[Libreoffice-commits] core.git: oox/source sc/qa

yogesh.bharate001 yogesh.bharate at synerzip.com
Thu May 7 09:00:20 PDT 2015


 oox/source/export/drawingml.cxx                           |    3 +-
 sc/qa/unit/data/xlsx/textbox-CondensedCharacterSpace.xlsx |binary
 sc/qa/unit/subsequent_export-test.cxx                     |   21 ++++++++++++++
 3 files changed, 23 insertions(+), 1 deletion(-)

New commits:
commit 3ffed8635acd55a5989bf9a0f4bc9c20b0acd945
Author: yogesh.bharate001 <yogesh.bharate at synerzip.com>
Date:   Mon May 4 17:49:12 2015 +0530

    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 at libreoffice.org>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index da55e0f..9ede463 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 0000000..fb46fef
Binary files /dev/null and b/sc/qa/unit/data/xlsx/textbox-CondensedCharacterSpace.xlsx differ
diff --git a/sc/qa/unit/subsequent_export-test.cxx b/sc/qa/unit/subsequent_export-test.cxx
index 5271095..4924adc 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);
 


More information about the Libreoffice-commits mailing list