summaryrefslogtreecommitdiff
path: root/forms
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2016-09-20 16:41:39 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2016-10-05 06:51:20 +0000
commit954f752cf10fc6a8777af2a6a93e496688464687 (patch)
tree0fc776cdcb6ad9b1d2b9673ac044bb5b4f496972 /forms
parentc1e18e05a53c1d55afe36a887ca25f74f3f1d32d (diff)
convert MapUnit to scoped enum
I left a prefix on the names "Map" so that I would not have to re-arrange each name too much, since I can't start identifiers with digits like "100thMM" And remove RSC_EXTRAMAPUNIT, which doesn't seem to be doing anything anymore. Change-Id: I5187824aa87e30caf5357b51b5384b5ab919d224 Reviewed-on: https://gerrit.libreoffice.org/29096 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'forms')
-rw-r--r--forms/source/richtext/richtextcontrol.cxx4
-rw-r--r--forms/source/richtext/richtextengine.cxx2
-rw-r--r--forms/source/richtext/richtextimplcontrol.cxx2
-rw-r--r--forms/source/richtext/rtattributehandler.cxx8
4 files changed, 8 insertions, 8 deletions
diff --git a/forms/source/richtext/richtextcontrol.cxx b/forms/source/richtext/richtextcontrol.cxx
index 2ce0db903d7f..b961a320d638 100644
--- a/forms/source/richtext/richtextcontrol.cxx
+++ b/forms/source/richtext/richtextcontrol.cxx
@@ -345,12 +345,12 @@ namespace frm
::Size aSize = pControl->GetSizePixel();
const MapUnit eTargetUnit = pTargetDevice->GetMapMode().GetMapUnit();
- if ( eTargetUnit != MAP_PIXEL )
+ if ( eTargetUnit != MapUnit::MapPixel )
aSize = pTargetDevice->PixelToLogic( aSize );
::Point aPos( _nX, _nY );
// the XView::draw API talks about pixels, always ...
- if ( eTargetUnit != MAP_PIXEL )
+ if ( eTargetUnit != MapUnit::MapPixel )
aPos = pTargetDevice->PixelToLogic( aPos );
pControl->Draw( pTargetDevice, aPos, aSize, DrawFlags::NoControls );
diff --git a/forms/source/richtext/richtextengine.cxx b/forms/source/richtext/richtextengine.cxx
index 21fce972d948..4a9a217253ef 100644
--- a/forms/source/richtext/richtextengine.cxx
+++ b/forms/source/richtext/richtextengine.cxx
@@ -63,7 +63,7 @@ namespace frm
pPool->SetPoolDefaultItem( SvxFontItem( aFont.GetFamilyType(), aFont.GetFamilyName(), OUString(), aFont.GetPitch(), aFont.GetCharSet(), EE_CHAR_FONTINFO ) );
// 12 pt font size
- MapMode aPointMapMode( MAP_POINT );
+ MapMode aPointMapMode( MapUnit::MapPoint );
Size a12PointSize( OutputDevice::LogicToLogic( Size( 12, 0 ), aPointMapMode, aDeviceMapMode ) );
pPool->SetPoolDefaultItem( SvxFontHeightItem( a12PointSize.Width(), 100, EE_CHAR_FONTHEIGHT ) );
diff --git a/forms/source/richtext/richtextimplcontrol.cxx b/forms/source/richtext/richtextimplcontrol.cxx
index ca1bda40792f..3bc77a4d52c4 100644
--- a/forms/source/richtext/richtextimplcontrol.cxx
+++ b/forms/source/richtext/richtextimplcontrol.cxx
@@ -581,7 +581,7 @@ namespace frm
// translate coordinates
Point aPos( _rPos );
Size aSize( _rSize );
- if ( aOriginalMapMode.GetMapUnit() == MAP_PIXEL )
+ if ( aOriginalMapMode.GetMapUnit() == MapUnit::MapPixel )
{
aPos = _pDev->PixelToLogic( _rPos, aNormalizedMapMode );
aSize = _pDev->PixelToLogic( _rSize, aNormalizedMapMode );
diff --git a/forms/source/richtext/rtattributehandler.cxx b/forms/source/richtext/rtattributehandler.cxx
index 1e9998700cfa..19eaa93fc898 100644
--- a/forms/source/richtext/rtattributehandler.cxx
+++ b/forms/source/richtext/rtattributehandler.cxx
@@ -326,12 +326,12 @@ namespace frm
{
// by definition, the item should have the unit twip
sal_uLong nHeight = pFontHeightItem->GetHeight();
- if ( _rAttribs.GetPool()->GetMetric( getWhich() ) != MAP_TWIP )
+ if ( _rAttribs.GetPool()->GetMetric( getWhich() ) != MapUnit::MapTwip )
{
nHeight = OutputDevice::LogicToLogic(
Size( 0, nHeight ),
MapMode( (MapUnit)( _rAttribs.GetPool()->GetMetric( getWhich() ) ) ),
- MapMode( MAP_TWIP )
+ MapMode( MapUnit::MapTwip )
).Height();
}
@@ -354,11 +354,11 @@ namespace frm
// correct measurement units
MapUnit eItemMapUnit = pFontHeightItem->GetPropUnit(); (void)eItemMapUnit;
sal_uLong nHeight = pFontHeightItem->GetHeight();
- if ( _rNewAttribs.GetPool()->GetMetric( getWhich() ) != MAP_TWIP )
+ if ( _rNewAttribs.GetPool()->GetMetric( getWhich() ) != MapUnit::MapTwip )
{
nHeight = OutputDevice::LogicToLogic(
Size( 0, nHeight ),
- MapMode( (MapUnit)( MAP_TWIP ) ),
+ MapMode( (MapUnit)( MapUnit::MapTwip ) ),
MapMode( (MapUnit)( _rNewAttribs.GetPool()->GetMetric( getWhich() ) ) )
).Height();
}