summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <Michael.Stahl@cib.de>2018-10-27 19:56:00 +0200
committerCaolán McNamara <caolanm@redhat.com>2018-10-30 13:43:52 +0100
commitea3e84429f84c4a57ce28980b799cc6d6995ef26 (patch)
tree32f03ecab8ebf8462e1a7f975fa9cf96c73f63c1
parent1839856aec8d59a7575f7aceff48f50e1f237e39 (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> (cherry picked from commit be9f3db2306150a37ef18e4ccc8d8f4a1934c5c1) Reviewed-on: https://gerrit.libreoffice.org/62452 Reviewed-by: Armin Le Grand <Armin.Le.Grand@cib.de> (cherry picked from commit ba5d56afd88ba29ba7f222d15f4b9046011cc38e) Reviewed-on: https://gerrit.libreoffice.org/62471 Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com> Tested-by: Xisco Faulí <xiscofauli@libreoffice.org> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--sd/source/core/stlpool.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/sd/source/core/stlpool.cxx b/sd/source/core/stlpool.cxx
index c627970fd4e2..aa3d1de8a89a 100644
--- a/sd/source/core/stlpool.cxx
+++ b/sd/source/core/stlpool.cxx
@@ -652,7 +652,7 @@ void SdStyleSheetPool::CopySheets(SdStyleSheetPool& rSourcePool, SfxStyleFamily
pExistingSheet =
GetStyleSheetByPositionInIndex(aSheetsWithName.front()).get();
if (!rRenameSuffix.isEmpty() &&
- pExistingSheet->GetItemSet().Equals(xSheet->GetItemSet(), false))
+ !pExistingSheet->GetItemSet().Equals(xSheet->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,
@@ -664,7 +664,8 @@ void SdStyleSheetPool::CopySheets(SdStyleSheetPool& rSourcePool, SfxStyleFamily
aTmpName = aName + rRenameSuffix + OUString::number(nSuffix);
pExistingSheet = Find(aTmpName, eFamily);
nSuffix++;
- } while( pExistingSheet && pExistingSheet->GetItemSet().Equals(xSheet->GetItemSet(), false) );
+ } while (pExistingSheet &&
+ !pExistingSheet->GetItemSet().Equals(xSheet->GetItemSet(), false));
aName = aTmpName;
bAddToList = true;
}