Kaydet (Commit) b82da7a6 authored tarafından Kohei Yoshida's avatar Kohei Yoshida Kaydeden (comit) Eike Rathke

bnc#492440: Sort autofilter popup items correctly.

Use locale-aware collator to sort strings, instead of using the
transliterator.  The actual sorting algorithm for cell sort uses
collator.  Let's be consistent with it.

Change-Id: I6729553ce92d50e45fa1ea6e1c35581fd791807d
Reviewed-on: https://gerrit.libreoffice.org/1932Reviewed-by: 's avatarEike Rathke <erack@redhat.com>
Tested-by: 's avatarEike Rathke <erack@redhat.com>
üst 1ecd52e7
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
#include "typedstrdata.hxx" #include "typedstrdata.hxx"
#include "global.hxx" #include "global.hxx"
#include "unotools/transliterationwrapper.hxx" #include "unotools/collatorwrapper.hxx"
bool ScTypedStrData::LessCaseSensitive::operator() (const ScTypedStrData& left, const ScTypedStrData& right) const bool ScTypedStrData::LessCaseSensitive::operator() (const ScTypedStrData& left, const ScTypedStrData& right) const
{ {
...@@ -39,7 +39,7 @@ bool ScTypedStrData::LessCaseSensitive::operator() (const ScTypedStrData& left, ...@@ -39,7 +39,7 @@ bool ScTypedStrData::LessCaseSensitive::operator() (const ScTypedStrData& left,
if (left.meStrType == Value) if (left.meStrType == Value)
return left.mfValue < right.mfValue; return left.mfValue < right.mfValue;
return ScGlobal::GetCaseTransliteration()->compareString( return ScGlobal::GetCaseCollator()->compareString(
left.maStrValue, right.maStrValue) < 0; left.maStrValue, right.maStrValue) < 0;
} }
...@@ -51,7 +51,7 @@ bool ScTypedStrData::LessCaseInsensitive::operator() (const ScTypedStrData& left ...@@ -51,7 +51,7 @@ bool ScTypedStrData::LessCaseInsensitive::operator() (const ScTypedStrData& left
if (left.meStrType == Value) if (left.meStrType == Value)
return left.mfValue < right.mfValue; return left.mfValue < right.mfValue;
return ScGlobal::GetpTransliteration()->compareString( return ScGlobal::GetCollator()->compareString(
left.maStrValue, right.maStrValue) < 0; left.maStrValue, right.maStrValue) < 0;
} }
...@@ -63,7 +63,7 @@ bool ScTypedStrData::EqualCaseSensitive::operator() (const ScTypedStrData& left, ...@@ -63,7 +63,7 @@ bool ScTypedStrData::EqualCaseSensitive::operator() (const ScTypedStrData& left,
if (left.meStrType == Value && left.mfValue != right.mfValue) if (left.meStrType == Value && left.mfValue != right.mfValue)
return false; return false;
return ScGlobal::GetCaseTransliteration()->compareString( return ScGlobal::GetCaseCollator()->compareString(
left.maStrValue, right.maStrValue) == 0; left.maStrValue, right.maStrValue) == 0;
} }
...@@ -75,7 +75,7 @@ bool ScTypedStrData::EqualCaseInsensitive::operator() (const ScTypedStrData& lef ...@@ -75,7 +75,7 @@ bool ScTypedStrData::EqualCaseInsensitive::operator() (const ScTypedStrData& lef
if (left.meStrType == Value && left.mfValue != right.mfValue) if (left.meStrType == Value && left.mfValue != right.mfValue)
return false; return false;
return ScGlobal::GetpTransliteration()->compareString( return ScGlobal::GetCollator()->compareString(
left.maStrValue, right.maStrValue) == 0; left.maStrValue, right.maStrValue) == 0;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment