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

346749c
From 69561c112dbaac0df32500e5c50e1ea3236d4b50 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
346749c
index ff2a55a22f80..47c105a7d38a 100644
346749c
--- a/sd/source/core/stlpool.cxx
346749c
+++ b/sd/source/core/stlpool.cxx
346749c
@@ -651,7 +651,7 @@ void SdStyleSheetPool::CopySheets(SdStyleSheetPool& rSourcePool, SfxStyleFamily
346749c
             pExistingSheet =
346749c
                 GetStyleSheetByPositionInIndex(aSheetsWithName.front());
346749c
             if (!rRenameSuffix.isEmpty() &&
346749c
-                pExistingSheet->GetItemSet().Equals(pSheet->GetItemSet(), false))
346749c
+                !pExistingSheet->GetItemSet().Equals(pSheet->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,
346749c
@@ -663,7 +663,8 @@ void SdStyleSheetPool::CopySheets(SdStyleSheetPool& rSourcePool, SfxStyleFamily
346749c
                     aTmpName = aName + rRenameSuffix + OUString::number(nSuffix);
346749c
                     pExistingSheet = Find(aTmpName, eFamily);
346749c
                     nSuffix++;
346749c
-                } while( pExistingSheet && pExistingSheet->GetItemSet().Equals(pSheet->GetItemSet(), false) );
346749c
+                } while (pExistingSheet &&
346749c
+                        !pExistingSheet->GetItemSet().Equals(pSheet->GetItemSet(), false));
346749c
                 aName = aTmpName;
346749c
                 bAddToList = true;
346749c
             }
346749c
-- 
346749c
2.17.1
346749c