diff options
Diffstat (limited to 'sc/source/ui/view')
-rw-r--r-- | sc/source/ui/view/drawutil.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/view/drawvie4.cxx | 8 | ||||
-rw-r--r-- | sc/source/ui/view/drawview.cxx | 6 | ||||
-rw-r--r-- | sc/source/ui/view/gridmerg.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/view/gridwin.cxx | 10 | ||||
-rw-r--r-- | sc/source/ui/view/gridwin4.cxx | 26 | ||||
-rw-r--r-- | sc/source/ui/view/gridwin_dbgutil.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/view/hintwin.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/view/notemark.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/view/output.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/view/output3.cxx | 6 | ||||
-rw-r--r-- | sc/source/ui/view/preview.cxx | 20 | ||||
-rw-r--r-- | sc/source/ui/view/printfun.cxx | 26 | ||||
-rw-r--r-- | sc/source/ui/view/tabview.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/view/tabview3.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/view/tabvwsh4.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/view/tabvwshb.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/view/viewdata.cxx | 6 | ||||
-rw-r--r-- | sc/source/ui/view/viewfun7.cxx | 10 | ||||
-rw-r--r-- | sc/source/ui/view/viewfunc.cxx | 4 |
20 files changed, 76 insertions, 76 deletions
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(), |