[Libreoffice-commits] core.git: sc/qa vcl/source
Xisco Fauli (via logerrit)
logerrit at kemper.freedesktop.org
Tue May 19 12:43:19 UTC 2020
sc/qa/uitest/calc_tests/data/tdf98493.ods |binary
sc/qa/uitest/calc_tests8/navigator.py | 34 ++++++++++++++++++++++++++++++
vcl/source/treelist/uiobject.cxx | 5 ++++
3 files changed, 39 insertions(+)
New commits:
commit 4435a3b02525067700ee494dbd91d84df985b001
Author: Xisco Fauli <xiscofauli at libreoffice.org>
AuthorDate: Tue May 19 12:12:59 2020 +0200
Commit: Xisco Faulí <xiscofauli at libreoffice.org>
CommitDate: Tue May 19 14:42:39 2020 +0200
tdf#98493, tdf#133079: sc: Add UItest
Change-Id: I04794bb7313f6ecd32088f8e7aa57e898f8ba427
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94493
Tested-by: Xisco Faulí <xiscofauli at libreoffice.org>
Reviewed-by: Xisco Faulí <xiscofauli at libreoffice.org>
diff --git a/sc/qa/uitest/calc_tests/data/tdf98493.ods b/sc/qa/uitest/calc_tests/data/tdf98493.ods
new file mode 100644
index 000000000000..1cc0d8b11967
Binary files /dev/null and b/sc/qa/uitest/calc_tests/data/tdf98493.ods differ
diff --git a/sc/qa/uitest/calc_tests8/navigator.py b/sc/qa/uitest/calc_tests8/navigator.py
index 6e6cc31b1e59..4026ca66520b 100644
--- a/sc/qa/uitest/calc_tests8/navigator.py
+++ b/sc/qa/uitest/calc_tests8/navigator.py
@@ -81,3 +81,37 @@ class navigator(UITestCase):
self.xUITest.executeCommand(".uno:Sidebar")
self.ui_test.close_doc()
+
+ def test_tdf98493(self):
+
+ self.ui_test.load_file(get_url_for_data_file("tdf98493.ods"))
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ xGridWin = xCalcDoc.getChild("grid_window")
+
+ self.assertEqual(get_state_as_dict(xGridWin)["SelectedTable"], "2")
+
+ self.xUITest.executeCommand(".uno:Sidebar")
+ xGridWin.executeAction("SIDEBAR", mkPropertyValues({"PANEL": "ScNavigatorPanel"}))
+
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ xNavigatorPanel = xCalcDoc.getChild("NavigatorPanelParent")
+ xNavigatorPanel.executeAction("ROOT", tuple())
+ xContentBox = xNavigatorPanel.getChild('contentbox')
+
+ # tdf#133079, without the fix in place, it would be 8
+ self.assertEqual(len(xContentBox.getChildren()), 1)
+
+ xSheets = xContentBox.getChild('0')
+ self.assertEqual(len(xSheets.getChildren()), 12)
+
+ #key=item position, value=sheet ( there are hidden sheets )
+ results = { '1': '0', '5': '4', '6': '4', '11': '10'}
+
+ for k, v in results.items():
+ xChild = xSheets.getChild(k)
+ xChild.executeAction("DOUBLECLICK", tuple())
+
+ self.assertEqual(get_state_as_dict(xGridWin)["SelectedTable"], v)
+
+ self.xUITest.executeCommand(".uno:Sidebar")
+ self.ui_test.close_doc()
diff --git a/vcl/source/treelist/uiobject.cxx b/vcl/source/treelist/uiobject.cxx
index e5f166e8f1ce..2478ab8786df 100644
--- a/vcl/source/treelist/uiobject.cxx
+++ b/vcl/source/treelist/uiobject.cxx
@@ -135,6 +135,11 @@ void TreeListEntryUIObject::execute(const OUString& rAction, const StringMap& /*
return;
pItem->ClickHdl(mpEntry);
}
+ else if (rAction == "DOUBLECLICK")
+ {
+ mxTreeList->Select(mpEntry);
+ mxTreeList->DoubleClickHdl();
+ }
}
std::unique_ptr<UIObject> TreeListEntryUIObject::get_child(const OUString& rID)
More information about the Libreoffice-commits
mailing list