summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorSzymon Kłos <szymon.klos@collabora.com>2018-02-13 17:47:23 +0100
committerAndras Timar <andras.timar@collabora.com>2018-02-19 09:19:42 +0100
commit04040bd9e4b8cf52dc75b7d4510c6fc1d104896a (patch)
tree255214243049fcf16c0e6fe4968095b7ba60cd51 /sd
parent1104be609f2847387da2da16c4dd1be624f1c858 (diff)
PPTX export scale for TextFitToSize
MSO requires to save fontScale attribute to have all the text shown properly (with FitToSize property) Values are approximated, after any modification in MSO scale is recalculated. Squashed: 7a510effa4566d405d2033b6635b42c08d34dec8 2c2919cb591d88b11bb2e25e45d6f75923821457 Change-Id: I73657fdd663b540b436747cfeeef3c76e8fe388c Reviewed-on: https://gerrit.libreoffice.org/49742 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Szymon Kłos <szymon.klos@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/49917 Reviewed-by: Andras Timar <andras.timar@collabora.com> Tested-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'sd')
-rw-r--r--sd/qa/unit/data/pptx/font-scale.pptxbin0 -> 40239 bytes
-rw-r--r--sd/qa/unit/export-tests-ooxml2.cxx17
2 files changed, 17 insertions, 0 deletions
diff --git a/sd/qa/unit/data/pptx/font-scale.pptx b/sd/qa/unit/data/pptx/font-scale.pptx
new file mode 100644
index 000000000000..df33b20cebca
--- /dev/null
+++ b/sd/qa/unit/data/pptx/font-scale.pptx
Binary files differ
diff --git a/sd/qa/unit/export-tests-ooxml2.cxx b/sd/qa/unit/export-tests-ooxml2.cxx
index 80518487b96a..7cfb05b3228a 100644
--- a/sd/qa/unit/export-tests-ooxml2.cxx
+++ b/sd/qa/unit/export-tests-ooxml2.cxx
@@ -125,6 +125,7 @@ public:
void testGroupsRotatedPosition();
void testAccentColor();
void testTdf114848();
+ void testFontScale();
void testTdf115394();
void testTdf115394Zero();
@@ -173,6 +174,7 @@ public:
CPPUNIT_TEST(testGroupsRotatedPosition);
CPPUNIT_TEST(testAccentColor);
CPPUNIT_TEST(testTdf114848);
+ CPPUNIT_TEST(testFontScale);
CPPUNIT_TEST(testTdf115394);
CPPUNIT_TEST(testTdf115394Zero);
@@ -1134,6 +1136,21 @@ void SdOOXMLExportTest2::testGroupRotation()
assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:grpSp/p:sp[2]/p:spPr/a:xfrm", "rot", "20400000");
}
+void SdOOXMLExportTest2::testFontScale()
+{
+ sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/font-scale.pptx"), PPTX);
+ utl::TempFile tempFile;
+ xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
+ xmlDocPtr pXmlDocContent = parseExport(tempFile, "ppt/slides/slide1.xml");
+
+ // Rounding errors possible, approximate value
+ OUString sScale = getXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp/p:txBody/a:bodyPr/a:normAutofit", "fontScale");
+ if (sScale != "73000" && sScale != "72000" && sScale != "74000")
+ CPPUNIT_ASSERT_EQUAL(OUString("73000"), sScale);
+
+ xDocShRef->DoClose();
+}
+
void SdOOXMLExportTest2::testTdf115394()
{
sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/tdf115394.pptx"), PPTX);