Blame 0001-tdf-120376-sd-fix-duplicated-styles-on-copy-paste.patch

ced0d1c
From 7c789011bc9dba216b86f28891b7ea2e4f4df67c Mon Sep 17 00:00:00 2001
346749c
From: Michael Stahl <Michael.Stahl@cib.de>
346749c
Date: Sat, 27 Oct 2018 19:56:00 +0200
346749c
Subject: [PATCH] tdf#120376 sd: fix duplicated styles on copy/paste
346749c
346749c
Unfortunately the comparison was inverted, so a style is copied
346749c
iff it already exists, which is clearly the reviewer's fault...
346749c
346749c
(regression from 57db6e24b5ad43d447c30e44a112c74c7e75b46b)
346749c
346749c
Change-Id: I3425982feb08e980eca9243cc16120897b65a70f
346749c
---
346749c
 sd/source/core/stlpool.cxx | 5 +++--
346749c
 1 file changed, 3 insertions(+), 2 deletions(-)
346749c
346749c
diff --git a/sd/source/core/stlpool.cxx b/sd/source/core/stlpool.cxx
ced0d1c
index c627970..aa3d1de 100644
346749c
--- a/sd/source/core/stlpool.cxx
346749c
+++ b/sd/source/core/stlpool.cxx
b31b5f8
@@ -652,7 +652,7 @@ void SdStyleSheetPool::CopySheets(SdStyleSheetPool& rSourcePool, SfxStyleFamily
346749c
             pExistingSheet =
b31b5f8
                 GetStyleSheetByPositionInIndex(aSheetsWithName.front()).get();
346749c
             if (!rRenameSuffix.isEmpty() &&
b31b5f8
-                pExistingSheet->GetItemSet().Equals(xSheet->GetItemSet(), false))
ced0d1c
+                !pExistingSheet->GetItemSet().Equals(xSheet->GetItemSet(), false))
346749c
             {
346749c
                 // we have found a sheet with the same name, but different contents. Try to find a new name.
346749c
                 // If we already have a sheet with the new name, and it is equal to the one in the source pool,
b31b5f8
@@ -664,7 +664,8 @@ void SdStyleSheetPool::CopySheets(SdStyleSheetPool& rSourcePool, SfxStyleFamily
346749c
                     aTmpName = aName + rRenameSuffix + OUString::number(nSuffix);
346749c
                     pExistingSheet = Find(aTmpName, eFamily);
346749c
                     nSuffix++;
b31b5f8
-                } while( pExistingSheet && pExistingSheet->GetItemSet().Equals(xSheet->GetItemSet(), false) );
346749c
+                } while (pExistingSheet &&
ced0d1c
+                        !pExistingSheet->GetItemSet().Equals(xSheet->GetItemSet(), false));
346749c
                 aName = aTmpName;
346749c
                 bAddToList = true;
346749c
             }
346749c
-- 
346749c
2.17.1
346749c