summaryrefslogtreecommitdiff
path: root/oox/qa/unit
diff options
context:
space:
mode:
authorRegina Henschel <rb.henschel@t-online.de>2023-02-02 23:24:01 +0100
committerRegina Henschel <rb.henschel@t-online.de>2023-02-03 01:17:48 +0000
commita834bbad8295cba0ca88a91a524aad48640271ec (patch)
tree5029acbb751ea3ed386b3bea8f324bc24be2d858 /oox/qa/unit
parentf2a2dab47dfae5c0c0bd68132e1446d571767eb8 (diff)
tdf#153246 VML export write adj attribute for Fontwork
The fix for tdf#153296 has introduced correct shapetype markup for Fontwork shapes so that handles are moveable in Word. But the actual adjustment value of the handle was not exported. This patch adds the missing 'adj' attribute to the <v:shape> element. The fix is restricted to the preset Fontwork types because for other shapetypes the VML export is not yet suitable in regard to handles. Change-Id: I7ecda9e63d50ab7d8c1fda3e09f7383546ddaf5a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146537 Tested-by: Jenkins Reviewed-by: Regina Henschel <rb.henschel@t-online.de>
Diffstat (limited to 'oox/qa/unit')
-rw-r--r--oox/qa/unit/data/tdf153246_VML_export_Fontwork_Adjustment.odtbin0 -> 20601 bytes
-rw-r--r--oox/qa/unit/export.cxx27
2 files changed, 27 insertions, 0 deletions
diff --git a/oox/qa/unit/data/tdf153246_VML_export_Fontwork_Adjustment.odt b/oox/qa/unit/data/tdf153246_VML_export_Fontwork_Adjustment.odt
new file mode 100644
index 000000000000..1a26191821cf
--- /dev/null
+++ b/oox/qa/unit/data/tdf153246_VML_export_Fontwork_Adjustment.odt
Binary files differ
diff --git a/oox/qa/unit/export.cxx b/oox/qa/unit/export.cxx
index 64c97b56a24d..50c953135623 100644
--- a/oox/qa/unit/export.cxx
+++ b/oox/qa/unit/export.cxx
@@ -883,6 +883,33 @@ CPPUNIT_TEST_FIXTURE(Test, testVMLFontworkArchUp)
// ..., but a <v:shapetype> element with <v:textpath> subelement
assertXPath(pXmlDoc, "//v:shapetype/v:textpath", 1);
}
+
+CPPUNIT_TEST_FIXTURE(Test, testVMLAdjustmentExport)
+{
+ // The document has a Fontwork shape type 'textCirclePour' (150). When exporting to docx, the
+ // adjustment values were not exported at all.
+ loadFromURL(u"tdf153246_VML_export_Fontwork_Adjustment.odt");
+
+ // FIXME: tdf#153183 validation error in OOXML export: Errors: 1
+ // Attribute 'ID' is not allowed to appear in element 'v:shape'.
+ skipValidation();
+
+ // Save to DOCX:
+ save("Office Open XML Text");
+
+ // Examine the saved markup.
+ xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
+
+ // Make sure an "adj" attribute exists
+ assertXPath(pXmlDoc, "//v:shape[@adj]", 1);
+ // ... and has the correct values
+ OUString sAdjustments = getXPath(pXmlDoc, "//v:shape", "adj");
+ sal_Int32 nTokenStart = 0;
+ OUString sAngle = sAdjustments.getToken(0, ',', nTokenStart);
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(sal_Int32(-7341733), sAngle.toInt32(), 2);
+ OUString sRadius = sAdjustments.copy(nTokenStart);
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(sal_Int32(5296), sRadius.toInt32(), 2);
+}
}
CPPUNIT_PLUGIN_IMPLEMENT();