summaryrefslogtreecommitdiff
path: root/svl
diff options
context:
space:
mode:
authorMuthu Subramanian <sumuthu@collabora.com>2014-02-13 16:10:47 +0530
committerMuthu Subramanian <sumuthu@collabora.com>2014-02-13 16:13:01 +0530
commita4cd841541a729d7b8126d27d91fa28e30b01403 (patch)
treef8be9dc829674972b0e634c337ae1701b65350b9 /svl
parentc388071c4d1bee70e41f9ff72d50e5966bb8f237 (diff)
n#757432: Styles (rename &) copy to different decks.
While copying slides to different slide decks, styles were not being copied if there is already one with the same name. This patch renames and copies those to keep the formatting intact. Change-Id: I66f71493f1fd658eed43e39aa7ae7ee7b5463b34
Diffstat (limited to 'svl')
-rw-r--r--svl/source/items/itemset.cxx23
1 files changed, 23 insertions, 0 deletions
diff --git a/svl/source/items/itemset.cxx b/svl/source/items/itemset.cxx
index 842fc4060786..50498e396922 100644
--- a/svl/source/items/itemset.cxx
+++ b/svl/source/items/itemset.cxx
@@ -31,6 +31,7 @@
#include <tools/stream.hxx>
#include <tools/solar.h>
+#include <rtl/strbuf.hxx>
// STATIC DATA -----------------------------------------------------------
@@ -2029,4 +2030,26 @@ SfxItemSet *SfxAllItemSet::Clone(sal_Bool bItems, SfxItemPool *pToPool ) const
return bItems ? new SfxAllItemSet(*this) : new SfxAllItemSet(*_pPool);
}
+// -----------------------------------------------------------------------
+
+sal_uInt64 SfxItemSet::getHash() const
+{
+ return stringify().hashCode64();
+}
+
+// -----------------------------------------------------------------------
+
+OString SfxItemSet::stringify() const
+{
+ rtl::OStringBuffer aString(100);
+ SvMemoryStream aStream;
+ OString aLine;
+ SfxItemSet aSet(*this);
+ aSet.InvalidateDefaultItems();
+ aSet.Store(aStream, true);
+ aStream.Flush();
+ aString.append((const char *)aStream.GetData(), aStream.GetEndOfData());
+
+ return aString.makeStringAndClear();
+}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */