[Libreoffice-commits] core.git: Branch 'libreoffice-6-3' - sfx2/source
Julien Nabet (via logerrit)
logerrit at kemper.freedesktop.org
Tue Aug 6 08:23:06 UTC 2019
sfx2/source/dialog/templdlg.cxx | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
New commits:
commit 0702541b3d4661846dccde26efa9c2fb5ed65f35
Author: Julien Nabet <serval2412 at yahoo.fr>
AuthorDate: Mon Aug 5 18:26:31 2019 +0200
Commit: Xisco FaulĂ <xiscofauli at libreoffice.org>
CommitDate: Tue Aug 6 10:22:25 2019 +0200
tdf#126663: optimize style list display in sidebar
See Flamegraph perf:
https://bugs.documentfoundation.org/attachment.cgi?id=153129
+ according to Xisco, time takes 15s instead of 145s
(See https://bugs.documentfoundation.org/show_bug.cgi?id=126663#c7
+ https://bugs.documentfoundation.org/show_bug.cgi?id=126663#c8)
Change-Id: Ib02bbd0793ec8e903359d5f59f7c33809028bb02
Reviewed-on: https://gerrit.libreoffice.org/76988
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
Reviewed-by: Julien Nabet <serval2412 at yahoo.fr>
Tested-by: Julien Nabet <serval2412 at yahoo.fr>
(cherry picked from commit 86ab2b2fcd95c6d14d0fd91dd1adaee5e7fd5713)
Reviewed-on: https://gerrit.libreoffice.org/76994
Tested-by: Jenkins
Reviewed-by: Xisco FaulĂ <xiscofauli at libreoffice.org>
diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx
index 98db80802603..55acfa1445d0 100644
--- a/sfx2/source/dialog/templdlg.cxx
+++ b/sfx2/source/dialog/templdlg.cxx
@@ -1184,13 +1184,13 @@ void SfxCommonTemplateDialog_Impl::UpdateStyles_Impl(StyleFlags nFlags)
while( pStyle )
{
- //Bubblesort
- size_t nPos;
- for(nPos = aStrings.size(); nPos && aSorter.compare(aStrings[nPos-1], pStyle->GetName()) > 0; --nPos)
- {};
- aStrings.insert(aStrings.begin() + nPos, pStyle->GetName());
+ aStrings.push_back(pStyle->GetName());
pStyle = pStyleSheetPool->Next();
}
+ std::sort(aStrings.begin(), aStrings.end(),
+ [&aSorter](const OUString& rLHS, const OUString& rRHS) {
+ return aSorter.compare(rLHS, rRHS) < 0;
+ });
size_t nCount = aStrings.size();
size_t nPos = 0;
More information about the Libreoffice-commits
mailing list