summaryrefslogtreecommitdiff
path: root/sc/source/core
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 /sc/source/core
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 'sc/source/core')
-rw-r--r--sc/source/core/data/column2.cxx2
-rw-r--r--sc/source/core/data/docpool.cxx4
-rw-r--r--sc/source/core/data/documen2.cxx4
-rw-r--r--sc/source/core/data/documen8.cxx8
-rw-r--r--sc/source/core/data/documen9.cxx2
-rw-r--r--sc/source/core/data/drwlayer.cxx8
-rw-r--r--sc/source/core/data/global.cxx6
-rw-r--r--sc/source/core/data/patattr.cxx4
-rw-r--r--sc/source/core/data/poolhelp.cxx4
-rw-r--r--sc/source/core/data/table1.cxx2
-rw-r--r--sc/source/core/tool/editutil.cxx4
-rw-r--r--sc/source/core/tool/interpr1.cxx2
12 files changed, 25 insertions, 25 deletions
diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx
index 3cc09b014f2b..85ab7e6cb719 100644
--- a/sc/source/core/data/column2.cxx
+++ b/sc/source/core/data/column2.cxx
@@ -357,7 +357,7 @@ long ScColumn::GetNeededSize(
// the font is not reset each time with !bEditEngine
vcl::Font aOldFont = pDev->GetFont();
- MapMode aHMMMode( MAP_100TH_MM, Point(), rZoomX, rZoomY );
+ MapMode aHMMMode( MapUnit::Map100thMM, Point(), rZoomX, rZoomY );
// save in document ?
ScFieldEditEngine* pEngine = pDocument->CreateFieldEditEngine();
diff --git a/sc/source/core/data/docpool.cxx b/sc/source/core/data/docpool.cxx
index 94d177cac43e..1dedbae775a9 100644
--- a/sc/source/core/data/docpool.cxx
+++ b/sc/source/core/data/docpool.cxx
@@ -920,9 +920,9 @@ MapUnit ScDocumentPool::GetMetric( sal_uInt16 nWhich ) const
{
// Own attributes in Twips, everything else in 1/100 mm
if ( nWhich >= ATTR_STARTINDEX && nWhich <= ATTR_ENDINDEX )
- return MAP_TWIP;
+ return MapUnit::MapTwip;
else
- return MAP_100TH_MM;
+ return MapUnit::Map100thMM;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/data/documen2.cxx b/sc/source/core/data/documen2.cxx
index de91bf751f79..d2af6d209bd7 100644
--- a/sc/source/core/data/documen2.cxx
+++ b/sc/source/core/data/documen2.cxx
@@ -504,7 +504,7 @@ ScFieldEditEngine& ScDocument::GetEditEngine()
pEditEngine = new ScFieldEditEngine(this, GetEnginePool(), GetEditPool());
pEditEngine->SetUpdateMode( false );
pEditEngine->EnableUndo( false );
- pEditEngine->SetRefMapMode( MAP_100TH_MM );
+ pEditEngine->SetRefMapMode( MapUnit::Map100thMM );
ApplyAsianEditSettings( *pEditEngine );
}
return *pEditEngine;
@@ -517,7 +517,7 @@ ScNoteEditEngine& ScDocument::GetNoteEngine()
pNoteEngine = new ScNoteEditEngine( GetEnginePool(), GetEditPool() );
pNoteEngine->SetUpdateMode( false );
pNoteEngine->EnableUndo( false );
- pNoteEngine->SetRefMapMode( MAP_100TH_MM );
+ pNoteEngine->SetRefMapMode( MapUnit::Map100thMM );
ApplyAsianEditSettings( *pNoteEngine );
const SfxItemSet& rItemSet = GetDefPattern()->GetItemSet();
SfxItemSet* pEEItemSet = new SfxItemSet( pNoteEngine->GetEmptyItemSet() );
diff --git a/sc/source/core/data/documen8.cxx b/sc/source/core/data/documen8.cxx
index e0992b534b6c..e99e32f9df70 100644
--- a/sc/source/core/data/documen8.cxx
+++ b/sc/source/core/data/documen8.cxx
@@ -137,7 +137,7 @@ SfxPrinter* ScDocument::GetPrinter(bool bCreateIfNotExist)
pSet->Put( SfxBoolItem( SID_PRINTER_NOTFOUND_WARN, aMisc.IsNotFoundWarning() ) );
pPrinter = VclPtr<SfxPrinter>::Create( pSet );
- pPrinter->SetMapMode( MAP_100TH_MM );
+ pPrinter->SetMapMode( MapUnit::Map100thMM );
UpdateDrawPrinter();
pPrinter->SetDigitLanguage( SC_MOD()->GetOptDigitLanguage() );
}
@@ -197,7 +197,7 @@ VirtualDevice* ScDocument::GetVirtualDevice_100th_mm()
#endif
pVirtualDevice_100th_mm->SetReferenceDevice(VirtualDevice::RefDevMode::MSO1);
MapMode aMapMode( pVirtualDevice_100th_mm->GetMapMode() );
- aMapMode.SetMapUnit( MAP_100TH_MM );
+ aMapMode.SetMapUnit( MapUnit::Map100thMM );
pVirtualDevice_100th_mm->SetMapMode( aMapMode );
}
return pVirtualDevice_100th_mm;
@@ -591,9 +591,9 @@ bool ScDocument::IdleCalcTextWidth() // true = try next again
{
pDev = GetPrinter();
aScope.setOldMapMode(pDev->GetMapMode());
- pDev->SetMapMode( MAP_PIXEL ); // Important for GetNeededSize
+ pDev->SetMapMode( MapUnit::MapPixel ); // Important for GetNeededSize
- Point aPix1000 = pDev->LogicToPixel( Point(1000,1000), MAP_TWIP );
+ Point aPix1000 = pDev->LogicToPixel( Point(1000,1000), MapUnit::MapTwip );
nPPTX = aPix1000.X() / 1000.0;
nPPTY = aPix1000.Y() / 1000.0;
}
diff --git a/sc/source/core/data/documen9.cxx b/sc/source/core/data/documen9.cxx
index 711d0a03c532..8cdf00e9eb47 100644
--- a/sc/source/core/data/documen9.cxx
+++ b/sc/source/core/data/documen9.cxx
@@ -505,7 +505,7 @@ bool ScDocument::IsPrintEmpty( SCTAB nTab, SCCOL nStartCol, SCROW nStartRow,
pThis->ExtendMerge( 0,nStartRow, nExtendCol,nTmpRow, nTab ); // no Refresh, incl. Attrs
OutputDevice* pDev = pThis->GetPrinter();
- pDev->SetMapMode( MAP_PIXEL ); // Important for GetNeededSize
+ pDev->SetMapMode( MapUnit::MapPixel ); // Important for GetNeededSize
ExtendPrintArea( pDev, nTab, 0, nStartRow, nExtendCol, nEndRow );
if ( nExtendCol >= nStartCol )
return false;
diff --git a/sc/source/core/data/drwlayer.cxx b/sc/source/core/data/drwlayer.cxx
index d9ef0b5659a0..1396caa9861c 100644
--- a/sc/source/core/data/drwlayer.cxx
+++ b/sc/source/core/data/drwlayer.cxx
@@ -268,9 +268,9 @@ ScDrawLayer::ScDrawLayer( ScDocument* pDocument, const OUString& rName ) :
SetSwapGraphics();
- SetScaleUnit(MAP_100TH_MM);
+ SetScaleUnit(MapUnit::Map100thMM);
SfxItemPool& rPool = GetItemPool();
- rPool.SetDefaultMetric(MAP_100TH_MM);
+ rPool.SetDefaultMetric(MapUnit::Map100thMM);
SvxFrameDirectionItem aModeItem( FRMDIR_ENVIRONMENT, EE_PARA_WRITINGDIR );
rPool.SetPoolDefaultItem( aModeItem );
@@ -2042,7 +2042,7 @@ ScIMapInfo* ScDrawLayer::GetIMapInfo( SdrObject* pObj )
IMapObject* ScDrawLayer::GetHitIMapObject( SdrObject* pObj,
const Point& rWinPoint, const vcl::Window& rCmpWnd )
{
- const MapMode aMap100( MAP_100TH_MM );
+ const MapMode aMap100( MapUnit::Map100thMM );
MapMode aWndMode = rCmpWnd.GetMapMode();
Point aRelPoint( rCmpWnd.LogicToLogic( rWinPoint, &aWndMode, &aMap100 ) );
Rectangle aLogRect = rCmpWnd.LogicToLogic( pObj->GetLogicRect(), &aWndMode, &aMap100 );
@@ -2073,7 +2073,7 @@ IMapObject* ScDrawLayer::GetHitIMapObject( SdrObject* pObj,
if ( rGeo.nShearAngle )
ShearPoint( aRelPoint, aLogRect.TopLeft(), -rGeo.nTan );
- if ( rGraphic.GetPrefMapMode().GetMapUnit() == MAP_PIXEL )
+ if ( rGraphic.GetPrefMapMode().GetMapUnit() == MapUnit::MapPixel )
aGraphSize = rCmpWnd.PixelToLogic( rGraphic.GetPrefSize(),
aMap100 );
else
diff --git a/sc/source/core/data/global.cxx b/sc/source/core/data/global.cxx
index 9966874e313d..1436ecf2a587 100644
--- a/sc/source/core/data/global.cxx
+++ b/sc/source/core/data/global.cxx
@@ -530,7 +530,7 @@ void ScGlobal::Init()
void ScGlobal::InitPPT()
{
OutputDevice* pDev = Application::GetDefaultDevice();
- Point aPix1000 = pDev->LogicToPixel( Point(100000,100000), MAP_TWIP );
+ Point aPix1000 = pDev->LogicToPixel( Point(100000,100000), MapUnit::MapTwip );
nScreenPPTX = aPix1000.X() / 100000.0;
nScreenPPTY = aPix1000.Y() / 100000.0;
}
@@ -562,12 +562,12 @@ void ScGlobal::InitTextHeight(SfxItemPool* pPool)
OutputDevice* pDefaultDev = Application::GetDefaultDevice();
ScopedVclPtrInstance< VirtualDevice > pVirtWindow( *pDefaultDev );
- pVirtWindow->SetMapMode(MAP_PIXEL);
+ pVirtWindow->SetMapMode(MapUnit::MapPixel);
vcl::Font aDefFont;
pPattern->GetFont(aDefFont, SC_AUTOCOL_BLACK, pVirtWindow); // Font color doesn't matter here
pVirtWindow->SetFont(aDefFont);
sal_uInt16 nTest = static_cast<sal_uInt16>(
- pVirtWindow->PixelToLogic(Size(0, pVirtWindow->GetTextHeight()), MAP_TWIP).Height());
+ pVirtWindow->PixelToLogic(Size(0, pVirtWindow->GetTextHeight()), MapUnit::MapTwip).Height());
if (nTest > nDefFontHeight)
nDefFontHeight = nTest;
diff --git a/sc/source/core/data/patattr.cxx b/sc/source/core/data/patattr.cxx
index 57e66f692a9a..449071a2cff7 100644
--- a/sc/source/core/data/patattr.cxx
+++ b/sc/source/core/data/patattr.cxx
@@ -391,8 +391,8 @@ void ScPatternAttr::GetFont(
aFraction = *pScale;
Size aSize( 0, (long) nFontHeight );
MapMode aDestMode = pOutDev->GetMapMode();
- MapMode aSrcMode( MAP_TWIP, Point(), aFraction, aFraction );
- if (aDestMode.GetMapUnit() == MAP_PIXEL && pOutDev->GetDPIX() > 0)
+ MapMode aSrcMode( MapUnit::MapTwip, Point(), aFraction, aFraction );
+ if (aDestMode.GetMapUnit() == MapUnit::MapPixel && pOutDev->GetDPIX() > 0)
aEffSize = pOutDev->LogicToPixel( aSize, aSrcMode );
else
{
diff --git a/sc/source/core/data/poolhelp.cxx b/sc/source/core/data/poolhelp.cxx
index 02a29c377dae..28b5ae0a9cb8 100644
--- a/sc/source/core/data/poolhelp.cxx
+++ b/sc/source/core/data/poolhelp.cxx
@@ -51,7 +51,7 @@ SfxItemPool* ScPoolHelper::GetEditPool() const
if ( !pEditPool )
{
pEditPool = EditEngine::CreatePool();
- pEditPool->SetDefaultMetric( MAP_100TH_MM );
+ pEditPool->SetDefaultMetric( MapUnit::Map100thMM );
pEditPool->FreezeIdRanges();
pEditPool->SetFileFormatVersion( SOFFICE_FILEFORMAT_50 ); // used in ScGlobal::EETextObjEqual
}
@@ -62,7 +62,7 @@ SfxItemPool* ScPoolHelper::GetEnginePool() const
if ( !pEnginePool )
{
pEnginePool = EditEngine::CreatePool();
- pEnginePool->SetDefaultMetric( MAP_100TH_MM );
+ pEnginePool->SetDefaultMetric( MapUnit::Map100thMM );
pEnginePool->FreezeIdRanges();
} // ifg ( pEnginePool )
return pEnginePool;
diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx
index a38889d3a02f..1ad6ebe3c147 100644
--- a/sc/source/core/data/table1.cxx
+++ b/sc/source/core/data/table1.cxx
@@ -1738,7 +1738,7 @@ void ScTable::ExtendPrintArea( OutputDevice* pDev,
return;
}
- Point aPix1000 = pDev->LogicToPixel( Point(1000,1000), MAP_TWIP );
+ Point aPix1000 = pDev->LogicToPixel( Point(1000,1000), MapUnit::MapTwip );
double nPPTX = aPix1000.X() / 1000.0;
double nPPTY = aPix1000.Y() / 1000.0;
diff --git a/sc/source/core/tool/editutil.cxx b/sc/source/core/tool/editutil.cxx
index c2d1d72ebfc4..0922d00741dd 100644
--- a/sc/source/core/tool/editutil.cxx
+++ b/sc/source/core/tool/editutil.cxx
@@ -331,7 +331,7 @@ Rectangle ScEditUtil::GetEditArea( const ScPatternAttr* pPattern, bool bForceToT
else
{
MapMode aMode = pDev->GetMapMode();
- pDev->SetMapMode( MAP_PIXEL );
+ pDev->SetMapMode( MapUnit::MapPixel );
long nTextHeight = pDoc->GetNeededSize( nCol, nRow, nTab,
pDev, nPPTX, nPPTY, aZoomX, aZoomY, false );
@@ -711,7 +711,7 @@ ScTabEditEngine::ScTabEditEngine( const ScPatternAttr& rPattern,
void ScTabEditEngine::Init( const ScPatternAttr& rPattern )
{
- SetRefMapMode(MAP_100TH_MM);
+ SetRefMapMode(MapUnit::Map100thMM);
SfxItemSet* pEditDefaults = new SfxItemSet( GetEmptyItemSet() );
rPattern.FillEditItemSet( pEditDefaults );
SetDefaults( pEditDefaults );
diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index 87da7230f60c..aca7342beeab 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -2246,7 +2246,7 @@ void ScInterpreter::ScCell()
vcl::Font aOldFont( pPrinter->GetFont() );
vcl::Font aDefFont;
- pPrinter->SetMapMode( MAP_TWIP );
+ pPrinter->SetMapMode( MapUnit::MapTwip );
// font color doesn't matter here
pDok->GetDefPattern()->GetFont( aDefFont, SC_AUTOCOL_BLACK, pPrinter );
pPrinter->SetFont( aDefFont );