summaryrefslogtreecommitdiff
path: root/sw/source/core/unocore
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2021-06-23 08:51:05 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-06-30 17:53:36 +0200
commitcf15c4dad74e31a035c0d1ca899dfbef4da90ad2 (patch)
treec0f2704bc1388420e5ca9167eb12f91bb96771a6 /sw/source/core/unocore
parentd2cbf5d1aba6a2a74b0e6ca99cb27242f9582a94 (diff)
tdf#135316 optimise SwCharFormats::FindFormatByName
reduces load time by 10% Change-Id: Ic5c90588825592245d09f8ebe03b13e34676496a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117699 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/core/unocore')
-rw-r--r--sw/source/core/unocore/unosett.cxx13
-rw-r--r--sw/source/core/unocore/unostyle.cxx2
2 files changed, 2 insertions, 13 deletions
diff --git a/sw/source/core/unocore/unosett.cxx b/sw/source/core/unocore/unosett.cxx
index 186b0e98116e..101a70f10ada 100644
--- a/sw/source/core/unocore/unosett.cxx
+++ b/sw/source/core/unocore/unosett.cxx
@@ -1589,21 +1589,10 @@ void SwXNumberingRules::SetPropertiesToNumFormat(
}
else if (pLocalDoc)
{
- const SwCharFormats* pFormats = pLocalDoc->GetCharFormats();
- const size_t nChCount = pFormats->size();
-
SwCharFormat* pCharFormat = nullptr;
if (!sCharFormatName.isEmpty())
{
- for(size_t j = 0; j< nChCount; ++j)
- {
- SwCharFormat* pTmp = (*pFormats)[j];
- if(pTmp->GetName() == sCharFormatName)
- {
- pCharFormat = pTmp;
- break;
- }
- }
+ pCharFormat = pLocalDoc->FindCharFormatByName(sCharFormatName);
if(!pCharFormat)
{
diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx
index a6a14abef2dc..86d9381b8573 100644
--- a/sw/source/core/unocore/unostyle.cxx
+++ b/sw/source/core/unocore/unostyle.cxx
@@ -891,7 +891,7 @@ uno::Any XStyleFamily::getByName(const OUString& rName)
throw uno::RuntimeException();
SfxStyleSheetBase* pBase = m_pBasePool->Find(sStyleName, m_rEntry.m_eFamily);
if(!pBase)
- throw container::NoSuchElementException();
+ throw container::NoSuchElementException(rName);
uno::Reference<style::XStyle> xStyle = FindStyle(sStyleName);
if(!xStyle.is())
xStyle = m_rEntry.m_fCreateStyle(m_pBasePool, m_pDocShell, m_rEntry.m_eFamily == SfxStyleFamily::Frame ? pBase->GetName() : sStyleName);