summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2021-06-23 12:09:02 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-06-24 10:00:03 +0200
commit066c4054f4a1078602aaab5516590628eaf6a47e (patch)
treeab2eccd292ec3688d61ff46f73e216e03cc9aa80 /sw
parent6d30c51f1f69d8c31b30b4e08a97222363852b17 (diff)
tdf#135316 bypass 'existing style' check when importing
trust the import filter to have already de-duplicated styles Shaves 5% off my load time Change-Id: I36b5196762483f629a38e00156d2fe9a1cb28c97 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117759 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/unocore/unostyle.cxx11
1 files changed, 7 insertions, 4 deletions
diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx
index ac72abefd161..fd5c6037e4a9 100644
--- a/sw/source/core/unocore/unostyle.cxx
+++ b/sw/source/core/unocore/unostyle.cxx
@@ -932,10 +932,13 @@ void XStyleFamily::insertByName(const OUString& rName, const uno::Any& rElement)
throw uno::RuntimeException();
OUString sStyleName;
SwStyleNameMapper::FillUIName(rName, sStyleName, m_rEntry.m_aPoolId);
- SfxStyleSheetBase* pBase = m_pBasePool->Find(sStyleName, m_rEntry.m_eFamily);
- SfxStyleSheetBase* pUINameBase = m_pBasePool->Find(sStyleName, m_rEntry.m_eFamily);
- if(pBase || pUINameBase)
- throw container::ElementExistException();
+ if (!m_pDocShell->GetDoc()->IsInWriterfilterImport())
+ {
+ SfxStyleSheetBase* pBase = m_pBasePool->Find(sStyleName, m_rEntry.m_eFamily);
+ SfxStyleSheetBase* pUINameBase = m_pBasePool->Find(sStyleName, m_rEntry.m_eFamily);
+ if(pBase || pUINameBase)
+ throw container::ElementExistException();
+ }
if(rElement.getValueType().getTypeClass() != uno::TypeClass_INTERFACE)
throw lang::IllegalArgumentException();
if (SwGetPoolIdFromName::CellStyle == m_rEntry.m_aPoolId)