summaryrefslogtreecommitdiff
path: root/vcl/source/filter
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2017-10-26 23:15:06 +0200
committerMichael Stahl <mstahl@redhat.com>2017-10-26 23:17:45 +0200
commit11d2f3d6e1b6c9baf43d8521293c53525108436d (patch)
treeffe35d5d47713a11c93c3bf11f588eeaf492fc16 /vcl/source/filter
parent213f7c02d4f3ddbe2f52950575e2559c52d98ac2 (diff)
vcl: make MapMode constructor explicit
Insert constructor everywhere, except a couple places that apparently want to compare GetMapUnit(). Change-Id: I1910deb60562e5e949203435e827057f70a3f988
Diffstat (limited to 'vcl/source/filter')
-rw-r--r--vcl/source/filter/graphicfilter.cxx8
-rw-r--r--vcl/source/filter/igif/gifread.cxx2
-rw-r--r--vcl/source/filter/jpeg/JpegReader.cxx2
-rw-r--r--vcl/source/filter/wmf/emfwr.cxx2
4 files changed, 7 insertions, 7 deletions
diff --git a/vcl/source/filter/graphicfilter.cxx b/vcl/source/filter/graphicfilter.cxx
index 19c32190e3d0..c555ac89aa06 100644
--- a/vcl/source/filter/graphicfilter.cxx
+++ b/vcl/source/filter/graphicfilter.cxx
@@ -835,10 +835,10 @@ static Graphic ImpGetScaledGraphic( const Graphic& rGraphic, FilterConfigItem& r
Size aOriginalSize;
Size aPrefSize( rGraphic.GetPrefSize() );
MapMode aPrefMapMode( rGraphic.GetPrefMapMode() );
- if ( aPrefMapMode == MapUnit::MapPixel )
- aOriginalSize = Application::GetDefaultDevice()->PixelToLogic( aPrefSize, MapUnit::Map100thMM );
+ if (aPrefMapMode.GetMapUnit() == MapUnit::MapPixel)
+ aOriginalSize = Application::GetDefaultDevice()->PixelToLogic(aPrefSize, MapMode(MapUnit::Map100thMM));
else
- aOriginalSize = OutputDevice::LogicToLogic( aPrefSize, aPrefMapMode, MapUnit::Map100thMM );
+ aOriginalSize = OutputDevice::LogicToLogic(aPrefSize, aPrefMapMode, MapMode(MapUnit::Map100thMM));
if ( !nLogicalWidth )
nLogicalWidth = aOriginalSize.Width();
if ( !nLogicalHeight )
@@ -887,7 +887,7 @@ static Graphic ImpGetScaledGraphic( const Graphic& rGraphic, FilterConfigItem& r
if( ( nMode == 1 ) || ( nMode == 2 ) )
{
GDIMetaFile aMtf( rGraphic.GetGDIMetaFile() );
- Size aNewSize( OutputDevice::LogicToLogic( Size( nLogicalWidth, nLogicalHeight ), MapUnit::Map100thMM, aMtf.GetPrefMapMode() ) );
+ Size aNewSize( OutputDevice::LogicToLogic(Size(nLogicalWidth, nLogicalHeight), MapMode(MapUnit::Map100thMM), aMtf.GetPrefMapMode()) );
if( aNewSize.Width() && aNewSize.Height() )
{
diff --git a/vcl/source/filter/igif/gifread.cxx b/vcl/source/filter/igif/gifread.cxx
index 9d07b805417d..4b3ef39b7212 100644
--- a/vcl/source/filter/igif/gifread.cxx
+++ b/vcl/source/filter/igif/gifread.cxx
@@ -888,7 +888,7 @@ ReadState GIFReader::ReadGIF( Graphic& rGraphic )
if( nLogWidth100 && nLogHeight100 )
{
rGraphic.SetPrefSize( Size( nLogWidth100, nLogHeight100 ) );
- rGraphic.SetPrefMapMode( MapUnit::Map100thMM );
+ rGraphic.SetPrefMapMode(MapMode(MapUnit::Map100thMM));
}
}
else
diff --git a/vcl/source/filter/jpeg/JpegReader.cxx b/vcl/source/filter/jpeg/JpegReader.cxx
index 014cdfd5d772..604b182b5bb1 100644
--- a/vcl/source/filter/jpeg/JpegReader.cxx
+++ b/vcl/source/filter/jpeg/JpegReader.cxx
@@ -225,7 +225,7 @@ bool JPEGReader::CreateBitmap(JPEGCreateBitmapParam& rParam)
Fraction aFractX( 1, rParam.X_density );
Fraction aFractY( 1, rParam.Y_density );
MapMode aMapMode( nUnit == 1 ? MapUnit::MapInch : MapUnit::MapCM, aEmptyPoint, aFractX, aFractY );
- Size aPrefSize = OutputDevice::LogicToLogic( aSize, aMapMode, MapUnit::Map100thMM );
+ Size aPrefSize = OutputDevice::LogicToLogic(aSize, aMapMode, MapMode(MapUnit::Map100thMM));
mpBitmap->SetPrefSize(aPrefSize);
mpBitmap->SetPrefMapMode(MapMode(MapUnit::Map100thMM));
diff --git a/vcl/source/filter/wmf/emfwr.cxx b/vcl/source/filter/wmf/emfwr.cxx
index 649425f20b83..fabada800ea9 100644
--- a/vcl/source/filter/wmf/emfwr.cxx
+++ b/vcl/source/filter/wmf/emfwr.cxx
@@ -250,7 +250,7 @@ bool EMFWriter::WriteEMF(const GDIMetaFile& rMtf)
mnHorTextAlign = 0;
const Size aMtfSizePix( maVDev->LogicToPixel( rMtf.GetPrefSize(), rMtf.GetPrefMapMode() ) );
- const Size aMtfSizeLog( OutputDevice::LogicToLogic( rMtf.GetPrefSize(), rMtf.GetPrefMapMode(), MapUnit::Map100thMM ) );
+ const Size aMtfSizeLog( OutputDevice::LogicToLogic(rMtf.GetPrefSize(), rMtf.GetPrefMapMode(), MapMode(MapUnit::Map100thMM)) );
// seek over header
// use [MS-EMF 2.2.11] HeaderExtension2 Object, otherwise resulting EMF cannot be converted with GetWinMetaFileBits()