Kaydet (Commit) 8865ed2e authored tarafından yogesh.bharate001's avatar yogesh.bharate001 Kaydeden (comit) Joren De Cuyper

tdf#90812: rPr is not exported after roundtrip.

Problem Description:
XML Difference: In sharedStrings.xml
Original file :
<r>
  <rPr>
      <sz val="11"/>
      <color rgb="FFFF0000"/>
      <rFont val="Calibri"/>
      <family val="2"/>
      <scheme val="minor"/>
  </rPr>
   <t>Red</t>
</r>

Roundtrip file:
<r>
  <t>Red</t>
</r>

rPr is missing in roundtrip file.

Conflicts:
	sc/qa/unit/subsequent_export-test.cxx

Change-Id: I79efd0f8f1a735ef7e4ebd3fda220b3e339ea91c
Reviewed-on: https://gerrit.libreoffice.org/15548Reviewed-by: 's avatarJoren De Cuyper <jorendc@libreoffice.org>
Tested-by: 's avatarJoren De Cuyper <jorendc@libreoffice.org>
üst 686034d5
...@@ -142,6 +142,7 @@ public: ...@@ -142,6 +142,7 @@ public:
void testSheetCharacterKerningSpace(); void testSheetCharacterKerningSpace();
void testSheetCondensedCharacterSpace(); void testSheetCondensedCharacterSpace();
void testTextUnderlineColor(); void testTextUnderlineColor();
void testSheetRunParagraphProperty();
CPPUNIT_TEST_SUITE(ScExportTest); CPPUNIT_TEST_SUITE(ScExportTest);
CPPUNIT_TEST(test); CPPUNIT_TEST(test);
...@@ -194,6 +195,7 @@ public: ...@@ -194,6 +195,7 @@ public:
CPPUNIT_TEST(testSheetCharacterKerningSpace); CPPUNIT_TEST(testSheetCharacterKerningSpace);
CPPUNIT_TEST(testSheetCondensedCharacterSpace); CPPUNIT_TEST(testSheetCondensedCharacterSpace);
CPPUNIT_TEST(testTextUnderlineColor); CPPUNIT_TEST(testTextUnderlineColor);
CPPUNIT_TEST(testSheetRunParagraphProperty);
CPPUNIT_TEST_SUITE_END(); CPPUNIT_TEST_SUITE_END();
...@@ -220,7 +222,8 @@ void ScExportTest::registerNamespaces(xmlXPathContextPtr& pXmlXPathCtx) ...@@ -220,7 +222,8 @@ void ScExportTest::registerNamespaces(xmlXPathContextPtr& pXmlXPathCtx)
{ BAD_CAST("table"), BAD_CAST("urn:oasis:names:tc:opendocument:xmlns:table:1.0") }, { BAD_CAST("table"), BAD_CAST("urn:oasis:names:tc:opendocument:xmlns:table:1.0") },
{ BAD_CAST("text"), BAD_CAST("urn:oasis:names:tc:opendocument:xmlns:text:1.0") }, { BAD_CAST("text"), BAD_CAST("urn:oasis:names:tc:opendocument:xmlns:text:1.0") },
{ BAD_CAST("xlink"), BAD_CAST("http://www.w3c.org/1999/xlink") }, { BAD_CAST("xlink"), BAD_CAST("http://www.w3c.org/1999/xlink") },
{ BAD_CAST("xdr"), BAD_CAST("http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing") } { BAD_CAST("xdr"), BAD_CAST("http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing") },
{ BAD_CAST("x"), BAD_CAST("http://schemas.openxmlformats.org/spreadsheetml/2006/main") }
}; };
for(size_t i = 0; i < SAL_N_ELEMENTS(aNamespaces); ++i) for(size_t i = 0; i < SAL_N_ELEMENTS(aNamespaces); ++i)
{ {
...@@ -2611,6 +2614,21 @@ void ScExportTest::testTextUnderlineColor() ...@@ -2611,6 +2614,21 @@ void ScExportTest::testTextUnderlineColor()
CPPUNIT_ASSERT_EQUAL(OUString("ff0000"), color); CPPUNIT_ASSERT_EQUAL(OUString("ff0000"), color);
} }
void ScExportTest::testSheetRunParagraphProperty()
{
ScDocShellRef xShell = loadDoc("TextColor.", XLSX);
CPPUNIT_ASSERT(xShell.Is());
ScDocShellRef xDocSh = saveAndReload(&(*xShell), XLSX);
CPPUNIT_ASSERT(xDocSh.Is());
xmlDocPtr pDoc = XPathHelper::parseExport(&(*xDocSh), m_xSFactory, "xl/sharedStrings.xml", XLSX);
CPPUNIT_ASSERT(pDoc);
assertXPath(pDoc, "/x:sst/x:si/x:r[1]/x:rPr[1]", 1);
xDocSh->DoClose();
}
CPPUNIT_TEST_SUITE_REGISTRATION(ScExportTest); CPPUNIT_TEST_SUITE_REGISTRATION(ScExportTest);
......
...@@ -427,9 +427,10 @@ void XclExpString::WriteXml( XclExpXmlStream& rStrm ) const ...@@ -427,9 +427,10 @@ void XclExpString::WriteXml( XclExpXmlStream& rStrm ) const
const XclExpFont* pFont = NULL; const XclExpFont* pFont = NULL;
for ( ; aIt != aEnd; ++aIt ) for ( ; aIt != aEnd; ++aIt )
{ {
// pFont getting first then pass it to run otherwise pFont is NULL.
pFont = rFonts.GetFont( aIt->mnFontIdx );
nStart = lcl_WriteRun( rStrm, GetUnicodeBuffer(), nStart = lcl_WriteRun( rStrm, GetUnicodeBuffer(),
nStart, aIt->mnChar-nStart, pFont ); nStart, aIt->mnChar-nStart, pFont );
pFont = rFonts.GetFont( aIt->mnFontIdx );
} }
lcl_WriteRun( rStrm, GetUnicodeBuffer(), lcl_WriteRun( rStrm, GetUnicodeBuffer(),
nStart, GetUnicodeBuffer().size() - nStart, pFont ); nStart, GetUnicodeBuffer().size() - nStart, pFont );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment