From 0b03dff37f4cad722819f36d5cf3bd39fb46d8ed Mon Sep 17 00:00:00 2001 From: Justin Luth Date: Mon, 15 Jan 2024 14:36:12 -0500 Subject: tdf#159158 writerfilter: relativeHeight always under z-index No matter what z-index I chose, it always ends up being above a relativeHeight. Since a heaven z-index is 0+, that means that all relativeHeight's need to be treated as negative. IsInHeaderFooter is a complication, because these are ALWAYS treated as if they are below the text, and yet behindDoc relativeHeights still need to be below their counterparts. While this algorithm could never cover all the situations (it would require transitioning to a sal_Int64 to do that) it should be fine for practical purposes. Plus, there are some unknown complications surrounding this. If I increase the behindDoc relativeHeight by 1 in tdf159158_zOrder_behindDocB.docx the yellow star actually moves on top of the blue star, which totally debunks my theory. RTF doesn't really use relativeHeight, but if it did, these changes should apply anyway. Change-Id: I62e1f9ae8fe6f99534a2a799692120508204c553 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162234 Reviewed-by: Justin Luth Tested-by: Justin Luth Reviewed-by: Miklos Vajna --- sw/qa/extras/ooxmlexport/ooxmlexport18.cxx | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'sw') diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx index e7040b6d8d0b..5699ecbe7953 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx @@ -989,16 +989,15 @@ DECLARE_OOXMLEXPORT_TEST(testTdf159158_zOrder_zIndexWins, "tdf159158_zOrder_zInd CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty(zOrder0, "ZOrder")); // lower CPPUNIT_ASSERT_EQUAL(sal_Int32(1), getProperty(zOrder1, "ZOrder")); CPPUNIT_ASSERT_EQUAL(sal_Int32(2), getProperty(zOrder2, "ZOrder")); // higher - // If zOrder is defined by z-index, it seems that it goes above everything set by relativeHeight - if (isExported()) // not named on import - CPPUNIT_ASSERT_EQUAL_MESSAGE("DID YOU FIX ME? Frame1 really should be at the very top", - OUString("Frame1"), getProperty(zOrder0,"Name")); // I'm puzzled. Somehow 0 is larger than 0EFF FFFF, but not larger than 0F00 0000 // and yet the maximum value was established earlier as 1DFF FFFF. Something doesn't line up. // Perhaps 0 and 1 don't mean maximum value at all, but something completely different? CPPUNIT_ASSERT_MESSAGE("DID YOU FIX ME? I really should be yellow, not blue", - "5-Point Star Yellow" != getProperty(zOrder1, "Name")); - // CPPUNIT_ASSERT_EQUAL(OUString("5-Point Star Blue"), getProperty(zOrder2,"Name")); + "5-Point Star Yellow" != getProperty(zOrder0, "Name")); + // CPPUNIT_ASSERT_EQUAL(OUString("5-Point Star Blue"), getProperty(zOrder1,"Name")); + // If zOrder is defined by z-index, it seems that it goes above everything set by relativeHeight + if (isExported()) // not named on import + CPPUNIT_ASSERT_EQUAL(OUString("Frame1"), getProperty(zOrder2,"Name")); } DECLARE_OOXMLEXPORT_TEST(testTdf159158_zOrder_behindDocA, "tdf159158_zOrder_behindDocA.docx") -- cgit