diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-09-20 16:41:39 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-10-05 06:51:20 +0000 |
commit | 954f752cf10fc6a8777af2a6a93e496688464687 (patch) | |
tree | 0fc776cdcb6ad9b1d2b9673ac044bb5b4f496972 /sc | |
parent | c1e18e05a53c1d55afe36a887ca25f74f3f1d32d (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')
80 files changed, 191 insertions, 191 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 ); diff --git a/sc/source/filter/excel/xechart.cxx b/sc/source/filter/excel/xechart.cxx index 1c03ccec29d6..181eb60dc20e 100644 --- a/sc/source/filter/excel/xechart.cxx +++ b/sc/source/filter/excel/xechart.cxx @@ -3311,7 +3311,7 @@ XclExpChChart::XclExpChChart( const XclExpRoot& rRoot, Reference< XChartDocument > const & xChartDoc, const Rectangle& rChartRect ) : XclExpChGroupBase( XclExpChRoot( rRoot, *this ), EXC_CHFRBLOCK_TYPE_CHART, EXC_ID_CHCHART, 16 ) { - Size aPtSize = OutputDevice::LogicToLogic( rChartRect.GetSize(), MapMode( MAP_100TH_MM ), MapMode( MAP_POINT ) ); + Size aPtSize = OutputDevice::LogicToLogic( rChartRect.GetSize(), MapMode( MapUnit::Map100thMM ), MapMode( MapUnit::MapPoint ) ); // rectangle is stored in 16.16 fixed-point format maRect.mnX = maRect.mnY = 0; maRect.mnWidth = static_cast< sal_Int32 >( aPtSize.Width() << 16 ); diff --git a/sc/source/filter/excel/xeescher.cxx b/sc/source/filter/excel/xeescher.cxx index 6e2ee0622e64..c5a66a5a2e5b 100644 --- a/sc/source/filter/excel/xeescher.cxx +++ b/sc/source/filter/excel/xeescher.cxx @@ -258,7 +258,7 @@ void XclExpDffAnchorBase::SetFlags( const SdrObject& rSdrObj ) void XclExpDffAnchorBase::SetSdrObject( const SdrObject& rSdrObj ) { ImplSetFlags( rSdrObj ); - ImplCalcAnchorRect( rSdrObj.GetCurrentBoundRect(), MAP_100TH_MM ); + ImplCalcAnchorRect( rSdrObj.GetCurrentBoundRect(), MapUnit::Map100thMM ); } void XclExpDffAnchorBase::WriteDffData( EscherEx& rEscherEx ) const @@ -271,7 +271,7 @@ void XclExpDffAnchorBase::WriteDffData( EscherEx& rEscherEx ) const void XclExpDffAnchorBase::WriteData( EscherEx& rEscherEx, const Rectangle& rRect ) { // the passed rectangle is in twips - ImplCalcAnchorRect( rRect, MAP_TWIP ); + ImplCalcAnchorRect( rRect, MapUnit::MapTwip ); WriteDffData( rEscherEx ); } @@ -327,7 +327,7 @@ void XclExpDffEmbeddedAnchor::ImplCalcAnchorRect( const Rectangle& rRect, MapUni XclExpDffNoteAnchor::XclExpDffNoteAnchor( const XclExpRoot& rRoot, const Rectangle& rRect ) : XclExpDffAnchorBase( rRoot, EXC_ESC_ANCHOR_SIZELOCKED ) { - maAnchor.SetRect( rRoot, rRoot.GetCurrScTab(), rRect, MAP_100TH_MM ); + maAnchor.SetRect( rRoot, rRoot.GetCurrScTab(), rRect, MapUnit::Map100thMM ); } XclExpDffDropDownAnchor::XclExpDffDropDownAnchor( const XclExpRoot& rRoot, const ScAddress& rScPos ) : diff --git a/sc/source/filter/excel/xiescher.cxx b/sc/source/filter/excel/xiescher.cxx index 0ae25f02a302..9a1484d0ac55 100644 --- a/sc/source/filter/excel/xiescher.cxx +++ b/sc/source/filter/excel/xiescher.cxx @@ -1703,7 +1703,7 @@ SdrObjectPtr XclImpChartObj::DoCreateSdrObj( XclImpDffConverter& rDffConv, const inserted into the draw page. */ sal_Int64 nAspect = css::embed::Aspects::MSOLE_CONTENT; MapUnit aUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( xEmbObj->getMapUnit( nAspect ) ); - Size aSize( vcl::Window::LogicToLogic( rAnchorRect.GetSize(), MapMode( MAP_100TH_MM ), MapMode( aUnit ) ) ); + Size aSize( vcl::Window::LogicToLogic( rAnchorRect.GetSize(), MapMode( MapUnit::Map100thMM ), MapMode( aUnit ) ) ); css::awt::Size aAwtSize( aSize.Width(), aSize.Height() ); xEmbObj->setVisualAreaSize( nAspect, aAwtSize ); @@ -1766,7 +1766,7 @@ void XclImpChartObj::FinalizeTabChart() // create the object anchor XclObjAnchor aAnchor; - aAnchor.SetRect( GetRoot(), GetCurrScTab(), Rectangle( 1000, 500, nWidth, nHeight ), MAP_100TH_MM ); + aAnchor.SetRect( GetRoot(), GetCurrScTab(), Rectangle( 1000, 500, nWidth, nHeight ), MapUnit::Map100thMM ); SetAnchor( aAnchor ); } @@ -4131,7 +4131,7 @@ void XclImpSheetDrawing::ConvertObjects( XclImpDffConverter& rDffConv ) Rectangle XclImpSheetDrawing::CalcAnchorRect( const XclObjAnchor& rAnchor, bool /*bDffAnchor*/ ) const { - return rAnchor.GetRect( GetRoot(), maScUsedArea.aStart.Tab(), MAP_100TH_MM ); + return rAnchor.GetRect( GetRoot(), maScUsedArea.aStart.Tab(), MapUnit::Map100thMM ); } void XclImpSheetDrawing::OnObjectInserted( const XclImpDrawObjBase& rDrawObj ) diff --git a/sc/source/filter/excel/xlescher.cxx b/sc/source/filter/excel/xlescher.cxx index 70a4d79dcb15..de02aaab6ac0 100644 --- a/sc/source/filter/excel/xlescher.cxx +++ b/sc/source/filter/excel/xlescher.cxx @@ -45,13 +45,13 @@ double lclGetTwipsScale( MapUnit eMapUnit ) Calc's strange definition of a point (1 inch == 72.27 points, instead of 72 points). NOTE: Calc's definition changed from TeX points (72.27) to PS points - (72), so the MAP_TWIP case now actually also delivers a scale of 1.0 + (72), so the MapUnit::MapTwip case now actually also delivers a scale of 1.0 */ double fScale = 1.0; switch( eMapUnit ) { - case MAP_TWIP: fScale = 1; break; // Calc twips <-> real twips - case MAP_100TH_MM: fScale = HMM_PER_TWIPS; break; // Calc twips <-> 1/100mm + case MapUnit::MapTwip: fScale = 1; break; // Calc twips <-> real twips + case MapUnit::Map100thMM: fScale = HMM_PER_TWIPS; break; // Calc twips <-> 1/100mm default: OSL_FAIL( "lclGetTwipsScale - map unit not implemented" ); } return fScale; @@ -183,8 +183,8 @@ void XclObjAnchor::SetRect( const Size& rPageSize, sal_Int32 nScaleX, sal_Int32 double fScale = 1.0; switch( eMapUnit ) { - case MAP_TWIP: fScale = HMM_PER_TWIPS; break; // Calc twips -> 1/100mm - case MAP_100TH_MM: fScale = 1.0; break; // Calc 1/100mm -> 1/100mm + case MapUnit::MapTwip: fScale = HMM_PER_TWIPS; break; // Calc twips -> 1/100mm + case MapUnit::Map100thMM: fScale = 1.0; break; // Calc 1/100mm -> 1/100mm default: OSL_FAIL( "XclObjAnchor::SetRect - map unit not implemented" ); } diff --git a/sc/source/filter/excel/xlroot.cxx b/sc/source/filter/excel/xlroot.cxx index a1d9a20cd703..97ece71e8236 100644 --- a/sc/source/filter/excel/xlroot.cxx +++ b/sc/source/filter/excel/xlroot.cxx @@ -344,7 +344,7 @@ ScEditEngineDefaulter& XclRoot::GetEditEngine() const { mrData.mxEditEngine.reset( new ScEditEngineDefaulter( GetDoc().GetEnginePool() ) ); ScEditEngineDefaulter& rEE = *mrData.mxEditEngine; - rEE.SetRefMapMode( MAP_100TH_MM ); + rEE.SetRefMapMode( MapUnit::Map100thMM ); rEE.SetEditTextObjectPool( GetDoc().GetEditPool() ); rEE.SetUpdateMode( false ); rEE.EnableUndo( false ); @@ -359,7 +359,7 @@ ScHeaderEditEngine& XclRoot::GetHFEditEngine() const { mrData.mxHFEditEngine.reset( new ScHeaderEditEngine( EditEngine::CreatePool() ) ); ScHeaderEditEngine& rEE = *mrData.mxHFEditEngine; - rEE.SetRefMapMode( MAP_TWIP ); // headers/footers use twips as default metric + rEE.SetRefMapMode( MapUnit::MapTwip ); // headers/footers use twips as default metric rEE.SetUpdateMode( false ); rEE.EnableUndo( false ); rEE.SetControlWord( rEE.GetControlWord() & ~EEControlBits::ALLOWBIGOBJS ); @@ -386,7 +386,7 @@ EditEngine& XclRoot::GetDrawEditEngine() const { mrData.mxDrawEditEng.reset( new EditEngine( &GetDoc().GetDrawLayer()->GetItemPool() ) ); EditEngine& rEE = *mrData.mxDrawEditEng; - rEE.SetRefMapMode( MAP_100TH_MM ); + rEE.SetRefMapMode( MapUnit::Map100thMM ); rEE.SetUpdateMode( false ); rEE.EnableUndo( false ); rEE.SetControlWord( rEE.GetControlWord() & ~EEControlBits::ALLOWBIGOBJS ); diff --git a/sc/source/filter/html/htmlexp.cxx b/sc/source/filter/html/htmlexp.cxx index ac29f3d31184..d30ed4f0b7b8 100644 --- a/sc/source/filter/html/htmlexp.cxx +++ b/sc/source/filter/html/htmlexp.cxx @@ -284,7 +284,7 @@ sal_uInt16 ScHTMLExport::ToPixel( sal_uInt16 nVal ) if( nVal ) { nVal = (sal_uInt16)pAppWin->LogicToPixel( - Size( nVal, nVal ), MapMode( MAP_TWIP ) ).Width(); + Size( nVal, nVal ), MapMode( MapUnit::MapTwip ) ).Width(); if( !nVal ) // If there's a Twip there should also be a Pixel nVal = 1; } @@ -294,7 +294,7 @@ sal_uInt16 ScHTMLExport::ToPixel( sal_uInt16 nVal ) Size ScHTMLExport::MMToPixel( const Size& rSize ) { Size aSize( rSize ); - aSize = pAppWin->LogicToPixel( rSize, MapMode( MAP_100TH_MM ) ); + aSize = pAppWin->LogicToPixel( rSize, MapMode( MapUnit::Map100thMM ) ); // If there's something there should also be a Pixel if ( !aSize.Width() && rSize.Width() ) aSize.Width() = 1; diff --git a/sc/source/filter/html/htmlimp.cxx b/sc/source/filter/html/htmlimp.cxx index f57b19734922..7af6d8fe928c 100644 --- a/sc/source/filter/html/htmlimp.cxx +++ b/sc/source/filter/html/htmlimp.cxx @@ -84,13 +84,13 @@ ScHTMLImport::ScHTMLImport( ScDocument* pDocP, const OUString& rBaseURL, const S } aPageSize.Width() -= nLeftMargin + nRightMargin; aPageSize.Height() -= nTopMargin + nBottomMargin; - aPageSize = pDefaultDev->LogicToPixel( aPageSize, MapMode( MAP_TWIP ) ); + aPageSize = pDefaultDev->LogicToPixel( aPageSize, MapMode( MapUnit::MapTwip ) ); } else { OSL_FAIL("no StyleSheet?!?"); aPageSize = pDefaultDev->LogicToPixel( - SvxPaperInfo::GetPaperSize( PAPER_A4 ), MapMode( MAP_TWIP ) ); + SvxPaperInfo::GetPaperSize( PAPER_A4 ), MapMode( MapUnit::MapTwip ) ); } if( bCalcWidthHeight ) mpParser = new ScHTMLLayoutParser( mpEngine, rBaseURL, aPageSize, pDocP ); diff --git a/sc/source/filter/html/htmlpars.cxx b/sc/source/filter/html/htmlpars.cxx index 11ce7137cb43..11e6fe9f131c 100644 --- a/sc/source/filter/html/htmlpars.cxx +++ b/sc/source/filter/html/htmlpars.cxx @@ -299,7 +299,7 @@ sal_uLong ScHTMLLayoutParser::Read( SvStream& rStream, const OUString& rBaseURL for ( sal_uInt16 j = 1; j < nCount; j++ ) { aSize.Width() = (*pColOffset)[j] - nOff; - aSize = pDefaultDev->PixelToLogic( aSize, MapMode( MAP_TWIP ) ); + aSize = pDefaultDev->PixelToLogic( aSize, MapMode( MapUnit::MapTwip ) ); maColWidths[ j-1 ] = aSize.Width(); nOff = (*pColOffset)[j]; } diff --git a/sc/source/filter/oox/workbookhelper.cxx b/sc/source/filter/oox/workbookhelper.cxx index cc8bd240afa0..44425e3cdb13 100644 --- a/sc/source/filter/oox/workbookhelper.cxx +++ b/sc/source/filter/oox/workbookhelper.cxx @@ -577,7 +577,7 @@ void WorkbookGlobals::initialize() // initialise edit engine ScDocument& rDoc = getScDocument(); mxEditEngine.reset( new ScEditEngineDefaulter( rDoc.GetEnginePool() ) ); - mxEditEngine->SetRefMapMode( MAP_100TH_MM ); + mxEditEngine->SetRefMapMode( MapUnit::Map100thMM ); mxEditEngine->SetEditTextObjectPool( rDoc.GetEditPool() ); mxEditEngine->SetUpdateMode( false ); mxEditEngine->EnableUndo( false ); diff --git a/sc/source/filter/oox/worksheethelper.cxx b/sc/source/filter/oox/worksheethelper.cxx index bd03be374b5a..bb04088163fb 100644 --- a/sc/source/filter/oox/worksheethelper.cxx +++ b/sc/source/filter/oox/worksheethelper.cxx @@ -1189,14 +1189,14 @@ sal_Int32 getColumnWidth(UnitConverter& rConverter, double nWidth) double nCoeff = rConverter.getCoefficient(UNIT_DIGIT); ScopedVclPtrInstance<VirtualDevice> aDev; - long nPixel = aDev->LogicToPixel(Point(nCoeff, 0), MapMode(MAP_100TH_MM)).getX(); + long nPixel = aDev->LogicToPixel(Point(nCoeff, 0), MapMode(MapUnit::Map100thMM)).getX(); // the 1.047 has been experimentally chosen based on measurements with a screen ruler // TODO: fix the display of cells so that it no longer requires this hack // algorithm from OOXML spec part1: 18.3.1.13 sal_Int32 nColWidthPixel= std::floor( ( ( 256 * nWidth + std::floor( 128.0 / nPixel ) ) / 256.0 ) * nPixel ) * 1.047; - return aDev->PixelToLogic(Point(nColWidthPixel, 0), MapMode(MAP_100TH_MM)).getX(); + return aDev->PixelToLogic(Point(nColWidthPixel, 0), MapMode(MapUnit::Map100thMM)).getX(); } } diff --git a/sc/source/filter/rtf/eeimpars.cxx b/sc/source/filter/rtf/eeimpars.cxx index 97b2e3204577..87018f11e8b5 100644 --- a/sc/source/filter/rtf/eeimpars.cxx +++ b/sc/source/filter/rtf/eeimpars.cxx @@ -496,7 +496,7 @@ bool ScEEImport::GraphicSize( SCCOL nCol, SCROW nRow, SCTAB /*nTab*/, ScEEParseE Size aSizePix = pI->aSize; aSizePix.Width() += 2 * pI->aSpace.X(); aSizePix.Height() += 2 * pI->aSpace.Y(); - Size aLogicSize = pDefaultDev->PixelToLogic( aSizePix, MapMode( MAP_TWIP ) ); + Size aLogicSize = pDefaultDev->PixelToLogic( aSizePix, MapMode( MapUnit::MapTwip ) ); if ( nDir & nHorizontal ) nWidth += aLogicSize.Width(); else if ( nWidth < aLogicSize.Width() ) @@ -580,11 +580,11 @@ void ScEEImport::InsertGraphic( SCCOL nCol, SCROW nRow, SCTAB nTab, aInsertPos.Y() += aSpace.Y(); } // Add offset of Spacing - aSpace = pDefaultDev->PixelToLogic( pI->aSpace, MapMode( MAP_100TH_MM ) ); + aSpace = pDefaultDev->PixelToLogic( pI->aSpace, MapMode( MapUnit::Map100thMM ) ); aInsertPos += aSpace; Size aSizePix = pI->aSize; - aLogicSize = pDefaultDev->PixelToLogic( aSizePix, MapMode( MAP_100TH_MM ) ); + aLogicSize = pDefaultDev->PixelToLogic( aSizePix, MapMode( MapUnit::Map100thMM ) ); // Limit size ::ScLimitSizeOnDrawPage( aLogicSize, aInsertPos, pPage->GetSize() ); diff --git a/sc/source/filter/rtf/rtfparse.cxx b/sc/source/filter/rtf/rtfparse.cxx index 923e69d8ba9b..b6b7a70fad9a 100644 --- a/sc/source/filter/rtf/rtfparse.cxx +++ b/sc/source/filter/rtf/rtfparse.cxx @@ -43,7 +43,7 @@ ScRTFParser::ScRTFParser( EditEngine* pEditP ) : bNewDef( false ) { // RTF default FontSize 12Pt - long nMM = OutputDevice::LogicToLogic( 12, MAP_POINT, MAP_100TH_MM ); + long nMM = OutputDevice::LogicToLogic( 12, MapUnit::MapPoint, MapUnit::Map100thMM ); pPool->SetPoolDefaultItem( SvxFontHeightItem( nMM, 100, EE_CHAR_FONTHEIGHT ) ); // Free-flying pInsDefault pInsDefault = new ScRTFCellDefault( pPool ); diff --git a/sc/source/filter/xml/xmlimprt.cxx b/sc/source/filter/xml/xmlimprt.cxx index e972a15a0853..b68e5db3bf2b 100644 --- a/sc/source/filter/xml/xmlimprt.cxx +++ b/sc/source/filter/xml/xmlimprt.cxx @@ -3430,7 +3430,7 @@ ScEditEngineDefaulter* ScXMLImport::GetEditEngine() if (!mpEditEngine) { mpEditEngine.reset(new ScEditEngineDefaulter(pDoc->GetEnginePool())); - mpEditEngine->SetRefMapMode(MAP_100TH_MM); + mpEditEngine->SetRefMapMode(MapUnit::Map100thMM); mpEditEngine->SetEditTextObjectPool(pDoc->GetEditPool()); mpEditEngine->SetUpdateMode(false); mpEditEngine->EnableUndo(false); diff --git a/sc/source/ui/Accessibility/AccessibleText.cxx b/sc/source/ui/Accessibility/AccessibleText.cxx index 2b3fdcfa2b19..d8387a755ec0 100644 --- a/sc/source/ui/Accessibility/AccessibleText.cxx +++ b/sc/source/ui/Accessibility/AccessibleText.cxx @@ -1096,7 +1096,7 @@ SvxTextForwarder* ScAccessibleEditLineTextData::GetTextForwarder() mpEditEngine = new ScFieldEditEngine(nullptr, pEnginePool, nullptr, true); mbEditEngineCreated = true; mpEditEngine->EnableUndo( false ); - mpEditEngine->SetRefMapMode( MAP_100TH_MM ); + mpEditEngine->SetRefMapMode( MapUnit::Map100thMM ); mpForwarder = new SvxEditEngineForwarder(*mpEditEngine); mpEditEngine->SetText(pTxtWnd->GetTextString()); @@ -1309,7 +1309,7 @@ SvxTextForwarder* ScAccessiblePreviewHeaderCellTextData::GetTextForwarder() if (pDocShell) pEditEngine->SetRefDevice(pDocShell->GetRefDevice()); else - pEditEngine->SetRefMapMode( MAP_100TH_MM ); + pEditEngine->SetRefMapMode( MapUnit::Map100thMM ); pForwarder = new SvxEditEngineForwarder(*pEditEngine); } @@ -1412,7 +1412,7 @@ SvxTextForwarder* ScAccessibleHeaderTextData::GetTextForwarder() ScHeaderEditEngine* pHdrEngine = new ScHeaderEditEngine( pEnginePool ); pHdrEngine->EnableUndo( false ); - pHdrEngine->SetRefMapMode( MAP_TWIP ); + pHdrEngine->SetRefMapMode( MapUnit::MapTwip ); // default font must be set, independently of document // -> use global pool from module @@ -1535,7 +1535,7 @@ SvxTextForwarder* ScAccessibleNoteTextData::GetTextForwarder() if (mpDocSh) mpEditEngine->SetRefDevice(mpDocSh->GetRefDevice()); else - mpEditEngine->SetRefMapMode( MAP_100TH_MM ); + mpEditEngine->SetRefMapMode( MapUnit::Map100thMM ); mpForwarder = new SvxEditEngineForwarder(*mpEditEngine); } diff --git a/sc/source/ui/app/client.cxx b/sc/source/ui/app/client.cxx index e8deabcc36f0..83e9b922c30c 100644 --- a/sc/source/ui/app/client.cxx +++ b/sc/source/ui/app/client.cxx @@ -206,7 +206,7 @@ void ScClient::ViewChanged() } MapUnit aMapUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( xObj->getMapUnit( GetAspect() ) ); - Size aVisSize = OutputDevice::LogicToLogic( Size( aSz.Width, aSz.Height ), aMapUnit, MAP_100TH_MM ); + Size aVisSize = OutputDevice::LogicToLogic( Size( aSz.Width, aSz.Height ), aMapUnit, MapUnit::Map100thMM ); // Take over position and size into document SdrOle2Obj* pDrawObj = GetDrawObj(); diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx index 43b3c5ed8210..834d4c4663ad 100644 --- a/sc/source/ui/app/inputhdl.cxx +++ b/sc/source/ui/app/inputhdl.cxx @@ -679,7 +679,7 @@ void ScInputHandler::SetRefScale( const Fraction& rX, const Fraction& rY ) aScaleY = rY; if (pEngine) { - MapMode aMode( MAP_100TH_MM, Point(), aScaleX, aScaleY ); + MapMode aMode( MapUnit::Map100thMM, Point(), aScaleX, aScaleY ); pEngine->SetRefMapMode( aMode ); } } @@ -703,7 +703,7 @@ void ScInputHandler::UpdateRefDevice() else pEngine->SetRefDevice( nullptr ); - MapMode aMode( MAP_100TH_MM, Point(), aScaleX, aScaleY ); + MapMode aMode( MapUnit::Map100thMM, Point(), aScaleX, aScaleY ); pEngine->SetRefMapMode( aMode ); // SetRefDevice(NULL) uses VirtualDevice, SetRefMapMode forces creation of a local VDev, diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx index 7424fd3e70a0..5f875fb59d9d 100644 --- a/sc/source/ui/app/inputwin.cxx +++ b/sc/source/ui/app/inputwin.cxx @@ -1397,7 +1397,7 @@ ScTextWnd::ScTextWnd(ScInputBarGroup* pParent, ScTabViewShell* pViewSh) // always use application font, so a font with cjk chars can be installed vcl::Font aAppFont = GetFont(); aTextFont = aAppFont; - aTextFont.SetFontSize(PixelToLogic(aAppFont.GetFontSize(), MAP_TWIP)); // AppFont is in pixels + aTextFont.SetFontSize(PixelToLogic(aAppFont.GetFontSize(), MapUnit::MapTwip)); // AppFont is in pixels const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings(); @@ -1417,7 +1417,7 @@ ScTextWnd::ScTextWnd(ScInputBarGroup* pParent, ScTabViewShell* pViewSh) SetSizePixel(aSize); SetBackground(aBgColor); SetLineColor(COL_BLACK); - SetMapMode(MAP_TWIP); + SetMapMode(MapUnit::MapTwip); SetPointer(PointerStyle::Text); SetFont(aTextFont); diff --git a/sc/source/ui/app/msgpool.cxx b/sc/source/ui/app/msgpool.cxx index be2db5a53571..b981f01d7570 100644 --- a/sc/source/ui/app/msgpool.cxx +++ b/sc/source/ui/app/msgpool.cxx @@ -95,9 +95,9 @@ MapUnit ScMessagePool::GetMetric( sal_uInt16 nWhich ) const { // Own attributes: Twips, everything else 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/ui/app/transobj.cxx b/sc/source/ui/app/transobj.cxx index 59d285f27dbb..138abae2fc52 100644 --- a/sc/source/ui/app/transobj.cxx +++ b/sc/source/ui/app/transobj.cxx @@ -348,11 +348,11 @@ bool ScTransferObj::GetData( const datatransfer::DataFlavor& rFlavor, const OUSt aBlock.aEnd.Col(), aBlock.aEnd.Row(), aBlock.aStart.Tab() ); ScopedVclPtrInstance< VirtualDevice > pVirtDev; - pVirtDev->SetOutputSizePixel( pVirtDev->LogicToPixel( aMMRect.GetSize(), MAP_100TH_MM ) ); + pVirtDev->SetOutputSizePixel( pVirtDev->LogicToPixel( aMMRect.GetSize(), MapUnit::Map100thMM ) ); PaintToDev( pVirtDev, pDoc, 1.0, aBlock ); - pVirtDev->SetMapMode( MapMode( MAP_PIXEL ) ); + pVirtDev->SetMapMode( MapMode( MapUnit::MapPixel ) ); Bitmap aBmp = pVirtDev->GetBitmap( Point(), pVirtDev->GetOutputSize() ); bOK = SetBitmapEx( aBmp, rFlavor ); } diff --git a/sc/source/ui/cctrl/cbuttonw.cxx b/sc/source/ui/cctrl/cbuttonw.cxx index 5a5a7008bfa8..f7d9729512d2 100644 --- a/sc/source/ui/cctrl/cbuttonw.cxx +++ b/sc/source/ui/cctrl/cbuttonw.cxx @@ -43,7 +43,7 @@ void ScDDComboBoxButton::SetOutputDevice( OutputDevice* pOutputDevice ) void ScDDComboBoxButton::SetOptSizePixel() { - aBtnSize = pOut->LogicToPixel( Size(0,11), MAP_APPFONT ); + aBtnSize = pOut->LogicToPixel( Size(0,11), MapUnit::MapAppFont ); //aBtnSize.Width() = GetSystemMetrics( SM_CXVSCROLL ) - 1; // Win SDK-Funktion aBtnSize.Width() = pOut->GetSettings().GetStyleSettings().GetScrollBarSize(); } diff --git a/sc/source/ui/cctrl/tbzoomsliderctrl.cxx b/sc/source/ui/cctrl/tbzoomsliderctrl.cxx index 71a4a94af0e0..a380905b55ee 100644 --- a/sc/source/ui/cctrl/tbzoomsliderctrl.cxx +++ b/sc/source/ui/cctrl/tbzoomsliderctrl.cxx @@ -224,7 +224,7 @@ ScZoomSliderWnd::ScZoomSliderWnd( vcl::Window* pParent, mpImpl->maSliderButton = Image( SVX_RES( RID_SVXBMP_SLIDERBUTTON ) ); mpImpl->maIncreaseButton = Image( SVX_RES( RID_SVXBMP_SLIDERINCREASE ) ); mpImpl->maDecreaseButton = Image( SVX_RES( RID_SVXBMP_SLIDERDECREASE ) ); - Size aSliderSize = LogicToPixel( Size( aLogicalSize), MapMode( MAP_10TH_MM ) ); + Size aSliderSize = LogicToPixel( Size( aLogicalSize), MapMode( MapUnit::Map10thMM ) ); SetSizePixel( Size( aSliderSize.Width() * nSliderWidth-1, aSliderSize.Height() + nSliderHeight ) ); } diff --git a/sc/source/ui/condformat/condformatdlg.cxx b/sc/source/ui/condformat/condformatdlg.cxx index 98bcc4adf03d..82fb4068e576 100644 --- a/sc/source/ui/condformat/condformatdlg.cxx +++ b/sc/source/ui/condformat/condformatdlg.cxx @@ -158,7 +158,7 @@ VCL_BUILDER_DECL_FACTORY(ScCondFormatList) Size ScCondFormatList::GetOptimalSize() const { - return LogicToPixel(Size(290, 185), MAP_APPFONT); + return LogicToPixel(Size(290, 185), MapUnit::MapAppFont); } void ScCondFormatList::Resize() diff --git a/sc/source/ui/condformat/condformatdlgentry.cxx b/sc/source/ui/condformat/condformatdlgentry.cxx index 216a0ef82f93..921f57899d70 100644 --- a/sc/source/ui/condformat/condformatdlgentry.cxx +++ b/sc/source/ui/condformat/condformatdlgentry.cxx @@ -94,7 +94,7 @@ void ScCondFrmtEntry::SetIndex(sal_Int32 nIndex) void ScCondFrmtEntry::SetHeight() { - long nPad = LogicToPixel(Size(42,2), MapMode(MAP_APPFONT)).getHeight(); + long nPad = LogicToPixel(Size(42,2), MapMode(MapUnit::MapAppFont)).getHeight(); // Calculate maximum height we need from visible widgets sal_uInt16 nChildren = GetChildCount(); diff --git a/sc/source/ui/condformat/condformatmgr.cxx b/sc/source/ui/condformat/condformatmgr.cxx index ba9df607709c..f8d7447c3bdd 100644 --- a/sc/source/ui/condformat/condformatmgr.cxx +++ b/sc/source/ui/condformat/condformatmgr.cxx @@ -99,7 +99,7 @@ void ScCondFormatManagerWindow::setColSizes() return; long aStaticTabs[]= { 2, 0, 0 }; aStaticTabs[2] = rBar.GetSizePixel().Width() / 2; - SvSimpleTable::SetTabs(aStaticTabs, MAP_PIXEL); + SvSimpleTable::SetTabs(aStaticTabs, MapUnit::MapPixel); } ScCondFormatManagerDlg::ScCondFormatManagerDlg(vcl::Window* pParent, ScDocument* pDoc, const ScConditionalFormatList* pFormatList): @@ -109,7 +109,7 @@ ScCondFormatManagerDlg::ScCondFormatManagerDlg(vcl::Window* pParent, ScDocument* mbModified(false) { SvSimpleTableContainer *pContainer = get<SvSimpleTableContainer>("CONTAINER"); - Size aSize(LogicToPixel(Size(290, 220), MAP_APPFONT)); + Size aSize(LogicToPixel(Size(290, 220), MapUnit::MapAppFont)); pContainer->set_width_request(aSize.Width()); pContainer->set_height_request(aSize.Height()); m_pCtrlManager = VclPtr<ScCondFormatManagerWindow>::Create(*pContainer, mpDoc, mpFormatList); diff --git a/sc/source/ui/dbgui/csvgrid.cxx b/sc/source/ui/dbgui/csvgrid.cxx index ad90f5da88ec..34cbd3222bd6 100644 --- a/sc/source/ui/dbgui/csvgrid.cxx +++ b/sc/source/ui/dbgui/csvgrid.cxx @@ -75,7 +75,7 @@ ScCsvGrid::ScCsvGrid( ScCsvControl& rParent ) : mbMTSelecting( false ) { mpEditEngine->SetRefDevice( mpBackgrDev.get() ); - mpEditEngine->SetRefMapMode( MapMode( MAP_PIXEL ) ); + mpEditEngine->SetRefMapMode( MapMode( MapUnit::MapPixel ) ); maEdEngSize = mpEditEngine->GetPaperSize(); mpPopup->SetMenuFlags( mpPopup->GetMenuFlags() | MenuFlags::NoAutoMnemonics ); diff --git a/sc/source/ui/dbgui/csvtablebox.cxx b/sc/source/ui/dbgui/csvtablebox.cxx index aef45567bf95..cb23052062f4 100644 --- a/sc/source/ui/dbgui/csvtablebox.cxx +++ b/sc/source/ui/dbgui/csvtablebox.cxx @@ -74,7 +74,7 @@ VCL_BUILDER_FACTORY_ARGS(ScCsvTableBox, WB_BORDER) Size ScCsvTableBox::GetOptimalSize() const { - Size aDefault(LogicToPixel(Size(243, 82), MapMode(MAP_APPFONT))); + Size aDefault(LogicToPixel(Size(243, 82), MapMode(MapUnit::MapAppFont))); return aDefault; } diff --git a/sc/source/ui/dbgui/scendlg.cxx b/sc/source/ui/dbgui/scendlg.cxx index 675fdce1d82b..3cd9044ca12d 100644 --- a/sc/source/ui/dbgui/scendlg.cxx +++ b/sc/source/ui/dbgui/scendlg.cxx @@ -45,7 +45,7 @@ ScNewScenarioDlg::ScNewScenarioDlg( vcl::Window* pParent, const OUString& rName, { get(m_pEdName, "name"); get(m_pEdComment, "comment"); - Size aSize(m_pEdComment->LogicToPixel(Size(183, 46), MAP_APPFONT)); + Size aSize(m_pEdComment->LogicToPixel(Size(183, 46), MapUnit::MapAppFont)); m_pEdComment->set_width_request(aSize.Width()); m_pEdComment->set_height_request(aSize.Height()); get(m_pCbShowFrame, "showframe"); diff --git a/sc/source/ui/dbgui/validate.cxx b/sc/source/ui/dbgui/validate.cxx index 8add8fcba032..3be6e95a88bc 100644 --- a/sc/source/ui/dbgui/validate.cxx +++ b/sc/source/ui/dbgui/validate.cxx @@ -338,7 +338,7 @@ ScTPValidationValue::ScTPValidationValue( vcl::Window* pParent, const SfxItemSet get(m_pEdMin, "min"); m_pEdMin->SetReferences(nullptr, m_pFtMin); get(m_pEdList, "minlist"); - Size aSize(LogicToPixel(Size(174, 105), MAP_APPFONT)); + Size aSize(LogicToPixel(Size(174, 105), MapUnit::MapAppFont)); m_pEdList->set_width_request(aSize.Width()); m_pEdList->set_height_request(aSize.Height()); get(m_pFtMax, "maxft"); diff --git a/sc/source/ui/dialogs/searchresults.cxx b/sc/source/ui/dialogs/searchresults.cxx index 243fb2a61549..3cd86fac9b8b 100644 --- a/sc/source/ui/dialogs/searchresults.cxx +++ b/sc/source/ui/dialogs/searchresults.cxx @@ -28,7 +28,7 @@ SearchResultsDlg::SearchResultsDlg( SfxBindings* _pBindings, vcl::Window* pParen { SvSimpleTableContainer *pContainer = get<SvSimpleTableContainer>("results"); Size aControlSize(150, 120); - aControlSize = pContainer->LogicToPixel(aControlSize, MAP_APPFONT); + aControlSize = pContainer->LogicToPixel(aControlSize, MapUnit::MapAppFont); pContainer->set_width_request(aControlSize.Width()); pContainer->set_height_request(aControlSize.Height()); diff --git a/sc/source/ui/docshell/docsh3.cxx b/sc/source/ui/docshell/docsh3.cxx index 880b2fb58abd..dcb08bad4ca6 100644 --- a/sc/source/ui/docshell/docsh3.cxx +++ b/sc/source/ui/docshell/docsh3.cxx @@ -377,15 +377,15 @@ void ScDocShell::CalcOutputFactor() MapMode aOldMode = pRefDev->GetMapMode(); vcl::Font aOldFont = pRefDev->GetFont(); - pRefDev->SetMapMode(MAP_PIXEL); + pRefDev->SetMapMode(MapUnit::MapPixel); pPattern->GetFont(aDefFont, SC_AUTOCOL_BLACK, pRefDev); // font color doesn't matter here pRefDev->SetFont(aDefFont); - nPrinterWidth = pRefDev->PixelToLogic( Size( pRefDev->GetTextWidth(aTestString), 0 ), MAP_100TH_MM ).Width(); + nPrinterWidth = pRefDev->PixelToLogic( Size( pRefDev->GetTextWidth(aTestString), 0 ), MapUnit::Map100thMM ).Width(); pRefDev->SetFont(aOldFont); pRefDev->SetMapMode(aOldMode); ScopedVclPtrInstance< VirtualDevice > pVirtWindow( *Application::GetDefaultDevice() ); - pVirtWindow->SetMapMode(MAP_PIXEL); + pVirtWindow->SetMapMode(MapUnit::MapPixel); pPattern->GetFont(aDefFont, SC_AUTOCOL_BLACK, pVirtWindow); // font color doesn't matter here pVirtWindow->SetFont(aDefFont); nWindowWidth = pVirtWindow->GetTextWidth(aTestString); diff --git a/sc/source/ui/docshell/docsh6.cxx b/sc/source/ui/docshell/docsh6.cxx index d4b1af7047f5..a33c47d486b5 100644 --- a/sc/source/ui/docshell/docsh6.cxx +++ b/sc/source/ui/docshell/docsh6.cxx @@ -111,7 +111,7 @@ void ScDocShell::SetVisAreaOrSize( const Rectangle& rVisArea ) if (pEnv) { vcl::Window* pWin = pEnv->GetEditWin(); - pEnv->MakeScale( aArea.GetSize(), MAP_100TH_MM, + pEnv->MakeScale( aArea.GetSize(), MapUnit::Map100thMM, pWin->LogicToPixel( aArea.GetSize() ) ); } */ diff --git a/sc/source/ui/docshell/sizedev.cxx b/sc/source/ui/docshell/sizedev.cxx index 90bca78f619f..aaa37e1971a2 100644 --- a/sc/source/ui/docshell/sizedev.cxx +++ b/sc/source/ui/docshell/sizedev.cxx @@ -34,7 +34,7 @@ ScSizeDeviceProvider::ScSizeDeviceProvider( ScDocShell* pDocSh ) bOwner = false; aOldMapMode = pDevice->GetMapMode(); - pDevice->SetMapMode( MAP_PIXEL ); // GetNeededSize needs pixel MapMode + pDevice->SetMapMode( MapUnit::MapPixel ); // GetNeededSize needs pixel MapMode // printer has right DigitLanguage already } else @@ -44,7 +44,7 @@ ScSizeDeviceProvider::ScSizeDeviceProvider( ScDocShell* pDocSh ) bOwner = true; } - Point aLogic = pDevice->LogicToPixel( Point(1000,1000), MAP_TWIP ); + Point aLogic = pDevice->LogicToPixel( Point(1000,1000), MapUnit::MapTwip ); nPPTX = aLogic.X() / 1000.0; nPPTY = aLogic.Y() / 1000.0; diff --git a/sc/source/ui/drawfunc/fuins1.cxx b/sc/source/ui/drawfunc/fuins1.cxx index 9b1c8d01392a..4ae82e783ae7 100644 --- a/sc/source/ui/drawfunc/fuins1.cxx +++ b/sc/source/ui/drawfunc/fuins1.cxx @@ -127,8 +127,8 @@ static void lcl_InsertGraphic( const Graphic& rGraphic, // at 100% view scale (as in SetMarkedOriginalSize), // instead of respecting the current view scale MapMode aSourceMap = rGraphic.GetPrefMapMode(); - MapMode aDestMap( MAP_100TH_MM ); - if ( aSourceMap.GetMapUnit() == MAP_PIXEL && pDrawView ) + MapMode aDestMap( MapUnit::Map100thMM ); + if ( aSourceMap.GetMapUnit() == MapUnit::MapPixel && pDrawView ) { Fraction aScaleX, aScaleY; pDrawView->CalcNormScale( aScaleX, aScaleY ); @@ -186,9 +186,9 @@ static void lcl_InsertMedia( const OUString& rMediaURL, bool bApi, if( rPrefSize.Width() && rPrefSize.Height() ) { if( pWindow ) - aSize = pWindow->PixelToLogic( rPrefSize, MAP_100TH_MM ); + aSize = pWindow->PixelToLogic( rPrefSize, MapUnit::Map100thMM ); else - aSize = Application::GetDefaultDevice()->PixelToLogic( rPrefSize, MAP_100TH_MM ); + aSize = Application::GetDefaultDevice()->PixelToLogic( rPrefSize, MapUnit::Map100thMM ); } else aSize = Size( 5000, 5000 ); diff --git a/sc/source/ui/drawfunc/fuins2.cxx b/sc/source/ui/drawfunc/fuins2.cxx index bb949ce08ae2..2622d6102aec 100644 --- a/sc/source/ui/drawfunc/fuins2.cxx +++ b/sc/source/ui/drawfunc/fuins2.cxx @@ -273,8 +273,8 @@ FuInsertOLE::FuInsertOLE(ScTabViewShell* pViewSh, vcl::Window* pWin, ScDrawView* { ::svt::EmbeddedObjectRef aObjRef( xObj, nAspect ); Size aSize; - MapMode aMap100( MAP_100TH_MM ); - MapUnit aMapUnit = MAP_100TH_MM; + MapMode aMap100( MapUnit::Map100thMM ); + MapUnit aMapUnit = MapUnit::Map100thMM; if ( nAspect == embed::Aspects::MSOLE_ICON ) { @@ -301,7 +301,7 @@ FuInsertOLE::FuInsertOLE(ScTabViewShell* pViewSh, vcl::Window* pWin, ScDrawView* // Rechteck mit ausgewogenem Kantenverhaeltnis aSize.Width() = 5000; aSize.Height() = 5000; - Size aTmp = OutputDevice::LogicToLogic( aSize, MAP_100TH_MM, aMapUnit ); + Size aTmp = OutputDevice::LogicToLogic( aSize, MapUnit::Map100thMM, aMapUnit ); aSz.Width = aTmp.Width(); aSz.Height = aTmp.Height(); xObj->setVisualAreaSize( nAspect, aSz ); @@ -340,7 +340,7 @@ FuInsertOLE::FuInsertOLE(ScTabViewShell* pViewSh, vcl::Window* pWin, ScDrawView* awt::Size aSz = xObj->getVisualAreaSize( nAspect ); Size aNewSize( aSz.Width, aSz.Height ); - aNewSize = OutputDevice::LogicToLogic( aNewSize, aMapUnit, MAP_100TH_MM ); + aNewSize = OutputDevice::LogicToLogic( aNewSize, aMapUnit, MapUnit::Map100thMM ); if ( aNewSize != aSize ) { @@ -484,7 +484,7 @@ FuInsertChart::FuInsertChart(ScTabViewShell* pViewSh, vcl::Window* pWin, ScDrawV } if (bSizeCh) { - aSize = vcl::Window::LogicToLogic( aSize, MapMode( MAP_100TH_MM ), MapMode( aMapUnit ) ); + aSize = vcl::Window::LogicToLogic( aSize, MapMode( MapUnit::Map100thMM ), MapMode( aMapUnit ) ); aSz.Width = aSize.Width(); aSz.Height = aSize.Height(); xObj->setVisualAreaSize( nAspect, aSz ); diff --git a/sc/source/ui/drawfunc/futext2.cxx b/sc/source/ui/drawfunc/futext2.cxx index 30f6e4f5fc40..3c096623e296 100644 --- a/sc/source/ui/drawfunc/futext2.cxx +++ b/sc/source/ui/drawfunc/futext2.cxx @@ -38,7 +38,7 @@ SdrOutliner* FuText::MakeOutliner() // so the device must be taken from the model here. OutputDevice* pRef = pDrDoc->GetRefDevice(); if (pRef && pRef != pWindow) - pRef->SetMapMode( MapMode(MAP_100TH_MM) ); + pRef->SetMapMode( MapMode(MapUnit::Map100thMM) ); return pOutl; } diff --git a/sc/source/ui/miscdlgs/acredlin.cxx b/sc/source/ui/miscdlgs/acredlin.cxx index c07e7c35e3f4..7180c3c05a3b 100644 --- a/sc/source/ui/miscdlgs/acredlin.cxx +++ b/sc/source/ui/miscdlgs/acredlin.cxx @@ -1772,7 +1772,7 @@ void ScAcceptChgDlg::Initialize(SfxChildWinInfo *pInfo) { sal_Int32 n1 = aStr.indexOf(';'); aStr = aStr.copy( n1+1 ); - pTheView->SetTab(i, (sal_uInt16)aStr.toInt32(), MAP_PIXEL); + pTheView->SetTab(i, (sal_uInt16)aStr.toInt32(), MapUnit::MapPixel); } } } diff --git a/sc/source/ui/miscdlgs/retypepassdlg.cxx b/sc/source/ui/miscdlgs/retypepassdlg.cxx index 9f128e5c42ff..1a9a8e166f33 100644 --- a/sc/source/ui/miscdlgs/retypepassdlg.cxx +++ b/sc/source/ui/miscdlgs/retypepassdlg.cxx @@ -40,7 +40,7 @@ ScRetypePassDlg::ScRetypePassDlg(vcl::Window* pParent) : get(mpTextDocStatus, "docStatusLabel"); get(mpBtnRetypeDoc, "retypeDocButton"); vcl::Window *pScrolledWindow = get<vcl::Window>("scrolledwindow"); - Size aSize(LogicToPixel(Size(190, 90), MAP_APPFONT)); + Size aSize(LogicToPixel(Size(190, 90), MapUnit::MapAppFont)); pScrolledWindow->set_width_request(aSize.Width()); pScrolledWindow->set_height_request(aSize.Height()); get(mpSheetsBox, "sheetsBox"); diff --git a/sc/source/ui/miscdlgs/sharedocdlg.cxx b/sc/source/ui/miscdlgs/sharedocdlg.cxx index 91b4de526591..4add1fb94faf 100644 --- a/sc/source/ui/miscdlgs/sharedocdlg.cxx +++ b/sc/source/ui/miscdlgs/sharedocdlg.cxx @@ -63,7 +63,7 @@ public: GetSizePixel().Width() - nAccessedWidth); long aStaticTabs[]= { 2, 0, 0 }; aStaticTabs[2] = nWebSiteWidth; - SvSimpleTable::SetTabs(aStaticTabs, MAP_PIXEL); + SvSimpleTable::SetTabs(aStaticTabs, MapUnit::MapPixel); } }; diff --git a/sc/source/ui/namedlg/namemgrtable.cxx b/sc/source/ui/namedlg/namemgrtable.cxx index a1ee00b1c441..99689657e747 100644 --- a/sc/source/ui/namedlg/namemgrtable.cxx +++ b/sc/source/ui/namedlg/namemgrtable.cxx @@ -44,7 +44,7 @@ ScRangeManagerTable::ScRangeManagerTable(SvSimpleTableContainer& rParent, , mpInitListener(nullptr) { static long aStaticTabs[] = {3, 0, 0, 0 }; - SetTabs( &aStaticTabs[0], MAP_PIXEL ); + SetTabs( &aStaticTabs[0], MapUnit::MapPixel ); OUString aNameStr(ScGlobal::GetRscString(STR_HEADER_NAME)); OUString aRangeStr(ScGlobal::GetRscString(STR_HEADER_RANGE_OR_EXPR)); @@ -99,7 +99,7 @@ void ScRangeManagerTable::setColWidths() rHeaderBar.SetItemSize( ITEMID_RANGE, nTabSize); rHeaderBar.SetItemSize( ITEMID_SCOPE, nTabSize); static long aStaticTabs[] = {3, 0, nTabSize, 2*nTabSize }; - SetTabs( &aStaticTabs[0], MAP_PIXEL ); + SetTabs( &aStaticTabs[0], MapUnit::MapPixel ); HeaderEndDragHdl(nullptr); } @@ -295,9 +295,9 @@ IMPL_LINK_NOARG(ScRangeManagerTable, HeaderEndDragHdl, HeaderBar*, void) rHeaderBar.SetItemSize(ITEMID_SCOPE, nItemScopeSize); SetTab(0, 0); - SetTab(1, PixelToLogic( aSz, MapMode(MAP_APPFONT) ).Width() ); + SetTab(1, PixelToLogic( aSz, MapMode(MapUnit::MapAppFont) ).Width() ); aSz.Width() += nItemRangeSize; - SetTab(2, PixelToLogic( aSz, MapMode(MAP_APPFONT) ).Width() ); + SetTab(2, PixelToLogic( aSz, MapMode(MapUnit::MapAppFont) ).Width() ); } IMPL_LINK_NOARG(ScRangeManagerTable, ScrollHdl, SvTreeListBox*, void) diff --git a/sc/source/ui/namedlg/namepast.cxx b/sc/source/ui/namedlg/namepast.cxx index 48bb5888301a..c47b56a14de2 100644 --- a/sc/source/ui/namedlg/namepast.cxx +++ b/sc/source/ui/namedlg/namepast.cxx @@ -49,7 +49,7 @@ ScNamePasteDlg::ScNamePasteDlg( vcl::Window * pParent, ScDocShell* pShell, bool ScAddress aPos(pViewData->GetCurX(), pViewData->GetCurY(), pViewData->GetTabNo()); SvSimpleTableContainer *pContainer = get<SvSimpleTableContainer>("ctrl"); Size aControlSize(210, 0); - aControlSize = LogicToPixel(aControlSize, MAP_APPFONT); + aControlSize = LogicToPixel(aControlSize, MapUnit::MapAppFont); pContainer->set_width_request(aControlSize.Width()); pContainer->set_height_request(10 * GetTextHeight()); mpTable = VclPtr<ScRangeManagerTable>::Create(*pContainer, m_RangeMap, aPos); diff --git a/sc/source/ui/pagedlg/scuitphfedit.cxx b/sc/source/ui/pagedlg/scuitphfedit.cxx index b1e2bdd6b534..67e3b226780d 100644 --- a/sc/source/ui/pagedlg/scuitphfedit.cxx +++ b/sc/source/ui/pagedlg/scuitphfedit.cxx @@ -130,7 +130,7 @@ ScHFEditPage::ScHFEditPage( vcl::Window* pParent, m_pWndRight->SetFont( aPatAttr ); // Set size request for all 3 widgets - Size aSize = LogicToPixel(Size(80, 120), MAP_APPFONT); + Size aSize = LogicToPixel(Size(80, 120), MapUnit::MapAppFont); VclPtr<ScEditWindow> aEditWindows[] = {m_pWndLeft, m_pWndCenter, m_pWndRight}; for (auto &pEditWindow : aEditWindows) diff --git a/sc/source/ui/pagedlg/tphfedit.cxx b/sc/source/ui/pagedlg/tphfedit.cxx index 248fae39f890..4face4a60e86 100644 --- a/sc/source/ui/pagedlg/tphfedit.cxx +++ b/sc/source/ui/pagedlg/tphfedit.cxx @@ -72,7 +72,7 @@ ScEditWindow::ScEditWindow( vcl::Window* pParent, WinBits nBits, ScEditWindowLoc const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings(); Color aBgColor = rStyleSettings.GetWindowColor(); - SetMapMode( MAP_TWIP ); + SetMapMode( MapUnit::MapTwip ); SetPointer( PointerStyle::Text ); SetBackground( aBgColor ); diff --git a/sc/source/ui/sidebar/AlignmentPropertyPanel.cxx b/sc/source/ui/sidebar/AlignmentPropertyPanel.cxx index e1b0993ab03f..24f3f9538766 100644 --- a/sc/source/ui/sidebar/AlignmentPropertyPanel.cxx +++ b/sc/source/ui/sidebar/AlignmentPropertyPanel.cxx @@ -195,7 +195,7 @@ IMPL_LINK_NOARG(AlignmentPropertyPanel, MFLeftIndentMdyHdl, Edit&, void) { mpCBXWrapText->EnableTriState(false); sal_uInt16 nVal = (sal_uInt16)mpMFLeftIndent->GetValue(); - SfxUInt16Item aItem( SID_ATTR_ALIGN_INDENT, (sal_uInt16)CalcToUnit( nVal, MAP_TWIP ) ); + SfxUInt16Item aItem( SID_ATTR_ALIGN_INDENT, (sal_uInt16)CalcToUnit( nVal, MapUnit::MapTwip ) ); GetBindings()->GetDispatcher()->ExecuteList(SID_ATTR_ALIGN_INDENT, SfxCallMode::RECORD, { &aItem }); @@ -297,7 +297,7 @@ void AlignmentPropertyPanel::NotifyItemUpdate( { const SfxUInt16Item* pItem = static_cast<const SfxUInt16Item*>(pState); sal_uInt16 nVal = pItem->GetValue(); - mpMFLeftIndent->SetValue( CalcToPoint(nVal, MAP_TWIP, 1) ); + mpMFLeftIndent->SetValue( CalcToPoint(nVal, MapUnit::MapTwip, 1) ); } else { diff --git a/sc/source/ui/undo/undostyl.cxx b/sc/source/ui/undo/undostyl.cxx index aaf2541462f7..a021422bdf25 100644 --- a/sc/source/ui/undo/undostyl.cxx +++ b/sc/source/ui/undo/undostyl.cxx @@ -91,7 +91,7 @@ static void lcl_DocStyleChanged( ScDocument* pDoc, SfxStyleSheetBase* pStyle, bo //! move to document or docshell ScopedVclPtrInstance< VirtualDevice > pVDev; - Point aLogic = pVDev->LogicToPixel( Point(1000,1000), MAP_TWIP ); + Point aLogic = pVDev->LogicToPixel( Point(1000,1000), MapUnit::MapTwip ); double nPPTX = aLogic.X() / 1000.0; double nPPTY = aLogic.Y() / 1000.0; Fraction aZoom(1,1); diff --git a/sc/source/ui/unoobj/chartuno.cxx b/sc/source/ui/unoobj/chartuno.cxx index 8cb4a28ff5c2..f604e9dfc574 100644 --- a/sc/source/ui/unoobj/chartuno.cxx +++ b/sc/source/ui/unoobj/chartuno.cxx @@ -231,7 +231,7 @@ void SAL_CALL ScChartsObj::addNewByName( const OUString& rName, sal_Int64 nAspect(embed::Aspects::MSOLE_CONTENT); MapUnit aMapUnit(VCLUnoHelper::UnoEmbed2VCLMapUnit( xObj->getMapUnit( nAspect ) )); Size aSize(aInsRect.GetSize()); - aSize = vcl::Window::LogicToLogic( aSize, MapMode( MAP_100TH_MM ), MapMode( aMapUnit ) ); + aSize = vcl::Window::LogicToLogic( aSize, MapMode( MapUnit::Map100thMM ), MapMode( aMapUnit ) ); awt::Size aSz; aSz.Width = aSize.Width(); aSz.Height = aSize.Height(); diff --git a/sc/source/ui/unoobj/styleuno.cxx b/sc/source/ui/unoobj/styleuno.cxx index 03679b621c7c..763ff041b097 100644 --- a/sc/source/ui/unoobj/styleuno.cxx +++ b/sc/source/ui/unoobj/styleuno.cxx @@ -744,7 +744,7 @@ void SAL_CALL ScStyleFamilyObj::removeByName( const OUString& aName ) { // wie ScViewFunc::RemoveStyleSheetInUse ScopedVclPtrInstance< VirtualDevice > pVDev; - Point aLogic = pVDev->LogicToPixel( Point(1000,1000), MAP_TWIP ); + Point aLogic = pVDev->LogicToPixel( Point(1000,1000), MapUnit::MapTwip ); double nPPTX = aLogic.X() / 1000.0; double nPPTY = aLogic.Y() / 1000.0; Fraction aZoom(1,1); @@ -1084,7 +1084,7 @@ void SAL_CALL ScStyleObj::setParentStyle( const OUString& rParentStyle ) // update lineheight ScopedVclPtrInstance< VirtualDevice > pVDev; - Point aLogic = pVDev->LogicToPixel( Point(1000,1000), MAP_TWIP ); + Point aLogic = pVDev->LogicToPixel( Point(1000,1000), MapUnit::MapTwip ); double nPPTX = aLogic.X() / 1000.0; double nPPTY = aLogic.Y() / 1000.0; Fraction aZoom(1,1); @@ -1450,7 +1450,7 @@ void SAL_CALL ScStyleObj::setAllPropertiesToDefault() // row heights ScopedVclPtrInstance< VirtualDevice > pVDev; - Point aLogic = pVDev->LogicToPixel( Point(1000,1000), MAP_TWIP ); + Point aLogic = pVDev->LogicToPixel( Point(1000,1000), MapUnit::MapTwip ); double nPPTX = aLogic.X() / 1000.0; double nPPTY = aLogic.Y() / 1000.0; Fraction aZoom(1,1); @@ -1830,7 +1830,7 @@ void ScStyleObj::SetOnePropertyValue( const OUString& rPropertyName, const SfxIt { // update lineheight ScopedVclPtrInstance< VirtualDevice > pVDev; - Point aLogic = pVDev->LogicToPixel( Point(1000,1000), MAP_TWIP ); + Point aLogic = pVDev->LogicToPixel( Point(1000,1000), MapUnit::MapTwip ); double nPPTX = aLogic.X() / 1000.0; double nPPTY = aLogic.Y() / 1000.0; Fraction aZoom(1,1); diff --git a/sc/source/ui/unoobj/textuno.cxx b/sc/source/ui/unoobj/textuno.cxx index 041ac3d4e747..ddf83ee1b8cf 100644 --- a/sc/source/ui/unoobj/textuno.cxx +++ b/sc/source/ui/unoobj/textuno.cxx @@ -211,7 +211,7 @@ SvxTextForwarder* ScHeaderFooterTextData::GetTextForwarder() ScHeaderEditEngine* pHdrEngine = new ScHeaderEditEngine( pEnginePool ); pHdrEngine->EnableUndo( false ); - pHdrEngine->SetRefMapMode( MAP_TWIP ); + pHdrEngine->SetRefMapMode( MapUnit::MapTwip ); // default font must be set, independently of document // -> use global pool from module @@ -859,7 +859,7 @@ ScDrawTextCursor* ScDrawTextCursor::getImplementation(const uno::Reference<uno:: ScSimpleEditSourceHelper::ScSimpleEditSourceHelper() { SfxItemPool* pEnginePool = EditEngine::CreatePool(); - pEnginePool->SetDefaultMetric( MAP_100TH_MM ); + pEnginePool->SetDefaultMetric( MapUnit::Map100thMM ); pEnginePool->FreezeIdRanges(); pEditEngine = new ScFieldEditEngine(nullptr, pEnginePool, nullptr, true); // TRUE: become owner of pool @@ -960,7 +960,7 @@ SvxTextForwarder* ScCellTextData::GetTextForwarder() if (pDocShell) pEditEngine->SetRefDevice(pDocShell->GetRefDevice()); else - pEditEngine->SetRefMapMode( MAP_100TH_MM ); + pEditEngine->SetRefMapMode( MapUnit::Map100thMM ); pForwarder = new SvxEditEngineForwarder(*pEditEngine); } diff --git a/sc/source/ui/view/drawutil.cxx b/sc/source/ui/view/drawutil.cxx index ea4a83fa0d37..5f5c969c27ce 100644 --- a/sc/source/ui/view/drawutil.cxx +++ b/sc/source/ui/view/drawutil.cxx @@ -56,7 +56,7 @@ void ScDrawUtil::CalcScale( ScDocument* pDoc, SCTAB nTab, nPixelY += ScViewData::ToPixel(nHeight, nPPTY); } - MapMode aHMMMode( MAP_100TH_MM, Point(), rZoomX, rZoomY ); + MapMode aHMMMode( MapUnit::Map100thMM, Point(), rZoomX, rZoomY ); Point aPixelLog = pDev->PixelToLogic( Point( nPixelX,nPixelY ), aHMMMode ); // Fraction(double) ctor can be used here (and avoid overflows of PixelLog * Zoom) diff --git a/sc/source/ui/view/drawvie4.cxx b/sc/source/ui/view/drawvie4.cxx index d0f51dfeb725..839f47d7bc7c 100644 --- a/sc/source/ui/view/drawvie4.cxx +++ b/sc/source/ui/view/drawvie4.cxx @@ -472,7 +472,7 @@ void ScDrawView::SetMarkedOriginalSize() if ( nAspect == embed::Aspects::MSOLE_ICON ) { - MapMode aMapMode( MAP_100TH_MM ); + MapMode aMapMode( MapUnit::Map100thMM ); aOriginalSize = static_cast<SdrOle2Obj*>(pObj)->GetOrigObjSize( &aMapMode ); bDo = true; } @@ -485,7 +485,7 @@ void ScDrawView::SetMarkedOriginalSize() aSz = xObj->getVisualAreaSize( static_cast<SdrOle2Obj*>(pObj)->GetAspect() ); aOriginalSize = OutputDevice::LogicToLogic( Size( aSz.Width, aSz.Height ), - aUnit, MAP_100TH_MM ); + aUnit, MapUnit::Map100thMM ); bDo = true; } catch( embed::NoVisualAreaSizeException& ) { @@ -499,8 +499,8 @@ void ScDrawView::SetMarkedOriginalSize() const Graphic& rGraphic = static_cast<SdrGrafObj*>(pObj)->GetGraphic(); MapMode aSourceMap = rGraphic.GetPrefMapMode(); - MapMode aDestMap( MAP_100TH_MM ); - if (aSourceMap.GetMapUnit() == MAP_PIXEL) + MapMode aDestMap( MapUnit::Map100thMM ); + if (aSourceMap.GetMapUnit() == MapUnit::MapPixel) { // consider pixel correction, so that the bitmap is correct on the screen Fraction aNormScaleX, aNormScaleY; diff --git a/sc/source/ui/view/drawview.cxx b/sc/source/ui/view/drawview.cxx index f39da944547d..9bf969152c6b 100644 --- a/sc/source/ui/view/drawview.cxx +++ b/sc/source/ui/view/drawview.cxx @@ -313,7 +313,7 @@ void ScDrawView::RecalcScale() } else { - Point aLogic = pDev->LogicToPixel( Point(1000,1000), MAP_TWIP ); + Point aLogic = pDev->LogicToPixel( Point(1000,1000), MapUnit::MapTwip ); nPPTX = aLogic.X() / 1000.0; nPPTY = aLogic.Y() / 1000.0; //! Zoom, handed over ??? @@ -559,8 +559,8 @@ bool ScDrawView::SdrBeginTextEdit( if (OutlinerView* pView = GetTextEditOutlinerView()) { Rectangle aRectangle = pView->GetOutputArea(); - if (pWinL && pWinL->GetMapMode().GetMapUnit() == MAP_100TH_MM) - aRectangle = OutputDevice::LogicToLogic(aRectangle, MAP_100TH_MM, MAP_TWIP); + if (pWinL && pWinL->GetMapMode().GetMapUnit() == MapUnit::Map100thMM) + aRectangle = OutputDevice::LogicToLogic(aRectangle, MapUnit::Map100thMM, MapUnit::MapTwip); OString sRectangle = aRectangle.toString(); SfxLokHelper::notifyOtherViews(pViewSh, LOK_CALLBACK_VIEW_LOCK, "rectangle", sRectangle); } diff --git a/sc/source/ui/view/gridmerg.cxx b/sc/source/ui/view/gridmerg.cxx index 6ccc18170f2f..c7cf899953f9 100644 --- a/sc/source/ui/view/gridmerg.cxx +++ b/sc/source/ui/view/gridmerg.cxx @@ -35,7 +35,7 @@ ScGridMerger::ScGridMerger( OutputDevice* pOutDev, long nOnePixelX, long nOnePix // optimize (DrawGrid) only for pixel MapMode, // to avoid rounding errors - bOptimize = ( pDev->GetMapMode().GetMapUnit() == MAP_PIXEL ); + bOptimize = ( pDev->GetMapMode().GetMapUnit() == MapUnit::MapPixel ); } ScGridMerger::~ScGridMerger() diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index 5ffad27f03ec..667bc3eee40c 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -978,7 +978,7 @@ void ScGridWindow::DoScenarioMenu( const ScRange& rScenRange ) vcl::Font aOldFont = GetFont(); SetFont(mpFilterBox->GetFont()); MapMode aOldMode = GetMapMode(); - SetMapMode( MAP_PIXEL ); + SetMapMode( MapUnit::MapPixel ); nHeight = GetTextHeight(); nHeight *= SC_FILTERLISTBOX_LINES; @@ -1104,7 +1104,7 @@ void ScGridWindow::LaunchDataSelectMenu( SCCOL nCol, SCROW nRow ) vcl::Font aOldFont = GetFont(); SetFont(mpFilterBox->GetFont()); MapMode aOldMode = GetMapMode(); - SetMapMode(MAP_PIXEL); + SetMapMode(MapUnit::MapPixel); nHeight = GetTextHeight(); nHeight *= SC_FILTERLISTBOX_LINES; @@ -1584,7 +1584,7 @@ bool ScGridWindow::IsCellCoveredByText(SCsCOL nPosX, SCsROW nPosY, SCTAB nTab, S &aZoomX, &aZoomY); MapMode aCurrentMapMode(GetMapMode()); - SetMapMode(MAP_PIXEL); + SetMapMode(MapUnit::MapPixel); // obtain the bounding box of the text in first non-empty cell // to the left @@ -4614,7 +4614,7 @@ void ScGridWindow::ScrollPixel( long nDifX, long nDifY ) bIsInScroll = true; - SetMapMode(MAP_PIXEL); + SetMapMode(MapUnit::MapPixel); Scroll( nDifX, nDifY, ScrollFlags::Children ); SetMapMode( GetDrawMapMode() ); // generated shifted MapMode @@ -5194,7 +5194,7 @@ std::shared_ptr<ScFieldEditEngine> createEditEngine( ScDocShell* pDocSh, const S std::shared_ptr<ScFieldEditEngine> pEngine(new ScFieldEditEngine(&rDoc, rDoc.GetEditPool())); ScSizeDeviceProvider aProv(pDocSh); pEngine->SetRefDevice(aProv.GetDevice()); - pEngine->SetRefMapMode(MAP_100TH_MM); + pEngine->SetRefMapMode(MapUnit::Map100thMM); SfxItemSet aDefault = pEngine->GetEmptyItemSet(); rPat.FillEditItemSet(&aDefault); aDefault.Put( SvxAdjustItem(toSvxAdjust(rPat), EE_PARA_JUST) ); diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx index 2e66fef6464f..27a7d24d4359 100644 --- a/sc/source/ui/view/gridwin4.cxx +++ b/sc/source/ui/view/gridwin4.cxx @@ -498,7 +498,7 @@ void ScGridWindow::Draw( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, ScUpdateMod // use a virtual device with 1/100th mm as text formatting reference xFmtVirtDev.disposeAndReset( VclPtr<VirtualDevice>::Create() ); - xFmtVirtDev->SetMapMode( MAP_100TH_MM ); + xFmtVirtDev->SetMapMode( MapUnit::Map100thMM ); aOutputData.SetFmtDevice( xFmtVirtDev.get() ); bLogicText = true; // use logic MapMode @@ -670,7 +670,7 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, const ScTableInfo& rTableI { // save MapMode and set to pixel MapMode aCurrentMapMode(pContentDev->GetMapMode()); - pContentDev->SetMapMode(MAP_PIXEL); + pContentDev->SetMapMode(MapUnit::MapPixel); Rectangle aPixRect = Rectangle( Point(), GetOutputSizePixel() ); pContentDev->SetFillColor( rColorCfg.GetColorValue(svtools::APPBACKGROUND).nColor ); @@ -707,7 +707,7 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, const ScTableInfo& rTableI if ( rDoc.HasBackgroundDraw( nTab, aDrawingRectLogic ) ) { - pContentDev->SetMapMode(MAP_PIXEL); + pContentDev->SetMapMode(MapUnit::MapPixel); aOutputData.DrawClear(); // drawing background @@ -728,7 +728,7 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, const ScTableInfo& rTableI if ( !bGridFirst && ( bGrid || bPage ) ) aOutputData.DrawGrid(*pContentDev, bGrid, bPage); - pContentDev->SetMapMode(MAP_PIXEL); + pContentDev->SetMapMode(MapUnit::MapPixel); if ( bPageMode ) { @@ -762,18 +762,18 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, const ScTableInfo& rTableI if (bIsTiledRendering) { // Tiled offset nScrX, nScrY - MapMode aMap( MAP_PIXEL ); + MapMode aMap( MapUnit::MapPixel ); aMap.SetOrigin(Point(nScrX, nScrY)); pContentDev->SetMapMode(aMap); } else - pContentDev->SetMapMode(MAP_PIXEL); + pContentDev->SetMapMode(MapUnit::MapPixel); // Autofilter- and Pivot-Buttons DrawButtons(nX1, nX2, rTableInfo, pContentDev); // Pixel - pContentDev->SetMapMode(MAP_PIXEL); + pContentDev->SetMapMode(MapUnit::MapPixel); aOutputData.DrawClipMarks(); @@ -847,7 +847,7 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, const ScTableInfo& rTableI } } - pContentDev->SetMapMode(MAP_PIXEL); + pContentDev->SetMapMode(MapUnit::MapPixel); if ( pViewData->IsRefMode() && nTab >= pViewData->GetRefStartZ() && nTab <= pViewData->GetRefEndZ() ) { @@ -965,7 +965,7 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, const ScTableInfo& rTableI // paint the editeng text Rectangle aEditRect(Point(nScrX, nScrY), Size(aOutputData.GetScrW(), aOutputData.GetScrH())); pEditView->Paint(rDevice.PixelToLogic(aEditRect), &rDevice); - rDevice.SetMapMode(MAP_PIXEL); + rDevice.SetMapMode(MapUnit::MapPixel); // restore the cursor it was originally visible if (bVisCursor) @@ -1036,7 +1036,7 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, const ScTableInfo& rTableI Rectangle aEditRect(Point(nScreenX, nScreenY), Size(nScreenW, nScreenH)); pOtherEditView->Paint(rDevice.PixelToLogic(aEditRect), &rDevice); - rDevice.SetMapMode(MAP_PIXEL); + rDevice.SetMapMode(MapUnit::MapPixel); } } } @@ -1226,11 +1226,11 @@ void ScGridWindow::LogicInvalidate(const Rectangle* pRectangle) // When dragging shapes the map mode is disabled. if (IsMapModeEnabled()) { - if (GetMapMode().GetMapUnit() == MAP_100TH_MM) - aRectangle = OutputDevice::LogicToLogic(aRectangle, MAP_100TH_MM, MAP_TWIP); + if (GetMapMode().GetMapUnit() == MapUnit::Map100thMM) + aRectangle = OutputDevice::LogicToLogic(aRectangle, MapUnit::Map100thMM, MapUnit::MapTwip); } else - aRectangle = PixelToLogic(aRectangle, MapMode(MAP_TWIP)); + aRectangle = PixelToLogic(aRectangle, MapMode(MapUnit::MapTwip)); sRectangle = aRectangle.toString(); } diff --git a/sc/source/ui/view/gridwin_dbgutil.cxx b/sc/source/ui/view/gridwin_dbgutil.cxx index 10b67ca1aa1f..42762835f100 100644 --- a/sc/source/ui/view/gridwin_dbgutil.cxx +++ b/sc/source/ui/view/gridwin_dbgutil.cxx @@ -46,7 +46,7 @@ void ScGridWindow::dumpColumnInformationPixel() for (SCCOL nCol = 0; nCol <= 20; ++nCol) { sal_uInt16 nWidth = pDoc->GetColWidth(nCol, nTab); - long nPixel = LogicToPixel(Point(nWidth, 0), MapMode(MAP_TWIP)).getX(); + long nPixel = LogicToPixel(Point(nWidth, 0), MapMode(MapUnit::MapTwip)).getX(); std::cout << "Column: " << nCol << ", Width: " << nPixel << "px" << std::endl; } } @@ -58,7 +58,7 @@ void ScGridWindow::dumpColumnInformationHmm() for (SCCOL nCol = 0; nCol <= 20; ++nCol) { sal_uInt16 nWidth = pDoc->GetColWidth(nCol, nTab); - long nPixel = LogicToLogic(Point(nWidth, 0), MAP_TWIP, MAP_100TH_MM).getX(); + long nPixel = LogicToLogic(Point(nWidth, 0), MapUnit::MapTwip, MapUnit::Map100thMM).getX(); std::cout << "Column: " << nCol << ", Width: " << nPixel << "hmm" << std::endl; } } diff --git a/sc/source/ui/view/hintwin.cxx b/sc/source/ui/view/hintwin.cxx index 41bce2332042..32f71131717c 100644 --- a/sc/source/ui/view/hintwin.cxx +++ b/sc/source/ui/view/hintwin.cxx @@ -44,7 +44,7 @@ ScOverlayHint::ScOverlayHint(const OUString& rTit, const OUString& rMsg, const C , m_aTitle(rTit) , m_aMessage(convertLineEnd(rMsg, LINEEND_CR)) , m_aTextFont(rFont) - , m_aMapMode(MAP_PIXEL) + , m_aMapMode(MapUnit::MapPixel) , m_nLeft(0) , m_nTop(0) { @@ -158,7 +158,7 @@ drawinglayer::primitive2d::Primitive2DContainer ScOverlayHint::createOverlayObje Size ScOverlayHint::GetSizePixel() const { basegfx::B2DRange aRange; - createOverlaySequence(0, 0, MAP_PIXEL, aRange); + createOverlaySequence(0, 0, MapUnit::MapPixel, aRange); return Size(aRange.getWidth(), aRange.getHeight()); } diff --git a/sc/source/ui/view/notemark.cxx b/sc/source/ui/view/notemark.cxx index 818f9fc76a12..9d5282e58a77 100644 --- a/sc/source/ui/view/notemark.cxx +++ b/sc/source/ui/view/notemark.cxx @@ -78,9 +78,9 @@ IMPL_LINK_NOARG(ScNoteMarker, TimeHdl, Timer *, void) SvtPathOptions aPathOpt; OUString aPath = aPathOpt.GetPalettePath(); pModel = new SdrModel(aPath, nullptr, nullptr, false); - pModel->SetScaleUnit(MAP_100TH_MM); + pModel->SetScaleUnit(MapUnit::Map100thMM); SfxItemPool& rPool = pModel->GetItemPool(); - rPool.SetDefaultMetric(MAP_100TH_MM); + rPool.SetDefaultMetric(MapUnit::Map100thMM); rPool.FreezeIdRanges(); OutputDevice* pPrinter = pDoc->GetRefDevice(); diff --git a/sc/source/ui/view/output.cxx b/sc/source/ui/view/output.cxx index b9a5e462dce1..5c8a05ff2ee9 100644 --- a/sc/source/ui/view/output.cxx +++ b/sc/source/ui/view/output.cxx @@ -339,7 +339,7 @@ void ScOutputData::DrawGrid(vcl::RenderContext& rRenderContext, bool bGrid, bool // // This is where all the confusion comes from, ultimately we want them // always in the logic units (100th of millimiters), but we need to get - // there gradually (get rid of setting MAP_PIXEL first), otherwise we'd + // there gradually (get rid of setting MapUnit::MapPixel first), otherwise we'd // break all the drawing by one change. // So until that happens, we need to special case. bool bWorksInPixels = bMetaFile; diff --git a/sc/source/ui/view/output3.cxx b/sc/source/ui/view/output3.cxx index 42eeeace7160..56a360e3e8b2 100644 --- a/sc/source/ui/view/output3.cxx +++ b/sc/source/ui/view/output3.cxx @@ -82,7 +82,7 @@ Point ScOutputData::PrePrintDrawingLayer(long nLogStX, long nLogStY ) // #i76114# MapMode has to be set because BeginDrawLayers uses GetPaintRegion MapMode aOldMode = mpDev->GetMapMode(); if (!bMetaFile) - mpDev->SetMapMode( MapMode( MAP_100TH_MM, aMMOffset, aOldMode.GetScaleX(), aOldMode.GetScaleY() ) ); + mpDev->SetMapMode( MapMode( MapUnit::Map100thMM, aMMOffset, aOldMode.GetScaleX(), aOldMode.GetScaleY() ) ); // #i74769# work with SdrPaintWindow directly // #i76114# pass bDisableIntersect = true, because the intersection of the table area @@ -108,7 +108,7 @@ void ScOutputData::PostPrintDrawingLayer(const Point& rMMOffset) // #i74768# if (!bMetaFile) { - mpDev->SetMapMode( MapMode( MAP_100TH_MM, rMMOffset, aOldMode.GetScaleX(), aOldMode.GetScaleY() ) ); + mpDev->SetMapMode( MapMode( MapUnit::Map100thMM, rMMOffset, aOldMode.GetScaleX(), aOldMode.GetScaleY() ) ); } if(pViewShell || pDrawView) @@ -155,7 +155,7 @@ void ScOutputData::PrintDrawingLayer(const sal_uInt16 nLayer, const Point& rMMOf if (!bMetaFile) { - mpDev->SetMapMode( MapMode( MAP_100TH_MM, rMMOffset, aOldMode.GetScaleX(), aOldMode.GetScaleY() ) ); + mpDev->SetMapMode( MapMode( MapUnit::Map100thMM, rMMOffset, aOldMode.GetScaleX(), aOldMode.GetScaleY() ) ); } DrawSelectiveObjects( nLayer ); diff --git a/sc/source/ui/view/preview.cxx b/sc/source/ui/view/preview.cxx index 1e916697ae2f..7099142c5dc9 100644 --- a/sc/source/ui/view/preview.cxx +++ b/sc/source/ui/view/preview.cxx @@ -354,7 +354,7 @@ void ScPreview::DoPrint( ScPreviewLocationData* pFillLocation ) Fraction aPreviewZoom( nZoom, 100 ); Fraction aHorPrevZoom( (long)( 100 * nZoom / pDocShell->GetOutputFactor() ), 10000 ); - MapMode aMMMode( MAP_100TH_MM, Point(), aHorPrevZoom, aPreviewZoom ); + MapMode aMMMode( MapUnit::Map100thMM, Point(), aHorPrevZoom, aPreviewZoom ); bool bDoPrint = ( pFillLocation == nullptr ); bool bValidPage = ( nPageNo < nTotalPages ); @@ -559,7 +559,7 @@ void ScPreview::DoPrint( ScPreviewLocationData* pFillLocation ) DrawInvert( nPageEndY - nFooterHeight, PointerStyle::VSizeBar ); } - SetMapMode( MapMode( MAP_PIXEL ) ); + SetMapMode( MapMode( MapUnit::MapPixel ) ); for( int i= aPageArea.aStart.Col(); i<= aPageArea.aEnd.Col(); i++ ) { Point aColumnTop = LogicToPixel( Point( 0, -aOffset.Y() ) ,aMMMode ); @@ -742,7 +742,7 @@ void ScPreview::SetZoom(sal_uInt16 nNewZoom) Fraction aPreviewZoom( nZoom, 100 ); Fraction aHorPrevZoom( (long)( 100 * nZoom / pDocShell->GetOutputFactor() ), 10000 ); - MapMode aMMMode( MAP_100TH_MM, Point(), aHorPrevZoom, aPreviewZoom ); + MapMode aMMMode( MapUnit::Map100thMM, Point(), aHorPrevZoom, aPreviewZoom ); SetMapMode( aMMMode ); bInSetZoom = true; // don't scroll during SetYOffset in UpdateScrollBars @@ -817,7 +817,7 @@ sal_uInt16 ScPreview::GetOptimalZoom(bool bWidthOnly) // desired margin is 0.25cm in default MapMode (like Writer), // but some additional margin is introduced by integer scale values // -> add only 0.10cm, so there is some margin in all cases. - Size aMarginSize( LogicToPixel( Size( 100, 100 ), MAP_100TH_MM ) ); + Size aMarginSize( LogicToPixel( Size( 100, 100 ), MapUnit::Map100thMM ) ); aWinSize.Width() -= 2 * aMarginSize.Width(); aWinSize.Height() -= 2 * aMarginSize.Height(); @@ -853,7 +853,7 @@ void ScPreview::SetXOffset( long nX ) aOffset.X() = nX; if (nDif && !bInSetZoom) { - MapMode aOldMode = GetMapMode(); SetMapMode(MAP_PIXEL); + MapMode aOldMode = GetMapMode(); SetMapMode(MapUnit::MapPixel); Scroll( nDif, 0 ); SetMapMode(aOldMode); } @@ -879,7 +879,7 @@ void ScPreview::SetYOffset( long nY ) aOffset.Y() = nY; if (nDif && !bInSetZoom) { - MapMode aOldMode = GetMapMode(); SetMapMode(MAP_PIXEL); + MapMode aOldMode = GetMapMode(); SetMapMode(MapUnit::MapPixel); Scroll( 0, nDif ); SetMapMode(aOldMode); } @@ -968,7 +968,7 @@ void ScPreview::MouseButtonDown( const MouseEvent& rMEvt ) { Fraction aPreviewZoom( nZoom, 100 ); Fraction aHorPrevZoom( (long)( 100 * nZoom / pDocShell->GetOutputFactor() ), 10000 ); - MapMode aMMMode( MAP_100TH_MM, Point(), aHorPrevZoom, aPreviewZoom ); + MapMode aMMMode( MapUnit::Map100thMM, Point(), aHorPrevZoom, aPreviewZoom ); aButtonDownChangePoint = PixelToLogic( rMEvt.GetPosPixel(),aMMMode ); aButtonDownPt = PixelToLogic( rMEvt.GetPosPixel(),aMMMode ); @@ -1051,7 +1051,7 @@ void ScPreview::MouseButtonUp( const MouseEvent& rMEvt ) { Fraction aPreviewZoom( nZoom, 100 ); Fraction aHorPrevZoom( (long)( 100 * nZoom / pDocShell->GetOutputFactor() ), 10000 ); - MapMode aMMMode( MAP_100TH_MM, Point(), aHorPrevZoom, aPreviewZoom ); + MapMode aMMMode( MapUnit::Map100thMM, Point(), aHorPrevZoom, aPreviewZoom ); aButtonUpPt = PixelToLogic( rMEvt.GetPosPixel(),aMMMode ); @@ -1301,7 +1301,7 @@ void ScPreview::MouseMove( const MouseEvent& rMEvt ) { Fraction aPreviewZoom( nZoom, 100 ); Fraction aHorPrevZoom( (long)( 100 * nZoom / pDocShell->GetOutputFactor() ), 10000 ); - MapMode aMMMode( MAP_100TH_MM, Point(), aHorPrevZoom, aPreviewZoom ); + MapMode aMMMode( MapUnit::Map100thMM, Point(), aHorPrevZoom, aPreviewZoom ); Point aMouseMovePoint = PixelToLogic( rMEvt.GetPosPixel(), aMMMode ); long nLeftMargin = 0; @@ -1538,7 +1538,7 @@ void ScPreview::DragMove( long nDragMovePos, PointerStyle nFlags ) { Fraction aPreviewZoom( nZoom, 100 ); Fraction aHorPrevZoom( (long)( 100 * nZoom / pDocShell->GetOutputFactor() ), 10000 ); - MapMode aMMMode( MAP_100TH_MM, Point(), aHorPrevZoom, aPreviewZoom ); + MapMode aMMMode( MapUnit::Map100thMM, Point(), aHorPrevZoom, aPreviewZoom ); SetMapMode( aMMMode ); long nPos = nDragMovePos; if( nFlags == PointerStyle::HSizeBar || nFlags == PointerStyle::HSplit ) diff --git a/sc/source/ui/view/printfun.cxx b/sc/source/ui/view/printfun.cxx index 300affff95f9..83d763432837 100644 --- a/sc/source/ui/view/printfun.cxx +++ b/sc/source/ui/view/printfun.cxx @@ -191,7 +191,7 @@ void ScPrintFunc::Construct( const ScPrintOptions* pOptions ) // unified MapMode for all calls (e.g. Repaint!!!) // else, EditEngine outputs different text heights - pDev->SetMapMode(MAP_PIXEL); + pDev->SetMapMode(MapUnit::MapPixel); pBorderItem = nullptr; pBackgroundItem = nullptr; @@ -248,7 +248,7 @@ ScPrintFunc::ScPrintFunc( ScDocShell* pShell, SfxPrinter* pNewPrinter, SCTAB nTa pPageData ( pData ) { pDev = pPrinter.get(); - aSrcOffset = pPrinter->PixelToLogic( pPrinter->GetPageOffsetPixel(), MAP_100TH_MM ); + aSrcOffset = pPrinter->PixelToLogic( pPrinter->GetPageOffsetPixel(), MapUnit::Map100thMM ); Construct( pOptions ); } @@ -547,7 +547,7 @@ void ScPrintFunc::DrawToDev( ScDocument* pDoc, OutputDevice* pDev, double /* nPr if ( bMetaFile && pDev->GetOutDevType() == OUTDEV_VIRDEV ) aOutputData.SetSnapPixel(); - Point aLogStart = pDev->PixelToLogic( Point(nScrX,nScrY), MAP_100TH_MM ); + Point aLogStart = pDev->PixelToLogic( Point(nScrX,nScrY), MapUnit::Map100thMM ); long nLogStX = aLogStart.X(); long nLogStY = aLogStart.Y(); @@ -713,7 +713,7 @@ bool ScPrintFunc::AdjustPrintArea( bool bNew ) if ( bChangeCol ) { OutputDevice* pRefDev = pDoc->GetPrinter(); // use the printer also for Preview - pRefDev->SetMapMode( MAP_PIXEL ); // important for GetNeededSize + pRefDev->SetMapMode( MapUnit::MapPixel ); // important for GetNeededSize pDoc->ExtendPrintArea( pRefDev, nPrintTab, nStartCol, nStartRow, nEndCol, nEndRow ); @@ -1114,8 +1114,8 @@ static void lcl_DrawGraphic( const SvxBrushItem &rBrush, vcl::RenderContext *pOu SvxGraphicPosition ePos; if ( pGraphic && pGraphic->IsSupportedGraphic() ) { - const MapMode aMapMM( MAP_100TH_MM ); - if ( pGraphic->GetPrefMapMode().GetMapUnit() == MAP_PIXEL ) + const MapMode aMapMM( MapUnit::Map100thMM ); + if ( pGraphic->GetPrefMapMode().GetMapUnit() == MapUnit::MapPixel ) aGrfSize = pRefDev->PixelToLogic( pGraphic->GetPrefSize(), aMapMM ); else aGrfSize = OutputDevice::LogicToLogic( pGraphic->GetPrefSize(), @@ -1519,7 +1519,7 @@ void ScPrintFunc::LocateArea( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, aMMOffset.X() = (long)(aMMOffset.X() * HMM_PER_TWIPS); aMMOffset.Y() = (long)(aMMOffset.Y() * HMM_PER_TWIPS); aMMOffset += Point( nLogStX, nLogStY ); - MapMode aDrawMapMode( MAP_100TH_MM, aMMOffset, aLogicMode.GetScaleX(), aLogicMode.GetScaleY() ); + MapMode aDrawMapMode( MapUnit::Map100thMM, aMMOffset, aLogicMode.GetScaleX(), aLogicMode.GetScaleY() ); // get pixel rectangle @@ -1609,7 +1609,7 @@ void ScPrintFunc::PrintArea( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, OutputDevice* pRefDev = pDoc->GetPrinter(); // use the printer also for Preview Fraction aPrintFrac( nZoom, 100 ); // without nManualZoom // MapMode, as it would arrive at the printer: - pRefDev->SetMapMode( MapMode( MAP_100TH_MM, Point(), aPrintFrac, aPrintFrac ) ); + pRefDev->SetMapMode( MapMode( MapUnit::Map100thMM, Point(), aPrintFrac, aPrintFrac ) ); // when rendering (PDF), don't use printer as ref device, but printer's MapMode // has to be set anyway, as charts still use it (#106409#) @@ -2569,13 +2569,13 @@ void ScPrintFunc::InitModes() // set MapModes from nZoom etc. aHorFract = Fraction( (long)( nEffZoom / nFact ), 10000 ); } - aLogicMode = MapMode( MAP_100TH_MM, Point(), aHorFract, aZoomFract ); + aLogicMode = MapMode( MapUnit::Map100thMM, Point(), aHorFract, aZoomFract ); Point aLogicOfs( -aOffset.X(), -aOffset.Y() ); - aOffsetMode = MapMode( MAP_100TH_MM, aLogicOfs, aHorFract, aZoomFract ); + aOffsetMode = MapMode( MapUnit::Map100thMM, aLogicOfs, aHorFract, aZoomFract ); Point aTwipsOfs( (long) ( -aOffset.X() / nScaleX + 0.5 ), (long) ( -aOffset.Y() / nScaleY + 0.5 ) ); - aTwipMode = MapMode( MAP_TWIP, aTwipsOfs, aHorFract, aZoomFract ); + aTwipMode = MapMode( MapUnit::MapTwip, aTwipsOfs, aHorFract, aZoomFract ); } void ScPrintFunc::ApplyPrintSettings() @@ -2597,14 +2597,14 @@ void ScPrintFunc::ApplyPrintSettings() aEnumSize.Width() = aEnumSize.Height(); aEnumSize.Height() = nTemp; } - Paper ePaper = SvxPaperInfo::GetSvxPaper( aEnumSize, MAP_TWIP, true ); + Paper ePaper = SvxPaperInfo::GetSvxPaper( aEnumSize, MapUnit::MapTwip, true ); sal_uInt16 nPaperBin = static_cast<const SvxPaperBinItem&>(pParamSet->Get(ATTR_PAGE_PAPERBIN)).GetValue(); pPrinter->SetPaper( ePaper ); if ( PAPER_USER == ePaper ) { MapMode aPrinterMode = pPrinter->GetMapMode(); - MapMode aLocalMode( MAP_TWIP ); + MapMode aLocalMode( MapUnit::MapTwip ); pPrinter->SetMapMode( aLocalMode ); pPrinter->SetPaperSizeUser( aEnumSize ); pPrinter->SetMapMode( aPrinterMode ); diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx index c6b1673a0464..c83ddd442d30 100644 --- a/sc/source/ui/view/tabview.cxx +++ b/sc/source/ui/view/tabview.cxx @@ -1841,7 +1841,7 @@ Point ScTabView::GetChartDialogPos( const Size& rDialogSize, const Rectangle& rL pWin->OutputToAbsoluteScreenPixel( aObjPixel.BottomRight() ) ); Rectangle aDesktop = pWin->GetDesktopRectPixel(); - Size aSpace = pWin->LogicToPixel( Size( 8, 12 ), MAP_APPFONT ); + Size aSpace = pWin->LogicToPixel( Size( 8, 12 ), MapUnit::MapAppFont ); ScDocument* pDoc = aViewData.GetDocument(); SCTAB nTab = aViewData.GetTabNo(); diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx index 3b1e33411b0b..f574b0988949 100644 --- a/sc/source/ui/view/tabview3.cxx +++ b/sc/source/ui/view/tabview3.cxx @@ -1819,7 +1819,7 @@ void ScTabView::SetTabNo( SCTAB nTab, bool bNew, bool bExtendSelection, bool bSa if ( pDrawObj ) { Rectangle aRect = pDrawObj->GetLogicRect(); - MapMode aMapMode( MAP_100TH_MM ); + MapMode aMapMode( MapUnit::Map100thMM ); Size aOleSize = pDrawObj->GetOrigObjSize( &aMapMode ); aRect.SetSize( aOleSize ); aObjArea = aRect; diff --git a/sc/source/ui/view/tabvwsh4.cxx b/sc/source/ui/view/tabvwsh4.cxx index 160dc436c9d5..892b7c71d354 100644 --- a/sc/source/ui/view/tabvwsh4.cxx +++ b/sc/source/ui/view/tabvwsh4.cxx @@ -332,7 +332,7 @@ void ScTabViewShell::UpdateOleZoom() if ( aObjSize.Width() > 0 && aObjSize.Height() > 0 ) { vcl::Window* pWin = GetActiveWin(); - Size aWinHMM = pWin->PixelToLogic( pWin->GetOutputSizePixel(), MAP_100TH_MM ); + Size aWinHMM = pWin->PixelToLogic( pWin->GetOutputSizePixel(), MapUnit::Map100thMM ); SetZoomFactor( Fraction( aWinHMM.Width(),aObjSize.Width() ), Fraction( aWinHMM.Height(),aObjSize.Height() ) ); } @@ -361,7 +361,7 @@ void ScTabViewShell::InnerResizePixel( const Point &rOfs, const Size &rSize ) if ( aObjSize.Width() > 0 && aObjSize.Height() > 0 ) { - Size aLogicSize = GetWindow()->PixelToLogic( aSize, MAP_100TH_MM ); + Size aLogicSize = GetWindow()->PixelToLogic( aSize, MapUnit::Map100thMM ); SfxViewShell::SetZoomFactor( Fraction( aLogicSize.Width(),aObjSize.Width() ), Fraction( aLogicSize.Height(),aObjSize.Height() ) ); } diff --git a/sc/source/ui/view/tabvwshb.cxx b/sc/source/ui/view/tabvwshb.cxx index d16e7e84caf3..35ca636fcd77 100644 --- a/sc/source/ui/view/tabvwshb.cxx +++ b/sc/source/ui/view/tabvwshb.cxx @@ -127,7 +127,7 @@ void ScTabViewShell::ActivateObject( SdrOle2Obj* pObj, long nVerb ) Size aDrawSize = aRect.GetSize(); - MapMode aMapMode( MAP_100TH_MM ); + MapMode aMapMode( MapUnit::Map100thMM ); Size aOleSize = pObj->GetOrigObjSize( &aMapMode ); if ( pClient->GetAspect() != embed::Aspects::MSOLE_ICON @@ -139,7 +139,7 @@ void ScTabViewShell::ActivateObject( SdrOle2Obj* pObj, long nVerb ) { MapUnit aUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( xObj->getMapUnit( pClient->GetAspect() ) ); aOleSize = OutputDevice::LogicToLogic( aDrawSize, - MAP_100TH_MM, aUnit ); + MapUnit::Map100thMM, aUnit ); awt::Size aSz( aOleSize.Width(), aOleSize.Height() ); xObj->setVisualAreaSize( pClient->GetAspect(), aSz ); } diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx index 8e2dd1592d00..34aa647f7da0 100644 --- a/sc/source/ui/view/viewdata.cxx +++ b/sc/source/ui/view/viewdata.cxx @@ -330,7 +330,7 @@ ScViewData::ScViewData( ScDocShell* pDocSh, ScTabViewShell* pViewSh ) : pViewShell ( pViewSh ), pOptions ( new ScViewOptions ), pSpellingView ( nullptr ), - aLogicMode ( MAP_100TH_MM ), + aLogicMode ( MapUnit::Map100thMM ), eDefZoomType( SvxZoomType::PERCENT ), aDefZoomX ( 1,1 ), aDefZoomY ( 1,1 ), @@ -2473,7 +2473,7 @@ void ScViewData::WriteExtOptions( ScExtDocOptions& rDocOpt ) const { Point& rSplitPos = rTabSett.maSplitPos; rSplitPos = Point( bHSplit ? pViewTab->nHSplitPos : 0, bVSplit ? pViewTab->nVSplitPos : 0 ); - rSplitPos = Application::GetDefaultDevice()->PixelToLogic( rSplitPos, MapMode( MAP_TWIP ) ); + rSplitPos = Application::GetDefaultDevice()->PixelToLogic( rSplitPos, MapMode( MapUnit::MapTwip ) ); if( pDocShell ) rSplitPos.X() = (long)((double)rSplitPos.X() / pDocShell->GetOutputFactor()); } @@ -2609,7 +2609,7 @@ void ScViewData::ReadExtOptions( const ScExtDocOptions& rDocOpt ) else { Point aPixel = Application::GetDefaultDevice()->LogicToPixel( - rTabSett.maSplitPos, MapMode( MAP_TWIP ) ); //! Zoom? + rTabSett.maSplitPos, MapMode( MapUnit::MapTwip ) ); //! Zoom? // the test for use of printer metrics for text formatting here // effectively results in the nFactor = 1.0 regardless of the Option setting. if( pDocShell && SC_MOD()->GetInputOptions().GetTextWysiwyg()) diff --git a/sc/source/ui/view/viewfun7.cxx b/sc/source/ui/view/viewfun7.cxx index 5e769f87c7bd..680fcb77e9fd 100644 --- a/sc/source/ui/view/viewfun7.cxx +++ b/sc/source/ui/view/viewfun7.cxx @@ -88,7 +88,7 @@ void ScViewFunc::PasteDraw( const Point& rLogicPos, SdrModel* pModel, if (pRef) { aOldMapMode = pRef->GetMapMode(); - pRef->SetMapMode( MapMode(MAP_100TH_MM) ); + pRef->SetMapMode( MapMode(MapUnit::Map100thMM) ); } bool bNegativePage = GetViewData().GetDocument()->IsNegativePage( GetViewData().GetTabNo() ); @@ -301,14 +301,14 @@ bool ScViewFunc::PasteObject( const Point& rPos, const uno::Reference < embed::X Size aSize; if ( nAspect == embed::Aspects::MSOLE_ICON ) { - MapMode aMapMode( MAP_100TH_MM ); + MapMode aMapMode( MapUnit::Map100thMM ); aSize = aObjRef.GetSize( &aMapMode ); } else { // working with visual area can switch object to running state MapUnit aMapObj = VCLUnoHelper::UnoEmbed2VCLMapUnit( xObj->getMapUnit( nAspect ) ); - MapUnit aMap100 = MAP_100TH_MM; + MapUnit aMap100 = MapUnit::Map100thMM; if ( pDescSize && pDescSize->Width() && pDescSize->Height() ) { @@ -413,9 +413,9 @@ bool ScViewFunc::PasteGraphic( const Point& rPos, const Graphic& rGraphic, Point aPos( rPos ); vcl::Window* pWin = GetActiveWin(); MapMode aSourceMap = rGraphic.GetPrefMapMode(); - MapMode aDestMap( MAP_100TH_MM ); + MapMode aDestMap( MapUnit::Map100thMM ); - if (aSourceMap.GetMapUnit() == MAP_PIXEL) + if (aSourceMap.GetMapUnit() == MapUnit::MapPixel) { // consider pixel correction, so bitmap fits to screen Fraction aScaleX, aScaleY; diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx index efedb2e0803b..23d738f45c69 100644 --- a/sc/source/ui/view/viewfunc.cxx +++ b/sc/source/ui/view/viewfunc.cxx @@ -1404,7 +1404,7 @@ void ScViewFunc::RemoveStyleSheetInUse( const SfxStyleSheetBase* pStyleSheet ) ScDocShellModificator aModificator( *pDocSh ); ScopedVclPtrInstance< VirtualDevice > pVirtDev; - pVirtDev->SetMapMode(MAP_PIXEL); + pVirtDev->SetMapMode(MapUnit::MapPixel); pDoc->StyleSheetChanged( pStyleSheet, true, pVirtDev, rViewData.GetPPTX(), rViewData.GetPPTY(), @@ -1430,7 +1430,7 @@ void ScViewFunc::UpdateStyleSheetInUse( const SfxStyleSheetBase* pStyleSheet ) ScDocShellModificator aModificator( *pDocSh ); ScopedVclPtrInstance< VirtualDevice > pVirtDev; - pVirtDev->SetMapMode(MAP_PIXEL); + pVirtDev->SetMapMode(MapUnit::MapPixel); pDoc->StyleSheetChanged( pStyleSheet, false, pVirtDev, rViewData.GetPPTX(), rViewData.GetPPTY(), diff --git a/sc/source/ui/xmlsource/xmlsourcedlg.cxx b/sc/source/ui/xmlsource/xmlsourcedlg.cxx index 435e81b58254..bbadc7f03704 100644 --- a/sc/source/ui/xmlsource/xmlsourcedlg.cxx +++ b/sc/source/ui/xmlsource/xmlsourcedlg.cxx @@ -78,7 +78,7 @@ ScXMLSourceDlg::ScXMLSourceDlg( get(mpFtSourceFile, "sourcefile"); get(mpMapGrid, "mapgrid"); get(mpLbTree, "tree"); - Size aTreeSize(mpLbTree->LogicToPixel(Size(130, 120), MAP_APPFONT)); + Size aTreeSize(mpLbTree->LogicToPixel(Size(130, 120), MapUnit::MapAppFont)); mpLbTree->set_width_request(aTreeSize.Width()); mpLbTree->set_height_request(aTreeSize.Height()); get(mpRefEdit, "edit"); |