summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-05-20 13:00:06 +0200
committerNoel Grandin <noelgrandin@gmail.com>2015-05-21 09:01:57 +0000
commit431598b97b47b13c8b241f587b5eea21bf134893 (patch)
treef94011f51ec2ab79679e7df6133e6ac8f52ba808 /vcl
parent0cd2895e70eb96083ea78b1350583fe791b4237a (diff)
convert CVT constants to scoped enum
Change-Id: I7703816b6a1df2bf24c06cdf9992f9982ae724e8 Reviewed-on: https://gerrit.libreoffice.org/15826 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/filter/graphicfilter.cxx22
-rw-r--r--vcl/source/gdi/cvtgrf.cxx4
-rw-r--r--vcl/source/gdi/gfxlink.cxx26
-rw-r--r--vcl/source/gdi/impgraph.cxx12
-rw-r--r--vcl/source/gdi/pdfwriter_impl.cxx2
5 files changed, 33 insertions, 33 deletions
diff --git a/vcl/source/filter/graphicfilter.cxx b/vcl/source/filter/graphicfilter.cxx
index efa848b098b6..a77e9739cae0 100644
--- a/vcl/source/filter/graphicfilter.cxx
+++ b/vcl/source/filter/graphicfilter.cxx
@@ -2187,17 +2187,17 @@ IMPL_LINK( GraphicFilter, FilterCallback, ConvertData*, pData )
OString aShortName;
switch( pData->mnFormat )
{
- case( CVT_BMP ): aShortName = BMP_SHORTNAME; break;
- case( CVT_GIF ): aShortName = GIF_SHORTNAME; break;
- case( CVT_JPG ): aShortName = JPG_SHORTNAME; break;
- case( CVT_MET ): aShortName = MET_SHORTNAME; break;
- case( CVT_PCT ): aShortName = PCT_SHORTNAME; break;
- case( CVT_PNG ): aShortName = PNG_SHORTNAME; break;
- case( CVT_SVM ): aShortName = SVM_SHORTNAME; break;
- case( CVT_TIF ): aShortName = TIF_SHORTNAME; break;
- case( CVT_WMF ): aShortName = WMF_SHORTNAME; break;
- case( CVT_EMF ): aShortName = EMF_SHORTNAME; break;
- case( CVT_SVG ): aShortName = SVG_SHORTNAME; break;
+ case( ConvertDataFormat::BMP ): aShortName = BMP_SHORTNAME; break;
+ case( ConvertDataFormat::GIF ): aShortName = GIF_SHORTNAME; break;
+ case( ConvertDataFormat::JPG ): aShortName = JPG_SHORTNAME; break;
+ case( ConvertDataFormat::MET ): aShortName = MET_SHORTNAME; break;
+ case( ConvertDataFormat::PCT ): aShortName = PCT_SHORTNAME; break;
+ case( ConvertDataFormat::PNG ): aShortName = PNG_SHORTNAME; break;
+ case( ConvertDataFormat::SVM ): aShortName = SVM_SHORTNAME; break;
+ case( ConvertDataFormat::TIF ): aShortName = TIF_SHORTNAME; break;
+ case( ConvertDataFormat::WMF ): aShortName = WMF_SHORTNAME; break;
+ case( ConvertDataFormat::EMF ): aShortName = EMF_SHORTNAME; break;
+ case( ConvertDataFormat::SVG ): aShortName = SVG_SHORTNAME; break;
default:
break;
diff --git a/vcl/source/gdi/cvtgrf.cxx b/vcl/source/gdi/cvtgrf.cxx
index 65cc9193292b..1dcd9490fed9 100644
--- a/vcl/source/gdi/cvtgrf.cxx
+++ b/vcl/source/gdi/cvtgrf.cxx
@@ -33,7 +33,7 @@ GraphicConverter::~GraphicConverter()
{
}
-sal_uLong GraphicConverter::Import( SvStream& rIStm, Graphic& rGraphic, sal_uLong nFormat )
+sal_uLong GraphicConverter::Import( SvStream& rIStm, Graphic& rGraphic, ConvertDataFormat nFormat )
{
GraphicConverter* pCvt = ImplGetSVData()->maGDIData.mpGrfConverter;
sal_uLong nRet = ERRCODE_IO_GENERAL;
@@ -54,7 +54,7 @@ sal_uLong GraphicConverter::Import( SvStream& rIStm, Graphic& rGraphic, sal_uLon
return nRet;
}
-sal_uLong GraphicConverter::Export( SvStream& rOStm, const Graphic& rGraphic, sal_uLong nFormat )
+sal_uLong GraphicConverter::Export( SvStream& rOStm, const Graphic& rGraphic, ConvertDataFormat nFormat )
{
GraphicConverter* pCvt = ImplGetSVData()->maGDIData.mpGrfConverter;
sal_uLong nRet = ERRCODE_IO_GENERAL;
diff --git a/vcl/source/gdi/gfxlink.cxx b/vcl/source/gdi/gfxlink.cxx
index 75fd45c356ed..62aa6bf6dc07 100644
--- a/vcl/source/gdi/gfxlink.cxx
+++ b/vcl/source/gdi/gfxlink.cxx
@@ -171,30 +171,30 @@ bool GfxLink::LoadNative( Graphic& rGraphic )
if( pData )
{
- SvMemoryStream aMemStm;
- sal_uLong nCvtType;
+ SvMemoryStream aMemStm;
+ ConvertDataFormat nCvtType;
aMemStm.SetBuffer( const_cast<sal_uInt8*>(pData), mnBufSize, false, mnBufSize );
switch( meType )
{
- case( GFX_LINK_TYPE_NATIVE_GIF ): nCvtType = CVT_GIF; break;
+ case( GFX_LINK_TYPE_NATIVE_GIF ): nCvtType = ConvertDataFormat::GIF; break;
// #i15508# added BMP type for better exports (reload when swapped - checked, works)
- case( GFX_LINK_TYPE_NATIVE_BMP ): nCvtType = CVT_BMP; break;
+ case( GFX_LINK_TYPE_NATIVE_BMP ): nCvtType = ConvertDataFormat::BMP; break;
- case( GFX_LINK_TYPE_NATIVE_JPG ): nCvtType = CVT_JPG; break;
- case( GFX_LINK_TYPE_NATIVE_PNG ): nCvtType = CVT_PNG; break;
- case( GFX_LINK_TYPE_NATIVE_TIF ): nCvtType = CVT_TIF; break;
- case( GFX_LINK_TYPE_NATIVE_WMF ): nCvtType = CVT_WMF; break;
- case( GFX_LINK_TYPE_NATIVE_MET ): nCvtType = CVT_MET; break;
- case( GFX_LINK_TYPE_NATIVE_PCT ): nCvtType = CVT_PCT; break;
- case( GFX_LINK_TYPE_NATIVE_SVG ): nCvtType = CVT_SVG; break;
+ case( GFX_LINK_TYPE_NATIVE_JPG ): nCvtType = ConvertDataFormat::JPG; break;
+ case( GFX_LINK_TYPE_NATIVE_PNG ): nCvtType = ConvertDataFormat::PNG; break;
+ case( GFX_LINK_TYPE_NATIVE_TIF ): nCvtType = ConvertDataFormat::TIF; break;
+ case( GFX_LINK_TYPE_NATIVE_WMF ): nCvtType = ConvertDataFormat::WMF; break;
+ case( GFX_LINK_TYPE_NATIVE_MET ): nCvtType = ConvertDataFormat::MET; break;
+ case( GFX_LINK_TYPE_NATIVE_PCT ): nCvtType = ConvertDataFormat::PCT; break;
+ case( GFX_LINK_TYPE_NATIVE_SVG ): nCvtType = ConvertDataFormat::SVG; break;
- default: nCvtType = CVT_UNKNOWN; break;
+ default: nCvtType = ConvertDataFormat::Unknown; break;
}
- if( nCvtType && ( GraphicConverter::Import( aMemStm, rGraphic, nCvtType ) == ERRCODE_NONE ) )
+ if( nCvtType != ConvertDataFormat::Unknown && ( GraphicConverter::Import( aMemStm, rGraphic, nCvtType ) == ERRCODE_NONE ) )
bRet = true;
}
}
diff --git a/vcl/source/gdi/impgraph.cxx b/vcl/source/gdi/impgraph.cxx
index 1c62ab03e4cc..c19acc0535f6 100644
--- a/vcl/source/gdi/impgraph.cxx
+++ b/vcl/source/gdi/impgraph.cxx
@@ -1036,18 +1036,18 @@ bool ImpGraphic::ImplReadEmbedded( SvStream& rIStm )
else if( sal::static_int_cast<sal_uLong>(meType) >= SYS_WINMETAFILE
&& sal::static_int_cast<sal_uLong>(meType) <= SYS_MACMETAFILE )
{
- Graphic aSysGraphic;
- sal_uLong nCvtType;
+ Graphic aSysGraphic;
+ ConvertDataFormat nCvtType;
switch( sal::static_int_cast<sal_uLong>(meType) )
{
case( SYS_WINMETAFILE ):
- case( SYS_WNTMETAFILE ): nCvtType = CVT_WMF; break;
- case( SYS_OS2METAFILE ): nCvtType = CVT_MET; break;
- case( SYS_MACMETAFILE ): nCvtType = CVT_PCT; break;
+ case( SYS_WNTMETAFILE ): nCvtType = ConvertDataFormat::WMF; break;
+ case( SYS_OS2METAFILE ): nCvtType = ConvertDataFormat::MET; break;
+ case( SYS_MACMETAFILE ): nCvtType = ConvertDataFormat::PCT; break;
default:
- nCvtType = CVT_UNKNOWN;
+ nCvtType = ConvertDataFormat::Unknown;
break;
}
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index cdfccbb41a37..99433c2d053e 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -11522,7 +11522,7 @@ void PDFWriterImpl::drawJPGBitmap( SvStream& rDCTData, bool bIsTrueColor, const
// need to convert to grayscale;
// load stream to bitmap and draw the bitmap instead
Graphic aGraphic;
- GraphicConverter::Import( rDCTData, aGraphic, CVT_JPG );
+ GraphicConverter::Import( rDCTData, aGraphic, ConvertDataFormat::JPG );
Bitmap aBmp( aGraphic.GetBitmap() );
if( !!rMask && rMask.GetSizePixel() == aBmp.GetSizePixel() )
{