diff options
Diffstat (limited to 'chart2')
-rw-r--r-- | chart2/qa/extras/chart2export.cxx | 33 | ||||
-rw-r--r-- | chart2/qa/extras/chart2import.cxx | 24 |
2 files changed, 38 insertions, 19 deletions
diff --git a/chart2/qa/extras/chart2export.cxx b/chart2/qa/extras/chart2export.cxx index c8b4c03755e7..309381d80224 100644 --- a/chart2/qa/extras/chart2export.cxx +++ b/chart2/qa/extras/chart2export.cxx @@ -1817,11 +1817,13 @@ void Chart2ExportTest::testTitleManualLayoutXLSX() OUString aXVal = getXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:layout/c:manualLayout/c:x", "val"); double nX = aXVal.toDouble(); - CPPUNIT_ASSERT(nX > 0 && nX < 1); + CPPUNIT_ASSERT(nX > 0); + CPPUNIT_ASSERT(nX < 1); OUString aYVal = getXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:layout/c:manualLayout/c:y", "val"); double nY = aYVal.toDouble(); - CPPUNIT_ASSERT(nY > 0 && nY < 1); + CPPUNIT_ASSERT(nY > 0); + CPPUNIT_ASSERT(nY < 1); CPPUNIT_ASSERT(nX != nY); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:bodyPr", "rot", "1200000"); @@ -1839,20 +1841,24 @@ void Chart2ExportTest::testPlotAreaManualLayoutXLSX() OUString aXVal = getXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:layout/c:manualLayout/c:x", "val"); double nX = aXVal.toDouble(); - CPPUNIT_ASSERT(nX > 0 && nX < 1); + CPPUNIT_ASSERT(nX > 0); + CPPUNIT_ASSERT(nX < 1); OUString aYVal = getXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:layout/c:manualLayout/c:y", "val"); double nY = aYVal.toDouble(); - CPPUNIT_ASSERT(nY > 0 && nY < 1); + CPPUNIT_ASSERT(nY > 0); + CPPUNIT_ASSERT(nY < 1); CPPUNIT_ASSERT(nX != nY); OUString aWVal = getXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:layout/c:manualLayout/c:w", "val"); double nW = aWVal.toDouble(); - CPPUNIT_ASSERT(nW > 0 && nW < 1); + CPPUNIT_ASSERT(nW > 0); + CPPUNIT_ASSERT(nW < 1); OUString aHVal = getXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:layout/c:manualLayout/c:h", "val"); double nH = aHVal.toDouble(); - CPPUNIT_ASSERT(nH > 0 && nH < 1); + CPPUNIT_ASSERT(nH > 0); + CPPUNIT_ASSERT(nH < 1); CPPUNIT_ASSERT(nH != nW); } @@ -1868,20 +1874,24 @@ void Chart2ExportTest::testLegendManualLayoutXLSX() OUString aXVal = getXPath(pXmlDoc, "/c:chartSpace/c:chart/c:legend/c:layout/c:manualLayout/c:x", "val"); double nX = aXVal.toDouble(); - CPPUNIT_ASSERT(nX > 0 && nX < 1); + CPPUNIT_ASSERT(nX > 0); + CPPUNIT_ASSERT(nX < 1); OUString aYVal = getXPath(pXmlDoc, "/c:chartSpace/c:chart/c:legend/c:layout/c:manualLayout/c:y", "val"); double nY = aYVal.toDouble(); - CPPUNIT_ASSERT(nY > 0 && nY < 1); + CPPUNIT_ASSERT(nY > 0); + CPPUNIT_ASSERT(nY < 1); CPPUNIT_ASSERT(nX != nY); OUString aWVal = getXPath(pXmlDoc, "/c:chartSpace/c:chart/c:legend/c:layout/c:manualLayout/c:w", "val"); double nW = aWVal.toDouble(); - CPPUNIT_ASSERT(nW > 0 && nW < 1); + CPPUNIT_ASSERT(nW > 0); + CPPUNIT_ASSERT(nW < 1); OUString aHVal = getXPath(pXmlDoc, "/c:chartSpace/c:chart/c:legend/c:layout/c:manualLayout/c:h", "val"); double nH = aHVal.toDouble(); - CPPUNIT_ASSERT(nH > 0 && nH < 1); + CPPUNIT_ASSERT(nH > 0); + CPPUNIT_ASSERT(nH < 1); CPPUNIT_ASSERT(nH != nW); // Make sure that default text font size is preserved after export @@ -2946,7 +2956,8 @@ void Chart2ExportTest::testTdf134255() CPPUNIT_ASSERT(xDataSeries.is()); Reference< beans::XPropertySet > xPropSet(xDataSeries, UNO_QUERY_THROW); bool bWrap = false; - CPPUNIT_ASSERT((xPropSet->getPropertyValue("TextWordWrap") >>= bWrap) && bWrap); + CPPUNIT_ASSERT((xPropSet->getPropertyValue("TextWordWrap") >>= bWrap)); + CPPUNIT_ASSERT(bWrap); // export test xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text"); diff --git a/chart2/qa/extras/chart2import.cxx b/chart2/qa/extras/chart2import.cxx index 57c7227b49c1..4b425a386b70 100644 --- a/chart2/qa/extras/chart2import.cxx +++ b/chart2/qa/extras/chart2import.cxx @@ -707,7 +707,8 @@ void Chart2ImportTest::testPPTXPercentageNumberFormats() Reference<beans::XPropertySet> xPS(xYAxis, uno::UNO_QUERY_THROW); bool bLinkNumberFormatToSource = true; bool bSuccess = xPS->getPropertyValue(CHART_UNONAME_LINK_TO_SRC_NUMFMT) >>= bLinkNumberFormatToSource; - CPPUNIT_ASSERT_MESSAGE("\"LinkNumberFormatToSource\" should be set to false.", bSuccess && !bLinkNumberFormatToSource); + CPPUNIT_ASSERT_MESSAGE("\"LinkNumberFormatToSource\" should be set to false.", bSuccess); + CPPUNIT_ASSERT_MESSAGE("\"LinkNumberFormatToSource\" should be set to false.", !bLinkNumberFormatToSource); // FIXME: This should be in fact "0.00%". // see TODO in oox/source/drawingml/chart/modelbase.cxx @@ -1049,19 +1050,22 @@ void Chart2ImportTest::testTdf124817() xDataSeries = getDataSeriesFromDoc(xChartDoc, 0); CPPUNIT_ASSERT(xDataSeries.is()); uno::Reference<beans::XPropertySet> xPropSet_0(xDataSeries, uno::UNO_QUERY_THROW); - CPPUNIT_ASSERT((xPropSet_0->getPropertyValue("Symbol") >>= aSymblProp) && (aSymblProp.Style == chart2::SymbolStyle_NONE)); + CPPUNIT_ASSERT((xPropSet_0->getPropertyValue("Symbol") >>= aSymblProp)); + CPPUNIT_ASSERT_EQUAL(chart2::SymbolStyle_NONE, aSymblProp.Style); // Check the symbol of data series 2 (marker style square) xDataSeries = getDataSeriesFromDoc(xChartDoc, 1); CPPUNIT_ASSERT(xDataSeries.is()); uno::Reference<beans::XPropertySet> xPropSet_1(xDataSeries, uno::UNO_QUERY_THROW); - CPPUNIT_ASSERT((xPropSet_1->getPropertyValue("Symbol") >>= aSymblProp) && (aSymblProp.FillColor == static_cast<sal_Int32>(0xED7D31))); + CPPUNIT_ASSERT((xPropSet_1->getPropertyValue("Symbol") >>= aSymblProp)); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0xED7D31), aSymblProp.FillColor); // Check the symbol of data series 3 (marker style diagonal cross) xDataSeries = getDataSeriesFromDoc(xChartDoc, 2); CPPUNIT_ASSERT(xDataSeries.is()); uno::Reference<beans::XPropertySet> xPropSet_2(xDataSeries, uno::UNO_QUERY_THROW); - CPPUNIT_ASSERT((xPropSet_2->getPropertyValue("Symbol") >>= aSymblProp) && (aSymblProp.BorderColor == static_cast<sal_Int32>(0xFF0000))); + CPPUNIT_ASSERT((xPropSet_2->getPropertyValue("Symbol") >>= aSymblProp)); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0xFF0000), aSymblProp.BorderColor); } void Chart2ImportTest::testTdf126033() @@ -1284,7 +1288,8 @@ void Chart2ImportTest::testNumberFormatsXLSX() bool bSuccess = xPropertySet->getPropertyValue("PercentageNumberFormat") >>= nNumberFormat; CPPUNIT_ASSERT_EQUAL(false, bSuccess); bSuccess = xPropertySet->getPropertyValue(CHART_UNONAME_LINK_TO_SRC_NUMFMT) >>= bLinkNumberFormatToSource; - CPPUNIT_ASSERT_MESSAGE("\"LinkNumberFormatToSource\" should be set to true.", bSuccess && bLinkNumberFormatToSource); + CPPUNIT_ASSERT_MESSAGE("\"LinkNumberFormatToSource\" should be set to true.", bSuccess); + CPPUNIT_ASSERT_MESSAGE("\"LinkNumberFormatToSource\" should be set to true.", bLinkNumberFormatToSource); xPropertySet.set(xDataSeries->getDataPointByIndex(1), uno::UNO_SET_THROW); xPropertySet->getPropertyValue("Label") >>= aLabel; @@ -1295,7 +1300,8 @@ void Chart2ImportTest::testNumberFormatsXLSX() bSuccess = xPropertySet->getPropertyValue("PercentageNumberFormat") >>= nNumberFormat; CPPUNIT_ASSERT_EQUAL(false, bSuccess); bSuccess = xPropertySet->getPropertyValue(CHART_UNONAME_LINK_TO_SRC_NUMFMT) >>= bLinkNumberFormatToSource; - CPPUNIT_ASSERT_MESSAGE("\"LinkNumberFormatToSource\" should be set to true.", bSuccess && bLinkNumberFormatToSource); + CPPUNIT_ASSERT_MESSAGE("\"LinkNumberFormatToSource\" should be set to true.", bSuccess); + CPPUNIT_ASSERT_MESSAGE("\"LinkNumberFormatToSource\" should be set to true.", bLinkNumberFormatToSource); xPropertySet.set(xDataSeries->getDataPointByIndex(2), uno::UNO_SET_THROW); xPropertySet->getPropertyValue("Label") >>= aLabel; @@ -1306,7 +1312,8 @@ void Chart2ImportTest::testNumberFormatsXLSX() bSuccess = xPropertySet->getPropertyValue("PercentageNumberFormat") >>= nNumberFormat; CPPUNIT_ASSERT_EQUAL(false, bSuccess); bSuccess = xPropertySet->getPropertyValue(CHART_UNONAME_LINK_TO_SRC_NUMFMT) >>= bLinkNumberFormatToSource; - CPPUNIT_ASSERT_MESSAGE("\"LinkNumberFormatToSource\" should be set to true.", bSuccess && bLinkNumberFormatToSource); + CPPUNIT_ASSERT_MESSAGE("\"LinkNumberFormatToSource\" should be set to true.", bSuccess); + CPPUNIT_ASSERT_MESSAGE("\"LinkNumberFormatToSource\" should be set to true.", bLinkNumberFormatToSource); } void Chart2ImportTest::testNumberFormatsDOCX() @@ -1371,7 +1378,8 @@ void Chart2ImportTest::testPercentageNumberFormatsDOCX() CPPUNIT_ASSERT_EQUAL(sal_False, aLabel.ShowNumber); CPPUNIT_ASSERT_EQUAL(sal_True, aLabel.ShowNumberInPercent); bool bSuccess = xPropertySet->getPropertyValue(CHART_UNONAME_LINK_TO_SRC_NUMFMT) >>= bLinkNumberFormatToSource; - CPPUNIT_ASSERT_MESSAGE("\"LinkNumberFormatToSource\" should be set to true.", bSuccess && bLinkNumberFormatToSource); + CPPUNIT_ASSERT_MESSAGE("\"LinkNumberFormatToSource\" should be set to true.", bSuccess); + CPPUNIT_ASSERT_MESSAGE("\"LinkNumberFormatToSource\" should be set to true.", bLinkNumberFormatToSource); } void Chart2ImportTest::testAutoTitleDelDefaultValue2007XLSX() |