[Libreoffice-commits] core.git: sw/source

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Sun Jun 27 14:39:17 UTC 2021


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

New commits:
commit 770f94f4c5bedede8ee70e1f3bc1303dbace62ca
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Sat Jun 26 18:02:19 2021 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Sun Jun 27 16:38:45 2021 +0200

    Revert "tdf#135316 bypass 'existing style' check when importing"
    
    This reverts commit 066c4054f4a1078602aaab5516590628eaf6a47e.
    
    As mst_ says:
      there isn't just File->Open but also Insert->Text from File...
      in that case the optimisation looks wrong to me
    
    Change-Id: I9d0b4bc748842b8fac7ea4cd58192562f8fd82f2
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117864
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx
index fd5c6037e4a9..ac72abefd161 100644
--- a/sw/source/core/unocore/unostyle.cxx
+++ b/sw/source/core/unocore/unostyle.cxx
@@ -932,13 +932,10 @@ void XStyleFamily::insertByName(const OUString& rName, const uno::Any& rElement)
         throw uno::RuntimeException();
     OUString sStyleName;
     SwStyleNameMapper::FillUIName(rName, sStyleName, m_rEntry.m_aPoolId);
-    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();
-    }
+    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)


More information about the Libreoffice-commits mailing list