diff options
-rw-r--r-- | oox/source/export/drawingml.cxx | 3 | ||||
-rw-r--r-- | sc/qa/unit/data/xlsx/textbox-CondensedCharacterSpace.xlsx | bin | 0 -> 9577 bytes | |||
-rw-r--r-- | sc/qa/unit/subsequent_export-test.cxx | 21 |
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 Binary files differnew file mode 100644 index 000000000000..fb46fefd4312 --- /dev/null +++ b/sc/qa/unit/data/xlsx/textbox-CondensedCharacterSpace.xlsx 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); |