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>
This commit is contained in:
yogesh.bharate001 2015-05-04 17:49:12 +05:30 committed by Caolán McNamara
parent d0dd41319f
commit 3ffed8635a
3 changed files with 23 additions and 1 deletions

View File

@ -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 ),

View File

@ -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);