diff options
Diffstat (limited to 'svtools/source/misc')
-rw-r--r-- | svtools/source/misc/embedhlp.cxx | 4 | ||||
-rw-r--r-- | svtools/source/misc/embedtransfer.cxx | 4 | ||||
-rw-r--r-- | svtools/source/misc/imap.cxx | 14 | ||||
-rw-r--r-- | svtools/source/misc/imap2.cxx | 4 | ||||
-rw-r--r-- | svtools/source/misc/transfer.cxx | 8 | ||||
-rw-r--r-- | svtools/source/misc/unitconv.cxx | 96 |
6 files changed, 65 insertions, 65 deletions
diff --git a/svtools/source/misc/embedhlp.cxx b/svtools/source/misc/embedhlp.cxx index 9a61bfc7cce0..564b5a096479 100644 --- a/svtools/source/misc/embedhlp.cxx +++ b/svtools/source/misc/embedhlp.cxx @@ -463,7 +463,7 @@ const Graphic* EmbeddedObjectRef::GetGraphic() const Size EmbeddedObjectRef::GetSize( MapMode* pTargetMapMode ) const { - MapMode aSourceMapMode( MAP_100TH_MM ); + MapMode aSourceMapMode( MapUnit::Map100thMM ); Size aResult; if ( mpImpl->nViewAspect == embed::Aspects::MSOLE_ICON ) @@ -640,7 +640,7 @@ SvStream* EmbeddedObjectRef::GetGraphicStream( bool bUpdate ) const void EmbeddedObjectRef::DrawPaintReplacement( const Rectangle &rRect, const OUString &rText, OutputDevice *pOut ) { - MapMode aMM( MAP_APPFONT ); + MapMode aMM( MapUnit::MapAppFont ); Size aAppFontSz = pOut->LogicToLogic( Size( 0, 8 ), &aMM, nullptr ); vcl::Font aFnt( OUString("Helvetica"), aAppFontSz ); aFnt.SetTransparent( true ); diff --git a/svtools/source/misc/embedtransfer.cxx b/svtools/source/misc/embedtransfer.cxx index 8dab2ac5abdb..1a867e22e240 100644 --- a/svtools/source/misc/embedtransfer.cxx +++ b/svtools/source/misc/embedtransfer.cxx @@ -218,7 +218,7 @@ void SvEmbedTransferHelper::FillTransferableObjectDescriptor( TransferableObject rDesc.mnOle2Misc = sal::static_int_cast<sal_Int32>(xObj->getStatus( rDesc.mnViewAspect )); Size aSize; - MapMode aMapMode( MAP_100TH_MM ); + MapMode aMapMode( MapUnit::Map100thMM ); if ( nAspect == embed::Aspects::MSOLE_ICON ) { if ( pGraphic ) @@ -247,7 +247,7 @@ void SvEmbedTransferHelper::FillTransferableObjectDescriptor( TransferableObject aMapMode = MapMode( VCLUnoHelper::UnoEmbed2VCLMapUnit( xObj->getMapUnit( rDesc.mnViewAspect ) ) ); } - rDesc.maSize = OutputDevice::LogicToLogic( aSize, aMapMode, MapMode( MAP_100TH_MM ) ); + rDesc.maSize = OutputDevice::LogicToLogic( aSize, aMapMode, MapMode( MapUnit::Map100thMM ) ); rDesc.maDragStartPos = Point(); rDesc.maDisplayName.clear(); } diff --git a/svtools/source/misc/imap.cxx b/svtools/source/misc/imap.cxx index e37763b52a9a..1b96d67840f7 100644 --- a/svtools/source/misc/imap.cxx +++ b/svtools/source/misc/imap.cxx @@ -151,7 +151,7 @@ IMapRectangleObject::IMapRectangleObject( const Rectangle& rRect, void IMapRectangleObject::ImpConstruct( const Rectangle& rRect, bool bPixel ) { if ( bPixel ) - aRect = Application::GetDefaultDevice()->PixelToLogic( rRect, MapMode( MAP_100TH_MM ) ); + aRect = Application::GetDefaultDevice()->PixelToLogic( rRect, MapMode( MapUnit::Map100thMM ) ); else aRect = rRect; } @@ -209,7 +209,7 @@ Rectangle IMapRectangleObject::GetRectangle( bool bPixelCoords ) const Rectangle aNewRect; if ( bPixelCoords ) - aNewRect = Application::GetDefaultDevice()->LogicToPixel( aRect, MapMode( MAP_100TH_MM ) ); + aNewRect = Application::GetDefaultDevice()->LogicToPixel( aRect, MapMode( MapUnit::Map100thMM ) ); else aNewRect = aRect; @@ -252,7 +252,7 @@ void IMapCircleObject::ImpConstruct( const Point& rCenter, sal_uLong nRad, bool { if ( bPixel ) { - MapMode aMap100( MAP_100TH_MM ); + MapMode aMap100( MapUnit::Map100thMM ); aCenter = Application::GetDefaultDevice()->PixelToLogic( rCenter, aMap100 ); nRadius = Application::GetDefaultDevice()->PixelToLogic( Size( nRad, 0 ), aMap100 ).Width(); @@ -334,7 +334,7 @@ Point IMapCircleObject::GetCenter( bool bPixelCoords ) const Point aNewPoint; if ( bPixelCoords ) - aNewPoint = Application::GetDefaultDevice()->LogicToPixel( aCenter, MapMode( MAP_100TH_MM ) ); + aNewPoint = Application::GetDefaultDevice()->LogicToPixel( aCenter, MapMode( MapUnit::Map100thMM ) ); else aNewPoint = aCenter; @@ -346,7 +346,7 @@ sal_uLong IMapCircleObject::GetRadius( bool bPixelCoords ) const sal_uLong nNewRadius; if ( bPixelCoords ) - nNewRadius = Application::GetDefaultDevice()->LogicToPixel( Size( nRadius, 0 ), MapMode( MAP_100TH_MM ) ).Width(); + nNewRadius = Application::GetDefaultDevice()->LogicToPixel( Size( nRadius, 0 ), MapMode( MapUnit::Map100thMM ) ).Width(); else nNewRadius = nRadius; @@ -395,7 +395,7 @@ IMapPolygonObject::IMapPolygonObject( const tools::Polygon& rPoly, void IMapPolygonObject::ImpConstruct( const tools::Polygon& rPoly, bool bPixel ) { if ( bPixel ) - aPoly = Application::GetDefaultDevice()->PixelToLogic( rPoly, MapMode( MAP_100TH_MM ) ); + aPoly = Application::GetDefaultDevice()->PixelToLogic( rPoly, MapMode( MapUnit::Map100thMM ) ); else aPoly = rPoly; } @@ -462,7 +462,7 @@ tools::Polygon IMapPolygonObject::GetPolygon( bool bPixelCoords ) const tools::Polygon aNewPoly; if ( bPixelCoords ) - aNewPoly = Application::GetDefaultDevice()->LogicToPixel( aPoly, MapMode( MAP_100TH_MM ) ); + aNewPoly = Application::GetDefaultDevice()->LogicToPixel( aPoly, MapMode( MapUnit::Map100thMM ) ); else aNewPoly = aPoly; diff --git a/svtools/source/misc/imap2.cxx b/svtools/source/misc/imap2.cxx index b031d4c85cc7..8ca4349421fd 100644 --- a/svtools/source/misc/imap2.cxx +++ b/svtools/source/misc/imap2.cxx @@ -39,7 +39,7 @@ void IMapObject::AppendCERNCoords(OStringBuffer& rBuf, const Point& rPoint100) { - const Point aPixPt( Application::GetDefaultDevice()->LogicToPixel( rPoint100, MapMode( MAP_100TH_MM ) ) ); + const Point aPixPt( Application::GetDefaultDevice()->LogicToPixel( rPoint100, MapMode( MapUnit::Map100thMM ) ) ); rBuf.append('('); rBuf.append(static_cast<sal_Int32>(aPixPt.X())); @@ -50,7 +50,7 @@ void IMapObject::AppendCERNCoords(OStringBuffer& rBuf, const Point& rPoint100) void IMapObject::AppendNCSACoords(OStringBuffer& rBuf, const Point& rPoint100) { - const Point aPixPt( Application::GetDefaultDevice()->LogicToPixel( rPoint100, MapMode( MAP_100TH_MM ) ) ); + const Point aPixPt( Application::GetDefaultDevice()->LogicToPixel( rPoint100, MapMode( MapUnit::Map100thMM ) ) ); rBuf.append(static_cast<sal_Int32>(aPixPt.X())); rBuf.append(','); diff --git a/svtools/source/misc/transfer.cxx b/svtools/source/misc/transfer.cxx index b156b61220bd..8efdce0b1512 100644 --- a/svtools/source/misc/transfer.cxx +++ b/svtools/source/misc/transfer.cxx @@ -1609,18 +1609,18 @@ bool TransferableDataHelper::GetBitmapEx( const DataFlavor& rFlavor, BitmapEx& r { const MapMode aMapMode(rBmpEx.GetPrefMapMode()); - if(MAP_PIXEL != aMapMode.GetMapUnit()) + if(MapUnit::MapPixel != aMapMode.GetMapUnit()) { - const Size aSize(OutputDevice::LogicToLogic(rBmpEx.GetPrefSize(), aMapMode, MAP_100TH_MM)); + const Size aSize(OutputDevice::LogicToLogic(rBmpEx.GetPrefSize(), aMapMode, MapUnit::Map100thMM)); // #i122388# This wrongly corrects in the given case; changing from 5000 100th mm to // the described 50 cm (which is 50000 100th mm) if((aSize.Width() > 50000) || (aSize.Height() > 50000)) { - rBmpEx.SetPrefMapMode(MAP_PIXEL); + rBmpEx.SetPrefMapMode(MapUnit::MapPixel); // #i122388# also adapt size by applying the mew MapMode - const Size aNewSize(OutputDevice::LogicToLogic(aSize, MAP_100TH_MM, MAP_PIXEL)); + const Size aNewSize(OutputDevice::LogicToLogic(aSize, MapUnit::Map100thMM, MapUnit::MapPixel)); rBmpEx.SetPrefSize(aNewSize); } } diff --git a/svtools/source/misc/unitconv.cxx b/svtools/source/misc/unitconv.cxx index 250ac3b96438..acf65083136c 100644 --- a/svtools/source/misc/unitconv.cxx +++ b/svtools/source/misc/unitconv.cxx @@ -111,7 +111,7 @@ void SetFieldUnit( MetricBox& rBox, FieldUnit eUnit ) void SetMetricValue( MetricField& rField, long nCoreValue, MapUnit eUnit ) { - sal_Int64 nVal = OutputDevice::LogicToLogic( nCoreValue, (MapUnit)eUnit, MAP_100TH_MM ); + sal_Int64 nVal = OutputDevice::LogicToLogic( nCoreValue, (MapUnit)eUnit, MapUnit::Map100thMM ); nVal = rField.Normalize( nVal ); rField.SetValue( nVal, FUNIT_100TH_MM ); @@ -136,7 +136,7 @@ long GetCoreValue( const MetricField& rField, MapUnit eUnit ) } if( bRoundBefore ) nVal = rField.Denormalize( nVal ); - sal_Int64 nUnitVal = OutputDevice::LogicToLogic( static_cast<long>(nVal), MAP_100TH_MM, (MapUnit)eUnit ); + sal_Int64 nUnitVal = OutputDevice::LogicToLogic( static_cast<long>(nVal), MapUnit::Map100thMM, (MapUnit)eUnit ); if( ! bRoundBefore ) nUnitVal = rField.Denormalize( nUnitVal ); return static_cast<long>(nUnitVal); @@ -147,23 +147,23 @@ long CalcToUnit( float nIn, MapUnit eUnit ) { // nIn ist in Points - DBG_ASSERT( eUnit == MAP_TWIP || - eUnit == MAP_100TH_MM || - eUnit == MAP_10TH_MM || - eUnit == MAP_MM || - eUnit == MAP_CM, "this unit is not implemented" ); + DBG_ASSERT( eUnit == MapUnit::MapTwip || + eUnit == MapUnit::Map100thMM || + eUnit == MapUnit::Map10thMM || + eUnit == MapUnit::MapMM || + eUnit == MapUnit::MapCM, "this unit is not implemented" ); float nTmp = nIn; - if ( MAP_TWIP != eUnit ) + if ( MapUnit::MapTwip != eUnit ) nTmp = nIn * 10 / 567; switch ( eUnit ) { - case MAP_100TH_MM: nTmp *= 100; break; - case MAP_10TH_MM: nTmp *= 10; break; - case MAP_MM: break; - case MAP_CM: nTmp /= 10; break; + case MapUnit::Map100thMM: nTmp *= 100; break; + case MapUnit::Map10thMM: nTmp *= 10; break; + case MapUnit::MapMM: break; + case MapUnit::MapCM: nTmp /= 10; break; default: ;//prevent warning } @@ -180,46 +180,46 @@ long ItemToControl( long nIn, MapUnit eItem, FieldUnit eCtrl ) switch ( eItem ) { - case MAP_100TH_MM: - case MAP_10TH_MM: - case MAP_MM: + case MapUnit::Map100thMM: + case MapUnit::Map10thMM: + case MapUnit::MapMM: { - if ( eItem == MAP_10TH_MM ) + if ( eItem == MapUnit::Map10thMM ) nIn /= 10; - else if ( eItem == MAP_100TH_MM ) + else if ( eItem == MapUnit::Map100thMM ) nIn /= 100; nOut = TransformMetric( nIn, FUNIT_MM, eCtrl ); } break; - case MAP_CM: + case MapUnit::MapCM: { nOut = TransformMetric( nIn, FUNIT_CM, eCtrl ); } break; - case MAP_1000TH_INCH: - case MAP_100TH_INCH: - case MAP_10TH_INCH: - case MAP_INCH: + case MapUnit::Map1000thInch: + case MapUnit::Map100thInch: + case MapUnit::Map10thInch: + case MapUnit::MapInch: { - if ( eItem == MAP_10TH_INCH ) + if ( eItem == MapUnit::Map10thInch ) nIn /= 10; - else if ( eItem == MAP_100TH_INCH ) + else if ( eItem == MapUnit::Map100thInch ) nIn /= 100; - else if ( eItem == MAP_1000TH_INCH ) + else if ( eItem == MapUnit::Map1000thInch ) nIn /= 1000; nOut = TransformMetric( nIn, FUNIT_INCH, eCtrl ); } break; - case MAP_POINT: + case MapUnit::MapPoint: { nOut = TransformMetric( nIn, FUNIT_POINT, eCtrl ); } break; - case MAP_TWIP: + case MapUnit::MapTwip: { nOut = TransformMetric( nIn, FUNIT_TWIP, eCtrl ); } @@ -240,24 +240,24 @@ FieldUnit MapToFieldUnit( const MapUnit eUnit ) { switch ( eUnit ) { - case MAP_100TH_MM: - case MAP_10TH_MM: - case MAP_MM: + case MapUnit::Map100thMM: + case MapUnit::Map10thMM: + case MapUnit::MapMM: return FUNIT_MM; - case MAP_CM: + case MapUnit::MapCM: return FUNIT_CM; - case MAP_1000TH_INCH: - case MAP_100TH_INCH: - case MAP_10TH_INCH: - case MAP_INCH: + case MapUnit::Map1000thInch: + case MapUnit::Map100thInch: + case MapUnit::Map10thInch: + case MapUnit::MapInch: return FUNIT_INCH; - case MAP_POINT: + case MapUnit::MapPoint: return FUNIT_POINT; - case MAP_TWIP: + case MapUnit::MapTwip: return FUNIT_TWIP; default: ;//prevent warning } @@ -267,30 +267,30 @@ FieldUnit MapToFieldUnit( const MapUnit eUnit ) long CalcToPoint( long nIn, MapUnit eUnit, sal_uInt16 nFactor ) { - DBG_ASSERT( eUnit == MAP_TWIP || - eUnit == MAP_100TH_MM || - eUnit == MAP_10TH_MM || - eUnit == MAP_MM || - eUnit == MAP_CM, "this unit is not implemented" ); + DBG_ASSERT( eUnit == MapUnit::MapTwip || + eUnit == MapUnit::Map100thMM || + eUnit == MapUnit::Map10thMM || + eUnit == MapUnit::MapMM || + eUnit == MapUnit::MapCM, "this unit is not implemented" ); long nRet = 0; - if ( MAP_TWIP == eUnit ) + if ( MapUnit::MapTwip == eUnit ) nRet = nIn; else nRet = nIn * 567; switch ( eUnit ) { - case MAP_100TH_MM: nRet /= 100; break; - case MAP_10TH_MM: nRet /= 10; break; - case MAP_MM: break; - case MAP_CM: nRet *= 10; break; + case MapUnit::Map100thMM: nRet /= 100; break; + case MapUnit::Map10thMM: nRet /= 10; break; + case MapUnit::MapMM: break; + case MapUnit::MapCM: nRet *= 10; break; default: ;//prevent warning } // ggf. aufrunden - if ( MAP_TWIP != eUnit ) + if ( MapUnit::MapTwip != eUnit ) { long nMod = 10; long nTmp = nRet % nMod; |