From 3ffed8635acd55a5989bf9a0f4bc9c20b0acd945 Mon Sep 17 00:00:00 2001 From: "yogesh.bharate001" Date: Mon, 4 May 2015 17:49:12 +0530 Subject: [PATCH] tdf#91066: Condensed Character Spacing i.e spc(negative value) is not exported after RT. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Problem Description: - Condensed character spacing i.e Spacing between characters/letters (negative value) is not preserved after roundtrip. XML Difference: XML Difference : Original: After Roundtrip: 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 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- oox/source/export/drawingml.cxx | 3 ++- .../xlsx/textbox-CondensedCharacterSpace.xlsx | Bin 0 -> 9577 bytes sc/qa/unit/subsequent_export-test.cxx | 21 ++++++++++++++++++ 3 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 sc/qa/unit/data/xlsx/textbox-CondensedCharacterSpace.xlsx 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 0000000000000000000000000000000000000000..fb46fefd43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=KL{^ku3b>+W0_-jY{--bV~1u%B}sXu+!@UKm}KO6SLMDu@c z+1>SXw|Vo+(m~-m(sjz`d5+g%MbvlCkFujCK>LU|8=$hvpEy!Pv(ED{p!j{ TF!=t^zgPe>7z2)|f86~K3XDnn literal 0 HcmV?d00001 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);