dev/null |binary sw/qa/extras/ooxmlexport/ooxmlexport21.cxx | 21 --------------------- sw/qa/extras/ww8export/ww8export4.cxx | 7 ------- sw/source/filter/ww8/ww8graf.cxx | 11 ----------- sw/source/writerfilter/dmapper/GraphicImport.cxx | 7 ------- 5 files changed, 46 deletions(-)
New commits: commit 47bb0e2b7d0690f06150c7e110e6992f3d62bd10 Author: Justin Luth <jl...@mail.com> AuthorDate: Thu Sep 5 17:12:12 2024 +0200 Commit: Justin Luth <jl...@mail.com> CommitDate: Thu Sep 5 19:34:09 2024 +0200 Revert "tdf#162612 mso import NOT-layoutInCell: effectively are wrap-through" This reverts my 25.2 commit c8e272734a8fa26d93b057d1c9def8dc6c401143. Reason for revert: I found an example where wrapping does apply. In addition, wrap-through images are not restricted to the paper area, but in this case the shape should still be restricted. Needs more testing..., so just completely revert for now. Change-Id: I559942fee98f5693c90f7e16f65fefb7ecb9ab48 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172899 Reviewed-by: Justin Luth <jl...@mail.com> Tested-by: Jenkins diff --git a/sw/qa/extras/ooxmlexport/data/tdf162612_notLayoutInCell_notWrapThrough_contourOpaque.docx b/sw/qa/extras/ooxmlexport/data/tdf162612_notLayoutInCell_notWrapThrough_contourOpaque.docx deleted file mode 100644 index dae6163b2af3..000000000000 Binary files a/sw/qa/extras/ooxmlexport/data/tdf162612_notLayoutInCell_notWrapThrough_contourOpaque.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport21.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport21.cxx index a18c55327875..a7ceb3f03ab1 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport21.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport21.cxx @@ -14,7 +14,6 @@ #include <com/sun/star/beans/XPropertyState.hpp> #include <com/sun/star/drawing/FillStyle.hpp> #include <com/sun/star/text/RelOrientation.hpp> -#include <com/sun/star/text/WrapTextMode.hpp> #include <com/sun/star/text/XDocumentIndex.hpp> #include <com/sun/star/text/XTextTable.hpp> #include <com/sun/star/text/XTextField.hpp> @@ -724,26 +723,6 @@ DECLARE_OOXMLEXPORT_TEST(testTdf162551, "tdf162551_notLayoutInCell_charLeft_from CPPUNIT_ASSERT(getProperty<bool>(getShape(1), u"IsFollowingTextFlow"_ustr)); } -DECLARE_OOXMLEXPORT_TEST(testTdf162612, - "tdf162612_notLayoutInCell_notWrapThrough_contourOpaque.docx") -{ - // given cell B2 with a centered, tight-wrapped image that is NOT layoutInCell - // (but Microsoft doesn't wrap any text around it) - xmlDocUniquePtr pDump = parseLayoutDump(); - CPPUNIT_ASSERT_EQUAL(OUString("-anchor point-"), - getXPathContent(pDump, "//tab/row[2]/cell[2]/txt"_ostr)); - sal_Int32 nParaHeight - = getXPath(pDump, "//tab/row[2]/cell[2]/txt/infos/bounds"_ostr, "height"_ostr).toInt32(); - // text should not wrap as two lines(552) beside the shape. It is one line(276) behind the shape - CPPUNIT_ASSERT_EQUAL(sal_Int32(276), nParaHeight); - - // the image is over top of the text - CPPUNIT_ASSERT(getProperty<bool>(getShape(1), u"Opaque"_ustr)); - // image should be wrapThrough, not PARALLEL (despite being wp:wrapTight wrapText="bothSides") - CPPUNIT_ASSERT_EQUAL(text::WrapTextMode_THROUGH, - getProperty<text::WrapTextMode>(getShape(1), u"Surround"_ustr)); -} - CPPUNIT_TEST_FIXTURE(Test, testTdf159207_footerFramePrBorder) { loadFromFile(u"tdf159207_footerFramePrBorder.docx"); // re-imports as editeng Frame/Shape diff --git a/sw/qa/extras/ww8export/ww8export4.cxx b/sw/qa/extras/ww8export/ww8export4.cxx index b50bd53854d4..512b24667d22 100644 --- a/sw/qa/extras/ww8export/ww8export4.cxx +++ b/sw/qa/extras/ww8export/ww8export4.cxx @@ -209,13 +209,6 @@ DECLARE_WW8EXPORT_TEST(testTdf162541, "tdf162541_notLayoutInCell_paraLeft.doc") CPPUNIT_ASSERT(nShapeLeft < nParaLeft); // shape is located in column A, not column B CPPUNIT_ASSERT_EQUAL(nTableLeft, nShapeLeft); CPPUNIT_ASSERT(!getProperty<bool>(getShape(1), u"IsFollowingTextFlow"_ustr)); - - // tdf#162612 - // Note that this round-trip will "fix" the weird splitting table around the image... - - // image should be wrapThrough, not PARALLEL (despite being wrapTight on largest side) - CPPUNIT_ASSERT_EQUAL(text::WrapTextMode_THROUGH, - getProperty<text::WrapTextMode>(getShape(1), u"Surround"_ustr)); } DECLARE_WW8EXPORT_TEST(testTdf162542, "tdf162542_notLayoutInCell_charLeft_wrapThrough.doc") diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx index d499e22fac31..4708b4468329 100644 --- a/sw/source/filter/ww8/ww8graf.cxx +++ b/sw/source/filter/ww8/ww8graf.cxx @@ -2431,16 +2431,6 @@ RndStdIds SwWW8ImplReader::ProcessEscherAlign(SvxMSDffImportRec& rRecord, WW8_FS bIsObjectLayoutInTableCell = true; rFlySet.Put(SwFormatFollowTextFlow(true)); } - - // Microsoft strangely ignores all wrapping for not-layoutInCell objects - const SfxPoolItem* pItem; - if (SfxItemState::SET == rFlySet.GetItemState(RES_SURROUND, false, &pItem)) - { - const text::WrapTextMode eSurround - = static_cast<const SwFormatSurround*>(pItem)->GetSurround(); - if (eSurround != text::WrapTextMode_THROUGH) - rFlySet.Put(SwFormatSurround(text::WrapTextMode_THROUGH)); - } } // If the image is inline, then the relative orientation means nothing, @@ -2869,7 +2859,6 @@ SwFrameFormat* SwWW8ImplReader::Read_GrafLayer( tools::Long nGrafAnchorCp ) aFSFA.nby = WW8_FSPA::RelPageBorder; } - // this might also adjust previously set RES_SURROUND and RES_FOLLOW_TEXT_FLOW RndStdIds eAnchor = ProcessEscherAlign(*pRecord, aFSFA, aFlySet); // Should we, and is it possible to make this into a writer textbox diff --git a/sw/source/writerfilter/dmapper/GraphicImport.cxx b/sw/source/writerfilter/dmapper/GraphicImport.cxx index 90f717a5ac93..396508332e51 100644 --- a/sw/source/writerfilter/dmapper/GraphicImport.cxx +++ b/sw/source/writerfilter/dmapper/GraphicImport.cxx @@ -871,13 +871,6 @@ void GraphicImport::lcl_attribute(Id nName, const Value& rValue) { m_pImpl->m_nHoriRelation = text::RelOrientation::PAGE_PRINT_AREA; } - - // Microsoft strangely ignores all wrapping for not-layoutInCell objects - if (m_pImpl->m_nWrap != text::WrapTextMode_THROUGH - && m_pImpl->m_rGraphicImportType == IMPORT_AS_DETECTED_ANCHOR) - { - m_pImpl->m_nWrap = text::WrapTextMode_THROUGH; - } } // Is it a graphic image bool bUseShape = true;