diff options
author | Andreas Heinisch <andreas.heinisch@yahoo.de> | 2022-10-07 11:59:33 +0200 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2022-10-13 18:10:10 +0200 |
commit | 1b1ad0e3d5988c5e16dabfaa40252a22dab517b7 (patch) | |
tree | e16f9991c80867690ada1a88bc2f7bcb3f5b71a7 /sc | |
parent | 09c9346960afaab5a9c03a0e4cf3dd8eb21ca4a0 (diff) |
tdf#125363, tdf#123095 - Use CaseTransliteration for autofilter
Change-Id: Ib6f1edebe26a69d3316a901e00d2bc6e0c66695f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141047
Tested-by: Jenkins
Reviewed-by: Eike Rathke <erack@redhat.com>
Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141288
Diffstat (limited to 'sc')
-rw-r--r-- | sc/qa/uitest/autofilter/autofilterBugs.py | 48 | ||||
-rw-r--r-- | sc/source/core/tool/typedstrdata.cxx | 7 |
2 files changed, 51 insertions, 4 deletions
diff --git a/sc/qa/uitest/autofilter/autofilterBugs.py b/sc/qa/uitest/autofilter/autofilterBugs.py index 1a9d2261d631..a295c6307793 100644 --- a/sc/qa/uitest/autofilter/autofilterBugs.py +++ b/sc/qa/uitest/autofilter/autofilterBugs.py @@ -25,6 +25,54 @@ class autofilter(UITestCase): #autofilter still exist self.assertEqual(calc_doc.getPropertyValue("UnnamedDatabaseRanges").getByTable(0).AutoFilter, True) + def test_tdf123095(self): + with self.ui_test.create_doc_in_start_center("calc") as document: + calcDoc = self.xUITest.getTopFocusWindow() + xGridWindow = calcDoc.getChild("grid_window") + enter_text_to_cell(xGridWindow, "A1", "乙二醇(进口料件)") + enter_text_to_cell(xGridWindow, "A2", "乙二醇(进口料件)") + xGridWindow.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A2"})) + + with self.ui_test.execute_dialog_through_command(".uno:DataFilterAutoFilter", close_button="no"): + pass + + xGridWindow.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "0", "ROW": "0"})) + xFloatWindow = self.xUITest.getFloatWindow() + xTreeList = xFloatWindow.getChild("check_list_box") + + # Without the fix in place, the second entry would not exist + self.assertEqual(2, len(xTreeList.getChildren())) + self.assertEqual(get_state_as_dict(xTreeList.getChild("0"))["Text"], "乙二醇(进口料件)") + self.assertEqual(get_state_as_dict(xTreeList.getChild("1"))["Text"], "乙二醇(进口料件)") + + def test_tdf125363(self): + with self.ui_test.create_doc_in_start_center("calc") as document: + calcDoc = self.xUITest.getTopFocusWindow() + xGridWindow = calcDoc.getChild("grid_window") + enter_text_to_cell(xGridWindow, "A1", "guet") + enter_text_to_cell(xGridWindow, "A2", "guͤt") + enter_text_to_cell(xGridWindow, "A3", "tuon") + enter_text_to_cell(xGridWindow, "A4", "tuͦn") + enter_text_to_cell(xGridWindow, "A5", "vröude") + enter_text_to_cell(xGridWindow, "A6", "vröudᵉ") + xGridWindow.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A6"})) + + with self.ui_test.execute_dialog_through_command(".uno:DataFilterAutoFilter", close_button="no"): + pass + + xGridWindow.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "0", "ROW": "0"})) + xFloatWindow = self.xUITest.getFloatWindow() + xTreeList = xFloatWindow.getChild("check_list_box") + + # Without the fix in place, the entries with superscript/modifier letters would not exist + self.assertEqual(6, len(xTreeList.getChildren())) + self.assertEqual(get_state_as_dict(xTreeList.getChild("0"))["Text"], "guet") + self.assertEqual(get_state_as_dict(xTreeList.getChild("1"))["Text"], "guͤt") + self.assertEqual(get_state_as_dict(xTreeList.getChild("2"))["Text"], "tuon") + self.assertEqual(get_state_as_dict(xTreeList.getChild("3"))["Text"], "tuͦn") + self.assertEqual(get_state_as_dict(xTreeList.getChild("4"))["Text"], "vröude") + self.assertEqual(get_state_as_dict(xTreeList.getChild("5"))["Text"], "vröudᵉ") + def test_tdf94055(self): with self.ui_test.create_doc_in_start_center("calc") as document: calcDoc = self.xUITest.getTopFocusWindow() diff --git a/sc/source/core/tool/typedstrdata.cxx b/sc/source/core/tool/typedstrdata.cxx index 83ecdfa64053..ecfdfdba93a8 100644 --- a/sc/source/core/tool/typedstrdata.cxx +++ b/sc/source/core/tool/typedstrdata.cxx @@ -11,6 +11,7 @@ #include <global.hxx> #include <unotools/collatorwrapper.hxx> +#include <unotools/transliterationwrapper.hxx> bool ScTypedStrData::LessCaseSensitive::operator() (const ScTypedStrData& left, const ScTypedStrData& right) const { @@ -53,8 +54,7 @@ bool ScTypedStrData::EqualCaseSensitive::operator() (const ScTypedStrData& left, if (left.mbIsDate != right.mbIsDate ) return false; - return ScGlobal::GetCaseCollator().compareString( - left.maStrValue, right.maStrValue) == 0; + return ScGlobal::GetCaseTransliteration().isEqual(left.maStrValue, right.maStrValue); } bool ScTypedStrData::EqualCaseInsensitive::operator() (const ScTypedStrData& left, const ScTypedStrData& right) const @@ -68,8 +68,7 @@ bool ScTypedStrData::EqualCaseInsensitive::operator() (const ScTypedStrData& lef if (left.mbIsDate != right.mbIsDate ) return false; - return ScGlobal::GetCollator().compareString( - left.maStrValue, right.maStrValue) == 0; + return ScGlobal::GetTransliteration().isEqual(left.maStrValue, right.maStrValue); } bool ScTypedStrData::operator< (const ScTypedStrData& r) const |