diff options
author | Matteo Casalin <matteo.casalin@yahoo.com> | 2015-08-29 16:49:46 +0200 |
---|---|---|
committer | Matteo Casalin <matteo.casalin@yahoo.com> | 2015-08-29 16:57:08 +0200 |
commit | d00ca13f880bbfe0fc987ef47184737dc74551d8 (patch) | |
tree | 2e7bb5c910a54607148f7bc1ec5cf48466402296 | |
parent | caabdbc6d2272a7549ad3761b29f23c5947ff9b2 (diff) |
XOutBitmap::GraphicToBase64 can return bool
instead of a sal_uLong error code, which no call place cares about
Change-Id: I0d0dd16859e2f9678f47f484edf933e165b1ca48
-rw-r--r-- | include/svx/xoutbmp.hxx | 2 | ||||
-rw-r--r-- | svx/source/xoutdev/_xoutbmp.cxx | 6 | ||||
-rw-r--r-- | sw/source/filter/html/css1atr.cxx | 3 | ||||
-rw-r--r-- | sw/source/filter/html/htmlflywriter.cxx | 6 | ||||
-rw-r--r-- | sw/source/filter/html/wrthtml.cxx | 3 |
5 files changed, 8 insertions, 12 deletions
diff --git a/include/svx/xoutbmp.hxx b/include/svx/xoutbmp.hxx index 34e03c3f9cc0..37fe77d550be 100644 --- a/include/svx/xoutbmp.hxx +++ b/include/svx/xoutbmp.hxx @@ -56,7 +56,7 @@ public: static sal_uInt16 WriteGraphic( const Graphic& rGraphic, OUString& rFileName, const OUString& rFilterName, const sal_uIntPtr nFlags = 0L, const Size* pMtfSize_100TH_MM = NULL ); - static sal_uLong GraphicToBase64(const Graphic& rGraphic,OUString& rOUString); + static bool GraphicToBase64(const Graphic& rGraphic, OUString& rOUString); static sal_uInt16 ExportGraphic( const Graphic& rGraphic, const INetURLObject& rURL, GraphicFilter& rFilter, const sal_uInt16 nFormat, diff --git a/svx/source/xoutdev/_xoutbmp.cxx b/svx/source/xoutdev/_xoutbmp.cxx index c6a71ae6edd3..399301868c40 100644 --- a/svx/source/xoutdev/_xoutbmp.cxx +++ b/svx/source/xoutdev/_xoutbmp.cxx @@ -327,7 +327,7 @@ sal_uInt16 XOutBitmap::WriteGraphic( const Graphic& rGraphic, OUString& rFileNam } } -sal_uLong XOutBitmap::GraphicToBase64(const Graphic& rGraphic, OUString& rOUString) +bool XOutBitmap::GraphicToBase64(const Graphic& rGraphic, OUString& rOUString) { SvMemoryStream aOStm; OUString aMimeType; @@ -357,14 +357,14 @@ sal_uLong XOutBitmap::GraphicToBase64(const Graphic& rGraphic, OUString& rOUStri if ( nErr ) { SAL_WARN("svx", "XOutBitmap::GraphicToBase64() invalid Graphic? error: " << nErr ); - return nErr; + return false; } aOStm.Seek(STREAM_SEEK_TO_END); css::uno::Sequence<sal_Int8> aOStmSeq( static_cast<sal_Int8 const *>(aOStm.GetData()),aOStm.Tell() ); OUStringBuffer aStrBuffer; ::sax::Converter::encodeBase64(aStrBuffer,aOStmSeq); rOUString = aMimeType + ";base64," + aStrBuffer.makeStringAndClear(); - return 0; + return true; } sal_uInt16 XOutBitmap::ExportGraphic( const Graphic& rGraphic, const INetURLObject& rURL, diff --git a/sw/source/filter/html/css1atr.cxx b/sw/source/filter/html/css1atr.cxx index 02881ce84351..c630a767ea97 100644 --- a/sw/source/filter/html/css1atr.cxx +++ b/sw/source/filter/html/css1atr.cxx @@ -3235,8 +3235,7 @@ static Writer& OutCSS1_SvxBrush( Writer& rWrt, const SfxPoolItem& rHt, const Graphic* pGrf = static_cast<const SvxBrushItem &>(rHt).GetGraphic(); if( pGrf ) { - sal_uLong nErr = XOutBitmap::GraphicToBase64(*pGrf, aGraphicInBase64); - if( nErr ) + if( !XOutBitmap::GraphicToBase64(*pGrf, aGraphicInBase64) ) { rHTMLWrt.nWarn = WARN_SWG_POOR_LOAD | WARN_SW_WRITE_BASE; } diff --git a/sw/source/filter/html/htmlflywriter.cxx b/sw/source/filter/html/htmlflywriter.cxx index 9e24f9ae6362..e21b49263379 100644 --- a/sw/source/filter/html/htmlflywriter.cxx +++ b/sw/source/filter/html/htmlflywriter.cxx @@ -1358,8 +1358,7 @@ Writer& OutHTML_Image( Writer& rWrt, const SwFrameFormat &rFrameFormat, aHtml.start(OOO_STRING_SVTOOLS_HTML_image); OUString aGraphicInBase64; - sal_uLong nErr = XOutBitmap::GraphicToBase64(rGraphic, aGraphicInBase64); - if (nErr) + if ( !XOutBitmap::GraphicToBase64(rGraphic, aGraphicInBase64) ) { rHTMLWrt.nWarn = WARN_SWG_POOR_LOAD | WARN_SW_WRITE_BASE; } @@ -1425,8 +1424,7 @@ Writer& OutHTML_BulletImage( Writer& rWrt, const Graphic* pGrf = pBrush->GetGraphic(); if( pGrf ) { - sal_uLong nErr = XOutBitmap::GraphicToBase64(*pGrf, aGraphicInBase64); - if( nErr ) + if( !XOutBitmap::GraphicToBase64(*pGrf, aGraphicInBase64) ) { rHTMLWrt.nWarn = WARN_SWG_POOR_LOAD | WARN_SW_WRITE_BASE; } diff --git a/sw/source/filter/html/wrthtml.cxx b/sw/source/filter/html/wrthtml.cxx index 4e5d57be4920..ea5e12b6cf43 100644 --- a/sw/source/filter/html/wrthtml.cxx +++ b/sw/source/filter/html/wrthtml.cxx @@ -1233,8 +1233,7 @@ void SwHTMLWriter::OutBackground( const SvxBrushItem *pBrushItem, bool bGraphic const Graphic* pGrf = pBrushItem->GetGraphic(); if( pGrf ) { - sal_uLong nErr = XOutBitmap::GraphicToBase64(*pGrf, aGraphicInBase64); - if( nErr ) + if( !XOutBitmap::GraphicToBase64(*pGrf, aGraphicInBase64) ) { nWarn = WARN_SWG_POOR_LOAD | WARN_SW_WRITE_BASE; } |