diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2024-04-01 20:32:15 +0900 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2024-04-03 04:06:39 +0200 |
commit | db64748f1ee771da9da857f95601b9e08b577166 (patch) | |
tree | 2be5e8a13d75e287da95aa5d1b6891c34812875e /sd | |
parent | 6fd33d50603c2d12c0a1d88edb04c0890b6a1ef1 (diff) |
svx: read font and spacing scaling from oox, add bot as UNO prop.
- Read spacing in oox.
- Add spacing scaling as a property.
- Rename property "TextFitToSizeScale" to "TextFitToSizeFontScale"
- Add property "TextFitToSizeSpacingScale"
Change-Id: Icde575e55a3146169d86bb538a57adcf1fa228a7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165633
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/qa/unit/export-tests-ooxml2.cxx | 16 | ||||
-rw-r--r-- | sd/qa/unit/import-tests-smartart.cxx | 15 | ||||
-rw-r--r-- | sd/qa/unit/import-tests2.cxx | 6 |
3 files changed, 19 insertions, 18 deletions
diff --git a/sd/qa/unit/export-tests-ooxml2.cxx b/sd/qa/unit/export-tests-ooxml2.cxx index ddd272752859..4abd5859aa7d 100644 --- a/sd/qa/unit/export-tests-ooxml2.cxx +++ b/sd/qa/unit/export-tests-ooxml2.cxx @@ -1888,10 +1888,10 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTextColumns_3columns) CPPUNIT_ASSERT_EQUAL(uno::Any(sal_Int32(300)), xColProps->getPropertyValue("AutomaticDistance")); // Scale value may be unstable; just test that the text is actually scaled - double fScale; - CPPUNIT_ASSERT(xProps->getPropertyValue("TextFitToSizeScale") >>= fScale); - CPPUNIT_ASSERT_GREATER(0.0, fScale); - CPPUNIT_ASSERT_LESS(100.0, fScale); + double fFontScale; + CPPUNIT_ASSERT(xProps->getPropertyValue("TextFitToSizeFontScale") >>= fFontScale); + CPPUNIT_ASSERT_GREATER(0.0, fFontScale); + CPPUNIT_ASSERT_LESS(100.0, fFontScale); } save("Impress Office Open XML"); @@ -1908,10 +1908,10 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTextColumns_3columns) CPPUNIT_ASSERT_EQUAL(uno::Any(sal_Int32(300)), xColProps->getPropertyValue("AutomaticDistance")); // Scale value may be unstable; just test that the text is actually scaled - double fScale; - CPPUNIT_ASSERT(xProps->getPropertyValue("TextFitToSizeScale") >>= fScale); - CPPUNIT_ASSERT_GREATER(0.0, fScale); - CPPUNIT_ASSERT_LESS(100.0, fScale); + double fFontScale; + CPPUNIT_ASSERT(xProps->getPropertyValue("TextFitToSizeFontScale") >>= fFontScale); + CPPUNIT_ASSERT_GREATER(0.0, fFontScale); + CPPUNIT_ASSERT_LESS(100.0, fFontScale); } xmlDocUniquePtr pXmlDocRels = parseExport("ppt/slides/slide1.xml"); diff --git a/sd/qa/unit/import-tests-smartart.cxx b/sd/qa/unit/import-tests-smartart.cxx index 568f0a90efca..84882fba0e79 100644 --- a/sd/qa/unit/import-tests-smartart.cxx +++ b/sd/qa/unit/import-tests-smartart.cxx @@ -1527,21 +1527,22 @@ CPPUNIT_TEST_FIXTURE(SdImportTestSmartArt, testAutofitSync) uno::Reference<drawing::XShape> xMiddle = getChildShape(xDiagram, 2); uno::Reference<beans::XPropertySet> xFirstInner(getChildShape(getChildShape(xMiddle, 0), 0), uno::UNO_QUERY); - double nFirstScale = 0; - CPPUNIT_ASSERT(xFirstInner->getPropertyValue("TextFitToSizeScale") >>= nFirstScale); - CPPUNIT_ASSERT_GREATER(0.0, nFirstScale); - CPPUNIT_ASSERT_LESS(100.0, nFirstScale); + double fFirstScale = 0; + CPPUNIT_ASSERT(xFirstInner->getPropertyValue("TextFitToSizeFontScale") >>= fFirstScale); + CPPUNIT_ASSERT_GREATER(0.0, fFirstScale); + CPPUNIT_ASSERT_LESS(100.0, fFirstScale); + uno::Reference<beans::XPropertySet> xSecondInner(getChildShape(getChildShape(xMiddle, 2), 0), uno::UNO_QUERY); - double nSecondScale = 0; - CPPUNIT_ASSERT(xSecondInner->getPropertyValue("TextFitToSizeScale") >>= nSecondScale); + double fSecondScale = 0; + CPPUNIT_ASSERT(xSecondInner->getPropertyValue("TextFitToSizeFontScale") >>= fSecondScale); // Without the accompanying fix in place, this test would have failed with: // - Expected: 56 // - Actual : 100 // i.e. the left shape had no scale-down and the right shape was scaled down, even if it was // requested that their scaling matches. - CPPUNIT_ASSERT_EQUAL(nSecondScale, nFirstScale); + CPPUNIT_ASSERT_EQUAL(fSecondScale, fFirstScale); // Without the accompanying fix in place, this test would have failed with: // - Expected: 0 (drawing::TextFitToSizeType_NONE) diff --git a/sd/qa/unit/import-tests2.cxx b/sd/qa/unit/import-tests2.cxx index 9ade40ad1917..5457224bd642 100644 --- a/sd/qa/unit/import-tests2.cxx +++ b/sd/qa/unit/import-tests2.cxx @@ -1368,9 +1368,9 @@ CPPUNIT_TEST_FIXTURE(SdImportTest2, testTdf120028) xPropSet->getPropertyValue("CharHeight") >>= fCharHeight; CPPUNIT_ASSERT_DOUBLES_EQUAL(13.5, fCharHeight, 1E-12); - double fTextSclale = 0.0; - xShape->getPropertyValue("TextFitToSizeScale") >>= fTextSclale; - CPPUNIT_ASSERT_DOUBLES_EQUAL(92.0, fTextSclale, 1E1); + double fFontScale = 0.0; + xShape->getPropertyValue("TextFitToSizeFontScale") >>= fFontScale; + CPPUNIT_ASSERT_DOUBLES_EQUAL(92.0, fFontScale, 1E1); } CPPUNIT_TEST_FIXTURE(SdImportTest2, testDescriptionImport) |