diff options
author | Michael Stahl <Michael.Stahl@cib.de> | 2018-10-27 19:56:00 +0200 |
---|---|---|
committer | Michael Stahl <Michael.Stahl@cib.de> | 2018-10-27 22:55:58 +0200 |
commit | be9f3db2306150a37ef18e4ccc8d8f4a1934c5c1 (patch) | |
tree | 06a91a677c005f490211b9a59f67b67e2eae08aa | |
parent | 68c73b2cc26313de315e828cb9f8db53d9aeb6bf (diff) |
tdf#120376 sd: fix duplicated styles on copy/paste
Unfortunately the comparison was inverted, so a style is copied
iff it already exists, which is clearly the reviewer's fault...
(regression from 57db6e24b5ad43d447c30e44a112c74c7e75b46b)
Change-Id: I3425982feb08e980eca9243cc16120897b65a70f
Reviewed-on: https://gerrit.libreoffice.org/62436
Tested-by: Jenkins
Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
-rw-r--r-- | sd/source/core/stlpool.cxx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sd/source/core/stlpool.cxx b/sd/source/core/stlpool.cxx index ff2a55a22f80..47c105a7d38a 100644 --- a/sd/source/core/stlpool.cxx +++ b/sd/source/core/stlpool.cxx @@ -651,7 +651,7 @@ void SdStyleSheetPool::CopySheets(SdStyleSheetPool& rSourcePool, SfxStyleFamily pExistingSheet = GetStyleSheetByPositionInIndex(aSheetsWithName.front()); if (!rRenameSuffix.isEmpty() && - pExistingSheet->GetItemSet().Equals(pSheet->GetItemSet(), false)) + !pExistingSheet->GetItemSet().Equals(pSheet->GetItemSet(), false)) { // we have found a sheet with the same name, but different contents. Try to find a new name. // If we already have a sheet with the new name, and it is equal to the one in the source pool, @@ -663,7 +663,8 @@ void SdStyleSheetPool::CopySheets(SdStyleSheetPool& rSourcePool, SfxStyleFamily aTmpName = aName + rRenameSuffix + OUString::number(nSuffix); pExistingSheet = Find(aTmpName, eFamily); nSuffix++; - } while( pExistingSheet && pExistingSheet->GetItemSet().Equals(pSheet->GetItemSet(), false) ); + } while (pExistingSheet && + !pExistingSheet->GetItemSet().Equals(pSheet->GetItemSet(), false)); aName = aTmpName; bAddToList = true; } |