summaryrefslogtreecommitdiff
path: root/sc/qa/unit/subsequent_export-test.cxx
diff options
context:
space:
mode:
authorMaxim Monastirsky <momonasmon@gmail.com>2021-02-07 17:42:27 +0200
committerEike Rathke <erack@redhat.com>2021-05-13 18:26:12 +0200
commita796aa9d65e3d4292232820d424b3f62c673fa07 (patch)
tree5c931cb8b44bca89b27753844630b3027764af31 /sc/qa/unit/subsequent_export-test.cxx
parenta5bdce555ad7e5bd480c7bd63159869b7a9bc3d3 (diff)
tdf#112559 sc: Expose font height via the Defaults UNO API
This fixes both ODF import and export of the default cell style. Change-Id: I776591c6ed932a136b95107d3c4a0f25c1bebdf1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110539 Tested-by: Jenkins Reviewed-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'sc/qa/unit/subsequent_export-test.cxx')
-rw-r--r--sc/qa/unit/subsequent_export-test.cxx26
1 files changed, 26 insertions, 0 deletions
diff --git a/sc/qa/unit/subsequent_export-test.cxx b/sc/qa/unit/subsequent_export-test.cxx
index 01cf0a236a24..4864266b8790 100644
--- a/sc/qa/unit/subsequent_export-test.cxx
+++ b/sc/qa/unit/subsequent_export-test.cxx
@@ -57,6 +57,7 @@
#include <editeng/borderline.hxx>
#include <editeng/escapementitem.hxx>
#include <editeng/fontitem.hxx>
+#include <editeng/fhgtitem.hxx>
#include <editeng/udlnitem.hxx>
#include <editeng/flditem.hxx>
#include <editeng/colritem.hxx>
@@ -89,6 +90,7 @@ public:
virtual void tearDown() override;
void test();
+ void testDefaultFontHeight();
void testTdf139167();
void testTdf113271();
void testTdf139394();
@@ -293,6 +295,7 @@ public:
CPPUNIT_TEST_SUITE(ScExportTest);
CPPUNIT_TEST(test);
+ CPPUNIT_TEST(testDefaultFontHeight);
CPPUNIT_TEST(testTdf139167);
CPPUNIT_TEST(testTdf113271);
CPPUNIT_TEST(testTdf139394);
@@ -544,6 +547,29 @@ void ScExportTest::test()
xDocSh->DoClose();
}
+void ScExportTest::testDefaultFontHeight()
+{
+ ScDocShellRef xDocSh = new ScDocShell;
+ xDocSh->DoInitNew();
+
+ ScDocumentPool* pPool = xDocSh->GetDocument().GetPool();
+ pPool->SetPoolDefaultItem(SvxFontHeightItem(400, 100, ATTR_FONT_HEIGHT));
+ pPool->SetPoolDefaultItem(SvxFontHeightItem(400, 100, ATTR_CJK_FONT_HEIGHT));
+ pPool->SetPoolDefaultItem(SvxFontHeightItem(400, 100, ATTR_CTL_FONT_HEIGHT));
+
+ xDocSh = saveAndReload(xDocSh.get(), FORMAT_ODS);
+
+ pPool = xDocSh->GetDocument().GetPool();
+ const SvxFontHeightItem& rItem = pPool->GetDefaultItem(ATTR_FONT_HEIGHT);
+ CPPUNIT_ASSERT_EQUAL(sal_uInt32(400), rItem.GetHeight());
+ const SvxFontHeightItem& rCJKItem = pPool->GetDefaultItem(ATTR_CJK_FONT_HEIGHT);
+ CPPUNIT_ASSERT_EQUAL(sal_uInt32(400), rCJKItem.GetHeight());
+ const SvxFontHeightItem& rCTLItem = pPool->GetDefaultItem(ATTR_CTL_FONT_HEIGHT);
+ CPPUNIT_ASSERT_EQUAL(sal_uInt32(400), rCTLItem.GetHeight());
+
+ xDocSh->DoClose();
+}
+
void ScExportTest::testTdf139167()
{
ScDocShellRef xShell = loadDoc(u"tdf139167.", FORMAT_XLSX);