summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorMichael Stahl <Michael.Stahl@cib.de>2018-10-27 23:39:27 +0200
committerXisco Faulí <xiscofauli@libreoffice.org>2018-10-30 14:01:33 +0100
commit2b44debe150d5e4bd9777a9a55a8328512d4fb40 (patch)
tree2aee710bec87db8ee2ae2cf67d926eee39836c4b /svx
parent18bf8e100a0487ccb7c1c91ec22224e71a5838c4 (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/62469 Tested-by: Jenkins Tested-by: Xisco Faulí <xiscofauli@libreoffice.org> Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org>
Diffstat (limited to 'svx')
-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 637f2c4872ba..66397ebd47e3 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();
}
}