diff options
Diffstat (limited to 'sfx2/source/appl')
-rw-r--r-- | sfx2/source/appl/appdde.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/appl/fileobj.cxx | 18 | ||||
-rw-r--r-- | sfx2/source/appl/impldde.cxx | 33 | ||||
-rw-r--r-- | sfx2/source/appl/linkmgr2.cxx | 13 | ||||
-rw-r--r-- | sfx2/source/appl/lnkbase2.cxx | 20 |
5 files changed, 44 insertions, 42 deletions
diff --git a/sfx2/source/appl/appdde.cxx b/sfx2/source/appl/appdde.cxx index d2bf891e2c59..67b2f508573a 100644 --- a/sfx2/source/appl/appdde.cxx +++ b/sfx2/source/appl/appdde.cxx @@ -437,7 +437,7 @@ bool SfxApplication::InitializeDde() pAppData_Impl->pDocTopics = new SfxDdeDocTopics_Impl; // we certainly want to support RTF! - pAppData_Impl->pDdeService->AddFormat( FORMAT_RTF ); + pAppData_Impl->pDdeService->AddFormat( SotClipboardFormatId::RTF ); // Config path as a topic becauseof multiple starts INetURLObject aOfficeLockFile( SvtPathOptions().GetUserConfigPath() ); diff --git a/sfx2/source/appl/fileobj.cxx b/sfx2/source/appl/fileobj.cxx index db30c8354584..a1c1d989722a 100644 --- a/sfx2/source/appl/fileobj.cxx +++ b/sfx2/source/appl/fileobj.cxx @@ -76,11 +76,11 @@ bool SvFileObject::GetData( ::com::sun::star::uno::Any & rData, const OUString & rMimeType, bool bGetSynchron ) { - sal_uIntPtr nFmt = SotExchange::RegisterFormatMimeType( rMimeType ); + SotClipboardFormatId nFmt = SotExchange::RegisterFormatMimeType( rMimeType ); switch( nType ) { case FILETYPE_TEXT: - if( FORMAT_FILE == nFmt ) + if( SotClipboardFormatId::FILE == nFmt ) { // The media in the application must be opened to lookup the // relative file links!! This is done through the link manager @@ -94,8 +94,8 @@ bool SvFileObject::GetData( ::com::sun::star::uno::Any & rData, { SfxMediumRef xTmpMed; - if( FORMAT_GDIMETAFILE == nFmt || FORMAT_BITMAP == nFmt || - SOT_FORMATSTR_ID_SVXB == nFmt ) + if( SotClipboardFormatId::GDIMETAFILE == nFmt || SotClipboardFormatId::BITMAP == nFmt || + SotClipboardFormatId::SVXB == nFmt ) { Graphic aGrf; @@ -138,15 +138,15 @@ bool SvFileObject::GetData( ::com::sun::star::uno::Any & rData, aGrf.SetDefaultType(); } - if( SOT_FORMATSTR_ID_SVXB != nFmt ) + if( SotClipboardFormatId::SVXB != nFmt ) nFmt = (bLoadError || GRAPHIC_BITMAP == aGrf.GetType()) - ? FORMAT_BITMAP - : FORMAT_GDIMETAFILE; + ? SotClipboardFormatId::BITMAP + : SotClipboardFormatId::GDIMETAFILE; SvMemoryStream aMemStm( 0, 65535 ); switch ( nFmt ) { - case SOT_FORMATSTR_ID_SVXB: + case SotClipboardFormatId::SVXB: if( GRAPHIC_NONE != aGrf.GetType() ) { aMemStm.SetVersion( SOFFICE_FILEFORMAT_50 ); @@ -154,7 +154,7 @@ bool SvFileObject::GetData( ::com::sun::star::uno::Any & rData, } break; - case FORMAT_BITMAP: + case SotClipboardFormatId::BITMAP: { const Bitmap aBitmap(aGrf.GetBitmap()); diff --git a/sfx2/source/appl/impldde.cxx b/sfx2/source/appl/impldde.cxx index 6f1cb5196bfb..1d9617636c48 100644 --- a/sfx2/source/appl/impldde.cxx +++ b/sfx2/source/appl/impldde.cxx @@ -265,31 +265,32 @@ void SvDDEObject::Edit( vcl::Window* pParent, sfx2::SvBaseLink* pBaseLink, const bool SvDDEObject::ImplHasOtherFormat( DdeTransaction& rReq ) { - sal_uInt16 nFmt = 0; + SotClipboardFormatId nFmt = SotClipboardFormatId::NONE; switch( rReq.GetFormat() ) { - case FORMAT_RTF: - nFmt = FORMAT_STRING; + case SotClipboardFormatId::RTF: + nFmt = SotClipboardFormatId::STRING; break; - case SOT_FORMATSTR_ID_HTML_SIMPLE: - case SOT_FORMATSTR_ID_HTML: - nFmt = FORMAT_RTF; + case SotClipboardFormatId::HTML_SIMPLE: + case SotClipboardFormatId::HTML: + nFmt = SotClipboardFormatId::RTF; break; - case FORMAT_GDIMETAFILE: - nFmt = FORMAT_BITMAP; + case SotClipboardFormatId::GDIMETAFILE: + nFmt = SotClipboardFormatId::BITMAP; break; - case SOT_FORMATSTR_ID_SVXB: - nFmt = FORMAT_GDIMETAFILE; + case SotClipboardFormatId::SVXB: + nFmt = SotClipboardFormatId::GDIMETAFILE; break; // something else? + default: break; } - if( nFmt ) + if( nFmt != SotClipboardFormatId::NONE ) rReq.SetFormat( nFmt ); // try it once more - return 0 != nFmt; + return SotClipboardFormatId::NONE != nFmt; } bool SvDDEObject::IsPending() const @@ -313,19 +314,19 @@ bool SvDDEObject::IsDataComplete() const IMPL_LINK( SvDDEObject, ImplGetDDEData, DdeData*, pData ) { - sal_uIntPtr nFmt = pData->GetFormat(); + SotClipboardFormatId nFmt = pData->GetFormat(); switch( nFmt ) { - case FORMAT_GDIMETAFILE: + case SotClipboardFormatId::GDIMETAFILE: break; - case FORMAT_BITMAP: + case SotClipboardFormatId::BITMAP: break; default: { const sal_Char* p = (sal_Char*)( pData->operator const void*() ); - long nLen = FORMAT_STRING == nFmt ? (p ? strlen( p ) : 0) : (long)*pData; + long nLen = SotClipboardFormatId::STRING == nFmt ? (p ? strlen( p ) : 0) : (long)*pData; Sequence< sal_Int8 > aSeq( reinterpret_cast<const sal_Int8*>(p), nLen ); if( pGetData ) diff --git a/sfx2/source/appl/linkmgr2.cxx b/sfx2/source/appl/linkmgr2.cxx index 6b8a19d09176..9d910a92beff 100644 --- a/sfx2/source/appl/linkmgr2.cxx +++ b/sfx2/source/appl/linkmgr2.cxx @@ -501,11 +501,11 @@ void LinkManager::CancelTransfers() // gets the appropriate information as a string // For now this is required for file object in conjunction with JavaScript // - needs information about Load/Abort/Error -sal_uIntPtr LinkManager::RegisterStatusInfoId() +SotClipboardFormatId LinkManager::RegisterStatusInfoId() { - static sal_uIntPtr nFormat = 0; + static SotClipboardFormatId nFormat = SotClipboardFormatId::NONE; - if( !nFormat ) + if( nFormat == SotClipboardFormatId::NONE ) { nFormat = SotExchange::RegisterFormatName( OUString("StatusInfo from SvxInternalLink")); @@ -529,13 +529,13 @@ bool LinkManager::GetGraphicFromAny( const OUString& rMimeType, switch( SotExchange::GetFormatIdFromMimeType( rMimeType ) ) { - case SOT_FORMATSTR_ID_SVXB: + case SotClipboardFormatId::SVXB: { ReadGraphic( aMemStm, rGrf ); bRet = true; } break; - case FORMAT_GDIMETAFILE: + case SotClipboardFormatId::GDIMETAFILE: { GDIMetaFile aMtf; aMtf.Read( aMemStm ); @@ -543,7 +543,7 @@ bool LinkManager::GetGraphicFromAny( const OUString& rMimeType, bRet = true; } break; - case FORMAT_BITMAP: + case SotClipboardFormatId::BITMAP: { Bitmap aBmp; ReadDIB(aBmp, aMemStm, true); @@ -551,6 +551,7 @@ bool LinkManager::GetGraphicFromAny( const OUString& rMimeType, bRet = true; } break; + default: break; } } return bRet; diff --git a/sfx2/source/appl/lnkbase2.cxx b/sfx2/source/appl/lnkbase2.cxx index 9e1e8603d941..d75252df67c2 100644 --- a/sfx2/source/appl/lnkbase2.cxx +++ b/sfx2/source/appl/lnkbase2.cxx @@ -67,10 +67,10 @@ struct ImplBaseLinkData struct tClientType { // applies for all links - sal_uIntPtr nCntntType; // Update Format + SotClipboardFormatId nCntntType; // Update Format // Not Ole-Links - bool bIntrnlLnk; // It is an internal link - sal_uInt16 nUpdateMode; // UpdateMode + bool bIntrnlLnk; // It is an internal link + sal_uInt16 nUpdateMode; // UpdateMode }; struct tDDEType @@ -84,7 +84,7 @@ struct ImplBaseLinkData }; ImplBaseLinkData() { - ClientType.nCntntType = 0; + ClientType.nCntntType = SotClipboardFormatId::NONE; ClientType.bIntrnlLnk = false; ClientType.nUpdateMode = 0; DDEType.pItem = NULL; @@ -108,7 +108,7 @@ public: #endif virtual ~ImplDdeItem(); - virtual DdeData* Get( sal_uIntPtr ) SAL_OVERRIDE; + virtual DdeData* Get( SotClipboardFormatId ) SAL_OVERRIDE; virtual bool Put( const DdeData* ) SAL_OVERRIDE; virtual void AdviseLoop( bool ) SAL_OVERRIDE; @@ -135,7 +135,7 @@ SvBaseLink::SvBaseLink() -SvBaseLink::SvBaseLink( sal_uInt16 nUpdateMode, sal_uIntPtr nContentType ) +SvBaseLink::SvBaseLink( sal_uInt16 nUpdateMode, SotClipboardFormatId nContentType ) : m_bIsReadOnly(false) { pImpl = new BaseLink_Impl(); @@ -419,16 +419,16 @@ void SvBaseLink::_GetRealObject( bool bConnect) Disconnect(); } -sal_uIntPtr SvBaseLink::GetContentType() const +SotClipboardFormatId SvBaseLink::GetContentType() const { if( OBJECT_CLIENT_SO & nObjType ) return pImplData->ClientType.nCntntType; - return 0; // all Formats ? + return SotClipboardFormatId::NONE; // all Formats ? } -bool SvBaseLink::SetContentType( sal_uIntPtr nType ) +bool SvBaseLink::SetContentType( SotClipboardFormatId nType ) { if( OBJECT_CLIENT_SO & nObjType ) { @@ -578,7 +578,7 @@ ImplDdeItem::~ImplDdeItem() aRef->Disconnect(); } -DdeData* ImplDdeItem::Get( sal_uIntPtr nFormat ) +DdeData* ImplDdeItem::Get( SotClipboardFormatId nFormat ) { if( pLink->GetObj() ) { |