[Libreoffice-commits] .: sfx2/source
Caolán McNamara
caolan at kemper.freedesktop.org
Mon Feb 14 12:53:22 PST 2011
sfx2/source/dialog/templdlg.cxx | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
New commits:
commit 1d349a8c551ae9acefd66fafb270c53c456b6d93
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon Feb 14 15:39:41 2011 +0000
and now use the Collator+BreakIterator wrapper
diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx
index 5f279a1..8a97d4e 100644
--- a/sfx2/source/dialog/templdlg.cxx
+++ b/sfx2/source/dialog/templdlg.cxx
@@ -670,6 +670,11 @@ void StyleTree_Impl::Put(StyleTree_Impl* pIns, ULONG lPos)
StyleTreeArr_Impl &MakeTree_Impl(StyleTreeArr_Impl &rArr)
{
const USHORT nCount = rArr.Count();
+
+ comphelper::string::NaturalStringSorter aSorter(
+ ::comphelper::getProcessComponentContext(),
+ Application::GetSettings().GetLocale());
+
// Alle unter ihren Parents einordnen
USHORT i;
for(i = 0; i < nCount; ++i)
@@ -685,7 +690,7 @@ StyleTreeArr_Impl &MakeTree_Impl(StyleTreeArr_Impl &rArr)
// initial sortiert einfuegen
USHORT nPos;
for( nPos = 0 ; nPos < pCmp->Count() &&
- comphelper::string::compareNatural((*pCmp->pChilds)[nPos]->aName, pEntry->aName) < 0 ; nPos++);
+ aSorter.compare((*pCmp->pChilds)[nPos]->aName, pEntry->aName) < 0 ; nPos++);
pCmp->Put(pEntry,nPos);
break;
}
@@ -1313,12 +1318,16 @@ void SfxCommonTemplateDialog_Impl::UpdateStyles_Impl(USHORT nFlags)
SvLBoxEntry* pEntry = aFmtLb.First();
SvStringsDtor aStrings;
+ comphelper::string::NaturalStringSorter aSorter(
+ ::comphelper::getProcessComponentContext(),
+ Application::GetSettings().GetLocale());
+
while( pStyle )
{
//Bubblesort
USHORT nPos;
for( nPos = aStrings.Count() ; nPos &&
- comphelper::string::compareNatural(*(aStrings[nPos-1]), pStyle->GetName()) > 0 ; nPos--);
+ aSorter.compare(*(aStrings[nPos-1]), pStyle->GetName()) > 0 ; nPos--);
aStrings.Insert( new String( pStyle->GetName() ), nPos );
pStyle = pStyleSheetPool->Next();
}
More information about the Libreoffice-commits
mailing list