diff options
author | Michael Stahl <mstahl@redhat.com> | 2017-10-26 23:15:06 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2017-10-26 23:17:45 +0200 |
commit | 11d2f3d6e1b6c9baf43d8521293c53525108436d (patch) | |
tree | ffe35d5d47713a11c93c3bf11f588eeaf492fc16 /vcl | |
parent | 213f7c02d4f3ddbe2f52950575e2559c52d98ac2 (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')
-rw-r--r-- | vcl/source/app/settings.cxx | 2 | ||||
-rw-r--r-- | vcl/source/control/button.cxx | 4 | ||||
-rw-r--r-- | vcl/source/control/listctrl.cxx | 2 | ||||
-rw-r--r-- | vcl/source/control/morebtn.cxx | 2 | ||||
-rw-r--r-- | vcl/source/filter/graphicfilter.cxx | 8 | ||||
-rw-r--r-- | vcl/source/filter/igif/gifread.cxx | 2 | ||||
-rw-r--r-- | vcl/source/filter/jpeg/JpegReader.cxx | 2 | ||||
-rw-r--r-- | vcl/source/filter/wmf/emfwr.cxx | 2 | ||||
-rw-r--r-- | vcl/source/gdi/dibtools.cxx | 2 | ||||
-rw-r--r-- | vcl/source/gdi/gdimetafiletools.cxx | 8 | ||||
-rw-r--r-- | vcl/source/gdi/gdimtf.cxx | 2 | ||||
-rw-r--r-- | vcl/source/gdi/graph.cxx | 3 | ||||
-rw-r--r-- | vcl/source/gdi/pdfwriter_impl.cxx | 2 | ||||
-rw-r--r-- | vcl/source/gdi/pdfwriter_impl2.cxx | 4 | ||||
-rw-r--r-- | vcl/source/gdi/pngread.cxx | 2 | ||||
-rw-r--r-- | vcl/source/gdi/pngwrite.cxx | 2 | ||||
-rw-r--r-- | vcl/source/gdi/print.cxx | 6 | ||||
-rw-r--r-- | vcl/source/gdi/print3.cxx | 2 | ||||
-rw-r--r-- | vcl/source/gdi/textlayout.cxx | 4 | ||||
-rw-r--r-- | vcl/source/gdi/vectorgraphicdata.cxx | 2 | ||||
-rw-r--r-- | vcl/source/outdev/bitmap.cxx | 2 | ||||
-rw-r--r-- | vcl/source/window/printdlg.cxx | 8 | ||||
-rw-r--r-- | vcl/source/window/split.cxx | 2 |
23 files changed, 38 insertions, 37 deletions
diff --git a/vcl/source/app/settings.cxx b/vcl/source/app/settings.cxx index b6f9a2d7b1b4..8be97308eb38 100644 --- a/vcl/source/app/settings.cxx +++ b/vcl/source/app/settings.cxx @@ -2050,7 +2050,7 @@ const Size& StyleSettings::GetListBoxPreviewDefaultPixelSize() const if(0 == mxData->maListBoxPreviewDefaultPixelSize.Width() || 0 == mxData->maListBoxPreviewDefaultPixelSize.Height()) { const_cast< StyleSettings* >(this)->mxData->maListBoxPreviewDefaultPixelSize = - Application::GetDefaultDevice()->LogicToPixel(mxData->maListBoxPreviewDefaultLogicSize, MapUnit::MapAppFont); + Application::GetDefaultDevice()->LogicToPixel(mxData->maListBoxPreviewDefaultLogicSize, MapMode(MapUnit::MapAppFont)); } return mxData->maListBoxPreviewDefaultPixelSize; diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx index 8aa2cebc4f1b..875734f51d15 100644 --- a/vcl/source/control/button.cxx +++ b/vcl/source/control/button.cxx @@ -2807,7 +2807,7 @@ Image RadioButton::GetRadioImage( const AllSettings& rSettings, DrawButtonFlags void RadioButton::ImplSetMinimumNWFSize() { Push( PushFlags::MAPMODE ); - SetMapMode( MapUnit::MapPixel ); + SetMapMode(MapMode(MapUnit::MapPixel)); ImplControlValue aControlValue; Size aCurSize( GetSizePixel() ); @@ -3643,7 +3643,7 @@ Image CheckBox::GetCheckImage( const AllSettings& rSettings, DrawButtonFlags nFl void CheckBox::ImplSetMinimumNWFSize() { Push( PushFlags::MAPMODE ); - SetMapMode( MapUnit::MapPixel ); + SetMapMode(MapMode(MapUnit::MapPixel)); ImplControlValue aControlValue; Size aCurSize( GetSizePixel() ); diff --git a/vcl/source/control/listctrl.cxx b/vcl/source/control/listctrl.cxx index 1c42b0565fb9..fd94a50abed1 100644 --- a/vcl/source/control/listctrl.cxx +++ b/vcl/source/control/listctrl.cxx @@ -95,7 +95,7 @@ void ListControl::RecalcAll() Size ListControl::GetOptimalSize() const { - return LogicToPixel(Size(300, 185), MapUnit::MapAppFont); + return LogicToPixel(Size(300, 185), MapMode(MapUnit::MapAppFont)); } void ListControl::Resize() diff --git a/vcl/source/control/morebtn.cxx b/vcl/source/control/morebtn.cxx index acff4e0be2f2..95fd6fb78871 100644 --- a/vcl/source/control/morebtn.cxx +++ b/vcl/source/control/morebtn.cxx @@ -89,7 +89,7 @@ void MoreButton::Click() { vcl::Window* pParent = GetParent(); Size aSize( pParent->GetSizePixel() ); - long nDeltaPixel = LogicToPixel( Size( 0, 0 ), MapUnit::MapPixel ).Height(); + long nDeltaPixel = LogicToPixel(Size(0, 0), MapMode(MapUnit::MapPixel)).Height(); // Change status mbState = !mbState; 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() diff --git a/vcl/source/gdi/dibtools.cxx b/vcl/source/gdi/dibtools.cxx index 02ab6d068bc8..8e20fd7a9aa3 100644 --- a/vcl/source/gdi/dibtools.cxx +++ b/vcl/source/gdi/dibtools.cxx @@ -1476,7 +1476,7 @@ bool ImplWriteDIBBody(const Bitmap& rBitmap, SvStream& rOStm, BitmapReadAccess c // MapMode is integer-based, and suffers from roundoffs, // especially if maPrefSize is small. Trying to circumvent // that by performing part of the math in floating point. - const Size aScale100000(OutputDevice::LogicToLogic(Size(100000, 100000), MapUnit::Map100thMM, rBitmap.GetPrefMapMode())); + const Size aScale100000(OutputDevice::LogicToLogic(Size(100000, 100000), MapMode(MapUnit::Map100thMM), rBitmap.GetPrefMapMode())); const double fBmpWidthM((double)rBitmap.GetPrefSize().Width() / aScale100000.Width()); const double fBmpHeightM((double)rBitmap.GetPrefSize().Height() / aScale100000.Height()); diff --git a/vcl/source/gdi/gdimetafiletools.cxx b/vcl/source/gdi/gdimetafiletools.cxx index a5bd77e1b4ab..e63f64ca6b4b 100644 --- a/vcl/source/gdi/gdimetafiletools.cxx +++ b/vcl/source/gdi/gdimetafiletools.cxx @@ -717,11 +717,11 @@ void clipMetafileContentAgainstOwnRegions(GDIMetaFile& rSource) if(MapUnit::MapPixel == rBitmapEx.GetPrefMapMode().GetMapUnit()) { - aLogicalSize = Application::GetDefaultDevice()->PixelToLogic(aLogicalSize, aMapModes.back().GetMapUnit()); + aLogicalSize = Application::GetDefaultDevice()->PixelToLogic(aLogicalSize, aMapModes.back()); } else { - aLogicalSize = OutputDevice::LogicToLogic(aLogicalSize, rBitmapEx.GetPrefMapMode(), aMapModes.back().GetMapUnit()); + aLogicalSize = OutputDevice::LogicToLogic(aLogicalSize, rBitmapEx.GetPrefMapMode(), aMapModes.back()); } bDone = handleBitmapContent( @@ -744,11 +744,11 @@ void clipMetafileContentAgainstOwnRegions(GDIMetaFile& rSource) if(MapUnit::MapPixel == rBitmap.GetPrefMapMode().GetMapUnit()) { - aLogicalSize = Application::GetDefaultDevice()->PixelToLogic(aLogicalSize, aMapModes.back().GetMapUnit()); + aLogicalSize = Application::GetDefaultDevice()->PixelToLogic(aLogicalSize, aMapModes.back()); } else { - aLogicalSize = OutputDevice::LogicToLogic(aLogicalSize, rBitmap.GetPrefMapMode(), aMapModes.back().GetMapUnit()); + aLogicalSize = OutputDevice::LogicToLogic(aLogicalSize, rBitmap.GetPrefMapMode(), aMapModes.back()); } bDone = handleBitmapContent( diff --git a/vcl/source/gdi/gdimtf.cxx b/vcl/source/gdi/gdimtf.cxx index a2310de9b564..a7c691fc1863 100644 --- a/vcl/source/gdi/gdimtf.cxx +++ b/vcl/source/gdi/gdimtf.cxx @@ -420,7 +420,7 @@ bool GDIMetaFile::ImplPlayWithRenderer( OutputDevice* pOut, const Point& rPos, S BitmapEx aBitmapEx; if( aBitmapEx.Create( xBitmapCanvas, aSize ) ) { - if ( pOut->GetMapMode() == MapUnit::MapPixel ) + if (pOut->GetMapMode().GetMapUnit() == MapUnit::MapPixel) pOut->DrawBitmapEx( rPos, aBitmapEx ); else pOut->DrawBitmapEx( rPos, rLogicDestSize, aBitmapEx ); diff --git a/vcl/source/gdi/graph.cxx b/vcl/source/gdi/graph.cxx index 9d8833683f34..d60a4f2cf0a2 100644 --- a/vcl/source/gdi/graph.cxx +++ b/vcl/source/gdi/graph.cxx @@ -416,7 +416,8 @@ basegfx::B2DSize Graphic::GetPPI() const } else { - const Size aGrf1000thInchSize = OutputDevice::LogicToLogic(aGrfPrefMapModeSize, aGrfMap, MapUnit::Map1000thInch); + const Size aGrf1000thInchSize = OutputDevice::LogicToLogic( + aGrfPrefMapModeSize, aGrfMap, MapMode(MapUnit::Map1000thInch)); nGrfDPIx = 1000.0 * aGrfPixelSize.Width() / aGrf1000thInchSize.Width(); nGrfDPIy = 1000.0 * aGrfPixelSize.Height() / aGrf1000thInchSize.Height(); } diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index d671c43b6e51..3e3525162845 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -2201,7 +2201,7 @@ OutputDevice* PDFWriterImpl::getReferenceDevice() pVDev->SetReferenceDevice( m_aContext.DPIx, m_aContext.DPIy ); pVDev->SetOutputSizePixel( Size( 640, 480 ) ); - pVDev->SetMapMode( MapUnit::MapMM ); + pVDev->SetMapMode(MapMode(MapUnit::MapMM)); m_pReferenceDevice->mpPDFWriter = this; m_pReferenceDevice->ImplUpdateFontData(); diff --git a/vcl/source/gdi/pdfwriter_impl2.cxx b/vcl/source/gdi/pdfwriter_impl2.cxx index 632e526c9471..dc47a65b6554 100644 --- a/vcl/source/gdi/pdfwriter_impl2.cxx +++ b/vcl/source/gdi/pdfwriter_impl2.cxx @@ -107,7 +107,7 @@ void PDFWriterImpl::implWriteBitmapEx( const Point& i_rPoint, const Size& i_rSiz if( i_rContext.m_nMaxImageResolution > 50 ) { // do downsampling if necessary - const Size aDstSizeTwip( i_pDummyVDev->PixelToLogic( i_pDummyVDev->LogicToPixel( aSize ), MapUnit::MapTwip ) ); + const Size aDstSizeTwip( i_pDummyVDev->PixelToLogic(i_pDummyVDev->LogicToPixel(aSize), MapMode(MapUnit::MapTwip)) ); const Size aBmpSize( aBitmapEx.GetSizePixel() ); const double fBmpPixelX = aBmpSize.Width(); const double fBmpPixelY = aBmpSize.Height(); @@ -425,7 +425,7 @@ void PDFWriterImpl::playMetafile( const GDIMetaFile& i_rMtf, vcl::PDFExtOutDevDa } else { - const Size aDstSizeTwip( pDummyVDev->PixelToLogic( pDummyVDev->LogicToPixel( rSize ), MapUnit::MapTwip ) ); + const Size aDstSizeTwip( pDummyVDev->PixelToLogic(pDummyVDev->LogicToPixel(rSize), MapMode(MapUnit::MapTwip)) ); // i#115962# Always use at least 300 DPI for bitmap conversion of transparence gradients, // else the quality is not acceptable (see bugdoc as example) diff --git a/vcl/source/gdi/pngread.cxx b/vcl/source/gdi/pngread.cxx index 8dde053a7d82..0752d52ff6f7 100644 --- a/vcl/source/gdi/pngread.cxx +++ b/vcl/source/gdi/pngread.cxx @@ -436,7 +436,7 @@ BitmapEx PNGReaderImpl::GetBitmapEx( const Size& rPreviewSizeHint ) if ( mbpHYs && maPhysSize.Width() && maPhysSize.Height() ) { - aRet.SetPrefMapMode( MapUnit::Map100thMM ); + aRet.SetPrefMapMode(MapMode(MapUnit::Map100thMM)); aRet.SetPrefSize( maPhysSize ); } } diff --git a/vcl/source/gdi/pngwrite.cxx b/vcl/source/gdi/pngwrite.cxx index ab15754724f4..072e74d62530 100644 --- a/vcl/source/gdi/pngwrite.cxx +++ b/vcl/source/gdi/pngwrite.cxx @@ -355,7 +355,7 @@ void PNGWriterImpl::ImplWriteTransparent() void PNGWriterImpl::ImplWritepHYs(const BitmapEx& rBmpEx) { - if (rBmpEx.GetPrefMapMode() == MapUnit::Map100thMM) + if (rBmpEx.GetPrefMapMode().GetMapUnit() == MapUnit::Map100thMM) { Size aPrefSize(rBmpEx.GetPrefSize()); diff --git a/vcl/source/gdi/print.cxx b/vcl/source/gdi/print.cxx index 5ac8a2a8d957..55f4b3fa3be9 100644 --- a/vcl/source/gdi/print.cxx +++ b/vcl/source/gdi/print.cxx @@ -241,7 +241,7 @@ void Printer::EmulateDrawTransparent ( const tools::PolyPolygon& rPolyPoly, mpAlphaVDev = pOldAlphaVDev; tools::Rectangle aPolyRect( LogicToPixel( rPolyPoly ).GetBoundRect() ); - const Size aDPISize( LogicToPixel( Size( 1, 1 ), MapUnit::MapInch ) ); + const Size aDPISize( LogicToPixel(Size(1, 1), MapMode(MapUnit::MapInch)) ); const long nBaseExtent = std::max( FRound( aDPISize.Width() / 300. ), 1L ); long nMove; const sal_uInt16 nTrans = ( nTransparencePercent < 13 ) ? 0 : @@ -1429,7 +1429,7 @@ bool Printer::SetPaperSizeUser( const Size& rSize, bool bMatchNearest ) return false; const Size aPixSize = LogicToPixel( rSize ); - const Size aPageSize = PixelToLogic( aPixSize, MapUnit::Map100thMM ); + const Size aPageSize = PixelToLogic(aPixSize, MapMode(MapUnit::Map100thMM)); bool bNeedToChange(maJobSetup.ImplGetConstData().GetPaperWidth() != aPageSize.Width() || maJobSetup.ImplGetConstData().GetPaperHeight() != aPageSize.Height()); @@ -1518,7 +1518,7 @@ OUString Printer::GetPaperName( Paper ePaper ) OUString Printer::GetPaperName() const { - Size aPageSize = PixelToLogic( GetPaperSizePixel(), MapUnit::Map100thMM ); + Size aPageSize = PixelToLogic( GetPaperSizePixel(), MapMode(MapUnit::Map100thMM)); Paper ePaper = ImplGetPaperFormat( aPageSize.Width(), aPageSize.Height() ); if( ePaper == PAPER_USER ) ePaper = ImplGetPaperFormat( aPageSize.Height(), aPageSize.Width() ); diff --git a/vcl/source/gdi/print3.cxx b/vcl/source/gdi/print3.cxx index 26d8f5fd2141..4a8006b2a8b6 100644 --- a/vcl/source/gdi/print3.cxx +++ b/vcl/source/gdi/print3.cxx @@ -1282,7 +1282,7 @@ void PrinterController::printFilteredPage( int i_nPage ) } // in N-Up printing set the correct page size - mpImplData->mxPrinter->SetMapMode( MapUnit::Map100thMM ); + mpImplData->mxPrinter->SetMapMode(MapMode(MapUnit::Map100thMM)); // aPageSize was filtered through mpImplData->getRealPaperSize already by getFilteredPageFile() mpImplData->mxPrinter->SetPaperSizeUser( aPageSize.aSize, ! mpImplData->isFixedPageSize() ); if( mpImplData->mnFixedPaperBin != -1 && diff --git a/vcl/source/gdi/textlayout.cxx b/vcl/source/gdi/textlayout.cxx index 8623cd0c6935..f533e84c0ba1 100644 --- a/vcl/source/gdi/textlayout.cxx +++ b/vcl/source/gdi/textlayout.cxx @@ -133,14 +133,14 @@ namespace vcl // now that the Zoom is part of the map mode, reset the target device's font to the "unzoomed" version Font aDrawFont( m_aUnzoomedPointFont ); - aDrawFont.SetFontSize( OutputDevice::LogicToLogic( aDrawFont.GetFontSize(), MapUnit::MapPoint, eTargetMapUnit ) ); + aDrawFont.SetFontSize( OutputDevice::LogicToLogic(aDrawFont.GetFontSize(), MapMode(MapUnit::MapPoint), MapMode(eTargetMapUnit)) ); _rTargetDevice.SetFont( aDrawFont ); // transfer font to the reference device m_rReferenceDevice.Push( PushFlags::FONT | PushFlags::TEXTLAYOUTMODE ); Font aRefFont( m_aUnzoomedPointFont ); aRefFont.SetFontSize( OutputDevice::LogicToLogic( - aRefFont.GetFontSize(), MapUnit::MapPoint, m_rReferenceDevice.GetMapMode().GetMapUnit() ) ); + aRefFont.GetFontSize(), MapMode(MapUnit::MapPoint), m_rReferenceDevice.GetMapMode()) ); m_rReferenceDevice.SetFont( aRefFont ); } diff --git a/vcl/source/gdi/vectorgraphicdata.cxx b/vcl/source/gdi/vectorgraphicdata.cxx index d5d66f80c440..48d6ecf65286 100644 --- a/vcl/source/gdi/vectorgraphicdata.cxx +++ b/vcl/source/gdi/vectorgraphicdata.cxx @@ -59,7 +59,7 @@ BitmapEx convertPrimitive2DSequenceToBitmapEx( aRealRect.Y2 = rTargetRange.getMaxY(); // get system DPI - const Size aDPI(Application::GetDefaultDevice()->LogicToPixel(Size(1, 1), MapUnit::MapInch)); + const Size aDPI(Application::GetDefaultDevice()->LogicToPixel(Size(1, 1), MapMode(MapUnit::MapInch))); const uno::Reference< rendering::XBitmap > xBitmap( xPrimitive2DRenderer->rasterize( diff --git a/vcl/source/outdev/bitmap.cxx b/vcl/source/outdev/bitmap.cxx index 97dc646fda5b..cfdae8d46e9d 100644 --- a/vcl/source/outdev/bitmap.cxx +++ b/vcl/source/outdev/bitmap.cxx @@ -196,7 +196,7 @@ Bitmap OutputDevice::GetDownsampledBitmap( const Size& rDstSz, if( !aBmp.IsEmpty() ) { // do downsampling if necessary - Size aDstSizeTwip( PixelToLogic( LogicToPixel( rDstSz ), MapUnit::MapTwip ) ); + Size aDstSizeTwip( PixelToLogic(LogicToPixel(rDstSz), MapMode(MapUnit::MapTwip)) ); // #103209# Normalize size (mirroring has to happen outside of this method) aDstSizeTwip = Size( labs(aDstSizeTwip.Width()), labs(aDstSizeTwip.Height()) ); diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx index 39219b35e8e0..441ea7d59721 100644 --- a/vcl/source/window/printdlg.cxx +++ b/vcl/source/window/printdlg.cxx @@ -279,7 +279,7 @@ void PrintDialog::PrintPreviewWindow::preparePreviewBitmap() maPageVDev->Erase(); maPageVDev->Push(); - maPageVDev->SetMapMode( MapUnit::Map100thMM ); + maPageVDev->SetMapMode(MapMode(MapUnit::Map100thMM)); DrawModeFlags nOldDrawMode = maPageVDev->GetDrawMode(); if( mbGreyscale ) maPageVDev->SetDrawMode( maPageVDev->GetDrawMode() | @@ -296,8 +296,8 @@ void PrintDialog::PrintPreviewWindow::preparePreviewBitmap() maPageVDev->Pop(); - SetMapMode( MapUnit::MapPixel ); - maPageVDev->SetMapMode( MapUnit::MapPixel ); + SetMapMode(MapMode(MapUnit::MapPixel)); + maPageVDev->SetMapMode(MapMode(MapUnit::MapPixel)); maPreviewBitmap = maPageVDev->GetBitmap(Point(0, 0), aVDevSize); @@ -322,7 +322,7 @@ void PrintDialog::ShowNupOrderWindow::Paint(vcl::RenderContext& rRenderContext, { Window::Paint(rRenderContext, i_rRect); - rRenderContext.SetMapMode(MapUnit::MapPixel); + rRenderContext.SetMapMode(MapMode(MapUnit::MapPixel)); rRenderContext.SetTextColor(rRenderContext.GetSettings().GetStyleSettings().GetFieldTextColor()); int nPages = mnRows * mnColumns; diff --git a/vcl/source/window/split.cxx b/vcl/source/window/split.cxx index ad991269c258..3421e679614f 100644 --- a/vcl/source/window/split.cxx +++ b/vcl/source/window/split.cxx @@ -695,7 +695,7 @@ void Splitter::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& Size Splitter::GetOptimalSize() const { - return LogicToPixel(Size(3, 3), MapUnit::MapAppFont); + return LogicToPixel(Size(3, 3), MapMode(MapUnit::MapAppFont)); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |