diff options
author | Eike Rathke <erack@redhat.com> | 2017-11-10 23:18:52 +0100 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2017-11-11 01:18:47 +0100 |
commit | 38f4d4ca02cdc2fd4656e3a72def94da1df89650 (patch) | |
tree | b142aceae633b3ff8f8d92f69f6b33ddb38f2e32 /chart2 | |
parent | 12434a33c1c153c375d2e02e0ae26f471ff15b68 (diff) |
A user object id is *NOT* a SotClipboardFormatId
Do not try to squeeze it into such.. especially if
SotClipboardFormatId::... enum identifiers are used in a user
object id context that is completely not related to the identifier
name this is totally confusing.
commit fb14be5f8f74f83ba89e15f891ddf1f753dcc62f
Date: Thu Mar 12 14:53:28 2015 +0200
create new 'enum class' SotClipboardFormatId to unify types
overdid with that.
Change-Id: I34b570be9f52b7b94ca8af6b23983393ac3a3a55
Reviewed-on: https://gerrit.libreoffice.org/44612
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'chart2')
-rw-r--r-- | chart2/source/controller/main/ChartTransferable.cxx | 8 | ||||
-rw-r--r-- | chart2/source/controller/main/ChartTransferable.hxx | 2 |
2 files changed, 6 insertions, 4 deletions
diff --git a/chart2/source/controller/main/ChartTransferable.cxx b/chart2/source/controller/main/ChartTransferable.cxx index ee92dfa591cb..8fb95fa29de6 100644 --- a/chart2/source/controller/main/ChartTransferable.cxx +++ b/chart2/source/controller/main/ChartTransferable.cxx @@ -37,6 +37,8 @@ #include <svx/unomodel.hxx> #include <svx/svdview.hxx> +constexpr sal_uInt32 CHARTTRANSFER_OBJECTTYPE_DRAWMODEL = 1; + using namespace ::com::sun::star; using ::com::sun::star::uno::Reference; @@ -85,7 +87,7 @@ bool ChartTransferable::GetData( const css::datatransfer::DataFlavor& rFlavor, c { if ( nFormat == SotClipboardFormatId::DRAWING ) { - bResult = SetObject( m_pMarkedObjModel, SotClipboardFormatId::STRING, rFlavor ); + bResult = SetObject( m_pMarkedObjModel, CHARTTRANSFER_OBJECTTYPE_DRAWMODEL, rFlavor ); } else if ( nFormat == SotClipboardFormatId::GDIMETAFILE ) { @@ -102,7 +104,7 @@ bool ChartTransferable::GetData( const css::datatransfer::DataFlavor& rFlavor, c return bResult; } -bool ChartTransferable::WriteObject( tools::SvRef<SotStorageStream>& rxOStm, void* pUserObject, SotClipboardFormatId nUserObjectId, +bool ChartTransferable::WriteObject( tools::SvRef<SotStorageStream>& rxOStm, void* pUserObject, sal_uInt32 nUserObjectId, const datatransfer::DataFlavor& /* rFlavor */ ) { // called from SetObject, put data into stream @@ -110,7 +112,7 @@ bool ChartTransferable::WriteObject( tools::SvRef<SotStorageStream>& rxOStm, voi bool bRet = false; switch ( nUserObjectId ) { - case SotClipboardFormatId::STRING: + case CHARTTRANSFER_OBJECTTYPE_DRAWMODEL: { SdrModel* pMarkedObjModel = static_cast< SdrModel* >( pUserObject ); if ( pMarkedObjModel ) diff --git a/chart2/source/controller/main/ChartTransferable.hxx b/chart2/source/controller/main/ChartTransferable.hxx index 282c7ad94c24..1e950e236d34 100644 --- a/chart2/source/controller/main/ChartTransferable.hxx +++ b/chart2/source/controller/main/ChartTransferable.hxx @@ -44,7 +44,7 @@ protected: // implementation of TransferableHelper methods 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, SotClipboardFormatId nUserObjectId, + virtual bool WriteObject( tools::SvRef<SotStorageStream>& rxOStm, void* pUserObject, sal_uInt32 nUserObjectId, const css::datatransfer::DataFlavor& rFlavor ) override; private: |