diff options
author | Noel Grandin <noel@peralex.com> | 2015-03-12 14:53:28 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-03-18 14:23:50 +0200 |
commit | fb14be5f8f74f83ba89e15f891ddf1f753dcc62f (patch) | |
tree | beaa4af08b0c3d75bf6e40b21b96c55e0ac1c60a /svx | |
parent | b8ce52aab9459773544f1696cfe6b7b6f171a389 (diff) |
create new 'enum class' SotClipboardFormatId to unify types
of which there are several.
There are some issues here I am unsure of
- the SW and SC and CHART2 modules essentially ignore the enum values and assign their own ids
Perhaps I should change them to use the common values and create new enum values where necessary?
- the sc/qa/ and sq/qa/ and starmath/qa/ code was doing some dodgy stuff. I translated the code to pass down the stuff
numeric values to the underlying code, but perhaps further fixing is necessary?
Change-Id: Ic06d723e404481e3f1bca67c43b70321b764d923
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/dialog/imapwnd.cxx | 4 | ||||
-rw-r--r-- | svx/source/fmcomp/dbaexchange.cxx | 98 | ||||
-rw-r--r-- | svx/source/fmcomp/dbaobjectex.cxx | 16 | ||||
-rw-r--r-- | svx/source/fmcomp/xmlexchg.cxx | 6 | ||||
-rw-r--r-- | svx/source/form/filtnav.cxx | 8 | ||||
-rw-r--r-- | svx/source/form/fmexch.cxx | 30 | ||||
-rw-r--r-- | svx/source/form/fmtextcontrolshell.cxx | 2 | ||||
-rw-r--r-- | svx/source/gallery2/galbrws2.cxx | 24 | ||||
-rw-r--r-- | svx/source/gallery2/galmisc.cxx | 38 | ||||
-rw-r--r-- | svx/source/gallery2/galtheme.cxx | 34 | ||||
-rw-r--r-- | svx/source/inc/filtnav.hxx | 2 | ||||
-rw-r--r-- | svx/source/inc/fmexch.hxx | 8 | ||||
-rw-r--r-- | svx/source/items/clipfmtitem.cxx | 10 | ||||
-rw-r--r-- | svx/source/mnuctrls/clipboardctl.cxx | 2 | ||||
-rw-r--r-- | svx/source/svdraw/svdograf.cxx | 2 | ||||
-rw-r--r-- | svx/source/svdraw/svdoole2.cxx | 2 | ||||
-rw-r--r-- | svx/source/svdraw/svdotxln.cxx | 2 | ||||
-rw-r--r-- | svx/source/tbxctrls/colrctrl.cxx | 10 |
18 files changed, 149 insertions, 149 deletions
diff --git a/svx/source/dialog/imapwnd.cxx b/svx/source/dialog/imapwnd.cxx index 054b67439789..7ff7feb7d1e5 100644 --- a/svx/source/dialog/imapwnd.cxx +++ b/svx/source/dialog/imapwnd.cxx @@ -524,13 +524,13 @@ sal_Int8 IMapWindow::ExecuteDrop( const ExecuteDropEvent& rEvt ) { sal_Int8 nRet = DND_ACTION_NONE; - if( IsDropFormatSupported( SOT_FORMATSTR_ID_NETSCAPE_BOOKMARK ) ) + if( IsDropFormatSupported( SotClipboardFormatId::NETSCAPE_BOOKMARK ) ) { const OUString aString; INetBookmark aBookMark( aString, aString ); SdrObject* pSdrObj = GetHitSdrObj( rEvt.maPosPixel ); - if( pSdrObj && TransferableDataHelper( rEvt.maDropEvent.Transferable ).GetINetBookmark( SOT_FORMATSTR_ID_NETSCAPE_BOOKMARK, aBookMark ) ) + if( pSdrObj && TransferableDataHelper( rEvt.maDropEvent.Transferable ).GetINetBookmark( SotClipboardFormatId::NETSCAPE_BOOKMARK, aBookMark ) ) { IMapObject* pIMapObj = GetIMapObj( pSdrObj ); diff --git a/svx/source/fmcomp/dbaexchange.cxx b/svx/source/fmcomp/dbaexchange.cxx index 59bbbb7a95b9..889173374c23 100644 --- a/svx/source/fmcomp/dbaexchange.cxx +++ b/svx/source/fmcomp/dbaexchange.cxx @@ -149,13 +149,13 @@ namespace svx } - sal_uInt32 OColumnTransferable::getDescriptorFormatId() + SotClipboardFormatId OColumnTransferable::getDescriptorFormatId() { - static sal_uInt32 s_nFormat = (sal_uInt32)-1; - if ((sal_uInt32)-1 == s_nFormat) + static SotClipboardFormatId s_nFormat = static_cast<SotClipboardFormatId>(-1); + if (static_cast<SotClipboardFormatId>(-1) == s_nFormat) { s_nFormat = SotExchange::RegisterFormatName(OUString("application/x-openoffice;windows_formatname=\"dbaccess.ColumnDescriptorTransfer\"")); - OSL_ENSURE((sal_uInt32)-1 != s_nFormat, "OColumnTransferable::getDescriptorFormatId: bad exchange id!"); + OSL_ENSURE(static_cast<SotClipboardFormatId>(-1) != s_nFormat, "OColumnTransferable::getDescriptorFormatId: bad exchange id!"); } return s_nFormat; } @@ -210,10 +210,10 @@ namespace svx void OColumnTransferable::AddSupportedFormats() { if (CTF_CONTROL_EXCHANGE & m_nFormatFlags) - AddFormat(SOT_FORMATSTR_ID_SBA_CTRLDATAEXCHANGE); + AddFormat(SotClipboardFormatId::SBA_CTRLDATAEXCHANGE); if (CTF_FIELD_DESCRIPTOR & m_nFormatFlags) - AddFormat(SOT_FORMATSTR_ID_SBA_FIELDDATAEXCHANGE); + AddFormat(SotClipboardFormatId::SBA_FIELDDATAEXCHANGE); if (CTF_COLUMN_DESCRIPTOR & m_nFormatFlags) AddFormat(getDescriptorFormatId()); @@ -222,12 +222,13 @@ namespace svx bool OColumnTransferable::GetData( const DataFlavor& _rFlavor, const OUString& /*rDestDoc*/ ) { - const sal_uInt32 nFormatId = SotExchange::GetFormat(_rFlavor); + const SotClipboardFormatId nFormatId = SotExchange::GetFormat(_rFlavor); switch (nFormatId) { - case SOT_FORMATSTR_ID_SBA_FIELDDATAEXCHANGE: - case SOT_FORMATSTR_ID_SBA_CTRLDATAEXCHANGE: + case SotClipboardFormatId::SBA_FIELDDATAEXCHANGE: + case SotClipboardFormatId::SBA_CTRLDATAEXCHANGE: return SetString(m_sCompatibleFormat, _rFlavor); + default: break; } if (nFormatId == getDescriptorFormatId()) return SetAny( makeAny( m_aDescriptor.createPropertyValueSequence() ), _rFlavor ); @@ -246,9 +247,9 @@ namespace svx ++aCheck ) { - if (bFieldFormat && (SOT_FORMATSTR_ID_SBA_FIELDDATAEXCHANGE == aCheck->mnSotId)) + if (bFieldFormat && (SotClipboardFormatId::SBA_FIELDDATAEXCHANGE == aCheck->mnSotId)) return true; - if (bControlFormat && (SOT_FORMATSTR_ID_SBA_CTRLDATAEXCHANGE == aCheck->mnSotId)) + if (bControlFormat && (SotClipboardFormatId::SBA_CTRLDATAEXCHANGE == aCheck->mnSotId)) return true; if (bDescriptorFormat && (getDescriptorFormatId() == aCheck->mnSotId)) return true; @@ -334,12 +335,12 @@ namespace svx } // check if we have a (string) format we can use .... - SotFormatStringId nRecognizedFormat = 0; - if (_rData.HasFormat(SOT_FORMATSTR_ID_SBA_FIELDDATAEXCHANGE)) - nRecognizedFormat = SOT_FORMATSTR_ID_SBA_FIELDDATAEXCHANGE; - if (_rData.HasFormat(SOT_FORMATSTR_ID_SBA_CTRLDATAEXCHANGE)) - nRecognizedFormat = SOT_FORMATSTR_ID_SBA_CTRLDATAEXCHANGE; - if (!nRecognizedFormat) + SotClipboardFormatId nRecognizedFormat = SotClipboardFormatId::NONE; + if (_rData.HasFormat(SotClipboardFormatId::SBA_FIELDDATAEXCHANGE)) + nRecognizedFormat = SotClipboardFormatId::SBA_FIELDDATAEXCHANGE; + if (_rData.HasFormat(SotClipboardFormatId::SBA_CTRLDATAEXCHANGE)) + nRecognizedFormat = SotClipboardFormatId::SBA_CTRLDATAEXCHANGE; + if (nRecognizedFormat == SotClipboardFormatId::NONE) return false; OUString sFieldDescription; @@ -361,17 +362,15 @@ namespace svx if ( _pContainer ) { if ( m_nFormatFlags & CTF_FIELD_DESCRIPTOR ) - _pContainer->CopyAny( SOT_FORMATSTR_ID_SBA_FIELDDATAEXCHANGE, makeAny( m_sCompatibleFormat ) ); + _pContainer->CopyAny( SotClipboardFormatId::SBA_FIELDDATAEXCHANGE, makeAny( m_sCompatibleFormat ) ); if ( m_nFormatFlags & CTF_CONTROL_EXCHANGE ) - _pContainer->CopyAny( SOT_FORMATSTR_ID_SBA_CTRLDATAEXCHANGE, makeAny( m_sCompatibleFormat ) ); + _pContainer->CopyAny( SotClipboardFormatId::SBA_CTRLDATAEXCHANGE, makeAny( m_sCompatibleFormat ) ); if ( m_nFormatFlags & CTF_COLUMN_DESCRIPTOR ) { Any aContent = makeAny( m_aDescriptor.createPropertyValueSequence() ); - _pContainer->CopyAny( - sal::static_int_cast< sal_uInt16 >( getDescriptorFormatId() ), - aContent ); + _pContainer->CopyAny( getDescriptorFormatId(), aContent ); } } } @@ -447,33 +446,34 @@ namespace svx switch (nObjectType) { case CommandType::TABLE: - AddFormat(SOT_FORMATSTR_ID_DBACCESS_TABLE); + AddFormat(SotClipboardFormatId::DBACCESS_TABLE); break; case CommandType::QUERY: - AddFormat(SOT_FORMATSTR_ID_DBACCESS_QUERY); + AddFormat(SotClipboardFormatId::DBACCESS_QUERY); break; case CommandType::COMMAND: - AddFormat(SOT_FORMATSTR_ID_DBACCESS_COMMAND); + AddFormat(SotClipboardFormatId::DBACCESS_COMMAND); break; } if (!m_sCompatibleObjectDescription.isEmpty()) - AddFormat(SOT_FORMATSTR_ID_SBA_DATAEXCHANGE); + AddFormat(SotClipboardFormatId::SBA_DATAEXCHANGE); } bool ODataAccessObjectTransferable::GetData( const DataFlavor& rFlavor, const OUString& /*rDestDoc*/ ) { - sal_uIntPtr nFormat = SotExchange::GetFormat(rFlavor); + SotClipboardFormatId nFormat = SotExchange::GetFormat(rFlavor); switch (nFormat) { - case SOT_FORMATSTR_ID_DBACCESS_TABLE: - case SOT_FORMATSTR_ID_DBACCESS_QUERY: - case SOT_FORMATSTR_ID_DBACCESS_COMMAND: + case SotClipboardFormatId::DBACCESS_TABLE: + case SotClipboardFormatId::DBACCESS_QUERY: + case SotClipboardFormatId::DBACCESS_COMMAND: return SetAny( makeAny(m_aDescriptor.createPropertyValueSequence()), rFlavor ); - case SOT_FORMATSTR_ID_SBA_DATAEXCHANGE: + case SotClipboardFormatId::SBA_DATAEXCHANGE: return SetString(m_sCompatibleObjectDescription, rFlavor); + default: break; } return false; } @@ -486,11 +486,11 @@ namespace svx ++aCheck ) { - if (SOT_FORMATSTR_ID_DBACCESS_TABLE == aCheck->mnSotId) + if (SotClipboardFormatId::DBACCESS_TABLE == aCheck->mnSotId) return true; - if (SOT_FORMATSTR_ID_DBACCESS_QUERY == aCheck->mnSotId) + if (SotClipboardFormatId::DBACCESS_QUERY == aCheck->mnSotId) return true; - if (SOT_FORMATSTR_ID_DBACCESS_COMMAND == aCheck->mnSotId) + if (SotClipboardFormatId::DBACCESS_COMMAND == aCheck->mnSotId) return true; } return false; @@ -499,15 +499,15 @@ namespace svx ODataAccessDescriptor ODataAccessObjectTransferable::extractObjectDescriptor(const TransferableDataHelper& _rData) { - sal_Int32 nKnownFormatId = 0; - if ( _rData.HasFormat( SOT_FORMATSTR_ID_DBACCESS_TABLE ) ) - nKnownFormatId = SOT_FORMATSTR_ID_DBACCESS_TABLE; - if ( _rData.HasFormat( SOT_FORMATSTR_ID_DBACCESS_QUERY ) ) - nKnownFormatId = SOT_FORMATSTR_ID_DBACCESS_QUERY; - if ( _rData.HasFormat( SOT_FORMATSTR_ID_DBACCESS_COMMAND ) ) - nKnownFormatId = SOT_FORMATSTR_ID_DBACCESS_COMMAND; - - if (0 != nKnownFormatId) + SotClipboardFormatId nKnownFormatId = SotClipboardFormatId::NONE; + if ( _rData.HasFormat( SotClipboardFormatId::DBACCESS_TABLE ) ) + nKnownFormatId = SotClipboardFormatId::DBACCESS_TABLE; + if ( _rData.HasFormat( SotClipboardFormatId::DBACCESS_QUERY ) ) + nKnownFormatId = SotClipboardFormatId::DBACCESS_QUERY; + if ( _rData.HasFormat( SotClipboardFormatId::DBACCESS_COMMAND ) ) + nKnownFormatId = SotClipboardFormatId::DBACCESS_COMMAND; + + if (SotClipboardFormatId::NONE != nKnownFormatId) { // extract the any from the transferable DataFlavor aFlavor; @@ -582,7 +582,7 @@ namespace svx OUString sDatasourceName = _rDatasource; sObjectName = _rCommand; - // for compatibility: create a string which can be used for the SOT_FORMATSTR_ID_SBA_DATAEXCHANGE format + // for compatibility: create a string which can be used for the SotClipboardFormatId::SBA_DATAEXCHANGE format bool bTreatAsStatement = (CommandType::COMMAND == _nCommandType); // statements are - in this old and ugly format - described as queries @@ -621,13 +621,13 @@ namespace svx { } - sal_uInt32 OMultiColumnTransferable::getDescriptorFormatId() + SotClipboardFormatId OMultiColumnTransferable::getDescriptorFormatId() { - static sal_uInt32 s_nFormat = (sal_uInt32)-1; - if ((sal_uInt32)-1 == s_nFormat) + static SotClipboardFormatId s_nFormat = static_cast<SotClipboardFormatId>(-1); + if (static_cast<SotClipboardFormatId>(-1) == s_nFormat) { s_nFormat = SotExchange::RegisterFormatName(OUString("application/x-openoffice;windows_formatname=\"dbaccess.MultipleColumnDescriptorTransfer\"")); - OSL_ENSURE((sal_uInt32)-1 != s_nFormat, "OColumnTransferable::getDescriptorFormatId: bad exchange id!"); + OSL_ENSURE(static_cast<SotClipboardFormatId>(-1) != s_nFormat, "OColumnTransferable::getDescriptorFormatId: bad exchange id!"); } return s_nFormat; } @@ -639,7 +639,7 @@ namespace svx bool OMultiColumnTransferable::GetData( const DataFlavor& _rFlavor, const OUString& /*rDestDoc*/ ) { - const sal_uInt32 nFormatId = SotExchange::GetFormat(_rFlavor); + const SotClipboardFormatId nFormatId = SotExchange::GetFormat(_rFlavor); if (nFormatId == getDescriptorFormatId()) { return SetAny( makeAny( m_aDescriptors ), _rFlavor ); diff --git a/svx/source/fmcomp/dbaobjectex.cxx b/svx/source/fmcomp/dbaobjectex.cxx index d43184e5c4e9..c2a66f28216c 100644 --- a/svx/source/fmcomp/dbaobjectex.cxx +++ b/svx/source/fmcomp/dbaobjectex.cxx @@ -52,19 +52,19 @@ namespace svx - sal_uInt32 OComponentTransferable::getDescriptorFormatId(bool _bExtractForm) + SotClipboardFormatId OComponentTransferable::getDescriptorFormatId(bool _bExtractForm) { - static sal_uInt32 s_nReportFormat = (sal_uInt32)-1; - static sal_uInt32 s_nFormFormat = (sal_uInt32)-1; - if ( _bExtractForm && (sal_uInt32)-1 == s_nFormFormat ) + static SotClipboardFormatId s_nReportFormat = static_cast<SotClipboardFormatId>(-1); + static SotClipboardFormatId s_nFormFormat = static_cast<SotClipboardFormatId>(-1); + if ( _bExtractForm && static_cast<SotClipboardFormatId>(-1) == s_nFormFormat ) { s_nFormFormat = SotExchange::RegisterFormatName(OUString("application/x-openoffice;windows_formatname=\"dbaccess.FormComponentDescriptorTransfer\"" )); - OSL_ENSURE((sal_uInt32)-1 != s_nFormFormat, "OComponentTransferable::getDescriptorFormatId: bad exchange id!"); + OSL_ENSURE(static_cast<SotClipboardFormatId>(-1) != s_nFormFormat, "OComponentTransferable::getDescriptorFormatId: bad exchange id!"); } - else if ( !_bExtractForm && (sal_uInt32)-1 == s_nReportFormat) + else if ( !_bExtractForm && static_cast<SotClipboardFormatId>(-1) == s_nReportFormat) { s_nReportFormat = SotExchange::RegisterFormatName(OUString("application/x-openoffice;windows_formatname=\"dbaccess.ReportComponentDescriptorTransfer\"")); - OSL_ENSURE((sal_uInt32)-1 != s_nReportFormat, "OComponentTransferable::getDescriptorFormatId: bad exchange id!"); + OSL_ENSURE(static_cast<SotClipboardFormatId>(-1) != s_nReportFormat, "OComponentTransferable::getDescriptorFormatId: bad exchange id!"); } return _bExtractForm ? s_nFormFormat : s_nReportFormat; } @@ -88,7 +88,7 @@ namespace svx bool OComponentTransferable::GetData( const DataFlavor& _rFlavor, const OUString& /*rDestDoc*/ ) { - const sal_uInt32 nFormatId = SotExchange::GetFormat(_rFlavor); + const SotClipboardFormatId nFormatId = SotExchange::GetFormat(_rFlavor); if ( nFormatId == getDescriptorFormatId(true) || nFormatId == getDescriptorFormatId(false) ) return SetAny( makeAny( m_aDescriptor.createPropertyValueSequence() ), _rFlavor ); diff --git a/svx/source/fmcomp/xmlexchg.cxx b/svx/source/fmcomp/xmlexchg.cxx index 6a493c261b4b..22b1a3ccc684 100644 --- a/svx/source/fmcomp/xmlexchg.cxx +++ b/svx/source/fmcomp/xmlexchg.cxx @@ -34,13 +34,13 @@ namespace svx void OXFormsTransferable::AddSupportedFormats() { - AddFormat( SOT_FORMATSTR_ID_XFORMS ); + AddFormat( SotClipboardFormatId::XFORMS ); } bool OXFormsTransferable::GetData( const DataFlavor& _rFlavor, const OUString& /*rDestDoc*/ ) { - const sal_uInt32 nFormatId = SotExchange::GetFormat( _rFlavor ); - if ( SOT_FORMATSTR_ID_XFORMS == nFormatId ) + const SotClipboardFormatId nFormatId = SotExchange::GetFormat( _rFlavor ); + if ( SotClipboardFormatId::XFORMS == nFormatId ) { return SetString(OUString("XForms-Transferable"), _rFlavor); } diff --git a/svx/source/form/filtnav.cxx b/svx/source/form/filtnav.cxx index d6c423020bc6..bd421b778abd 100644 --- a/svx/source/form/filtnav.cxx +++ b/svx/source/form/filtnav.cxx @@ -117,13 +117,13 @@ void OFilterItemExchange::AddSupportedFormats() } -sal_uInt32 OFilterItemExchange::getFormatId() +SotClipboardFormatId OFilterItemExchange::getFormatId() { - static sal_uInt32 s_nFormat = (sal_uInt32)-1; - if ((sal_uInt32)-1 == s_nFormat) + static SotClipboardFormatId s_nFormat = static_cast<SotClipboardFormatId>(-1); + if (static_cast<SotClipboardFormatId>(-1) == s_nFormat) { s_nFormat = SotExchange::RegisterFormatName(OUString("application/x-openoffice;windows_formatname=\"form.FilterControlExchange\"")); - DBG_ASSERT((sal_uInt32)-1 != s_nFormat, "OFilterExchangeHelper::getFormatId: bad exchange id!"); + DBG_ASSERT(static_cast<SotClipboardFormatId>(-1) != s_nFormat, "OFilterExchangeHelper::getFormatId: bad exchange id!"); } return s_nFormat; } diff --git a/svx/source/form/fmexch.cxx b/svx/source/form/fmexch.cxx index 7ad362e500af..50943bd1a92f 100644 --- a/svx/source/form/fmexch.cxx +++ b/svx/source/form/fmexch.cxx @@ -99,7 +99,7 @@ namespace svxform } - bool OLocalExchange::hasFormat( const DataFlavorExVector& _rFormats, sal_uInt32 _nFormatId ) + bool OLocalExchange::hasFormat( const DataFlavorExVector& _rFormats, SotClipboardFormatId _nFormatId ) { DataFlavorExVector::const_iterator aSearch; @@ -154,7 +154,7 @@ namespace svxform } - static bool lcl_fillDataFlavorEx( SotFormatStringId nId, DataFlavorEx& _rFlavor ) + static bool lcl_fillDataFlavorEx( SotClipboardFormatId nId, DataFlavorEx& _rFlavor ) { _rFlavor.mnSotId = nId; return SotExchange::GetFormatDataFlavor( _rFlavor.mnSotId, _rFlavor ); @@ -280,7 +280,7 @@ namespace svxform bool OControlExchange::GetData( const DataFlavor& _rFlavor, const OUString& rDestDoc ) { - const sal_uInt32 nFormatId = SotExchange::GetFormat( _rFlavor ); + const SotClipboardFormatId nFormatId = SotExchange::GetFormat( _rFlavor ); if ( getControlPathFormatId( ) == nFormatId ) { @@ -317,37 +317,37 @@ namespace svxform } - sal_uInt32 OControlExchange::getControlPathFormatId() + SotClipboardFormatId OControlExchange::getControlPathFormatId() { - static sal_uInt32 s_nFormat = (sal_uInt32)-1; - if ((sal_uInt32)-1 == s_nFormat) + static SotClipboardFormatId s_nFormat = static_cast<SotClipboardFormatId>(-1); + if (static_cast<SotClipboardFormatId>(-1) == s_nFormat) { s_nFormat = SotExchange::RegisterFormatName(OUString("application/x-openoffice;windows_formatname=\"svxform.ControlPathExchange\"")); - DBG_ASSERT((sal_uInt32)-1 != s_nFormat, "OControlExchange::getControlPathFormatId: bad exchange id!"); + DBG_ASSERT(static_cast<SotClipboardFormatId>(-1) != s_nFormat, "OControlExchange::getControlPathFormatId: bad exchange id!"); } return s_nFormat; } - sal_uInt32 OControlExchange::getHiddenControlModelsFormatId() + SotClipboardFormatId OControlExchange::getHiddenControlModelsFormatId() { - static sal_uInt32 s_nFormat = (sal_uInt32)-1; - if ((sal_uInt32)-1 == s_nFormat) + static SotClipboardFormatId s_nFormat = static_cast<SotClipboardFormatId>(-1); + if (static_cast<SotClipboardFormatId>(-1) == s_nFormat) { s_nFormat = SotExchange::RegisterFormatName(OUString("application/x-openoffice;windows_formatname=\"svxform.HiddenControlModelsExchange\"")); - DBG_ASSERT((sal_uInt32)-1 != s_nFormat, "OControlExchange::getHiddenControlModelsFormatId: bad exchange id!"); + DBG_ASSERT(static_cast<SotClipboardFormatId>(-1) != s_nFormat, "OControlExchange::getHiddenControlModelsFormatId: bad exchange id!"); } return s_nFormat; } - sal_uInt32 OControlExchange::getFieldExchangeFormatId() + SotClipboardFormatId OControlExchange::getFieldExchangeFormatId() { - static sal_uInt32 s_nFormat = (sal_uInt32)-1; - if ((sal_uInt32)-1 == s_nFormat) + static SotClipboardFormatId s_nFormat = static_cast<SotClipboardFormatId>(-1); + if (static_cast<SotClipboardFormatId>(-1) == s_nFormat) { s_nFormat = SotExchange::RegisterFormatName(OUString("application/x-openoffice;windows_formatname=\"svxform.FieldNameExchange\"")); - DBG_ASSERT((sal_uInt32)-1 != s_nFormat, "OControlExchange::getFieldExchangeFormatId: bad exchange id!"); + DBG_ASSERT(static_cast<SotClipboardFormatId>(-1) != s_nFormat, "OControlExchange::getFieldExchangeFormatId: bad exchange id!"); } return s_nFormat; } diff --git a/svx/source/form/fmtextcontrolshell.cxx b/svx/source/form/fmtextcontrolshell.cxx index 7d1366c5852d..43dccd894b63 100644 --- a/svx/source/form/fmtextcontrolshell.cxx +++ b/svx/source/form/fmtextcontrolshell.cxx @@ -971,7 +971,7 @@ namespace svx if ( pActiveControlVCLWindow ) { TransferableDataHelper aDataHelper( TransferableDataHelper::CreateFromSystemClipboard( pActiveControlVCLWindow) ); - bDisable |= !aDataHelper.HasFormat( SOT_FORMAT_STRING ); + bDisable |= !aDataHelper.HasFormat( SotClipboardFormatId::STRING ); } else bDisable |= true; diff --git a/svx/source/gallery2/galbrws2.cxx b/svx/source/gallery2/galbrws2.cxx index 52574c269ee5..c68f6f91feb7 100644 --- a/svx/source/gallery2/galbrws2.cxx +++ b/svx/source/gallery2/galbrws2.cxx @@ -274,12 +274,12 @@ void GalleryThemePopup::ExecutePopup( vcl::Window *pWindow, const ::Point &aPos if( aDataHelper.GetFormatCount() ) { - if( aDataHelper.HasFormat( SOT_FORMATSTR_ID_DRAWING ) || - aDataHelper.HasFormat( SOT_FORMAT_FILE_LIST ) || - aDataHelper.HasFormat( FORMAT_FILE ) || - aDataHelper.HasFormat( SOT_FORMATSTR_ID_SVXB ) || - aDataHelper.HasFormat( FORMAT_GDIMETAFILE ) || - aDataHelper.HasFormat( FORMAT_BITMAP ) ) + if( aDataHelper.HasFormat( SotClipboardFormatId::DRAWING ) || + aDataHelper.HasFormat( SotClipboardFormatId::FILE_LIST ) || + aDataHelper.HasFormat( SotClipboardFormatId::FILE ) || + aDataHelper.HasFormat( SotClipboardFormatId::SVXB ) || + aDataHelper.HasFormat( SotClipboardFormatId::GDIMETAFILE ) || + aDataHelper.HasFormat( SotClipboardFormatId::BITMAP ) ) { bEnable = sal_True; } @@ -574,12 +574,12 @@ sal_Int8 GalleryBrowser2::AcceptDrop( DropTargetHelper& rTarget, const AcceptDro { if( !mpCurTheme->IsDragging() ) { - if( rTarget.IsDropFormatSupported( SOT_FORMATSTR_ID_DRAWING ) || - rTarget.IsDropFormatSupported( SOT_FORMAT_FILE_LIST ) || - rTarget.IsDropFormatSupported( FORMAT_FILE ) || - rTarget.IsDropFormatSupported( SOT_FORMATSTR_ID_SVXB ) || - rTarget.IsDropFormatSupported( FORMAT_GDIMETAFILE ) || - rTarget.IsDropFormatSupported( FORMAT_BITMAP ) ) + if( rTarget.IsDropFormatSupported( SotClipboardFormatId::DRAWING ) || + rTarget.IsDropFormatSupported( SotClipboardFormatId::FILE_LIST ) || + rTarget.IsDropFormatSupported( SotClipboardFormatId::FILE ) || + rTarget.IsDropFormatSupported( SotClipboardFormatId::SVXB ) || + rTarget.IsDropFormatSupported( SotClipboardFormatId::GDIMETAFILE ) || + rTarget.IsDropFormatSupported( SotClipboardFormatId::BITMAP ) ) { nRet = DND_ACTION_COPY; } diff --git a/svx/source/gallery2/galmisc.cxx b/svx/source/gallery2/galmisc.cxx index fd0a90cc33be..7a7809df927a 100644 --- a/svx/source/gallery2/galmisc.cxx +++ b/svx/source/gallery2/galmisc.cxx @@ -477,29 +477,29 @@ void GalleryTransferable::AddSupportedFormats() { if( SGA_OBJ_SVDRAW == meObjectKind ) { - AddFormat( SOT_FORMATSTR_ID_DRAWING ); - AddFormat( SOT_FORMATSTR_ID_SVXB ); - AddFormat( FORMAT_GDIMETAFILE ); - AddFormat( FORMAT_BITMAP ); + AddFormat( SotClipboardFormatId::DRAWING ); + AddFormat( SotClipboardFormatId::SVXB ); + AddFormat( SotClipboardFormatId::GDIMETAFILE ); + AddFormat( SotClipboardFormatId::BITMAP ); } else { if( mpURL ) - AddFormat( FORMAT_FILE ); + AddFormat( SotClipboardFormatId::FILE ); if( mpGraphicObject ) { - AddFormat( SOT_FORMATSTR_ID_SVXB ); + AddFormat( SotClipboardFormatId::SVXB ); if( mpGraphicObject->GetType() == GRAPHIC_GDIMETAFILE ) { - AddFormat( FORMAT_GDIMETAFILE ); - AddFormat( FORMAT_BITMAP ); + AddFormat( SotClipboardFormatId::GDIMETAFILE ); + AddFormat( SotClipboardFormatId::BITMAP ); } else { - AddFormat( FORMAT_BITMAP ); - AddFormat( FORMAT_GDIMETAFILE ); + AddFormat( SotClipboardFormatId::BITMAP ); + AddFormat( SotClipboardFormatId::GDIMETAFILE ); } } } @@ -507,33 +507,33 @@ void GalleryTransferable::AddSupportedFormats() bool GalleryTransferable::GetData( const datatransfer::DataFlavor& rFlavor, const OUString& /*rDestDoc*/ ) { - sal_uInt32 nFormat = SotExchange::GetFormat( rFlavor ); + SotClipboardFormatId nFormat = SotExchange::GetFormat( rFlavor ); bool bRet = false; InitData( false ); - if( ( SOT_FORMATSTR_ID_DRAWING == nFormat ) && ( SGA_OBJ_SVDRAW == meObjectKind ) ) + if( ( SotClipboardFormatId::DRAWING == nFormat ) && ( SGA_OBJ_SVDRAW == meObjectKind ) ) { - bRet = ( mxModelStream.Is() && SetObject( &mxModelStream, 0, rFlavor ) ); + bRet = ( mxModelStream.Is() && SetObject( &mxModelStream, SotClipboardFormatId::NONE, rFlavor ) ); } - else if( ( SOT_FORMATSTR_ID_SVIM == nFormat ) && mpImageMap ) + else if( ( SotClipboardFormatId::SVIM == nFormat ) && mpImageMap ) { // TODO/MBA: do we need a BaseURL here?! bRet = SetImageMap( *mpImageMap, rFlavor ); } - else if( ( FORMAT_FILE == nFormat ) && mpURL ) + else if( ( SotClipboardFormatId::FILE == nFormat ) && mpURL ) { bRet = SetString( mpURL->GetMainURL( INetURLObject::NO_DECODE ), rFlavor ); } - else if( ( SOT_FORMATSTR_ID_SVXB == nFormat ) && mpGraphicObject ) + else if( ( SotClipboardFormatId::SVXB == nFormat ) && mpGraphicObject ) { bRet = SetGraphic( mpGraphicObject->GetGraphic(), rFlavor ); } - else if( ( FORMAT_GDIMETAFILE == nFormat ) && mpGraphicObject ) + else if( ( SotClipboardFormatId::GDIMETAFILE == nFormat ) && mpGraphicObject ) { bRet = SetGDIMetaFile( mpGraphicObject->GetGraphic().GetGDIMetaFile(), rFlavor ); } - else if( ( FORMAT_BITMAP == nFormat ) && mpGraphicObject ) + else if( ( SotClipboardFormatId::BITMAP == nFormat ) && mpGraphicObject ) { bRet = SetBitmapEx( mpGraphicObject->GetGraphic().GetBitmapEx(), rFlavor ); } @@ -542,7 +542,7 @@ bool GalleryTransferable::GetData( const datatransfer::DataFlavor& rFlavor, cons } bool GalleryTransferable::WriteObject( SotStorageStreamRef& rxOStm, void* pUserObject, - sal_uInt32, const datatransfer::DataFlavor& ) + SotClipboardFormatId, const datatransfer::DataFlavor& ) { bool bRet = false; diff --git a/svx/source/gallery2/galtheme.cxx b/svx/source/gallery2/galtheme.cxx index 2bf184f4c559..c0f5ecd6d00e 100644 --- a/svx/source/gallery2/galtheme.cxx +++ b/svx/source/gallery2/galtheme.cxx @@ -1185,24 +1185,24 @@ bool GalleryTheme::InsertTransferable( const uno::Reference< datatransfer::XTran TransferableDataHelper aDataHelper( rxTransferable ); boost::scoped_ptr<Graphic> pGraphic; - if( aDataHelper.HasFormat( SOT_FORMATSTR_ID_DRAWING ) ) + if( aDataHelper.HasFormat( SotClipboardFormatId::DRAWING ) ) { SotStorageStreamRef xModelStm; - if( aDataHelper.GetSotStorageStream( SOT_FORMATSTR_ID_DRAWING, xModelStm ) ) + if( aDataHelper.GetSotStorageStream( SotClipboardFormatId::DRAWING, xModelStm ) ) bRet = InsertModelStream( xModelStm, nInsertPos ); } - else if( aDataHelper.HasFormat( SOT_FORMAT_FILE_LIST ) || - aDataHelper.HasFormat( FORMAT_FILE ) ) + else if( aDataHelper.HasFormat( SotClipboardFormatId::FILE_LIST ) || + aDataHelper.HasFormat( SotClipboardFormatId::FILE ) ) { FileList aFileList; - if( aDataHelper.HasFormat( SOT_FORMAT_FILE_LIST ) ) - aDataHelper.GetFileList( SOT_FORMAT_FILE_LIST, aFileList ); + if( aDataHelper.HasFormat( SotClipboardFormatId::FILE_LIST ) ) + aDataHelper.GetFileList( SotClipboardFormatId::FILE_LIST, aFileList ); else { OUString aFile; - if (aDataHelper.GetString(FORMAT_FILE, aFile) && !aFile.isEmpty()) + if (aDataHelper.GetString(SotClipboardFormatId::FILE, aFile) && !aFile.isEmpty()) aFileList.AppendFile( aFile ); } @@ -1226,16 +1226,16 @@ bool GalleryTheme::InsertTransferable( const uno::Reference< datatransfer::XTran else { Graphic aGraphic; - sal_uIntPtr nFormat = 0; + SotClipboardFormatId nFormat = SotClipboardFormatId::NONE; - if( aDataHelper.HasFormat( SOT_FORMATSTR_ID_SVXB ) ) - nFormat = SOT_FORMATSTR_ID_SVXB; - else if( aDataHelper.HasFormat( FORMAT_GDIMETAFILE ) ) - nFormat = FORMAT_GDIMETAFILE; - else if( aDataHelper.HasFormat( FORMAT_BITMAP ) ) - nFormat = FORMAT_BITMAP; + if( aDataHelper.HasFormat( SotClipboardFormatId::SVXB ) ) + nFormat = SotClipboardFormatId::SVXB; + else if( aDataHelper.HasFormat( SotClipboardFormatId::GDIMETAFILE ) ) + nFormat = SotClipboardFormatId::GDIMETAFILE; + else if( aDataHelper.HasFormat( SotClipboardFormatId::BITMAP ) ) + nFormat = SotClipboardFormatId::BITMAP; - if( nFormat && aDataHelper.GetGraphic( nFormat, aGraphic ) ) + if( nFormat != SotClipboardFormatId::NONE && aDataHelper.GetGraphic( nFormat, aGraphic ) ) pGraphic.reset(new Graphic( aGraphic )); } @@ -1243,13 +1243,13 @@ bool GalleryTheme::InsertTransferable( const uno::Reference< datatransfer::XTran { bRet = false; - if( aDataHelper.HasFormat( SOT_FORMATSTR_ID_SVIM ) ) + if( aDataHelper.HasFormat( SotClipboardFormatId::SVIM ) ) { ImageMap aImageMap; // according to KA we don't need a BaseURL here - if( aDataHelper.GetImageMap( SOT_FORMATSTR_ID_SVIM, aImageMap ) ) + if( aDataHelper.GetImageMap( SotClipboardFormatId::SVIM, aImageMap ) ) { SvxGalleryDrawModel aModel; diff --git a/svx/source/inc/filtnav.hxx b/svx/source/inc/filtnav.hxx index 6e050a0f18a6..2ae3ff311f68 100644 --- a/svx/source/inc/filtnav.hxx +++ b/svx/source/inc/filtnav.hxx @@ -206,7 +206,7 @@ class OFilterItemExchange : public OLocalExchange public: OFilterItemExchange(); - static sal_uInt32 getFormatId( ); + static SotClipboardFormatId getFormatId( ); inline static bool hasFormat( const DataFlavorExVector& _rFormats ); const ::std::vector<FmFilterItem*>& getDraggedEntries() const { return m_aDraggedEntries; } diff --git a/svx/source/inc/fmexch.hxx b/svx/source/inc/fmexch.hxx index ea6d34a5b3c7..5f77950826de 100644 --- a/svx/source/inc/fmexch.hxx +++ b/svx/source/inc/fmexch.hxx @@ -74,7 +74,7 @@ namespace svxform void clear(); - static bool hasFormat( const DataFlavorExVector& _rFormats, sal_uInt32 _nFormatId ); + static bool hasFormat( const DataFlavorExVector& _rFormats, SotClipboardFormatId _nFormatId ); protected: // XClipboardOwner @@ -210,9 +210,9 @@ namespace svxform OControlExchange( ); public: - static sal_uInt32 getFieldExchangeFormatId( ); - static sal_uInt32 getControlPathFormatId( ); - static sal_uInt32 getHiddenControlModelsFormatId( ); + static SotClipboardFormatId getFieldExchangeFormatId( ); + static SotClipboardFormatId getControlPathFormatId( ); + static SotClipboardFormatId getHiddenControlModelsFormatId( ); inline static bool hasFieldExchangeFormat( const DataFlavorExVector& _rFormats ); inline static bool hasControlPathFormat( const DataFlavorExVector& _rFormats ); diff --git a/svx/source/items/clipfmtitem.cxx b/svx/source/items/clipfmtitem.cxx index f7ae1207de0c..bc9362fb6543 100644 --- a/svx/source/items/clipfmtitem.cxx +++ b/svx/source/items/clipfmtitem.cxx @@ -25,7 +25,7 @@ struct SvxClipboardFmtItem_Impl { boost::ptr_vector< boost::nullable<OUString> > aFmtNms; - std::vector<sal_uIntPtr> aFmtIds; + std::vector<SotClipboardFormatId> aFmtIds; SvxClipboardFmtItem_Impl() {} SvxClipboardFmtItem_Impl( const SvxClipboardFmtItem_Impl& ); @@ -84,7 +84,7 @@ bool SvxClipboardFmtItem::PutValue( const ::com::sun::star::uno::Any& rVal, sal_ pImpl->aFmtIds.clear(); pImpl->aFmtNms.clear(); for ( sal_uInt16 n=0; n < nCount; ++n ) - AddClipbrdFormat( sal_uIntPtr( aClipFormats.Identifiers[n] ), aClipFormats.Names[n], n ); + AddClipbrdFormat( static_cast<SotClipboardFormatId>(aClipFormats.Identifiers[n]), aClipFormats.Names[n], n ); return true; } @@ -118,7 +118,7 @@ SfxPoolItem* SvxClipboardFmtItem::Clone( SfxItemPool * /*pPool*/ ) const return new SvxClipboardFmtItem( *this ); } -void SvxClipboardFmtItem::AddClipbrdFormat( sal_uIntPtr nId, sal_uInt16 nPos ) +void SvxClipboardFmtItem::AddClipbrdFormat( SotClipboardFormatId nId, sal_uInt16 nPos ) { if( nPos > pImpl->aFmtNms.size() ) nPos = pImpl->aFmtNms.size(); @@ -127,7 +127,7 @@ void SvxClipboardFmtItem::AddClipbrdFormat( sal_uIntPtr nId, sal_uInt16 nPos ) pImpl->aFmtIds.insert( pImpl->aFmtIds.begin()+nPos, nId ); } -void SvxClipboardFmtItem::AddClipbrdFormat( sal_uIntPtr nId, const OUString& rName, +void SvxClipboardFmtItem::AddClipbrdFormat( SotClipboardFormatId nId, const OUString& rName, sal_uInt16 nPos ) { if( nPos > pImpl->aFmtNms.size() ) @@ -142,7 +142,7 @@ sal_uInt16 SvxClipboardFmtItem::Count() const return pImpl->aFmtIds.size(); } -sal_uIntPtr SvxClipboardFmtItem::GetClipbrdFormatId( sal_uInt16 nPos ) const +SotClipboardFormatId SvxClipboardFmtItem::GetClipbrdFormatId( sal_uInt16 nPos ) const { return pImpl->aFmtIds[ nPos ]; } diff --git a/svx/source/mnuctrls/clipboardctl.cxx b/svx/source/mnuctrls/clipboardctl.cxx index 8602702e0fea..352dcb0cb651 100644 --- a/svx/source/mnuctrls/clipboardctl.cxx +++ b/svx/source/mnuctrls/clipboardctl.cxx @@ -74,7 +74,7 @@ SfxPopupWindow* SvxClipBoardControl::CreatePopupWindow() sal_uInt16 nCount = pFmtItem->Count(); for (sal_uInt16 i = 0; i < nCount; ++i) { - sal_uIntPtr nFmtID = pFmtItem->GetClipbrdFormatId( i ); + SotClipboardFormatId nFmtID = pFmtItem->GetClipbrdFormatId( i ); OUString aFmtStr( pFmtItem->GetClipbrdFormatName( i ) ); if (aFmtStr.isEmpty()) aFmtStr = SvPasteObjectHelper::GetSotFormatUIName( nFmtID ); diff --git a/svx/source/svdraw/svdograf.cxx b/svx/source/svdraw/svdograf.cxx index c8aec7d0de11..612f2aa7105a 100644 --- a/svx/source/svdraw/svdograf.cxx +++ b/svx/source/svdraw/svdograf.cxx @@ -195,7 +195,7 @@ void SAL_CALL SdrGraphicUpdater::run(void) } SdrGraphicLink::SdrGraphicLink(SdrGrafObj& rObj) -: ::sfx2::SvBaseLink( ::sfx2::LINKUPDATE_ONCALL, SOT_FORMATSTR_ID_SVXB ) +: ::sfx2::SvBaseLink( ::sfx2::LINKUPDATE_ONCALL, SotClipboardFormatId::SVXB ) , rGrafObj( rObj ) , pGraphicUpdater( NULL ) { diff --git a/svx/source/svdraw/svdoole2.cxx b/svx/source/svdraw/svdoole2.cxx index 2f495acf2293..2592c580b5b9 100644 --- a/svx/source/svdraw/svdoole2.cxx +++ b/svx/source/svdraw/svdoole2.cxx @@ -608,7 +608,7 @@ public: SdrEmbedObjectLink::SdrEmbedObjectLink(SdrOle2Obj* pObject): - ::sfx2::SvBaseLink( ::sfx2::LINKUPDATE_ONCALL, SOT_FORMATSTR_ID_SVXB ), + ::sfx2::SvBaseLink( ::sfx2::LINKUPDATE_ONCALL, SotClipboardFormatId::SVXB ), pObj(pObject) { SetSynchron( false ); diff --git a/svx/source/svdraw/svdotxln.cxx b/svx/source/svdraw/svdotxln.cxx index b2bb10a99412..e1156160bde3 100644 --- a/svx/source/svdraw/svdotxln.cxx +++ b/svx/source/svdraw/svdotxln.cxx @@ -41,7 +41,7 @@ class ImpSdrObjTextLink: public ::sfx2::SvBaseLink public: ImpSdrObjTextLink( SdrTextObj* pObj1 ) - : ::sfx2::SvBaseLink( ::sfx2::LINKUPDATE_ONCALL, FORMAT_FILE ), + : ::sfx2::SvBaseLink( ::sfx2::LINKUPDATE_ONCALL, SotClipboardFormatId::FILE ), pSdrObj( pObj1 ) {} virtual ~ImpSdrObjTextLink(); diff --git a/svx/source/tbxctrls/colrctrl.cxx b/svx/source/tbxctrls/colrctrl.cxx index 689932bda7ad..f78e8276db9e 100644 --- a/svx/source/tbxctrls/colrctrl.cxx +++ b/svx/source/tbxctrls/colrctrl.cxx @@ -52,7 +52,7 @@ protected: virtual void AddSupportedFormats() SAL_OVERRIDE; virtual bool GetData( const css::datatransfer::DataFlavor& rFlavor, const OUString& rDestDoc ) SAL_OVERRIDE; - virtual bool WriteObject( SotStorageStreamRef& rxOStm, void* pUserObject, sal_uInt32 nUserObjectId, const ::com::sun::star::datatransfer::DataFlavor& rFlavor ) SAL_OVERRIDE; + virtual bool WriteObject( SotStorageStreamRef& rxOStm, void* pUserObject, SotClipboardFormatId nUserObjectId, const ::com::sun::star::datatransfer::DataFlavor& rFlavor ) SAL_OVERRIDE; public: @@ -64,7 +64,7 @@ public: void SvxColorValueSetData::AddSupportedFormats() { - AddFormat( SOT_FORMATSTR_ID_XFA ); + AddFormat( SotClipboardFormatId::XFA ); } @@ -73,16 +73,16 @@ bool SvxColorValueSetData::GetData( const css::datatransfer::DataFlavor& rFlavor { bool bRet = false; - if( SotExchange::GetFormat( rFlavor ) == SOT_FORMATSTR_ID_XFA ) + if( SotExchange::GetFormat( rFlavor ) == SotClipboardFormatId::XFA ) { - SetObject( &maData, 0, rFlavor ); + SetObject( &maData, SotClipboardFormatId::NONE, rFlavor ); bRet = true; } return bRet; } -bool SvxColorValueSetData::WriteObject( SotStorageStreamRef& rxOStm, void*, sal_uInt32 , const ::com::sun::star::datatransfer::DataFlavor& ) +bool SvxColorValueSetData::WriteObject( SotStorageStreamRef& rxOStm, void*, SotClipboardFormatId, const ::com::sun::star::datatransfer::DataFlavor& ) { WriteXFillExchangeData( *rxOStm, maData ); return( rxOStm->GetError() == ERRCODE_NONE ); |