summaryrefslogtreecommitdiff
path: root/sc/qa
diff options
context:
space:
mode:
authorIlhan Yesil <ilhanyesil@gmx.de>2018-09-03 12:57:01 +0200
committerKatarina Behrens <Katarina.Behrens@cib.de>2018-09-05 10:39:57 +0200
commit7010edf9c3cd1a602417421980092dee9ce7ea94 (patch)
treeacce16f3c9e75141c54235b90f5db73efa9e0614 /sc/qa
parentbfe1624507ed32818a4d4b59c995330f3bb40c2b (diff)
tdf#117287 When saving as Xlsx, export visible flag if comment is visble
The visible flag will be exported now, when a comment is visible and the file is saved as Xlsx. Change-Id: Id05ab5f94ea85f48db123d1043ecdc4813a64382 Reviewed-on: https://gerrit.libreoffice.org/59934 Tested-by: Jenkins Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de>
Diffstat (limited to 'sc/qa')
-rw-r--r--sc/qa/unit/data/xlsx/tdf117287_comment.xlsxbin0 -> 10251 bytes
-rw-r--r--sc/qa/unit/subsequent_export-test.cxx43
2 files changed, 39 insertions, 4 deletions
diff --git a/sc/qa/unit/data/xlsx/tdf117287_comment.xlsx b/sc/qa/unit/data/xlsx/tdf117287_comment.xlsx
new file mode 100644
index 000000000000..486bdef90f84
--- /dev/null
+++ b/sc/qa/unit/data/xlsx/tdf117287_comment.xlsx
Binary files differ
diff --git a/sc/qa/unit/subsequent_export-test.cxx b/sc/qa/unit/subsequent_export-test.cxx
index 596cfe751e20..5d0f1dce5313 100644
--- a/sc/qa/unit/subsequent_export-test.cxx
+++ b/sc/qa/unit/subsequent_export-test.cxx
@@ -121,6 +121,7 @@ public:
void testFormatExportODS();
void testCommentExportXLSX();
+ void testCommentExportXLSX_2_XLSX();
#if HAVE_MORE_FONTS
void testCustomColumnWidthExportXLSX();
#endif
@@ -242,8 +243,8 @@ public:
CPPUNIT_TEST(testCellNoteExportODS);
CPPUNIT_TEST(testCellNoteExportXLS);
CPPUNIT_TEST(testFormatExportODS);
-
CPPUNIT_TEST(testCommentExportXLSX);
+ CPPUNIT_TEST(testCommentExportXLSX_2_XLSX);
#if HAVE_MORE_FONTS
CPPUNIT_TEST(testCustomColumnWidthExportXLSX);
#endif
@@ -698,8 +699,10 @@ void ScExportTest::testCommentExportXLSX()
ScDocShellRef xShell = loadDoc("comment.", FORMAT_ODS);
CPPUNIT_ASSERT(xShell.is());
- std::shared_ptr<utl::TempFile> pXPathFile = ScBootstrapFixture::exportTo(&(*xShell), FORMAT_XLSX);
- const xmlDocPtr pComments = XPathHelper::parseExport(pXPathFile, m_xSFactory, "xl/comments1.xml");
+ std::shared_ptr<utl::TempFile> pXPathFile
+ = ScBootstrapFixture::exportTo(&(*xShell), FORMAT_XLSX);
+ const xmlDocPtr pComments
+ = XPathHelper::parseExport(pXPathFile, m_xSFactory, "xl/comments1.xml");
CPPUNIT_ASSERT(pComments);
assertXPath(pComments, "/x:comments/x:authors/x:author[1]", "BAKO");
@@ -707,7 +710,8 @@ void ScExportTest::testCommentExportXLSX()
assertXPath(pComments, "/x:comments/x:commentList/x:comment/x:text/x:r/x:t", "Komentarz");
- const xmlDocPtr pVmlDrawing = XPathHelper::parseExport(pXPathFile, m_xSFactory, "xl/drawings/vmlDrawing1.vml");
+ const xmlDocPtr pVmlDrawing
+ = XPathHelper::parseExport(pXPathFile, m_xSFactory, "xl/drawings/vmlDrawing1.vml");
CPPUNIT_ASSERT(pVmlDrawing);
//assertXPath(pVmlDrawing, "/xml/v:shapetype", "coordsize", "21600,21600");
@@ -720,6 +724,37 @@ void ScExportTest::testCommentExportXLSX()
assertXPath(pVmlDrawing, "/xml/v:shape/v:shadow", "obscured", "t");
}
+void ScExportTest::testCommentExportXLSX_2_XLSX()
+{
+ //tdf#117287 FILESAVE XLSX: Comments always disappear after opening the exported XLSX file with Excel
+ ScDocShellRef xShell = loadDoc("tdf117287_comment.", FORMAT_XLSX);
+ CPPUNIT_ASSERT(xShell.is());
+
+
+ ScDocument& rDoc = xShell->GetDocument();
+ ScAddress aPosC9(2, 8, 0);
+ ScPostIt *pNote = rDoc.GetNote(aPosC9);
+
+ CPPUNIT_ASSERT(pNote);
+ CPPUNIT_ASSERT(!pNote->IsCaptionShown());
+
+ pNote->ShowCaption(aPosC9, true);
+
+ std::shared_ptr<utl::TempFile> pXPathFile
+ = ScBootstrapFixture::exportTo(&(*xShell), FORMAT_XLSX);
+ const xmlDocPtr pComments
+ = XPathHelper::parseExport(pXPathFile, m_xSFactory, "xl/comments1.xml");
+ CPPUNIT_ASSERT(pComments);
+
+ assertXPath(pComments, "/x:comments/x:commentList/x:comment/x:text/x:r/x:t", "visible comment");
+
+ const xmlDocPtr pVmlDrawing
+ = XPathHelper::parseExport(pXPathFile, m_xSFactory, "xl/drawings/vmlDrawing1.vml");
+ CPPUNIT_ASSERT(pVmlDrawing);
+
+ assertXPath(pVmlDrawing, "/xml/v:shape/x:ClientData/x:Visible", 0);
+}
+
#if HAVE_MORE_FONTS
void ScExportTest::testCustomColumnWidthExportXLSX()
{