summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
Diffstat (limited to 'sd')
-rw-r--r--sd/source/ui/view/sdview2.cxx20
-rw-r--r--sd/source/ui/view/sdview3.cxx35
2 files changed, 35 insertions, 20 deletions
diff --git a/sd/source/ui/view/sdview2.cxx b/sd/source/ui/view/sdview2.cxx
index 45905d242cf9..e86ce789f2ca 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>
@@ -668,14 +669,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;
}
diff --git a/sd/source/ui/view/sdview3.cxx b/sd/source/ui/view/sdview3.cxx
index 634e59e7ce93..dd2f29d38bc3 100644
--- a/sd/source/ui/view/sdview3.cxx
+++ b/sd/source/ui/view/sdview3.cxx
@@ -71,6 +71,7 @@
#include <ViewClipboard.hxx>
#include <sfx2/ipclient.hxx>
#include <sfx2/classificationhelper.hxx>
+#include <comphelper/sequenceashashmap.hxx>
#include <comphelper/storagehelper.hxx>
#include <comphelper/processfactory.hxx>
#include <tools/stream.hxx>
@@ -1329,14 +1330,10 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper,
if(!bReturn && pPickObj && CHECK_FORMAT_TRANS( SotClipboardFormatId::XFA ) )
{
- ::tools::SvRef<SotStorageStream> xStm;
-
- if( aDataHelper.GetSotStorageStream( SotClipboardFormatId::XFA, xStm ) )
+ uno::Any const data(aDataHelper.GetAny(SotClipboardFormatId::XFA, ""));
+ uno::Sequence<beans::NamedValue> props;
+ if (data >>= props)
{
- XFillExchangeData aFillData( XFillAttrSetItem( &mrDoc.GetPool() ) );
-
- ReadXFillExchangeData( *xStm, aFillData );
-
if( IsUndoEnabled() )
{
BegUndo( SdResId(STR_UNDO_DRAGDROP) );
@@ -1344,15 +1341,27 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper,
EndUndo();
}
- XFillAttrSetItem* pSetItem = aFillData.GetXFillAttrSetItem();
- SfxItemSet rSet = pSetItem->GetItemSet();
- drawing::FillStyle eFill = rSet.Get( XATTR_FILLSTYLE ).GetValue();
+ ::comphelper::SequenceAsHashMap const map(props);
+ drawing::FillStyle eFill(drawing::FillStyle_BITMAP); // default to something that's ignored
+ Color aColor(COL_BLACK);
+ auto it = map.find("FillStyle");
+ if (it != map.end())
+ {
+ XFillStyleItem style;
+ style.PutValue(it->second, 0);
+ eFill = style.GetValue();
+ }
+ it = map.find("FillColor");
+ if (it != map.end())
+ {
+ XFillColorItem color;
+ color.PutValue(it->second, 0);
+ aColor = color.GetColorValue();
+ }
if( eFill == drawing::FillStyle_SOLID || eFill == drawing::FillStyle_NONE )
{
- const XFillColorItem& rColItem = rSet.Get( XATTR_FILLCOLOR );
- Color aColor( rColItem.GetColorValue() );
- OUString aName( rColItem.GetName() );
+ OUString aName;
SfxItemSet aSet( mrDoc.GetPool() );
bool bClosed = pPickObj->IsClosedObj();
::sd::Window* pWin = mpViewSh->GetActiveWindow();