summaryrefslogtreecommitdiff
path: root/chart2
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-06-09 13:43:00 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-06-09 14:24:00 +0200
commit027b25ecd54ac97ea2471ca73e3ba89ce052fe76 (patch)
treefe8923a13998a96a865027c897273d0edb4d7c62 /chart2
parentf59e802478e35e7b6f561f24806bca47b604529b (diff)
use comphelper::InitPropertySequence in more places
Change-Id: I72d7b13a23ce306b752b39187a0e9fbb7028643a Reviewed-on: https://gerrit.libreoffice.org/38606 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'chart2')
-rw-r--r--chart2/qa/extras/PivotChartTest.cxx6
-rw-r--r--chart2/source/model/main/ChartModel.cxx26
2 files changed, 9 insertions, 23 deletions
diff --git a/chart2/qa/extras/PivotChartTest.cxx b/chart2/qa/extras/PivotChartTest.cxx
index f1a345fa964c..d03afda37b2e 100644
--- a/chart2/qa/extras/PivotChartTest.cxx
+++ b/chart2/qa/extras/PivotChartTest.cxx
@@ -188,10 +188,8 @@ uno::Reference<sheet::XDataPilotTable> lclGetPivotTableByName(sal_Int32 nIndex,
uno::Sequence<uno::Reference<chart2::data::XLabeledDataSequence>>
lclGetCategories(Reference<chart2::XChartDocument> const & xChartDoc)
{
- uno::Sequence<beans::PropertyValue> aArguments(1);
- aArguments[0] = beans::PropertyValue("CellRangeRepresentation", -1,
- uno::makeAny<OUString>("PT@categories"),
- beans::PropertyState_DIRECT_VALUE);
+ uno::Sequence<beans::PropertyValue> aArguments( comphelper::InitPropertySequence(
+ {{"CellRangeRepresentation", uno::Any(OUString("PT@categories"))}} ));
uno::Reference<chart2::data::XDataProvider> xDataProvider(xChartDoc->getDataProvider(), uno::UNO_QUERY_THROW);
return xDataProvider->createDataSource(aArguments)->getDataSequences();
diff --git a/chart2/source/model/main/ChartModel.cxx b/chart2/source/model/main/ChartModel.cxx
index b83e04408b82..bef84f2006b3 100644
--- a/chart2/source/model/main/ChartModel.cxx
+++ b/chart2/source/model/main/ChartModel.cxx
@@ -41,6 +41,7 @@
#include <com/sun/star/chart2/data/XPivotTableDataProvider.hpp>
#include <comphelper/processfactory.hxx>
+#include <comphelper/propertysequence.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <svl/numuno.hxx>
@@ -744,25 +745,12 @@ Reference< chart2::data::XDataSource > ChartModel::impl_createDefaultData()
xIni->initialize(aArgs);
}
//create data
- uno::Sequence<beans::PropertyValue> aArgs(4);
- aArgs[0] = beans::PropertyValue(
- "CellRangeRepresentation", -1,
- uno::Any( OUString("all") ), beans::PropertyState_DIRECT_VALUE );
- aArgs[1] = beans::PropertyValue(
- "HasCategories",
- -1,
- uno::Any( true ),
- beans::PropertyState_DIRECT_VALUE );
- aArgs[2] = beans::PropertyValue(
- "FirstCellAsLabel",
- -1,
- uno::Any( true ),
- beans::PropertyState_DIRECT_VALUE );
- aArgs[3] = beans::PropertyValue(
- "DataRowSource",
- -1,
- uno::Any( css::chart::ChartDataRowSource_COLUMNS ),
- beans::PropertyState_DIRECT_VALUE );
+ uno::Sequence<beans::PropertyValue> aArgs( comphelper::InitPropertySequence({
+ { "CellRangeRepresentation", uno::Any( OUString("all") ) },
+ { "HasCategories", uno::Any( true ) },
+ { "FirstCellAsLabel", uno::Any( true ) },
+ { "DataRowSource", uno::Any( css::chart::ChartDataRowSource_COLUMNS ) }
+ }));
xDataSource = m_xInternalDataProvider->createDataSource( aArgs );
}
}