summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryogesh.bharate001 <yogesh.bharate@synerzip.com>2015-05-04 17:49:12 +0530
committerCaolán McNamara <caolanm@redhat.com>2015-05-07 15:59:49 +0000
commit3ffed8635acd55a5989bf9a0f4bc9c20b0acd945 (patch)
tree858115689fbb4458c184ae5d5dd5d6d10b8e2a98
parentd0dd41319ff153cc71ac65f7cc6a0abb0e3ca300 (diff)
tdf#91066: Condensed Character Spacing i.e spc(negative value) is not exported after RT.
Problem Description: - Condensed character spacing i.e Spacing between characters/letters (negative value) is not preserved after roundtrip. XML Difference: XML Difference : Original: <a:rPr lang="en-IN" sz="6000" b="1" kern="0" spc="-1000" baseline="0"> After Roundtrip: <a:rPr b="1" lang="en-IN" sz="6000" strike="noStrike"> spc="-1000" is missing in roundtripped file. Change-Id: I02edbb31375c2406a6e39873b7b886f4786a3758 Solution: Added support for Condensed Character Spacing. Reviewed-on: https://gerrit.libreoffice.org/15635 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--oox/source/export/drawingml.cxx3
-rw-r--r--sc/qa/unit/data/xlsx/textbox-CondensedCharacterSpace.xlsxbin0 -> 9577 bytes
-rw-r--r--sc/qa/unit/subsequent_export-test.cxx21
3 files changed, 23 insertions, 1 deletions
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index da55e0f9f0e3..9ede46300ce4 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -1335,7 +1335,8 @@ void DrawingML::WriteRunProperties( Reference< XPropertySet > rRun, bool bIsFiel
XML_i, italic,
XML_lang, usLanguage.isEmpty() ? NULL : USS( usLanguage ),
XML_sz, IS( nSize ),
- XML_spc, nCharKerning > 0 ? IS(nCharKerning) : NULL,
+ // For Condensed character spacing spc value is negative.
+ XML_spc, nCharKerning ? IS(nCharKerning) : NULL,
XML_strike, strikeout,
XML_u, underline,
XML_baseline, nCharEscapement == 0 ? NULL : IS( nCharEscapement*1000 ),
diff --git a/sc/qa/unit/data/xlsx/textbox-CondensedCharacterSpace.xlsx b/sc/qa/unit/data/xlsx/textbox-CondensedCharacterSpace.xlsx
new file mode 100644
index 000000000000..fb46fefd4312
--- /dev/null
+++ b/sc/qa/unit/data/xlsx/textbox-CondensedCharacterSpace.xlsx
Binary files differ
diff --git a/sc/qa/unit/subsequent_export-test.cxx b/sc/qa/unit/subsequent_export-test.cxx
index 5271095b2f3f..4924adcb78a6 100644
--- a/sc/qa/unit/subsequent_export-test.cxx
+++ b/sc/qa/unit/subsequent_export-test.cxx
@@ -140,6 +140,7 @@ public:
void testSheetTextBoxHyperlink();
void testFontSize();
void testSheetCharacterKerningSpace();
+ void testSheetCondensedCharacterSpace();
CPPUNIT_TEST_SUITE(ScExportTest);
CPPUNIT_TEST(test);
@@ -190,6 +191,7 @@ public:
CPPUNIT_TEST(testSheetTextBoxHyperlink);
CPPUNIT_TEST(testFontSize);
CPPUNIT_TEST(testSheetCharacterKerningSpace);
+ CPPUNIT_TEST(testSheetCondensedCharacterSpace);
CPPUNIT_TEST_SUITE_END();
@@ -2573,6 +2575,25 @@ void ScExportTest::testSheetCharacterKerningSpace()
xDocSh->DoClose();
}
+void ScExportTest::testSheetCondensedCharacterSpace()
+{
+ ScDocShellRef xShell = loadDoc("textbox-CondensedCharacterSpace.", XLSX);
+ CPPUNIT_ASSERT(xShell.Is());
+
+ ScDocShellRef xDocSh = saveAndReload(&(*xShell), XLSX);
+ CPPUNIT_ASSERT(xDocSh.Is());
+
+ xmlDocPtr pDoc = XPathHelper::parseExport(&(*xDocSh), m_xSFactory, "xl/drawings/drawing1.xml", XLSX);
+ CPPUNIT_ASSERT(pDoc);
+
+ OUString CondensedCharSpace = getXPath(pDoc,
+ "/xdr:wsDr[1]/xdr:twoCellAnchor[1]/xdr:sp[1]/xdr:txBody[1]/a:p[1]/a:r[1]/a:rPr[1]","spc");
+
+ // make sure that the CondensedCharSpace is -996.
+ CPPUNIT_ASSERT_EQUAL(OUString("-996"), CondensedCharSpace);
+
+ xDocSh->DoClose();
+}
CPPUNIT_TEST_SUITE_REGISTRATION(ScExportTest);