diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-06-01 16:47:00 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-06-02 09:00:13 +0200 |
commit | 0265bdb92e5dbb5ba851a3d89eb8722bdaf081be (patch) | |
tree | 46c8f87d626cb6c74e211f4dce2721ab5c9b9e14 /svx | |
parent | cf0651fe736c1f411651ee2691ab009fe271be2f (diff) |
convert GRFILTER constants to ERRCODE_GRFILTER_
since various code mixes these constants in with ErrCode values from
other code, let us just make it into real ErrCode values.
Change-Id: Ifa3d0f7526172609a44e6749bed9f730ab6b1a95
Reviewed-on: https://gerrit.libreoffice.org/38313
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/qa/unit/xoutdev.cxx | 2 | ||||
-rw-r--r-- | svx/source/sidebar/area/AreaPropertyPanelBase.cxx | 4 | ||||
-rw-r--r-- | svx/source/unodraw/UnoGraphicExporter.cxx | 10 | ||||
-rw-r--r-- | svx/source/xoutdev/_xoutbmp.cxx | 25 |
4 files changed, 21 insertions, 20 deletions
diff --git a/svx/qa/unit/xoutdev.cxx b/svx/qa/unit/xoutdev.cxx index f2bbb3c42440..a680bd4ebac2 100644 --- a/svx/qa/unit/xoutdev.cxx +++ b/svx/qa/unit/xoutdev.cxx @@ -47,7 +47,7 @@ void XOutdevTest::testPdfGraphicExport() test::Directories aDirectories; OUString aURL = aDirectories.getURLFromSrc("svx/qa/unit/data/graphic.pdf"); SvFileStream aStream(aURL, StreamMode::READ); - CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt16>(GRFILTER_OK), GraphicFilter::GetGraphicFilter().ImportGraphic(aGraphic, aURL, aStream)); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt16>(ERRCODE_NONE), GraphicFilter::GetGraphicFilter().ImportGraphic(aGraphic, aURL, aStream)); // Export it. utl::TempFile aTempFile; diff --git a/svx/source/sidebar/area/AreaPropertyPanelBase.cxx b/svx/source/sidebar/area/AreaPropertyPanelBase.cxx index 90140dfdb894..e82242591617 100644 --- a/svx/source/sidebar/area/AreaPropertyPanelBase.cxx +++ b/svx/source/sidebar/area/AreaPropertyPanelBase.cxx @@ -200,13 +200,13 @@ IMPL_LINK_NOARG(AreaPropertyPanelBase, ClickImportBitmapHdl, Button*, void) { SvxOpenGraphicDialog aDlg( "Import" ); aDlg.EnableLink(false); - if( aDlg.Execute() == GRFILTER_OK ) + if( aDlg.Execute() == ERRCODE_NONE ) { Graphic aGraphic; EnterWait(); int nError = aDlg.GetGraphic( aGraphic ); LeaveWait(); - if( nError == GRFILTER_OK ) + if( nError == ERRCODE_NONE ) { const SvxBitmapListItem aItem( *static_cast<const SvxBitmapListItem*>(SfxObjectShell::Current()->GetItem(SID_BITMAP_LIST))); XBitmapListRef pList = aItem.GetBitmapList(); diff --git a/svx/source/unodraw/UnoGraphicExporter.cxx b/svx/source/unodraw/UnoGraphicExporter.cxx index 17eabdd5c360..e4ae5760b944 100644 --- a/svx/source/unodraw/UnoGraphicExporter.cxx +++ b/svx/source/unodraw/UnoGraphicExporter.cxx @@ -1013,15 +1013,15 @@ sal_Bool SAL_CALL GraphicExporter::filter( const Sequence< PropertyValue >& aDes // create the output stuff Graphic aGraphic; - sal_uInt16 nStatus = GetGraphic( aSettings, aGraphic, bVectorType ) ? GRFILTER_OK : GRFILTER_FILTERERROR; + ErrCode nStatus = GetGraphic( aSettings, aGraphic, bVectorType ) ? ERRCODE_NONE : ERRCODE_GRFILTER_FILTERERROR; - if( nStatus == GRFILTER_OK ) + if( nStatus == ERRCODE_NONE ) { // export graphic only if it has a size const Size aGraphSize( aGraphic.GetPrefSize() ); if ( ( aGraphSize.Width() == 0 ) || ( aGraphSize.Height() == 0 ) ) { - nStatus = GRFILTER_FILTERERROR; + nStatus = ERRCODE_GRFILTER_FILTERERROR; } else { @@ -1054,7 +1054,7 @@ sal_Bool SAL_CALL GraphicExporter::filter( const Sequence< PropertyValue >& aDes } } - if ( aSettings.mxInteractionHandler.is() && ( nStatus != GRFILTER_OK ) ) + if ( aSettings.mxInteractionHandler.is() && ( nStatus != ERRCODE_NONE ) ) { Any aInteraction; Sequence< css::uno::Reference< css::task::XInteractionContinuation > > lContinuations(1); @@ -1066,7 +1066,7 @@ sal_Bool SAL_CALL GraphicExporter::filter( const Sequence< PropertyValue >& aDes aInteraction <<= aErrorCode; aSettings.mxInteractionHandler->handle( framework::InteractionRequest::CreateRequest( aInteraction, lContinuations ) ); } - return nStatus == GRFILTER_OK; + return nStatus == ERRCODE_NONE; } void SAL_CALL GraphicExporter::cancel() diff --git a/svx/source/xoutdev/_xoutbmp.cxx b/svx/source/xoutdev/_xoutbmp.cxx index fd105064b55c..6205b6533b6a 100644 --- a/svx/source/xoutdev/_xoutbmp.cxx +++ b/svx/source/xoutdev/_xoutbmp.cxx @@ -117,7 +117,7 @@ Graphic XOutBitmap::MirrorGraphic( const Graphic& rGraphic, const BmpMirrorFlags return aRetGraphic; } -sal_uInt16 XOutBitmap::WriteGraphic( const Graphic& rGraphic, OUString& rFileName, +ErrCode XOutBitmap::WriteGraphic( const Graphic& rGraphic, OUString& rFileName, const OUString& rFilterName, const XOutFlags nFlags, const Size* pMtfSize_100TH_MM ) { @@ -127,7 +127,8 @@ sal_uInt16 XOutBitmap::WriteGraphic( const Graphic& rGraphic, OUString& rFileNam Graphic aGraphic; OUString aExt; GraphicFilter& rFilter = GraphicFilter::GetGraphicFilter(); - sal_uInt16 nErr = GRFILTER_FILTERERROR, nFilter = GRFILTER_FORMAT_NOTFOUND; + ErrCode nErr = ERRCODE_GRFILTER_FILTERERROR; + sal_uInt16 nFilter = GRFILTER_FORMAT_NOTFOUND; bool bTransparent = rGraphic.IsTransparent(), bAnimated = rGraphic.IsAnimated(); DBG_ASSERT( aURL.GetProtocol() != INetProtocol::NotValid, "XOutBitmap::WriteGraphic(...): invalid URL" ); @@ -169,7 +170,7 @@ sal_uInt16 XOutBitmap::WriteGraphic( const Graphic& rGraphic, OUString& rFileNam if(!aMedium.GetError()) { - nErr = GRFILTER_OK; + nErr = ERRCODE_NONE; } } } @@ -188,11 +189,11 @@ sal_uInt16 XOutBitmap::WriteGraphic( const Graphic& rGraphic, OUString& rFileNam pOutStream->WriteBytes(aPdfData.getConstArray(), aPdfData.getLength()); aMedium.Commit(); if (!aMedium.GetError()) - nErr = GRFILTER_OK; + nErr = ERRCODE_NONE; } } - if( GRFILTER_OK != nErr ) + if( ERRCODE_NONE != nErr ) { if( ( nFlags & XOutFlags::UseNativeIfPossible ) && !( nFlags & XOutFlags::MirrorHorz ) && @@ -231,13 +232,13 @@ sal_uInt16 XOutBitmap::WriteGraphic( const Graphic& rGraphic, OUString& rFileNam aMedium.Commit(); if( !aMedium.GetError() ) - nErr = GRFILTER_OK; + nErr = ERRCODE_NONE; } } } } - if( GRFILTER_OK != nErr ) + if( ERRCODE_NONE != nErr ) { OUString aFilter( rFilterName ); bool bWriteTransGrf = ( aFilter.equalsIgnoreAsciiCase( "transgrf" ) ) || @@ -344,7 +345,7 @@ sal_uInt16 XOutBitmap::WriteGraphic( const Graphic& rGraphic, OUString& rFileNam } else { - return GRFILTER_OK; + return ERRCODE_NONE; } } @@ -406,7 +407,7 @@ bool XOutBitmap::GraphicToBase64(const Graphic& rGraphic, OUString& rOUString) return true; } -sal_uInt16 XOutBitmap::ExportGraphic( const Graphic& rGraphic, const INetURLObject& rURL, +ErrCode XOutBitmap::ExportGraphic( const Graphic& rGraphic, const INetURLObject& rURL, GraphicFilter& rFilter, const sal_uInt16 nFormat, const css::uno::Sequence< css::beans::PropertyValue >* pFilterData ) { @@ -414,7 +415,7 @@ sal_uInt16 XOutBitmap::ExportGraphic( const Graphic& rGraphic, const INetURLObje SfxMedium aMedium( rURL.GetMainURL( INetURLObject::DecodeMechanism::NONE ), StreamMode::WRITE | StreamMode::SHARE_DENYNONE | StreamMode::TRUNC ); SvStream* pOStm = aMedium.GetOutStream(); - sal_uInt16 nRet = GRFILTER_IOERROR; + ErrCode nRet = ERRCODE_GRFILTER_IOERROR; if( pOStm ) { @@ -425,8 +426,8 @@ sal_uInt16 XOutBitmap::ExportGraphic( const Graphic& rGraphic, const INetURLObje pGrfFilter = nullptr; aMedium.Commit(); - if( aMedium.GetError() && ( GRFILTER_OK == nRet ) ) - nRet = GRFILTER_IOERROR; + if( aMedium.GetError() && ( ERRCODE_NONE == nRet ) ) + nRet = ERRCODE_GRFILTER_IOERROR; } return nRet; |