[Libreoffice-commits] core.git: 2 commits - sc/qa sc/source
Kohei Yoshida
kohei.yoshida at collabora.com
Mon Aug 18 12:19:53 PDT 2014
sc/qa/unit/subsequent_export-test.cxx | 18 ++++++++++++++++++
sc/source/filter/excel/excrecds.cxx | 5 +++--
2 files changed, 21 insertions(+), 2 deletions(-)
New commits:
commit 3104f95254530c76c3fc0c3b840254912c067ad8
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date: Mon Aug 18 15:16:19 2014 -0400
Let's not export sheet tab color when it's not set.
COL_AUTO is the default value which is treated as color not being set. The
old code would export it as a white color which is not correct.
Change-Id: Ib68fccfb228333f2059edc4cfffeed90880ebc60
diff --git a/sc/source/filter/excel/excrecds.cxx b/sc/source/filter/excel/excrecds.cxx
index 0ea43ff..d911c19 100644
--- a/sc/source/filter/excel/excrecds.cxx
+++ b/sc/source/filter/excel/excrecds.cxx
@@ -424,8 +424,9 @@ void XclExpXmlSheetPr::SaveXml( XclExpXmlStream& rStrm )
// OOXTODO: XML_outlinePr
- rWorksheet->singleElement(
- XML_tabColor, XML_rgb, XclXmlUtils::ToOString(maTabColor).getStr(), FSEND);
+ if (maTabColor != Color(COL_AUTO))
+ rWorksheet->singleElement(
+ XML_tabColor, XML_rgb, XclXmlUtils::ToOString(maTabColor).getStr(), FSEND);
rWorksheet->singleElement(XML_pageSetUpPr,
// OOXTODO: XML_autoPageBreaks,
commit ead1db7d4907ff70d412701f08b9c74481cef0bc
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date: Mon Aug 18 15:15:03 2014 -0400
Write test to ensure that we export sheet tab color settings correctly.
Previously, we would incorrectly export a sheet tab without any color set
as a tab with white color.
Change-Id: I97e59a0d8e2fba6db64149f53acfe4331a5ce2ba
diff --git a/sc/qa/unit/subsequent_export-test.cxx b/sc/qa/unit/subsequent_export-test.cxx
index 466ca67..8d9a67a 100644
--- a/sc/qa/unit/subsequent_export-test.cxx
+++ b/sc/qa/unit/subsequent_export-test.cxx
@@ -1757,6 +1757,24 @@ void ScExportTest::testSharedFormulaExportXLSX()
{
bool checkContent( ScDocument& rDoc )
{
+ SCTAB nTabCount = rDoc.GetTableCount();
+ if (nTabCount != 2)
+ {
+ cerr << "Document should have exactly 2 sheets. " << nTabCount << " found." << endl;
+ return false;
+ }
+
+ // Make sure the sheet tab colors are not set.
+ for (SCROW i = 0; i <= 1; ++i)
+ {
+ Color aTabBgColor = rDoc.GetTabBgColor(i);
+ if (aTabBgColor != Color(COL_AUTO))
+ {
+ cerr << "The tab color of Sheet " << (i+1) << " should not be explicitly set." << endl;
+ return false;
+ }
+ }
+
// B2:B7 should show 1,2,3,4,5,6.
double fExpected = 1.0;
for (SCROW i = 1; i <= 6; ++i, ++fExpected)
More information about the Libreoffice-commits
mailing list