chart2/qa/extras/chart2import.cxx | 31 ++++++++++++++++++++++ chart2/qa/extras/data/xlsx/autotitledel_2007.xlsx |binary chart2/qa/extras/data/xlsx/autotitledel_2013.xlsx |binary oox/source/drawingml/chart/chartspacefragment.cxx | 6 +++- oox/source/drawingml/chart/chartspacemodel.cxx | 2 - vcl/source/opengl/OpenGLHelper.cxx | 2 - 6 files changed, 38 insertions(+), 3 deletions(-)
New commits: commit e6dbd5b03cf923fa505f8313fbae56f2d287be30 Author: Markus Mohrhard <markus.mohrh...@collabora.co.uk> Date: Mon Mar 16 02:55:08 2015 +0100 add tests for autoTitleDel flag default value fixes Change-Id: I9860142f2da9c19f52f3a8a2be6ec851bdf81b6e diff --git a/chart2/qa/extras/chart2import.cxx b/chart2/qa/extras/chart2import.cxx index c334713..668c09b 100644 --- a/chart2/qa/extras/chart2import.cxx +++ b/chart2/qa/extras/chart2import.cxx @@ -63,6 +63,11 @@ public: void testTransparentBackground(OUString const & filename); + // below are OOXML default value tests for cases + // where we fixed the handling of MSO 2007 vs OOXML + void testAutoTitleDelDefaultValue2007XLSX(); + void testAutoTitleDelDefaultValue2013XLSX(); + CPPUNIT_TEST_SUITE(Chart2ImportTest); CPPUNIT_TEST(Fdo60083); CPPUNIT_TEST(testSteppedLines); @@ -93,6 +98,8 @@ public: CPPUNIT_TEST(testAxisTextRotationXLSX); // CPPUNIT_TEST(testTextCanOverlapXLSX); // TODO : temporarily disabled. CPPUNIT_TEST(testNumberFormatsXLSX); + CPPUNIT_TEST(testAutoTitleDelDefaultValue2007XLSX); + CPPUNIT_TEST(testAutoTitleDelDefaultValue2013XLSX); CPPUNIT_TEST_SUITE_END(); private: @@ -748,6 +755,30 @@ void Chart2ImportTest::testNumberFormatsXLSX() CPPUNIT_ASSERT_MESSAGE("\"LinkNumberFormatToSource\" should be set to true.", bSuccess && bLinkNumberFormatToSource); } +void Chart2ImportTest::testAutoTitleDelDefaultValue2007XLSX() +{ + load("/chart2/qa/extras/data/xlsx/", "autotitledel_2007.xlsx"); + Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0, mxComponent); + CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChartDoc.is()); + + Reference<chart2::XTitled> xTitled(xChartDoc, uno::UNO_QUERY_THROW); + OUString aTitle = getTitleString(xTitled); + CPPUNIT_ASSERT_MESSAGE("autoTitleDel default value is false in MSO 2007 documents", + !aTitle.isEmpty()); +} + +void Chart2ImportTest::testAutoTitleDelDefaultValue2013XLSX() +{ + load("/chart2/qa/extras/data/xlsx/", "autotitledel_2013.xlsx"); + Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0, mxComponent); + CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChartDoc.is()); + + Reference<chart2::XTitled> xTitled(xChartDoc, uno::UNO_QUERY_THROW); + uno::Reference<chart2::XTitle> xTitle = xTitled->getTitleObject(); + CPPUNIT_ASSERT_MESSAGE("autoTitleDel default value is true in the OOXML spec", + !xTitle.is()); +} + CPPUNIT_TEST_SUITE_REGISTRATION(Chart2ImportTest); CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/chart2/qa/extras/data/xlsx/autotitledel_2007.xlsx b/chart2/qa/extras/data/xlsx/autotitledel_2007.xlsx new file mode 100644 index 0000000..9ce71cf Binary files /dev/null and b/chart2/qa/extras/data/xlsx/autotitledel_2007.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/autotitledel_2013.xlsx b/chart2/qa/extras/data/xlsx/autotitledel_2013.xlsx new file mode 100644 index 0000000..a507027 Binary files /dev/null and b/chart2/qa/extras/data/xlsx/autotitledel_2013.xlsx differ commit ed043994a5e1405350f475add8879ff0715698ed Author: Markus Mohrhard <markus.mohrh...@collabora.co.uk> Date: Fri Mar 13 15:48:05 2015 +0100 missing space in log message Change-Id: I464dbf8cf9c65f2dd5e88236be8ddf4c0676bfdd diff --git a/vcl/source/opengl/OpenGLHelper.cxx b/vcl/source/opengl/OpenGLHelper.cxx index 499c1ed..e692584 100644 --- a/vcl/source/opengl/OpenGLHelper.cxx +++ b/vcl/source/opengl/OpenGLHelper.cxx @@ -92,7 +92,7 @@ namespace { SAL_WARN("vcl.opengl", rDetail << " shader " << nId << " compile for " << rName << " failed : " << &ErrorMessage[0]); } else - SAL_WARN("vcl.opengl", rDetail << " shader: " << rName << " compile " << nId << "failed without error log"); + SAL_WARN("vcl.opengl", rDetail << " shader: " << rName << " compile " << nId << " failed without error log"); return 0; } } commit 708d201884c4940647dc65e43e887803f06dce87 Author: Markus Mohrhard <markus.mohrh...@collabora.co.uk> Date: Tue Mar 10 14:42:26 2015 +0100 handle one more place with MSO 2007 vs OOXML spec for charts Change-Id: I7dbc3017f2bba7b186174be2e4fd8c9ce7005d34 diff --git a/oox/source/drawingml/chart/chartspacefragment.cxx b/oox/source/drawingml/chart/chartspacefragment.cxx index eb014ef..159bc0e 100644 --- a/oox/source/drawingml/chart/chartspacefragment.cxx +++ b/oox/source/drawingml/chart/chartspacefragment.cxx @@ -91,8 +91,12 @@ ContextHandlerRef ChartSpaceFragment::onCreateContext( sal_Int32 nElement, const case C_TOKEN( backWall ): return new WallFloorContext( *this, mrModel.mxBackWall.create() ); case C_TOKEN( dispBlanksAs ): - mrModel.mnDispBlanksAs = rAttribs.getToken( XML_val, XML_zero ); + { + bool bMSO2007Document = getFilter().isMSO2007Document(); + // default value is XML_gap for MSO 2007 and XML_zero in OOXML + mrModel.mnDispBlanksAs = rAttribs.getToken( XML_val, bMSO2007Document ? XML_gap : XML_zero ); return 0; + } case C_TOKEN( floor ): return new WallFloorContext( *this, mrModel.mxFloor.create() ); case C_TOKEN( legend ): diff --git a/oox/source/drawingml/chart/chartspacemodel.cxx b/oox/source/drawingml/chart/chartspacemodel.cxx index 7dab058..8a14bb0 100644 --- a/oox/source/drawingml/chart/chartspacemodel.cxx +++ b/oox/source/drawingml/chart/chartspacemodel.cxx @@ -25,7 +25,7 @@ namespace drawingml { namespace chart { ChartSpaceModel::ChartSpaceModel(bool bMSO2007Doc) : - mnDispBlanksAs( XML_gap ), // not zero as specified, TODO: OOXML_spec + mnDispBlanksAs( bMSO2007Doc ? XML_gap : XML_zero ), // difference between OOXML spec and MSO 2007 mnStyle( 2 ), mbAutoTitleDel( !bMSO2007Doc ), // difference between OOXML spec and MSO 2007 mbPlotVisOnly( false ), _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits