diff options
author | Michael Stahl <mstahl@redhat.com> | 2017-10-26 23:15:06 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2017-10-26 23:17:45 +0200 |
commit | 11d2f3d6e1b6c9baf43d8521293c53525108436d (patch) | |
tree | ffe35d5d47713a11c93c3bf11f588eeaf492fc16 /editeng | |
parent | 213f7c02d4f3ddbe2f52950575e2559c52d98ac2 (diff) |
vcl: make MapMode constructor explicit
Insert constructor everywhere, except a couple places that apparently
want to compare GetMapUnit().
Change-Id: I1910deb60562e5e949203435e827057f70a3f988
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/source/editeng/eerdll.cxx | 2 | ||||
-rw-r--r-- | editeng/source/editeng/impedit.cxx | 10 | ||||
-rw-r--r-- | editeng/source/editeng/impedit2.cxx | 2 | ||||
-rw-r--r-- | editeng/source/items/paperinf.cxx | 10 | ||||
-rw-r--r-- | editeng/source/outliner/outliner.cxx | 4 | ||||
-rw-r--r-- | editeng/source/uno/unoviwou.cxx | 6 |
6 files changed, 20 insertions, 14 deletions
diff --git a/editeng/source/editeng/eerdll.cxx b/editeng/source/editeng/eerdll.cxx index 005a0e4a218d..a7f74bf2701f 100644 --- a/editeng/source/editeng/eerdll.cxx +++ b/editeng/source/editeng/eerdll.cxx @@ -216,7 +216,7 @@ std::locale& EditDLL::GetResLocale() editeng::SharedVclResources::SharedVclResources() : m_pVirDev(VclPtr<VirtualDevice>::Create()) { - m_pVirDev->SetMapMode(MapUnit::MapTwip); + m_pVirDev->SetMapMode(MapMode(MapUnit::MapTwip)); } editeng::SharedVclResources::~SharedVclResources() diff --git a/editeng/source/editeng/impedit.cxx b/editeng/source/editeng/impedit.cxx index 8622bc4a7133..f613f419b74b 100644 --- a/editeng/source/editeng/impedit.cxx +++ b/editeng/source/editeng/impedit.cxx @@ -431,7 +431,7 @@ void ImpEditView::DrawSelectionXOR( EditSelection aTmpSel, vcl::Region* pRegion, tools::Rectangle& rStart = aRectangles.front(); tools::Rectangle aStart = tools::Rectangle(rStart.Left(), rStart.Top(), rStart.Left() + 1, rStart.Bottom()); if (bMm100ToTwip) - aStart = OutputDevice::LogicToLogic(aStart, MapUnit::Map100thMM, MapUnit::MapTwip); + aStart = OutputDevice::LogicToLogic(aStart, MapMode(MapUnit::Map100thMM), MapMode(MapUnit::MapTwip)); aStart.Move(aOrigin.getX(), aOrigin.getY()); mpViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_TEXT_SELECTION_START, aStart.toString().getStr()); @@ -439,7 +439,7 @@ void ImpEditView::DrawSelectionXOR( EditSelection aTmpSel, vcl::Region* pRegion, tools::Rectangle& rEnd = aRectangles.back(); tools::Rectangle aEnd = tools::Rectangle(rEnd.Right() - 1, rEnd.Top(), rEnd.Right(), rEnd.Bottom()); if (bMm100ToTwip) - aEnd = OutputDevice::LogicToLogic(aEnd, MapUnit::Map100thMM, MapUnit::MapTwip); + aEnd = OutputDevice::LogicToLogic(aEnd, MapMode(MapUnit::Map100thMM), MapMode(MapUnit::MapTwip)); aEnd.Move(aOrigin.getX(), aOrigin.getY()); mpViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_TEXT_SELECTION_END, aEnd.toString().getStr()); @@ -449,7 +449,7 @@ void ImpEditView::DrawSelectionXOR( EditSelection aTmpSel, vcl::Region* pRegion, for (tools::Rectangle & rRectangle : aRectangles) { if (bMm100ToTwip) - rRectangle = OutputDevice::LogicToLogic(rRectangle, MapUnit::Map100thMM, MapUnit::MapTwip); + rRectangle = OutputDevice::LogicToLogic(rRectangle, MapMode(MapUnit::Map100thMM), MapMode(MapUnit::MapTwip)); rRectangle.Move(aOrigin.getX(), aOrigin.getY()); v.emplace_back(rRectangle.toString().getStr()); } @@ -496,7 +496,7 @@ void ImpEditView::ImplDrawHighlightRect( OutputDevice* _pTarget, const Point& rD { if ( rDocPosTopLeft.X() != rDocPosBottomRight.X() ) { - bool bPixelMode = _pTarget->GetMapMode() == MapUnit::MapPixel; + bool bPixelMode = _pTarget->GetMapMode().GetMapUnit() == MapUnit::MapPixel; Point aPnt1( GetWindowPos( rDocPosTopLeft ) ); Point aPnt2( GetWindowPos( rDocPosBottomRight ) ); @@ -1100,7 +1100,7 @@ void ImpEditView::ShowCursor( bool bGotoCursor, bool bForceVisCursor ) // LOK output is always in twips, convert from mm100 if necessary. if (pOutWin->GetMapMode().GetMapUnit() == MapUnit::Map100thMM) - aRect = OutputDevice::LogicToLogic(aRect, MapUnit::Map100thMM, MapUnit::MapTwip); + aRect = OutputDevice::LogicToLogic(aRect, MapMode(MapUnit::Map100thMM), MapMode(MapUnit::MapTwip)); else if (pOutWin->GetMapMode().GetMapUnit() == MapUnit::MapTwip) { // Writer comments: they use editeng, but are separate widgets. diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx index 8ea502e278ac..2ba8c6cde892 100644 --- a/editeng/source/editeng/impedit2.cxx +++ b/editeng/source/editeng/impedit2.cxx @@ -228,7 +228,7 @@ void ImpEditEngine::SetRefMapMode( const MapMode& rMapMode ) mpOwnDev.disposeAndClear(); mpOwnDev = VclPtr<VirtualDevice>::Create(); pRefDev = mpOwnDev; - pRefDev->SetMapMode( MapUnit::MapTwip ); + pRefDev->SetMapMode(MapMode(MapUnit::MapTwip)); SetRefDevice( pRefDev ); pRefDev->SetMapMode( rMapMode ); diff --git a/editeng/source/items/paperinf.cxx b/editeng/source/items/paperinf.cxx index bde8319d93e7..9f2da29c14eb 100644 --- a/editeng/source/items/paperinf.cxx +++ b/editeng/source/items/paperinf.cxx @@ -37,7 +37,9 @@ Size SvxPaperInfo::GetPaperSize( Paper ePaper, MapUnit eUnit ) { PaperInfo aInfo(ePaper); Size aRet(aInfo.getWidth(), aInfo.getHeight()); // in 100thMM - return eUnit == MapUnit::Map100thMM ? aRet : OutputDevice::LogicToLogic(aRet, MapUnit::Map100thMM, eUnit); + return eUnit == MapUnit::Map100thMM + ? aRet + : OutputDevice::LogicToLogic(aRet, MapMode(MapUnit::Map100thMM), MapMode(eUnit)); } /*------------------------------------------------------------------------ @@ -85,7 +87,7 @@ Size SvxPaperInfo::GetPaperSize( const Printer* pPrinter ) Paper SvxPaperInfo::GetSvxPaper( const Size &rSize, MapUnit eUnit, bool bSloppy ) { - Size aSize(eUnit == MapUnit::Map100thMM ? rSize : OutputDevice::LogicToLogic(rSize, eUnit, MapUnit::Map100thMM)); + Size aSize(eUnit == MapUnit::Map100thMM ? rSize : OutputDevice::LogicToLogic(rSize, MapMode(eUnit), MapMode(MapUnit::Map100thMM))); PaperInfo aInfo(aSize.Width(), aSize.Height()); if (bSloppy) aInfo.doSloppyFit(); @@ -105,7 +107,9 @@ Size SvxPaperInfo::GetDefaultPaperSize( MapUnit eUnit ) { PaperInfo aInfo(PaperInfo::getSystemDefaultPaper()); Size aRet(aInfo.getWidth(), aInfo.getHeight()); - return eUnit == MapUnit::Map100thMM ? aRet : OutputDevice::LogicToLogic(aRet, MapUnit::Map100thMM, eUnit); + return eUnit == MapUnit::Map100thMM + ? aRet + : OutputDevice::LogicToLogic(aRet, MapMode(MapUnit::Map100thMM), MapMode(eUnit)); } /*------------------------------------------------------------------------ diff --git a/editeng/source/outliner/outliner.cxx b/editeng/source/outliner/outliner.cxx index ef9852b83102..e4455865396d 100644 --- a/editeng/source/outliner/outliner.cxx +++ b/editeng/source/outliner/outliner.cxx @@ -1438,7 +1438,9 @@ Size Outliner::ImplGetBulletSize( sal_Int32 nPara ) } else { - pPara->aBulSize = OutputDevice::LogicToLogic( pFmt->GetGraphicSize(), MapUnit::Map100thMM, pEditEngine->GetRefDevice()->GetMapMode() ); + pPara->aBulSize = OutputDevice::LogicToLogic(pFmt->GetGraphicSize(), + MapMode(MapUnit::Map100thMM), + pEditEngine->GetRefDevice()->GetMapMode()); } } diff --git a/editeng/source/uno/unoviwou.cxx b/editeng/source/uno/unoviwou.cxx index 96f445e7cb02..6cb02472b3c3 100644 --- a/editeng/source/uno/unoviwou.cxx +++ b/editeng/source/uno/unoviwou.cxx @@ -70,7 +70,7 @@ tools::Rectangle SvxDrawOutlinerViewForwarder::GetVisArea() const MapMode aMapMode(pOutDev->GetMapMode()); aVisArea = OutputDevice::LogicToLogic( aVisArea, pOutliner->GetRefMapMode(), - aMapMode.GetMapUnit() ); + MapMode(aMapMode.GetMapUnit())); aMapMode.SetOrigin(Point()); return pOutDev->LogicToPixel( aVisArea, aMapMode ); } @@ -93,7 +93,7 @@ Point SvxDrawOutlinerViewForwarder::LogicToPixel( const Point& rPoint, const Map MapMode aMapMode(pOutDev->GetMapMode()); Point aPoint2( OutputDevice::LogicToLogic( aPoint1, rMapMode, - aMapMode.GetMapUnit() ) ); + MapMode(aMapMode.GetMapUnit()))); aMapMode.SetOrigin(Point()); return pOutDev->LogicToPixel( aPoint2, aMapMode ); } @@ -111,7 +111,7 @@ Point SvxDrawOutlinerViewForwarder::PixelToLogic( const Point& rPoint, const Map aMapMode.SetOrigin(Point()); Point aPoint1( pOutDev->PixelToLogic( rPoint, aMapMode ) ); Point aPoint2( OutputDevice::LogicToLogic( aPoint1, - aMapMode.GetMapUnit(), + MapMode(aMapMode.GetMapUnit()), rMapMode ) ); Point aTextOffset( GetTextOffset() ); |