summaryrefslogtreecommitdiff
path: root/chart2/source
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2024-03-27 21:56:50 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2024-03-28 17:17:32 +0100
commit5ec7c4eecf955090cc3bdd7a283aa5a291d12385 (patch)
tree817d8626dad27e0259522fe4b8436b19f12411f2 /chart2/source
parentccc2e526d107a353469b5aad99e94544c07a10ee (diff)
fix comparison of UIObject's inside UITests
using == to compare them doesnt work, because we return a new one with every call to getTopFocusWindow and similar. So add a equals() method to the UNO interface to do the comparison. Change-Id: Ie909fe9b4e84fe07f4ca87bbebf65b56d3da8f78 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165436 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'chart2/source')
-rw-r--r--chart2/source/controller/inc/uiobject.hxx2
-rw-r--r--chart2/source/controller/uitest/uiobject.cxx8
2 files changed, 10 insertions, 0 deletions
diff --git a/chart2/source/controller/inc/uiobject.hxx b/chart2/source/controller/inc/uiobject.hxx
index 917ba322bf5e..6de63f5d3fdf 100644
--- a/chart2/source/controller/inc/uiobject.hxx
+++ b/chart2/source/controller/inc/uiobject.hxx
@@ -32,6 +32,8 @@ public:
virtual OUString get_type() const override;
+ virtual bool equals(const UIObject& rOther) const override;
+
private:
OUString maCID;
diff --git a/chart2/source/controller/uitest/uiobject.cxx b/chart2/source/controller/uitest/uiobject.cxx
index 783a91982f84..c75f15c3885c 100644
--- a/chart2/source/controller/uitest/uiobject.cxx
+++ b/chart2/source/controller/uitest/uiobject.cxx
@@ -95,6 +95,14 @@ OUString ChartUIObject::get_type() const
return "ChartUIObject for type: ";
}
+bool ChartUIObject::equals(const UIObject& rOther) const
+{
+ const ChartUIObject* pOther = dynamic_cast<const ChartUIObject*>(&rOther);
+ if (!pOther)
+ return false;
+ return mxChartWindow.get() == pOther->mxChartWindow.get();
+}
+
ChartWindowUIObject::ChartWindowUIObject(const VclPtr<chart::ChartWindow>& xChartWindow):
WindowUIObject(xChartWindow),
mxChartWindow(xChartWindow)