diff options
author | Bartosz Kosiorek <gang65@poczta.onet.pl> | 2018-01-12 17:12:18 +0100 |
---|---|---|
committer | Bartosz Kosiorek <gang65@poczta.onet.pl> | 2018-02-07 14:49:28 +0100 |
commit | ea7274259a211170ee9f5a8714a2f9acd8bed6d8 (patch) | |
tree | d0aebf3e014b6538c9d7fc070c24f7ee09191aae /sc/qa/unit | |
parent | 37413f569ad557cc08ea625ce18a6570eb00f075 (diff) |
tdf#114842 Fix comment shape export for Calc
When we have shape definition for commend, eg.:
<v:shape id="_x0000_s1026" type="#_x0000_t202"
the "type" must be specified previously, eg:
<v:shapetype id="shapetype_202" coordsize="21600,21600" o:spt="202" path="m,l,21600l21600,21600l21600,xe">
<v:stroke joinstyle="miter"/>
<v:path gradientshapeok="t" o:connecttype="rect"/>
</v:shapetype
Unfortunately here is the problem, "id" of "v:shapetype" is "shapetype_202".
It means that type used by shape type="#_x0000_t202" is not exisiting.
To fix that issue I have changed "v:shapetype" id to be exactly the same as it is used:
<v:shapetype id="_x005F_x0000_t202" coordsize="21600,21600" o:spt="202" path="m,l,21600l21600,21600l21600,xe">
<v:stroke joinstyle="miter"/>
<v:path gradientshapeok="t" o:connecttype="rect"/>
</v:shapetype>
After that fix, comments are displayed correctly.
I also added unit test, to make sure that shape is using already defined "shapetype".
Change-Id: I8faf1befe7573aa33ee8a294eb192e5e255f37a1
Reviewed-on: https://gerrit.libreoffice.org/47821
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
Diffstat (limited to 'sc/qa/unit')
-rw-r--r-- | sc/qa/unit/subsequent_export-test.cxx | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/sc/qa/unit/subsequent_export-test.cxx b/sc/qa/unit/subsequent_export-test.cxx index aaf82ae88c88..6865897d0318 100644 --- a/sc/qa/unit/subsequent_export-test.cxx +++ b/sc/qa/unit/subsequent_export-test.cxx @@ -564,14 +564,25 @@ void ScExportTest::testCommentExportXLSX() CPPUNIT_ASSERT(xShell.is()); std::shared_ptr<utl::TempFile> pXPathFile = ScBootstrapFixture::exportTo(&(*xShell), FORMAT_XLSX); - xmlDocPtr pSheet = XPathHelper::parseExport(pXPathFile, m_xSFactory, "xl/comments1.xml"); - CPPUNIT_ASSERT(pSheet); + const xmlDocPtr pComments = XPathHelper::parseExport(pXPathFile, m_xSFactory, "xl/comments1.xml"); + CPPUNIT_ASSERT(pComments); + + assertXPath(pComments, "/x:comments/x:authors/x:author[1]", "BAKO"); + assertXPath(pComments, "/x:comments/x:authors/x:author", 1); + + assertXPath(pComments, "/x:comments/x:commentList/x:comment/x:text/x:r/x:t", "Komentarz"); - assertXPath(pSheet, "/x:comments/x:authors/x:author[1]", "BAKO"); - assertXPath(pSheet, "/x:comments/x:authors/x:author", 1); + const xmlDocPtr pVmlDrawing = XPathHelper::parseExport(pXPathFile, m_xSFactory, "xl/drawings/vmlDrawing1.vml"); + CPPUNIT_ASSERT(pVmlDrawing); - assertXPath(pSheet, "/x:comments/x:commentList/x:comment/x:text/x:r/x:t", "Komentarz"); + //assertXPath(pVmlDrawing, "/xml/v:shapetype", "coordsize", "21600,21600"); + assertXPath(pVmlDrawing, "/xml/v:shapetype", "spt", "202"); + assertXPath(pVmlDrawing, "/xml/v:shapetype/v:stroke", "joinstyle", "miter"); + const OUString sShapeTypeId = "#" + getXPath(pVmlDrawing, "/xml/v:shapetype", "id"); + assertXPath(pVmlDrawing, "/xml/v:shape", "type", sShapeTypeId); + assertXPath(pVmlDrawing, "/xml/v:shape/v:shadow", "color", "black"); + assertXPath(pVmlDrawing, "/xml/v:shape/v:shadow", "obscured", "t"); } #if HAVE_MORE_FONTS |