summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-03-07 20:46:20 +0000
committerCaolán McNamara <caolanm@redhat.com>2021-03-09 10:07:24 +0100
commit6b0e1986a7c446cb6862f645e45c377c2a309065 (patch)
treec23ebdd0d7c40cb46c7a95ae3683c6d738af4694
parenta2d0741eed98db9c8b3509153a77d2e56b423d06 (diff)
decompose ScNavigatorDlgUIObject and use sub components directly
Change-Id: I817d0e201804dce3e83d204702ff236f5689ebb8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112148 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--sc/qa/uitest/calc_tests8/navigator.py7
-rw-r--r--sc/source/ui/inc/navipi.hxx3
-rw-r--r--sc/source/ui/inc/uiobject.hxx17
-rw-r--r--sc/source/ui/navipi/navipi.cxx5
-rw-r--r--sc/source/ui/uitest/uiobject.cxx28
5 files changed, 5 insertions, 55 deletions
diff --git a/sc/qa/uitest/calc_tests8/navigator.py b/sc/qa/uitest/calc_tests8/navigator.py
index abbb8ce1cf73..5e8cb99e01e3 100644
--- a/sc/qa/uitest/calc_tests8/navigator.py
+++ b/sc/qa/uitest/calc_tests8/navigator.py
@@ -91,7 +91,9 @@ class navigator(UITestCase):
xCalcDoc = self.xUITest.getTopFocusWindow()
xNavigatorPanel = xCalcDoc.getChild("NavigatorPanelParent")
- xNavigatorPanel.executeAction("ROOT", tuple())
+ xToolBar = xNavigatorPanel.getChild("toolbox2")
+ xToolBar.executeAction("CLICK", mkPropertyValues({"POS": "0"})) # 'toggle' button
+
xContentBox = xNavigatorPanel.getChild('contentbox')
# tdf#133079, without the fix in place, it would be 8
@@ -123,7 +125,8 @@ class navigator(UITestCase):
xCalcDoc = self.xUITest.getTopFocusWindow()
xNavigatorPanel = xCalcDoc.getChild("NavigatorPanelParent")
- xNavigatorPanel.executeAction("ROOT", tuple())
+ xToolBar = xNavigatorPanel.getChild("toolbox2")
+ xToolBar.executeAction("CLICK", mkPropertyValues({"POS": "0"})) # 'toggle' button
xRow = xNavigatorPanel.getChild('row')
xColumn = xNavigatorPanel.getChild('column')
diff --git a/sc/source/ui/inc/navipi.hxx b/sc/source/ui/inc/navipi.hxx
index 988822a69ee8..fae782112f7c 100644
--- a/sc/source/ui/inc/navipi.hxx
+++ b/sc/source/ui/inc/navipi.hxx
@@ -88,7 +88,6 @@ class ScNavigatorDlg : public PanelLayout, public SfxListener
friend class ScNavigatorControllerItem;
friend class ScNavigatorDialogWrapper;
friend class ScContentTree;
-friend class ScNavigatorDlgUIObject;
private:
static constexpr int CTRL_ITEMS = 4;
@@ -178,8 +177,6 @@ public:
virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
virtual void StateChanged(StateChangedType nStateChange) override;
-
- FactoryFunction GetUITestFactory() const override;
};
class ScNavigatorDialogWrapper: public SfxChildWindowContext
diff --git a/sc/source/ui/inc/uiobject.hxx b/sc/source/ui/inc/uiobject.hxx
index ae3583fff154..01ebdcdc6e89 100644
--- a/sc/source/ui/inc/uiobject.hxx
+++ b/sc/source/ui/inc/uiobject.hxx
@@ -45,21 +45,4 @@ private:
ScViewFunc* getViewFunc();
};
-class ScNavigatorDlg;
-
-class ScNavigatorDlgUIObject : public WindowUIObject
-{
- VclPtr<ScNavigatorDlg> mxScNavigatorDlg;
-
-public:
- ScNavigatorDlgUIObject(const VclPtr<ScNavigatorDlg>& xScNavigatorDlg);
-
- virtual void execute(const OUString& rAction, const StringMap& rParameters) override;
-
- static std::unique_ptr<UIObject> create(vcl::Window* pWindow);
-
-protected:
- virtual OUString get_name() const override;
-};
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/navipi/navipi.cxx b/sc/source/ui/navipi/navipi.cxx
index 6fea222a7938..d8fa920f2385 100644
--- a/sc/source/ui/navipi/navipi.cxx
+++ b/sc/source/ui/navipi/navipi.cxx
@@ -442,11 +442,6 @@ void ScNavigatorDlg::StateChanged(StateChangedType nStateChange)
}
}
-FactoryFunction ScNavigatorDlg::GetUITestFactory() const
-{
- return ScNavigatorDlgUIObject::create;
-}
-
ScNavigatorDlg::~ScNavigatorDlg()
{
disposeOnce();
diff --git a/sc/source/ui/uitest/uiobject.cxx b/sc/source/ui/uitest/uiobject.cxx
index 1e17f9301a58..d93da2619a77 100644
--- a/sc/source/ui/uitest/uiobject.cxx
+++ b/sc/source/ui/uitest/uiobject.cxx
@@ -381,32 +381,4 @@ OUString ScGridWinUIObject::get_name() const
return "ScGridWinUIObject";
}
-ScNavigatorDlgUIObject::ScNavigatorDlgUIObject(const VclPtr<ScNavigatorDlg>& xScNavigatorDlg):
- WindowUIObject(xScNavigatorDlg),
- mxScNavigatorDlg(xScNavigatorDlg)
-{
-}
-
-void ScNavigatorDlgUIObject::execute(const OUString& rAction,
- const StringMap& rParameters)
-{
- if (rAction == "ROOT")
- {
- mxScNavigatorDlg->ToolBoxSelectHdl("toggle");
- }
- else
- WindowUIObject::execute(rAction, rParameters);
-}
-
-std::unique_ptr<UIObject> ScNavigatorDlgUIObject::create(vcl::Window* pWindow)
-{
- ScNavigatorDlg* pScNavigatorDlg = dynamic_cast<ScNavigatorDlg*>(pWindow);
- assert(pScNavigatorDlg);
- return std::unique_ptr<UIObject>(new ScNavigatorDlgUIObject(pScNavigatorDlg));
-}
-
-OUString ScNavigatorDlgUIObject::get_name() const
-{
- return "ScNavigatorDlgUIObject";
-}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */