diff --git a/chart2/source/controller/sidebar/ChartAxisPanel.cxx b/chart2/source/controller/sidebar/ChartAxisPanel.cxx index 77fdaf45f119..63807f37c9ec 100644 --- a/chart2/source/controller/sidebar/ChartAxisPanel.cxx +++ b/chart2/source/controller/sidebar/ChartAxisPanel.cxx @@ -24,6 +24,7 @@ #include #include +#include #include "ChartAxisPanel.hxx" #include @@ -166,7 +167,8 @@ OUString getCID(const css::uno::Reference& xModel) aAny >>= aCID; #if defined DBG_UTIL && !defined NDEBUG ObjectType eType = ObjectIdentifier::getObjectType(aCID); - assert(eType == OBJECTTYPE_AXIS); + if(eType != OBJECTTYPE_AXIS) + SAL_WARN("chart2","Selected item is not an axis"); #endif return aCID; @@ -271,6 +273,10 @@ void ChartAxisPanel::updateData() return; OUString aCID = getCID(mxModel); + ObjectType eType = ObjectIdentifier::getObjectType(aCID); + if (eType!=OBJECTTYPE_AXIS) + return; + SolarMutexGuard aGuard; mxCBShowLabel->set_active(isLabelShown(mxModel, aCID)); diff --git a/chart2/source/controller/sidebar/ChartErrorBarPanel.cxx b/chart2/source/controller/sidebar/ChartErrorBarPanel.cxx index c31990146953..cb768d34dd15 100644 --- a/chart2/source/controller/sidebar/ChartErrorBarPanel.cxx +++ b/chart2/source/controller/sidebar/ChartErrorBarPanel.cxx @@ -24,6 +24,8 @@ #include "ChartErrorBarPanel.hxx" #include #include +#include + using namespace css; using namespace css::uno; @@ -220,9 +222,11 @@ OUString getCID(const css::uno::Reference& xModel) aAny >>= aCID; #if defined DBG_UTIL && !defined NDEBUG ObjectType eType = ObjectIdentifier::getObjectType(aCID); - assert(eType == OBJECTTYPE_DATA_ERRORS_X || - eType == OBJECTTYPE_DATA_ERRORS_Y || - eType == OBJECTTYPE_DATA_ERRORS_Z); + if (eType != OBJECTTYPE_DATA_ERRORS_X && + eType != OBJECTTYPE_DATA_ERRORS_Y && + eType != OBJECTTYPE_DATA_ERRORS_Z) + SAL_WARN("chart2","Selected item is not an error bar"); + #endif return aCID; @@ -297,6 +301,12 @@ void ChartErrorBarPanel::updateData() return; OUString aCID = getCID(mxModel); + ObjectType eType = ObjectIdentifier::getObjectType(aCID); + if (eType != OBJECTTYPE_DATA_ERRORS_X && + eType != OBJECTTYPE_DATA_ERRORS_Y && + eType != OBJECTTYPE_DATA_ERRORS_Z) + return; + bool bPos = showPositiveError(mxModel, aCID); bool bNeg = showNegativeError(mxModel, aCID); diff --git a/chart2/source/controller/sidebar/ChartSeriesPanel.cxx b/chart2/source/controller/sidebar/ChartSeriesPanel.cxx index 83a3251925f1..8a0c0d787db3 100644 --- a/chart2/source/controller/sidebar/ChartSeriesPanel.cxx +++ b/chart2/source/controller/sidebar/ChartSeriesPanel.cxx @@ -28,6 +28,7 @@ #include #include +#include #include "ChartSeriesPanel.hxx" #include @@ -264,8 +265,10 @@ OUString getCID(const css::uno::Reference& xModel) #if defined DBG_UTIL && !defined NDEBUG ObjectType eType = ObjectIdentifier::getObjectType(aCID); - assert(eType == OBJECTTYPE_DATA_SERIES || eType == OBJECTTYPE_DATA_POINT - || eType == OBJECTTYPE_DATA_CURVE); + if (eType != OBJECTTYPE_DATA_SERIES && + eType != OBJECTTYPE_DATA_POINT && + eType != OBJECTTYPE_DATA_CURVE) + SAL_WARN("chart2","Selected item is not a chart series"); #endif return aCID; @@ -355,6 +358,12 @@ void ChartSeriesPanel::updateData() return; OUString aCID = getCID(mxModel); + ObjectType eType = ObjectIdentifier::getObjectType(aCID); + if (eType!=OBJECTTYPE_DATA_SERIES && + eType != OBJECTTYPE_DATA_POINT && + eType != OBJECTTYPE_DATA_CURVE) + return; + SolarMutexGuard aGuard; bool bLabelVisible = isDataLabelVisible(mxModel, aCID); mxCBLabel->set_active(bLabelVisible);