sw/qa/extras/rtfexport/rtfexport2.cxx |   25 +++++++++----------------
 1 file changed, 9 insertions(+), 16 deletions(-)

New commits:
commit 1d2c42037c6704122581c2c6f0dd9d7979f49211
Author:     Justin Luth <jl...@mail.com>
AuthorDate: Mon Jul 15 15:40:20 2024 -0400
Commit:     Justin Luth <jl...@mail.com>
CommitDate: Tue Jul 16 05:26:27 2024 +0200

    tdf#158977: restore disabled rtfexport2 testFdo44176
    
    Some unit tests were disabled with
        tdf#136472 adjust ooxml import to handle first header/footer
    
    This unit test seems pointless currently,
    but apparently back in 3.5 days it means something.
    The point is that the header space on the two pages
    is supposed to be identical, which measureably
    means that the body area of the pages should be identical.
    
    Adapted to try to keep the test alive and potentially relevant.
    
    Change-Id: I9e03839a9a755ad604269ff46bdd556e8cae4393
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170533
    Tested-by: Jenkins
    Reviewed-by: Justin Luth <jl...@mail.com>

diff --git a/sw/qa/extras/rtfexport/rtfexport2.cxx 
b/sw/qa/extras/rtfexport/rtfexport2.cxx
index 03cca0a40ee9..49bedd63213a 100644
--- a/sw/qa/extras/rtfexport/rtfexport2.cxx
+++ b/sw/qa/extras/rtfexport/rtfexport2.cxx
@@ -354,27 +354,20 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo47107)
     verify();
 }
 
-// TODO - First Page Headers Support
-// This assumption is false now - we only have "Standard" page style, which 
should have properties properly set
-/*CPPUNIT_TEST_FIXTURE(Test, testFdo44176)
-{
-    auto verify = [this]() {
-        uno::Reference<container::XNameAccess> 
xPageStyles(getStyles("PageStyles"));
-        uno::Reference<beans::XPropertySet> 
xFirstPage(xPageStyles->getByName("First Page"),
-                                                       uno::UNO_QUERY);
-        uno::Reference<beans::XPropertySet> 
xDefault(xPageStyles->getByName("Standard"),
-                                                     uno::UNO_QUERY);
-        sal_Int32 nFirstTop = 0, nDefaultTop = 0, nDefaultHeader = 0;
-        xFirstPage->getPropertyValue("TopMargin") >>= nFirstTop;
-        xDefault->getPropertyValue("TopMargin") >>= nDefaultTop;
-        xDefault->getPropertyValue("HeaderHeight") >>= nDefaultHeader;
-        CPPUNIT_ASSERT_EQUAL(nFirstTop, nDefaultTop + nDefaultHeader);
+CPPUNIT_TEST_FIXTURE(Test, testFdo44176)
+{
+    auto verify = [this]() {
+        // given a document with an empty first header, and a non-empty follow 
header,
+        // ensure that the body text space is equal on the first and follow 
page
+        // (since in this case the default margins are large enough to fully 
include the header)
+        const OUString sBodyHeight = parseDump("//page[1]/body/infos"_ostr, 
"height"_ostr);
+        CPPUNIT_ASSERT_EQUAL(sBodyHeight, 
parseDump("//page[2]/body/infos"_ostr, "height"_ostr));
     };
     createSwDoc("fdo44176.rtf");
     verify();
     saveAndReload(mpFilter);
     verify();
-}*/
+}
 
 CPPUNIT_TEST_FIXTURE(Test, testFdo39053)
 {

Reply via email to