summaryrefslogtreecommitdiffstats
path: root/chart2/qa/extras/PivotChartTest.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'chart2/qa/extras/PivotChartTest.cxx')
-rw-r--r--chart2/qa/extras/PivotChartTest.cxx36
1 files changed, 16 insertions, 20 deletions
diff --git a/chart2/qa/extras/PivotChartTest.cxx b/chart2/qa/extras/PivotChartTest.cxx
index ee024531e88b..d6a87ec057a9 100644
--- a/chart2/qa/extras/PivotChartTest.cxx
+++ b/chart2/qa/extras/PivotChartTest.cxx
@@ -34,7 +34,8 @@ namespace com::sun::star::util { class XNumberFormats; }
class PivotChartTest : public ChartTest
{
public:
- PivotChartTest() : ChartTest()
+ PivotChartTest()
+ : ChartTest("/chart2/qa/extras/data/")
{}
void testRoundtrip();
@@ -71,7 +72,7 @@ void lclModifyOrientation(uno::Reference<sheet::XDataPilotDescriptor> const & xD
OUString aName = xNamed->getName();
uno::Reference<beans::XPropertySet> xPropSet(xNamed, UNO_QUERY_THROW);
if (aName == sFieldName)
- xPropSet->setPropertyValue("Orientation", uno::makeAny(eOrientation));
+ xPropSet->setPropertyValue("Orientation", uno::Any(eOrientation));
}
}
@@ -87,7 +88,7 @@ void lclModifyFunction(uno::Reference<sheet::XDataPilotDescriptor> const & xDesc
OUString aName = xNamed->getName();
uno::Reference<beans::XPropertySet> xPropSet(xNamed, UNO_QUERY_THROW);
if (aName == sFieldName)
- xPropSet->setPropertyValue("Function", uno::makeAny(eFunction));
+ xPropSet->setPropertyValue("Function", uno::Any(eFunction));
}
}
@@ -134,13 +135,13 @@ void lclModifySubtotals(uno::Reference<sheet::XDataPilotDescriptor> const & xDes
void lclModifyColumnGrandTotal(uno::Reference<sheet::XDataPilotDescriptor> const & xDataPilotDescriptor, bool bTotal)
{
uno::Reference<beans::XPropertySet> xProperties(xDataPilotDescriptor, uno::UNO_QUERY_THROW);
- xProperties->setPropertyValue("ColumnGrand", uno::makeAny(bTotal));
+ xProperties->setPropertyValue("ColumnGrand", uno::Any(bTotal));
}
void lclModifyRowGrandTotal(uno::Reference<sheet::XDataPilotDescriptor> const & xDataPilotDescriptor, bool bTotal)
{
uno::Reference<beans::XPropertySet> xProperties(xDataPilotDescriptor, uno::UNO_QUERY_THROW);
- xProperties->setPropertyValue("RowGrand", uno::makeAny(bTotal));
+ xProperties->setPropertyValue("RowGrand", uno::Any(bTotal));
}
void lclCheckSequence(std::vector<double> const & reference,
@@ -293,7 +294,7 @@ table::CellRangeAddress lclCreateTestData(uno::Reference<sheet::XSpreadsheetDocu
sal_Int32 nDateKey = xNumberFormatTypes->getStandardFormat(util::NumberFormat::DATE, aLocale);
uno::Reference<table::XCellRange> xCellRange = xSheet->getCellRangeByPosition(nEndCol, 1, nEndCol, nEndRow);
uno::Reference<beans::XPropertySet> xCellProp(xCellRange, UNO_QUERY_THROW);
- xCellProp->setPropertyValue("NumberFormat", uno::makeAny(nDateKey));
+ xCellProp->setPropertyValue("NumberFormat", uno::Any(nDateKey));
table::CellRangeAddress sCellRangeAddress;
sCellRangeAddress.Sheet = 0;
@@ -316,7 +317,7 @@ void PivotChartTest::testRoundtrip()
std::vector<double> aReference2 { 101879.458079, 178636.929704, 314626.484864 };
- load(u"/chart2/qa/extras/data/ods/", "PivotChartRoundTrip.ods");
+ loadFromFile(u"ods/PivotChartRoundTrip.ods");
xChartDoc = getPivotChartDocFromSheet(1, mxComponent);
CPPUNIT_ASSERT(xChartDoc.is());
@@ -351,7 +352,7 @@ void PivotChartTest::testRoundtrip()
CPPUNIT_ASSERT_EQUAL(OUString("Total"), lclGetLabel(xChartDoc, 0));
}
- reload("calc8");
+ saveAndReload("calc8");
xChartDoc = getPivotChartDocFromSheet(1, mxComponent);
CPPUNIT_ASSERT(xChartDoc.is());
@@ -371,7 +372,7 @@ void PivotChartTest::testChangePivotTable()
uno::Sequence<uno::Any> xSequence;
Reference<chart2::XChartDocument> xChartDoc;
- load(u"/chart2/qa/extras/data/ods/", "PivotTableExample.ods");
+ loadFromFile(u"ods/PivotTableExample.ods");
// Check we have the Pivot Table
OUString sPivotTableName("DataPilot1");
@@ -493,7 +494,7 @@ void PivotChartTest::testChangePivotTable()
// Enable column totals and check the data is still unchanged
{
uno::Reference<beans::XPropertySet> xProperties(xDataPilotTable, uno::UNO_QUERY_THROW);
- xProperties->setPropertyValue("ColumnGrand", uno::makeAny(true));
+ xProperties->setPropertyValue("ColumnGrand", uno::Any(true));
}
CPPUNIT_ASSERT_EQUAL(sal_Int32(3), getNumberOfDataSeries(xChartDoc));
@@ -528,8 +529,7 @@ void PivotChartTest::testPivotChartWithOneColumnField()
// SETUP DATA and PIVOT TABLE
- if (!mxComponent.is())
- mxComponent = loadFromDesktop("private:factory/scalc");
+ mxComponent = loadFromDesktop("private:factory/scalc");
uno::Reference<sheet::XSpreadsheetDocument> xSheetDoc(mxComponent, uno::UNO_QUERY_THROW);
@@ -610,8 +610,7 @@ void PivotChartTest::testPivotChartWithOneRowField()
// SETUP DATA and PIVOT TABLE
- if (!mxComponent.is())
- mxComponent = loadFromDesktop("private:factory/scalc");
+ mxComponent = loadFromDesktop("private:factory/scalc");
uno::Reference<sheet::XSpreadsheetDocument> xSheetDoc(mxComponent, uno::UNO_QUERY_THROW);
@@ -670,8 +669,7 @@ void PivotChartTest::testPivotTableDataProvider_PivotTableFields()
{
// SETUP DATA and PIVOT TABLE
- if (!mxComponent.is())
- mxComponent = loadFromDesktop("private:factory/scalc");
+ mxComponent = loadFromDesktop("private:factory/scalc");
uno::Reference<sheet::XSpreadsheetDocument> xSheetDoc(mxComponent, uno::UNO_QUERY_THROW);
@@ -778,8 +776,7 @@ void PivotChartTest::testPivotChartRowFieldInOutlineMode()
{
// SETUP DATA and PIVOT TABLE
- if (!mxComponent.is())
- mxComponent = loadFromDesktop("private:factory/scalc");
+ mxComponent = loadFromDesktop("private:factory/scalc");
uno::Reference<sheet::XSpreadsheetDocument> xSheetDoc(mxComponent, uno::UNO_QUERY_THROW);
@@ -908,8 +905,7 @@ void PivotChartTest::testPivotChartWithDateRowField()
{
// SETUP DATA and PIVOT TABLE
- if (!mxComponent.is())
- mxComponent = loadFromDesktop("private:factory/scalc");
+ mxComponent = loadFromDesktop("private:factory/scalc");
uno::Reference<sheet::XSpreadsheetDocument> xSheetDoc(mxComponent, uno::UNO_QUERY_THROW);