diff options
author | Andreas Heinisch <andreas.heinisch@yahoo.de> | 2022-05-08 14:31:00 +0200 |
---|---|---|
committer | Andreas Heinisch <andreas.heinisch@yahoo.de> | 2022-05-10 20:30:56 +0200 |
commit | ad79900cd62c487bda9d2515892d62b3b08a5dfa (patch) | |
tree | 68db852861aa90cee6f0af6f30930a04e06d5ba8 /sc/qa | |
parent | adb5eca79f3ae0c80c8046e73d7a411734a1b75d (diff) |
tdf#108188, tdf#131190 - Verify that the page style is actually used
Change-Id: I007d26c6fcaf60d2a2378cc00e630da447f95a8a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134022
Tested-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
Diffstat (limited to 'sc/qa')
-rw-r--r-- | sc/qa/unit/bugfix-test.cxx | 21 | ||||
-rw-r--r-- | sc/qa/unit/data/ods/tdf108188_pagestyle.ods | bin | 0 -> 7890 bytes |
2 files changed, 21 insertions, 0 deletions
diff --git a/sc/qa/unit/bugfix-test.cxx b/sc/qa/unit/bugfix-test.cxx index 3b3cc27439df..2975b0b0a834 100644 --- a/sc/qa/unit/bugfix-test.cxx +++ b/sc/qa/unit/bugfix-test.cxx @@ -29,6 +29,7 @@ #include <svx/svdpage.hxx> #include <svx/svdomeas.hxx> #include <userdat.hxx> +#include <stlpool.hxx> using namespace ::com::sun::star; using namespace ::com::sun::star::uno; @@ -63,6 +64,7 @@ public: void testTdf129789(); void testTdf130725(); void testTdf104502_hiddenColsCountedInPageCount(); + void testTdf108188_pagestyle(); CPPUNIT_TEST_SUITE(ScFiltersTest); CPPUNIT_TEST(testTdf137576_Measureline); @@ -87,6 +89,7 @@ public: CPPUNIT_TEST(testTdf129789); CPPUNIT_TEST(testTdf130725); CPPUNIT_TEST(testTdf104502_hiddenColsCountedInPageCount); + CPPUNIT_TEST(testTdf108188_pagestyle); CPPUNIT_TEST_SUITE_END(); private: @@ -726,6 +729,24 @@ void ScFiltersTest::testTdf104502_hiddenColsCountedInPageCount() xShell->DoClose(); } +void ScFiltersTest::testTdf108188_pagestyle() +{ + ScDocShellRef xDocSh = loadDoc(u"tdf108188_pagestyle.", FORMAT_ODS); + CPPUNIT_ASSERT(xDocSh); + + // Check if the user defined page style is present + const OUString aTestPageStyle = "TestPageStyle"; + ScDocument& rDoc = xDocSh->GetDocument(); + CPPUNIT_ASSERT_EQUAL(aTestPageStyle, rDoc.GetPageStyle(0)); + + // Without the accompanying fix in place, the page styles are always used + ScStyleSheetPool* pStylePool = rDoc.GetStyleSheetPool(); + CPPUNIT_ASSERT(pStylePool->Find(aTestPageStyle, SfxStyleFamily::Page)->IsUsed()); + CPPUNIT_ASSERT(!pStylePool->Find("Default", SfxStyleFamily::Page)->IsUsed()); + + xDocSh->DoClose(); +} + ScFiltersTest::ScFiltersTest() : ScBootstrapFixture( "sc/qa/unit/data" ) diff --git a/sc/qa/unit/data/ods/tdf108188_pagestyle.ods b/sc/qa/unit/data/ods/tdf108188_pagestyle.ods Binary files differnew file mode 100644 index 000000000000..d0ecf9f88453 --- /dev/null +++ b/sc/qa/unit/data/ods/tdf108188_pagestyle.ods |