summaryrefslogtreecommitdiff
path: root/sd/qa
diff options
context:
space:
mode:
authorRegina Henschel <rb.henschel@t-online.de>2022-11-08 10:28:08 +0100
committerRegina Henschel <rb.henschel@t-online.de>2022-11-12 12:45:03 +0100
commitbd7f1270cf58eba7600d1b4c6c8ca9a901a04f66 (patch)
tree05f659c2c41a0eda0b1136547dd50d9c58d24746 /sd/qa
parent34a90a7f56b7009bc95cf1b0a0e258fa0af2d52a (diff)
tdf#125085 PPTX WordArt import: get shape font from run
PPTX uses the settings at the run for the text in a WordArt shape. LO uses the settings of the shape. The patch copies the run font and language properties to the shape. In addition I have split the old method lcl_createPresetShape and renamed the parts. Now the method lcl_putCustomShapeIntoTextPathMode contains the geometry changes to put a CustomShape into text path mode and to adapt the OOXML values to the values needed for our preset Fontwork shapes, which are based on binary MS Office. MS Office has the style of the characters of a WordArt as properties of the run. LibreOffice ignores most of the properties specified in the style of a span element, when the text is displayed as Fontwork. Instead LO uses the properties defined for the shape for styling the text. Copying the text properties to the shape is now done in method lcl_copyCharPropsToShape. The values in testTdf125573_FontWorkScaleX depend on the used Font. Since on creation time wrong Fonts were used and now correct Fonts are imported, the values have to be updated. Import of fill and stroke of the characters is still missing, only a rudimentary import of color for solid fill exists. Change-Id: I6f31fe07fb0656b2ce8581e7123265fa598ac9c1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142421 Tested-by: Jenkins Reviewed-by: Regina Henschel <rb.henschel@t-online.de>
Diffstat (limited to 'sd/qa')
-rw-r--r--sd/qa/unit/export-tests-ooxml3.cxx15
1 files changed, 8 insertions, 7 deletions
diff --git a/sd/qa/unit/export-tests-ooxml3.cxx b/sd/qa/unit/export-tests-ooxml3.cxx
index 415b801fb293..e5e8cee6c390 100644
--- a/sd/qa/unit/export-tests-ooxml3.cxx
+++ b/sd/qa/unit/export-tests-ooxml3.cxx
@@ -65,7 +65,7 @@ public:
void testTdf145162();
void testZeroIndentExport();
void testTdf100348_convert_Fontwork2TextWarp();
- void testTdf1225573_FontWorkScaleX();
+ void testTdf125573_FontWorkScaleX();
void testTdf99497_keepAppearanceOfCircleKind();
/// SmartArt animated elements
void testTdf104792();
@@ -155,7 +155,7 @@ public:
CPPUNIT_TEST(testTdf145162);
CPPUNIT_TEST(testZeroIndentExport);
CPPUNIT_TEST(testTdf100348_convert_Fontwork2TextWarp);
- CPPUNIT_TEST(testTdf1225573_FontWorkScaleX);
+ CPPUNIT_TEST(testTdf125573_FontWorkScaleX);
CPPUNIT_TEST(testTdf99497_keepAppearanceOfCircleKind);
CPPUNIT_TEST(testTdf104792);
CPPUNIT_TEST(testTdf90627);
@@ -711,7 +711,7 @@ void SdOOXMLExportTest3::testTdf100348_convert_Fontwork2TextWarp()
CPPUNIT_ASSERT_EQUAL(9180.0, fAdj2);
}
-void SdOOXMLExportTest3::testTdf1225573_FontWorkScaleX()
+void SdOOXMLExportTest3::testTdf125573_FontWorkScaleX()
{
loadFromURL(u"pptx/tdf125573_FontWorkScaleX.pptx");
save("Impress Office Open XML");
@@ -722,19 +722,20 @@ void SdOOXMLExportTest3::testTdf1225573_FontWorkScaleX()
assertXPath(pXmlDocContent,
"/p:sld/p:cSld/p:spTree/p:sp[1]/p:txBody/a:bodyPr[@fromWordArt='1']");
+ // State of Nov 2022. It needs to be updated, when import of fill and stroke is implemented.
// Error was, that text in legacy shapes of category "Follow Path" was not scaled to the path.
uno::Reference<beans::XPropertySet> xShapeArchProps(getShapeFromPage(0, 0));
awt::Rectangle aBoundRectArch;
xShapeArchProps->getPropertyValue(UNO_NAME_MISC_OBJ_BOUNDRECT) >>= aBoundRectArch;
- // difference should be zero, but allow some range for stroke thickness
- CPPUNIT_ASSERT_LESS(sal_Int32(50), std::abs(aBoundRectArch.Width - 13081));
+ // BoundRect is DPI dependent, thus allow some range.
+ CPPUNIT_ASSERT_LESS(sal_Int32(50), std::abs(aBoundRectArch.Width - 13038));
// Error was, that text in shapes of category "Warp" was not scaled to the path.
uno::Reference<beans::XPropertySet> xShapeWaveProps(getShapeFromPage(0, 1));
awt::Rectangle aBoundRectWave;
xShapeWaveProps->getPropertyValue(UNO_NAME_MISC_OBJ_BOUNDRECT) >>= aBoundRectWave;
- // difference should be zero, but allow some range for stroke thickness
- CPPUNIT_ASSERT_LESS(sal_Int32(50), std::abs(aBoundRectWave.Width - 11514));
+ // BoundRect is DPI dependent, thus allow some range.
+ CPPUNIT_ASSERT_LESS(sal_Int32(50), std::abs(aBoundRectWave.Width - 11576));
}
void SdOOXMLExportTest3::testTdf99497_keepAppearanceOfCircleKind()