summaryrefslogtreecommitdiff
path: root/sd/source/ui/view/sdview2.cxx
diff options
context:
space:
mode:
authorMichael Stahl <Michael.Stahl@cib.de>2018-10-27 23:39:27 +0200
committerMichael Stahl <Michael.Stahl@cib.de>2018-10-28 08:56:08 +0100
commit0a6813ad5d57d0df72562c797a8b0581bfd65a11 (patch)
tree4256d0ce8383dcd5b2948be075359e0296cebc13 /sd/source/ui/view/sdview2.cxx
parente89e8941e114d4d1adf76df995a3f1a8d1bff4b1 (diff)
tdf#119235 svx,sd: fix drag&drop from ColorBar
This was using the SfxPoolItem serialisation of XATTR_FILL* items, where only XFillColorItem and XFillStyleItem were actually used; the binary serialisation was removed without being aware of this feature. Fix this by using uno::Any instead, rather than reviving the binary serialisation. Also change the clipboard format strings, just to be safe. (regression from 97b889b8b2b2554ce33fd6b3f0359fc18f39832d) Change-Id: I1828621a9aae606a1ca47835eef608062efe64a0 Reviewed-on: https://gerrit.libreoffice.org/62455 Reviewed-by: Michael Stahl <Michael.Stahl@cib.de> Tested-by: Michael Stahl <Michael.Stahl@cib.de>
Diffstat (limited to 'sd/source/ui/view/sdview2.cxx')
-rw-r--r--sd/source/ui/view/sdview2.cxx20
1 files changed, 13 insertions, 7 deletions
diff --git a/sd/source/ui/view/sdview2.cxx b/sd/source/ui/view/sdview2.cxx
index c2f2abbc5c6f..a6ffc051d5d9 100644
--- a/sd/source/ui/view/sdview2.cxx
+++ b/sd/source/ui/view/sdview2.cxx
@@ -21,6 +21,7 @@
#include <vector>
#include <com/sun/star/embed/XEmbedPersist.hpp>
+#include <comphelper/sequenceashashmap.hxx>
#include <tools/urlobj.hxx>
#include <svx/svdetc.hxx>
#include <svx/svdoole2.hxx>
@@ -666,14 +667,19 @@ sal_Int8 View::ExecuteDrop( const ExecuteDropEvent& rEvt,
{
if(pIAOHandle->getOverlayObjectList().isHitPixel(rEvt.maPosPixel))
{
- ::tools::SvRef<SotStorageStream> xStm;
-
- if( aDataHelper.GetSotStorageStream( SotClipboardFormatId::XFA, xStm ) && xStm.is() )
+ uno::Any const data(aDataHelper.GetAny(SotClipboardFormatId::XFA, ""));
+ uno::Sequence<beans::NamedValue> props;
+ if (data >>= props)
{
- XFillExchangeData aFillData( XFillAttrSetItem( &mrDoc.GetPool() ) );
-
- ReadXFillExchangeData( *xStm, aFillData );
- const Color aColor( aFillData.GetXFillAttrSetItem()->GetItemSet().Get( XATTR_FILLCOLOR ).GetColorValue() );
+ ::comphelper::SequenceAsHashMap const map(props);
+ Color aColor(COL_BLACK);
+ auto const it = map.find("FillColor");
+ if (it != map.end())
+ {
+ XFillColorItem color;
+ color.PutValue(it->second, 0);
+ aColor = color.GetColorValue();
+ }
static_cast< SdrHdlColor* >( pIAOHandle )->SetColor( aColor, true );
nRet = nDropAction;
}