[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - chart2/source
Ouyang Leyan (via logerrit)
logerrit at kemper.freedesktop.org
Tue Nov 10 16:06:24 UTC 2020
chart2/source/controller/sidebar/ChartAxisPanel.cxx | 8 +++++++-
chart2/source/controller/sidebar/ChartErrorBarPanel.cxx | 16 +++++++++++++---
chart2/source/controller/sidebar/ChartSeriesPanel.cxx | 12 +++++++++++-
3 files changed, 31 insertions(+), 5 deletions(-)
New commits:
commit a5305624f21919352fa5d89c2cf259b0354d8a03
Author: Ouyang Leyan <ouyang.leyan at hotmail.com>
AuthorDate: Sun Sep 6 20:11:57 2020 +0200
Commit: Xisco Fauli <xiscofauli at libreoffice.org>
CommitDate: Tue Nov 10 17:05:51 2020 +0100
tdf#133630 Check object type when updating side panel data
Change-Id: I033b4c7fb1dc1787d28caf5b925ed45bbb63cf06
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102544
Tested-by: Jenkins
Reviewed-by: Andras Timar <andras.timar at collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105524
Tested-by: Xisco Fauli <xiscofauli at libreoffice.org>
Reviewed-by: Xisco Fauli <xiscofauli at libreoffice.org>
diff --git a/chart2/source/controller/sidebar/ChartAxisPanel.cxx b/chart2/source/controller/sidebar/ChartAxisPanel.cxx
index 593071ac1ab3..084ec37a2227 100644
--- a/chart2/source/controller/sidebar/ChartAxisPanel.cxx
+++ b/chart2/source/controller/sidebar/ChartAxisPanel.cxx
@@ -24,6 +24,7 @@
#include <com/sun/star/util/XModifyBroadcaster.hpp>
#include <vcl/svapp.hxx>
+#include <sal/log.hxx>
#include "ChartAxisPanel.hxx"
#include <ChartController.hxx>
@@ -166,7 +167,8 @@ OUString getCID(const css::uno::Reference<css::frame::XModel>& 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 819f8f1ed2dd..7e035f9b7c77 100644
--- a/chart2/source/controller/sidebar/ChartErrorBarPanel.cxx
+++ b/chart2/source/controller/sidebar/ChartErrorBarPanel.cxx
@@ -24,6 +24,8 @@
#include "ChartErrorBarPanel.hxx"
#include <ChartController.hxx>
#include <vcl/svapp.hxx>
+#include <sal/log.hxx>
+
using namespace css;
using namespace css::uno;
@@ -220,9 +222,11 @@ OUString getCID(const css::uno::Reference<css::frame::XModel>& 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 d014337a9d8a..abc45c555770 100644
--- a/chart2/source/controller/sidebar/ChartSeriesPanel.cxx
+++ b/chart2/source/controller/sidebar/ChartSeriesPanel.cxx
@@ -28,6 +28,7 @@
#include <com/sun/star/util/XModifyBroadcaster.hpp>
#include <vcl/svapp.hxx>
+#include <sal/log.hxx>
#include "ChartSeriesPanel.hxx"
#include <ChartController.hxx>
@@ -264,7 +265,10 @@ OUString getCID(const css::uno::Reference<css::frame::XModel>& xModel)
#if defined DBG_UTIL && !defined NDEBUG
ObjectType eType = ObjectIdentifier::getObjectType(aCID);
- assert(eType == OBJECTTYPE_DATA_SERIES || eType == OBJECTTYPE_DATA_POINT);
+ 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;
@@ -354,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);
More information about the Libreoffice-commits
mailing list