summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorJustin Luth <jluth@mail.com>2024-08-21 13:27:01 -0400
committerJustin Luth <jluth@mail.com>2024-08-24 14:31:52 +0200
commit77bbf007cd9db81c141bb123b83aac72c13a436f (patch)
treec6aef37d028a6960c565f24c91135c2474907f78 /sw
parentc63cce999629ef1aedfa688d1ef8753e13020c36 (diff)
tdf#162542 doc import NOT-layoutInCell: do not change char into margin
It was simply wrong to equate an char-orientation with a page margin orientation. make CppunitTest_sw_ww8export4 CPPUNIT_TEST_NAME=testTdf162542 Change-Id: I08f1449bfbb8e24311bc77e164d3fa57f25ee35f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172217 Reviewed-by: Justin Luth <jluth@mail.com> Tested-by: Jenkins
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/ww8export/data/tdf162542_notLayoutInCell_charLeft_wrapThrough.docbin0 -> 73216 bytes
-rw-r--r--sw/qa/extras/ww8export/ww8export4.cxx23
-rw-r--r--sw/source/filter/ww8/ww8graf.cxx4
3 files changed, 25 insertions, 2 deletions
diff --git a/sw/qa/extras/ww8export/data/tdf162542_notLayoutInCell_charLeft_wrapThrough.doc b/sw/qa/extras/ww8export/data/tdf162542_notLayoutInCell_charLeft_wrapThrough.doc
new file mode 100644
index 000000000000..e6100c7eabcf
--- /dev/null
+++ b/sw/qa/extras/ww8export/data/tdf162542_notLayoutInCell_charLeft_wrapThrough.doc
Binary files differ
diff --git a/sw/qa/extras/ww8export/ww8export4.cxx b/sw/qa/extras/ww8export/ww8export4.cxx
index 2eb0584c1be6..1266a2a06977 100644
--- a/sw/qa/extras/ww8export/ww8export4.cxx
+++ b/sw/qa/extras/ww8export/ww8export4.cxx
@@ -191,6 +191,29 @@ DECLARE_WW8EXPORT_TEST(testTdf91632_layoutInCellD, "tdf91632_layoutInCellD.doc")
CPPUNIT_ASSERT(getProperty<bool>(xShape2, u"IsFollowingTextFlow"_ustr));
}
+DECLARE_WW8EXPORT_TEST(testTdf162542, "tdf162542_notLayoutInCell_charLeft_wrapThrough.doc")
+{
+ // given cell B2 with a char-oriented-left wrapThrough image that is NOT layoutInCell
+ xmlDocUniquePtr pDump = parseLayoutDump();
+ sal_Int32 nShapeLeft
+ = getXPath(pDump, "//tab/row[2]/cell[2]/txt[6]/anchored/fly/SwAnchoredObject/bounds"_ostr,
+ "left"_ostr)
+ .toInt32();
+ sal_Int32 nPara6Left
+ = getXPath(pDump, "//tab/row[2]/cell[2]/txt[6]/infos/bounds"_ostr, "left"_ostr).toInt32();
+ CPPUNIT_ASSERT(nShapeLeft > nPara6Left); // nShapeLeft starts after the word "anchor"
+
+ // sal_Int32 nShapeTop
+ // = getXPath(pDump, "//tab/row[2]/cell[2]/txt[6]/anchored/fly/SwAnchoredObject/bounds"_ostr,
+ // "top"_ostr)
+ // .toInt32();
+ // sal_Int32 nPara1Top
+ // = getXPath(pDump, "//tab/row[2]/cell[2]/txt[1]/infos/bounds"_ostr, "top"_ostr).toInt32();
+ // CPPUNIT_ASSERT_EQUAL(nPara1Top, nShapeTop); // nShapeTop starts at the cell margin"
+
+ CPPUNIT_ASSERT(!getProperty<bool>(getShape(1), u"IsFollowingTextFlow"_ustr));
+}
+
CPPUNIT_TEST_FIXTURE(Test, testEndnotesAtSectEndDOC)
{
// Given a document, endnotes at collected at section end:
diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx
index 8e520c8a5ea1..7b18ebdb7754 100644
--- a/sw/source/filter/ww8/ww8graf.cxx
+++ b/sw/source/filter/ww8/ww8graf.cxx
@@ -2463,13 +2463,13 @@ RndStdIds SwWW8ImplReader::ProcessEscherAlign(SvxMSDffImportRec& rRecord, WW8_FS
}
// if the object is anchored inside a table cell, is horizontal aligned
- // at frame|character and has wrap through, but its attribute
+ // at frame and has wrap through, but its attribute
// 'layout in table cell' isn't set, convert its horizontal alignment to page text area.
// #i84783# - use new method <IsObjectLayoutInTableCell()>
const bool bIsObjectLayoutInTableCell
= m_nInTable && IsObjectLayoutInTableCell(rRecord.nGroupShapeBooleanProperties);
if (!bIsObjectLayoutInTableCell && m_nInTable &&
- (eHoriRel == text::RelOrientation::FRAME || eHoriRel == text::RelOrientation::CHAR) &&
+ (eHoriRel == text::RelOrientation::FRAME) &&
rFSPA.nwr == 3)
{
eHoriRel = text::RelOrientation::PAGE_PRINT_AREA;