summaryrefslogtreecommitdiff
path: root/svx/source
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-29 11:31:02 +0100
commit24ccbc35e8857cc8de784154d0648800d39ab20b (patch)
tree8344c05955b703bf1bd4f1d34a434c2a87dc5c12 /svx/source
parentba5d56afd88ba29ba7f222d15f4b9046011cc38e (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> (cherry picked from commit 0a6813ad5d57d0df72562c797a8b0581bfd65a11) Reviewed-on: https://gerrit.libreoffice.org/62472 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@cib.de>
Diffstat (limited to 'svx/source')
-rw-r--r--svx/source/tbxctrls/colrctrl.cxx32
1 files changed, 15 insertions, 17 deletions
diff --git a/svx/source/tbxctrls/colrctrl.cxx b/svx/source/tbxctrls/colrctrl.cxx
index 3a22aa10863f..8f4854fc1d2a 100644
--- a/svx/source/tbxctrls/colrctrl.cxx
+++ b/svx/source/tbxctrls/colrctrl.cxx
@@ -48,18 +48,18 @@ class SvxColorValueSetData : public TransferableHelper
{
private:
- XFillExchangeData maData;
+ uno::Sequence<beans::NamedValue> m_Data;
protected:
virtual void AddSupportedFormats() override;
virtual bool GetData( const css::datatransfer::DataFlavor& rFlavor, const OUString& rDestDoc ) override;
- virtual bool WriteObject( tools::SvRef<SotStorageStream>& rxOStm, void* pUserObject, sal_uInt32 nUserObjectId, const css::datatransfer::DataFlavor& rFlavor ) override;
public:
- explicit SvxColorValueSetData( const XFillAttrSetItem& rSetItem ) :
- maData( rSetItem ) {}
+ explicit SvxColorValueSetData(const uno::Sequence<beans::NamedValue>& rProps)
+ : m_Data(rProps)
+ {}
};
void SvxColorValueSetData::AddSupportedFormats()
@@ -73,19 +73,13 @@ bool SvxColorValueSetData::GetData( const css::datatransfer::DataFlavor& rFlavor
if( SotExchange::GetFormat( rFlavor ) == SotClipboardFormatId::XFA )
{
- SetObject( &maData, 0, rFlavor );
+ SetAny(uno::makeAny(m_Data));
bRet = true;
}
return bRet;
}
-bool SvxColorValueSetData::WriteObject( tools::SvRef<SotStorageStream>& rxOStm, void*, sal_uInt32, const css::datatransfer::DataFlavor& )
-{
- WriteXFillExchangeData( *rxOStm, maData );
- return( rxOStm->GetError() == ERRCODE_NONE );
-}
-
SvxColorValueSet_docking::SvxColorValueSet_docking( vcl::Window* _pParent ) :
SvxColorValueSet( _pParent, WB_ITEMBORDER ),
DragSourceHelper( this ),
@@ -149,14 +143,18 @@ void SvxColorValueSet_docking::DoDrag()
if( pDocSh && nItemId )
{
- XFillAttrSetItem aXFillSetItem( &pDocSh->GetPool() );
- SfxItemSet& rSet = aXFillSetItem.GetItemSet();
-
- rSet.Put( XFillColorItem( GetItemText( nItemId ), GetItemColor( nItemId ) ) );
- rSet.Put(XFillStyleItem( ( 1 == nItemId ) ? drawing::FillStyle_NONE : drawing::FillStyle_SOLID ) );
+ uno::Sequence<beans::NamedValue> props(2);
+ XFillColorItem const color(GetItemText(nItemId), GetItemColor(nItemId));
+ props[0].Name = "FillColor";
+ color.QueryValue(props[0].Value, 0);
+ XFillStyleItem const style((1 == nItemId)
+ ? drawing::FillStyle_NONE
+ : drawing::FillStyle_SOLID);
+ props[1].Name = "FillStyle";
+ style.QueryValue(props[1].Value, 0);
EndSelection();
- ( new SvxColorValueSetData( aXFillSetItem ) )->StartDrag( this, DND_ACTION_COPY );
+ ( new SvxColorValueSetData(props) )->StartDrag( this, DND_ACTION_COPY );
ReleaseMouse();
}
}