sw/source/core/unocore/unostyle.cxx |   11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

New commits:
commit 066c4054f4a1078602aaab5516590628eaf6a47e
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Wed Jun 23 12:09:02 2021 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Thu Jun 24 10:00:03 2021 +0200

    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.gran...@collabora.co.uk>

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)
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to