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 /filter | |
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 'filter')
-rw-r--r-- | filter/source/graphicfilter/egif/egif.cxx | 2 | ||||
-rw-r--r-- | filter/source/graphicfilter/eps/eps.cxx | 2 | ||||
-rw-r--r-- | filter/source/graphicfilter/etiff/etiff.cxx | 2 | ||||
-rw-r--r-- | filter/source/graphicfilter/ieps/ieps.cxx | 16 | ||||
-rw-r--r-- | filter/source/graphicfilter/ipsd/ipsd.cxx | 2 | ||||
-rw-r--r-- | filter/source/msfilter/escherex.cxx | 6 | ||||
-rw-r--r-- | filter/source/msfilter/msdffimp.cxx | 12 | ||||
-rw-r--r-- | filter/source/pdf/pdfexport.cxx | 4 | ||||
-rw-r--r-- | filter/source/svg/svgexport.cxx | 12 | ||||
-rw-r--r-- | filter/source/svg/svgfontexport.cxx | 2 | ||||
-rw-r--r-- | filter/source/svg/svgwriter.cxx | 6 |
11 files changed, 33 insertions, 33 deletions
diff --git a/filter/source/graphicfilter/egif/egif.cxx b/filter/source/graphicfilter/egif/egif.cxx index 66778e06369d..d8e7eb3f4591 100644 --- a/filter/source/graphicfilter/egif/egif.cxx +++ b/filter/source/graphicfilter/egif/egif.cxx @@ -102,7 +102,7 @@ bool GIFWriter::WriteGIF(const Graphic& rGraphic, FilterConfigItem* pFilterConfi bool bLogSize = ( aMap.GetMapUnit() != MapUnit::MapPixel ); if( bLogSize ) - aSize100 = OutputDevice::LogicToLogic( rGraphic.GetPrefSize(), aMap, MapUnit::Map100thMM ); + aSize100 = OutputDevice::LogicToLogic(rGraphic.GetPrefSize(), aMap, MapMode(MapUnit::Map100thMM)); bStatus = true; nLastPercent = 0; diff --git a/filter/source/graphicfilter/eps/eps.cxx b/filter/source/graphicfilter/eps/eps.cxx index c407c9fcbde1..a155d8d5dd65 100644 --- a/filter/source/graphicfilter/eps/eps.cxx +++ b/filter/source/graphicfilter/eps/eps.cxx @@ -456,7 +456,7 @@ void PSWriter::ImplWriteProlog( const Graphic* pPreview ) ImplWriteLong( 0 ); ImplWriteLong( 0 ); Size aSizePoint = OutputDevice::LogicToLogic( pMTF->GetPrefSize(), - pMTF->GetPrefMapMode(), MapUnit::MapPoint ); + pMTF->GetPrefMapMode(), MapMode(MapUnit::MapPoint)); ImplWriteLong( aSizePoint.Width() ); ImplWriteLong( aSizePoint.Height() ,PS_RET ); ImplWriteLine( "%%Pages: 0" ); diff --git a/filter/source/graphicfilter/etiff/etiff.cxx b/filter/source/graphicfilter/etiff/etiff.cxx index 5a77fad0fc23..f02985fc1658 100644 --- a/filter/source/graphicfilter/etiff/etiff.cxx +++ b/filter/source/graphicfilter/etiff/etiff.cxx @@ -195,7 +195,7 @@ bool TIFFWriter::WriteTIFF( const Graphic& rGraphic, FilterConfigItem const * pF if ( aMapMode.GetMapUnit() != MapUnit::MapPixel ) { const Size aPrefSize( rGraphic.GetPrefSize() ); - aDestMapSize = OutputDevice::LogicToLogic( aPrefSize, aMapMode, MapUnit::MapInch ); + aDestMapSize = OutputDevice::LogicToLogic(aPrefSize, aMapMode, MapMode(MapUnit::MapInch)); } ImplWriteResolution( mnXResPos, aDestMapSize.Width() ); ImplWriteResolution( mnYResPos, aDestMapSize.Height() ); diff --git a/filter/source/graphicfilter/ieps/ieps.cxx b/filter/source/graphicfilter/ieps/ieps.cxx index 65414afe6a82..4d6001cd9538 100644 --- a/filter/source/graphicfilter/ieps/ieps.cxx +++ b/filter/source/graphicfilter/ieps/ieps.cxx @@ -135,17 +135,17 @@ static void MakeAsMeta(Graphic &rGraphic) if( !aSize.Width() || !aSize.Height() ) aSize = Application::GetDefaultDevice()->PixelToLogic( - aBmp.GetSizePixel(), MapUnit::Map100thMM ); + aBmp.GetSizePixel(), MapMode(MapUnit::Map100thMM)); else aSize = OutputDevice::LogicToLogic( aSize, - aBmp.GetPrefMapMode(), MapUnit::Map100thMM ); + aBmp.GetPrefMapMode(), MapMode(MapUnit::Map100thMM)); pVDev->EnableOutput( false ); aMtf.Record( pVDev ); pVDev->DrawBitmap( Point(), aSize, rGraphic.GetBitmap() ); aMtf.Stop(); aMtf.WindStart(); - aMtf.SetPrefMapMode( MapUnit::Map100thMM ); + aMtf.SetPrefMapMode(MapMode(MapUnit::Map100thMM)); aMtf.SetPrefSize( aSize ); rGraphic = aMtf; } @@ -554,7 +554,7 @@ void MakePreview(sal_uInt8* pBuf, sal_uInt32 nBytesRead, pVDev->Pop(); aMtf.Stop(); aMtf.WindStart(); - aMtf.SetPrefMapMode( MapUnit::MapPoint ); + aMtf.SetPrefMapMode(MapMode(MapUnit::MapPoint)); aMtf.SetPrefSize( Size( nWidth, nHeight ) ); rGraphic = aMtf; } @@ -731,13 +731,13 @@ ipsGraphicImport( SvStream & rStream, Graphic & rGraphic, FilterConfigItem* ) aMtf.Record( pVDev ); aSize = aBitmap.GetPrefSize(); if( !aSize.Width() || !aSize.Height() ) - aSize = Application::GetDefaultDevice()->PixelToLogic( aBitmap.GetSizePixel(), MapUnit::Map100thMM ); + aSize = Application::GetDefaultDevice()->PixelToLogic(aBitmap.GetSizePixel(), MapMode(MapUnit::Map100thMM)); else - aSize = OutputDevice::LogicToLogic( aSize, aBitmap.GetPrefMapMode(), MapUnit::Map100thMM ); + aSize = OutputDevice::LogicToLogic(aSize, aBitmap.GetPrefMapMode(), MapMode(MapUnit::Map100thMM)); pVDev->DrawBitmap( Point(), aSize, aBitmap ); aMtf.Stop(); aMtf.WindStart(); - aMtf.SetPrefMapMode( MapUnit::Map100thMM ); + aMtf.SetPrefMapMode(MapMode(MapUnit::Map100thMM)); aMtf.SetPrefSize( aSize ); aGraphic = aMtf; bHasPreview = bRetValue = true; @@ -790,7 +790,7 @@ ipsGraphicImport( SvStream & rStream, Graphic & rGraphic, FilterConfigItem* ) aGfxLink, aGraphic.GetGDIMetaFile() ) ) ); CreateMtfReplacementAction( aMtf, rStream, nOrigPos, nPSSize, nPosWMF, nSizeWMF, nPosTIFF, nSizeTIFF ); aMtf.WindStart(); - aMtf.SetPrefMapMode( MapUnit::MapPoint ); + aMtf.SetPrefMapMode(MapMode(MapUnit::MapPoint)); aMtf.SetPrefSize( Size( nWidth, nHeight ) ); rGraphic = aMtf; bRetValue = true; diff --git a/filter/source/graphicfilter/ipsd/ipsd.cxx b/filter/source/graphicfilter/ipsd/ipsd.cxx index 41eac7db2a37..21214a799657 100644 --- a/filter/source/graphicfilter/ipsd/ipsd.cxx +++ b/filter/source/graphicfilter/ipsd/ipsd.cxx @@ -147,7 +147,7 @@ bool PSDReader::ReadPSD(Graphic & rGraphic ) Fraction aFractX( 1, mnXResFixed >> 16 ); Fraction aFractY( 1, mnYResFixed >> 16 ); MapMode aMapMode( MapUnit::MapInch, aEmptyPoint, aFractX, aFractY ); - Size aPrefSize = OutputDevice::LogicToLogic( aBitmapSize, aMapMode, MapUnit::Map100thMM ); + Size aPrefSize = OutputDevice::LogicToLogic(aBitmapSize, aMapMode, MapMode(MapUnit::Map100thMM)); rGraphic.SetPrefSize( aPrefSize ); rGraphic.SetPrefMapMode( MapMode( MapUnit::Map100thMM ) ); } diff --git a/filter/source/msfilter/escherex.cxx b/filter/source/msfilter/escherex.cxx index e0feee627745..5075c342bbd5 100644 --- a/filter/source/msfilter/escherex.cxx +++ b/filter/source/msfilter/escherex.cxx @@ -1113,10 +1113,10 @@ void EscherPropertyContainer::CreateLineProperties( static Size lcl_SizeToEmu(Size aPrefSize, const MapMode& aPrefMapMode) { Size aRetSize; - if (aPrefMapMode == MapUnit::MapPixel) - aRetSize = Application::GetDefaultDevice()->PixelToLogic( aPrefSize, MapUnit::Map100thMM ); + if (aPrefMapMode.GetMapUnit() == MapUnit::MapPixel) + aRetSize = Application::GetDefaultDevice()->PixelToLogic(aPrefSize, MapMode(MapUnit::Map100thMM)); else - aRetSize = OutputDevice::LogicToLogic( aPrefSize, aPrefMapMode, MapUnit::Map100thMM ); + aRetSize = OutputDevice::LogicToLogic(aPrefSize, aPrefMapMode, MapMode(MapUnit::Map100thMM)); return aRetSize; } diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx index e8d4657a8456..bd5e717ef2e3 100644 --- a/filter/source/msfilter/msdffimp.cxx +++ b/filter/source/msfilter/msdffimp.cxx @@ -192,11 +192,11 @@ void Impl_OlePres::Write( SvStream & rStm ) { Size aPrefS( pMtf->GetPrefSize() ); Size aS( aPrefS ); - aS = OutputDevice::LogicToLogic( aS, nMU, MapUnit::Map100thMM ); + aS = OutputDevice::LogicToLogic(aS, MapMode(nMU), MapMode(MapUnit::Map100thMM)); pMtf->Scale( Fraction( aS.Width(), aPrefS.Width() ), Fraction( aS.Height(), aPrefS.Height() ) ); - pMtf->SetPrefMapMode( MapUnit::Map100thMM ); + pMtf->SetPrefMapMode(MapMode(MapUnit::Map100thMM)); pMtf->SetPrefSize( aS ); } WriteWindowMetafileBits( rStm, *pMtf ); @@ -3695,7 +3695,7 @@ static Size lcl_GetPrefSize(const Graphic& rGraf, const MapMode& aWanted) if (aPrefMapMode == aWanted) return rGraf.GetPrefSize(); Size aRetSize; - if (aPrefMapMode == MapUnit::MapPixel) + if (aPrefMapMode.GetMapUnit() == MapUnit::MapPixel) { aRetSize = Application::GetDefaultDevice()->PixelToLogic( rGraf.GetPrefSize(), aWanted); @@ -3725,7 +3725,7 @@ static void lcl_ApplyCropping( const DffPropSet& rPropSet, SfxItemSet* pSet, Gra sal_uInt32 nTop( 0 ), nBottom( 0 ), nLeft( 0 ), nRight( 0 ); if ( pSet ) // use crop attributes ? - aCropSize = lcl_GetPrefSize( rGraf, MapUnit::Map100thMM ); + aCropSize = lcl_GetPrefSize(rGraf, MapMode(MapUnit::Map100thMM)); else { aCropBitmap = rGraf.GetBitmapEx(); @@ -4455,7 +4455,7 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r rOutliner.SetUpdateMode( false ); rOutliner.SetText( *pParaObj ); ScopedVclPtrInstance< VirtualDevice > pVirDev(DeviceFormat::BITMASK); - pVirDev->SetMapMode( MapUnit::Map100thMM ); + pVirDev->SetMapMode(MapMode(MapUnit::Map100thMM)); sal_Int32 i, nParagraphs = rOutliner.GetParagraphCount(); if ( nParagraphs ) { @@ -6507,7 +6507,7 @@ bool SvxMSDffManager::GetBLIPDirect( SvStream& rBLIPStream, Graphic& rData, tool aMtf.Scale( (double) aMtfSize100.Width() / aOldSize.Width(), (double) aMtfSize100.Height() / aOldSize.Height() ); aMtf.SetPrefSize( aMtfSize100 ); - aMtf.SetPrefMapMode( MapUnit::Map100thMM ); + aMtf.SetPrefMapMode(MapMode(MapUnit::Map100thMM)); rData = aMtf; } } diff --git a/filter/source/pdf/pdfexport.cxx b/filter/source/pdf/pdfexport.cxx index ffa952ada11f..ca454bbd65f7 100644 --- a/filter/source/pdf/pdfexport.cxx +++ b/filter/source/pdf/pdfexport.cxx @@ -242,7 +242,7 @@ bool PDFExport::ExportSelection( vcl::PDFWriter& rPDFWriter, { bRet = true; // #i18334# nPageCount == 0, rPDFWriter.NewPage( 10000, 10000 ); // creating dummy page - rPDFWriter.SetMapMode( MapUnit::Map100thMM ); + rPDFWriter.SetMapMode(MapMode(MapUnit::Map100thMM)); } } } @@ -1005,7 +1005,7 @@ void PDFExport::showErrors( const std::set< vcl::PDFWriter::ErrorCode >& rErrors bool PDFExport::ImplExportPage( vcl::PDFWriter& rWriter, vcl::PDFExtOutDevData& rPDFExtOutDevData, const GDIMetaFile& rMtf ) { basegfx::B2DPolygon aSize(tools::Polygon(tools::Rectangle(Point(0, 0), rMtf.GetPrefSize())).getB2DPolygon()); - basegfx::B2DPolygon aSizePDF(OutputDevice::LogicToLogic(aSize, rMtf.GetPrefMapMode(), MapUnit::MapPoint)); + basegfx::B2DPolygon aSizePDF(OutputDevice::LogicToLogic(aSize, rMtf.GetPrefMapMode(), MapMode(MapUnit::MapPoint))); basegfx::B2DRange aRangePDF(aSizePDF.getB2DRange()); Point aOrigin; tools::Rectangle aPageRect( aOrigin, rMtf.GetPrefSize() ); diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx index a7409f4cfeef..a01a959bd43e 100644 --- a/filter/source/svg/svgexport.cxx +++ b/filter/source/svg/svgexport.cxx @@ -1946,7 +1946,7 @@ bool SVGFilter::implCreateObjectsFromShape( const Reference< XDrawPage > & rxPag aMtf.AddAction( new MetaBmpExScaleAction( aNullPt, aSize, aGraphic.GetBitmapEx() ) ); aMtf.SetPrefSize( aSize ); - aMtf.SetPrefMapMode( MapUnit::Map100thMM ); + aMtf.SetPrefMapMode(MapMode(MapUnit::Map100thMM)); (*mpObjects)[ rxShape ] = ObjectRepresentation( rxShape, aMtf ); } @@ -2011,14 +2011,14 @@ bool SVGFilter::implCreateObjectsFromShape( const Reference< XDrawPage > & rxPag pAction->Duplicate(); aEmbeddedBitmapMtf.AddAction( pAction ); aEmbeddedBitmapMtf.SetPrefSize( aSize ); - aEmbeddedBitmapMtf.SetPrefMapMode( MapUnit::Map100thMM ); + aEmbeddedBitmapMtf.SetPrefMapMode(MapMode(MapUnit::Map100thMM)); mEmbeddedBitmapActionSet.insert( ObjectRepresentation( rxShape, aEmbeddedBitmapMtf ) ); pAction->Duplicate(); aMtf.AddAction( pAction ); } } aMtf.SetPrefSize( aSize ); - aMtf.SetPrefMapMode( MapUnit::Map100thMM ); + aMtf.SetPrefMapMode(MapMode(MapUnit::Map100thMM)); mEmbeddedBitmapActionMap[ rxShape ] = ObjectRepresentation( rxShape, aMtf ); } } @@ -2303,7 +2303,7 @@ IMPL_LINK( SVGFilter, CalcFieldHdl, EditFieldInfo*, pInfo, void ) void SVGExport::writeMtf( const GDIMetaFile& rMtf ) { - const Size aSize( OutputDevice::LogicToLogic( rMtf.GetPrefSize(), rMtf.GetPrefMapMode(), MapUnit::MapMM ) ); + const Size aSize( OutputDevice::LogicToLogic(rMtf.GetPrefSize(), rMtf.GetPrefMapMode(), MapMode(MapUnit::MapMM)) ); rtl::OUString aAttr; Reference< XExtendedDocumentHandler> xExtDocHandler( GetDocHandler(), UNO_QUERY ); @@ -2342,8 +2342,8 @@ void SVGExport::writeMtf( const GDIMetaFile& rMtf ) aObjects.emplace_back( Reference< XInterface >(), rMtf ); SVGFontExport aSVGFontExport( *this, aObjects ); - Point aPoint100thmm( OutputDevice::LogicToLogic( rMtf.GetPrefMapMode().GetOrigin(), rMtf.GetPrefMapMode(), MapUnit::Map100thMM ) ); - Size aSize100thmm( OutputDevice::LogicToLogic( rMtf.GetPrefSize(), rMtf.GetPrefMapMode(), MapUnit::Map100thMM ) ); + Point aPoint100thmm( OutputDevice::LogicToLogic(rMtf.GetPrefMapMode().GetOrigin(), rMtf.GetPrefMapMode(), MapMode(MapUnit::Map100thMM)) ); + Size aSize100thmm( OutputDevice::LogicToLogic(rMtf.GetPrefSize(), rMtf.GetPrefMapMode(), MapMode(MapUnit::Map100thMM)) ); SVGActionWriter aWriter( *this, aSVGFontExport ); aWriter.WriteMetaFile( aPoint100thmm, aSize100thmm, rMtf, diff --git a/filter/source/svg/svgfontexport.cxx b/filter/source/svg/svgfontexport.cxx index 27e092974a44..1f31e42e1c3c 100644 --- a/filter/source/svg/svgfontexport.cxx +++ b/filter/source/svg/svgfontexport.cxx @@ -190,7 +190,7 @@ void SVGFontExport::implEmbedFont( const vcl::Font& rFont ) aFont.SetFontSize( Size( 0, nFontEM ) ); aFont.SetAlignment( ALIGN_BASELINE ); - pVDev->SetMapMode( MapUnit::Map100thMM ); + pVDev->SetMapMode(MapMode(MapUnit::Map100thMM)); pVDev->SetFont( aFont ); mrExport.AddAttribute( XML_NAMESPACE_NONE, "id", aCurIdStr += OUString::number( ++mnCurFontId ) ); diff --git a/filter/source/svg/svgwriter.cxx b/filter/source/svg/svgwriter.cxx index 7d06983c4dbc..95b229723474 100644 --- a/filter/source/svg/svgwriter.cxx +++ b/filter/source/svg/svgwriter.cxx @@ -1731,7 +1731,7 @@ SVGActionWriter::SVGActionWriter( SVGExport& rExport, SVGFontExport& rFontExport { mpVDev = VclPtr<VirtualDevice>::Create(); mpVDev->EnableOutput( false ); - maTargetMapMode = MapUnit::Map100thMM; + maTargetMapMode = MapMode(MapUnit::Map100thMM); maTextWriter.setVirtualDevice( mpVDev, maTargetMapMode ); } @@ -3741,11 +3741,11 @@ void SVGActionWriter::WriteMetaFile( const Point& rPos100thmm, mpVDev->Push(); - Size aSize( OutputDevice::LogicToLogic( rSize100thmm, MapUnit::Map100thMM, aMapMode ) ); + Size aSize( OutputDevice::LogicToLogic(rSize100thmm, MapMode(MapUnit::Map100thMM), aMapMode) ); aMapMode.SetScaleX( aFractionX *= Fraction( aSize.Width(), aPrefSize.Width() ) ); aMapMode.SetScaleY( aFractionY *= Fraction( aSize.Height(), aPrefSize.Height() ) ); - Point aOffset( OutputDevice::LogicToLogic( rPos100thmm, MapUnit::Map100thMM, aMapMode ) ); + Point aOffset( OutputDevice::LogicToLogic(rPos100thmm, MapMode(MapUnit::Map100thMM), aMapMode ) ); aMapMode.SetOrigin( aOffset += aMapMode.GetOrigin() ); mpVDev->SetMapMode( aMapMode ); |