[Libreoffice-commits] core.git: sc/qa

Markus Mohrhard markus.mohrhard at googlemail.com
Wed Jun 28 14:51:31 UTC 2017


 sc/qa/unit/data/xlsx/page_scale.xlsx   |binary
 sc/qa/unit/subsequent_filters-test.cxx |   20 ++++++++++++++++++++
 2 files changed, 20 insertions(+)

New commits:
commit be00e2a73d10483b675a080f4899f8bf85d331db
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Wed Jun 28 04:17:57 2017 +0200

    add test for tdf#65848
    
    Change-Id: I6a75fdf0eb615a80d76f9298d3dad8ecbec7c66e
    Reviewed-on: https://gerrit.libreoffice.org/39335
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>

diff --git a/sc/qa/unit/data/xlsx/page_scale.xlsx b/sc/qa/unit/data/xlsx/page_scale.xlsx
new file mode 100644
index 000000000000..070f218d6d04
Binary files /dev/null and b/sc/qa/unit/data/xlsx/page_scale.xlsx differ
diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx
index 38e83104aa83..d41e0eb0a912 100644
--- a/sc/qa/unit/subsequent_filters-test.cxx
+++ b/sc/qa/unit/subsequent_filters-test.cxx
@@ -238,6 +238,8 @@ public:
     void testTdf100709XLSX();
     void testTdf97598XLSX();
 
+    void testPageScalingXLSX();
+
     CPPUNIT_TEST_SUITE(ScFiltersTest);
     CPPUNIT_TEST(testBooleanFormatXLSX);
     CPPUNIT_TEST(testBasicCellContentODS);
@@ -358,6 +360,8 @@ public:
     CPPUNIT_TEST(testTdf100709XLSX);
     CPPUNIT_TEST(testTdf97598XLSX);
 
+    CPPUNIT_TEST(testPageScalingXLSX);
+
     CPPUNIT_TEST_SUITE_END();
 
 private:
@@ -3892,6 +3896,22 @@ void ScFiltersTest::testCondFormatXLSB()
     xDocSh->DoClose();
 }
 
+void ScFiltersTest::testPageScalingXLSX()
+{
+    ScDocShellRef xDocSh = loadDoc("page_scale.", FORMAT_XLSX);
+    ScDocument& rDoc = xDocSh->GetDocument();
+
+    OUString aStyleName = rDoc.GetPageStyle(0);
+    ScStyleSheetPool* pStylePool = rDoc.GetStyleSheetPool();
+    SfxStyleSheetBase* pStyleSheet = pStylePool->Find( aStyleName, SfxStyleFamily::Page );
+    CPPUNIT_ASSERT(pStyleSheet);
+
+    SfxItemSet& rSet = pStyleSheet->GetItemSet();
+    sal_uInt16 nVal = static_cast<const SfxUInt16Item&>(rSet.Get(ATTR_PAGE_SCALE)).GetValue();
+    CPPUNIT_ASSERT_EQUAL(sal_uInt16(90), nVal);
+
+    xDocSh->DoClose();
+}
 
 ScFiltersTest::ScFiltersTest()
       : ScBootstrapFixture( "sc/qa/unit/data" )


More information about the Libreoffice-commits mailing list