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 /sc | |
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 'sc')
37 files changed, 551 insertions, 549 deletions
diff --git a/sc/qa/unit/filters-test.cxx b/sc/qa/unit/filters-test.cxx index 4beeb54a315f..54eabf36842a 100644 --- a/sc/qa/unit/filters-test.cxx +++ b/sc/qa/unit/filters-test.cxx @@ -58,7 +58,7 @@ public: virtual bool load( const OUString &rFilter, const OUString &rURL, const OUString &rUserData, unsigned int nFilterFlags, - unsigned int nClipboardID, unsigned int nFilterVersion) SAL_OVERRIDE; + SotClipboardFormatId nClipboardID, unsigned int nFilterVersion) SAL_OVERRIDE; /** * Ensure CVEs remain unbroken */ @@ -114,7 +114,7 @@ private: bool ScFiltersTest::load(const OUString &rFilter, const OUString &rURL, const OUString &rUserData, unsigned int nFilterFlags, - unsigned int nClipboardID, unsigned int nFilterVersion) + SotClipboardFormatId nClipboardID, unsigned int nFilterVersion) { ScDocShellRef xDocShRef = ScBootstrapFixture::load(rURL, rFilter, rUserData, OUString(), nFilterFlags, nClipboardID, nFilterVersion ); diff --git a/sc/qa/unit/helper/qahelper.cxx b/sc/qa/unit/helper/qahelper.cxx index c64cac111b9f..11a22a8397cd 100644 --- a/sc/qa/unit/helper/qahelper.cxx +++ b/sc/qa/unit/helper/qahelper.cxx @@ -533,7 +533,7 @@ OUString toString( ScDocShellRef ScBootstrapFixture::load( bool bReadWrite, const OUString& rURL, const OUString& rFilter, const OUString &rUserData, - const OUString& rTypeName, unsigned int nFilterFlags, unsigned int nClipboardID, + const OUString& rTypeName, unsigned int nFilterFlags, SotClipboardFormatId nClipboardID, sal_uIntPtr nFilterVersion, const OUString* pPassword ) { SfxFilter* pFilter = new SfxFilter( @@ -566,7 +566,7 @@ ScDocShellRef ScBootstrapFixture::load( bool bReadWrite, ScDocShellRef ScBootstrapFixture::load( const OUString& rURL, const OUString& rFilter, const OUString &rUserData, - const OUString& rTypeName, unsigned int nFilterFlags, unsigned int nClipboardID, + const OUString& rTypeName, unsigned int nFilterFlags, SotClipboardFormatId nClipboardID, sal_uIntPtr nFilterVersion, const OUString* pPassword ) { return load( false, rURL, rFilter, rUserData, rTypeName, nFilterFlags, nClipboardID, nFilterVersion, pPassword ); @@ -581,7 +581,9 @@ ScDocShellRef ScBootstrapFixture::loadDoc( createFileURL( rFileName, aFileExtension, aFileName ); OUString aFilterType(aFileFormats[nFormat].pTypeName, strlen(aFileFormats[nFormat].pTypeName), RTL_TEXTENCODING_UTF8); unsigned int nFormatType = aFileFormats[nFormat].nFormatType; - unsigned int nClipboardId = nFormatType ? SFX_FILTER_IMPORT | SFX_FILTER_USESOPTIONS : 0; + SotClipboardFormatId nClipboardId = SotClipboardFormatId::NONE; + if (nFormatType) + nClipboardId = SotClipboardFormatId::STARCALC_8; return load(bReadWrite, aFileName, aFilterName, OUString(), aFilterType, nFormatType, nClipboardId, nFormatType); } @@ -619,9 +621,9 @@ ScDocShellRef ScBootstrapFixture::saveAndReload( utl::TempFile aTempFile; SfxMedium aStoreMedium( aTempFile.GetURL(), STREAM_STD_WRITE ); - sal_uInt32 nExportFormat = 0; + SotClipboardFormatId nExportFormat = SotClipboardFormatId::NONE; if (nFormatType == ODS_FORMAT_TYPE) - nExportFormat = SFX_FILTER_EXPORT | SFX_FILTER_USESOPTIONS; + nExportFormat = SotClipboardFormatId::STARCHART_8; SfxFilter* pExportFilter = new SfxFilter( rFilter, OUString(), nFormatType, nExportFormat, rTypeName, 0, OUString(), @@ -633,9 +635,9 @@ ScDocShellRef ScBootstrapFixture::saveAndReload( //std::cout << "File: " << aTempFile.GetURL() << std::endl; - sal_uInt32 nFormat = 0; + SotClipboardFormatId nFormat = SotClipboardFormatId::NONE; if (nFormatType == ODS_FORMAT_TYPE) - nFormat = SFX_FILTER_IMPORT | SFX_FILTER_USESOPTIONS; + nFormat = SotClipboardFormatId::STARCALC_8; ScDocShellRef xDocSh = load(aTempFile.GetURL(), rFilter, rUserData, rTypeName, nFormatType, nFormat ); if(nFormatType == XLSX_FORMAT_TYPE) @@ -664,10 +666,10 @@ boost::shared_ptr<utl::TempFile> ScBootstrapFixture::exportTo( ScDocShell* pShel boost::shared_ptr<utl::TempFile> pTempFile(new utl::TempFile()); pTempFile->EnableKillingFile(); SfxMedium aStoreMedium( pTempFile->GetURL(), STREAM_STD_WRITE ); - sal_uInt32 nExportFormat = 0; + SotClipboardFormatId nExportFormat = SotClipboardFormatId::NONE; sal_Int32 nFormatType = aFileFormats[nFormat].nFormatType; if (nFormatType == ODS_FORMAT_TYPE) - nExportFormat = SFX_FILTER_EXPORT | SFX_FILTER_USESOPTIONS; + nExportFormat = SotClipboardFormatId::STARCHART_8; SfxFilter* pExportFilter = new SfxFilter( aFilterName, OUString(), nFormatType, nExportFormat, aFilterType, 0, OUString(), diff --git a/sc/qa/unit/helper/qahelper.hxx b/sc/qa/unit/helper/qahelper.hxx index 8fbc156c8097..20ab92c9f797 100644 --- a/sc/qa/unit/helper/qahelper.hxx +++ b/sc/qa/unit/helper/qahelper.hxx @@ -225,12 +225,12 @@ protected: ScDocShellRef load( bool bReadWrite, const OUString& rURL, const OUString& rFilter, const OUString &rUserData, - const OUString& rTypeName, unsigned int nFilterFlags, unsigned int nClipboardID, + const OUString& rTypeName, unsigned int nFilterFlags, SotClipboardFormatId nClipboardID, sal_uIntPtr nFilterVersion = SOFFICE_FILEFORMAT_CURRENT, const OUString* pPassword = NULL ); ScDocShellRef load( const OUString& rURL, const OUString& rFilter, const OUString &rUserData, - const OUString& rTypeName, unsigned int nFilterFlags, unsigned int nClipboardID, + const OUString& rTypeName, unsigned int nFilterFlags, SotClipboardFormatId nClipboardID, sal_uIntPtr nFilterVersion = SOFFICE_FILEFORMAT_CURRENT, const OUString* pPassword = NULL ); ScDocShellRef loadDoc(const OUString& rFileName, sal_Int32 nFormat, bool bReadWrite = false ); diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx index 5c72a3dcdb92..44bb074c4954 100644 --- a/sc/qa/unit/opencl-test.cxx +++ b/sc/qa/unit/opencl-test.cxx @@ -65,7 +65,7 @@ public: virtual bool load( const OUString &rFilter, const OUString &rURL, const OUString &rUserData, unsigned int nFilterFlags, - unsigned int nClipboardID, unsigned int nFilterVersion) SAL_OVERRIDE; + SotClipboardFormatId nClipboardID, unsigned int nFilterVersion) SAL_OVERRIDE; void testSharedFormulaXLS(); #if 0 void testSharedFormulaXLSGroundWater(); @@ -557,7 +557,7 @@ bool ScOpenCLTest::initTestEnv(const OUString& fileName, sal_Int32 nFormat, bool ScOpenCLTest::load(const OUString &rFilter, const OUString &rURL, const OUString &rUserData, unsigned int nFilterFlags, - unsigned int nClipboardID, unsigned int nFilterVersion) + SotClipboardFormatId nClipboardID, unsigned int nFilterVersion) { ScDocShellRef xDocShRef = ScBootstrapFixture::load(rURL, rFilter, rUserData, OUString(), nFilterFlags, nClipboardID, nFilterVersion ); diff --git a/sc/qa/unit/subsequent_export-test.cxx b/sc/qa/unit/subsequent_export-test.cxx index 4a1b599f71ad..0084145438ae 100644 --- a/sc/qa/unit/subsequent_export-test.cxx +++ b/sc/qa/unit/subsequent_export-test.cxx @@ -224,9 +224,9 @@ ScDocShellRef ScExportTest::saveAndReloadPassword(ScDocShell* pShell, const OUSt utl::TempFile aTempFile; aTempFile.EnableKillingFile(); SfxMedium aStoreMedium( aTempFile.GetURL(), STREAM_STD_WRITE ); - sal_uInt32 nExportFormat = 0; + SotClipboardFormatId nExportFormat = SotClipboardFormatId::NONE; if (nFormatType == ODS_FORMAT_TYPE) - nExportFormat = SFX_FILTER_EXPORT | SFX_FILTER_USESOPTIONS; + nExportFormat = SotClipboardFormatId::STARCHART_8; SfxFilter* pExportFilter = new SfxFilter( rFilter, OUString(), nFormatType, nExportFormat, rTypeName, 0, OUString(), @@ -247,9 +247,9 @@ ScDocShellRef ScExportTest::saveAndReloadPassword(ScDocShell* pShell, const OUSt //std::cout << "File: " << aTempFile.GetURL() << std::endl; - sal_uInt32 nFormat = 0; + SotClipboardFormatId nFormat = SotClipboardFormatId::NONE; if (nFormatType == ODS_FORMAT_TYPE) - nFormat = SFX_FILTER_IMPORT | SFX_FILTER_USESOPTIONS; + nFormat = SotClipboardFormatId::STARCALC_8; OUString aPass("test"); return load(aTempFile.GetURL(), rFilter, rUserData, rTypeName, nFormatType, nFormat, SOFFICE_FILEFORMAT_CURRENT, &aPass); diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx index 7de72c1bb296..01dae642939f 100644 --- a/sc/qa/unit/subsequent_filters-test.cxx +++ b/sc/qa/unit/subsequent_filters-test.cxx @@ -84,7 +84,7 @@ public: virtual bool load( const OUString &rFilter, const OUString &rURL, const OUString &rUserData, unsigned int nFilterFlags, - unsigned int nClipboardID, unsigned int nFilterVersion) SAL_OVERRIDE; + SotClipboardFormatId nClipboardID, unsigned int nFilterVersion) SAL_OVERRIDE; virtual void setUp() SAL_OVERRIDE; virtual void tearDown() SAL_OVERRIDE; @@ -287,7 +287,7 @@ private: bool ScFiltersTest::load(const OUString &rFilter, const OUString &rURL, const OUString &rUserData, unsigned int nFilterFlags, - unsigned int nClipboardID, unsigned int nFilterVersion) + SotClipboardFormatId nClipboardID, unsigned int nFilterVersion) { ScDocShellRef xDocShRef = ScBootstrapFixture::load( rURL, rFilter, rUserData, OUString(), nFilterFlags, nClipboardID, nFilterVersion); @@ -1389,7 +1389,7 @@ void ScFiltersTest::testBrokenQuotesCSV() std::cout << getFileFormats()[CSV].pName << " Test" << std::endl; unsigned int nFormatType = getFileFormats()[CSV].nFormatType; - unsigned int nClipboardId = nFormatType ? SFX_FILTER_IMPORT | SFX_FILTER_USESOPTIONS : 0; + SotClipboardFormatId nClipboardId = nFormatType ? SotClipboardFormatId::STARCALC_8 : SotClipboardFormatId::NONE; ScDocShellRef xDocSh = ScBootstrapFixture::load(aFileName, aFilterName, OUString(), aFilterType, nFormatType, nClipboardId, SOFFICE_FILEFORMAT_CURRENT); @@ -1416,7 +1416,7 @@ void ScFiltersTest::testCellValueXLSX() std::cout << getFileFormats()[XLSX].pName << " Test" << std::endl; unsigned int nFormatType = getFileFormats()[XLSX].nFormatType; - unsigned int nClipboardId = nFormatType ? SFX_FILTER_IMPORT | SFX_FILTER_USESOPTIONS : 0; + SotClipboardFormatId nClipboardId = nFormatType ? SotClipboardFormatId::STARCALC_8 : SotClipboardFormatId::NONE; ScDocShellRef xDocSh = ScBootstrapFixture::load( aFileName, aFilterName, OUString(), aFilterType, nFormatType, nClipboardId, SOFFICE_FILEFORMAT_CURRENT); @@ -1471,7 +1471,7 @@ void ScFiltersTest::testPassword_Impl(const OUString& aFileNameBase) createFileURL(aFileNameBase, aFileExtension, aFileName); OUString aFilterType(getFileFormats()[0].pTypeName, strlen(getFileFormats()[0].pTypeName), RTL_TEXTENCODING_UTF8); - sal_uInt32 nFormat = SFX_FILTER_IMPORT | SFX_FILTER_USESOPTIONS; + SotClipboardFormatId nFormat = SotClipboardFormatId::STARCALC_8; SfxFilter* aFilter = new SfxFilter( aFilterName, OUString(), getFileFormats()[0].nFormatType, nFormat, aFilterType, 0, OUString(), diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx index 2f11f48ef24f..195be8f09c09 100644 --- a/sc/qa/unit/ucalc.cxx +++ b/sc/qa/unit/ucalc.cxx @@ -5894,7 +5894,7 @@ void Test::testImportStream() ScImportExport aObj(m_pDoc, ScAddress(0,0,0)); aObj.SetImportBroadcast(true); aObj.SetExtOptions(aOpt); - aObj.ImportString("1,2,3", FORMAT_STRING); + aObj.ImportString("1,2,3", SotClipboardFormatId::STRING); CPPUNIT_ASSERT_EQUAL(1.0, m_pDoc->GetValue(ScAddress(0,0,0))); CPPUNIT_ASSERT_EQUAL(2.0, m_pDoc->GetValue(ScAddress(1,0,0))); diff --git a/sc/source/core/tool/ddelink.cxx b/sc/source/core/tool/ddelink.cxx index 24bc847591f4..5a0a3f36503b 100644 --- a/sc/source/core/tool/ddelink.cxx +++ b/sc/source/core/tool/ddelink.cxx @@ -42,7 +42,7 @@ bool ScDdeLink::bIsInUpdate = false; ScDdeLink::ScDdeLink( ScDocument* pD, const OUString& rA, const OUString& rT, const OUString& rI, sal_uInt8 nM ) : - ::sfx2::SvBaseLink(sfx2::LINKUPDATE_ALWAYS,FORMAT_STRING), + ::sfx2::SvBaseLink(sfx2::LINKUPDATE_ALWAYS,SotClipboardFormatId::STRING), pDoc( pD ), aAppl( rA ), aTopic( rT ), @@ -61,7 +61,7 @@ ScDdeLink::~ScDdeLink() } ScDdeLink::ScDdeLink( ScDocument* pD, const ScDdeLink& rOther ) : - ::sfx2::SvBaseLink(sfx2::LINKUPDATE_ALWAYS,FORMAT_STRING), + ::sfx2::SvBaseLink(sfx2::LINKUPDATE_ALWAYS,SotClipboardFormatId::STRING), pDoc ( pD ), aAppl ( rOther.aAppl ), aTopic ( rOther.aTopic ), @@ -75,7 +75,7 @@ ScDdeLink::ScDdeLink( ScDocument* pD, const ScDdeLink& rOther ) : } ScDdeLink::ScDdeLink( ScDocument* pD, SvStream& rStream, ScMultipleReadHeader& rHdr ) : - ::sfx2::SvBaseLink(sfx2::LINKUPDATE_ALWAYS,FORMAT_STRING), + ::sfx2::SvBaseLink(sfx2::LINKUPDATE_ALWAYS,SotClipboardFormatId::STRING), pDoc( pD ), bNeedUpdate( false ), pResult( NULL ) @@ -125,7 +125,7 @@ sfx2::SvBaseLink::UpdateResult ScDdeLink::DataChanged( const OUString& rMimeType, const ::com::sun::star::uno::Any & rValue ) { // wir koennen nur Strings... - if ( FORMAT_STRING != SotExchange::GetFormatIdFromMimeType( rMimeType )) + if ( SotClipboardFormatId::STRING != SotExchange::GetFormatIdFromMimeType( rMimeType )) return SUCCESS; OUString aLinkStr; diff --git a/sc/source/filter/excel/excel.cxx b/sc/source/filter/excel/excel.cxx index 88d1d6e07e44..831e0cf33c97 100644 --- a/sc/source/filter/excel/excel.cxx +++ b/sc/source/filter/excel/excel.cxx @@ -186,7 +186,7 @@ static FltError lcl_ExportExcelBiff( SfxMedium& rMedium, ScDocument *pDocument, eRet = SCWARN_EXPORT_MAXROW; SvGlobalName aGlobName( 0x00020810, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46 ); - sal_uInt32 nClip = SotExchange::RegisterFormatName( aClipName ); + SotClipboardFormatId nClip = SotExchange::RegisterFormatName( aClipName ); xRootStrg->SetClass( aGlobName, nClip, aClassName ); xStrgStrm->Commit(); diff --git a/sc/source/ui/app/drwtrans.cxx b/sc/source/ui/app/drwtrans.cxx index 745e23863025..0910bd124ba6 100644 --- a/sc/source/ui/app/drwtrans.cxx +++ b/sc/source/ui/app/drwtrans.cxx @@ -73,9 +73,9 @@ using namespace com::sun::star; -#define SCDRAWTRANS_TYPE_EMBOBJ 1 -#define SCDRAWTRANS_TYPE_DRAWMODEL 2 -#define SCDRAWTRANS_TYPE_DOCUMENT 3 +#define SCDRAWTRANS_TYPE_EMBOBJ SotClipboardFormatId::STRING +#define SCDRAWTRANS_TYPE_DRAWMODEL SotClipboardFormatId::BITMAP +#define SCDRAWTRANS_TYPE_DOCUMENT SotClipboardFormatId::GDIMETAFILE ScDrawTransferObj::ScDrawTransferObj( SdrModel* pClipModel, ScDocShell* pContainerShell, const TransferableObjectDescriptor& rDesc ) : @@ -288,38 +288,38 @@ void ScDrawTransferObj::AddSupportedFormats() { if ( bGrIsBit ) // single bitmap graphic { - AddFormat( SOT_FORMATSTR_ID_OBJECTDESCRIPTOR ); - AddFormat( SOT_FORMATSTR_ID_SVXB ); - AddFormat( SOT_FORMATSTR_ID_PNG ); - AddFormat( SOT_FORMAT_BITMAP ); - AddFormat( SOT_FORMAT_GDIMETAFILE ); + AddFormat( SotClipboardFormatId::OBJECTDESCRIPTOR ); + AddFormat( SotClipboardFormatId::SVXB ); + AddFormat( SotClipboardFormatId::PNG ); + AddFormat( SotClipboardFormatId::BITMAP ); + AddFormat( SotClipboardFormatId::GDIMETAFILE ); } else if ( bGraphic ) // other graphic { // #i25616# - AddFormat( SOT_FORMATSTR_ID_DRAWING ); + AddFormat( SotClipboardFormatId::DRAWING ); - AddFormat( SOT_FORMATSTR_ID_OBJECTDESCRIPTOR ); - AddFormat( SOT_FORMATSTR_ID_SVXB ); - AddFormat( SOT_FORMAT_GDIMETAFILE ); - AddFormat( SOT_FORMATSTR_ID_PNG ); - AddFormat( SOT_FORMAT_BITMAP ); + AddFormat( SotClipboardFormatId::OBJECTDESCRIPTOR ); + AddFormat( SotClipboardFormatId::SVXB ); + AddFormat( SotClipboardFormatId::GDIMETAFILE ); + AddFormat( SotClipboardFormatId::PNG ); + AddFormat( SotClipboardFormatId::BITMAP ); } else if ( pBookmark ) // url button { -// AddFormat( SOT_FORMATSTR_ID_EMBED_SOURCE ); - AddFormat( SOT_FORMATSTR_ID_OBJECTDESCRIPTOR ); - AddFormat( SOT_FORMATSTR_ID_SOLK ); - AddFormat( SOT_FORMAT_STRING ); - AddFormat( SOT_FORMATSTR_ID_UNIFORMRESOURCELOCATOR ); - AddFormat( SOT_FORMATSTR_ID_NETSCAPE_BOOKMARK ); - AddFormat( SOT_FORMATSTR_ID_DRAWING ); +// AddFormat( SotClipboardFormatId::EMBED_SOURCE ); + AddFormat( SotClipboardFormatId::OBJECTDESCRIPTOR ); + AddFormat( SotClipboardFormatId::SOLK ); + AddFormat( SotClipboardFormatId::STRING ); + AddFormat( SotClipboardFormatId::UNIFORMRESOURCELOCATOR ); + AddFormat( SotClipboardFormatId::NETSCAPE_BOOKMARK ); + AddFormat( SotClipboardFormatId::DRAWING ); } else if ( bOleObj ) // single OLE object { - AddFormat( SOT_FORMATSTR_ID_EMBED_SOURCE ); - AddFormat( SOT_FORMATSTR_ID_OBJECTDESCRIPTOR ); - AddFormat( SOT_FORMAT_GDIMETAFILE ); + AddFormat( SotClipboardFormatId::EMBED_SOURCE ); + AddFormat( SotClipboardFormatId::OBJECTDESCRIPTOR ); + AddFormat( SotClipboardFormatId::GDIMETAFILE ); CreateOLEData(); @@ -337,29 +337,29 @@ void ScDrawTransferObj::AddSupportedFormats() } else // any drawing objects { - AddFormat( SOT_FORMATSTR_ID_EMBED_SOURCE ); - AddFormat( SOT_FORMATSTR_ID_OBJECTDESCRIPTOR ); - AddFormat( SOT_FORMATSTR_ID_DRAWING ); + AddFormat( SotClipboardFormatId::EMBED_SOURCE ); + AddFormat( SotClipboardFormatId::OBJECTDESCRIPTOR ); + AddFormat( SotClipboardFormatId::DRAWING ); // leave out bitmap and metafile if there are only controls if ( !lcl_HasOnlyControls( pModel ) ) { - AddFormat( SOT_FORMATSTR_ID_PNG ); - AddFormat( SOT_FORMAT_BITMAP ); - AddFormat( SOT_FORMAT_GDIMETAFILE ); + AddFormat( SotClipboardFormatId::PNG ); + AddFormat( SotClipboardFormatId::BITMAP ); + AddFormat( SotClipboardFormatId::GDIMETAFILE ); } } // if( pImageMap ) -// AddFormat( SOT_FORMATSTR_ID_SVIM ); +// AddFormat( SotClipboardFormatId::SVIM ); } bool ScDrawTransferObj::GetData( const css::datatransfer::DataFlavor& rFlavor, const OUString& rDestDoc ) { bool bOK = false; - sal_uInt32 nFormat = SotExchange::GetFormat( rFlavor ); + SotClipboardFormatId nFormat = SotExchange::GetFormat( rFlavor ); - if ( bOleObj && nFormat != SOT_FORMAT_GDIMETAFILE ) + if ( bOleObj && nFormat != SotClipboardFormatId::GDIMETAFILE ) { CreateOLEData(); @@ -384,17 +384,17 @@ bool ScDrawTransferObj::GetData( const css::datatransfer::DataFlavor& rFlavor, c if( HasFormat( nFormat ) ) { - if ( nFormat == SOT_FORMATSTR_ID_LINKSRCDESCRIPTOR || nFormat == SOT_FORMATSTR_ID_OBJECTDESCRIPTOR ) + if ( nFormat == SotClipboardFormatId::LINKSRCDESCRIPTOR || nFormat == SotClipboardFormatId::OBJECTDESCRIPTOR ) { bOK = SetTransferableObjectDescriptor( aObjDesc, rFlavor ); } - else if ( nFormat == SOT_FORMATSTR_ID_DRAWING ) + else if ( nFormat == SotClipboardFormatId::DRAWING ) { bOK = SetObject( pModel, SCDRAWTRANS_TYPE_DRAWMODEL, rFlavor ); } - else if ( nFormat == SOT_FORMAT_BITMAP - || nFormat == SOT_FORMATSTR_ID_PNG - || nFormat == SOT_FORMAT_GDIMETAFILE ) + else if ( nFormat == SotClipboardFormatId::BITMAP + || nFormat == SotClipboardFormatId::PNG + || nFormat == SotClipboardFormatId::GDIMETAFILE ) { // #i71538# use complete SdrViews // SdrExchangeView aView( pModel ); @@ -402,12 +402,12 @@ bool ScDrawTransferObj::GetData( const css::datatransfer::DataFlavor& rFlavor, c SdrPageView* pPv = aView.ShowSdrPage(aView.GetModel()->GetPage(0)); OSL_ENSURE( pPv, "pPv not there..." ); aView.MarkAllObj( pPv ); - if ( nFormat == SOT_FORMAT_GDIMETAFILE ) + if ( nFormat == SotClipboardFormatId::GDIMETAFILE ) bOK = SetGDIMetaFile( aView.GetMarkedObjMetaFile(true), rFlavor ); else bOK = SetBitmapEx( aView.GetMarkedObjBitmapEx(true), rFlavor ); } - else if ( nFormat == SOT_FORMATSTR_ID_SVXB ) + else if ( nFormat == SotClipboardFormatId::SVXB ) { // only enabled for single graphics object @@ -423,7 +423,7 @@ bool ScDrawTransferObj::GetData( const css::datatransfer::DataFlavor& rFlavor, c } } } - else if ( nFormat == SOT_FORMATSTR_ID_EMBED_SOURCE ) + else if ( nFormat == SotClipboardFormatId::EMBED_SOURCE ) { if ( bOleObj ) // single OLE object { @@ -450,7 +450,7 @@ bool ScDrawTransferObj::GetData( const css::datatransfer::DataFlavor& rFlavor, c return bOK; } -bool ScDrawTransferObj::WriteObject( SotStorageStreamRef& rxOStm, void* pUserObject, sal_uInt32 nUserObjectId, +bool ScDrawTransferObj::WriteObject( SotStorageStreamRef& rxOStm, void* pUserObject, SotClipboardFormatId nUserObjectId, const ::com::sun::star::datatransfer::DataFlavor& /* rFlavor */ ) { // called from SetObject, put data into stream @@ -741,7 +741,7 @@ void ScDrawTransferObj::InitDocShell() Point(aSrcSize.Width()/2, aSrcSize.Height()/2), NULL, 0, OUString(), OUString()); - // put objects to right layer (see ScViewFunc::PasteDataFormat for SOT_FORMATSTR_ID_DRAWING) + // put objects to right layer (see ScViewFunc::PasteDataFormat for SotClipboardFormatId::DRAWING) SdrPage* pPage = pDestModel->GetPage(0); if (pPage) diff --git a/sc/source/ui/app/lnktrans.cxx b/sc/source/ui/app/lnktrans.cxx index a386cd0bd886..213ec96db35d 100644 --- a/sc/source/ui/app/lnktrans.cxx +++ b/sc/source/ui/app/lnktrans.cxx @@ -44,12 +44,12 @@ void ScLinkTransferObj::AddSupportedFormats() { // TransferableHelper::SetINetBookmark formats - AddFormat( SOT_FORMATSTR_ID_SOLK ); - AddFormat( SOT_FORMAT_STRING ); - AddFormat( SOT_FORMATSTR_ID_UNIFORMRESOURCELOCATOR ); - AddFormat( SOT_FORMATSTR_ID_NETSCAPE_BOOKMARK ); - AddFormat( SOT_FORMATSTR_ID_FILEGRPDESCRIPTOR ); - AddFormat( SOT_FORMATSTR_ID_FILECONTENT ); + AddFormat( SotClipboardFormatId::SOLK ); + AddFormat( SotClipboardFormatId::STRING ); + AddFormat( SotClipboardFormatId::UNIFORMRESOURCELOCATOR ); + AddFormat( SotClipboardFormatId::NETSCAPE_BOOKMARK ); + AddFormat( SotClipboardFormatId::FILEGRPDESCRIPTOR ); + AddFormat( SotClipboardFormatId::FILECONTENT ); } } diff --git a/sc/source/ui/app/seltrans.cxx b/sc/source/ui/app/seltrans.cxx index c965c1d26b2b..6acc11e70234 100644 --- a/sc/source/ui/app/seltrans.cxx +++ b/sc/source/ui/app/seltrans.cxx @@ -197,62 +197,62 @@ void ScSelectionTransferObj::AddSupportedFormats() case SC_SELTRANS_CELL: case SC_SELTRANS_CELLS: // same formats as in ScTransferObj::AddSupportedFormats - AddFormat( SOT_FORMATSTR_ID_EMBED_SOURCE ); - AddFormat( SOT_FORMATSTR_ID_OBJECTDESCRIPTOR ); - AddFormat( SOT_FORMAT_GDIMETAFILE ); - AddFormat( SOT_FORMATSTR_ID_PNG ); - AddFormat( SOT_FORMAT_BITMAP ); - AddFormat( SOT_FORMATSTR_ID_HTML ); - AddFormat( SOT_FORMATSTR_ID_SYLK ); - AddFormat( SOT_FORMATSTR_ID_LINK ); - AddFormat( SOT_FORMATSTR_ID_DIF ); - AddFormat( SOT_FORMAT_STRING ); - AddFormat( SOT_FORMAT_RTF ); + AddFormat( SotClipboardFormatId::EMBED_SOURCE ); + AddFormat( SotClipboardFormatId::OBJECTDESCRIPTOR ); + AddFormat( SotClipboardFormatId::GDIMETAFILE ); + AddFormat( SotClipboardFormatId::PNG ); + AddFormat( SotClipboardFormatId::BITMAP ); + AddFormat( SotClipboardFormatId::HTML ); + AddFormat( SotClipboardFormatId::SYLK ); + AddFormat( SotClipboardFormatId::LINK ); + AddFormat( SotClipboardFormatId::DIF ); + AddFormat( SotClipboardFormatId::STRING ); + AddFormat( SotClipboardFormatId::RTF ); if ( eMode == SC_SELTRANS_CELL ) - AddFormat( SOT_FORMATSTR_ID_EDITENGINE ); + AddFormat( SotClipboardFormatId::EDITENGINE ); break; // different graphic formats as in ScDrawTransferObj::AddSupportedFormats: case SC_SELTRANS_DRAW_BITMAP: - AddFormat( SOT_FORMATSTR_ID_OBJECTDESCRIPTOR ); - AddFormat( SOT_FORMATSTR_ID_SVXB ); - AddFormat( SOT_FORMATSTR_ID_PNG ); - AddFormat( SOT_FORMAT_BITMAP ); - AddFormat( SOT_FORMAT_GDIMETAFILE ); + AddFormat( SotClipboardFormatId::OBJECTDESCRIPTOR ); + AddFormat( SotClipboardFormatId::SVXB ); + AddFormat( SotClipboardFormatId::PNG ); + AddFormat( SotClipboardFormatId::BITMAP ); + AddFormat( SotClipboardFormatId::GDIMETAFILE ); break; case SC_SELTRANS_DRAW_GRAPHIC: - AddFormat( SOT_FORMATSTR_ID_OBJECTDESCRIPTOR ); - AddFormat( SOT_FORMATSTR_ID_SVXB ); - AddFormat( SOT_FORMAT_GDIMETAFILE ); - AddFormat( SOT_FORMATSTR_ID_PNG ); - AddFormat( SOT_FORMAT_BITMAP ); + AddFormat( SotClipboardFormatId::OBJECTDESCRIPTOR ); + AddFormat( SotClipboardFormatId::SVXB ); + AddFormat( SotClipboardFormatId::GDIMETAFILE ); + AddFormat( SotClipboardFormatId::PNG ); + AddFormat( SotClipboardFormatId::BITMAP ); break; case SC_SELTRANS_DRAW_BOOKMARK: - AddFormat( SOT_FORMATSTR_ID_OBJECTDESCRIPTOR ); - AddFormat( SOT_FORMATSTR_ID_SOLK ); - AddFormat( SOT_FORMAT_STRING ); - AddFormat( SOT_FORMATSTR_ID_UNIFORMRESOURCELOCATOR ); - AddFormat( SOT_FORMATSTR_ID_NETSCAPE_BOOKMARK ); - AddFormat( SOT_FORMATSTR_ID_DRAWING ); + AddFormat( SotClipboardFormatId::OBJECTDESCRIPTOR ); + AddFormat( SotClipboardFormatId::SOLK ); + AddFormat( SotClipboardFormatId::STRING ); + AddFormat( SotClipboardFormatId::UNIFORMRESOURCELOCATOR ); + AddFormat( SotClipboardFormatId::NETSCAPE_BOOKMARK ); + AddFormat( SotClipboardFormatId::DRAWING ); break; case SC_SELTRANS_DRAW_OLE: - AddFormat( SOT_FORMATSTR_ID_EMBED_SOURCE ); - AddFormat( SOT_FORMATSTR_ID_OBJECTDESCRIPTOR ); - AddFormat( SOT_FORMAT_GDIMETAFILE ); + AddFormat( SotClipboardFormatId::EMBED_SOURCE ); + AddFormat( SotClipboardFormatId::OBJECTDESCRIPTOR ); + AddFormat( SotClipboardFormatId::GDIMETAFILE ); break; case SC_SELTRANS_DRAW_OTHER: // other drawing objects - AddFormat( SOT_FORMATSTR_ID_EMBED_SOURCE ); - AddFormat( SOT_FORMATSTR_ID_OBJECTDESCRIPTOR ); - AddFormat( SOT_FORMATSTR_ID_DRAWING ); - AddFormat( SOT_FORMATSTR_ID_PNG ); - AddFormat( SOT_FORMAT_BITMAP ); - AddFormat( SOT_FORMAT_GDIMETAFILE ); + AddFormat( SotClipboardFormatId::EMBED_SOURCE ); + AddFormat( SotClipboardFormatId::OBJECTDESCRIPTOR ); + AddFormat( SotClipboardFormatId::DRAWING ); + AddFormat( SotClipboardFormatId::PNG ); + AddFormat( SotClipboardFormatId::BITMAP ); + AddFormat( SotClipboardFormatId::GDIMETAFILE ); break; default: diff --git a/sc/source/ui/app/transobj.cxx b/sc/source/ui/app/transobj.cxx index f76f3b9bf0d1..4b452c8ff89f 100644 --- a/sc/source/ui/app/transobj.cxx +++ b/sc/source/ui/app/transobj.cxx @@ -65,10 +65,10 @@ using namespace com::sun::star; -#define SCTRANS_TYPE_IMPEX 1 -#define SCTRANS_TYPE_EDIT_RTF 2 -#define SCTRANS_TYPE_EDIT_BIN 3 -#define SCTRANS_TYPE_EMBOBJ 4 +#define SCTRANS_TYPE_IMPEX SotClipboardFormatId::STRING +#define SCTRANS_TYPE_EDIT_RTF SotClipboardFormatId::BITMAP +#define SCTRANS_TYPE_EDIT_BIN SotClipboardFormatId::GDIMETAFILE +#define SCTRANS_TYPE_EMBOBJ SotClipboardFormatId::PRIVATE void ScTransferObj::GetAreaSize( ScDocument* pDoc, SCTAB nTab1, SCTAB nTab2, SCROW& nRow, SCCOL& nCol ) { @@ -209,7 +209,7 @@ ScTransferObj* ScTransferObj::GetOwnClipboard( vcl::Window* pUIWin ) // may be from other clipboard operations (like flushing, #86059#) TransferableDataHelper aDataHelper( TransferableDataHelper::CreateFromSystemClipboard( pUIWin ) ); - if ( !aDataHelper.HasFormat( SOT_FORMATSTR_ID_DIF ) ) + if ( !aDataHelper.HasFormat( SotClipboardFormatId::DIF ) ) { // OSL_FAIL("ScTransferObj wasn't released"); pObj = NULL; @@ -220,36 +220,36 @@ ScTransferObj* ScTransferObj::GetOwnClipboard( vcl::Window* pUIWin ) void ScTransferObj::AddSupportedFormats() { - AddFormat( SOT_FORMATSTR_ID_EMBED_SOURCE ); - AddFormat( SOT_FORMATSTR_ID_OBJECTDESCRIPTOR ); - AddFormat( SOT_FORMAT_GDIMETAFILE ); - AddFormat( SOT_FORMATSTR_ID_PNG ); - AddFormat( SOT_FORMAT_BITMAP ); + AddFormat( SotClipboardFormatId::EMBED_SOURCE ); + AddFormat( SotClipboardFormatId::OBJECTDESCRIPTOR ); + AddFormat( SotClipboardFormatId::GDIMETAFILE ); + AddFormat( SotClipboardFormatId::PNG ); + AddFormat( SotClipboardFormatId::BITMAP ); // ScImportExport formats - AddFormat( SOT_FORMATSTR_ID_HTML ); - AddFormat( SOT_FORMATSTR_ID_SYLK ); - AddFormat( SOT_FORMATSTR_ID_LINK ); - AddFormat( SOT_FORMATSTR_ID_DIF ); - AddFormat( SOT_FORMAT_STRING ); + AddFormat( SotClipboardFormatId::HTML ); + AddFormat( SotClipboardFormatId::SYLK ); + AddFormat( SotClipboardFormatId::LINK ); + AddFormat( SotClipboardFormatId::DIF ); + AddFormat( SotClipboardFormatId::STRING ); - AddFormat( SOT_FORMAT_RTF ); + AddFormat( SotClipboardFormatId::RTF ); if ( aBlock.aStart == aBlock.aEnd ) - AddFormat( SOT_FORMATSTR_ID_EDITENGINE ); + AddFormat( SotClipboardFormatId::EDITENGINE ); } bool ScTransferObj::GetData( const datatransfer::DataFlavor& rFlavor, const OUString& /*rDestDoc*/ ) { - sal_uInt32 nFormat = SotExchange::GetFormat( rFlavor ); + SotClipboardFormatId nFormat = SotExchange::GetFormat( rFlavor ); bool bOK = false; if( HasFormat( nFormat ) ) { - if ( nFormat == SOT_FORMATSTR_ID_LINKSRCDESCRIPTOR || nFormat == SOT_FORMATSTR_ID_OBJECTDESCRIPTOR ) + if ( nFormat == SotClipboardFormatId::LINKSRCDESCRIPTOR || nFormat == SotClipboardFormatId::OBJECTDESCRIPTOR ) { bOK = SetTransferableObjectDescriptor( aObjDesc, rFlavor ); } - else if ( ( nFormat == SOT_FORMAT_RTF || nFormat == SOT_FORMATSTR_ID_EDITENGINE ) && + else if ( ( nFormat == SotClipboardFormatId::RTF || nFormat == SotClipboardFormatId::EDITENGINE ) && aBlock.aStart == aBlock.aEnd ) { // RTF from a single cell is handled by EditEngine @@ -275,19 +275,19 @@ bool ScTransferObj::GetData( const datatransfer::DataFlavor& rFlavor, const OUSt } bOK = SetObject( &aEngine, - (nFormat == FORMAT_RTF) ? SCTRANS_TYPE_EDIT_RTF : SCTRANS_TYPE_EDIT_BIN, + (nFormat == SotClipboardFormatId::RTF) ? SCTRANS_TYPE_EDIT_RTF : SCTRANS_TYPE_EDIT_BIN, rFlavor ); } - else if ( ScImportExport::IsFormatSupported( nFormat ) || nFormat == SOT_FORMAT_RTF ) + else if ( ScImportExport::IsFormatSupported( nFormat ) || nFormat == SotClipboardFormatId::RTF ) { // if this transfer object was used to create a DDE link, filtered rows // have to be included for subsequent calls (to be consistent with link data) - if ( nFormat == SOT_FORMATSTR_ID_LINK ) + if ( nFormat == SotClipboardFormatId::LINK ) bUsedForLink = true; bool bIncludeFiltered = pDoc->IsCutMode() || bUsedForLink; - bool bReduceBlockFormat = nFormat == SOT_FORMATSTR_ID_HTML || nFormat == SOT_FORMAT_RTF; + bool bReduceBlockFormat = nFormat == SotClipboardFormatId::HTML || nFormat == SotClipboardFormatId::RTF; ScRange aReducedBlock = aBlock; if (bReduceBlockFormat && (aBlock.aEnd.Col() == MAXCOL || aBlock.aEnd.Row() == MAXROW) && aBlock.aStart.Tab() == aBlock.aEnd.Tab()) { @@ -332,7 +332,7 @@ bool ScTransferObj::GetData( const datatransfer::DataFlavor& rFlavor, const OUSt OSL_FAIL("unknown DataType"); } } - else if ( nFormat == SOT_FORMAT_BITMAP || nFormat == SOT_FORMATSTR_ID_PNG ) + else if ( nFormat == SotClipboardFormatId::BITMAP || nFormat == SotClipboardFormatId::PNG ) { Rectangle aMMRect = pDoc->GetMMRect( aBlock.aStart.Col(), aBlock.aStart.Row(), aBlock.aEnd.Col(), aBlock.aEnd.Row(), @@ -346,7 +346,7 @@ bool ScTransferObj::GetData( const datatransfer::DataFlavor& rFlavor, const OUSt Bitmap aBmp = aVirtDev.GetBitmap( Point(), aVirtDev.GetOutputSize() ); bOK = SetBitmapEx( aBmp, rFlavor ); } - else if ( nFormat == SOT_FORMAT_GDIMETAFILE ) + else if ( nFormat == SotClipboardFormatId::GDIMETAFILE ) { // #i123405# Do not limit visual size calculation for metafile creation. // It seems unlikely that removing the limitation causes problems since @@ -375,7 +375,7 @@ bool ScTransferObj::GetData( const datatransfer::DataFlavor& rFlavor, const OUSt bOK = SetGDIMetaFile( aMtf, rFlavor ); } - else if ( nFormat == SOT_FORMATSTR_ID_EMBED_SOURCE ) + else if ( nFormat == SotClipboardFormatId::EMBED_SOURCE ) { //TODO/LATER: differentiate between formats?! // #i123405# Do limit visual size calculation to PageSize @@ -388,7 +388,7 @@ bool ScTransferObj::GetData( const datatransfer::DataFlavor& rFlavor, const OUSt return bOK; } -bool ScTransferObj::WriteObject( SotStorageStreamRef& rxOStm, void* pUserObject, sal_uInt32 nUserObjectId, +bool ScTransferObj::WriteObject( SotStorageStreamRef& rxOStm, void* pUserObject, SotClipboardFormatId nUserObjectId, const datatransfer::DataFlavor& rFlavor ) { // called from SetObject, put data into stream @@ -400,7 +400,7 @@ bool ScTransferObj::WriteObject( SotStorageStreamRef& rxOStm, void* pUserObject, { ScImportExport* pImpEx = (ScImportExport*)pUserObject; - sal_uInt32 nFormat = SotExchange::GetFormat( rFlavor ); + SotClipboardFormatId nFormat = SotExchange::GetFormat( rFlavor ); // mba: no BaseURL for data exchange if ( pImpEx->ExportStream( *rxOStm, OUString(), nFormat ) ) bRet = ( rxOStm->GetError() == ERRCODE_NONE ); diff --git a/sc/source/ui/docshell/arealink.cxx b/sc/source/ui/docshell/arealink.cxx index 134ebb040359..cf79f30ca94d 100644 --- a/sc/source/ui/docshell/arealink.cxx +++ b/sc/source/ui/docshell/arealink.cxx @@ -60,7 +60,7 @@ ScAreaLink::ScAreaLink( SfxObjectShell* pShell, const OUString& rFile, const OUString& rFilter, const OUString& rOpt, const OUString& rArea, const ScRange& rDest, sal_uLong nRefresh ) : - ::sfx2::SvBaseLink(sfx2::LINKUPDATE_ONCALL,FORMAT_FILE), + ::sfx2::SvBaseLink(sfx2::LINKUPDATE_ONCALL,SotClipboardFormatId::FILE), ScRefreshTimer ( nRefresh ), pImpl ( new AreaLink_Impl() ), aFileName (rFile), diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx index e7cb71a76164..536c8c5b6369 100644 --- a/sc/source/ui/docshell/docsh.cxx +++ b/sc/source/ui/docshell/docsh.cxx @@ -178,7 +178,7 @@ SFX_IMPL_OBJECTFACTORY( ScDocShell, SvGlobalName(SO3_SC_CLASSID), SFXOBJECTSHELL TYPEINIT1( ScDocShell, SfxObjectShell ); // SfxInPlaceObject: No TypeInfo? void ScDocShell::FillClass( SvGlobalName* pClassName, - sal_uInt32* pFormat, + SotClipboardFormatId* pFormat, OUString* /* pAppName */, OUString* pFullTypeName, OUString* pShortTypeName, @@ -188,14 +188,14 @@ void ScDocShell::FillClass( SvGlobalName* pClassName, if ( nFileFormat == SOFFICE_FILEFORMAT_60 ) { *pClassName = SvGlobalName( SO3_SC_CLASSID_60 ); - *pFormat = SOT_FORMATSTR_ID_STARCALC_60; + *pFormat = SotClipboardFormatId::STARCALC_60; *pFullTypeName = OUString( ScResId( SCSTR_LONG_SCDOC_NAME ) ); *pShortTypeName = OUString( ScResId( SCSTR_SHORT_SCDOC_NAME ) ); } else if ( nFileFormat == SOFFICE_FILEFORMAT_8 ) { *pClassName = SvGlobalName( SO3_SC_CLASSID_60 ); - *pFormat = bTemplate ? SOT_FORMATSTR_ID_STARCALC_8_TEMPLATE : SOT_FORMATSTR_ID_STARCALC_8; + *pFormat = bTemplate ? SotClipboardFormatId::STARCALC_8_TEMPLATE : SotClipboardFormatId::STARCALC_8; *pFullTypeName = "calc8"; *pShortTypeName = ScResId(SCSTR_SHORT_SCDOC_NAME).toString(); } @@ -1313,7 +1313,7 @@ bool ScDocShell::ConvertFrom( SfxMedium& rMedium ) if (pInStream) { pInStream->Seek( 0 ); - bRet = aImpEx.ImportStream( *pInStream, rMedium.GetBaseURL(), SOT_FORMATSTR_ID_SYLK ); + bRet = aImpEx.ImportStream( *pInStream, rMedium.GetBaseURL(), SotClipboardFormatId::SYLK ); eError = bRet ? eERR_OK : SCERR_IMPORT_UNKNOWN; aDocument.StartAllListeners(); sc::SetFormulaDirtyContext aCxt; @@ -2405,7 +2405,7 @@ bool ScDocShell::ConvertTo( SfxMedium &rMed ) ScImportExport aImExport( &aDocument, aRange ); aImExport.SetFormulas( true ); - bRet = aImExport.ExportStream( *pStream, rMed.GetBaseURL( true ), SOT_FORMATSTR_ID_SYLK ); + bRet = aImExport.ExportStream( *pStream, rMed.GetBaseURL( true ), SotClipboardFormatId::SYLK ); } } else if (aFltName == pFilterHtml) @@ -2424,7 +2424,7 @@ bool ScDocShell::ConvertTo( SfxMedium &rMed ) ScImportExport aImExport(&aDocument); aImExport.SetStreamPath(rMed.GetName()); aImExport.SetFilterOptions(sFilterOptions); - bRet = aImExport.ExportStream(*pStream, rMed.GetBaseURL(true), SOT_FORMATSTR_ID_HTML); + bRet = aImExport.ExportStream(*pStream, rMed.GetBaseURL(true), SotClipboardFormatId::HTML); if (bRet && !aImExport.GetNonConvertibleChars().isEmpty()) { SetError(*new StringErrorInfo( diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx index 9d9ef86e9980..4f9f8f109032 100644 --- a/sc/source/ui/docshell/docsh4.cxx +++ b/sc/source/ui/docshell/docsh4.cxx @@ -2059,7 +2059,7 @@ bool ScDocShell::DdeGetData( const OUString& rItem, const OUString& rMimeType, ::com::sun::star::uno::Any & rValue ) { - if( FORMAT_STRING == SotExchange::GetFormatIdFromMimeType( rMimeType ) ) + if( SotClipboardFormatId::STRING == SotExchange::GetFormatIdFromMimeType( rMimeType ) ) { if( rItem.equalsIgnoreAsciiCase( "Format" ) ) { @@ -2081,7 +2081,7 @@ bool ScDocShell::DdeGetData( const OUString& rItem, { OString aData; if( aObj.ExportByteString( aData, osl_getThreadTextEncoding(), - SOT_FORMATSTR_ID_SYLK ) ) + SotClipboardFormatId::SYLK ) ) { rValue <<= ::com::sun::star::uno::Sequence< sal_Int8 >( reinterpret_cast<const sal_Int8*>(aData.getStr()), @@ -2107,7 +2107,7 @@ bool ScDocShell::DdeSetData( const OUString& rItem, const OUString& rMimeType, const ::com::sun::star::uno::Any & rValue ) { - if( FORMAT_STRING == SotExchange::GetFormatIdFromMimeType( rMimeType )) + if( SotClipboardFormatId::STRING == SotExchange::GetFormatIdFromMimeType( rMimeType )) { if( rItem.equalsIgnoreAsciiCase( "Format" ) ) { @@ -2127,7 +2127,7 @@ bool ScDocShell::DdeSetData( const OUString& rItem, OUString aData; if ( ScByteSequenceToString::GetString( aData, rValue, osl_getThreadTextEncoding() ) ) { - return aObj.ImportString( aData, SOT_FORMATSTR_ID_SYLK ); + return aObj.ImportString( aData, SotClipboardFormatId::SYLK ); } return false; } diff --git a/sc/source/ui/docshell/externalrefmgr.cxx b/sc/source/ui/docshell/externalrefmgr.cxx index 3ab529a85051..5bde93bc1945 100644 --- a/sc/source/ui/docshell/externalrefmgr.cxx +++ b/sc/source/ui/docshell/externalrefmgr.cxx @@ -1274,7 +1274,7 @@ ScExternalRefCache::DocItem* ScExternalRefCache::getDocItem(sal_uInt16 nFileId) } ScExternalRefLink::ScExternalRefLink(ScDocument* pDoc, sal_uInt16 nFileId, const OUString& rFilter) : - ::sfx2::SvBaseLink(::sfx2::LINKUPDATE_ONCALL, FORMAT_FILE), + ::sfx2::SvBaseLink(::sfx2::LINKUPDATE_ONCALL, SotClipboardFormatId::FILE), mnFileId(nFileId), maFilterName(rFilter), mpDoc(pDoc), diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx index ec70334d183a..b64ee4c52b7e 100644 --- a/sc/source/ui/docshell/impex.cxx +++ b/sc/source/ui/docshell/impex.cxx @@ -192,14 +192,14 @@ void ScImportExport::SetFilterOptions(const OUString& rFilterOptions) maFilterOptions = rFilterOptions; } -bool ScImportExport::IsFormatSupported( sal_uLong nFormat ) +bool ScImportExport::IsFormatSupported( SotClipboardFormatId nFormat ) { - return nFormat == FORMAT_STRING - || nFormat == SOT_FORMATSTR_ID_SYLK - || nFormat == SOT_FORMATSTR_ID_LINK - || nFormat == SOT_FORMATSTR_ID_HTML - || nFormat == SOT_FORMATSTR_ID_HTML_SIMPLE - || nFormat == SOT_FORMATSTR_ID_DIF; + return nFormat == SotClipboardFormatId::STRING + || nFormat == SotClipboardFormatId::SYLK + || nFormat == SotClipboardFormatId::LINK + || nFormat == SotClipboardFormatId::HTML + || nFormat == SotClipboardFormatId::HTML_SIMPLE + || nFormat == SotClipboardFormatId::DIF; } // Prepare for Undo @@ -278,12 +278,12 @@ bool ScImportExport::ExportData( const OUString& rMimeType, return false; } -bool ScImportExport::ImportString( const OUString& rText, sal_uLong nFmt ) +bool ScImportExport::ImportString( const OUString& rText, SotClipboardFormatId nFmt ) { switch ( nFmt ) { // formats supporting unicode - case FORMAT_STRING : + case SotClipboardFormatId::STRING : { ScImportStringStream aStrm( rText); return ImportStream( aStrm, OUString(), nFmt ); @@ -301,10 +301,10 @@ bool ScImportExport::ImportString( const OUString& rText, sal_uLong nFmt ) } } -bool ScImportExport::ExportString( OUString& rText, sal_uLong nFmt ) +bool ScImportExport::ExportString( OUString& rText, SotClipboardFormatId nFmt ) { - OSL_ENSURE( nFmt == FORMAT_STRING, "ScImportExport::ExportString: Unicode not supported for other formats than FORMAT_STRING" ); - if ( nFmt != FORMAT_STRING ) + OSL_ENSURE( nFmt == SotClipboardFormatId::STRING, "ScImportExport::ExportString: Unicode not supported for other formats than SotClipboardFormatId::STRING" ); + if ( nFmt != SotClipboardFormatId::STRING ) { rtl_TextEncoding eEnc = osl_getThreadTextEncoding(); OString aTmp; @@ -332,7 +332,7 @@ bool ScImportExport::ExportString( OUString& rText, sal_uLong nFmt ) // ExportStream must handle RTL_TEXTENCODING_UNICODE } -bool ScImportExport::ExportByteString( OString& rText, rtl_TextEncoding eEnc, sal_uLong nFmt ) +bool ScImportExport::ExportByteString( OString& rText, rtl_TextEncoding eEnc, SotClipboardFormatId nFmt ) { OSL_ENSURE( eEnc != RTL_TEXTENCODING_UNICODE, "ScImportExport::ExportByteString: Unicode not supported" ); if ( eEnc == RTL_TEXTENCODING_UNICODE ) @@ -359,36 +359,36 @@ bool ScImportExport::ExportByteString( OString& rText, rtl_TextEncoding eEnc, sa return false; } -bool ScImportExport::ImportStream( SvStream& rStrm, const OUString& rBaseURL, sal_uLong nFmt ) +bool ScImportExport::ImportStream( SvStream& rStrm, const OUString& rBaseURL, SotClipboardFormatId nFmt ) { - if( nFmt == FORMAT_STRING ) + if( nFmt == SotClipboardFormatId::STRING ) { if( ExtText2Doc( rStrm ) ) // evaluate pExtOptions return true; } - if( nFmt == SOT_FORMATSTR_ID_SYLK ) + if( nFmt == SotClipboardFormatId::SYLK ) { if( Sylk2Doc( rStrm ) ) return true; } - if( nFmt == SOT_FORMATSTR_ID_DIF ) + if( nFmt == SotClipboardFormatId::DIF ) { if( Dif2Doc( rStrm ) ) return true; } - if( nFmt == FORMAT_RTF ) + if( nFmt == SotClipboardFormatId::RTF ) { if( RTF2Doc( rStrm, rBaseURL ) ) return true; } - if( nFmt == SOT_FORMATSTR_ID_LINK ) + if( nFmt == SotClipboardFormatId::LINK ) return true; // Link-Import? - if ( nFmt == SOT_FORMATSTR_ID_HTML ) + if ( nFmt == SotClipboardFormatId::HTML ) { if( HTML2Doc( rStrm, rBaseURL ) ) return true; } - if ( nFmt == SOT_FORMATSTR_ID_HTML_SIMPLE ) + if ( nFmt == SotClipboardFormatId::HTML_SIMPLE ) { MSE40HTMLClipFormatObj aMSE40ClpObj; // needed to skip the header data SvStream* pHTML = aMSE40ClpObj.IsValid( rStrm ); @@ -399,24 +399,24 @@ bool ScImportExport::ImportStream( SvStream& rStrm, const OUString& rBaseURL, sa return false; } -bool ScImportExport::ExportStream( SvStream& rStrm, const OUString& rBaseURL, sal_uLong nFmt ) +bool ScImportExport::ExportStream( SvStream& rStrm, const OUString& rBaseURL, SotClipboardFormatId nFmt ) { - if( nFmt == FORMAT_STRING ) + if( nFmt == SotClipboardFormatId::STRING ) { if( Doc2Text( rStrm ) ) return true; } - if( nFmt == SOT_FORMATSTR_ID_SYLK ) + if( nFmt == SotClipboardFormatId::SYLK ) { if( Doc2Sylk( rStrm ) ) return true; } - if( nFmt == SOT_FORMATSTR_ID_DIF ) + if( nFmt == SotClipboardFormatId::DIF ) { if( Doc2Dif( rStrm ) ) return true; } - if( nFmt == SOT_FORMATSTR_ID_LINK && !bAll ) + if( nFmt == SotClipboardFormatId::LINK && !bAll ) { OUString aDocName; if ( pDoc->IsClipboard() ) @@ -459,12 +459,12 @@ bool ScImportExport::ExportStream( SvStream& rStrm, const OUString& rBaseURL, sa return rStrm.GetError() == SVSTREAM_OK; } } - if( nFmt == SOT_FORMATSTR_ID_HTML ) + if( nFmt == SotClipboardFormatId::HTML ) { if( Doc2HTML( rStrm, rBaseURL ) ) return true; } - if( nFmt == FORMAT_RTF ) + if( nFmt == SotClipboardFormatId::RTF ) { if( Doc2RTF( rStrm ) ) return true; diff --git a/sc/source/ui/docshell/servobj.cxx b/sc/source/ui/docshell/servobj.cxx index 58f0cac8faf5..8fddc9b74427 100644 --- a/sc/source/ui/docshell/servobj.cxx +++ b/sc/source/ui/docshell/servobj.cxx @@ -163,7 +163,7 @@ bool ScServerObject::GetData( OUString aDdeTextFmt = pDocSh->GetDdeTextFmt(); ScDocument& rDoc = pDocSh->GetDocument(); - if( FORMAT_STRING == SotExchange::GetFormatIdFromMimeType( rMimeType )) + if( SotClipboardFormatId::STRING == SotExchange::GetFormatIdFromMimeType( rMimeType )) { ScImportExport aObj( &rDoc, aRange ); if( aDdeTextFmt[0] == 'F' ) @@ -171,7 +171,7 @@ bool ScServerObject::GetData( if( aDdeTextFmt == "SYLK" || aDdeTextFmt == "FSYLK" ) { OString aByteData; - if( aObj.ExportByteString( aByteData, osl_getThreadTextEncoding(), SOT_FORMATSTR_ID_SYLK ) ) + if( aObj.ExportByteString( aByteData, osl_getThreadTextEncoding(), SotClipboardFormatId::SYLK ) ) { rData <<= ::com::sun::star::uno::Sequence< sal_Int8 >( reinterpret_cast<const sal_Int8*>(aByteData.getStr()), diff --git a/sc/source/ui/docshell/tablink.cxx b/sc/source/ui/docshell/tablink.cxx index 765a232b3922..cca5968910a9 100644 --- a/sc/source/ui/docshell/tablink.cxx +++ b/sc/source/ui/docshell/tablink.cxx @@ -59,7 +59,7 @@ TYPEINIT1(ScTableLink, ::sfx2::SvBaseLink); ScTableLink::ScTableLink(ScDocShell* pDocSh, const OUString& rFile, const OUString& rFilter, const OUString& rOpt, sal_uLong nRefresh ): - ::sfx2::SvBaseLink(sfx2::LINKUPDATE_ONCALL,FORMAT_FILE), + ::sfx2::SvBaseLink(sfx2::LINKUPDATE_ONCALL,SotClipboardFormatId::FILE), ScRefreshTimer( nRefresh ), pImpl( new TableLink_Impl ), aFileName(rFile), @@ -76,7 +76,7 @@ ScTableLink::ScTableLink(ScDocShell* pDocSh, const OUString& rFile, ScTableLink::ScTableLink(SfxObjectShell* pShell, const OUString& rFile, const OUString& rFilter, const OUString& rOpt, sal_uLong nRefresh ): - ::sfx2::SvBaseLink(sfx2::LINKUPDATE_ONCALL,FORMAT_FILE), + ::sfx2::SvBaseLink(sfx2::LINKUPDATE_ONCALL,SotClipboardFormatId::FILE), ScRefreshTimer( nRefresh ), pImpl( new TableLink_Impl ), aFileName(rFile), diff --git a/sc/source/ui/drawfunc/drtxtob.cxx b/sc/source/ui/drawfunc/drtxtob.cxx index 4f7637baef5b..aa17857dbdc5 100644 --- a/sc/source/ui/drawfunc/drtxtob.cxx +++ b/sc/source/ui/drawfunc/drtxtob.cxx @@ -176,18 +176,18 @@ void ScDrawTextObjectBar::Execute( SfxRequest &rReq ) case SID_CLIPBOARD_FORMAT_ITEMS: { - sal_uLong nFormat = 0; + SotClipboardFormatId nFormat = SotClipboardFormatId::NONE; const SfxPoolItem* pItem; if ( pReqArgs && pReqArgs->GetItemState(nSlot, true, &pItem) == SfxItemState::SET && pItem->ISA(SfxUInt32Item) ) { - nFormat = static_cast<const SfxUInt32Item*>(pItem)->GetValue(); + nFormat = static_cast<SotClipboardFormatId>(static_cast<const SfxUInt32Item*>(pItem)->GetValue()); } - if ( nFormat ) + if ( nFormat != SotClipboardFormatId::NONE ) { - if (nFormat == SOT_FORMAT_STRING) + if (nFormat == SotClipboardFormatId::STRING) pOutView->Paste(); else pOutView->PasteSpecial(); @@ -478,7 +478,7 @@ IMPL_LINK( ScDrawTextObjectBar, ClipboardChanged, TransferableDataHelper*, pData { if ( pDataHelper ) { - bPastePossible = ( pDataHelper->HasFormat( SOT_FORMAT_STRING ) || pDataHelper->HasFormat( SOT_FORMAT_RTF ) ); + bPastePossible = ( pDataHelper->HasFormat( SotClipboardFormatId::STRING ) || pDataHelper->HasFormat( SotClipboardFormatId::RTF ) ); SfxBindings& rBindings = pViewData->GetBindings(); rBindings.Invalidate( SID_PASTE ); @@ -507,7 +507,7 @@ void ScDrawTextObjectBar::GetClipState( SfxItemSet& rSet ) // get initial state TransferableDataHelper aDataHelper( TransferableDataHelper::CreateFromSystemClipboard( pViewData->GetActiveWin() ) ); - bPastePossible = ( aDataHelper.HasFormat( SOT_FORMAT_STRING ) || aDataHelper.HasFormat( SOT_FORMAT_RTF ) ); + bPastePossible = ( aDataHelper.HasFormat( SotClipboardFormatId::STRING ) || aDataHelper.HasFormat( SotClipboardFormatId::RTF ) ); } SfxWhichIter aIter( rSet ); @@ -528,10 +528,10 @@ void ScDrawTextObjectBar::GetClipState( SfxItemSet& rSet ) TransferableDataHelper aDataHelper( TransferableDataHelper::CreateFromSystemClipboard( pViewData->GetActiveWin() ) ); - if ( aDataHelper.HasFormat( SOT_FORMAT_STRING ) ) - aFormats.AddClipbrdFormat( SOT_FORMAT_STRING ); - if ( aDataHelper.HasFormat( SOT_FORMAT_RTF ) ) - aFormats.AddClipbrdFormat( SOT_FORMAT_RTF ); + if ( aDataHelper.HasFormat( SotClipboardFormatId::STRING ) ) + aFormats.AddClipbrdFormat( SotClipboardFormatId::STRING ); + if ( aDataHelper.HasFormat( SotClipboardFormatId::RTF ) ) + aFormats.AddClipbrdFormat( SotClipboardFormatId::RTF ); rSet.Put( aFormats ); } diff --git a/sc/source/ui/drawfunc/drtxtob1.cxx b/sc/source/ui/drawfunc/drtxtob1.cxx index 6c12b0d6c646..a2e6a82ebde9 100644 --- a/sc/source/ui/drawfunc/drtxtob1.cxx +++ b/sc/source/ui/drawfunc/drtxtob1.cxx @@ -116,18 +116,18 @@ void ScDrawTextObjectBar::ExecutePasteContents( SfxRequest & /* rReq */ ) SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); boost::scoped_ptr<SfxAbstractPasteDialog> pDlg(pFact->CreatePasteDialog( pViewData->GetDialogParent() )); - pDlg->Insert( SOT_FORMAT_STRING, EMPTY_OUSTRING ); - pDlg->Insert( SOT_FORMAT_RTF, EMPTY_OUSTRING ); + pDlg->Insert( SotClipboardFormatId::STRING, EMPTY_OUSTRING ); + pDlg->Insert( SotClipboardFormatId::RTF, EMPTY_OUSTRING ); TransferableDataHelper aDataHelper( TransferableDataHelper::CreateFromSystemClipboard( pViewData->GetActiveWin() ) ); - sal_uLong nFormat = pDlg->GetFormat( aDataHelper.GetTransferable() ); + SotClipboardFormatId nFormat = pDlg->GetFormat( aDataHelper.GetTransferable() ); //! test if outliner view is still valid - if (nFormat > 0) + if (nFormat != SotClipboardFormatId::NONE) { - if (nFormat == SOT_FORMAT_STRING) + if (nFormat == SotClipboardFormatId::STRING) pOutView->Paste(); else pOutView->PasteSpecial(); diff --git a/sc/source/ui/inc/docsh.hxx b/sc/source/ui/inc/docsh.hxx index 03e867c2eca4..0a0c09d23059 100644 --- a/sc/source/ui/inc/docsh.hxx +++ b/sc/source/ui/inc/docsh.hxx @@ -186,7 +186,7 @@ public: GetUndoManager() SAL_OVERRIDE; virtual void FillClass( SvGlobalName * pClassName, - sal_uInt32 * pFormat, + SotClipboardFormatId * pFormat, OUString * pAppName, OUString * pFullTypeName, OUString * pShortTypeName, diff --git a/sc/source/ui/inc/drwtrans.hxx b/sc/source/ui/inc/drwtrans.hxx index f56bd95c2252..8f5642b2a59c 100644 --- a/sc/source/ui/inc/drwtrans.hxx +++ b/sc/source/ui/inc/drwtrans.hxx @@ -76,7 +76,7 @@ public: 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, + virtual bool WriteObject( SotStorageStreamRef& rxOStm, void* pUserObject, SotClipboardFormatId nUserObjectId, const ::com::sun::star::datatransfer::DataFlavor& rFlavor ) SAL_OVERRIDE; virtual void ObjectReleased() SAL_OVERRIDE; virtual void DragFinished( sal_Int8 nDropAction ) SAL_OVERRIDE; diff --git a/sc/source/ui/inc/impex.hxx b/sc/source/ui/inc/impex.hxx index f5b7b8c1bc11..e311e15f8141 100644 --- a/sc/source/ui/inc/impex.hxx +++ b/sc/source/ui/inc/impex.hxx @@ -110,7 +110,7 @@ public: SC_DLLPUBLIC static void EmbeddedNullTreatment( OUString & rStr ); - static bool IsFormatSupported( sal_uLong nFormat ); + static bool IsFormatSupported( SotClipboardFormatId nFormat ); static const sal_Unicode* ScanNextFieldFromString( const sal_Unicode* p, OUString& rField, sal_Unicode cStr, const sal_Unicode* pSeps, bool bMergeSeps, bool& rbIsQuoted, bool& rbOverflowCell ); @@ -135,12 +135,12 @@ public: void SetStreamPath( const OUString& rPath ) { aStreamPath = rPath; } const OUString& GetStreamPath() const { return aStreamPath; } - bool ImportString( const OUString&, sal_uLong=FORMAT_STRING ); - bool ExportString( OUString&, sal_uLong=FORMAT_STRING ); - bool ExportByteString( OString&, rtl_TextEncoding, sal_uLong=FORMAT_STRING ); + bool ImportString( const OUString&, SotClipboardFormatId=SotClipboardFormatId::STRING ); + bool ExportString( OUString&, SotClipboardFormatId=SotClipboardFormatId::STRING ); + bool ExportByteString( OString&, rtl_TextEncoding, SotClipboardFormatId=SotClipboardFormatId::STRING ); - bool ImportStream( SvStream&, const OUString& rBaseURL, sal_uLong=FORMAT_STRING ); - bool ExportStream( SvStream&, const OUString& rBaseURL, sal_uLong=FORMAT_STRING ); + bool ImportStream( SvStream&, const OUString& rBaseURL, SotClipboardFormatId=SotClipboardFormatId::STRING ); + bool ExportStream( SvStream&, const OUString& rBaseURL, SotClipboardFormatId=SotClipboardFormatId::STRING ); bool ImportData( const OUString& rMimeType, const ::com::sun::star::uno::Any & rValue ); diff --git a/sc/source/ui/inc/transobj.hxx b/sc/source/ui/inc/transobj.hxx index bd11836bcf97..57d8ea6f8954 100644 --- a/sc/source/ui/inc/transobj.hxx +++ b/sc/source/ui/inc/transobj.hxx @@ -73,7 +73,7 @@ public: 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, + virtual bool WriteObject( SotStorageStreamRef& rxOStm, void* pUserObject, SotClipboardFormatId nUserObjectId, const ::com::sun::star::datatransfer::DataFlavor& rFlavor ) SAL_OVERRIDE; virtual void ObjectReleased() SAL_OVERRIDE; virtual void DragFinished( sal_Int8 nDropAction ) SAL_OVERRIDE; diff --git a/sc/source/ui/inc/viewfunc.hxx b/sc/source/ui/inc/viewfunc.hxx index 70c7e0f8df4b..a032722ff9a5 100644 --- a/sc/source/ui/inc/viewfunc.hxx +++ b/sc/source/ui/inc/viewfunc.hxx @@ -111,10 +111,10 @@ public: InsertDeleteFlags nUndoExtraFlags = IDF_NONE, bool bAllowDialogs = false ); - void FillTab( InsertDeleteFlags nFlags, sal_uInt16 nFunction, bool bSkipEmpty, bool bAsLink ); + void FillTab( InsertDeleteFlags nFlags, sal_uInt16 nFunction, bool bSkipEmpty, bool bAsLink ); SC_DLLPUBLIC void PasteFromSystem(); - SC_DLLPUBLIC bool PasteFromSystem( sal_uLong nFormatId, bool bApi = false ); + SC_DLLPUBLIC bool PasteFromSystem( SotClipboardFormatId nFormatId, bool bApi = false ); void PasteFromTransferable( const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >& rxTransferable ); @@ -126,7 +126,7 @@ public: const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >& rxTransferable, SdrObject& rHitObj); - bool PasteDataFormat( sal_uLong nFormatId, + bool PasteDataFormat( SotClipboardFormatId nFormatId, const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >& rxTransferable, SCCOL nPosX, SCROW nPosY, Point* pLogicPos = NULL, @@ -138,7 +138,7 @@ public: bool PasteMetaFile( const Point&, const GDIMetaFile& ); bool PasteGraphic( const Point& rPos, const Graphic& rGraphic, const OUString& rFile, const OUString& rFilter ); - bool PasteBookmark( sal_uLong nFormatId, + bool PasteBookmark( SotClipboardFormatId nFormatId, const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >& rxTransferable, SCCOL nPosX, SCROW nPosY ); diff --git a/sc/source/ui/vba/vbahelper.cxx b/sc/source/ui/vba/vbahelper.cxx index dffde94c6985..cbb4fff51eff 100644 --- a/sc/source/ui/vba/vbahelper.cxx +++ b/sc/source/ui/vba/vbahelper.cxx @@ -211,7 +211,7 @@ void implnPasteSpecial(sal_uInt16 nFlags,sal_uInt16 nFunction,sal_Bool bSkipEmpt if ( pView && pWin ) { if ( bAsLink && bOtherDoc ) - pTabViewShell->PasteFromSystem(0);//SOT_FORMATSTR_ID_LINK + pTabViewShell->PasteFromSystem(0);//SotClipboardFormatId::LINK else { ScTransferObj* pOwnClip = ScTransferObj::GetOwnClipboard( pWin ); diff --git a/sc/source/ui/view/cellsh.cxx b/sc/source/ui/view/cellsh.cxx index 8c4ba99eaffb..6078b6cf0f60 100644 --- a/sc/source/ui/view/cellsh.cxx +++ b/sc/source/ui/view/cellsh.cxx @@ -344,7 +344,7 @@ void ScCellShell::GetCellState( SfxItemSet& rSet ) } static bool lcl_TestFormat( SvxClipboardFmtItem& rFormats, const TransferableDataHelper& rDataHelper, - SotFormatStringId nFormatId ) + SotClipboardFormatId nFormatId ) { if ( rDataHelper.HasFormat( nFormatId ) ) { @@ -352,15 +352,15 @@ static bool lcl_TestFormat( SvxClipboardFmtItem& rFormats, const TransferableDat // handled by "paste special" dialog / toolbox controller instead. // Only the object type name has to be set here: OUString aStrVal; - if ( nFormatId == SOT_FORMATSTR_ID_EMBED_SOURCE ) + if ( nFormatId == SotClipboardFormatId::EMBED_SOURCE ) { TransferableObjectDescriptor aDesc; if ( ((TransferableDataHelper&)rDataHelper).GetTransferableObjectDescriptor( - SOT_FORMATSTR_ID_OBJECTDESCRIPTOR, aDesc ) ) + SotClipboardFormatId::OBJECTDESCRIPTOR, aDesc ) ) aStrVal = aDesc.maTypeName; } - else if ( nFormatId == SOT_FORMATSTR_ID_EMBED_SOURCE_OLE - || nFormatId == SOT_FORMATSTR_ID_EMBEDDED_OBJ_OLE ) + else if ( nFormatId == SotClipboardFormatId::EMBED_SOURCE_OLE + || nFormatId == SotClipboardFormatId::EMBEDDED_OBJ_OLE ) { OUString aSource; SvPasteObjectHelper::GetEmbeddedName( rDataHelper, aStrVal, aSource, nFormatId ); @@ -384,27 +384,27 @@ void ScCellShell::GetPossibleClipboardFormats( SvxClipboardFmtItem& rFormats ) TransferableDataHelper aDataHelper( TransferableDataHelper::CreateFromSystemClipboard( pWin ) ); - lcl_TestFormat( rFormats, aDataHelper, SOT_FORMATSTR_ID_DRAWING ); - lcl_TestFormat( rFormats, aDataHelper, SOT_FORMATSTR_ID_SVXB ); - lcl_TestFormat( rFormats, aDataHelper, SOT_FORMAT_GDIMETAFILE ); - lcl_TestFormat( rFormats, aDataHelper, SOT_FORMATSTR_ID_PNG ); - lcl_TestFormat( rFormats, aDataHelper, SOT_FORMAT_BITMAP ); - lcl_TestFormat( rFormats, aDataHelper, SOT_FORMATSTR_ID_EMBED_SOURCE ); + lcl_TestFormat( rFormats, aDataHelper, SotClipboardFormatId::DRAWING ); + lcl_TestFormat( rFormats, aDataHelper, SotClipboardFormatId::SVXB ); + lcl_TestFormat( rFormats, aDataHelper, SotClipboardFormatId::GDIMETAFILE ); + lcl_TestFormat( rFormats, aDataHelper, SotClipboardFormatId::PNG ); + lcl_TestFormat( rFormats, aDataHelper, SotClipboardFormatId::BITMAP ); + lcl_TestFormat( rFormats, aDataHelper, SotClipboardFormatId::EMBED_SOURCE ); if ( !bDraw ) { - lcl_TestFormat( rFormats, aDataHelper, SOT_FORMATSTR_ID_LINK ); - lcl_TestFormat( rFormats, aDataHelper, SOT_FORMAT_STRING ); - lcl_TestFormat( rFormats, aDataHelper, SOT_FORMATSTR_ID_DIF ); - lcl_TestFormat( rFormats, aDataHelper, SOT_FORMAT_RTF ); - lcl_TestFormat( rFormats, aDataHelper, SOT_FORMATSTR_ID_HTML ); - lcl_TestFormat( rFormats, aDataHelper, SOT_FORMATSTR_ID_HTML_SIMPLE ); - lcl_TestFormat( rFormats, aDataHelper, SOT_FORMATSTR_ID_BIFF_8 ); - lcl_TestFormat( rFormats, aDataHelper, SOT_FORMATSTR_ID_BIFF_5 ); + lcl_TestFormat( rFormats, aDataHelper, SotClipboardFormatId::LINK ); + lcl_TestFormat( rFormats, aDataHelper, SotClipboardFormatId::STRING ); + lcl_TestFormat( rFormats, aDataHelper, SotClipboardFormatId::DIF ); + lcl_TestFormat( rFormats, aDataHelper, SotClipboardFormatId::RTF ); + lcl_TestFormat( rFormats, aDataHelper, SotClipboardFormatId::HTML ); + lcl_TestFormat( rFormats, aDataHelper, SotClipboardFormatId::HTML_SIMPLE ); + lcl_TestFormat( rFormats, aDataHelper, SotClipboardFormatId::BIFF_8 ); + lcl_TestFormat( rFormats, aDataHelper, SotClipboardFormatId::BIFF_5 ); } - if ( !lcl_TestFormat( rFormats, aDataHelper, SOT_FORMATSTR_ID_EMBED_SOURCE_OLE ) ) - lcl_TestFormat( rFormats, aDataHelper, SOT_FORMATSTR_ID_EMBEDDED_OBJ_OLE ); + if ( !lcl_TestFormat( rFormats, aDataHelper, SotClipboardFormatId::EMBED_SOURCE_OLE ) ) + lcl_TestFormat( rFormats, aDataHelper, SotClipboardFormatId::EMBEDDED_OBJ_OLE ); } // insert, insert contents @@ -416,23 +416,23 @@ static bool lcl_IsCellPastePossible( const TransferableDataHelper& rData ) bPossible = true; else { - if ( rData.HasFormat( SOT_FORMATSTR_ID_PNG ) || - rData.HasFormat( SOT_FORMAT_BITMAP ) || - rData.HasFormat( SOT_FORMAT_GDIMETAFILE ) || - rData.HasFormat( SOT_FORMATSTR_ID_SVXB ) || - rData.HasFormat( FORMAT_PRIVATE ) || - rData.HasFormat( SOT_FORMAT_RTF ) || - rData.HasFormat( SOT_FORMATSTR_ID_EMBED_SOURCE ) || - rData.HasFormat( SOT_FORMATSTR_ID_LINK_SOURCE ) || - rData.HasFormat( SOT_FORMATSTR_ID_EMBED_SOURCE_OLE ) || - rData.HasFormat( SOT_FORMATSTR_ID_LINK_SOURCE_OLE ) || - rData.HasFormat( SOT_FORMATSTR_ID_EMBEDDED_OBJ_OLE ) || - rData.HasFormat( SOT_FORMAT_STRING ) || - rData.HasFormat( SOT_FORMATSTR_ID_SYLK ) || - rData.HasFormat( SOT_FORMATSTR_ID_LINK ) || - rData.HasFormat( SOT_FORMATSTR_ID_HTML ) || - rData.HasFormat( SOT_FORMATSTR_ID_HTML_SIMPLE ) || - rData.HasFormat( SOT_FORMATSTR_ID_DIF ) ) + if ( rData.HasFormat( SotClipboardFormatId::PNG ) || + rData.HasFormat( SotClipboardFormatId::BITMAP ) || + rData.HasFormat( SotClipboardFormatId::GDIMETAFILE ) || + rData.HasFormat( SotClipboardFormatId::SVXB ) || + rData.HasFormat( SotClipboardFormatId::PRIVATE ) || + rData.HasFormat( SotClipboardFormatId::RTF ) || + rData.HasFormat( SotClipboardFormatId::EMBED_SOURCE ) || + rData.HasFormat( SotClipboardFormatId::LINK_SOURCE ) || + rData.HasFormat( SotClipboardFormatId::EMBED_SOURCE_OLE ) || + rData.HasFormat( SotClipboardFormatId::LINK_SOURCE_OLE ) || + rData.HasFormat( SotClipboardFormatId::EMBEDDED_OBJ_OLE ) || + rData.HasFormat( SotClipboardFormatId::STRING ) || + rData.HasFormat( SotClipboardFormatId::SYLK ) || + rData.HasFormat( SotClipboardFormatId::LINK ) || + rData.HasFormat( SotClipboardFormatId::HTML ) || + rData.HasFormat( SotClipboardFormatId::HTML_SIMPLE ) || + rData.HasFormat( SotClipboardFormatId::DIF ) ) { bPossible = true; } diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx index c2968bdd10d6..2fb91e4df0d8 100644 --- a/sc/source/ui/view/cellsh1.cxx +++ b/sc/source/ui/view/cellsh1.cxx @@ -1269,21 +1269,21 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) { WaitObject aWait( GetViewData()->GetDialogParent() ); - sal_uLong nFormat = 0; + SotClipboardFormatId nFormat = SotClipboardFormatId::NONE; const SfxPoolItem* pItem; if ( pReqArgs && pReqArgs->GetItemState(nSlot, true, &pItem) == SfxItemState::SET && pItem->ISA(SfxUInt32Item) ) { - nFormat = static_cast<const SfxUInt32Item*>(pItem)->GetValue(); + nFormat = static_cast<SotClipboardFormatId>(static_cast<const SfxUInt32Item*>(pItem)->GetValue()); } - if ( nFormat ) + if ( nFormat != SotClipboardFormatId::NONE ) { vcl::Window* pWin = GetViewData()->GetActiveWin(); bool bCells = ( ScTransferObj::GetOwnClipboard( pWin ) != NULL ); bool bDraw = ( ScDrawTransferObj::GetOwnClipboard( pWin ) != NULL ); - bool bOle = ( nFormat == SOT_FORMATSTR_ID_EMBED_SOURCE ); + bool bOle = ( nFormat == SotClipboardFormatId::EMBED_SOURCE ); if ( bCells && bOle ) pTabViewShell->PasteFromSystem(); @@ -1454,7 +1454,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) { WaitObject aWait( GetViewData()->GetDialogParent() ); if ( bAsLink && bOtherDoc ) - pTabViewShell->PasteFromSystem(SOT_FORMATSTR_ID_LINK); // DDE insert + pTabViewShell->PasteFromSystem(SotClipboardFormatId::LINK); // DDE insert else { pTabViewShell->PasteFromClip( nFlags, pOwnClip->GetDocument(), @@ -1530,12 +1530,12 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) pReqArgs->GetItemState(nSlot, true, &pItem) == SfxItemState::SET && pItem->ISA(SfxUInt32Item) ) { - sal_uLong nFormat = static_cast<const SfxUInt32Item*>(pItem)->GetValue(); + SotClipboardFormatId nFormat = static_cast<SotClipboardFormatId>(static_cast<const SfxUInt32Item*>(pItem)->GetValue()); bool bRet=true; { WaitObject aWait( GetViewData()->GetDialogParent() ); bool bDraw = ( ScDrawTransferObj::GetOwnClipboard( pWin ) != NULL ); - if ( bDraw && nFormat == SOT_FORMATSTR_ID_EMBED_SOURCE ) + if ( bDraw && nFormat == SotClipboardFormatId::EMBED_SOURCE ) pTabViewShell->PasteDraw(); else bRet = pTabViewShell->PasteFromSystem(nFormat, true); // TRUE: no error messages @@ -1575,28 +1575,28 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) { for (sal_uInt16 i=0; i<nFormatCount; i++) { - sal_uLong nFormatId = aFormats.GetClipbrdFormatId( i ); + SotClipboardFormatId nFormatId = aFormats.GetClipbrdFormatId( i ); OUString aName = aFormats.GetClipbrdFormatName( i ); // special case for paste dialog: '*' is replaced by object type - if ( nFormatId == SOT_FORMATSTR_ID_EMBED_SOURCE ) + if ( nFormatId == SotClipboardFormatId::EMBED_SOURCE ) aName = "*"; pDlg->Insert( nFormatId, aName ); } TransferableDataHelper aDataHelper( TransferableDataHelper::CreateFromSystemClipboard( pWin ) ); - sal_uLong nFormat = pDlg->GetFormat( aDataHelper.GetTransferable() ); - if (nFormat > 0) + SotClipboardFormatId nFormat = pDlg->GetFormat( aDataHelper.GetTransferable() ); + if (nFormat != SotClipboardFormatId::NONE) { { WaitObject aWait( GetViewData()->GetDialogParent() ); - if ( bDraw && nFormat == SOT_FORMATSTR_ID_EMBED_SOURCE ) + if ( bDraw && nFormat == SotClipboardFormatId::EMBED_SOURCE ) pTabViewShell->PasteDraw(); else pTabViewShell->PasteFromSystem(nFormat); } rReq.SetReturnValue(SfxInt16Item(nSlot, 1)); // 1 = success - rReq.AppendItem( SfxUInt32Item( nSlot, nFormat ) ); + rReq.AppendItem( SfxUInt32Item( nSlot, static_cast<sal_uInt32>(nFormat) ) ); rReq.Done(); } else diff --git a/sc/source/ui/view/cellsh2.cxx b/sc/source/ui/view/cellsh2.cxx index 187e5291d59e..e4fb7cce893d 100644 --- a/sc/source/ui/view/cellsh2.cxx +++ b/sc/source/ui/view/cellsh2.cxx @@ -956,7 +956,7 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq ) SvMemoryStream aStream; aStream.SetStreamCharSet( RTL_TEXTENCODING_UNICODE ); ScImportExport::SetNoEndianSwap( aStream ); - aExport.ExportStream( aStream, OUString(), FORMAT_STRING ); + aExport.ExportStream( aStream, OUString(), SotClipboardFormatId::STRING ); ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); OSL_ENSURE( pFact, "ScCellShell::ExecuteDB: SID_TEXT_TO_COLUMNS - pFact is null!" ); @@ -980,7 +980,7 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq ) aImport.SetApi( false ); aImport.SetImportBroadcast( true ); aStream.Seek( 0 ); - aImport.ImportStream( aStream, OUString(), FORMAT_STRING ); + aImport.ImportStream( aStream, OUString(), SotClipboardFormatId::STRING ); pDocSh->GetUndoManager()->LeaveListAction(); } diff --git a/sc/source/ui/view/editsh.cxx b/sc/source/ui/view/editsh.cxx index cb4c17a14fe1..bceac51de6a2 100644 --- a/sc/source/ui/view/editsh.cxx +++ b/sc/source/ui/view/editsh.cxx @@ -247,18 +247,18 @@ void ScEditShell::Execute( SfxRequest& rReq ) case SID_CLIPBOARD_FORMAT_ITEMS: { - sal_uLong nFormat = 0; + SotClipboardFormatId nFormat = SotClipboardFormatId::NONE; const SfxPoolItem* pItem; if ( pReqArgs && pReqArgs->GetItemState(nSlot, true, &pItem) == SfxItemState::SET && pItem->ISA(SfxUInt32Item) ) { - nFormat = static_cast<const SfxUInt32Item*>(pItem)->GetValue(); + nFormat = static_cast<SotClipboardFormatId>(static_cast<const SfxUInt32Item*>(pItem)->GetValue()); } - if ( nFormat ) + if ( nFormat != SotClipboardFormatId::NONE ) { - if (SOT_FORMAT_STRING == nFormat) + if (SotClipboardFormatId::STRING == nFormat) pTableView->Paste(); else pTableView->PasteSpecial(); @@ -273,11 +273,11 @@ void ScEditShell::Execute( SfxRequest& rReq ) { SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); boost::scoped_ptr<SfxAbstractPasteDialog> pDlg(pFact->CreatePasteDialog( pViewData->GetDialogParent() )); - sal_uLong nFormat = 0; + SotClipboardFormatId nFormat = SotClipboardFormatId::NONE; if ( pDlg ) { - pDlg->Insert( SOT_FORMAT_STRING, EMPTY_OUSTRING ); - pDlg->Insert( SOT_FORMAT_RTF, EMPTY_OUSTRING ); + pDlg->Insert( SotClipboardFormatId::STRING, EMPTY_OUSTRING ); + pDlg->Insert( SotClipboardFormatId::RTF, EMPTY_OUSTRING ); TransferableDataHelper aDataHelper( TransferableDataHelper::CreateFromSystemClipboard( pViewData->GetActiveWin() ) ); @@ -290,9 +290,9 @@ void ScEditShell::Execute( SfxRequest& rReq ) if (!SC_MOD()->IsInputMode()) return; - if (nFormat > 0) + if (nFormat != SotClipboardFormatId::NONE) { - if (SOT_FORMAT_STRING == nFormat) + if (SotClipboardFormatId::STRING == nFormat) pTableView->Paste(); else pTableView->PasteSpecial(); @@ -762,7 +762,7 @@ IMPL_LINK( ScEditShell, ClipboardChanged, TransferableDataHelper*, pDataHelper ) { if ( pDataHelper ) { - bPastePossible = ( pDataHelper->HasFormat( SOT_FORMAT_STRING ) || pDataHelper->HasFormat( SOT_FORMAT_RTF ) ); + bPastePossible = ( pDataHelper->HasFormat( SotClipboardFormatId::STRING ) || pDataHelper->HasFormat( SotClipboardFormatId::RTF ) ); SfxBindings& rBindings = pViewData->GetBindings(); rBindings.Invalidate( SID_PASTE ); @@ -784,7 +784,7 @@ void ScEditShell::GetClipState( SfxItemSet& rSet ) // get initial state TransferableDataHelper aDataHelper( TransferableDataHelper::CreateFromSystemClipboard( pViewData->GetActiveWin() ) ); - bPastePossible = ( aDataHelper.HasFormat( SOT_FORMAT_STRING ) || aDataHelper.HasFormat( SOT_FORMAT_RTF ) ); + bPastePossible = ( aDataHelper.HasFormat( SotClipboardFormatId::STRING ) || aDataHelper.HasFormat( SotClipboardFormatId::RTF ) ); } SfxWhichIter aIter( rSet ); @@ -805,10 +805,10 @@ void ScEditShell::GetClipState( SfxItemSet& rSet ) TransferableDataHelper aDataHelper( TransferableDataHelper::CreateFromSystemClipboard( pViewData->GetActiveWin() ) ); - if ( aDataHelper.HasFormat( SOT_FORMAT_STRING ) ) - aFormats.AddClipbrdFormat( SOT_FORMAT_STRING ); - if ( aDataHelper.HasFormat( SOT_FORMAT_RTF ) ) - aFormats.AddClipbrdFormat( SOT_FORMAT_RTF ); + if ( aDataHelper.HasFormat( SotClipboardFormatId::STRING ) ) + aFormats.AddClipbrdFormat( SotClipboardFormatId::STRING ); + if ( aDataHelper.HasFormat( SotClipboardFormatId::RTF ) ) + aFormats.AddClipbrdFormat( SotClipboardFormatId::RTF ); rSet.Put( aFormats ); } diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index d48120d8c294..0e6afcdf1b94 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -3775,10 +3775,10 @@ sal_Int8 ScGridWindow::AcceptDrop( const AcceptDropEvent& rEvt ) pViewData->GetTabNo(), PixelToLogic(rEvt.maPosPixel) ); if ( pHitObj && nMyAction == DND_ACTION_LINK ) // && !rData.pDrawTransfer ) { - if ( IsDropFormatSupported(SOT_FORMATSTR_ID_SVXB) - || IsDropFormatSupported(SOT_FORMAT_GDIMETAFILE) - || IsDropFormatSupported(SOT_FORMATSTR_ID_PNG) - || IsDropFormatSupported(SOT_FORMAT_BITMAP) ) + if ( IsDropFormatSupported(SotClipboardFormatId::SVXB) + || IsDropFormatSupported(SotClipboardFormatId::GDIMETAFILE) + || IsDropFormatSupported(SotClipboardFormatId::PNG) + || IsDropFormatSupported(SotClipboardFormatId::BITMAP) ) { // graphic dragged onto drawing object DrawMarkDropObj( pHitObj ); @@ -3797,47 +3797,47 @@ sal_Int8 ScGridWindow::AcceptDrop( const AcceptDropEvent& rEvt ) case DND_ACTION_COPYMOVE: { bool bMove = ( nMyAction == DND_ACTION_MOVE ); - if ( IsDropFormatSupported( SOT_FORMATSTR_ID_EMBED_SOURCE ) || - IsDropFormatSupported( SOT_FORMATSTR_ID_LINK_SOURCE ) || - IsDropFormatSupported( SOT_FORMATSTR_ID_EMBED_SOURCE_OLE ) || - IsDropFormatSupported( SOT_FORMATSTR_ID_LINK_SOURCE_OLE ) || - IsDropFormatSupported( SOT_FORMATSTR_ID_EMBEDDED_OBJ_OLE ) || - IsDropFormatSupported( SOT_FORMAT_STRING ) || - IsDropFormatSupported( SOT_FORMATSTR_ID_SYLK ) || - IsDropFormatSupported( SOT_FORMATSTR_ID_LINK ) || - IsDropFormatSupported( SOT_FORMATSTR_ID_HTML ) || - IsDropFormatSupported( SOT_FORMATSTR_ID_HTML_SIMPLE ) || - IsDropFormatSupported( SOT_FORMATSTR_ID_DIF ) || - IsDropFormatSupported( SOT_FORMATSTR_ID_DRAWING ) || - IsDropFormatSupported( SOT_FORMATSTR_ID_SVXB ) || - IsDropFormatSupported( SOT_FORMAT_RTF ) || - IsDropFormatSupported( SOT_FORMAT_GDIMETAFILE ) || - IsDropFormatSupported( SOT_FORMATSTR_ID_PNG ) || - IsDropFormatSupported( SOT_FORMAT_BITMAP ) || - IsDropFormatSupported( SOT_FORMATSTR_ID_SBA_DATAEXCHANGE ) || - IsDropFormatSupported( SOT_FORMATSTR_ID_SBA_FIELDDATAEXCHANGE ) || + if ( IsDropFormatSupported( SotClipboardFormatId::EMBED_SOURCE ) || + IsDropFormatSupported( SotClipboardFormatId::LINK_SOURCE ) || + IsDropFormatSupported( SotClipboardFormatId::EMBED_SOURCE_OLE ) || + IsDropFormatSupported( SotClipboardFormatId::LINK_SOURCE_OLE ) || + IsDropFormatSupported( SotClipboardFormatId::EMBEDDED_OBJ_OLE ) || + IsDropFormatSupported( SotClipboardFormatId::STRING ) || + IsDropFormatSupported( SotClipboardFormatId::SYLK ) || + IsDropFormatSupported( SotClipboardFormatId::LINK ) || + IsDropFormatSupported( SotClipboardFormatId::HTML ) || + IsDropFormatSupported( SotClipboardFormatId::HTML_SIMPLE ) || + IsDropFormatSupported( SotClipboardFormatId::DIF ) || + IsDropFormatSupported( SotClipboardFormatId::DRAWING ) || + IsDropFormatSupported( SotClipboardFormatId::SVXB ) || + IsDropFormatSupported( SotClipboardFormatId::RTF ) || + IsDropFormatSupported( SotClipboardFormatId::GDIMETAFILE ) || + IsDropFormatSupported( SotClipboardFormatId::PNG ) || + IsDropFormatSupported( SotClipboardFormatId::BITMAP ) || + IsDropFormatSupported( SotClipboardFormatId::SBA_DATAEXCHANGE ) || + IsDropFormatSupported( SotClipboardFormatId::SBA_FIELDDATAEXCHANGE ) || ( !bMove && ( - IsDropFormatSupported( SOT_FORMAT_FILE_LIST ) || - IsDropFormatSupported( SOT_FORMAT_FILE ) || - IsDropFormatSupported( SOT_FORMATSTR_ID_SOLK ) || - IsDropFormatSupported( SOT_FORMATSTR_ID_UNIFORMRESOURCELOCATOR ) || - IsDropFormatSupported( SOT_FORMATSTR_ID_NETSCAPE_BOOKMARK ) || - IsDropFormatSupported( SOT_FORMATSTR_ID_FILEGRPDESCRIPTOR ) ) ) ) + IsDropFormatSupported( SotClipboardFormatId::FILE_LIST ) || + IsDropFormatSupported( SotClipboardFormatId::FILE ) || + IsDropFormatSupported( SotClipboardFormatId::SOLK ) || + IsDropFormatSupported( SotClipboardFormatId::UNIFORMRESOURCELOCATOR ) || + IsDropFormatSupported( SotClipboardFormatId::NETSCAPE_BOOKMARK ) || + IsDropFormatSupported( SotClipboardFormatId::FILEGRPDESCRIPTOR ) ) ) ) { nRet = nMyAction; } } break; case DND_ACTION_LINK: - if ( IsDropFormatSupported( SOT_FORMATSTR_ID_LINK_SOURCE ) || - IsDropFormatSupported( SOT_FORMATSTR_ID_LINK_SOURCE_OLE ) || - IsDropFormatSupported( SOT_FORMATSTR_ID_LINK ) || - IsDropFormatSupported( SOT_FORMAT_FILE_LIST ) || - IsDropFormatSupported( SOT_FORMAT_FILE ) || - IsDropFormatSupported( SOT_FORMATSTR_ID_SOLK ) || - IsDropFormatSupported( SOT_FORMATSTR_ID_UNIFORMRESOURCELOCATOR ) || - IsDropFormatSupported( SOT_FORMATSTR_ID_NETSCAPE_BOOKMARK ) || - IsDropFormatSupported( SOT_FORMATSTR_ID_FILEGRPDESCRIPTOR ) ) + if ( IsDropFormatSupported( SotClipboardFormatId::LINK_SOURCE ) || + IsDropFormatSupported( SotClipboardFormatId::LINK_SOURCE_OLE ) || + IsDropFormatSupported( SotClipboardFormatId::LINK ) || + IsDropFormatSupported( SotClipboardFormatId::FILE_LIST ) || + IsDropFormatSupported( SotClipboardFormatId::FILE ) || + IsDropFormatSupported( SotClipboardFormatId::SOLK ) || + IsDropFormatSupported( SotClipboardFormatId::UNIFORMRESOURCELOCATOR ) || + IsDropFormatSupported( SotClipboardFormatId::NETSCAPE_BOOKMARK ) || + IsDropFormatSupported( SotClipboardFormatId::FILEGRPDESCRIPTOR ) ) { nRet = nMyAction; } @@ -3874,116 +3874,116 @@ sal_Int8 ScGridWindow::AcceptDrop( const AcceptDropEvent& rEvt ) return nRet; } -static sal_uLong lcl_GetDropFormatId( const uno::Reference<datatransfer::XTransferable>& xTransfer, bool bPreferText = false ) +static SotClipboardFormatId lcl_GetDropFormatId( const uno::Reference<datatransfer::XTransferable>& xTransfer, bool bPreferText = false ) { TransferableDataHelper aDataHelper( xTransfer ); - if ( !aDataHelper.HasFormat( SOT_FORMATSTR_ID_SBA_DATAEXCHANGE ) ) + if ( !aDataHelper.HasFormat( SotClipboardFormatId::SBA_DATAEXCHANGE ) ) { // use bookmark formats if no sba is present - if ( aDataHelper.HasFormat( SOT_FORMATSTR_ID_SOLK ) ) - return SOT_FORMATSTR_ID_SOLK; - else if ( aDataHelper.HasFormat( SOT_FORMATSTR_ID_UNIFORMRESOURCELOCATOR ) ) - return SOT_FORMATSTR_ID_UNIFORMRESOURCELOCATOR; - else if ( aDataHelper.HasFormat( SOT_FORMATSTR_ID_NETSCAPE_BOOKMARK ) ) - return SOT_FORMATSTR_ID_NETSCAPE_BOOKMARK; - else if ( aDataHelper.HasFormat( SOT_FORMATSTR_ID_FILEGRPDESCRIPTOR ) ) - return SOT_FORMATSTR_ID_FILEGRPDESCRIPTOR; + if ( aDataHelper.HasFormat( SotClipboardFormatId::SOLK ) ) + return SotClipboardFormatId::SOLK; + else if ( aDataHelper.HasFormat( SotClipboardFormatId::UNIFORMRESOURCELOCATOR ) ) + return SotClipboardFormatId::UNIFORMRESOURCELOCATOR; + else if ( aDataHelper.HasFormat( SotClipboardFormatId::NETSCAPE_BOOKMARK ) ) + return SotClipboardFormatId::NETSCAPE_BOOKMARK; + else if ( aDataHelper.HasFormat( SotClipboardFormatId::FILEGRPDESCRIPTOR ) ) + return SotClipboardFormatId::FILEGRPDESCRIPTOR; } - sal_uLong nFormatId = 0; - if ( aDataHelper.HasFormat( SOT_FORMATSTR_ID_DRAWING ) ) - nFormatId = SOT_FORMATSTR_ID_DRAWING; - else if ( aDataHelper.HasFormat( SOT_FORMATSTR_ID_SVXB ) ) - nFormatId = SOT_FORMATSTR_ID_SVXB; - else if ( aDataHelper.HasFormat( SOT_FORMATSTR_ID_EMBED_SOURCE ) ) + SotClipboardFormatId nFormatId = SotClipboardFormatId::NONE; + if ( aDataHelper.HasFormat( SotClipboardFormatId::DRAWING ) ) + nFormatId = SotClipboardFormatId::DRAWING; + else if ( aDataHelper.HasFormat( SotClipboardFormatId::SVXB ) ) + nFormatId = SotClipboardFormatId::SVXB; + else if ( aDataHelper.HasFormat( SotClipboardFormatId::EMBED_SOURCE ) ) { // If it's a Writer object, insert RTF instead of OLE bool bDoRtf = false; SotStorageStreamRef xStm; TransferableObjectDescriptor aObjDesc; - if( aDataHelper.GetTransferableObjectDescriptor( SOT_FORMATSTR_ID_OBJECTDESCRIPTOR, aObjDesc ) && - aDataHelper.GetSotStorageStream( SOT_FORMATSTR_ID_EMBED_SOURCE, xStm ) ) + if( aDataHelper.GetTransferableObjectDescriptor( SotClipboardFormatId::OBJECTDESCRIPTOR, aObjDesc ) && + aDataHelper.GetSotStorageStream( SotClipboardFormatId::EMBED_SOURCE, xStm ) ) { SotStorageRef xStore( new SotStorage( *xStm ) ); bDoRtf = ( ( aObjDesc.maClassName == SvGlobalName( SO3_SW_CLASSID ) || aObjDesc.maClassName == SvGlobalName( SO3_SWWEB_CLASSID ) ) - && aDataHelper.HasFormat( SOT_FORMAT_RTF ) ); + && aDataHelper.HasFormat( SotClipboardFormatId::RTF ) ); } if ( bDoRtf ) - nFormatId = FORMAT_RTF; + nFormatId = SotClipboardFormatId::RTF; else - nFormatId = SOT_FORMATSTR_ID_EMBED_SOURCE; - } - else if ( aDataHelper.HasFormat( SOT_FORMATSTR_ID_LINK_SOURCE ) ) - nFormatId = SOT_FORMATSTR_ID_LINK_SOURCE; - else if ( aDataHelper.HasFormat( SOT_FORMATSTR_ID_SBA_DATAEXCHANGE ) ) - nFormatId = SOT_FORMATSTR_ID_SBA_DATAEXCHANGE; - else if ( aDataHelper.HasFormat( SOT_FORMATSTR_ID_SBA_FIELDDATAEXCHANGE ) ) - nFormatId = SOT_FORMATSTR_ID_SBA_FIELDDATAEXCHANGE; - else if ( aDataHelper.HasFormat( SOT_FORMATSTR_ID_BIFF_8 ) ) - nFormatId = SOT_FORMATSTR_ID_BIFF_8; - else if ( aDataHelper.HasFormat( SOT_FORMATSTR_ID_BIFF_5 ) ) - nFormatId = SOT_FORMATSTR_ID_BIFF_5; - else if ( aDataHelper.HasFormat( SOT_FORMATSTR_ID_EMBED_SOURCE_OLE ) ) - nFormatId = SOT_FORMATSTR_ID_EMBED_SOURCE_OLE; - else if ( aDataHelper.HasFormat( SOT_FORMATSTR_ID_EMBEDDED_OBJ_OLE ) ) - nFormatId = SOT_FORMATSTR_ID_EMBEDDED_OBJ_OLE; - else if ( aDataHelper.HasFormat( SOT_FORMATSTR_ID_LINK_SOURCE_OLE ) ) - nFormatId = SOT_FORMATSTR_ID_LINK_SOURCE_OLE; - else if ( aDataHelper.HasFormat( SOT_FORMAT_RTF ) ) - nFormatId = SOT_FORMAT_RTF; - else if ( aDataHelper.HasFormat( SOT_FORMATSTR_ID_HTML ) ) - nFormatId = SOT_FORMATSTR_ID_HTML; - else if ( aDataHelper.HasFormat( SOT_FORMATSTR_ID_HTML_SIMPLE ) ) - nFormatId = SOT_FORMATSTR_ID_HTML_SIMPLE; - else if ( aDataHelper.HasFormat( SOT_FORMATSTR_ID_SYLK ) ) - nFormatId = SOT_FORMATSTR_ID_SYLK; - else if ( aDataHelper.HasFormat( SOT_FORMATSTR_ID_LINK ) ) - nFormatId = SOT_FORMATSTR_ID_LINK; - else if ( bPreferText && aDataHelper.HasFormat( SOT_FORMAT_STRING ) ) // #i86734# the behaviour introduced in #i62773# is wrong when pasting - nFormatId = SOT_FORMAT_STRING; - else if ( aDataHelper.HasFormat( SOT_FORMAT_FILE_LIST ) ) - nFormatId = SOT_FORMAT_FILE_LIST; - else if ( aDataHelper.HasFormat( SOT_FORMAT_FILE ) ) // #i62773# FILE_LIST/FILE before STRING (Unix file managers) - nFormatId = SOT_FORMAT_FILE; - else if ( aDataHelper.HasFormat( SOT_FORMAT_STRING ) ) - nFormatId = SOT_FORMAT_STRING; - else if ( aDataHelper.HasFormat( SOT_FORMAT_GDIMETAFILE ) ) - nFormatId = SOT_FORMAT_GDIMETAFILE; - else if ( aDataHelper.HasFormat( SOT_FORMATSTR_ID_PNG ) ) - nFormatId = SOT_FORMATSTR_ID_PNG; - else if ( aDataHelper.HasFormat( SOT_FORMAT_BITMAP ) ) - nFormatId = SOT_FORMAT_BITMAP; + nFormatId = SotClipboardFormatId::EMBED_SOURCE; + } + else if ( aDataHelper.HasFormat( SotClipboardFormatId::LINK_SOURCE ) ) + nFormatId = SotClipboardFormatId::LINK_SOURCE; + else if ( aDataHelper.HasFormat( SotClipboardFormatId::SBA_DATAEXCHANGE ) ) + nFormatId = SotClipboardFormatId::SBA_DATAEXCHANGE; + else if ( aDataHelper.HasFormat( SotClipboardFormatId::SBA_FIELDDATAEXCHANGE ) ) + nFormatId = SotClipboardFormatId::SBA_FIELDDATAEXCHANGE; + else if ( aDataHelper.HasFormat( SotClipboardFormatId::BIFF_8 ) ) + nFormatId = SotClipboardFormatId::BIFF_8; + else if ( aDataHelper.HasFormat( SotClipboardFormatId::BIFF_5 ) ) + nFormatId = SotClipboardFormatId::BIFF_5; + else if ( aDataHelper.HasFormat( SotClipboardFormatId::EMBED_SOURCE_OLE ) ) + nFormatId = SotClipboardFormatId::EMBED_SOURCE_OLE; + else if ( aDataHelper.HasFormat( SotClipboardFormatId::EMBEDDED_OBJ_OLE ) ) + nFormatId = SotClipboardFormatId::EMBEDDED_OBJ_OLE; + else if ( aDataHelper.HasFormat( SotClipboardFormatId::LINK_SOURCE_OLE ) ) + nFormatId = SotClipboardFormatId::LINK_SOURCE_OLE; + else if ( aDataHelper.HasFormat( SotClipboardFormatId::RTF ) ) + nFormatId = SotClipboardFormatId::RTF; + else if ( aDataHelper.HasFormat( SotClipboardFormatId::HTML ) ) + nFormatId = SotClipboardFormatId::HTML; + else if ( aDataHelper.HasFormat( SotClipboardFormatId::HTML_SIMPLE ) ) + nFormatId = SotClipboardFormatId::HTML_SIMPLE; + else if ( aDataHelper.HasFormat( SotClipboardFormatId::SYLK ) ) + nFormatId = SotClipboardFormatId::SYLK; + else if ( aDataHelper.HasFormat( SotClipboardFormatId::LINK ) ) + nFormatId = SotClipboardFormatId::LINK; + else if ( bPreferText && aDataHelper.HasFormat( SotClipboardFormatId::STRING ) ) // #i86734# the behaviour introduced in #i62773# is wrong when pasting + nFormatId = SotClipboardFormatId::STRING; + else if ( aDataHelper.HasFormat( SotClipboardFormatId::FILE_LIST ) ) + nFormatId = SotClipboardFormatId::FILE_LIST; + else if ( aDataHelper.HasFormat( SotClipboardFormatId::FILE ) ) // #i62773# FILE_LIST/FILE before STRING (Unix file managers) + nFormatId = SotClipboardFormatId::FILE; + else if ( aDataHelper.HasFormat( SotClipboardFormatId::STRING ) ) + nFormatId = SotClipboardFormatId::STRING; + else if ( aDataHelper.HasFormat( SotClipboardFormatId::GDIMETAFILE ) ) + nFormatId = SotClipboardFormatId::GDIMETAFILE; + else if ( aDataHelper.HasFormat( SotClipboardFormatId::PNG ) ) + nFormatId = SotClipboardFormatId::PNG; + else if ( aDataHelper.HasFormat( SotClipboardFormatId::BITMAP ) ) + nFormatId = SotClipboardFormatId::BITMAP; return nFormatId; } -static sal_uLong lcl_GetDropLinkId( const uno::Reference<datatransfer::XTransferable>& xTransfer ) +static SotClipboardFormatId lcl_GetDropLinkId( const uno::Reference<datatransfer::XTransferable>& xTransfer ) { TransferableDataHelper aDataHelper( xTransfer ); - sal_uLong nFormatId = 0; - if ( aDataHelper.HasFormat( SOT_FORMATSTR_ID_LINK_SOURCE ) ) - nFormatId = SOT_FORMATSTR_ID_LINK_SOURCE; - else if ( aDataHelper.HasFormat( SOT_FORMATSTR_ID_LINK_SOURCE_OLE ) ) - nFormatId = SOT_FORMATSTR_ID_LINK_SOURCE_OLE; - else if ( aDataHelper.HasFormat( SOT_FORMATSTR_ID_LINK ) ) - nFormatId = SOT_FORMATSTR_ID_LINK; - else if ( aDataHelper.HasFormat( SOT_FORMAT_FILE_LIST ) ) - nFormatId = SOT_FORMAT_FILE_LIST; - else if ( aDataHelper.HasFormat( SOT_FORMAT_FILE ) ) - nFormatId = SOT_FORMAT_FILE; - else if ( aDataHelper.HasFormat( SOT_FORMATSTR_ID_SOLK ) ) - nFormatId = SOT_FORMATSTR_ID_SOLK; - else if ( aDataHelper.HasFormat( SOT_FORMATSTR_ID_UNIFORMRESOURCELOCATOR ) ) - nFormatId = SOT_FORMATSTR_ID_UNIFORMRESOURCELOCATOR; - else if ( aDataHelper.HasFormat( SOT_FORMATSTR_ID_NETSCAPE_BOOKMARK ) ) - nFormatId = SOT_FORMATSTR_ID_NETSCAPE_BOOKMARK; - else if ( aDataHelper.HasFormat( SOT_FORMATSTR_ID_FILEGRPDESCRIPTOR ) ) - nFormatId = SOT_FORMATSTR_ID_FILEGRPDESCRIPTOR; + SotClipboardFormatId nFormatId = SotClipboardFormatId::NONE; + if ( aDataHelper.HasFormat( SotClipboardFormatId::LINK_SOURCE ) ) + nFormatId = SotClipboardFormatId::LINK_SOURCE; + else if ( aDataHelper.HasFormat( SotClipboardFormatId::LINK_SOURCE_OLE ) ) + nFormatId = SotClipboardFormatId::LINK_SOURCE_OLE; + else if ( aDataHelper.HasFormat( SotClipboardFormatId::LINK ) ) + nFormatId = SotClipboardFormatId::LINK; + else if ( aDataHelper.HasFormat( SotClipboardFormatId::FILE_LIST ) ) + nFormatId = SotClipboardFormatId::FILE_LIST; + else if ( aDataHelper.HasFormat( SotClipboardFormatId::FILE ) ) + nFormatId = SotClipboardFormatId::FILE; + else if ( aDataHelper.HasFormat( SotClipboardFormatId::SOLK ) ) + nFormatId = SotClipboardFormatId::SOLK; + else if ( aDataHelper.HasFormat( SotClipboardFormatId::UNIFORMRESOURCELOCATOR ) ) + nFormatId = SotClipboardFormatId::UNIFORMRESOURCELOCATOR; + else if ( aDataHelper.HasFormat( SotClipboardFormatId::NETSCAPE_BOOKMARK ) ) + nFormatId = SotClipboardFormatId::NETSCAPE_BOOKMARK; + else if ( aDataHelper.HasFormat( SotClipboardFormatId::FILEGRPDESCRIPTOR ) ) + nFormatId = SotClipboardFormatId::FILEGRPDESCRIPTOR; return nFormatId; } @@ -4445,10 +4445,10 @@ sal_Int8 ScGridWindow::ExecuteDrop( const ExecuteDropEvent& rEvt ) bool bDone = false; - sal_uLong nFormatId = bIsLink ? + SotClipboardFormatId nFormatId = bIsLink ? lcl_GetDropLinkId( rEvt.maDropEvent.Transferable ) : lcl_GetDropFormatId( rEvt.maDropEvent.Transferable ); - if ( nFormatId ) + if ( nFormatId != SotClipboardFormatId::NONE ) { pScMod->SetInExecuteDrop( true ); // #i28468# prevent error messages from PasteDataFormat bPasteIsDrop = true; @@ -4523,8 +4523,8 @@ void ScGridWindow::PasteSelection( const Point& rPosPixel ) uno::Reference<datatransfer::XTransferable> xTransferable = aDataHelper.GetTransferable(); if ( xTransferable.is() ) { - sal_uLong nFormatId = lcl_GetDropFormatId( xTransferable, true ); - if ( nFormatId ) + SotClipboardFormatId nFormatId = lcl_GetDropFormatId( xTransferable, true ); + if ( nFormatId != SotClipboardFormatId::NONE ) { bPasteIsDrop = true; pViewData->GetView()->PasteDataFormat( nFormatId, xTransferable, nPosX, nPosY, &aLogicPos ); diff --git a/sc/source/ui/view/tabvwshb.cxx b/sc/source/ui/view/tabvwshb.cxx index 7e6fd4d5b3fd..edf6eed9103b 100644 --- a/sc/source/ui/view/tabvwshb.cxx +++ b/sc/source/ui/view/tabvwshb.cxx @@ -381,7 +381,7 @@ void ScTabViewShell::ExecDrawIns(SfxRequest& rReq) if(pDescriptorItem) { - //! merge with ScViewFunc::PasteDataFormat (SOT_FORMATSTR_ID_SBA_FIELDDATAEXCHANGE)? + //! merge with ScViewFunc::PasteDataFormat (SotClipboardFormatId::SBA_FIELDDATAEXCHANGE)? ScDrawView* pDrView = GetScDrawView(); SdrPageView* pPageView = pDrView ? pDrView->GetSdrPageView() : NULL; diff --git a/sc/source/ui/view/viewfun3.cxx b/sc/source/ui/view/viewfun3.cxx index 79182b4f5d2f..992e480dd22e 100644 --- a/sc/source/ui/view/viewfun3.cxx +++ b/sc/source/ui/view/viewfun3.cxx @@ -472,13 +472,13 @@ void ScViewFunc::PasteFromSystem() TransferableDataHelper aDataHelper( TransferableDataHelper::CreateFromSystemClipboard( pWin ) ); { - sal_uLong nBiff8 = SotExchange::RegisterFormatName(OUString("Biff8")); - sal_uLong nBiff5 = SotExchange::RegisterFormatName(OUString("Biff5")); + SotClipboardFormatId nBiff8 = SotExchange::RegisterFormatName(OUString("Biff8")); + SotClipboardFormatId nBiff5 = SotExchange::RegisterFormatName(OUString("Biff5")); SotExchangeDest nDestination = SotExchangeDest::SCDOC_FREE_AREA; sal_uInt16 nSourceOptions = EXCHG_IN_ACTION_COPY; - sal_uLong nFormat; // output param for GetExchangeAction - sal_uInt16 nEventAction; // output param for GetExchangeAction + SotClipboardFormatId nFormat; // output param for GetExchangeAction + sal_uInt16 nEventAction; // output param for GetExchangeAction uno::Reference<com::sun::star::datatransfer::XTransferable> xTransferable( aDataHelper.GetXTransferable() ); sal_uInt16 nAction = SotExchange::GetExchangeAction( @@ -486,7 +486,7 @@ void ScViewFunc::PasteFromSystem() nDestination, nSourceOptions, EXCHG_IN_ACTION_DEFAULT, - nFormat, nEventAction, 0, + nFormat, nEventAction, SotClipboardFormatId::NONE, &xTransferable ); if ( nAction != EXCHG_INOUT_ACTION_NONE ) @@ -499,10 +499,10 @@ void ScViewFunc::PasteFromSystem() case EXCHG_OUT_ACTION_INSERT_GDIMETAFILE: case EXCHG_OUT_ACTION_INSERT_BITMAP: case EXCHG_OUT_ACTION_INSERT_GRAPH: - // FORMAT_BITMAP - // SOT_FORMATSTR_ID_PNG - // FORMAT_GDIMETAFILE - // SOT_FORMATSTR_ID_SVXB + // SotClipboardFormatId::BITMAP + // SotClipboardFormatId::PNG + // SotClipboardFormatId::GDIMETAFILE + // SotClipboardFormatId::SVXB PasteFromSystem(nFormat); break; default: @@ -515,19 +515,19 @@ void ScViewFunc::PasteFromSystem() // first SvDraw-model, then drawing // (only one drawing is allowed) - if (aDataHelper.HasFormat( SOT_FORMATSTR_ID_DRAWING )) + if (aDataHelper.HasFormat( SotClipboardFormatId::DRAWING )) { // special case for tables from drawing - if( aDataHelper.HasFormat( SOT_FORMAT_RTF ) ) + if( aDataHelper.HasFormat( SotClipboardFormatId::RTF ) ) { - PasteFromSystem( FORMAT_RTF ); + PasteFromSystem( SotClipboardFormatId::RTF ); } else { - PasteFromSystem( SOT_FORMATSTR_ID_DRAWING ); + PasteFromSystem( SotClipboardFormatId::DRAWING ); } } - else if (aDataHelper.HasFormat( SOT_FORMATSTR_ID_EMBED_SOURCE )) + else if (aDataHelper.HasFormat( SotClipboardFormatId::EMBED_SOURCE )) { // If it's a Writer object, insert RTF instead of OLE @@ -537,45 +537,45 @@ void ScViewFunc::PasteFromSystem() bool bDoRtf = false; TransferableObjectDescriptor aObjDesc; - if( aDataHelper.GetTransferableObjectDescriptor( SOT_FORMATSTR_ID_OBJECTDESCRIPTOR, aObjDesc ) ) + if( aDataHelper.GetTransferableObjectDescriptor( SotClipboardFormatId::OBJECTDESCRIPTOR, aObjDesc ) ) { bDoRtf = ( ( aObjDesc.maClassName == SvGlobalName( SO3_SW_CLASSID ) || aObjDesc.maClassName == SvGlobalName( SO3_SWWEB_CLASSID ) ) - && aDataHelper.HasFormat( SOT_FORMAT_RTF ) ); + && aDataHelper.HasFormat( SotClipboardFormatId::RTF ) ); } if ( bDoRtf ) - PasteFromSystem( FORMAT_RTF ); + PasteFromSystem( SotClipboardFormatId::RTF ); else if ( aObjDesc.maClassName == SvGlobalName( 0,0,0,0,0,0,0,0,0,0,0 ) - && aDataHelper.HasFormat( SOT_FORMATSTR_ID_SYLK )) - PasteFromSystem( SOT_FORMATSTR_ID_SYLK ); + && aDataHelper.HasFormat( SotClipboardFormatId::SYLK )) + PasteFromSystem( SotClipboardFormatId::SYLK ); else - PasteFromSystem( SOT_FORMATSTR_ID_EMBED_SOURCE ); + PasteFromSystem( SotClipboardFormatId::EMBED_SOURCE ); } - else if (aDataHelper.HasFormat( SOT_FORMATSTR_ID_LINK_SOURCE )) - PasteFromSystem( SOT_FORMATSTR_ID_LINK_SOURCE ); + else if (aDataHelper.HasFormat( SotClipboardFormatId::LINK_SOURCE )) + PasteFromSystem( SotClipboardFormatId::LINK_SOURCE ); // the following format can not affect scenario from #89579# - else if (aDataHelper.HasFormat( SOT_FORMATSTR_ID_EMBEDDED_OBJ_OLE )) - PasteFromSystem( SOT_FORMATSTR_ID_EMBEDDED_OBJ_OLE ); - // FORMAT_PRIVATE no longer here (can't work if pOwnClip is NULL) + else if (aDataHelper.HasFormat( SotClipboardFormatId::EMBEDDED_OBJ_OLE )) + PasteFromSystem( SotClipboardFormatId::EMBEDDED_OBJ_OLE ); + // SotClipboardFormatId::PRIVATE no longer here (can't work if pOwnClip is NULL) else if (aDataHelper.HasFormat(nBiff8)) // before xxx_OLE formats PasteFromSystem(nBiff8); else if (aDataHelper.HasFormat(nBiff5)) PasteFromSystem(nBiff5); - else if (aDataHelper.HasFormat(FORMAT_RTF)) - PasteFromSystem(FORMAT_RTF); - else if (aDataHelper.HasFormat(SOT_FORMATSTR_ID_HTML)) - PasteFromSystem(SOT_FORMATSTR_ID_HTML); - else if (aDataHelper.HasFormat(SOT_FORMATSTR_ID_HTML_SIMPLE)) - PasteFromSystem(SOT_FORMATSTR_ID_HTML_SIMPLE); - else if (aDataHelper.HasFormat(SOT_FORMATSTR_ID_SYLK)) - PasteFromSystem(SOT_FORMATSTR_ID_SYLK); - else if (aDataHelper.HasFormat(FORMAT_STRING)) - PasteFromSystem(FORMAT_STRING); + else if (aDataHelper.HasFormat(SotClipboardFormatId::RTF)) + PasteFromSystem(SotClipboardFormatId::RTF); + else if (aDataHelper.HasFormat(SotClipboardFormatId::HTML)) + PasteFromSystem(SotClipboardFormatId::HTML); + else if (aDataHelper.HasFormat(SotClipboardFormatId::HTML_SIMPLE)) + PasteFromSystem(SotClipboardFormatId::HTML_SIMPLE); + else if (aDataHelper.HasFormat(SotClipboardFormatId::SYLK)) + PasteFromSystem(SotClipboardFormatId::SYLK); + else if (aDataHelper.HasFormat(SotClipboardFormatId::STRING)) + PasteFromSystem(SotClipboardFormatId::STRING); // xxx_OLE formats come last, like in SotExchange tables - else if (aDataHelper.HasFormat( SOT_FORMATSTR_ID_EMBED_SOURCE_OLE )) - PasteFromSystem( SOT_FORMATSTR_ID_EMBED_SOURCE_OLE ); - else if (aDataHelper.HasFormat( SOT_FORMATSTR_ID_LINK_SOURCE_OLE )) - PasteFromSystem( SOT_FORMATSTR_ID_LINK_SOURCE_OLE ); + else if (aDataHelper.HasFormat( SotClipboardFormatId::EMBED_SOURCE_OLE )) + PasteFromSystem( SotClipboardFormatId::EMBED_SOURCE_OLE ); + else if (aDataHelper.HasFormat( SotClipboardFormatId::LINK_SOURCE_OLE )) + PasteFromSystem( SotClipboardFormatId::LINK_SOURCE_OLE ); } } } @@ -622,61 +622,61 @@ void ScViewFunc::PasteFromTransferable( const uno::Reference<datatransfer::XTran { TransferableDataHelper aDataHelper( rxTransferable ); { - sal_uLong nBiff8 = SotExchange::RegisterFormatName(OUString("Biff8")); - sal_uLong nBiff5 = SotExchange::RegisterFormatName(OUString("Biff5")); - sal_uLong nFormatId = 0; + SotClipboardFormatId nBiff8 = SotExchange::RegisterFormatName(OUString("Biff8")); + SotClipboardFormatId nBiff5 = SotExchange::RegisterFormatName(OUString("Biff5")); + SotClipboardFormatId nFormatId = SotClipboardFormatId::NONE; // first SvDraw-model, then drawing // (only one drawing is allowed) - if (aDataHelper.HasFormat( SOT_FORMATSTR_ID_DRAWING )) - nFormatId = SOT_FORMATSTR_ID_DRAWING; - else if (aDataHelper.HasFormat( SOT_FORMATSTR_ID_SVXB )) - nFormatId = SOT_FORMATSTR_ID_SVXB; - else if (aDataHelper.HasFormat( SOT_FORMATSTR_ID_EMBED_SOURCE )) + if (aDataHelper.HasFormat( SotClipboardFormatId::DRAWING )) + nFormatId = SotClipboardFormatId::DRAWING; + else if (aDataHelper.HasFormat( SotClipboardFormatId::SVXB )) + nFormatId = SotClipboardFormatId::SVXB; + else if (aDataHelper.HasFormat( SotClipboardFormatId::EMBED_SOURCE )) { // If it's a Writer object, insert RTF instead of OLE bool bDoRtf = false; TransferableObjectDescriptor aObjDesc; - if( aDataHelper.GetTransferableObjectDescriptor( SOT_FORMATSTR_ID_OBJECTDESCRIPTOR, aObjDesc ) ) + if( aDataHelper.GetTransferableObjectDescriptor( SotClipboardFormatId::OBJECTDESCRIPTOR, aObjDesc ) ) { bDoRtf = ( ( aObjDesc.maClassName == SvGlobalName( SO3_SW_CLASSID ) || aObjDesc.maClassName == SvGlobalName( SO3_SWWEB_CLASSID ) ) - && aDataHelper.HasFormat( SOT_FORMAT_RTF ) ); + && aDataHelper.HasFormat( SotClipboardFormatId::RTF ) ); } if ( bDoRtf ) - nFormatId = FORMAT_RTF; + nFormatId = SotClipboardFormatId::RTF; else - nFormatId = SOT_FORMATSTR_ID_EMBED_SOURCE; + nFormatId = SotClipboardFormatId::EMBED_SOURCE; } - else if (aDataHelper.HasFormat( SOT_FORMATSTR_ID_LINK_SOURCE )) - nFormatId = SOT_FORMATSTR_ID_LINK_SOURCE; + else if (aDataHelper.HasFormat( SotClipboardFormatId::LINK_SOURCE )) + nFormatId = SotClipboardFormatId::LINK_SOURCE; // the following format can not affect scenario from #89579# - else if (aDataHelper.HasFormat( SOT_FORMATSTR_ID_EMBEDDED_OBJ_OLE )) - nFormatId = SOT_FORMATSTR_ID_EMBEDDED_OBJ_OLE; - // FORMAT_PRIVATE no longer here (can't work if pOwnClip is NULL) + else if (aDataHelper.HasFormat( SotClipboardFormatId::EMBEDDED_OBJ_OLE )) + nFormatId = SotClipboardFormatId::EMBEDDED_OBJ_OLE; + // SotClipboardFormatId::PRIVATE no longer here (can't work if pOwnClip is NULL) else if (aDataHelper.HasFormat(nBiff8)) // before xxx_OLE formats nFormatId = nBiff8; else if (aDataHelper.HasFormat(nBiff5)) nFormatId = nBiff5; - else if (aDataHelper.HasFormat(FORMAT_RTF)) - nFormatId = FORMAT_RTF; - else if (aDataHelper.HasFormat(SOT_FORMATSTR_ID_HTML)) - nFormatId = SOT_FORMATSTR_ID_HTML; - else if (aDataHelper.HasFormat(SOT_FORMATSTR_ID_HTML_SIMPLE)) - nFormatId = SOT_FORMATSTR_ID_HTML_SIMPLE; - else if (aDataHelper.HasFormat(SOT_FORMATSTR_ID_SYLK)) - nFormatId = SOT_FORMATSTR_ID_SYLK; - else if (aDataHelper.HasFormat(FORMAT_STRING)) - nFormatId = FORMAT_STRING; - else if (aDataHelper.HasFormat(FORMAT_GDIMETAFILE)) - nFormatId = FORMAT_GDIMETAFILE; - else if (aDataHelper.HasFormat(FORMAT_BITMAP)) - nFormatId = FORMAT_BITMAP; + else if (aDataHelper.HasFormat(SotClipboardFormatId::RTF)) + nFormatId = SotClipboardFormatId::RTF; + else if (aDataHelper.HasFormat(SotClipboardFormatId::HTML)) + nFormatId = SotClipboardFormatId::HTML; + else if (aDataHelper.HasFormat(SotClipboardFormatId::HTML_SIMPLE)) + nFormatId = SotClipboardFormatId::HTML_SIMPLE; + else if (aDataHelper.HasFormat(SotClipboardFormatId::SYLK)) + nFormatId = SotClipboardFormatId::SYLK; + else if (aDataHelper.HasFormat(SotClipboardFormatId::STRING)) + nFormatId = SotClipboardFormatId::STRING; + else if (aDataHelper.HasFormat(SotClipboardFormatId::GDIMETAFILE)) + nFormatId = SotClipboardFormatId::GDIMETAFILE; + else if (aDataHelper.HasFormat(SotClipboardFormatId::BITMAP)) + nFormatId = SotClipboardFormatId::BITMAP; // xxx_OLE formats come last, like in SotExchange tables - else if (aDataHelper.HasFormat( SOT_FORMATSTR_ID_EMBED_SOURCE_OLE )) - nFormatId = SOT_FORMATSTR_ID_EMBED_SOURCE_OLE; - else if (aDataHelper.HasFormat( SOT_FORMATSTR_ID_LINK_SOURCE_OLE )) - nFormatId = SOT_FORMATSTR_ID_LINK_SOURCE_OLE; + else if (aDataHelper.HasFormat( SotClipboardFormatId::EMBED_SOURCE_OLE )) + nFormatId = SotClipboardFormatId::EMBED_SOURCE_OLE; + else if (aDataHelper.HasFormat( SotClipboardFormatId::LINK_SOURCE_OLE )) + nFormatId = SotClipboardFormatId::LINK_SOURCE_OLE; else return; @@ -687,14 +687,14 @@ void ScViewFunc::PasteFromTransferable( const uno::Reference<datatransfer::XTran } } -bool ScViewFunc::PasteFromSystem( sal_uLong nFormatId, bool bApi ) +bool ScViewFunc::PasteFromSystem( SotClipboardFormatId nFormatId, bool bApi ) { UpdateInputLine(); bool bRet = true; vcl::Window* pWin = GetActiveWin(); ScTransferObj* pOwnClip = ScTransferObj::GetOwnClipboard( pWin ); - if ( nFormatId == 0 && pOwnClip ) + if ( nFormatId == SotClipboardFormatId::NONE && pOwnClip ) { // keep a reference in case the clipboard is changed during PasteFromClip uno::Reference<datatransfer::XTransferable> aOwnClipRef( pOwnClip ); @@ -742,12 +742,12 @@ bool ScViewFunc::PasteOnDrawObjectLinked( { TransferableDataHelper aDataHelper( rxTransferable ); - if ( aDataHelper.HasFormat( SOT_FORMATSTR_ID_SVXB ) ) + if ( aDataHelper.HasFormat( SotClipboardFormatId::SVXB ) ) { SotStorageStreamRef xStm; ScDrawView* pScDrawView = GetScDrawView(); - if( pScDrawView && aDataHelper.GetSotStorageStream( SOT_FORMATSTR_ID_SVXB, xStm ) ) + if( pScDrawView && aDataHelper.GetSotStorageStream( SotClipboardFormatId::SVXB, xStm ) ) { Graphic aGraphic; @@ -762,12 +762,12 @@ bool ScViewFunc::PasteOnDrawObjectLinked( } } } - else if ( aDataHelper.HasFormat( SOT_FORMAT_GDIMETAFILE ) ) + else if ( aDataHelper.HasFormat( SotClipboardFormatId::GDIMETAFILE ) ) { GDIMetaFile aMtf; ScDrawView* pScDrawView = GetScDrawView(); - if( pScDrawView && aDataHelper.GetGDIMetaFile( FORMAT_GDIMETAFILE, aMtf ) ) + if( pScDrawView && aDataHelper.GetGDIMetaFile( SotClipboardFormatId::GDIMETAFILE, aMtf ) ) { const OUString aEmpty; const OUString aBeginUndo(ScGlobal::GetRscString(STR_UNDO_DRAGDROP)); @@ -778,12 +778,12 @@ bool ScViewFunc::PasteOnDrawObjectLinked( } } } - else if ( aDataHelper.HasFormat( SOT_FORMAT_BITMAP ) || aDataHelper.HasFormat( SOT_FORMATSTR_ID_PNG ) ) + else if ( aDataHelper.HasFormat( SotClipboardFormatId::BITMAP ) || aDataHelper.HasFormat( SotClipboardFormatId::PNG ) ) { BitmapEx aBmpEx; ScDrawView* pScDrawView = GetScDrawView(); - if( pScDrawView && aDataHelper.GetBitmapEx( FORMAT_BITMAP, aBmpEx ) ) + if( pScDrawView && aDataHelper.GetBitmapEx( SotClipboardFormatId::BITMAP, aBmpEx ) ) { const OUString aEmpty; const OUString aBeginUndo(ScGlobal::GetRscString(STR_UNDO_DRAGDROP)); diff --git a/sc/source/ui/view/viewfun4.cxx b/sc/source/ui/view/viewfun4.cxx index f4ad744a3637..f9d054cfb8f0 100644 --- a/sc/source/ui/view/viewfun4.cxx +++ b/sc/source/ui/view/viewfun4.cxx @@ -82,7 +82,7 @@ void ScViewFunc::PasteRTF( SCCOL nStartCol, SCROW nStartRow, ::com::sun::star::datatransfer::XTransferable >& rxTransferable ) { TransferableDataHelper aDataHelper( rxTransferable ); - if ( aDataHelper.HasFormat( SOT_FORMATSTR_ID_EDITENGINE ) ) + if ( aDataHelper.HasFormat( SotClipboardFormatId::EDITENGINE ) ) { HideAllCursors(); @@ -165,11 +165,11 @@ void ScViewFunc::PasteRTF( SCCOL nStartCol, SCROW nStartRow, OUString aStr; SotStorageStreamRef xStream; - if ( aDataHelper.GetSotStorageStream( SOT_FORMAT_RTF, xStream ) && xStream.Is() ) + if ( aDataHelper.GetSotStorageStream( SotClipboardFormatId::RTF, xStream ) && xStream.Is() ) // mba: clipboard always must contain absolute URLs (could be from alien source) - aImpEx.ImportStream( *xStream, OUString(), SOT_FORMAT_RTF ); - else if ( aDataHelper.GetString( SOT_FORMAT_RTF, aStr ) ) - aImpEx.ImportString( aStr, SOT_FORMAT_RTF ); + aImpEx.ImportStream( *xStream, OUString(), SotClipboardFormatId::RTF ); + else if ( aDataHelper.GetString( SotClipboardFormatId::RTF, aStr ) ) + aImpEx.ImportString( aStr, SotClipboardFormatId::RTF ); AdjustRowHeight( nStartRow, aImpEx.GetRange().aEnd.Row() ); pDocSh->UpdateOle(&GetViewData()); @@ -564,7 +564,7 @@ void ScViewFunc::DoSheetConversion( const ScConversionParam& rConvParam, bool bR rDoc.EnableIdle(bOldEnabled); } -// Pasten von FORMAT_FILE-Items +// Pasten von SotClipboardFormatId::FILE-Items // wird nicht direkt aus Drop aufgerufen, sondern asynchron -> Dialoge sind erlaubt bool ScViewFunc::PasteFile( const Point& rPos, const OUString& rFile, bool bLink ) @@ -669,7 +669,7 @@ bool ScViewFunc::PasteFile( const Point& rPos, const OUString& rFile, bool bLink } } -bool ScViewFunc::PasteBookmark( sal_uLong nFormatId, +bool ScViewFunc::PasteBookmark( SotClipboardFormatId nFormatId, const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >& rxTransferable, SCCOL nPosX, SCROW nPosY ) diff --git a/sc/source/ui/view/viewfun5.cxx b/sc/source/ui/view/viewfun5.cxx index 983a39ed922f..08c9f9e9b029 100644 --- a/sc/source/ui/view/viewfun5.cxx +++ b/sc/source/ui/view/viewfun5.cxx @@ -70,7 +70,7 @@ using namespace com::sun::star; -bool ScViewFunc::PasteDataFormat( sal_uLong nFormatId, +bool ScViewFunc::PasteDataFormat( SotClipboardFormatId nFormatId, const uno::Reference<datatransfer::XTransferable>& rxTransferable, SCCOL nPosX, SCROW nPosY, Point* pLogicPos, bool bLink, bool bAllowDialogs ) { @@ -84,7 +84,7 @@ bool ScViewFunc::PasteDataFormat( sal_uLong nFormatId, { // inserting position isn't needed for text formats bool bIsTextFormat = ( ScImportExport::IsFormatSupported( nFormatId ) || - nFormatId == FORMAT_RTF ); + nFormatId == SotClipboardFormatId::RTF ); if ( !bIsTextFormat ) { // Window MapMode isn't drawing MapMode if DrawingLayer hasn't been created yet @@ -105,16 +105,16 @@ bool ScViewFunc::PasteDataFormat( sal_uLong nFormatId, // handle individual formats - if ( nFormatId == SOT_FORMATSTR_ID_EMBED_SOURCE || - nFormatId == SOT_FORMATSTR_ID_LINK_SOURCE || - nFormatId == SOT_FORMATSTR_ID_EMBED_SOURCE_OLE || - nFormatId == SOT_FORMATSTR_ID_LINK_SOURCE_OLE || - nFormatId == SOT_FORMATSTR_ID_EMBEDDED_OBJ_OLE ) + if ( nFormatId == SotClipboardFormatId::EMBED_SOURCE || + nFormatId == SotClipboardFormatId::LINK_SOURCE || + nFormatId == SotClipboardFormatId::EMBED_SOURCE_OLE || + nFormatId == SotClipboardFormatId::LINK_SOURCE_OLE || + nFormatId == SotClipboardFormatId::EMBEDDED_OBJ_OLE ) { uno::Reference < io::XInputStream > xStm; TransferableObjectDescriptor aObjDesc; - if (aDataHelper.GetTransferableObjectDescriptor(SOT_FORMATSTR_ID_OBJECTDESCRIPTOR, aObjDesc)) + if (aDataHelper.GetTransferableObjectDescriptor(SotClipboardFormatId::OBJECTDESCRIPTOR, aObjDesc)) xStm = aDataHelper.GetInputStream(nFormatId, OUString()); if (xStm.is()) @@ -174,18 +174,18 @@ bool ScViewFunc::PasteDataFormat( sal_uLong nFormatId, { // try to get the replacement image from the clipboard Graphic aGraphic; - sal_uLong nGrFormat = 0; + SotClipboardFormatId nGrFormat = SotClipboardFormatId::NONE; // limit the size of the preview metafile to 100000 actions GDIMetaFile aMetafile; - if (aDataHelper.GetGDIMetaFile(FORMAT_GDIMETAFILE, aMetafile, 100000)) + if (aDataHelper.GetGDIMetaFile(SotClipboardFormatId::GDIMETAFILE, aMetafile, 100000)) { - nGrFormat = SOT_FORMAT_GDIMETAFILE; + nGrFormat = SotClipboardFormatId::GDIMETAFILE; aGraphic = aMetafile; } // insert replacement image ( if there is one ) into the object helper - if ( nGrFormat ) + if ( nGrFormat != SotClipboardFormatId::NONE ) { datatransfer::DataFlavor aDataFlavor; SotExchange::GetFormatDataFlavor( nGrFormat, aDataFlavor ); @@ -204,13 +204,13 @@ bool ScViewFunc::PasteDataFormat( sal_uLong nFormatId, } else { - if ( aDataHelper.GetTransferableObjectDescriptor( SOT_FORMATSTR_ID_OBJECTDESCRIPTOR_OLE, aObjDesc ) ) + if ( aDataHelper.GetTransferableObjectDescriptor( SotClipboardFormatId::OBJECTDESCRIPTOR_OLE, aObjDesc ) ) { OUString aName; uno::Reference < embed::XEmbeddedObject > xObj; - xStm = aDataHelper.GetInputStream(SOT_FORMATSTR_ID_EMBED_SOURCE_OLE, OUString()); + xStm = aDataHelper.GetInputStream(SotClipboardFormatId::EMBED_SOURCE_OLE, OUString()); if (!xStm.is()) - aDataHelper.GetInputStream(SOT_FORMATSTR_ID_EMBEDDED_OBJ_OLE, OUString()); + aDataHelper.GetInputStream(SotClipboardFormatId::EMBEDDED_OBJ_OLE, OUString()); if (xStm.is()) { @@ -243,20 +243,20 @@ bool ScViewFunc::PasteDataFormat( sal_uLong nFormatId, { // try to get the replacement image from the clipboard Graphic aGraphic; - sal_uLong nGrFormat = 0; + SotClipboardFormatId nGrFormat = SotClipboardFormatId::NONE; // (wg. Selection Manager bei Trustet Solaris) #ifndef SOLARIS - if( aDataHelper.GetGraphic( SOT_FORMATSTR_ID_SVXB, aGraphic ) ) - nGrFormat = SOT_FORMATSTR_ID_SVXB; - else if( aDataHelper.GetGraphic( FORMAT_GDIMETAFILE, aGraphic ) ) - nGrFormat = SOT_FORMAT_GDIMETAFILE; - else if( aDataHelper.GetGraphic( FORMAT_BITMAP, aGraphic ) ) - nGrFormat = SOT_FORMAT_BITMAP; + if( aDataHelper.GetGraphic( SotClipboardFormatId::SVXB, aGraphic ) ) + nGrFormat = SotClipboardFormatId::SVXB; + else if( aDataHelper.GetGraphic( SotClipboardFormatId::GDIMETAFILE, aGraphic ) ) + nGrFormat = SotClipboardFormatId::GDIMETAFILE; + else if( aDataHelper.GetGraphic( SotClipboardFormatId::BITMAP, aGraphic ) ) + nGrFormat = SotClipboardFormatId::BITMAP; #endif // insert replacement image ( if there is one ) into the object helper - if ( nGrFormat ) + if ( nGrFormat != SotClipboardFormatId::NONE ) { datatransfer::DataFlavor aDataFlavor; SotExchange::GetFormatDataFlavor( nGrFormat, aDataFlavor ); @@ -277,13 +277,13 @@ bool ScViewFunc::PasteDataFormat( sal_uLong nFormatId, //TODO/LATER: if format is not available, create picture } } - else if ( nFormatId == SOT_FORMATSTR_ID_LINK ) // LINK is also in ScImportExport + else if ( nFormatId == SotClipboardFormatId::LINK ) // LINK is also in ScImportExport { bRet = PasteLink( rxTransferable ); } - else if ( ScImportExport::IsFormatSupported( nFormatId ) || nFormatId == SOT_FORMAT_RTF ) + else if ( ScImportExport::IsFormatSupported( nFormatId ) || nFormatId == SotClipboardFormatId::RTF ) { - if ( nFormatId == SOT_FORMAT_RTF && aDataHelper.HasFormat( SOT_FORMATSTR_ID_EDITENGINE ) ) + if ( nFormatId == SotClipboardFormatId::RTF && aDataHelper.HasFormat( SotClipboardFormatId::EDITENGINE ) ) { // use EditView's PasteSpecial / Drop PasteRTF( nPosX, nPosY, rxTransferable ); @@ -299,7 +299,7 @@ bool ScViewFunc::PasteDataFormat( sal_uLong nFormatId, SotStorageStreamRef xStream; if ( aDataHelper.GetSotStorageStream( nFormatId, xStream ) && xStream.Is() ) { - if (nFormatId == SOT_FORMATSTR_ID_HTML) + if (nFormatId == SotClipboardFormatId::HTML) { // Launch the text import options dialog. For now, we do // this for html pasting only, but in the future it may @@ -325,7 +325,7 @@ bool ScViewFunc::PasteDataFormat( sal_uLong nFormatId, bRet = aObj.ImportStream( *xStream, OUString(), nFormatId ); // mba: clipboard always must contain absolute URLs (could be from alien source) } - else if (nFormatId == FORMAT_STRING && aDataHelper.GetString( nFormatId, aStr )) + else if (nFormatId == SotClipboardFormatId::STRING && aDataHelper.GetString( nFormatId, aStr )) { // Do CSV dialog if more than one line. sal_Int32 nDelim = aStr.indexOf('\n'); @@ -361,14 +361,14 @@ bool ScViewFunc::PasteDataFormat( sal_uLong nFormatId, else bRet = aObj.ImportString( aStr, nFormatId ); } - else if (nFormatId != FORMAT_STRING && aDataHelper.GetString( nFormatId, aStr )) + else if (nFormatId != SotClipboardFormatId::STRING && aDataHelper.GetString( nFormatId, aStr )) bRet = aObj.ImportString( aStr, nFormatId ); InvalidateAttribs(); GetViewData().UpdateInputHandler(); } } - else if (nFormatId == SOT_FORMATSTR_ID_SBA_DATAEXCHANGE) + else if (nFormatId == SotClipboardFormatId::SBA_DATAEXCHANGE) { // import of database data into table @@ -412,7 +412,7 @@ bool ScViewFunc::PasteDataFormat( sal_uLong nFormatId, bRet = true; } } - else if (nFormatId == SOT_FORMATSTR_ID_SBA_FIELDDATAEXCHANGE) + else if (nFormatId == SotClipboardFormatId::SBA_FIELDDATAEXCHANGE) { // insert database field control @@ -457,32 +457,32 @@ bool ScViewFunc::PasteDataFormat( sal_uLong nFormatId, } } } - else if (nFormatId == SOT_FORMAT_BITMAP || nFormatId == SOT_FORMATSTR_ID_PNG) + else if (nFormatId == SotClipboardFormatId::BITMAP || nFormatId == SotClipboardFormatId::PNG) { BitmapEx aBmpEx; - if( aDataHelper.GetBitmapEx( FORMAT_BITMAP, aBmpEx ) ) + if( aDataHelper.GetBitmapEx( SotClipboardFormatId::BITMAP, aBmpEx ) ) bRet = PasteBitmapEx( aPos, aBmpEx ); } - else if (nFormatId == SOT_FORMAT_GDIMETAFILE) + else if (nFormatId == SotClipboardFormatId::GDIMETAFILE) { GDIMetaFile aMtf; - if( aDataHelper.GetGDIMetaFile( FORMAT_GDIMETAFILE, aMtf ) ) + if( aDataHelper.GetGDIMetaFile( SotClipboardFormatId::GDIMETAFILE, aMtf ) ) bRet = PasteMetaFile( aPos, aMtf ); } - else if (nFormatId == SOT_FORMATSTR_ID_SVXB) + else if (nFormatId == SotClipboardFormatId::SVXB) { SotStorageStreamRef xStm; - if( aDataHelper.GetSotStorageStream( SOT_FORMATSTR_ID_SVXB, xStm ) ) + if( aDataHelper.GetSotStorageStream( SotClipboardFormatId::SVXB, xStm ) ) { Graphic aGraphic; ReadGraphic( *xStm, aGraphic ); bRet = PasteGraphic( aPos, aGraphic, EMPTY_OUSTRING, EMPTY_OUSTRING ); } } - else if ( nFormatId == SOT_FORMATSTR_ID_DRAWING ) + else if ( nFormatId == SotClipboardFormatId::DRAWING ) { SotStorageStreamRef xStm; - if( aDataHelper.GetSotStorageStream( SOT_FORMATSTR_ID_DRAWING, xStm ) ) + if( aDataHelper.GetSotStorageStream( SotClipboardFormatId::DRAWING, xStm ) ) { MakeDrawLayer(); // before loading model, so 3D factory has been created @@ -525,7 +525,7 @@ bool ScViewFunc::PasteDataFormat( sal_uLong nFormatId, bRet = true; } } - else if ( (nFormatId == SOT_FORMATSTR_ID_BIFF_5) || (nFormatId == SOT_FORMATSTR_ID_BIFF_8) ) + else if ( (nFormatId == SotClipboardFormatId::BIFF_5) || (nFormatId == SotClipboardFormatId::BIFF_8) ) { // do excel import into a clipboard document //TODO/MBA: testing @@ -586,13 +586,13 @@ bool ScViewFunc::PasteDataFormat( sal_uLong nFormatId, } } } - else if ( nFormatId == SOT_FORMAT_FILE ) + else if ( nFormatId == SotClipboardFormatId::FILE ) { OUString aFile; if ( aDataHelper.GetString( nFormatId, aFile ) ) bRet = PasteFile( aPos, aFile, bLink ); } - else if ( nFormatId == SOT_FORMAT_FILE_LIST ) + else if ( nFormatId == SotClipboardFormatId::FILE_LIST ) { FileList aFileList; if ( aDataHelper.GetFileList( nFormatId, aFileList ) ) @@ -610,10 +610,10 @@ bool ScViewFunc::PasteDataFormat( sal_uLong nFormatId, bRet = true; } } - else if ( nFormatId == SOT_FORMATSTR_ID_SOLK || - nFormatId == SOT_FORMATSTR_ID_UNIFORMRESOURCELOCATOR || - nFormatId == SOT_FORMATSTR_ID_NETSCAPE_BOOKMARK || - nFormatId == SOT_FORMATSTR_ID_FILEGRPDESCRIPTOR ) + else if ( nFormatId == SotClipboardFormatId::SOLK || + nFormatId == SotClipboardFormatId::UNIFORMRESOURCELOCATOR || + nFormatId == SotClipboardFormatId::NETSCAPE_BOOKMARK || + nFormatId == SotClipboardFormatId::FILEGRPDESCRIPTOR ) { bRet = PasteBookmark( nFormatId, rxTransferable, nPosX, nPosY ); } @@ -630,7 +630,7 @@ bool ScViewFunc::PasteLink( const uno::Reference<datatransfer::XTransferable>& r // get link data from transferable before string data, // so the source knows it will be used for a link - uno::Sequence<sal_Int8> aSequence = aDataHelper.GetSequence(SOT_FORMATSTR_ID_LINK, OUString()); + uno::Sequence<sal_Int8> aSequence = aDataHelper.GetSequence(SotClipboardFormatId::LINK, OUString()); if (!aSequence.getLength()) { OSL_FAIL("DDE Data not found."); @@ -641,10 +641,10 @@ bool ScViewFunc::PasteLink( const uno::Reference<datatransfer::XTransferable>& r sal_uInt16 nCols = 1; sal_uInt16 nRows = 1; - if ( aDataHelper.HasFormat( SOT_FORMAT_STRING ) ) + if ( aDataHelper.HasFormat( SotClipboardFormatId::STRING ) ) { OUString aDataStr; - if ( aDataHelper.GetString( SOT_FORMAT_STRING, aDataStr ) ) + if ( aDataHelper.GetString( SotClipboardFormatId::STRING, aDataStr ) ) { // get size from string the same way as in ScDdeLink::DataChanged |