summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--chart2/source/controller/dialogs/dlg_PropertyMapping.cxx11
-rw-r--r--chart2/source/controller/dialogs/dlg_PropertyMapping.hxx5
-rw-r--r--chart2/source/controller/dialogs/tp_DataSource.cxx6
-rw-r--r--chart2/source/model/template/BubbleChartType.cxx10
-rw-r--r--chart2/source/model/template/BubbleChartType.hxx3
-rw-r--r--chart2/source/model/template/ChartType.cxx6
-rw-r--r--chart2/source/model/template/ChartType.hxx3
-rw-r--r--offapi/com/sun/star/chart2/XChartType.idl6
8 files changed, 42 insertions, 8 deletions
diff --git a/chart2/source/controller/dialogs/dlg_PropertyMapping.cxx b/chart2/source/controller/dialogs/dlg_PropertyMapping.cxx
index 0f193b89f743..a10c84f31e97 100644
--- a/chart2/source/controller/dialogs/dlg_PropertyMapping.cxx
+++ b/chart2/source/controller/dialogs/dlg_PropertyMapping.cxx
@@ -9,6 +9,8 @@
#include "dlg_PropertyMapping.hxx"
+using namespace com::sun::star;
+
namespace chart {
namespace {
@@ -38,7 +40,7 @@ std::vector<OUString> getEntries()
}
-PropertyMappingDlg::PropertyMappingDlg(Window* pParent)
+PropertyMappingDlg::PropertyMappingDlg(Window* pParent, uno::Reference< chart2::XChartType > xChartType )
: ModalDialog(pParent, "PropertyMappingDialog",
"modules/schart/ui/dlg_PropertyMapping.ui")
{
@@ -47,11 +49,10 @@ PropertyMappingDlg::PropertyMappingDlg(Window* pParent)
get(mpBtnCancel, "cancel");
mpMappingTable->SetTabs( pListBoxTabs, MAP_APPFONT );
- std::vector<OUString> aEntries = getEntries();
- for(std::vector<OUString>::const_iterator itr = aEntries.begin(),
- itrEnd = aEntries.end(); itr != itrEnd; ++itr)
+ uno::Sequence< OUString > aPropRoles = xChartType->getSupportedPropertyRoles();
+ for(sal_Int32 i = 0, n = aPropRoles.getLength(); i < n; ++i)
{
- mpMappingTable->InsertEntry(*itr);
+ mpMappingTable->InsertEntry(aPropRoles[i]);
}
mpBtnOk->SetClickHdl( LINK( this, PropertyMappingDlg, OkBtnHdl ) );
mpBtnCancel->SetClickHdl( LINK( this, PropertyMappingDlg, CancelBtnHdl ) );
diff --git a/chart2/source/controller/dialogs/dlg_PropertyMapping.hxx b/chart2/source/controller/dialogs/dlg_PropertyMapping.hxx
index e6a6b4bd44b3..0c20de5f5dca 100644
--- a/chart2/source/controller/dialogs/dlg_PropertyMapping.hxx
+++ b/chart2/source/controller/dialogs/dlg_PropertyMapping.hxx
@@ -14,13 +14,16 @@
#include <vcl/button.hxx>
#include <svtools/svtabbx.hxx>
+#include <com/sun/star/chart2/XChartType.hpp>
+
namespace chart {
class PropertyMappingDlg : public ModalDialog
{
public:
- PropertyMappingDlg(Window* pParent);
+ PropertyMappingDlg(Window* pParent, com::sun::star::uno::Reference<
+ com::sun::star::chart2::XChartType > xChartType);
OUString getSelectedEntry();
diff --git a/chart2/source/controller/dialogs/tp_DataSource.cxx b/chart2/source/controller/dialogs/tp_DataSource.cxx
index 12533aa437b0..f15f2e1e8bbd 100644
--- a/chart2/source/controller/dialogs/tp_DataSource.cxx
+++ b/chart2/source/controller/dialogs/tp_DataSource.cxx
@@ -761,7 +761,11 @@ IMPL_LINK( DataSourceTabPage, RangeUpdateDataHdl, Edit*, pEdit )
IMPL_LINK_NOARG( DataSourceTabPage, AddMappingHdl )
{
- PropertyMappingDlg aDlg(this);
+ SeriesEntry * pSeriesEntry = dynamic_cast< SeriesEntry * >( m_pLB_SERIES->FirstSelected());
+ if(!pSeriesEntry)
+ return 0;
+
+ PropertyMappingDlg aDlg(this, pSeriesEntry->m_xChartType);
short aRet = aDlg.Execute();
if(aRet == RET_OK)
{
diff --git a/chart2/source/model/template/BubbleChartType.cxx b/chart2/source/model/template/BubbleChartType.cxx
index 1b68d5b9fa4e..999fe504a5b9 100644
--- a/chart2/source/model/template/BubbleChartType.cxx
+++ b/chart2/source/model/template/BubbleChartType.cxx
@@ -167,7 +167,6 @@ uno::Sequence< OUString > SAL_CALL BubbleChartType::getSupportedMandatoryRoles()
throw (uno::RuntimeException, std::exception)
{
uno::Sequence< OUString > aMandRolesSeq(4);
- aMandRolesSeq.realloc( 4 );
aMandRolesSeq[0] = "label";
aMandRolesSeq[1] = "values-x";
aMandRolesSeq[2] = "values-y";
@@ -175,6 +174,15 @@ uno::Sequence< OUString > SAL_CALL BubbleChartType::getSupportedMandatoryRoles()
return aMandRolesSeq;
}
+uno::Sequence< OUString > SAL_CALL BubbleChartType::getSupportedPropertyRoles()
+ throw(com::sun::star::uno::RuntimeException, std::exception)
+{
+ uno::Sequence< OUString > aPropertyRoles(2);
+ aPropertyRoles[0] = "FillColor";
+ aPropertyRoles[1] = "BorderColor";
+ return aPropertyRoles;
+}
+
OUString SAL_CALL BubbleChartType::getRoleOfSequenceForSeriesLabel()
throw (uno::RuntimeException, std::exception)
{
diff --git a/chart2/source/model/template/BubbleChartType.hxx b/chart2/source/model/template/BubbleChartType.hxx
index 03de9dbd8c72..c6cec1fad8e4 100644
--- a/chart2/source/model/template/BubbleChartType.hxx
+++ b/chart2/source/model/template/BubbleChartType.hxx
@@ -48,6 +48,9 @@ protected:
virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL
getSupportedMandatoryRoles()
throw (::com::sun::star::uno::RuntimeException, std::exception);
+ virtual com::sun::star::uno::Sequence< OUString > SAL_CALL
+ getSupportedPropertyRoles()
+ throw (::com::sun::star::uno::RuntimeException, std::exception);
virtual ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XCoordinateSystem > SAL_CALL
createCoordinateSystem( ::sal_Int32 DimensionCount )
throw (::com::sun::star::lang::IllegalArgumentException,
diff --git a/chart2/source/model/template/ChartType.cxx b/chart2/source/model/template/ChartType.cxx
index fa652c892677..7c5857753596 100644
--- a/chart2/source/model/template/ChartType.cxx
+++ b/chart2/source/model/template/ChartType.cxx
@@ -122,6 +122,12 @@ Sequence< OUString > SAL_CALL ChartType::getSupportedOptionalRoles()
return Sequence< OUString >();
}
+Sequence< OUString > SAL_CALL ChartType::getSupportedPropertyRoles()
+ throw (uno::RuntimeException, std::exception)
+{
+ return Sequence< OUString >();
+}
+
OUString SAL_CALL ChartType::getRoleOfSequenceForSeriesLabel()
throw (uno::RuntimeException, std::exception)
{
diff --git a/chart2/source/model/template/ChartType.hxx b/chart2/source/model/template/ChartType.hxx
index f450aa3c3052..3e36bf8ed721 100644
--- a/chart2/source/model/template/ChartType.hxx
+++ b/chart2/source/model/template/ChartType.hxx
@@ -80,6 +80,9 @@ protected:
throw (::com::sun::star::uno::RuntimeException, std::exception);
virtual OUString SAL_CALL getRoleOfSequenceForSeriesLabel()
throw (::com::sun::star::uno::RuntimeException, std::exception);
+ virtual com::sun::star::uno::Sequence< OUString > SAL_CALL
+ getSupportedPropertyRoles()
+ throw (::com::sun::star::uno::RuntimeException, std::exception);
// ____ XDataSeriesContainer ____
virtual void SAL_CALL addDataSeries(
diff --git a/offapi/com/sun/star/chart2/XChartType.idl b/offapi/com/sun/star/chart2/XChartType.idl
index f02b25b16b33..5dfe21f51566 100644
--- a/offapi/com/sun/star/chart2/XChartType.idl
+++ b/offapi/com/sun/star/chart2/XChartType.idl
@@ -72,6 +72,12 @@ interface XChartType : com::sun::star::uno::XInterface
*/
sequence< string > getSupportedOptionalRoles();
+ /** Returns a sequence with supported property mapping roles.
+
+ <p>An example for a property mappong role is FillColor.</p>
+ */
+ sequence< string > getSupportedPropertyRoles();
+
/** Returns the role of the XLabeledDataSequence of
which the label will be taken to identify the
DataSeries in dialogs or the legend.