From 41b012767feb8552b60a68c7be18d80c403304bf Mon Sep 17 00:00:00 2001 From: "Attila Bakos (NISZ)" Date: Tue, 5 Apr 2022 13:37:55 +0200 Subject: [PATCH] tdf#100680 sw DOCX compatibility: fix wrap of as_char flys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit New DOCX compatibility flag "WordLikeWrapForAsCharFlys" has been introduced which true in case of importing DOCX documents. It modifies the wrapping of long words with as_char anchored flys anchored into the same line, resulting e.g. correct import of poor man's header lines drawn by using underline characters under an image. Note: this example was imported as a broken header line: half of it was there after the left aligned image in the same line, and after the line break, only the other half under the image. Change-Id: I9474900ef778bcf5ddc9d95f39d536d67015f3b2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132571 Tested-by: László Németh Reviewed-by: László Németh --- sw/inc/IDocumentSettingAccess.hxx | 3 +++ sw/qa/extras/layout/data/tdf100680.docx | Bin 0 -> 25761 bytes sw/qa/extras/layout/layout2.cxx | 8 ++++++++ sw/source/core/doc/DocumentSettingManager.cxx | 8 +++++++- sw/source/core/inc/DocumentSettingManager.hxx | 2 ++ sw/source/core/text/portxt.cxx | 7 +++++-- sw/source/uibase/uno/SwXDocumentSettings.cxx | 16 ++++++++++++++++ writerfilter/source/filter/WriterFilter.cxx | 1 + 8 files changed, 42 insertions(+), 3 deletions(-) create mode 100644 sw/qa/extras/layout/data/tdf100680.docx diff --git a/sw/inc/IDocumentSettingAccess.hxx b/sw/inc/IDocumentSettingAccess.hxx index 7de8674c4d0f..4e434f20a3ee 100644 --- a/sw/inc/IDocumentSettingAccess.hxx +++ b/sw/inc/IDocumentSettingAccess.hxx @@ -119,6 +119,9 @@ 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 ooxlm than normally so in case of + // docx enable this flag. For details see ticket tdf#100680. + WRAP_AS_CHAR_FLYS_LIKE_IN_OOXML }; /** Provides access to settings of a document diff --git a/sw/qa/extras/layout/data/tdf100680.docx b/sw/qa/extras/layout/data/tdf100680.docx new file mode 100644 index 0000000000000000000000000000000000000000..c949540be3886713ef5ce3bdb357c1deb953f880 GIT binary patch literal 25761 zcmeFYWmH^Emj-$o2yTr94H{gU;K3aNAwX~l(71cBKxkZpySoQ>NN{%&G`J>#paFs< z_wc?mYrdK9n;&=G`(xIc>9xB1)Tydn_UvcxUFVdl5;6)AfC``k06+^2R*T@}K>$Dx z0{{pCbR>OgM+Y}^2R9=PFDG-?SDc>qb~O1YNX)qa5?KEKKL3knpfCBAZ4ZnnXR+sf4qSN3QWRh2jPp=Df&z zNz*L*j8r846Hyx8@paWF`nN-LF;Yruyb zSyPgF;L0#KaOOxMsIh1SWkw{&y0w?MI*mZR%El+Jva=un83VrS)TMVR8Tl4jlS90lG5PJd8a>Lx8v;WC~2 zLb`~CuCJ&}_+`On{`Z~8!UEE(Z*ck1nNJB*-maN)uh$b_9g`<(;zWGFn7cCU)xYWR z1d@U~inu-JoHnsDb}uaMM(7n;Mgk*si6bV-QR9AvrH*$I?y$;S?37?x)3Ho`Hf5+U z$adD8zf670lbgmpJ7=Sy{|2pGRQ6*CRoevFTTBb_+7up+*qENxx>tP~-xFG%yt83B zXD7FVaXrqAGpWQRKkk_R?p@GX(jOkoj**8E&UNEsVL+hwdoN;_Oq~CSR=2@u!;vEM zmE_sK)Q=u1E89y@H@;v202G`Q4@Va>E;C2d*Y=?KySICV$zL3nY4Agi*v_f6KE8mx ziB5W6$ZwMv`Als_48U5D<3@$N`Toh{xb=12>C-p0{GnIB$SekySEiC4{a_dSj0i7(4^3?OXozFV2+Y7Px!X-g3CAe7kVe`?i+p}yx9 z6kEiS(r2h7`L2%DeO^Pca8pM$8g~T7i{q@*VO_x7Ofq+)aw=LY8C)<3=d~DuM2R{@ zTRn@~8cg=*3SpnZ0eS5clxAUr=u)jdQcY=F^IYOgjYf5ro?{?xb#d8+(t3&M{Xm?B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YA=PPz5Y`0EKt_)!1`6$x~?@nwU+YAxI`vXhXNBnVXL~I<}Y7T>20z;uA z{Fw0^HjQl#hN0Jhf$TB*NM(&pV_W%PXdghh{Ohg%F!sTwvF%qdGzp-_IY$4nZfwI0 z3?0XOqUA@91=w|CI~-tWcD56B|B=Slq+{qpKst5Q@;@uozc=H*>%1|EvH*R~Q6g;B zH}*Theh3MZLRsoZ3hYOcuv1`f;bKy#%l}Amd_xx-$KGVY;LA!s@n2gm*f93g2?J~E z{eZD1QrH==2mhE1aL|tocY$B{_%#*4=1-0eF*FX&h5-)FZ(~Jl{NzpgIGzVShX1%_ YYp9$8zMT#q7o)|I0rt~XOb%cD2QZfYZ~y=R literal 0 HcmV?d00001 diff --git a/sw/qa/extras/layout/layout2.cxx b/sw/qa/extras/layout/layout2.cxx index 02b40c21b5ef..faf978d65f1e 100644 --- a/sw/qa/extras/layout/layout2.cxx +++ b/sw/qa/extras/layout/layout2.cxx @@ -93,6 +93,14 @@ void SwLayoutWriter2::CheckRedlineCharAttributesHidden() assertXPath(pXmlDoc, "/root/page[1]/body/txt[11]/Text[1]", "Portion", "foobaz"); } +CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf100680_as_char_wrap) +{ + createSwDoc(DATA_DIRECTORY, "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(DATA_DIRECTORY, "redline_charatr.fodt"); diff --git a/sw/source/core/doc/DocumentSettingManager.cxx b/sw/source/core/doc/DocumentSettingManager.cxx index 3e03097fb41f..851aec5b9e10 100644 --- a/sw/source/core/doc/DocumentSettingManager.cxx +++ b/sw/source/core/doc/DocumentSettingManager.cxx @@ -105,7 +105,8 @@ sw::DocumentSettingManager::DocumentSettingManager(SwDoc &rDoc) mbGutterAtTop(false), mbFootnoteInColumnToPageEnd(false), mnImagePreferredDPI(0), - mbAutoFirstLineIndentDisregardLineSpace(true) + mbAutoFirstLineIndentDisregardLineSpace(true), + mbWrapAsCharFlysLikeInOOXML(false) // COMPATIBILITY FLAGS END { @@ -244,6 +245,7 @@ bool sw::DocumentSettingManager::get(/*[in]*/ DocumentSettingId id) const case DocumentSettingId::FOOTNOTE_IN_COLUMN_TO_PAGEEND: return mbFootnoteInColumnToPageEnd; case DocumentSettingId::AUTO_FIRST_LINE_INDENT_DISREGARD_LINE_SPACE: return mbAutoFirstLineIndentDisregardLineSpace; + case DocumentSettingId::WRAP_AS_CHAR_FLYS_LIKE_IN_OOXML: return mbWrapAsCharFlysLikeInOOXML; default: OSL_FAIL("Invalid setting id"); } @@ -422,6 +424,10 @@ void sw::DocumentSettingManager::set(/*[in]*/ DocumentSettingId id, /*[in]*/ boo mbAutoFirstLineIndentDisregardLineSpace = value; break; + case DocumentSettingId::WRAP_AS_CHAR_FLYS_LIKE_IN_OOXML: + mbWrapAsCharFlysLikeInOOXML = value; + break; + // COMPATIBILITY FLAGS END case DocumentSettingId::BROWSE_MODE: //can be used temporary (load/save) when no SwViewShell is available diff --git a/sw/source/core/inc/DocumentSettingManager.hxx b/sw/source/core/inc/DocumentSettingManager.hxx index c687eb5939a5..b6656a934676 100644 --- a/sw/source/core/inc/DocumentSettingManager.hxx +++ b/sw/source/core/inc/DocumentSettingManager.hxx @@ -174,6 +174,8 @@ class DocumentSettingManager final : bool mbFootnoteInColumnToPageEnd; sal_Int32 mnImagePreferredDPI; bool mbAutoFirstLineIndentDisregardLineSpace; + // If this is on as_char flys wrapping will be handled the same like in Word + bool mbWrapAsCharFlysLikeInOOXML; public: diff --git a/sw/source/core/text/portxt.cxx b/sw/source/core/text/portxt.cxx index cf827ab6c3bf..140e29c168cc 100644 --- a/sw/source/core/text/portxt.cxx +++ b/sw/source/core/text/portxt.cxx @@ -419,8 +419,11 @@ 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() && + (aGuess.BreakPos() != rInf.GetLineStart() || bBreakLineIfHasFly) && ( !bFirstPor || rInf.GetFly() || rInf.GetLast()->IsFlyPortion() || rInf.IsFirstMulti() ) && ( !rInf.GetLast()->IsBlankPortion() || @@ -430,7 +433,7 @@ bool SwTextPortion::Format_( SwTextFormatInfo &rInf ) } else // case C2, last exit - BreakCut( rInf, aGuess ); + BreakCut(rInf, aGuess); } return bFull; diff --git a/sw/source/uibase/uno/SwXDocumentSettings.cxx b/sw/source/uibase/uno/SwXDocumentSettings.cxx index 4cfda7bbf3e4..49e6baeb4b28 100644 --- a/sw/source/uibase/uno/SwXDocumentSettings.cxx +++ b/sw/source/uibase/uno/SwXDocumentSettings.cxx @@ -152,6 +152,7 @@ enum SwDocumentSettingsPropertyHandles HANDLE_FOOTNOTE_IN_COLUMN_TO_PAGEEND, HANDLE_IMAGE_PREFERRED_DPI, HANDLE_AUTO_FIRST_LINE_INDENT_DISREGARD_LINE_SPACE, + HANDLE_WORD_LIKE_WRAP_FOR_AS_CHAR_FLYS }; } @@ -250,6 +251,7 @@ static rtl::Reference lcl_createSettingsInfo() { OUString("FootnoteInColumnToPageEnd"), HANDLE_FOOTNOTE_IN_COLUMN_TO_PAGEEND, cppu::UnoType::get(), 0 }, { OUString("ImagePreferredDPI"), HANDLE_IMAGE_PREFERRED_DPI, cppu::UnoType::get(), 0 }, { OUString("AutoFirstLineIndentDisregardLineSpace"), HANDLE_AUTO_FIRST_LINE_INDENT_DISREGARD_LINE_SPACE, cppu::UnoType::get(), 0 }, + { OUString("WordLikeWrapForAsCharFlys"), HANDLE_WORD_LIKE_WRAP_FOR_AS_CHAR_FLYS, cppu::UnoType::get(), 0 }, /* * As OS said, we don't have a view when we need to set this, so I have to @@ -1051,6 +1053,14 @@ void SwXDocumentSettings::_setSingleValue( const comphelper::PropertyInfo & rInf } } break; + case HANDLE_WORD_LIKE_WRAP_FOR_AS_CHAR_FLYS: + { + bool bValue = false; + if (rValue >>= bValue) + mpDoc->getIDocumentSettingAccess().set( + DocumentSettingId::WRAP_AS_CHAR_FLYS_LIKE_IN_OOXML, bValue); + } + break; default: throw UnknownPropertyException(OUString::number(rInfo.mnHandle)); } @@ -1574,6 +1584,12 @@ void SwXDocumentSettings::_getSingleValue( const comphelper::PropertyInfo & rInf DocumentSettingId::AUTO_FIRST_LINE_INDENT_DISREGARD_LINE_SPACE); } break; + case HANDLE_WORD_LIKE_WRAP_FOR_AS_CHAR_FLYS: + { + rValue <<= mpDoc->getIDocumentSettingAccess().get( + DocumentSettingId::WRAP_AS_CHAR_FLYS_LIKE_IN_OOXML); + } + break; default: throw UnknownPropertyException(OUString::number(rInfo.mnHandle)); } diff --git a/writerfilter/source/filter/WriterFilter.cxx b/writerfilter/source/filter/WriterFilter.cxx index 945a00f95258..5b87cb8f4e0a 100644 --- a/writerfilter/source/filter/WriterFilter.cxx +++ b/writerfilter/source/filter/WriterFilter.cxx @@ -331,6 +331,7 @@ void WriterFilter::setTargetDocument(const uno::Reference& xDo xSettings->setPropertyValue("PropLineSpacingShrinksFirstLine", uno::makeAny(true)); xSettings->setPropertyValue("DoNotCaptureDrawObjsOnPage", uno::makeAny(true)); xSettings->setPropertyValue("DisableOffPagePositioning", uno::makeAny(true)); + xSettings->setPropertyValue("WordLikeWrapForAsCharFlys", uno::makeAny(true)); } void WriterFilter::setSourceDocument(const uno::Reference& xDoc)