From fb14be5f8f74f83ba89e15f891ddf1f753dcc62f Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 12 Mar 2015 14:53:28 +0200 Subject: create new 'enum class' SotClipboardFormatId to unify types of which there are several. There are some issues here I am unsure of - the SW and SC and CHART2 modules essentially ignore the enum values and assign their own ids Perhaps I should change them to use the common values and create new enum values where necessary? - the sc/qa/ and sq/qa/ and starmath/qa/ code was doing some dodgy stuff. I translated the code to pass down the stuff numeric values to the underlying code, but perhaps further fixing is necessary? Change-Id: Ic06d723e404481e3f1bca67c43b70321b764d923 --- filter/qa/cppunit/filters-dxf-test.cxx | 4 ++-- filter/qa/cppunit/filters-eps-test.cxx | 4 ++-- filter/qa/cppunit/filters-met-test.cxx | 4 ++-- filter/qa/cppunit/filters-pcd-test.cxx | 4 ++-- filter/qa/cppunit/filters-pcx-test.cxx | 4 ++-- filter/qa/cppunit/filters-pict-test.cxx | 4 ++-- filter/qa/cppunit/filters-ppm-test.cxx | 4 ++-- filter/qa/cppunit/filters-psd-test.cxx | 4 ++-- filter/qa/cppunit/filters-ras-test.cxx | 4 ++-- filter/qa/cppunit/filters-tga-test.cxx | 4 ++-- filter/qa/cppunit/filters-tiff-test.cxx | 4 ++-- filter/source/msfilter/msdffimp.cxx | 10 +++++----- filter/source/msfilter/msoleexp.cxx | 2 +- filter/source/msfilter/viscache.hxx | 30 +++++++++++++++--------------- 14 files changed, 43 insertions(+), 43 deletions(-) (limited to 'filter') diff --git a/filter/qa/cppunit/filters-dxf-test.cxx b/filter/qa/cppunit/filters-dxf-test.cxx index 1d78a6188954..8d5be38adfe0 100644 --- a/filter/qa/cppunit/filters-dxf-test.cxx +++ b/filter/qa/cppunit/filters-dxf-test.cxx @@ -36,7 +36,7 @@ public: virtual bool load(const OUString &, const OUString &rURL, const OUString &, - unsigned int, unsigned int, unsigned int) SAL_OVERRIDE; + unsigned int, SotClipboardFormatId, unsigned int) SAL_OVERRIDE; /** * Ensure CVEs remain unbroken @@ -50,7 +50,7 @@ public: bool DxfFilterTest::load(const OUString &, const OUString &rURL, const OUString &, - unsigned int, unsigned int, unsigned int) + unsigned int, SotClipboardFormatId, unsigned int) { SvFileStream aFileStream(rURL, StreamMode::READ); Graphic aGraphic; diff --git a/filter/qa/cppunit/filters-eps-test.cxx b/filter/qa/cppunit/filters-eps-test.cxx index 2167281352b6..2cab8cdbc6bf 100644 --- a/filter/qa/cppunit/filters-eps-test.cxx +++ b/filter/qa/cppunit/filters-eps-test.cxx @@ -36,7 +36,7 @@ public: virtual bool load(const OUString &, const OUString &rURL, const OUString &, - unsigned int, unsigned int, unsigned int) SAL_OVERRIDE; + unsigned int, SotClipboardFormatId, unsigned int) SAL_OVERRIDE; /** * Ensure CVEs remain unbroken @@ -50,7 +50,7 @@ public: bool EpsFilterTest::load(const OUString &, const OUString &rURL, const OUString &, - unsigned int, unsigned int, unsigned int) + unsigned int, SotClipboardFormatId, unsigned int) { SvFileStream aFileStream(rURL, StreamMode::READ); Graphic aGraphic; diff --git a/filter/qa/cppunit/filters-met-test.cxx b/filter/qa/cppunit/filters-met-test.cxx index 4e551d24e06a..69ced464d739 100644 --- a/filter/qa/cppunit/filters-met-test.cxx +++ b/filter/qa/cppunit/filters-met-test.cxx @@ -36,7 +36,7 @@ public: virtual bool load(const OUString &, const OUString &rURL, const OUString &, - unsigned int, unsigned int, unsigned int) SAL_OVERRIDE; + unsigned int, SotClipboardFormatId, unsigned int) SAL_OVERRIDE; /** * Ensure CVEs remain unbroken @@ -50,7 +50,7 @@ public: bool MetFilterTest::load(const OUString &, const OUString &rURL, const OUString &, - unsigned int, unsigned int, unsigned int) + unsigned int, SotClipboardFormatId, unsigned int) { SvFileStream aFileStream(rURL, StreamMode::READ); Graphic aGraphic; diff --git a/filter/qa/cppunit/filters-pcd-test.cxx b/filter/qa/cppunit/filters-pcd-test.cxx index 1658f4cf0c05..16fbefbbad7b 100644 --- a/filter/qa/cppunit/filters-pcd-test.cxx +++ b/filter/qa/cppunit/filters-pcd-test.cxx @@ -36,7 +36,7 @@ public: virtual bool load(const OUString &, const OUString &rURL, const OUString &, - unsigned int, unsigned int, unsigned int) SAL_OVERRIDE; + unsigned int, SotClipboardFormatId, unsigned int) SAL_OVERRIDE; /** * Ensure CVEs remain unbroken @@ -50,7 +50,7 @@ public: bool PcdFilterTest::load(const OUString &, const OUString &rURL, const OUString &, - unsigned int, unsigned int, unsigned int) + unsigned int, SotClipboardFormatId, unsigned int) { SvFileStream aFileStream(rURL, StreamMode::READ); Graphic aGraphic; diff --git a/filter/qa/cppunit/filters-pcx-test.cxx b/filter/qa/cppunit/filters-pcx-test.cxx index 92139b1ad664..b478af5bd7e5 100644 --- a/filter/qa/cppunit/filters-pcx-test.cxx +++ b/filter/qa/cppunit/filters-pcx-test.cxx @@ -36,7 +36,7 @@ public: virtual bool load(const OUString &, const OUString &rURL, const OUString &, - unsigned int, unsigned int, unsigned int) SAL_OVERRIDE; + unsigned int, SotClipboardFormatId, unsigned int) SAL_OVERRIDE; /** * Ensure CVEs remain unbroken @@ -50,7 +50,7 @@ public: bool PcxFilterTest::load(const OUString &, const OUString &rURL, const OUString &, - unsigned int, unsigned int, unsigned int) + unsigned int, SotClipboardFormatId, unsigned int) { SvFileStream aFileStream(rURL, StreamMode::READ); Graphic aGraphic; diff --git a/filter/qa/cppunit/filters-pict-test.cxx b/filter/qa/cppunit/filters-pict-test.cxx index 35fed6162eec..0ea1301ae174 100644 --- a/filter/qa/cppunit/filters-pict-test.cxx +++ b/filter/qa/cppunit/filters-pict-test.cxx @@ -42,7 +42,7 @@ public: virtual bool load(const OUString &, const OUString &rURL, const OUString &, - unsigned int, unsigned int, unsigned int) SAL_OVERRIDE; + unsigned int, SotClipboardFormatId, unsigned int) SAL_OVERRIDE; OUString pictURL() { @@ -64,7 +64,7 @@ public: bool PictFilterTest::load(const OUString &, const OUString &rURL, const OUString &, - unsigned int, unsigned int, unsigned int) + unsigned int, SotClipboardFormatId, unsigned int) { SvFileStream aFileStream(rURL, StreamMode::READ); Graphic aGraphic; diff --git a/filter/qa/cppunit/filters-ppm-test.cxx b/filter/qa/cppunit/filters-ppm-test.cxx index 9cdafcd9dbf1..31b4941d5b2a 100644 --- a/filter/qa/cppunit/filters-ppm-test.cxx +++ b/filter/qa/cppunit/filters-ppm-test.cxx @@ -36,7 +36,7 @@ public: virtual bool load(const OUString &, const OUString &rURL, const OUString &, - unsigned int, unsigned int, unsigned int) SAL_OVERRIDE; + unsigned int, SotClipboardFormatId, unsigned int) SAL_OVERRIDE; /** * Ensure CVEs remain unbroken @@ -50,7 +50,7 @@ public: bool PpmFilterTest::load(const OUString &, const OUString &rURL, const OUString &, - unsigned int, unsigned int, unsigned int) + unsigned int, SotClipboardFormatId, unsigned int) { SvFileStream aFileStream(rURL, StreamMode::READ); Graphic aGraphic; diff --git a/filter/qa/cppunit/filters-psd-test.cxx b/filter/qa/cppunit/filters-psd-test.cxx index 0da3a9fa4dc5..a453443872e1 100644 --- a/filter/qa/cppunit/filters-psd-test.cxx +++ b/filter/qa/cppunit/filters-psd-test.cxx @@ -36,7 +36,7 @@ public: virtual bool load(const OUString &, const OUString &rURL, const OUString &, - unsigned int, unsigned int, unsigned int) SAL_OVERRIDE; + unsigned int, SotClipboardFormatId, unsigned int) SAL_OVERRIDE; /** * Ensure CVEs remain unbroken @@ -50,7 +50,7 @@ public: bool PsdFilterTest::load(const OUString &, const OUString &rURL, const OUString &, - unsigned int, unsigned int, unsigned int) + unsigned int, SotClipboardFormatId, unsigned int) { SvFileStream aFileStream(rURL, StreamMode::READ); Graphic aGraphic; diff --git a/filter/qa/cppunit/filters-ras-test.cxx b/filter/qa/cppunit/filters-ras-test.cxx index cbc7bdf1b288..66f23c914956 100644 --- a/filter/qa/cppunit/filters-ras-test.cxx +++ b/filter/qa/cppunit/filters-ras-test.cxx @@ -36,7 +36,7 @@ public: virtual bool load(const OUString &, const OUString &rURL, const OUString &, - unsigned int, unsigned int, unsigned int) SAL_OVERRIDE; + unsigned int, SotClipboardFormatId, unsigned int) SAL_OVERRIDE; /** * Ensure CVEs remain unbroken @@ -50,7 +50,7 @@ public: bool RasFilterTest::load(const OUString &, const OUString &rURL, const OUString &, - unsigned int, unsigned int, unsigned int) + unsigned int, SotClipboardFormatId, unsigned int) { SvFileStream aFileStream(rURL, StreamMode::READ); Graphic aGraphic; diff --git a/filter/qa/cppunit/filters-tga-test.cxx b/filter/qa/cppunit/filters-tga-test.cxx index 207e9ce2fef8..f723c35884b2 100644 --- a/filter/qa/cppunit/filters-tga-test.cxx +++ b/filter/qa/cppunit/filters-tga-test.cxx @@ -36,7 +36,7 @@ public: virtual bool load(const OUString &, const OUString &rURL, const OUString &, - unsigned int, unsigned int, unsigned int) SAL_OVERRIDE; + unsigned int, SotClipboardFormatId, unsigned int) SAL_OVERRIDE; /** * Ensure CVEs remain unbroken @@ -50,7 +50,7 @@ public: bool TgaFilterTest::load(const OUString &, const OUString &rURL, const OUString &, - unsigned int, unsigned int, unsigned int) + unsigned int, SotClipboardFormatId, unsigned int) { SvFileStream aFileStream(rURL, StreamMode::READ); Graphic aGraphic; diff --git a/filter/qa/cppunit/filters-tiff-test.cxx b/filter/qa/cppunit/filters-tiff-test.cxx index 2de6c8f7874d..bb73d8fe1919 100644 --- a/filter/qa/cppunit/filters-tiff-test.cxx +++ b/filter/qa/cppunit/filters-tiff-test.cxx @@ -36,7 +36,7 @@ public: virtual bool load(const OUString &, const OUString &rURL, const OUString &, - unsigned int, unsigned int, unsigned int) SAL_OVERRIDE; + unsigned int, SotClipboardFormatId, unsigned int) SAL_OVERRIDE; /** * Ensure CVEs remain unbroken @@ -50,7 +50,7 @@ public: bool TiffFilterTest::load(const OUString &, const OUString &rURL, const OUString &, - unsigned int, unsigned int, unsigned int) + unsigned int, SotClipboardFormatId, unsigned int) { SvFileStream aFileStream(rURL, StreamMode::READ); Graphic aGraphic; diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx index 328fe2f9306e..a3e880d8ed53 100644 --- a/filter/source/msfilter/msdffimp.cxx +++ b/filter/source/msfilter/msdffimp.cxx @@ -153,7 +153,7 @@ static sal_uInt32 nMSOleObjCntr = 0; /************************************************************************/ void Impl_OlePres::Write( SvStream & rStm ) { - WriteClipboardFormat( rStm, FORMAT_GDIMETAFILE ); + WriteClipboardFormat( rStm, SotClipboardFormatId::GDIMETAFILE ); rStm.WriteInt32( nJobLen + 4 ); // a TargetDevice that's always empty if( nJobLen ) rStm.Write( pJob, nJobLen ); @@ -166,7 +166,7 @@ void Impl_OlePres::Write( SvStream & rStm ) sal_uLong nPos = rStm.Tell(); rStm.WriteInt32( 0 ); - if( GetFormat() == FORMAT_GDIMETAFILE && pMtf ) + if( GetFormat() == SotClipboardFormatId::GDIMETAFILE && pMtf ) { // Always to 1/100 mm, until Mtf-Solution found // Assumption (no scaling, no origin translation) @@ -6534,7 +6534,7 @@ bool SvxMSDffManager::MakeContentStream( SotStorage * pStor, const GDIMetaFile & sal_uInt16 nAspect = ASPECT_CONTENT; sal_uLong nAdviseModes = 2; - Impl_OlePres aEle( FORMAT_GDIMETAFILE ); + Impl_OlePres aEle( SotClipboardFormatId::GDIMETAFILE ); // Convert the size in 1/100 mm // If a not applicable MapUnit (device dependent) is used, // SV tries to guess a best match for the right value @@ -6729,13 +6729,13 @@ bool SvxMSDffManager::ConvertToOle2( SvStream& rStm, sal_uInt32 nReadLen, if( pIds->nId ) { // found! - sal_uLong nCbFmt = SotExchange::RegisterFormatName( aSvrName ); + SotClipboardFormatId nCbFmt = SotExchange::RegisterFormatName( aSvrName ); rDest->SetClass( SvGlobalName( pIds->nId, 0, 0, 0xc0,0,0,0,0,0,0,0x46 ), nCbFmt, OUString::createFromAscii( pIds->pDspName ) ); } else { - sal_uLong nCbFmt = SotExchange::RegisterFormatName( aSvrName ); + SotClipboardFormatId nCbFmt = SotExchange::RegisterFormatName( aSvrName ); rDest->SetClass( SvGlobalName(), nCbFmt, aSvrName ); } } diff --git a/filter/source/msfilter/msoleexp.cxx b/filter/source/msfilter/msoleexp.cxx index 374707cd4057..c647141d40ec 100644 --- a/filter/source/msfilter/msoleexp.cxx +++ b/filter/source/msfilter/msoleexp.cxx @@ -222,7 +222,7 @@ void SvxMSExportOLEObjects::ExportOLEObject( svt::EmbeddedObjectRef& rObj, SvSto // this is a SO6 embedded object, save in old binary format rDestStg.SetVersion( SOFFICE_FILEFORMAT_31 ); rDestStg.SetClass( aEmbName, - SOT_FORMATSTR_ID_EMBEDDED_OBJ_OLE, + SotClipboardFormatId::EMBEDDED_OBJ_OLE, GetStorageType( aEmbName ) ); SotStorageStreamRef xExtStm = rDestStg.OpenSotStream( OUString( "properties_stream" ), diff --git a/filter/source/msfilter/viscache.hxx b/filter/source/msfilter/viscache.hxx index a52ca4a0b2de..84e7c978f3b5 100644 --- a/filter/source/msfilter/viscache.hxx +++ b/filter/source/msfilter/viscache.hxx @@ -26,17 +26,17 @@ class Impl_OlePres { - sal_uLong nFormat; - sal_uInt16 nAspect; + SotClipboardFormatId nFormat; + sal_uInt16 nAspect; Bitmap * pBmp; GDIMetaFile * pMtf; - sal_uInt32 nAdvFlags; - sal_Int32 nJobLen; - sal_uInt8* pJob; - Size aSize; // Groesse in 100TH_MM + sal_uInt32 nAdvFlags; + sal_Int32 nJobLen; + sal_uInt8* pJob; + Size aSize; // Groesse in 100TH_MM public: - Impl_OlePres( sal_uLong nF ) + Impl_OlePres( SotClipboardFormatId nF ) : nFormat( nF ) , nAspect( ASPECT_CONTENT ) , pBmp( NULL ) @@ -57,14 +57,14 @@ public: delete pMtf; pMtf = new GDIMetaFile( rMtf ); } - Bitmap *GetBitmap() const { return pBmp; } - GDIMetaFile *GetMetaFile() const { return pMtf; } - sal_uLong GetFormat() const { return nFormat; } - void SetAspect( sal_uInt16 nAsp ) { nAspect = nAsp; } - sal_uLong GetAdviseFlags() const { return nAdvFlags; } - void SetAdviseFlags( sal_uLong nAdv ) { nAdvFlags = nAdv; } - void SetSize( const Size & rSize ) { aSize = rSize; } - void Write( SvStream & rStm ); + Bitmap *GetBitmap() const { return pBmp; } + GDIMetaFile *GetMetaFile() const { return pMtf; } + SotClipboardFormatId GetFormat() const { return nFormat; } + void SetAspect( sal_uInt16 nAsp ) { nAspect = nAsp; } + sal_uLong GetAdviseFlags() const { return nAdvFlags; } + void SetAdviseFlags( sal_uLong nAdv ) { nAdvFlags = nAdv; } + void SetSize( const Size & rSize ) { aSize = rSize; } + void Write( SvStream & rStm ); }; #endif // INCLUDED_FILTER_SOURCE_MSFILTER_VISCACHE_HXX -- cgit