summaryrefslogtreecommitdiff
path: root/filter
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 /filter
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 'filter')
-rw-r--r--filter/source/flash/swfwriter.cxx4
-rw-r--r--filter/source/flash/swfwriter1.cxx4
-rw-r--r--filter/source/graphicfilter/egif/egif.cxx4
-rw-r--r--filter/source/graphicfilter/eps/eps.cxx2
-rw-r--r--filter/source/graphicfilter/etiff/etiff.cxx4
-rw-r--r--filter/source/graphicfilter/idxf/dxf2mtf.cxx4
-rw-r--r--filter/source/graphicfilter/ieps/ieps.cxx16
-rw-r--r--filter/source/graphicfilter/ios2met/ios2met.cxx4
-rw-r--r--filter/source/graphicfilter/ipcx/ipcx.cxx2
-rw-r--r--filter/source/graphicfilter/ipict/ipict.cxx2
-rw-r--r--filter/source/graphicfilter/ipsd/ipsd.cxx6
-rw-r--r--filter/source/graphicfilter/itiff/itiff.cxx2
-rw-r--r--filter/source/msfilter/escherex.cxx10
-rw-r--r--filter/source/msfilter/eschesdo.cxx4
-rw-r--r--filter/source/msfilter/msdffimp.cxx30
-rw-r--r--filter/source/msfilter/svdfppt.cxx2
-rw-r--r--filter/source/pdf/impdialog.cxx2
-rw-r--r--filter/source/pdf/pdfexport.cxx10
-rw-r--r--filter/source/svg/svgexport.cxx12
-rw-r--r--filter/source/svg/svgfontexport.cxx2
-rw-r--r--filter/source/svg/svgwriter.cxx6
-rw-r--r--filter/source/xsltdialog/xmlfiltersettingsdialog.cxx8
22 files changed, 70 insertions, 70 deletions
diff --git a/filter/source/flash/swfwriter.cxx b/filter/source/flash/swfwriter.cxx
index 22841bf1787a..1cd87e5ac097 100644
--- a/filter/source/flash/swfwriter.cxx
+++ b/filter/source/flash/swfwriter.cxx
@@ -27,8 +27,8 @@ using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::io;
-static MapMode aTWIPSMode( MAP_TWIP );
-static MapMode a100thmmMode( MAP_100TH_MM );
+static MapMode aTWIPSMode( MapUnit::MapTwip );
+static MapMode a100thmmMode( MapUnit::Map100thMM );
static sal_Int32 map100thmm( sal_Int32 n100thMM )
{
diff --git a/filter/source/flash/swfwriter1.cxx b/filter/source/flash/swfwriter1.cxx
index 3db22ad9b8a6..720e8d7e920c 100644
--- a/filter/source/flash/swfwriter1.cxx
+++ b/filter/source/flash/swfwriter1.cxx
@@ -45,8 +45,8 @@ using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::io;
using namespace ::com::sun::star::beans;
-static MapMode aTWIPSMode( MAP_TWIP );
-static MapMode a100thmmMode( MAP_100TH_MM );
+static MapMode aTWIPSMode( MapUnit::MapTwip );
+static MapMode a100thmmMode( MapUnit::Map100thMM );
Point Writer::map( const Point& rPoint ) const
diff --git a/filter/source/graphicfilter/egif/egif.cxx b/filter/source/graphicfilter/egif/egif.cxx
index 5955b8f1035f..29a75abf43d8 100644
--- a/filter/source/graphicfilter/egif/egif.cxx
+++ b/filter/source/graphicfilter/egif/egif.cxx
@@ -101,10 +101,10 @@ bool GIFWriter::WriteGIF(const Graphic& rGraphic, FilterConfigItem* pFilterConfi
Size aSize100;
const MapMode aMap( rGraphic.GetPrefMapMode() );
- bool bLogSize = ( aMap.GetMapUnit() != MAP_PIXEL );
+ bool bLogSize = ( aMap.GetMapUnit() != MapUnit::MapPixel );
if( bLogSize )
- aSize100 = OutputDevice::LogicToLogic( rGraphic.GetPrefSize(), aMap, MAP_100TH_MM );
+ aSize100 = OutputDevice::LogicToLogic( rGraphic.GetPrefSize(), aMap, MapUnit::Map100thMM );
bStatus = true;
nLastPercent = 0;
diff --git a/filter/source/graphicfilter/eps/eps.cxx b/filter/source/graphicfilter/eps/eps.cxx
index cce464e2faff..f8908a680803 100644
--- a/filter/source/graphicfilter/eps/eps.cxx
+++ b/filter/source/graphicfilter/eps/eps.cxx
@@ -468,7 +468,7 @@ void PSWriter::ImplWriteProlog( const Graphic* pPreview )
ImplWriteLong( 0 );
ImplWriteLong( 0 );
Size aSizePoint = OutputDevice::LogicToLogic( pMTF->GetPrefSize(),
- pMTF->GetPrefMapMode(), MAP_POINT );
+ pMTF->GetPrefMapMode(), 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 b6421501529d..ed955cf947b3 100644
--- a/filter/source/graphicfilter/etiff/etiff.cxx
+++ b/filter/source/graphicfilter/etiff/etiff.cxx
@@ -199,10 +199,10 @@ bool TIFFWriter::WriteTIFF( const Graphic& rGraphic, FilterConfigItem* pFilterCo
{
Size aDestMapSize( 300, 300 );
const MapMode aMapMode( aBmp.GetPrefMapMode() );
- if ( aMapMode.GetMapUnit() != MAP_PIXEL )
+ if ( aMapMode.GetMapUnit() != MapUnit::MapPixel )
{
const Size aPrefSize( rGraphic.GetPrefSize() );
- aDestMapSize = OutputDevice::LogicToLogic( aPrefSize, aMapMode, MAP_INCH );
+ aDestMapSize = OutputDevice::LogicToLogic( aPrefSize, aMapMode, MapUnit::MapInch );
}
ImplWriteResolution( mnXResPos, aDestMapSize.Width() );
ImplWriteResolution( mnYResPos, aDestMapSize.Height() );
diff --git a/filter/source/graphicfilter/idxf/dxf2mtf.cxx b/filter/source/graphicfilter/idxf/dxf2mtf.cxx
index 43534f9e6629..8c2db883b9db 100644
--- a/filter/source/graphicfilter/idxf/dxf2mtf.cxx
+++ b/filter/source/graphicfilter/idxf/dxf2mtf.cxx
@@ -878,9 +878,9 @@ bool DXF2GDIMetaFile::Convert(const DXFRepresentation & rDXF, GDIMetaFile & rMTF
// simply set map mode to 1/100-mm (1/10-mm) if the graphic
// does not get not too small (<0.5cm)
if( ( aPrefSize.Width() < 500 ) && ( aPrefSize.Height() < 500 ) )
- rMTF.SetPrefMapMode( MapMode( MAP_10TH_MM ) );
+ rMTF.SetPrefMapMode( MapMode( MapUnit::Map10thMM ) );
else
- rMTF.SetPrefMapMode( MapMode( MAP_100TH_MM ) );
+ rMTF.SetPrefMapMode( MapMode( MapUnit::Map100thMM ) );
}
pVirDev.disposeAndClear();
diff --git a/filter/source/graphicfilter/ieps/ieps.cxx b/filter/source/graphicfilter/ieps/ieps.cxx
index 61906c89bfc7..b2899b543dee 100644
--- a/filter/source/graphicfilter/ieps/ieps.cxx
+++ b/filter/source/graphicfilter/ieps/ieps.cxx
@@ -129,17 +129,17 @@ static void MakeAsMeta(Graphic &rGraphic)
if( !aSize.Width() || !aSize.Height() )
aSize = Application::GetDefaultDevice()->PixelToLogic(
- aBmp.GetSizePixel(), MAP_100TH_MM );
+ aBmp.GetSizePixel(), MapUnit::Map100thMM );
else
aSize = OutputDevice::LogicToLogic( aSize,
- aBmp.GetPrefMapMode(), MAP_100TH_MM );
+ aBmp.GetPrefMapMode(), MapUnit::Map100thMM );
pVDev->EnableOutput( false );
aMtf.Record( pVDev );
pVDev->DrawBitmap( Point(), aSize, rGraphic.GetBitmap() );
aMtf.Stop();
aMtf.WindStart();
- aMtf.SetPrefMapMode( MAP_100TH_MM );
+ aMtf.SetPrefMapMode( MapUnit::Map100thMM );
aMtf.SetPrefSize( aSize );
rGraphic = aMtf;
}
@@ -514,7 +514,7 @@ void MakePreview(sal_uInt8* pBuf, sal_uInt32 nBytesRead,
pVDev->Pop();
aMtf.Stop();
aMtf.WindStart();
- aMtf.SetPrefMapMode( MAP_POINT );
+ aMtf.SetPrefMapMode( MapUnit::MapPoint );
aMtf.SetPrefSize( Size( nWidth, nHeight ) );
rGraphic = aMtf;
}
@@ -680,13 +680,13 @@ ipsGraphicImport( SvStream & rStream, Graphic & rGraphic, FilterConfigItem* )
aMtf.Record( pVDev );
aSize = aBitmap.GetPrefSize();
if( !aSize.Width() || !aSize.Height() )
- aSize = Application::GetDefaultDevice()->PixelToLogic( aBitmap.GetSizePixel(), MAP_100TH_MM );
+ aSize = Application::GetDefaultDevice()->PixelToLogic( aBitmap.GetSizePixel(), MapUnit::Map100thMM );
else
- aSize = OutputDevice::LogicToLogic( aSize, aBitmap.GetPrefMapMode(), MAP_100TH_MM );
+ aSize = OutputDevice::LogicToLogic( aSize, aBitmap.GetPrefMapMode(), MapUnit::Map100thMM );
pVDev->DrawBitmap( Point(), aSize, aBitmap );
aMtf.Stop();
aMtf.WindStart();
- aMtf.SetPrefMapMode( MAP_100TH_MM );
+ aMtf.SetPrefMapMode( MapUnit::Map100thMM );
aMtf.SetPrefSize( aSize );
aGraphic = aMtf;
bHasPreview = bRetValue = true;
@@ -735,7 +735,7 @@ ipsGraphicImport( SvStream & rStream, Graphic & rGraphic, FilterConfigItem* )
aGfxLink, aGraphic.GetGDIMetaFile() ) ) );
CreateMtfReplacementAction( aMtf, rStream, nOrigPos, nPSSize, nPosWMF, nSizeWMF, nPosTIFF, nSizeTIFF );
aMtf.WindStart();
- aMtf.SetPrefMapMode( MAP_POINT );
+ aMtf.SetPrefMapMode( MapUnit::MapPoint );
aMtf.SetPrefSize( Size( nWidth, nHeight ) );
rGraphic = aMtf;
bRetValue = true;
diff --git a/filter/source/graphicfilter/ios2met/ios2met.cxx b/filter/source/graphicfilter/ios2met/ios2met.cxx
index 20f367a6e2dc..6e09ee464b2b 100644
--- a/filter/source/graphicfilter/ios2met/ios2met.cxx
+++ b/filter/source/graphicfilter/ios2met/ios2met.cxx
@@ -2162,9 +2162,9 @@ void OS2METReader::ReadDsc(sal_uInt16 nDscID, sal_uInt16 /*nDscLen*/)
ReadCoord(b32);
if (nUnitType==0x00 && xr>0 && yr>0)
- aGlobMapMode=MapMode(MAP_INCH,Point(0,0),Fraction(10,xr),Fraction(10,yr));
+ aGlobMapMode=MapMode(MapUnit::MapInch,Point(0,0),Fraction(10,xr),Fraction(10,yr));
else if (nUnitType==0x01 && xr>0 && yr>0)
- aGlobMapMode=MapMode(MAP_CM,Point(0,0),Fraction(10,xr),Fraction(10,yr));
+ aGlobMapMode=MapMode(MapUnit::MapCM,Point(0,0),Fraction(10,xr),Fraction(10,yr));
else
aGlobMapMode=MapMode();
diff --git a/filter/source/graphicfilter/ipcx/ipcx.cxx b/filter/source/graphicfilter/ipcx/ipcx.cxx
index 2aa8c6f2a5df..9e10aad98498 100644
--- a/filter/source/graphicfilter/ipcx/ipcx.cxx
+++ b/filter/source/graphicfilter/ipcx/ipcx.cxx
@@ -132,7 +132,7 @@ bool PCXReader::ReadPCX(Graphic & rGraphic)
/*
// set resolution:
if (nResX!=0 && nResY!=0) {
- MapMode aMapMode(MAP_INCH,Point(0,0),Fraction(1,nResX),Fraction(1,nResY));
+ MapMode aMapMode(MapUnit::MapInch,Point(0,0),Fraction(1,nResX),Fraction(1,nResY));
rBitmap.SetPrefMapMode(aMapMode);
rBitmap.SetPrefSize(Size(nWidth,nHeight));
}
diff --git a/filter/source/graphicfilter/ipict/ipict.cxx b/filter/source/graphicfilter/ipict/ipict.cxx
index a5c5a96ea915..916258c344c2 100644
--- a/filter/source/graphicfilter/ipict/ipict.cxx
+++ b/filter/source/graphicfilter/ipict/ipict.cxx
@@ -1965,7 +1965,7 @@ void PictReader::ReadPict( SvStream & rStreamPict, GDIMetaFile & rGDIMetaFile )
rGDIMetaFile.Stop();
pVirDev.disposeAndClear();
- rGDIMetaFile.SetPrefMapMode( MapMode( MAP_INCH, Point(), aHRes, aVRes ) );
+ rGDIMetaFile.SetPrefMapMode( MapMode( MapUnit::MapInch, Point(), aHRes, aVRes ) );
rGDIMetaFile.SetPrefSize( aBoundingRect.GetSize() );
pPict->SetEndian(nOrigNumberFormat);
diff --git a/filter/source/graphicfilter/ipsd/ipsd.cxx b/filter/source/graphicfilter/ipsd/ipsd.cxx
index 7f763836f614..a1cd3ab26007 100644
--- a/filter/source/graphicfilter/ipsd/ipsd.cxx
+++ b/filter/source/graphicfilter/ipsd/ipsd.cxx
@@ -151,10 +151,10 @@ bool PSDReader::ReadPSD(Graphic & rGraphic )
Point aEmptyPoint;
Fraction aFractX( 1, mnXResFixed >> 16 );
Fraction aFractY( 1, mnYResFixed >> 16 );
- MapMode aMapMode( MAP_INCH, aEmptyPoint, aFractX, aFractY );
- Size aPrefSize = OutputDevice::LogicToLogic( aBitmapSize, aMapMode, MAP_100TH_MM );
+ MapMode aMapMode( MapUnit::MapInch, aEmptyPoint, aFractX, aFractY );
+ Size aPrefSize = OutputDevice::LogicToLogic( aBitmapSize, aMapMode, MapUnit::Map100thMM );
rGraphic.SetPrefSize( aPrefSize );
- rGraphic.SetPrefMapMode( MapMode( MAP_100TH_MM ) );
+ rGraphic.SetPrefMapMode( MapMode( MapUnit::Map100thMM ) );
}
}
else
diff --git a/filter/source/graphicfilter/itiff/itiff.cxx b/filter/source/graphicfilter/itiff/itiff.cxx
index 39f733648247..f7956310a646 100644
--- a/filter/source/graphicfilter/itiff/itiff.cxx
+++ b/filter/source/graphicfilter/itiff/itiff.cxx
@@ -1131,7 +1131,7 @@ void TIFFReader::MakePalCol()
nRX=(sal_uLong)(fXResolution*2.54+0.5);
nRY=(sal_uLong)(fYResolution*2.54+0.5);
}
- MapMode aMapMode(MAP_INCH,Point(0,0),Fraction(1,nRX),Fraction(1,nRY));
+ MapMode aMapMode(MapUnit::MapInch,Point(0,0),Fraction(1,nRX),Fraction(1,nRY));
aBitmap.SetPrefMapMode(aMapMode);
aBitmap.SetPrefSize(Size(nImageWidth,nImageLength));
}
diff --git a/filter/source/msfilter/escherex.cxx b/filter/source/msfilter/escherex.cxx
index f46aa331fc1a..da6a5cf1168d 100644
--- a/filter/source/msfilter/escherex.cxx
+++ b/filter/source/msfilter/escherex.cxx
@@ -1131,10 +1131,10 @@ void EscherPropertyContainer::CreateLineProperties(
static Size lcl_SizeToEmu(Size aPrefSize, const MapMode& aPrefMapMode)
{
Size aRetSize;
- if (aPrefMapMode == MAP_PIXEL)
- aRetSize = Application::GetDefaultDevice()->PixelToLogic( aPrefSize, MAP_100TH_MM );
+ if (aPrefMapMode == MapUnit::MapPixel)
+ aRetSize = Application::GetDefaultDevice()->PixelToLogic( aPrefSize, MapUnit::Map100thMM );
else
- aRetSize = OutputDevice::LogicToLogic( aPrefSize, aPrefMapMode, MAP_100TH_MM );
+ aRetSize = OutputDevice::LogicToLogic( aPrefSize, aPrefMapMode, MapUnit::Map100thMM );
return aRetSize;
}
@@ -1384,7 +1384,7 @@ GraphicObject lclDrawHatch( const css::drawing::Hatch& rHatch, const Color& rBac
pVDev->SetOutputSizePixel(Size(2, 2));
pVDev->EnableOutput(false);
- pVDev->SetMapMode(MapMode(MAP_100TH_MM));
+ pVDev->SetMapMode(MapMode(MapUnit::Map100thMM));
aMtf.Clear();
aMtf.Record(pVDev);
pVDev->SetLineColor();
@@ -1393,7 +1393,7 @@ GraphicObject lclDrawHatch( const css::drawing::Hatch& rHatch, const Color& rBac
pVDev->DrawHatch(tools::PolyPolygon(rRect), Hatch((HatchStyle)rHatch.Style, Color(rHatch.Color), rHatch.Distance, (sal_uInt16)rHatch.Angle));
aMtf.Stop();
aMtf.WindStart();
- aMtf.SetPrefMapMode(MapMode(MAP_100TH_MM));
+ aMtf.SetPrefMapMode(MapMode(MapUnit::Map100thMM));
aMtf.SetPrefSize(rRect.GetSize());
return GraphicObject(Graphic(aMtf));
diff --git a/filter/source/msfilter/eschesdo.cxx b/filter/source/msfilter/eschesdo.cxx
index c80b387e9aed..010fadfd57f8 100644
--- a/filter/source/msfilter/eschesdo.cxx
+++ b/filter/source/msfilter/eschesdo.cxx
@@ -63,9 +63,9 @@ using namespace ::com::sun::star::style;
ImplEESdrWriter::ImplEESdrWriter( EscherEx& rEx )
: mpEscherEx(&rEx)
- , maMapModeSrc(MAP_100TH_MM)
+ , maMapModeSrc(MapUnit::Map100thMM)
// PowerPoint: 576 dpi, WinWord: 1440 dpi, Excel: 1440 dpi
- , maMapModeDest( MAP_INCH, Point(), Fraction( 1, EES_MAP_FRACTION ), Fraction( 1, EES_MAP_FRACTION ) )
+ , maMapModeDest( MapUnit::MapInch, Point(), Fraction( 1, EES_MAP_FRACTION ), Fraction( 1, EES_MAP_FRACTION ) )
, mpPicStrm(nullptr)
, mpHostAppData(nullptr)
, mbIsTitlePossible(false)
diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx
index 77595942c545..4d0fa1222b50 100644
--- a/filter/source/msfilter/msdffimp.cxx
+++ b/filter/source/msfilter/msdffimp.cxx
@@ -189,15 +189,15 @@ void Impl_OlePres::Write( SvStream & rStm )
DBG_ASSERT( pMtf->GetPrefMapMode().GetOrigin() == Point(),
"Origin-Verschiebung im Mtf" );
MapUnit nMU = pMtf->GetPrefMapMode().GetMapUnit();
- if( MAP_100TH_MM != nMU )
+ if( MapUnit::Map100thMM != nMU )
{
Size aPrefS( pMtf->GetPrefSize() );
Size aS( aPrefS );
- aS = OutputDevice::LogicToLogic( aS, nMU, MAP_100TH_MM );
+ aS = OutputDevice::LogicToLogic( aS, nMU, MapUnit::Map100thMM );
pMtf->Scale( Fraction( aS.Width(), aPrefS.Width() ),
Fraction( aS.Height(), aPrefS.Height() ) );
- pMtf->SetPrefMapMode( MAP_100TH_MM );
+ pMtf->SetPrefMapMode( MapUnit::Map100thMM );
pMtf->SetPrefSize( aS );
}
WriteWindowMetafileBits( rStm, *pMtf );
@@ -1018,7 +1018,7 @@ void DffPropertyReader::ApplyLineAttributes( SfxItemSet& rSet, const MSO_SPT eSh
if ( nLineFlags & 0x10 )
{
- bool bScaleArrows = rManager.pSdrModel->GetScaleUnit() == MAP_TWIP;
+ bool bScaleArrows = rManager.pSdrModel->GetScaleUnit() == MapUnit::MapTwip;
// LineStart
@@ -2628,7 +2628,7 @@ void DffPropertyReader::ApplyAttributes( SvStream& rIn, SfxItemSet& rSet, DffObj
if( eShadowType != mso_shadowOffset && !bNonZeroShadowOffset )
{
//0.12" == 173 twip == 302 100mm
- sal_uInt32 nDist = rManager.pSdrModel->GetScaleUnit() == MAP_TWIP ? 173: 302;
+ sal_uInt32 nDist = rManager.pSdrModel->GetScaleUnit() == MapUnit::MapTwip ? 173: 302;
rSet.Put( makeSdrShadowXDistItem( nDist ) );
rSet.Put( makeSdrShadowYDistItem( nDist ) );
}
@@ -3138,7 +3138,7 @@ void SvxMSDffManager::ScaleEmu( sal_Int32& rVal ) const
sal_uInt32 SvxMSDffManager::ScalePt( sal_uInt32 nVal ) const
{
MapUnit eMap = pSdrModel->GetScaleUnit();
- Fraction aFact( GetMapFactor( MAP_POINT, eMap ).X() );
+ Fraction aFact( GetMapFactor( MapUnit::MapPoint, eMap ).X() );
long aMul = aFact.GetNumerator();
long aDiv = aFact.GetDenominator() * 65536;
aFact = Fraction( aMul, aDiv ); // try again to shorten it
@@ -3158,7 +3158,7 @@ void SvxMSDffManager::SetModel(SdrModel* pModel, long nApplicationScale)
// PPT works in units of 576DPI
// WW on the other side uses twips, i.e. 1440DPI.
MapUnit eMap = pSdrModel->GetScaleUnit();
- Fraction aFact( GetMapFactor(MAP_INCH, eMap).X() );
+ Fraction aFact( GetMapFactor(MapUnit::MapInch, eMap).X() );
long nMul=aFact.GetNumerator();
long nDiv=aFact.GetDenominator()*nApplicationScale;
aFact=Fraction(nMul,nDiv); // try again to shorten it
@@ -3170,7 +3170,7 @@ void SvxMSDffManager::SetModel(SdrModel* pModel, long nApplicationScale)
// MS-DFF-Properties are mostly given in EMU (English Metric Units)
// 1mm=36000emu, 1twip=635emu
- aFact=GetMapFactor(MAP_100TH_MM,eMap).X();
+ aFact=GetMapFactor(MapUnit::Map100thMM,eMap).X();
nMul=aFact.GetNumerator();
nDiv=aFact.GetDenominator()*360;
aFact=Fraction(nMul,nDiv); // try again to shorten it
@@ -3180,7 +3180,7 @@ void SvxMSDffManager::SetModel(SdrModel* pModel, long nApplicationScale)
nEmuDiv=aFact.GetDenominator();
// And something for typographic Points
- aFact=GetMapFactor(MAP_POINT,eMap).X();
+ aFact=GetMapFactor(MapUnit::MapPoint,eMap).X();
nPntMul=aFact.GetNumerator();
nPntDiv=aFact.GetDenominator();
}
@@ -3691,7 +3691,7 @@ static Size lcl_GetPrefSize(const Graphic& rGraf, const MapMode& aWanted)
if (aPrefMapMode == aWanted)
return rGraf.GetPrefSize();
Size aRetSize;
- if (aPrefMapMode == MAP_PIXEL)
+ if (aPrefMapMode == MapUnit::MapPixel)
{
aRetSize = Application::GetDefaultDevice()->PixelToLogic(
rGraf.GetPrefSize(), aWanted);
@@ -3721,7 +3721,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, MAP_100TH_MM );
+ aCropSize = lcl_GetPrefSize( rGraf, MapUnit::Map100thMM );
else
{
aCropBitmap = rGraf.GetBitmapEx();
@@ -4423,7 +4423,7 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r
rOutliner.SetUpdateMode( false );
rOutliner.SetText( *pParaObj );
ScopedVclPtrInstance< VirtualDevice > pVirDev(DeviceFormat::BITMASK);
- pVirDev->SetMapMode( MAP_100TH_MM );
+ pVirDev->SetMapMode( MapUnit::Map100thMM );
sal_Int32 i, nParagraphs = rOutliner.GetParagraphCount();
if ( nParagraphs )
{
@@ -6479,7 +6479,7 @@ bool SvxMSDffManager::GetBLIPDirect( SvStream& rBLIPStream, Graphic& rData, Rect
aMtf.Scale( (double) aMtfSize100.Width() / aOldSize.Width(),
(double) aMtfSize100.Height() / aOldSize.Height() );
aMtf.SetPrefSize( aMtfSize100 );
- aMtf.SetPrefMapMode( MAP_100TH_MM );
+ aMtf.SetPrefMapMode( MapUnit::Map100thMM );
rData = aMtf;
}
}
@@ -6584,7 +6584,7 @@ bool SvxMSDffManager::MakeContentStream( SotStorage * pStor, const GDIMetaFile &
// SV tries to guess a best match for the right value
Size aSize = rMtf.GetPrefSize();
const MapMode& aMMSrc = rMtf.GetPrefMapMode();
- MapMode aMMDst( MAP_100TH_MM );
+ MapMode aMMDst( MapUnit::Map100thMM );
aSize = OutputDevice::LogicToLogic( aSize, aMMSrc, aMMDst );
aEle.SetSize( aSize );
aEle.SetAspect( nAspect );
@@ -7031,7 +7031,7 @@ css::uno::Reference < css::embed::XEmbeddedObject > SvxMSDffManager::CheckForCo
else
{
aSz = rVisArea.GetSize();
- aSz = OutputDevice::LogicToLogic( aSz, MapMode( MAP_100TH_MM ), aMapMode );
+ aSz = OutputDevice::LogicToLogic( aSz, MapMode( MapUnit::Map100thMM ), aMapMode );
}
// don't modify the object
diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx
index f9a2c19e21db..01b3366e2fd1 100644
--- a/filter/source/msfilter/svdfppt.cxx
+++ b/filter/source/msfilter/svdfppt.cxx
@@ -2503,7 +2503,7 @@ Size SdrPowerPointImport::GetPageSize() const
long nInchMul = 1, nInchDiv = 1;
if ( bInch )
{ // temporarily convert size (for rounding it) from inch to metric units
- Fraction aFact(GetMapFactor(eMap,MAP_100TH_MM).X());
+ Fraction aFact(GetMapFactor(eMap,MapUnit::Map100thMM).X());
nInchMul = aFact.GetNumerator();
nInchDiv = aFact.GetDenominator();
aRet.Width() = BigMulDiv( aRet.Width(), nInchMul, nInchDiv );
diff --git a/filter/source/pdf/impdialog.cxx b/filter/source/pdf/impdialog.cxx
index df7de8f45f9a..a4efda00bff6 100644
--- a/filter/source/pdf/impdialog.cxx
+++ b/filter/source/pdf/impdialog.cxx
@@ -1621,7 +1621,7 @@ ImplErrorDialog::ImplErrorDialog(const std::set< vcl::PDFWriter::ErrorCode >& rE
get(m_pErrors, "errors");
get(m_pExplanation, "message");
- Size aSize(LogicToPixel(Size(100, 75), MapMode(MAP_APPFONT)));
+ Size aSize(LogicToPixel(Size(100, 75), MapMode(MapUnit::MapAppFont)));
m_pErrors->set_width_request(aSize.Width());
m_pErrors->set_height_request(aSize.Height());
m_pExplanation->set_width_request(aSize.Width());
diff --git a/filter/source/pdf/pdfexport.cxx b/filter/source/pdf/pdfexport.cxx
index 14840bd92f3c..c36be38c62c9 100644
--- a/filter/source/pdf/pdfexport.cxx
+++ b/filter/source/pdf/pdfexport.cxx
@@ -199,7 +199,7 @@ bool PDFExport::ExportSelection( vcl::PDFWriter& rPDFWriter,
rPDFExtOutDevData.SetCurrentPageNumber( nCurrentPage );
GDIMetaFile aMtf;
- const MapMode aMapMode( MAP_100TH_MM );
+ const MapMode aMapMode( MapUnit::Map100thMM );
const Size aMtfSize( aPageSize.Width, aPageSize.Height );
pOut->Push();
@@ -241,7 +241,7 @@ bool PDFExport::ExportSelection( vcl::PDFWriter& rPDFWriter,
{
bRet = true; // #i18334# nPageCount == 0,
rPDFWriter.NewPage( 10000, 10000 ); // creating dummy page
- rPDFWriter.SetMapMode( MAP_100TH_MM );
+ rPDFWriter.SetMapMode( MapUnit::Map100thMM );
}
}
}
@@ -1014,7 +1014,7 @@ void PDFExport::showErrors( const std::set< vcl::PDFWriter::ErrorCode >& rErrors
bool PDFExport::ImplExportPage( vcl::PDFWriter& rWriter, vcl::PDFExtOutDevData& rPDFExtOutDevData, const GDIMetaFile& rMtf )
{
- const Size aSizePDF( OutputDevice::LogicToLogic( rMtf.GetPrefSize(), rMtf.GetPrefMapMode(), MAP_POINT ) );
+ const Size aSizePDF( OutputDevice::LogicToLogic( rMtf.GetPrefSize(), rMtf.GetPrefMapMode(), MapUnit::MapPoint ) );
Point aOrigin;
Rectangle aPageRect( aOrigin, rMtf.GetPrefSize() );
bool bRet = true;
@@ -1071,7 +1071,7 @@ void PDFExport::ImplWriteWatermark( vcl::PDFWriter& rWriter, const Size& rPageSi
OutputDevice* pDev = rWriter.GetReferenceDevice();
pDev->Push();
pDev->SetFont( aFont );
- pDev->SetMapMode( MapMode( MAP_POINT ) );
+ pDev->SetMapMode( MapMode( MapUnit::MapPoint ) );
int w = 0;
while( ( w = pDev->GetTextWidth( msWatermark ) ) > nTextWidth )
{
@@ -1094,7 +1094,7 @@ void PDFExport::ImplWriteWatermark( vcl::PDFWriter& rWriter, const Size& rPageSi
pDev->Pop();
rWriter.Push();
- rWriter.SetMapMode( MapMode( MAP_POINT ) );
+ rWriter.SetMapMode( MapMode( MapUnit::MapPoint ) );
rWriter.SetFont( aFont );
rWriter.SetTextColor( COL_LIGHTGREEN );
Point aTextPoint;
diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx
index cce9f68d88cd..1cd7fa3ddc9c 100644
--- a/filter/source/svg/svgexport.cxx
+++ b/filter/source/svg/svgexport.cxx
@@ -1967,7 +1967,7 @@ bool SVGFilter::implCreateObjectsFromShape( const Reference< XDrawPage > & rxPag
aMtf.AddAction( new MetaBmpExScaleAction( aNullPt, aSize, aGraphic.GetBitmapEx() ) );
aMtf.SetPrefSize( aSize );
- aMtf.SetPrefMapMode( MAP_100TH_MM );
+ aMtf.SetPrefMapMode( MapUnit::Map100thMM );
(*mpObjects)[ rxShape ] = ObjectRepresentation( rxShape, aMtf );
}
@@ -2032,14 +2032,14 @@ bool SVGFilter::implCreateObjectsFromShape( const Reference< XDrawPage > & rxPag
pAction->Duplicate();
aEmbeddedBitmapMtf.AddAction( pAction );
aEmbeddedBitmapMtf.SetPrefSize( aSize );
- aEmbeddedBitmapMtf.SetPrefMapMode( MAP_100TH_MM );
+ aEmbeddedBitmapMtf.SetPrefMapMode( MapUnit::Map100thMM );
mEmbeddedBitmapActionSet.insert( ObjectRepresentation( rxShape, aEmbeddedBitmapMtf ) );
pAction->Duplicate();
aMtf.AddAction( pAction );
}
}
aMtf.SetPrefSize( aSize );
- aMtf.SetPrefMapMode( MAP_100TH_MM );
+ aMtf.SetPrefMapMode( MapUnit::Map100thMM );
mEmbeddedBitmapActionMap[ rxShape ] = ObjectRepresentation( rxShape, aMtf );
}
}
@@ -2324,7 +2324,7 @@ IMPL_LINK( SVGFilter, CalcFieldHdl, EditFieldInfo*, pInfo, void )
void SVGExport::writeMtf( const GDIMetaFile& rMtf )
{
- const Size aSize( OutputDevice::LogicToLogic( rMtf.GetPrefSize(), rMtf.GetPrefMapMode(), MAP_MM ) );
+ const Size aSize( OutputDevice::LogicToLogic( rMtf.GetPrefSize(), rMtf.GetPrefMapMode(), MapUnit::MapMM ) );
rtl::OUString aAttr;
Reference< XExtendedDocumentHandler> xExtDocHandler( GetDocHandler(), UNO_QUERY );
@@ -2363,8 +2363,8 @@ void SVGExport::writeMtf( const GDIMetaFile& rMtf )
aObjects.push_back( ObjectRepresentation( Reference< XInterface >(), rMtf ) );
SVGFontExport aSVGFontExport( *this, aObjects );
- Point aPoint100thmm( OutputDevice::LogicToLogic( rMtf.GetPrefMapMode().GetOrigin(), rMtf.GetPrefMapMode(), MAP_100TH_MM ) );
- Size aSize100thmm( OutputDevice::LogicToLogic( rMtf.GetPrefSize(), rMtf.GetPrefMapMode(), MAP_100TH_MM ) );
+ Point aPoint100thmm( OutputDevice::LogicToLogic( rMtf.GetPrefMapMode().GetOrigin(), rMtf.GetPrefMapMode(), MapUnit::Map100thMM ) );
+ Size aSize100thmm( OutputDevice::LogicToLogic( rMtf.GetPrefSize(), rMtf.GetPrefMapMode(), 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 366c673bbb79..39b7276f3f7f 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( MAP_100TH_MM );
+ pVDev->SetMapMode( 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 4e6bb1d71677..e3c74c743ba5 100644
--- a/filter/source/svg/svgwriter.cxx
+++ b/filter/source/svg/svgwriter.cxx
@@ -1768,7 +1768,7 @@ SVGActionWriter::SVGActionWriter( SVGExport& rExport, SVGFontExport& rFontExport
{
mpVDev = VclPtr<VirtualDevice>::Create();
mpVDev->EnableOutput( false );
- maTargetMapMode = MAP_100TH_MM;
+ maTargetMapMode = MapUnit::Map100thMM;
maTextWriter.setVirtualDevice( mpVDev, maTargetMapMode );
}
@@ -3773,11 +3773,11 @@ void SVGActionWriter::WriteMetaFile( const Point& rPos100thmm,
mpVDev->Push();
- Size aSize( OutputDevice::LogicToLogic( rSize100thmm, MAP_100TH_MM, aMapMode ) );
+ Size aSize( OutputDevice::LogicToLogic( rSize100thmm, MapUnit::Map100thMM, aMapMode ) );
aMapMode.SetScaleX( aFractionX *= Fraction( aSize.Width(), aPrefSize.Width() ) );
aMapMode.SetScaleY( aFractionY *= Fraction( aSize.Height(), aPrefSize.Height() ) );
- Point aOffset( OutputDevice::LogicToLogic( rPos100thmm, MAP_100TH_MM, aMapMode ) );
+ Point aOffset( OutputDevice::LogicToLogic( rPos100thmm, MapUnit::Map100thMM, aMapMode ) );
aMapMode.SetOrigin( aOffset += aMapMode.GetOrigin() );
mpVDev->SetMapMode( aMapMode );
diff --git a/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx b/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx
index d8a7aef7d3ca..1c5a411e567b 100644
--- a/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx
+++ b/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx
@@ -1353,13 +1353,13 @@ void SvxPathControl::Resize()
m_pHeaderBar->SetItemSize(ITEMID_NAME, nFirstColumnWidth);
m_pHeaderBar->SetItemSize(ITEMID_TYPE, 0xFFFF);
long nTabs[] = {2, 0, nFirstColumnWidth};
- m_pFocusCtrl->SetTabs(&nTabs[0], MAP_PIXEL);
+ m_pFocusCtrl->SetTabs(&nTabs[0], MapUnit::MapPixel);
}
}
Size SvxPathControl::GetOptimalSize() const
{
- Size aDefSize(LogicToPixel(Size(150, 0), MapMode(MAP_APPFONT)));
+ Size aDefSize(LogicToPixel(Size(150, 0), MapMode(MapUnit::MapAppFont)));
Size aOptSize(m_pVBox->GetOptimalSize());
long nRowHeight(GetTextHeight());
aOptSize.Height() = nRowHeight * 10;
@@ -1413,7 +1413,7 @@ XMLFilterListBox::XMLFilterListBox(Window* pParent, SvxPathControl* pPathControl
static long nTabs[] = {2, 0, nTabSize };
SetSelectionMode( SelectionMode::Multiple );
- SetTabs( &nTabs[0], MAP_PIXEL );
+ SetTabs( &nTabs[0], MapUnit::MapPixel );
SetScrolledHdl( LINK( this, XMLFilterListBox, TabBoxScrollHdl_Impl ) );
SetHighlightRange();
Show();
@@ -1464,7 +1464,7 @@ IMPL_LINK( XMLFilterListBox, HeaderEndDrag_Impl, HeaderBar*, pBar, void )
long nW = m_pHeaderBar->GetItemSize(i);
aSz.Width() = nW + nTmpSz;
nTmpSz += nW;
- SetTab( i, PixelToLogic( aSz, MapMode(MAP_APPFONT) ).Width() );
+ SetTab( i, PixelToLogic( aSz, MapMode(MapUnit::MapAppFont) ).Width() );
}
}
}