From fb14be5f8f74f83ba89e15f891ddf1f753dcc62f Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 12 Mar 2015 14:53:28 +0200 Subject: 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 --- include/sfx2/docfilt.hxx | 9 +- include/sfx2/fcontnr.hxx | 2 +- include/sfx2/linkmgr.hxx | 2 +- include/sfx2/lnkbase.hxx | 6 +- include/sfx2/objsh.hxx | 2 +- include/sfx2/sfxdlg.hxx | 4 +- include/sot/exchange.hxx | 42 ++-- include/sot/formats.hxx | 303 +++++++++++++------------ include/sot/stg.hxx | 20 +- include/sot/storage.hxx | 7 +- include/sot/storinfo.hxx | 5 +- include/svl/svdde.hxx | 14 +- include/svtools/brwbox.hxx | 4 +- include/svtools/inetimg.hxx | 5 +- include/svtools/insdlg.hxx | 4 +- include/svtools/openfiledroptargetlistener.hxx | 2 +- include/svtools/transfer.hxx | 50 ++-- include/svx/clipfmtitem.hxx | 7 +- include/svx/dbaexchange.hxx | 6 +- include/svx/dbaobjectex.hxx | 2 +- include/svx/galmisc.hxx | 2 +- include/unotest/filters-test.hxx | 9 +- 22 files changed, 260 insertions(+), 247 deletions(-) (limited to 'include') diff --git a/include/sfx2/docfilt.hxx b/include/sfx2/docfilt.hxx index 34d7130d5981..5506f44cb9c3 100644 --- a/include/sfx2/docfilt.hxx +++ b/include/sfx2/docfilt.hxx @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -60,7 +61,7 @@ class SFX2_DLLPUBLIC SfxFilter SfxFilterFlags nFormatType; sal_uIntPtr nVersion; - sal_uIntPtr lFormat; + SotClipboardFormatId lFormat; sal_uInt16 nDocIcon; public: @@ -69,7 +70,7 @@ public: SfxFilter( const OUString &rName, const OUString &rWildCard, SfxFilterFlags nFormatType, - sal_uInt32 lFormat, + SotClipboardFormatId lFormat, const OUString &rTypeName, sal_uInt16 nDocIcon, const OUString &rMimeType, @@ -90,14 +91,14 @@ public: const OUString& GetName() const { return maFilterName; } const WildCard& GetWildcard() const { return aWildCard; } const OUString& GetRealTypeName() const { return aTypeName; } - sal_uIntPtr GetFormat() const { return lFormat; } + SotClipboardFormatId GetFormat() const { return lFormat; } const OUString& GetTypeName() const { return aTypeName; } const OUString& GetUIName() const { return aUIName; } sal_uInt16 GetDocIconId() const { return nDocIcon; } const OUString& GetUserData() const { return aUserData; } const OUString& GetDefaultTemplate() const { return aDefaultTemplate; } void SetDefaultTemplate( const OUString& rStr ) { aDefaultTemplate = rStr; } - bool UsesStorage() const { return GetFormat() != 0; } + bool UsesStorage() const { return GetFormat() != SotClipboardFormatId::NONE; } void SetURLPattern( const OUString& rStr ); OUString GetURLPattern() const { return aPattern; } void SetUIName( const OUString& rName ) { aUIName = rName; } diff --git a/include/sfx2/fcontnr.hxx b/include/sfx2/fcontnr.hxx index 758a73e80b4d..7a71a130f99a 100644 --- a/include/sfx2/fcontnr.hxx +++ b/include/sfx2/fcontnr.hxx @@ -118,7 +118,7 @@ public: sal_uInt32 DetectFilter( SfxMedium& rMedium, const SfxFilter **, bool bPlugIn, bool bAPI = false ) const; const SfxFilter* GetFilter4Mime( const OUString& rMime, SfxFilterFlags nMust = SFX_FILTER_IMPORT, SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED) const; - const SfxFilter* GetFilter4ClipBoardId( sal_uInt32 nId, SfxFilterFlags nMust = SFX_FILTER_IMPORT, SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED ) const; + const SfxFilter* GetFilter4ClipBoardId( SotClipboardFormatId nId, SfxFilterFlags nMust = SFX_FILTER_IMPORT, SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED ) const; const SfxFilter* GetFilter4EA( const OUString& rEA, SfxFilterFlags nMust = SFX_FILTER_IMPORT, SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED ) const; const SfxFilter* GetFilter4Extension( const OUString& rExt, SfxFilterFlags nMust = SFX_FILTER_IMPORT, SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED ) const; const SfxFilter* GetFilter4FilterName( const OUString& rName, SfxFilterFlags nMust = 0, SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED ) const; diff --git a/include/sfx2/linkmgr.hxx b/include/sfx2/linkmgr.hxx index 33aafb90a26d..12bf4378a613 100644 --- a/include/sfx2/linkmgr.hxx +++ b/include/sfx2/linkmgr.hxx @@ -151,7 +151,7 @@ public: // got the appropriate information as a string. // Is now required for FileObject in conjunction with JavaScript // this needs information about Load/Abort/Error - static sal_uIntPtr RegisterStatusInfoId(); + static SotClipboardFormatId RegisterStatusInfoId(); // if the mimetype says graphic/bitmap/gdimetafile then get the // graphic from the Any. Return says no errors diff --git a/include/sfx2/lnkbase.hxx b/include/sfx2/lnkbase.hxx index d88e53da59d7..0613a297246d 100644 --- a/include/sfx2/lnkbase.hxx +++ b/include/sfx2/lnkbase.hxx @@ -96,7 +96,7 @@ protected: m_xInputStreamToLoadFrom; SvBaseLink(); - SvBaseLink( sal_uInt16 nLinkType, sal_uIntPtr nContentType = FORMAT_STRING ); + SvBaseLink( sal_uInt16 nLinkType, SotClipboardFormatId nContentType = SotClipboardFormatId::STRING ); virtual ~SvBaseLink(); void _GetRealObject( bool bConnect = true ); @@ -136,8 +136,8 @@ public: void SetUpdateMode( sal_uInt16 ); sal_uInt16 GetUpdateMode() const; - sal_uIntPtr GetContentType() const; - bool SetContentType( sal_uIntPtr nType ); + SotClipboardFormatId GetContentType() const; + bool SetContentType( SotClipboardFormatId nType ); LinkManager* GetLinkManager(); const LinkManager* GetLinkManager() const; diff --git a/include/sfx2/objsh.hxx b/include/sfx2/objsh.hxx index 289a2dac73bb..1eda88cbf7ad 100644 --- a/include/sfx2/objsh.hxx +++ b/include/sfx2/objsh.hxx @@ -581,7 +581,7 @@ public: virtual void FillClass( SvGlobalName * pClassName, - sal_uInt32 * pFormat, + SotClipboardFormatId * pFormat, OUString * pAppName, OUString * pFullTypeName, OUString * pShortTypeName, diff --git a/include/sfx2/sfxdlg.hxx b/include/sfx2/sfxdlg.hxx index 31aa37ae12a7..799f7b40662e 100644 --- a/include/sfx2/sfxdlg.hxx +++ b/include/sfx2/sfxdlg.hxx @@ -93,9 +93,9 @@ public: class SfxAbstractPasteDialog : virtual public VclAbstractDialog { public: - virtual void Insert( SotFormatStringId nFormat, const rtl::OUString & rFormatName ) = 0; + virtual void Insert( SotClipboardFormatId nFormat, const rtl::OUString & rFormatName ) = 0; virtual void SetObjName( const SvGlobalName & rClass, const rtl::OUString & rObjName ) = 0; - virtual sal_uIntPtr GetFormat( const TransferableDataHelper& aHelper, + virtual SotClipboardFormatId GetFormat( const TransferableDataHelper& aHelper, const DataFlavorExVector* pFormats=0, const TransferableObjectDescriptor* pDesc=0 ) = 0; }; diff --git a/include/sot/exchange.hxx b/include/sot/exchange.hxx index d2f0adc5144c..be53ba12ddd5 100644 --- a/include/sot/exchange.hxx +++ b/include/sot/exchange.hxx @@ -26,6 +26,7 @@ #include #include #include +#include #include class SotDataObject; @@ -34,11 +35,10 @@ namespace com { namespace sun { namespace star { namespace datatransfer { class XTransferable; } } } } -typedef sal_uLong SotFormatStringId; struct DataFlavorEx : public ::com::sun::star::datatransfer::DataFlavor { - SotFormatStringId mnSotId; + SotClipboardFormatId mnSotId; }; typedef ::std::vector< DataFlavorEx > _DataFlavorExVector; @@ -52,21 +52,7 @@ struct DataFlavorExVector : public _DataFlavorExVector SOT_DLLPUBLIC bool IsFormatSupported( const DataFlavorExVector& rDataFlavorExVector, - sal_uLong nId ); - -// - predefined formats - -// Do NOT change the order of these values as the implementation depends on them! - -// stardard formats for that Copy/Paste methods exist -#define FORMAT_STRING 1 -#define FORMAT_BITMAP 2 -#define FORMAT_GDIMETAFILE 3 -#define FORMAT_PRIVATE 4 -#define FORMAT_FILE 5 -#define FORMAT_FILE_LIST 6 - -// further formats (only via CopyData/PasteData) -#define FORMAT_RTF 10 + SotClipboardFormatId nId ); // actions #define EXCHG_ACTION_MASK ((sal_uInt16)0x00FF) @@ -138,16 +124,16 @@ class SvGlobalName; class SOT_DLLPUBLIC SotExchange { public: - static sal_uLong RegisterFormat( const ::com::sun::star::datatransfer::DataFlavor& rFlavor ); - static sal_uLong RegisterFormatName( const OUString& rName ); - static sal_uLong RegisterFormatMimeType( const OUString& rMimeType ); - - static sal_uLong GetFormat( const ::com::sun::star::datatransfer::DataFlavor& rFlavor ); - static OUString GetFormatName( sal_uLong nFormat ); - static bool GetFormatDataFlavor( sal_uLong nFormat, ::com::sun::star::datatransfer::DataFlavor& rFlavor ); - static OUString GetFormatMimeType( sal_uLong nFormat ); + static SotClipboardFormatId RegisterFormat( const ::com::sun::star::datatransfer::DataFlavor& rFlavor ); + static SotClipboardFormatId RegisterFormatName( const OUString& rName ); + static SotClipboardFormatId RegisterFormatMimeType( const OUString& rMimeType ); + + static SotClipboardFormatId GetFormat( const ::com::sun::star::datatransfer::DataFlavor& rFlavor ); + static OUString GetFormatName( SotClipboardFormatId nFormat ); + static bool GetFormatDataFlavor( SotClipboardFormatId nFormat, ::com::sun::star::datatransfer::DataFlavor& rFlavor ); + static OUString GetFormatMimeType( SotClipboardFormatId nFormat ); static bool IsInternal( const SvGlobalName& ); - static sal_uLong GetFormatIdFromMimeType( const OUString& rMimeType ); + static SotClipboardFormatId GetFormatIdFromMimeType( const OUString& rMimeType ); // same for XTransferable interface static sal_uInt16 GetExchangeAction( @@ -160,11 +146,11 @@ public: // user action (EXCHG_IN_*, EXCHG_INOUT_*) sal_uInt16 nUserAction, // In:- Out: format to use - sal_uLong& rFormat, + SotClipboardFormatId& rFormat, // In:- Out: default action (EXCHG_IN_*, EXCHG_INOUT_*) sal_uInt16& rDefaultAction, // In:- optional - check only for this specific format - sal_uLong nOnlyTestFormat = 0, + SotClipboardFormatId nOnlyTestFormat = SotClipboardFormatId::NONE, // In:- optional - check the contents of Xtransferable const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >* pxTransferable = NULL ); diff --git a/include/sot/formats.hxx b/include/sot/formats.hxx index 4cfb94bb66e1..b33eb1bdc97b 100644 --- a/include/sot/formats.hxx +++ b/include/sot/formats.hxx @@ -34,150 +34,169 @@ #endif #endif -#include -#define SOT_FORMAT_SYSTEM_START ((sal_uLong)0) -#define SOT_FORMAT_STRING ((sal_uLong)FORMAT_STRING) -#define SOT_FORMAT_BITMAP ((sal_uLong)FORMAT_BITMAP) -#define SOT_FORMAT_GDIMETAFILE ((sal_uLong)FORMAT_GDIMETAFILE) -#define SOT_FORMAT_PRIVATE ((sal_uLong)FORMAT_PRIVATE) -#define SOT_FORMAT_FILE ((sal_uLong)FORMAT_FILE) -#define SOT_FORMAT_FILE_LIST ((sal_uLong)FORMAT_FILE_LIST) -#define SOT_FORMAT_RTF ((sal_uLong)FORMAT_RTF) +#include -#define SOT_FORMATSTR_ID_DRAWING ((sal_uLong)11) -#define SOT_FORMATSTR_ID_SVXB ((sal_uLong)12) -#define SOT_FORMATSTR_ID_SVIM ((sal_uLong)13) -#define SOT_FORMATSTR_ID_XFA ((sal_uLong)14) -#define SOT_FORMATSTR_ID_EDITENGINE ((sal_uLong)15) -#define SOT_FORMATSTR_ID_INTERNALLINK_STATE ((sal_uLong)16) -#define SOT_FORMATSTR_ID_SOLK ((sal_uLong)17) -#define SOT_FORMATSTR_ID_NETSCAPE_BOOKMARK ((sal_uLong)18) -#define SOT_FORMATSTR_ID_TREELISTBOX ((sal_uLong)19) -#define SOT_FORMATSTR_ID_NATIVE ((sal_uLong)20) -#define SOT_FORMATSTR_ID_OWNERLINK ((sal_uLong)21) -#define SOT_FORMATSTR_ID_STARSERVER ((sal_uLong)22) -#define SOT_FORMATSTR_ID_STAROBJECT ((sal_uLong)23) -#define SOT_FORMATSTR_ID_APPLETOBJECT ((sal_uLong)24) -#define SOT_FORMATSTR_ID_PLUGIN_OBJECT ((sal_uLong)25) -#define SOT_FORMATSTR_ID_STARWRITER_30 ((sal_uLong)26) -#define SOT_FORMATSTR_ID_STARWRITER_40 ((sal_uLong)27) -#define SOT_FORMATSTR_ID_STARWRITER_50 ((sal_uLong)28) -#define SOT_FORMATSTR_ID_STARWRITERWEB_40 ((sal_uLong)29) -#define SOT_FORMATSTR_ID_STARWRITERWEB_50 ((sal_uLong)30) -#define SOT_FORMATSTR_ID_STARWRITERGLOB_40 ((sal_uLong)31) -#define SOT_FORMATSTR_ID_STARWRITERGLOB_50 ((sal_uLong)32) -#define SOT_FORMATSTR_ID_STARDRAW ((sal_uLong)33) -#define SOT_FORMATSTR_ID_STARDRAW_40 ((sal_uLong)34) -#define SOT_FORMATSTR_ID_STARIMPRESS_50 ((sal_uLong)35) -#define SOT_FORMATSTR_ID_STARDRAW_50 ((sal_uLong)36) -#define SOT_FORMATSTR_ID_STARCALC ((sal_uLong)37) -#define SOT_FORMATSTR_ID_STARCALC_40 ((sal_uLong)38) -#define SOT_FORMATSTR_ID_STARCALC_50 ((sal_uLong)39) -#define SOT_FORMATSTR_ID_STARCHART ((sal_uLong)40) -#define SOT_FORMATSTR_ID_STARCHART_40 ((sal_uLong)41) -#define SOT_FORMATSTR_ID_STARCHART_50 ((sal_uLong)42) -#define SOT_FORMATSTR_ID_STARIMAGE ((sal_uLong)43) -#define SOT_FORMATSTR_ID_STARIMAGE_40 ((sal_uLong)44) -#define SOT_FORMATSTR_ID_STARIMAGE_50 ((sal_uLong)45) -#define SOT_FORMATSTR_ID_STARMATH ((sal_uLong)46) -#define SOT_FORMATSTR_ID_STARMATH_40 ((sal_uLong)47) -#define SOT_FORMATSTR_ID_STARMATH_50 ((sal_uLong)48) -#define SOT_FORMATSTR_ID_STAROBJECT_PAINTDOC ((sal_uLong)49) -#define SOT_FORMATSTR_ID_FILLED_AREA ((sal_uLong)50) -#define SOT_FORMATSTR_ID_HTML ((sal_uLong)51) -#define SOT_FORMATSTR_ID_HTML_SIMPLE ((sal_uLong)52) -#define SOT_FORMATSTR_ID_CHAOS ((sal_uLong)53) -#define SOT_FORMATSTR_ID_CNT_MSGATTACHFILE ((sal_uLong)54) -#define SOT_FORMATSTR_ID_BIFF_5 ((sal_uLong)55) -#define SOT_FORMATSTR_ID_BIFF__5 ((sal_uLong)56) -#define SOT_FORMATSTR_ID_SYLK ((sal_uLong)57) -#define SOT_FORMATSTR_ID_SYLK_BIGCAPS ((sal_uLong)58) -#define SOT_FORMATSTR_ID_LINK ((sal_uLong)59) -#define SOT_FORMATSTR_ID_DIF ((sal_uLong)60) -#define SOT_FORMATSTR_ID_STARDRAW_TABBAR ((sal_uLong)61) -#define SOT_FORMATSTR_ID_SONLK ((sal_uLong)62) -#define SOT_FORMATSTR_ID_MSWORD_DOC ((sal_uLong)63) -#define SOT_FORMATSTR_ID_STAR_FRAMESET_DOC ((sal_uLong)64) -#define SOT_FORMATSTR_ID_OFFICE_DOC ((sal_uLong)65) -#define SOT_FORMATSTR_ID_NOTES_DOCINFO ((sal_uLong)66) -#define SOT_FORMATSTR_ID_NOTES_HNOTE ((sal_uLong)67) -#define SOT_FORMATSTR_ID_NOTES_NATIVE ((sal_uLong)68) -#define SOT_FORMATSTR_ID_SFX_DOC ((sal_uLong)69) -#define SOT_FORMATSTR_ID_EVDF ((sal_uLong)70) -#define SOT_FORMATSTR_ID_ESDF ((sal_uLong)71) -#define SOT_FORMATSTR_ID_IDF ((sal_uLong)72) -#define SOT_FORMATSTR_ID_EFTP ((sal_uLong)73) -#define SOT_FORMATSTR_ID_EFD ((sal_uLong)74) -#define SOT_FORMATSTR_ID_SVX_FORMFIELDEXCH ((sal_uLong)75) -#define SOT_FORMATSTR_ID_EXTENDED_TABBAR ((sal_uLong)76) -#define SOT_FORMATSTR_ID_SBA_DATAEXCHANGE ((sal_uLong)77) -#define SOT_FORMATSTR_ID_SBA_FIELDDATAEXCHANGE ((sal_uLong)78) -#define SOT_FORMATSTR_ID_SBA_PRIVATE_URL ((sal_uLong)79) -#define SOT_FORMATSTR_ID_SBA_TABED ((sal_uLong)80) -#define SOT_FORMATSTR_ID_SBA_TABID ((sal_uLong)81) -#define SOT_FORMATSTR_ID_SBA_JOIN ((sal_uLong)82) -#define SOT_FORMATSTR_ID_OBJECTDESCRIPTOR ((sal_uLong)83) -#define SOT_FORMATSTR_ID_LINKSRCDESCRIPTOR ((sal_uLong)84) -#define SOT_FORMATSTR_ID_EMBED_SOURCE ((sal_uLong)85) -#define SOT_FORMATSTR_ID_LINK_SOURCE ((sal_uLong)86) -#define SOT_FORMATSTR_ID_EMBEDDED_OBJ ((sal_uLong)87) -#define SOT_FORMATSTR_ID_FILECONTENT ((sal_uLong)88) -#define SOT_FORMATSTR_ID_FILEGRPDESCRIPTOR ((sal_uLong)89) -#define SOT_FORMATSTR_ID_FILENAME ((sal_uLong)90) -#define SOT_FORMATSTR_ID_SD_OLE ((sal_uLong)91) -#define SOT_FORMATSTR_ID_EMBEDDED_OBJ_OLE ((sal_uLong)92) -#define SOT_FORMATSTR_ID_EMBED_SOURCE_OLE ((sal_uLong)93) -#define SOT_FORMATSTR_ID_OBJECTDESCRIPTOR_OLE ((sal_uLong)94) -#define SOT_FORMATSTR_ID_LINKSRCDESCRIPTOR_OLE ((sal_uLong)95) -#define SOT_FORMATSTR_ID_LINK_SOURCE_OLE ((sal_uLong)96) -#define SOT_FORMATSTR_ID_SBA_CTRLDATAEXCHANGE ((sal_uLong)97) -#define SOT_FORMATSTR_ID_OUTPLACE_OBJ ((sal_uLong)98) -#define SOT_FORMATSTR_ID_CNT_OWN_CLIP ((sal_uLong)99) -#define SOT_FORMATSTR_ID_INET_IMAGE ((sal_uLong)100) -#define SOT_FORMATSTR_ID_NETSCAPE_IMAGE ((sal_uLong)101) -#define SOT_FORMATSTR_ID_SBA_FORMEXCHANGE ((sal_uLong)102) -#define SOT_FORMATSTR_ID_SBA_REPORTEXCHANGE ((sal_uLong)103) -#define SOT_FORMATSTR_ID_UNIFORMRESOURCELOCATOR ((sal_uLong)104) -#define SOT_FORMATSTR_ID_STARCHARTDOCUMENT_50 ((sal_uLong)105) -#define SOT_FORMATSTR_ID_GRAPHOBJ ((sal_uLong)106) -#define SOT_FORMATSTR_ID_STARWRITER_60 ((sal_uLong)107) -#define SOT_FORMATSTR_ID_STARWRITERWEB_60 ((sal_uLong)108) -#define SOT_FORMATSTR_ID_STARWRITERGLOB_60 ((sal_uLong)109) -#define SOT_FORMATSTR_ID_STARDRAW_60 ((sal_uLong)110) -#define SOT_FORMATSTR_ID_STARIMPRESS_60 ((sal_uLong)111) -#define SOT_FORMATSTR_ID_STARCALC_60 ((sal_uLong)112) -#define SOT_FORMATSTR_ID_STARCHART_60 ((sal_uLong)113) -#define SOT_FORMATSTR_ID_STARMATH_60 ((sal_uLong)114) -#define SOT_FORMATSTR_ID_WMF ((sal_uLong)115) -#define SOT_FORMATSTR_ID_DBACCESS_QUERY ((sal_uLong)116) -#define SOT_FORMATSTR_ID_DBACCESS_TABLE ((sal_uLong)117) -#define SOT_FORMATSTR_ID_DBACCESS_COMMAND ((sal_uLong)118) -#define SOT_FORMATSTR_ID_DIALOG_60 ((sal_uLong)119) -#define SOT_FORMATSTR_ID_EMF ((sal_uLong)120) -#define SOT_FORMATSTR_ID_BIFF_8 ((sal_uLong)121) -#define SOT_FORMATSTR_ID_BMP ((sal_uLong)122) -#define SOT_FORMATSTR_ID_HTML_NO_COMMENT ((sal_uLong)123) -#define SOT_FORMATSTR_ID_STARWRITER_8 ((sal_uLong)124) -#define SOT_FORMATSTR_ID_STARWRITERWEB_8 ((sal_uLong)125) -#define SOT_FORMATSTR_ID_STARWRITERGLOB_8 ((sal_uLong)126) -#define SOT_FORMATSTR_ID_STARDRAW_8 ((sal_uLong)127) -#define SOT_FORMATSTR_ID_STARIMPRESS_8 ((sal_uLong)128) -#define SOT_FORMATSTR_ID_STARCALC_8 ((sal_uLong)129) -#define SOT_FORMATSTR_ID_STARCHART_8 ((sal_uLong)130) -#define SOT_FORMATSTR_ID_STARMATH_8 ((sal_uLong)131) -#define SOT_FORMATSTR_ID_XFORMS ((sal_uLong)132) -#define SOT_FORMATSTR_ID_STARWRITER_8_TEMPLATE ((sal_uLong)133) -#define SOT_FORMATSTR_ID_STARDRAW_8_TEMPLATE ((sal_uLong)134) -#define SOT_FORMATSTR_ID_STARIMPRESS_8_TEMPLATE ((sal_uLong)135) -#define SOT_FORMATSTR_ID_STARCALC_8_TEMPLATE ((sal_uLong)136) -#define SOT_FORMATSTR_ID_STARCHART_8_TEMPLATE ((sal_uLong)137) -#define SOT_FORMATSTR_ID_STARMATH_8_TEMPLATE ((sal_uLong)138) -#define SOT_FORMATSTR_ID_STARBASE_8 ((sal_uLong)139) -#define SOT_FORMATSTR_ID_HC_GDIMETAFILE ((sal_uLong)140) -#define SOT_FORMATSTR_ID_PNG ((sal_uLong)141) -#define SOT_FORMATSTR_ID_STARWRITERGLOB_8_TEMPLATE ((sal_uLong)142) -#define SOT_FORMATSTR_ID_USER_END SOT_FORMATSTR_ID_STARWRITERGLOB_8_TEMPLATE +// - predefined formats - +// Do NOT change the order of these values as the implementation depends on them! +enum class SotClipboardFormatId : sal_uLong +{ +// standard formats for that Copy/Paste methods exist + STRING = 1, + BITMAP = 2, + GDIMETAFILE = 3, + PRIVATE = 4, + FILE = 5, + FILE_LIST = 6, +// further formats (only via CopyData/PasteData) + RTF = 10, + + NONE = 0, + ONLY_USED_IN_SW = 8, // the SW module essentially creates its own ID's and this is one of them + DRAWING = 11, + SVXB = 12, + SVIM = 13, + XFA = 14, + EDITENGINE = 15, + INTERNALLINK_STATE = 16, + SOLK = 17, + NETSCAPE_BOOKMARK = 18, + TREELISTBOX = 19, + NATIVE = 20, + OWNERLINK = 21, + STARSERVER = 22, + STAROBJECT = 23, + APPLETOBJECT = 24, + PLUGIN_OBJECT = 25, + STARWRITER_30 = 26, + STARWRITER_40 = 27, + STARWRITER_50 = 28, + STARWRITERWEB_40 = 29, + STARWRITERWEB_50 = 30, + STARWRITERGLOB_40 = 31, + STARWRITERGLOB_50 = 32, + STARDRAW = 33, + STARDRAW_40 = 34, + STARIMPRESS_50 = 35, + STARDRAW_50 = 36, + STARCALC = 37, + STARCALC_40 = 38, + STARCALC_50 = 39, + STARCHART = 40, + STARCHART_40 = 41, + STARCHART_50 = 42, + STARIMAGE = 43, + STARIMAGE_40 = 44, + STARIMAGE_50 = 45, + STARMATH = 46, + STARMATH_40 = 47, + STARMATH_50 = 48, + STAROBJECT_PAINTDOC = 49, + FILLED_AREA = 50, + HTML = 51, + HTML_SIMPLE = 52, + CHAOS = 53, + CNT_MSGATTACHFILE = 54, + BIFF_5 = 55, + BIFF__5 = 56, + SYLK = 57, + SYLK_BIGCAPS = 58, + LINK = 59, + DIF = 60, + STARDRAW_TABBAR = 61, + SONLK = 62, + MSWORD_DOC = 63, + STAR_FRAMESET_DOC = 64, + OFFICE_DOC = 65, + NOTES_DOCINFO = 66, + NOTES_HNOTE = 67, + NOTES_NATIVE = 68, + SFX_DOC = 69, + EVDF = 70, + ESDF = 71, + IDF = 72, + EFTP = 73, + EFD = 74, + SVX_FORMFIELDEXCH = 75, + EXTENDED_TABBAR = 76, + SBA_DATAEXCHANGE = 77, + SBA_FIELDDATAEXCHANGE = 78, + SBA_PRIVATE_URL = 79, + SBA_TABED = 80, + SBA_TABID = 81, + SBA_JOIN = 82, + OBJECTDESCRIPTOR = 83, + LINKSRCDESCRIPTOR = 84, + EMBED_SOURCE = 85, + LINK_SOURCE = 86, + EMBEDDED_OBJ = 87, + FILECONTENT = 88, + FILEGRPDESCRIPTOR = 89, + FILENAME = 90, + SD_OLE = 91, + EMBEDDED_OBJ_OLE = 92, + EMBED_SOURCE_OLE = 93, + OBJECTDESCRIPTOR_OLE = 94, + LINKSRCDESCRIPTOR_OLE = 95, + LINK_SOURCE_OLE = 96, + SBA_CTRLDATAEXCHANGE = 97, + OUTPLACE_OBJ = 98, + CNT_OWN_CLIP = 99, + INET_IMAGE = 100, + NETSCAPE_IMAGE = 101, + SBA_FORMEXCHANGE = 102, + SBA_REPORTEXCHANGE = 103, + UNIFORMRESOURCELOCATOR = 104, + STARCHARTDOCUMENT_50 = 105, + GRAPHOBJ = 106, + STARWRITER_60 = 107, + STARWRITERWEB_60 = 108, + STARWRITERGLOB_60 = 109, + STARDRAW_60 = 110, + STARIMPRESS_60 = 111, + STARCALC_60 = 112, + STARCHART_60 = 113, + STARMATH_60 = 114, + WMF = 115, + DBACCESS_QUERY = 116, + DBACCESS_TABLE = 117, + DBACCESS_COMMAND = 118, + DIALOG_60 = 119, + EMF = 120, + BIFF_8 = 121, + BMP = 122, + HTML_NO_COMMENT = 123, + STARWRITER_8 = 124, + STARWRITERWEB_8 = 125, + STARWRITERGLOB_8 = 126, + STARDRAW_8 = 127, + STARIMPRESS_8 = 128, + STARCALC_8 = 129, + STARCHART_8 = 130, + STARMATH_8 = 131, + XFORMS = 132, + STARWRITER_8_TEMPLATE = 133, + STARDRAW_8_TEMPLATE = 134, + STARIMPRESS_8_TEMPLATE = 135, + STARCALC_8_TEMPLATE = 136, + STARCHART_8_TEMPLATE = 137, + STARMATH_8_TEMPLATE = 138, + STARBASE_8 = 139, + HC_GDIMETAFILE = 140, + PNG = 141, + STARWRITERGLOB_8_TEMPLATE = 142, + // the point at which we start allocating "runtime" format IDs + USER_END = STARWRITERGLOB_8_TEMPLATE +}; + +/** Make it easier to iterate over format IDs */ +inline SotClipboardFormatId& operator++(SotClipboardFormatId& v) +{ + v = static_cast(static_cast(v) + 1); + return v; +} + +#define SOT_FORMAT_SYSTEM_START SotClipboardFormatId::NONE #endif // INCLUDED_SOT_FORMATS_HXX diff --git a/include/sot/stg.hxx b/include/sot/stg.hxx index 2d8b1d1d1186..27bb26a40f70 100644 --- a/include/sot/stg.hxx +++ b/include/sot/stg.hxx @@ -84,6 +84,8 @@ public: virtual bool Equals( const BaseStorageStream& rStream ) const = 0; }; +enum class SotClipboardFormatId : sal_uLong; + class BaseStorage : public StorageBase { public: @@ -94,13 +96,13 @@ public: virtual const ClsId& GetClassId() const = 0; virtual void SetDirty() = 0; virtual void SetClass( const SvGlobalName & rClass, - sal_uLong nOriginalClipFormat, + SotClipboardFormatId nOriginalClipFormat, const OUString & rUserTypeName ) = 0; virtual void SetConvertClass( const SvGlobalName & rConvertClass, - sal_uLong nOriginalClipFormat, + SotClipboardFormatId nOriginalClipFormat, const OUString & rUserTypeName ) = 0; virtual SvGlobalName GetClassName() = 0; - virtual sal_uLong GetFormat() = 0; + virtual SotClipboardFormatId GetFormat() = 0; virtual OUString GetUserName() = 0; virtual bool ShouldConvert() = 0; virtual void FillInfoList( SvStorageInfoList* ) const = 0; @@ -194,13 +196,13 @@ public: virtual const ClsId& GetClassId() const SAL_OVERRIDE; virtual void SetDirty() SAL_OVERRIDE; virtual void SetClass( const SvGlobalName & rClass, - sal_uLong nOriginalClipFormat, + SotClipboardFormatId nOriginalClipFormat, const OUString & rUserTypeName ) SAL_OVERRIDE; virtual void SetConvertClass( const SvGlobalName & rConvertClass, - sal_uLong nOriginalClipFormat, + SotClipboardFormatId nOriginalClipFormat, const OUString & rUserTypeName ) SAL_OVERRIDE; virtual SvGlobalName GetClassName() SAL_OVERRIDE; - virtual sal_uLong GetFormat() SAL_OVERRIDE; + virtual SotClipboardFormatId GetFormat() SAL_OVERRIDE; virtual OUString GetUserName() SAL_OVERRIDE; virtual bool ShouldConvert() SAL_OVERRIDE; virtual void FillInfoList( SvStorageInfoList* ) const SAL_OVERRIDE; @@ -310,13 +312,13 @@ public: virtual const ClsId& GetClassId() const SAL_OVERRIDE; virtual void SetDirty() SAL_OVERRIDE; virtual void SetClass( const SvGlobalName & rClass, - sal_uLong nOriginalClipFormat, + SotClipboardFormatId nOriginalClipFormat, const OUString & rUserTypeName ) SAL_OVERRIDE; virtual void SetConvertClass( const SvGlobalName & rConvertClass, - sal_uLong nOriginalClipFormat, + SotClipboardFormatId nOriginalClipFormat, const OUString & rUserTypeName ) SAL_OVERRIDE; virtual SvGlobalName GetClassName() SAL_OVERRIDE; - virtual sal_uLong GetFormat() SAL_OVERRIDE; + virtual SotClipboardFormatId GetFormat() SAL_OVERRIDE; virtual OUString GetUserName() SAL_OVERRIDE; virtual bool ShouldConvert() SAL_OVERRIDE; virtual void FillInfoList( SvStorageInfoList* ) const SAL_OVERRIDE; diff --git a/include/sot/storage.hxx b/include/sot/storage.hxx index b25345f61050..3376609632e3 100644 --- a/include/sot/storage.hxx +++ b/include/sot/storage.hxx @@ -39,6 +39,7 @@ typedef short StorageMode; class SvStorage; +enum class SotClipboardFormatId : sal_uLong; /************************************************************************* *************************************************************************/ @@ -165,10 +166,10 @@ public: // own data sector void SetClass( const SvGlobalName & rClass, - sal_uLong bOriginalClipFormat, + SotClipboardFormatId bOriginalClipFormat, const OUString & rUserTypeName ); SvGlobalName GetClassName(); // type of data in the storage - sal_uLong GetFormat(); + SotClipboardFormatId GetFormat(); OUString GetUserName(); // list of all elements @@ -199,7 +200,7 @@ public: static SotStorage* OpenOLEStorage( const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& xStorage, const OUString& rEleName, StreamMode = STREAM_STD_READWRITE ); - static sal_Int32 GetFormatID( const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& xStorage ); + static SotClipboardFormatId GetFormatID( const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& xStorage ); static sal_Int32 GetVersion( const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& xStorage ); }; diff --git a/include/sot/storinfo.hxx b/include/sot/storinfo.hxx index d2bf31221322..4820bfcb2635 100644 --- a/include/sot/storinfo.hxx +++ b/include/sot/storinfo.hxx @@ -24,6 +24,7 @@ #include #include #include +#include class StgDirEntry; class SvStorageInfo @@ -54,8 +55,8 @@ public: typedef ::std::vector< SvStorageInfo > SvStorageInfoList; -SOT_DLLPUBLIC sal_uLong ReadClipboardFormat( SvStream & rStm ); -SOT_DLLPUBLIC void WriteClipboardFormat( SvStream & rStm, sal_uLong nFormat ); +SOT_DLLPUBLIC SotClipboardFormatId ReadClipboardFormat( SvStream & rStm ); +SOT_DLLPUBLIC void WriteClipboardFormat( SvStream & rStm, SotClipboardFormatId nFormat ); #endif // _STORINFO_HXX diff --git a/include/svl/svdde.hxx b/include/svl/svdde.hxx index 74e1c9637377..b3b5c50ed3c4 100644 --- a/include/svl/svdde.hxx +++ b/include/svl/svdde.hxx @@ -62,11 +62,11 @@ class SVL_DLLPUBLIC DdeData SVL_DLLPRIVATE void Lock(); - void SetFormat( sal_uLong nFmt ); + void SetFormat( SotClipboardFormatId nFmt ); public: DdeData(); - DdeData( SAL_UNUSED_PARAMETER const void*, SAL_UNUSED_PARAMETER long, SAL_UNUSED_PARAMETER sal_uLong = FORMAT_STRING ); + DdeData( SAL_UNUSED_PARAMETER const void*, SAL_UNUSED_PARAMETER long, SAL_UNUSED_PARAMETER SotClipboardFormatId = SotClipboardFormatId::STRING ); DdeData( SAL_UNUSED_PARAMETER const OUString& ); DdeData( const DdeData& ); ~DdeData(); @@ -74,7 +74,7 @@ public: operator const void*() const; operator long() const; - sal_uLong GetFormat() const; + SotClipboardFormatId GetFormat() const; DdeData& operator = ( const DdeData& ); @@ -118,8 +118,8 @@ public: void SetDoneHdl( const Link& rLink ) { aDone = rLink; } const Link& GetDoneHdl() const { return aDone; } - void SetFormat( sal_uLong nFmt ) { aDdeData.SetFormat( nFmt ); } - sal_uLong GetFormat() const { return aDdeData.GetFormat(); } + void SetFormat( SotClipboardFormatId nFmt ) { aDdeData.SetFormat( nFmt ); } + SotClipboardFormatId GetFormat() const { return aDdeData.GetFormat(); } long GetError(); @@ -187,7 +187,7 @@ class SVL_DLLPUBLIC DdePoke : public DdeTransaction { public: DdePoke( DdeConnection&, const OUString&, const char*, long, - sal_uLong = FORMAT_STRING, long = 0 ); + SotClipboardFormatId = SotClipboardFormatId::STRING, long = 0 ); DdePoke( DdeConnection&, const OUString&, SAL_UNUSED_PARAMETER const DdeData&, long = 0 ); DdePoke( DdeConnection&, const OUString&, const OUString&, long = 0 ); }; @@ -274,7 +274,7 @@ public: DdeGetPutItem( const OUString& rStr ); DdeGetPutItem( const DdeItem& rItem ); - virtual DdeData* Get( sal_uLong ); + virtual DdeData* Get( SotClipboardFormatId ); virtual bool Put( const DdeData* ); virtual void AdviseLoop( bool ); // Start / Stop AdviseLoop }; diff --git a/include/svtools/brwbox.hxx b/include/svtools/brwbox.hxx index 3be7495c6d44..545ed60c0252 100644 --- a/include/svtools/brwbox.hxx +++ b/include/svtools/brwbox.hxx @@ -404,8 +404,8 @@ protected: inline const DataFlavorExVector& GetDataFlavors() const; - bool IsDropFormatSupported( SotFormatStringId nFormat ); // need this because the base class' IsDropFormatSupported is not const ... - bool IsDropFormatSupported( SotFormatStringId nFormat ) const; + bool IsDropFormatSupported( SotClipboardFormatId nFormat ); // need this because the base class' IsDropFormatSupported is not const ... + bool IsDropFormatSupported( SotClipboardFormatId nFormat ) const; bool IsDropFormatSupported( const css::datatransfer::DataFlavor& _rFlavor ); // need this because the base class' IsDropFormatSupported is not const ... bool IsDropFormatSupported( const css::datatransfer::DataFlavor& _rFlavor ) const; diff --git a/include/svtools/inetimg.hxx b/include/svtools/inetimg.hxx index 1f5274e8050f..22a4f5628165 100644 --- a/include/svtools/inetimg.hxx +++ b/include/svtools/inetimg.hxx @@ -20,6 +20,7 @@ #define INCLUDED_SVTOOLS_INETIMG_HXX #include +#include class SvData; class SotDataObject; @@ -67,8 +68,8 @@ public: const Size& GetSizePixel() const { return aSizePixel; } // Im-/Export - bool Write( SvStream& rOStm, sal_uLong nFormat ) const; - bool Read( SvStream& rIStm, sal_uLong nFormat ); + bool Write( SvStream& rOStm, SotClipboardFormatId nFormat ) const; + bool Read( SvStream& rIStm, SotClipboardFormatId nFormat ); }; #endif // INCLUDED_SVTOOLS_INETIMG_HXX diff --git a/include/svtools/insdlg.hxx b/include/svtools/insdlg.hxx index 7bdfe48c1b68..70fcf9ec7861 100644 --- a/include/svtools/insdlg.hxx +++ b/include/svtools/insdlg.hxx @@ -70,8 +70,8 @@ public: class SVT_DLLPUBLIC SvPasteObjectHelper { public: - static OUString GetSotFormatUIName( SotFormatStringId nId ); - static bool GetEmbeddedName(const TransferableDataHelper& rData, OUString& _rName, OUString& _rSource, SotFormatStringId& _nFormat); + static OUString GetSotFormatUIName( SotClipboardFormatId nId ); + static bool GetEmbeddedName(const TransferableDataHelper& rData, OUString& _rName, OUString& _rSource, SotClipboardFormatId& _nFormat); }; #endif // INCLUDED_SVTOOLS_INSDLG_HXX diff --git a/include/svtools/openfiledroptargetlistener.hxx b/include/svtools/openfiledroptargetlistener.hxx index 2d708f7aa253..9924a3437134 100644 --- a/include/svtools/openfiledroptargetlistener.hxx +++ b/include/svtools/openfiledroptargetlistener.hxx @@ -66,7 +66,7 @@ class SVT_DLLPUBLIC OpenFileDropTargetListener : public ::cppu::WeakImplHelper1< private: void implts_BeginDrag( const css::uno::Sequence< css::datatransfer::DataFlavor >& rSupportedDataFlavors ); void implts_EndDrag(); - bool implts_IsDropFormatSupported( SotFormatStringId nFormat ); + bool implts_IsDropFormatSupported( SotClipboardFormatId nFormat ); void implts_OpenFile( const OUString& rFilePath ); }; diff --git a/include/svtools/transfer.hxx b/include/svtools/transfer.hxx index 9cf81c8de868..de0d85c1c1c3 100644 --- a/include/svtools/transfer.hxx +++ b/include/svtools/transfer.hxx @@ -218,11 +218,11 @@ protected: virtual ~TransferableHelper(); - void AddFormat( SotFormatStringId nFormat ); + void AddFormat( SotClipboardFormatId nFormat ); void AddFormat( const ::com::sun::star::datatransfer::DataFlavor& rFlavor ); - void RemoveFormat( SotFormatStringId nFormat ); + void RemoveFormat( SotClipboardFormatId nFormat ); void RemoveFormat( const ::com::sun::star::datatransfer::DataFlavor& rFlavor ); - bool HasFormat( SotFormatStringId nFormat ); + bool HasFormat( SotClipboardFormatId nFormat ); inline bool HasFormat( const ::com::sun::star::datatransfer::DataFlavor& rFlavor ) { return isDataFlavorSupported( rFlavor ); } void ClearFormats(); @@ -235,13 +235,13 @@ protected: bool SetTransferableObjectDescriptor( const TransferableObjectDescriptor& rDesc, const ::com::sun::star::datatransfer::DataFlavor& rFlavor ); bool SetINetBookmark( const INetBookmark& rBmk, const ::com::sun::star::datatransfer::DataFlavor& rFlavor ); bool SetINetImage( const INetImage& rINtImg, const ::com::sun::star::datatransfer::DataFlavor& rFlavor ); - bool SetObject( void* pUserObject, sal_uInt32 nUserObjectId, const ::com::sun::star::datatransfer::DataFlavor& rFlavor ); + bool SetObject( void* pUserObject, SotClipboardFormatId nUserObjectId, const ::com::sun::star::datatransfer::DataFlavor& rFlavor ); protected: virtual void AddSupportedFormats() = 0; virtual bool GetData( const css::datatransfer::DataFlavor& rFlavor, const OUString& rDestDoc ) = 0; - virtual bool WriteObject( SotStorageStreamRef& rxOStm, void* pUserObject, sal_uInt32 nUserObjectId, const ::com::sun::star::datatransfer::DataFlavor& rFlavor ); + virtual bool WriteObject( SotStorageStreamRef& rxOStm, void* pUserObject, SotClipboardFormatId nUserObjectId, const ::com::sun::star::datatransfer::DataFlavor& rFlavor ); virtual void DragFinished( sal_Int8 nDropAction ); virtual void ObjectReleased(); @@ -299,12 +299,12 @@ public: const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >& GetTransferable() const { return mxTransfer; } ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable > GetXTransferable() const; - bool HasFormat( SotFormatStringId nFormat ) const; + bool HasFormat( SotClipboardFormatId nFormat ) const; bool HasFormat( const ::com::sun::star::datatransfer::DataFlavor& rFlavor ) const; sal_uInt32 GetFormatCount() const; - SotFormatStringId GetFormat( sal_uInt32 nFormat ) const; + SotClipboardFormatId GetFormat( sal_uInt32 nFormat ) const; ::com::sun::star::datatransfer::DataFlavor GetFormatDataFlavor( sal_uInt32 nFormat ) const; DataFlavorExVector& GetDataFlavorExVector() const {return *mpFormats; } @@ -316,13 +316,13 @@ public: public: - css::uno::Any GetAny( SotFormatStringId nFormat, const OUString& rDestDoc ) const; + css::uno::Any GetAny( SotClipboardFormatId nFormat, const OUString& rDestDoc ) const; css::uno::Any GetAny( const css::datatransfer::DataFlavor& rFlavor, const OUString& rDestDoc ) const; - bool GetString( SotFormatStringId nFormat, OUString& rStr ); + bool GetString( SotClipboardFormatId nFormat, OUString& rStr ); bool GetString( const ::com::sun::star::datatransfer::DataFlavor& rFlavor, OUString& rStr ); - bool GetBitmapEx( SotFormatStringId nFormat, BitmapEx& rBmp ); + bool GetBitmapEx( SotClipboardFormatId nFormat, BitmapEx& rBmp ); bool GetBitmapEx( const ::com::sun::star::datatransfer::DataFlavor& rFlavor, BitmapEx& rBmp ); /** Return as GDI metafile. @@ -333,34 +333,34 @@ public: metafile, with over 3 million (!) actions; which is just too large for any reasonable handling - and you need to set a limit. */ - bool GetGDIMetaFile( SotFormatStringId nFormat, GDIMetaFile& rMtf, size_t nMaxActions = 0 ); + bool GetGDIMetaFile( SotClipboardFormatId nFormat, GDIMetaFile& rMtf, size_t nMaxActions = 0 ); bool GetGDIMetaFile( const ::com::sun::star::datatransfer::DataFlavor& rFlavor, GDIMetaFile& rMtf ); - bool GetGraphic( SotFormatStringId nFormat, Graphic& rGraphic ); + bool GetGraphic( SotClipboardFormatId nFormat, Graphic& rGraphic ); bool GetGraphic( const ::com::sun::star::datatransfer::DataFlavor& rFlavor, Graphic& rGraphic ); - bool GetImageMap( SotFormatStringId nFormat, ImageMap& rIMap ); + bool GetImageMap( SotClipboardFormatId nFormat, ImageMap& rIMap ); bool GetImageMap( const ::com::sun::star::datatransfer::DataFlavor& rFlavor, ImageMap& rImap ); - bool GetTransferableObjectDescriptor( SotFormatStringId nFormat, TransferableObjectDescriptor& rDesc ); + bool GetTransferableObjectDescriptor( SotClipboardFormatId nFormat, TransferableObjectDescriptor& rDesc ); bool GetTransferableObjectDescriptor( const ::com::sun::star::datatransfer::DataFlavor& rFlavor, TransferableObjectDescriptor& rDesc ); - bool GetINetBookmark( SotFormatStringId nFormat, INetBookmark& rBmk ); + bool GetINetBookmark( SotClipboardFormatId nFormat, INetBookmark& rBmk ); bool GetINetBookmark( const ::com::sun::star::datatransfer::DataFlavor& rFlavor, INetBookmark& rBmk ); - bool GetINetImage( SotFormatStringId nFormat, INetImage& rINtImg ); + bool GetINetImage( SotClipboardFormatId nFormat, INetImage& rINtImg ); bool GetINetImage( const ::com::sun::star::datatransfer::DataFlavor& rFlavor, INetImage& rINtImg ); - bool GetFileList( SotFormatStringId nFormat, FileList& rFileList ); + bool GetFileList( SotClipboardFormatId nFormat, FileList& rFileList ); bool GetFileList( const ::com::sun::star::datatransfer::DataFlavor& rFlavor, FileList& rFileList ); - css::uno::Sequence GetSequence( SotFormatStringId nFormat, const OUString& rDestDoc ); + css::uno::Sequence GetSequence( SotClipboardFormatId nFormat, const OUString& rDestDoc ); css::uno::Sequence GetSequence( const css::datatransfer::DataFlavor& rFlavor, const OUString& rDestDoc ); - bool GetSotStorageStream( SotFormatStringId nFormat, SotStorageStreamRef& rStreamRef ); + bool GetSotStorageStream( SotClipboardFormatId nFormat, SotStorageStreamRef& rStreamRef ); bool GetSotStorageStream( const ::com::sun::star::datatransfer::DataFlavor& rFlavor, SotStorageStreamRef& rStreamRef ); - css::uno::Reference GetInputStream( SotFormatStringId nFormat, const OUString& rDestDoc ); + css::uno::Reference GetInputStream( SotClipboardFormatId nFormat, const OUString& rDestDoc ); css::uno::Reference GetInputStream( const css::datatransfer::DataFlavor& rFlavor, const OUString& rDestDoc ); bool GetInterface( const ::com::sun::star::datatransfer::DataFlavor& rFlavor, ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& rIf ); @@ -478,7 +478,7 @@ public: virtual ~DropTargetHelper(); // typically called by the application in ::AcceptDrop and ::ExecuteDrop and (see above) - bool IsDropFormatSupported( SotFormatStringId nFormat ); + bool IsDropFormatSupported( SotClipboardFormatId nFormat ); bool IsDropFormatSupported( const ::com::sun::star::datatransfer::DataFlavor& rFlavor ); DataFlavorExVector& GetDataFlavorExVector() const {return *mpFormats; } @@ -507,11 +507,11 @@ public: void CopyImageMap( const ImageMap& rImgMap ); void CopyGraphic( const Graphic& rGrf ); void CopyString( const OUString& rStr ); - void CopyString( sal_uInt16 nFmt, const OUString& rStr ); - void CopyAny( sal_uInt16 nFmt, const ::com::sun::star::uno::Any& rAny ); + void CopyString( SotClipboardFormatId nFmt, const OUString& rStr ); + void CopyAny( SotClipboardFormatId nFmt, const ::com::sun::star::uno::Any& rAny ); - void CopyByteString( sal_uLong nFormatId, const OString& rStr ); - void CopyAnyData( sal_uLong nFormatId, const sal_Char* pData, sal_uLong nLen ); + void CopyByteString( SotClipboardFormatId nFormatId, const OString& rStr ); + void CopyAnyData( SotClipboardFormatId nFormatId, const sal_Char* pData, sal_uLong nLen ); bool HasAnyData() const; diff --git a/include/svx/clipfmtitem.hxx b/include/svx/clipfmtitem.hxx index 63daf82b7bb3..8119650ca8ab 100644 --- a/include/svx/clipfmtitem.hxx +++ b/include/svx/clipfmtitem.hxx @@ -20,6 +20,7 @@ #define INCLUDED_SVX_CLIPFMTITEM_HXX #include +#include #include #include @@ -42,12 +43,12 @@ public: virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId ) const SAL_OVERRIDE; virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId ) SAL_OVERRIDE; - void AddClipbrdFormat( sal_uIntPtr nId, sal_uInt16 nPos = USHRT_MAX ); - void AddClipbrdFormat( sal_uIntPtr nId, const OUString& rName, + void AddClipbrdFormat( SotClipboardFormatId nId, sal_uInt16 nPos = USHRT_MAX ); + void AddClipbrdFormat( SotClipboardFormatId nId, const OUString& rName, sal_uInt16 nPos = USHRT_MAX ); sal_uInt16 Count() const; - sal_uIntPtr GetClipbrdFormatId( sal_uInt16 nPos ) const; + SotClipboardFormatId GetClipbrdFormatId( sal_uInt16 nPos ) const; const OUString GetClipbrdFormatName( sal_uInt16 nPos ) const; }; diff --git a/include/svx/dbaexchange.hxx b/include/svx/dbaexchange.hxx index 5c5cba8bb8e4..eed5b2c46c8c 100644 --- a/include/svx/dbaexchange.hxx +++ b/include/svx/dbaexchange.hxx @@ -149,7 +149,7 @@ namespace svx virtual void AddSupportedFormats() SAL_OVERRIDE; virtual bool GetData( const css::datatransfer::DataFlavor& rFlavor, const OUString& rDestDoc ) SAL_OVERRIDE; - static sal_uInt32 getDescriptorFormatId(); + static SotClipboardFormatId getDescriptorFormatId(); private: SVX_DLLPRIVATE void implConstruct( @@ -170,7 +170,7 @@ namespace svx { ODataAccessDescriptor m_aDescriptor; OUString m_sCompatibleObjectDescription; - // needed to provide a SOT_FORMATSTR_ID_SBA_DATAEXCHANGE format + // needed to provide a SotClipboardFormatId::SBA_DATAEXCHANGE format public: /** should be used copying and the connection is needed. @@ -277,7 +277,7 @@ namespace svx virtual void AddSupportedFormats() SAL_OVERRIDE; virtual bool GetData( const css::datatransfer::DataFlavor& rFlavor, const OUString& rDestDoc ) SAL_OVERRIDE; virtual void ObjectReleased() SAL_OVERRIDE; - static sal_uInt32 getDescriptorFormatId(); + static SotClipboardFormatId getDescriptorFormatId(); }; diff --git a/include/svx/dbaobjectex.hxx b/include/svx/dbaobjectex.hxx index a7676209770a..2592d63444cf 100644 --- a/include/svx/dbaobjectex.hxx +++ b/include/svx/dbaobjectex.hxx @@ -65,7 +65,7 @@ namespace svx virtual void AddSupportedFormats() SAL_OVERRIDE; virtual bool GetData( const css::datatransfer::DataFlavor& rFlavor, const OUString& rDestDoc ) SAL_OVERRIDE; - static sal_uInt32 getDescriptorFormatId(bool _bExtractForm); + static SotClipboardFormatId getDescriptorFormatId(bool _bExtractForm); }; diff --git a/include/svx/galmisc.hxx b/include/svx/galmisc.hxx index 8d58cd4ef5fa..74878809a638 100644 --- a/include/svx/galmisc.hxx +++ b/include/svx/galmisc.hxx @@ -177,7 +177,7 @@ protected: // TransferableHelper 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; virtual void DragFinished( sal_Int8 nDropAction ) SAL_OVERRIDE; virtual void ObjectReleased() SAL_OVERRIDE; diff --git a/include/unotest/filters-test.hxx b/include/unotest/filters-test.hxx index 476588aff013..5bbc6463545a 100644 --- a/include/unotest/filters-test.hxx +++ b/include/unotest/filters-test.hxx @@ -13,6 +13,7 @@ #include #include #include +#include namespace test { @@ -44,7 +45,7 @@ public: //SfxFilterFlags for SfxFilter unsigned int nFilterFlags = SFX_FILTER_IMPORT, //Clipboard id for SfxFilter - unsigned int nClipboardID = 0, + SotClipboardFormatId nClipboardID = SotClipboardFormatId::NONE, //additional filter version for SfxFilter unsigned int nFilterVersion = 0, //export or import? @@ -55,7 +56,7 @@ public: const OUString &rURL, const OUString &rUserData, unsigned int nFilterFlags, - unsigned int nClipboardID, + SotClipboardFormatId nClipboardID, unsigned int nFilterVersion) = 0; virtual bool save( @@ -63,7 +64,7 @@ public: const OUString &/*rURL*/, const OUString &/*rUserData*/, unsigned int /*nFilterFlags*/, - unsigned int /*nClipboardID*/, + SotClipboardFormatId /*nClipboardID*/, unsigned int /*nFilterVersion*/) { return true; @@ -78,7 +79,7 @@ protected: const OUString &rURL, const OUString &rUserData, unsigned int nFilterFlags, - unsigned int nClipboardID, + SotClipboardFormatId nClipboardID, unsigned int nFilterVersion, bool bExport); }; -- cgit