tdf#152046 Revert "tdf#100680 sw DOCX compatibility: fix wrap of as_char flys"
This reverts 7.4 commit 41b012767feb8552b60a68c7be18d80c403304bf,
The premiss of the commit is that as-char flies needed to be handled differently,
and yet at the spot where it was implemented, we have no idea whether we
are even dealing with an as-char fly!!!
As this bug report report shows, it affects paragraphy that don't
have any fly whatsoever, let alone an as-char fly.
Change-Id: I2fedb2d610093933081e861a16a25de2f2716258
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152780
Reviewed-by: Justin Luth <jluth@mail.com>
Tested-by: Jenkins
diff --git a/sw/inc/IDocumentSettingAccess.hxx b/sw/inc/IDocumentSettingAccess.hxx
index e891a2b..7059583 100644
--- a/sw/inc/IDocumentSettingAccess.hxx
+++ b/sw/inc/IDocumentSettingAccess.hxx
@@ -120,9 +120,6 @@ enum class DocumentSettingId
// footnoteContainer default position is the page end instead of the column end
// only if "evenly distributed" is set, and "collected at the end" is not set
FOOTNOTE_IN_COLUMN_TO_PAGEEND,
// AsChar anchored flys wrapped differently in ooxml than normally so in case of
// docx enable this flag. For details see ticket tdf#100680.
WRAP_AS_CHAR_FLYS_LIKE_IN_OOXML,
// Should we display follow by symbol for numbered paragraph if numbering exists, but "None"?
NO_NUMBERING_SHOW_FOLLOWBY,
// drop cap punctuation: smaller dashes, bullet, asterisks, quotation marks etc.
diff --git a/sw/qa/extras/layout/data/tdf100680.docx b/sw/qa/extras/layout/data/tdf100680.docx
deleted file mode 100644
index c949540..0000000
--- a/sw/qa/extras/layout/data/tdf100680.docx
+++ /dev/null
Binary files differ
diff --git a/sw/qa/extras/layout/layout2.cxx b/sw/qa/extras/layout/layout2.cxx
index ea2da49..38bc549 100644
--- a/sw/qa/extras/layout/layout2.cxx
+++ b/sw/qa/extras/layout/layout2.cxx
@@ -137,14 +137,6 @@ void SwLayoutWriter2::CheckRedlineCharAttributesHidden()
"portion", "foobaz");
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf100680_as_char_wrap)
{
createSwDoc("tdf100680.docx");
auto pDump = parseLayoutDump();
assertXPath(pDump, "/root/page/header/txt/SwParaPortion/SwLineLayout[3]");
// If the third line missing that assert will fire, as was before the fix.
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testRedlineCharAttributes)
{
createSwDoc("redline_charatr.fodt");
diff --git a/sw/source/core/doc/DocumentSettingManager.cxx b/sw/source/core/doc/DocumentSettingManager.cxx
index da04446..7cba681 100644
--- a/sw/source/core/doc/DocumentSettingManager.cxx
+++ b/sw/source/core/doc/DocumentSettingManager.cxx
@@ -106,7 +106,6 @@ sw::DocumentSettingManager::DocumentSettingManager(SwDoc &rDoc)
mbFootnoteInColumnToPageEnd(false),
mnImagePreferredDPI(0),
mbAutoFirstLineIndentDisregardLineSpace(true),
mbWrapAsCharFlysLikeInOOXML(false),
mbNoNumberingShowFollowBy(false),
mbDropCapPunctuation(true)
@@ -248,7 +247,6 @@ bool sw::DocumentSettingManager::get(/*[in]*/ DocumentSettingId id) const
case DocumentSettingId::AUTO_FIRST_LINE_INDENT_DISREGARD_LINE_SPACE:
return mbAutoFirstLineIndentDisregardLineSpace;
case DocumentSettingId::HYPHENATE_URLS: return mbHyphenateURLs;
case DocumentSettingId::WRAP_AS_CHAR_FLYS_LIKE_IN_OOXML: return mbWrapAsCharFlysLikeInOOXML;
case DocumentSettingId::NO_NUMBERING_SHOW_FOLLOWBY: return mbNoNumberingShowFollowBy;
case DocumentSettingId::DROP_CAP_PUNCTUATION: return mbDropCapPunctuation;
default:
@@ -433,10 +431,6 @@ void sw::DocumentSettingManager::set(/*[in]*/ DocumentSettingId id, /*[in]*/ boo
mbHyphenateURLs = value;
break;
case DocumentSettingId::WRAP_AS_CHAR_FLYS_LIKE_IN_OOXML:
mbWrapAsCharFlysLikeInOOXML = value;
break;
case DocumentSettingId::NO_NUMBERING_SHOW_FOLLOWBY:
mbNoNumberingShowFollowBy = value;
break;
diff --git a/sw/source/core/inc/DocumentSettingManager.hxx b/sw/source/core/inc/DocumentSettingManager.hxx
index 07a12e3..3fdb3c7 100644
--- a/sw/source/core/inc/DocumentSettingManager.hxx
+++ b/sw/source/core/inc/DocumentSettingManager.hxx
@@ -176,7 +176,6 @@ class DocumentSettingManager final :
bool mbAutoFirstLineIndentDisregardLineSpace;
bool mbHyphenateURLs = false;
// If this is on as_char flys wrapping will be handled the same like in Word
bool mbWrapAsCharFlysLikeInOOXML;
bool mbNoNumberingShowFollowBy;
bool mbDropCapPunctuation; // tdf#150200, tdf#150438
diff --git a/sw/source/core/text/portxt.cxx b/sw/source/core/text/portxt.cxx
index 89df5fc..7d27d4a 100644
--- a/sw/source/core/text/portxt.cxx
+++ b/sw/source/core/text/portxt.cxx
@@ -422,11 +422,8 @@ bool SwTextPortion::Format_( SwTextFormatInfo &rInf )
else
{
bool bFirstPor = rInf.GetLineStart() == rInf.GetIdx();
const bool bBreakLineIfHasFly
= rInf.GetTextFrame()->GetDoc().getIDocumentSettingAccess().get(
DocumentSettingId::WRAP_AS_CHAR_FLYS_LIKE_IN_OOXML);
if (aGuess.BreakPos() != TextFrameIndex(COMPLETE_STRING) &&
(aGuess.BreakPos() != rInf.GetLineStart() || bBreakLineIfHasFly) &&
aGuess.BreakPos() != rInf.GetLineStart() &&
( !bFirstPor || rInf.GetFly() || rInf.GetLast()->IsFlyPortion() ||
rInf.IsFirstMulti() ) &&
( !rInf.GetLast()->IsBlankPortion() ||
diff --git a/sw/source/uibase/uno/SwXDocumentSettings.cxx b/sw/source/uibase/uno/SwXDocumentSettings.cxx
index 9ce8dda..ddb4d63 100644
--- a/sw/source/uibase/uno/SwXDocumentSettings.cxx
+++ b/sw/source/uibase/uno/SwXDocumentSettings.cxx
@@ -153,7 +153,6 @@ enum SwDocumentSettingsPropertyHandles
HANDLE_IMAGE_PREFERRED_DPI,
HANDLE_AUTO_FIRST_LINE_INDENT_DISREGARD_LINE_SPACE,
HANDLE_HYPHENATE_URLS,
HANDLE_WORD_LIKE_WRAP_FOR_AS_CHAR_FLYS,
HANDLE_NO_NUMBERING_SHOW_FOLLOWBY,
HANDLE_DROP_CAP_PUNCTUATION
};
@@ -255,7 +254,6 @@ static rtl::Reference<MasterPropertySetInfo> lcl_createSettingsInfo()
{ OUString("ImagePreferredDPI"), HANDLE_IMAGE_PREFERRED_DPI, cppu::UnoType<sal_Int32>::get(), 0 },
{ OUString("AutoFirstLineIndentDisregardLineSpace"), HANDLE_AUTO_FIRST_LINE_INDENT_DISREGARD_LINE_SPACE, cppu::UnoType<bool>::get(), 0 },
{ OUString("HyphenateURLs"), HANDLE_HYPHENATE_URLS, cppu::UnoType<bool>::get(), 0 },
{ OUString("WordLikeWrapForAsCharFlys"), HANDLE_WORD_LIKE_WRAP_FOR_AS_CHAR_FLYS, cppu::UnoType<bool>::get(), 0 },
{ OUString("NoNumberingShowFollowBy"), HANDLE_NO_NUMBERING_SHOW_FOLLOWBY, cppu::UnoType<bool>::get(), 0 },
{ OUString("DropCapPunctuation"), HANDLE_DROP_CAP_PUNCTUATION, cppu::UnoType<bool>::get(), 0 },
@@ -1068,14 +1066,6 @@ void SwXDocumentSettings::_setSingleValue( const comphelper::PropertyInfo & rInf
}
}
break;
case HANDLE_WORD_LIKE_WRAP_FOR_AS_CHAR_FLYS:
{
bool bTmp;
if (rValue >>= bTmp)
mpDoc->getIDocumentSettingAccess().set(
DocumentSettingId::WRAP_AS_CHAR_FLYS_LIKE_IN_OOXML, bTmp);
}
break;
case HANDLE_NO_NUMBERING_SHOW_FOLLOWBY:
{
bool bTmp;
@@ -1620,12 +1610,6 @@ void SwXDocumentSettings::_getSingleValue( const comphelper::PropertyInfo & rInf
DocumentSettingId::HYPHENATE_URLS);
}
break;
case HANDLE_WORD_LIKE_WRAP_FOR_AS_CHAR_FLYS:
{
rValue <<= mpDoc->getIDocumentSettingAccess().get(
DocumentSettingId::WRAP_AS_CHAR_FLYS_LIKE_IN_OOXML);
}
break;
case HANDLE_NO_NUMBERING_SHOW_FOLLOWBY:
{
rValue <<= mpDoc->getIDocumentSettingAccess().get(
diff --git a/writerfilter/source/filter/WriterFilter.cxx b/writerfilter/source/filter/WriterFilter.cxx
index 3ac82d7..0b3d86b 100644
--- a/writerfilter/source/filter/WriterFilter.cxx
+++ b/writerfilter/source/filter/WriterFilter.cxx
@@ -331,7 +331,6 @@ void WriterFilter::setTargetDocument(const uno::Reference<lang::XComponent>& xDo
xSettings->setPropertyValue("PropLineSpacingShrinksFirstLine", uno::Any(true));
xSettings->setPropertyValue("DoNotCaptureDrawObjsOnPage", uno::Any(true));
xSettings->setPropertyValue("DisableOffPagePositioning", uno::Any(true));
xSettings->setPropertyValue("WordLikeWrapForAsCharFlys", uno::Any(true));
xSettings->setPropertyValue("DropCapPunctuation", uno::Any(true));
// rely on default for HyphenateURLs=false
}