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 /sd | |
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 'sd')
44 files changed, 124 insertions, 124 deletions
diff --git a/sd/source/core/drawdoc.cxx b/sd/source/core/drawdoc.cxx index 3df30906acf2..6726f3736d9e 100644 --- a/sd/source/core/drawdoc.cxx +++ b/sd/source/core/drawdoc.cxx @@ -200,11 +200,11 @@ SdDrawDocument::SdDrawDocument(DocumentType eType, SfxObjectShell* pDrDocSh) else SetUIUnit( (FieldUnit)pOptions->GetMetric(), Fraction( 1, 1 ) ); // default - SetScaleUnit(MAP_100TH_MM); + SetScaleUnit(MapUnit::Map100thMM); SetScaleFraction(Fraction(1, 1)); SetDefaultFontHeight(847); // 24p - pItemPool->SetDefaultMetric(MAP_100TH_MM); + pItemPool->SetDefaultMetric(MapUnit::Map100thMM); pItemPool->FreezeIdRanges(); SetTextDefaults(); diff --git a/sd/source/core/drawdoc2.cxx b/sd/source/core/drawdoc2.cxx index 601b4bb90939..3ee8be97e24b 100644 --- a/sd/source/core/drawdoc2.cxx +++ b/sd/source/core/drawdoc2.cxx @@ -492,7 +492,7 @@ void SdDrawDocument::CreateFirstPages( SdDrawDocument* pRefDocument /* = 0 */ ) if (nPageCount <= 1) { // #i57181# Paper size depends on Language, like in Writer - Size aDefSize = SvxPaperInfo::GetDefaultPaperSize( MAP_100TH_MM ); + Size aDefSize = SvxPaperInfo::GetDefaultPaperSize( MapUnit::Map100thMM ); // Insert handout page SdPage* pHandoutPage = AllocSdPage(false); @@ -579,7 +579,7 @@ void SdDrawDocument::CreateFirstPages( SdDrawDocument* pRefDocument /* = 0 */ ) else { // Impress: always use screen format, landscape. - Size aSz( SvxPaperInfo::GetPaperSize(PAPER_SCREEN_4_3, MAP_100TH_MM) ); + Size aSz( SvxPaperInfo::GetPaperSize(PAPER_SCREEN_4_3, MapUnit::Map100thMM) ); pPage->SetSize( Size( aSz.Height(), aSz.Width() ) ); pPage->SetBorder(0, 0, 0, 0); } @@ -1008,7 +1008,7 @@ IMapObject* SdDrawDocument::GetHitIMapObject( SdrObject* pObj, if ( pIMapInfo ) { - const MapMode aMap100( MAP_100TH_MM ); + const MapMode aMap100( MapUnit::Map100thMM ); Size aGraphSize; Point aRelPoint( rWinPoint ); ImageMap& rImageMap = (ImageMap&) pIMapInfo->GetImageMap(); @@ -1034,7 +1034,7 @@ IMapObject* SdDrawDocument::GetHitIMapObject( SdrObject* pObj, if ( rGeo.nShearAngle ) ShearPoint( aRelPoint, rRect.TopLeft(), -rGeo.nTan ); - if ( pGrafObj->GetGrafPrefMapMode().GetMapUnit() == MAP_PIXEL ) + if ( pGrafObj->GetGrafPrefMapMode().GetMapUnit() == MapUnit::MapPixel ) aGraphSize = Application::GetDefaultDevice()->PixelToLogic( pGrafObj->GetGrafPrefSize(), aMap100 ); else aGraphSize = OutputDevice::LogicToLogic( pGrafObj->GetGrafPrefSize(), diff --git a/sd/source/core/sdpage.cxx b/sd/source/core/sdpage.cxx index 733ab02a982d..801016472376 100644 --- a/sd/source/core/sdpage.cxx +++ b/sd/source/core/sdpage.cxx @@ -303,7 +303,7 @@ SdrObject* SdPage::CreatePresObj(PresObjKind eObjKind, bool bVertical, const Rec aOutDev.SetMapMode( aGraphic.GetPrefMapMode() ); Size aSizePix = aOutDev.LogicToPixel( aGraphic.GetPrefSize() ); - aOutDev.SetMapMode(MAP_100TH_MM); + aOutDev.SetMapMode(MapUnit::Map100thMM); Size aSize = aOutDev.PixelToLogic(aSizePix); Point aPnt (0, 0); diff --git a/sd/source/filter/eppt/eppt.cxx b/sd/source/filter/eppt/eppt.cxx index 380e0bc3afbc..8d6cf4d51988 100644 --- a/sd/source/filter/eppt/eppt.cxx +++ b/sd/source/filter/eppt/eppt.cxx @@ -1080,9 +1080,9 @@ void ImplExportComments( const uno::Reference< drawing::XDrawPage >& xPage, SvMe uno::Reference< office::XAnnotation > xAnnotation( xAnnotationEnumeration->nextElement() ); geometry::RealPoint2D aRealPoint2D( xAnnotation->getPosition() ); - MapMode aMapDest( MAP_INCH, Point(), Fraction( 1, 576 ), Fraction( 1, 576 ) ); + MapMode aMapDest( MapUnit::MapInch, Point(), Fraction( 1, 576 ), Fraction( 1, 576 ) ); Point aPoint( OutputDevice::LogicToLogic( Point( static_cast< sal_Int32 >( aRealPoint2D.X * 100.0 ), - static_cast< sal_Int32 >( aRealPoint2D.Y * 100.0 ) ), MAP_100TH_MM, aMapDest ) ); + static_cast< sal_Int32 >( aRealPoint2D.Y * 100.0 ) ), MapUnit::Map100thMM, aMapDest ) ); OUString sAuthor( xAnnotation->getAuthor() ); uno::Reference< text::XText > xText( xAnnotation->getTextRange() ); diff --git a/sd/source/filter/eppt/pptx-epptbase.cxx b/sd/source/filter/eppt/pptx-epptbase.cxx index 350337653598..bd4b23235550 100644 --- a/sd/source/filter/eppt/pptx-epptbase.cxx +++ b/sd/source/filter/eppt/pptx-epptbase.cxx @@ -128,8 +128,8 @@ PPTWriterBase::PPTWriterBase() , mnPages(0) , mnMasterPages(0) , maFraction(1, 576) - , maMapModeSrc(MAP_100TH_MM) - , maMapModeDest(MAP_INCH, Point(), maFraction, maFraction) + , maMapModeSrc(MapUnit::Map100thMM) + , maMapModeDest(MapUnit::MapInch, Point(), maFraction, maFraction) , meLatestPageType(NORMAL) , mpStyleSheet(nullptr) { @@ -148,8 +148,8 @@ PPTWriterBase::PPTWriterBase( const Reference< XModel > & rXModel, , mnPages(0) , mnMasterPages(0) , maFraction(1, 576) - , maMapModeSrc(MAP_100TH_MM) - , maMapModeDest(MAP_INCH, Point(), maFraction, maFraction) + , maMapModeSrc(MapUnit::Map100thMM) + , maMapModeDest(MapUnit::MapInch, Point(), maFraction, maFraction) , meLatestPageType (NORMAL) , mpStyleSheet(nullptr) { diff --git a/sd/source/filter/grf/sdgrffilter.cxx b/sd/source/filter/grf/sdgrffilter.cxx index 9e4bb2f706ca..f0137e847837 100644 --- a/sd/source/filter/grf/sdgrffilter.cxx +++ b/sd/source/filter/grf/sdgrffilter.cxx @@ -194,7 +194,7 @@ bool SdGRFFilter::Import() Point aPos; Size aPagSize( pPage->GetSize() ); Size aGrfSize( OutputDevice::LogicToLogic( aGraphic.GetPrefSize(), - aGraphic.GetPrefMapMode(), MAP_100TH_MM ) ); + aGraphic.GetPrefMapMode(), MapUnit::Map100thMM ) ); aPagSize.Width() -= pPage->GetLftBorder() + pPage->GetRgtBorder(); aPagSize.Height() -= pPage->GetUppBorder() + pPage->GetLwrBorder(); diff --git a/sd/source/filter/html/buttonset.cxx b/sd/source/filter/html/buttonset.cxx index 1eed38115361..2aff0cd214b4 100644 --- a/sd/source/filter/html/buttonset.cxx +++ b/sd/source/filter/html/buttonset.cxx @@ -197,7 +197,7 @@ bool ButtonSetImpl::getPreview( int nSet, const std::vector< OUString >& rButton std::vector< Graphic > aGraphics; ScopedVclPtrInstance< VirtualDevice > pDev; - pDev->SetMapMode(MapMode(MAP_PIXEL)); + pDev->SetMapMode(MapMode(MapUnit::MapPixel)); Size aSize; std::vector< OUString >::const_iterator aIter( rButtons.begin() ); diff --git a/sd/source/filter/html/pubdlg.cxx b/sd/source/filter/html/pubdlg.cxx index cb7dbd6d5e93..74d691031dba 100644 --- a/sd/source/filter/html/pubdlg.cxx +++ b/sd/source/filter/html/pubdlg.cxx @@ -366,7 +366,7 @@ SdPublishingDlg::SdPublishingDlg(vcl::Window* pWindow, DocumentType eDocType) m_bImpress = eDocType == DOCUMENT_TYPE_IMPRESS; - Size aSize(LogicToPixel(Size(60, 50), MAP_APPFONT)); + Size aSize(LogicToPixel(Size(60, 50), MapUnit::MapAppFont)); get(pPage2_Standard_FB, "standardFBImage"); pPage2_Standard_FB->set_width_request(aSize.Width()); pPage2_Standard_FB->set_height_request(aSize.Height()); diff --git a/sd/source/ui/animations/CustomAnimationList.cxx b/sd/source/ui/animations/CustomAnimationList.cxx index 2cbac3ec54cd..2baffb241b46 100644 --- a/sd/source/ui/animations/CustomAnimationList.cxx +++ b/sd/source/ui/animations/CustomAnimationList.cxx @@ -434,7 +434,7 @@ void CustomAnimationTriggerEntryItem::Paint(const Point& rPos, SvTreeListBox& rD // draw the category title int nVertBorder = ((aSize.Height() - rDev.GetTextHeight()) >> 1); - int nHorzBorder = rRenderContext.LogicToPixel(Size(3, 3), MAP_APPFONT).Width(); + int nHorzBorder = rRenderContext.LogicToPixel(Size(3, 3), MapUnit::MapAppFont).Width(); aOutRect.Left() += nHorzBorder; aOutRect.Right() -= nHorzBorder; @@ -969,7 +969,7 @@ void CustomAnimationList::Paint(vcl::RenderContext& rRenderContext, const Rectan { Color aOldColor(rRenderContext.GetTextColor()); rRenderContext.SetTextColor(rRenderContext.GetSettings().GetStyleSettings().GetDisableColor()); - ::Point aOffset(rRenderContext.LogicToPixel(Point(6, 6), MAP_APPFONT)); + ::Point aOffset(rRenderContext.LogicToPixel(Point(6, 6), MapUnit::MapAppFont)); Rectangle aRect(Point(0,0), GetOutputSizePixel()); diff --git a/sd/source/ui/animations/SlideTransitionPane.cxx b/sd/source/ui/animations/SlideTransitionPane.cxx index 8da6e5a3e2a8..9689c54b1834 100644 --- a/sd/source/ui/animations/SlideTransitionPane.cxx +++ b/sd/source/ui/animations/SlideTransitionPane.cxx @@ -387,7 +387,7 @@ public: virtual Size GetOptimalSize() const override { - return LogicToPixel(Size(70, 88), MAP_APPFONT); + return LogicToPixel(Size(70, 88), MapUnit::MapAppFont); } }; diff --git a/sd/source/ui/annotations/annotationwindow.cxx b/sd/source/ui/annotations/annotationwindow.cxx index 90e5b78d6fc7..21cf13b5499c 100644 --- a/sd/source/ui/annotations/annotationwindow.cxx +++ b/sd/source/ui/annotations/annotationwindow.cxx @@ -368,7 +368,7 @@ void AnnotationWindow::StartEdit() void AnnotationWindow::Rescale() { - MapMode aMode(MAP_100TH_MM); + MapMode aMode(MapUnit::Map100thMM); aMode.SetOrigin( Point() ); mpOutliner->SetRefMapMode( aMode ); SetMapMode( aMode ); diff --git a/sd/source/ui/app/sdmod.cxx b/sd/source/ui/app/sdmod.cxx index 5ecdd8dfa36c..2d6b184b7a64 100644 --- a/sd/source/ui/app/sdmod.cxx +++ b/sd/source/ui/app/sdmod.cxx @@ -93,7 +93,7 @@ SdModule::SdModule(SfxObjectFactory* pFact1, SfxObjectFactory* pFact2 ) // set its resolution to 600 DPI. This leads to a visually better // formatting of text in small sizes (6 point and below.) mpVirtualRefDevice.reset(VclPtr<VirtualDevice>::Create()); - mpVirtualRefDevice->SetMapMode( MAP_100TH_MM ); + mpVirtualRefDevice->SetMapMode( MapUnit::Map100thMM ); mpVirtualRefDevice->SetReferenceDevice ( VirtualDevice::RefDevMode::Dpi600 ); } diff --git a/sd/source/ui/app/sdmod2.cxx b/sd/source/ui/app/sdmod2.cxx index c61ebf90874c..fc4f5e76eb21 100644 --- a/sd/source/ui/app/sdmod2.cxx +++ b/sd/source/ui/app/sdmod2.cxx @@ -436,7 +436,7 @@ SfxItemSet* SdModule::CreateItemSet( sal_uInt16 nSlot ) // Pool has by default MapUnit Twips (Awgh!) SfxItemPool& rPool = GetPool(); - rPool.SetDefaultMetric( MAP_100TH_MM ); + rPool.SetDefaultMetric( MapUnit::Map100thMM ); SfxItemSet* pRet = new SfxItemSet( rPool, SID_ATTR_METRIC, SID_ATTR_METRIC, diff --git a/sd/source/ui/dlg/PaneDockingWindow.cxx b/sd/source/ui/dlg/PaneDockingWindow.cxx index a76a2fe4afc5..2dbe88d41039 100644 --- a/sd/source/ui/dlg/PaneDockingWindow.cxx +++ b/sd/source/ui/dlg/PaneDockingWindow.cxx @@ -43,7 +43,7 @@ PaneDockingWindow::PaneDockingWindow( : TitledDockingWindow(_pBindings, pChildWindow, pParent) { SetTitle(rsTitle); - SetSizePixel(LogicToPixel(Size(80,200), MAP_APPFONT)); + SetSizePixel(LogicToPixel(Size(80,200), MapUnit::MapAppFont)); } PaneDockingWindow::~PaneDockingWindow() diff --git a/sd/source/ui/dlg/RemoteDialogClientBox.cxx b/sd/source/ui/dlg/RemoteDialogClientBox.cxx index e20fdec12faa..b1c466f8bc5e 100644 --- a/sd/source/ui/dlg/RemoteDialogClientBox.cxx +++ b/sd/source/ui/dlg/RemoteDialogClientBox.cxx @@ -119,7 +119,7 @@ VCL_BUILDER_DECL_FACTORY(ClientBox) Size ClientBox::GetOptimalSize() const { - return LogicToPixel(Size(200, 140), MAP_APPFONT); + return LogicToPixel(Size(200, 140), MapUnit::MapAppFont); } ClientBox::~ClientBox() @@ -167,7 +167,7 @@ void ClientBox::CalcActiveHeight( const long nPos ) aSize.Width() -= ICON_OFFSET; aSize = LogicToPixel( Size( RSC_CD_PUSHBUTTON_WIDTH, RSC_CD_PUSHBUTTON_HEIGHT ), - MapMode( MAP_APPFONT ) ); + MapMode( MapUnit::MapAppFont ) ); aTextHeight += aSize.Height(); if ( aTextHeight < m_nStdHeight ) @@ -356,7 +356,7 @@ void ClientBox::RecalcAll() Size aPBSize = LogicToPixel( Size( RSC_CD_PUSHBUTTON_WIDTH, RSC_CD_PUSHBUTTON_HEIGHT ), - MapMode( MAP_APPFONT ) ); + MapMode( MapUnit::MapAppFont ) ); m_aPinBox->SetSizePixel( aPBSize ); m_aDeauthoriseButton->SetSizePixel( m_aDeauthoriseButton->GetOptimalSize() ); diff --git a/sd/source/ui/dlg/animobjs.cxx b/sd/source/ui/dlg/animobjs.cxx index e7f2a837b49d..b40f032492c8 100644 --- a/sd/source/ui/dlg/animobjs.cxx +++ b/sd/source/ui/dlg/animobjs.cxx @@ -59,7 +59,7 @@ SdDisplay::SdDisplay(vcl::Window* pWin) : Control(pWin, 0) , aScale(1, 1) { - SetMapMode( MAP_PIXEL ); + SetMapMode( MapUnit::MapPixel ); const StyleSettings& rStyles = Application::GetSettings().GetStyleSettings(); SetBackground( Wallpaper( Color( rStyles.GetFieldColor() ) ) ); } @@ -105,7 +105,7 @@ void SdDisplay::SetScale( const Fraction& rFrac ) Size SdDisplay::GetOptimalSize() const { - return LogicToPixel(Size(147, 87), MAP_APPFONT); + return LogicToPixel(Size(147, 87), MapUnit::MapAppFont); } void SdDisplay::DataChanged( const DataChangedEvent& rDCEvt ) @@ -534,7 +534,7 @@ void AnimationWindow::UpdateControl(bool const bDisableCtrls) Size aObjSize( aObjRect.GetSize() ); Point aOrigin( Point( -aObjRect.Left(), -aObjRect.Top() ) ); MapMode aMap( pVD->GetMapMode() ); - aMap.SetMapUnit( MAP_100TH_MM ); + aMap.SetMapUnit( MapUnit::Map100thMM ); aMap.SetOrigin( aOrigin ); pVD->SetMapMode( aMap ); pVD->SetOutputSize( aObjSize ); @@ -896,7 +896,7 @@ void AnimationWindow::CreateAnimObj (::sd::View& rView ) DBG_ASSERT( pOutWin, "Window does not exist!" ); // find window center - const MapMode aMap100( MAP_100TH_MM ); + const MapMode aMap100( MapUnit::Map100thMM ); Size aMaxSizeLog; Size aMaxSizePix; Size aTemp( pOutWin->GetOutputSizePixel() ); @@ -913,7 +913,7 @@ void AnimationWindow::CreateAnimObj (::sd::View& rView ) Size aTmpSizeLog; const Size aTmpSizePix( rBmpEx.GetSizePixel() ); - if ( aGraphic.GetPrefMapMode().GetMapUnit() == MAP_PIXEL ) + if ( aGraphic.GetPrefMapMode().GetMapUnit() == MapUnit::MapPixel ) aTmpSizeLog = pDefDev->PixelToLogic( aGraphic.GetPrefSize(), aMap100 ); else aTmpSizeLog = OutputDevice::LogicToLogic( aGraphic.GetPrefSize(), aGraphic.GetPrefMapMode(), aMap100 ); diff --git a/sd/source/ui/dlg/copydlg.cxx b/sd/source/ui/dlg/copydlg.cxx index e4ed8df8241d..f68e06c38293 100644 --- a/sd/source/ui/dlg/copydlg.cxx +++ b/sd/source/ui/dlg/copydlg.cxx @@ -118,12 +118,12 @@ void CopyDlg::Reset() long nMoveX = 500L; if( SfxItemState::SET == mrOutAttrs.GetItemState( ATTR_COPY_MOVE_X, true, &pPoolItem ) ) nMoveX = static_cast<const SfxInt32Item*>( pPoolItem )->GetValue(); - SetMetricValue( *m_pMtrFldMoveX, Fraction(nMoveX) / maUIScale, MAP_100TH_MM); + SetMetricValue( *m_pMtrFldMoveX, Fraction(nMoveX) / maUIScale, MapUnit::Map100thMM); long nMoveY = 500L; if( SfxItemState::SET == mrOutAttrs.GetItemState( ATTR_COPY_MOVE_Y, true, &pPoolItem ) ) nMoveY = static_cast<const SfxInt32Item*>( pPoolItem )->GetValue(); - SetMetricValue( *m_pMtrFldMoveY, Fraction(nMoveY) / maUIScale, MAP_100TH_MM); + SetMetricValue( *m_pMtrFldMoveY, Fraction(nMoveY) / maUIScale, MapUnit::Map100thMM); if( SfxItemState::SET == mrOutAttrs.GetItemState( ATTR_COPY_ANGLE, true, &pPoolItem ) ) m_pMtrFldAngle->SetValue( static_cast<const SfxInt32Item*>( pPoolItem )->GetValue() ); @@ -133,12 +133,12 @@ void CopyDlg::Reset() long nWidth = 0L; if( SfxItemState::SET == mrOutAttrs.GetItemState( ATTR_COPY_WIDTH, true, &pPoolItem ) ) nWidth = static_cast<const SfxInt32Item*>( pPoolItem )->GetValue(); - SetMetricValue( *m_pMtrFldWidth, Fraction(nWidth) / maUIScale, MAP_100TH_MM); + SetMetricValue( *m_pMtrFldWidth, Fraction(nWidth) / maUIScale, MapUnit::Map100thMM); long nHeight = 0L; if( SfxItemState::SET == mrOutAttrs.GetItemState( ATTR_COPY_HEIGHT, true, &pPoolItem ) ) nHeight = static_cast<const SfxInt32Item*>( pPoolItem )->GetValue(); - SetMetricValue( *m_pMtrFldHeight, Fraction(nHeight) / maUIScale, MAP_100TH_MM); + SetMetricValue( *m_pMtrFldHeight, Fraction(nHeight) / maUIScale, MapUnit::Map100thMM); if( SfxItemState::SET == mrOutAttrs.GetItemState( ATTR_COPY_START_COLOR, true, &pPoolItem ) ) { @@ -189,10 +189,10 @@ void CopyDlg::Reset() */ void CopyDlg::GetAttr( SfxItemSet& rOutAttrs ) { - long nMoveX = Fraction( GetCoreValue( *m_pMtrFldMoveX, MAP_100TH_MM) ) * maUIScale; - long nMoveY = Fraction( GetCoreValue( *m_pMtrFldMoveY, MAP_100TH_MM) ) * maUIScale; - long nHeight = Fraction( GetCoreValue( *m_pMtrFldHeight, MAP_100TH_MM) ) * maUIScale; - long nWidth = Fraction( GetCoreValue( *m_pMtrFldWidth, MAP_100TH_MM) ) * maUIScale; + long nMoveX = Fraction( GetCoreValue( *m_pMtrFldMoveX, MapUnit::Map100thMM) ) * maUIScale; + long nMoveY = Fraction( GetCoreValue( *m_pMtrFldMoveY, MapUnit::Map100thMM) ) * maUIScale; + long nHeight = Fraction( GetCoreValue( *m_pMtrFldHeight, MapUnit::Map100thMM) ) * maUIScale; + long nWidth = Fraction( GetCoreValue( *m_pMtrFldWidth, MapUnit::Map100thMM) ) * maUIScale; rOutAttrs.Put( SfxUInt16Item( ATTR_COPY_NUMBER, (sal_uInt16) m_pNumFldCopies->GetValue() ) ); rOutAttrs.Put( SfxInt32Item( ATTR_COPY_MOVE_X, nMoveX ) ); @@ -239,9 +239,9 @@ IMPL_LINK_NOARG(CopyDlg, SetViewData, Button*, void) Rectangle aRect = mpView->GetAllMarkedRect(); SetMetricValue( *m_pMtrFldMoveX, Fraction( aRect.GetWidth() ) / - maUIScale, MAP_100TH_MM); + maUIScale, MapUnit::Map100thMM); SetMetricValue( *m_pMtrFldMoveY, Fraction( aRect.GetHeight() ) / - maUIScale, MAP_100TH_MM); + maUIScale, MapUnit::Map100thMM); // sets color attribute const SfxPoolItem* pPoolItem = nullptr; @@ -260,13 +260,13 @@ IMPL_LINK_NOARG(CopyDlg, SetDefault, Button*, void) m_pNumFldCopies->SetValue( 1L ); long nValue = 500L; - SetMetricValue( *m_pMtrFldMoveX, Fraction(nValue) / maUIScale, MAP_100TH_MM); - SetMetricValue( *m_pMtrFldMoveY, Fraction(nValue) / maUIScale, MAP_100TH_MM); + SetMetricValue( *m_pMtrFldMoveX, Fraction(nValue) / maUIScale, MapUnit::Map100thMM); + SetMetricValue( *m_pMtrFldMoveY, Fraction(nValue) / maUIScale, MapUnit::Map100thMM); nValue = 0L; m_pMtrFldAngle->SetValue( nValue ); - SetMetricValue( *m_pMtrFldWidth, Fraction(nValue) / maUIScale, MAP_100TH_MM); - SetMetricValue( *m_pMtrFldHeight, Fraction(nValue) / maUIScale, MAP_100TH_MM); + SetMetricValue( *m_pMtrFldWidth, Fraction(nValue) / maUIScale, MapUnit::Map100thMM); + SetMetricValue( *m_pMtrFldHeight, Fraction(nValue) / maUIScale, MapUnit::Map100thMM); // set color attribute const SfxPoolItem* pPoolItem = nullptr; diff --git a/sd/source/ui/dlg/dlgsnap.cxx b/sd/source/ui/dlg/dlgsnap.cxx index aa0d30375cde..1b9a51655c5a 100644 --- a/sd/source/ui/dlg/dlgsnap.cxx +++ b/sd/source/ui/dlg/dlgsnap.cxx @@ -105,8 +105,8 @@ SdSnapLineDlg::SdSnapLineDlg( nYValue = static_cast<const SfxInt32Item&>( rInAttrs.Get(ATTR_SNAPLINE_Y)).GetValue(); nXValue = Fraction(nXValue) / aUIScale; nYValue = Fraction(nYValue) / aUIScale; - SetMetricValue( *m_pMtrFldX, nXValue, MAP_100TH_MM); - SetMetricValue( *m_pMtrFldY, nYValue, MAP_100TH_MM); + SetMetricValue( *m_pMtrFldX, nXValue, MapUnit::Map100thMM); + SetMetricValue( *m_pMtrFldY, nYValue, MapUnit::Map100thMM); m_pRbPoint->Check(); } @@ -152,8 +152,8 @@ void SdSnapLineDlg::GetAttr(SfxItemSet& rOutAttrs) else if ( m_pRbVert->IsChecked() ) eKind = SK_VERTICAL; else eKind = SK_POINT; - nXValue = Fraction( GetCoreValue( *m_pMtrFldX, MAP_100TH_MM) ) * aUIScale; - nYValue = Fraction( GetCoreValue( *m_pMtrFldY, MAP_100TH_MM) ) * aUIScale; + nXValue = Fraction( GetCoreValue( *m_pMtrFldX, MapUnit::Map100thMM) ) * aUIScale; + nYValue = Fraction( GetCoreValue( *m_pMtrFldY, MapUnit::Map100thMM) ) * aUIScale; rOutAttrs.Put(SfxAllEnumItem(ATTR_SNAPLINE_KIND, (sal_uInt16)eKind)); rOutAttrs.Put(SfxUInt32Item(ATTR_SNAPLINE_X, nXValue)); diff --git a/sd/source/ui/dlg/docprev.cxx b/sd/source/ui/dlg/docprev.cxx index e141119de251..3158d48f47b5 100644 --- a/sd/source/ui/dlg/docprev.cxx +++ b/sd/source/ui/dlg/docprev.cxx @@ -89,7 +89,7 @@ void SdDocPreviewWin::dispose() Size SdDocPreviewWin::GetOptimalSize() const { - return LogicToPixel(Size(122, 96), MAP_APPFONT); + return LogicToPixel(Size(122, 96), MapUnit::MapAppFont); } void SdDocPreviewWin::Resize() diff --git a/sd/source/ui/dlg/headerfooterdlg.cxx b/sd/source/ui/dlg/headerfooterdlg.cxx index e021b59a16e7..f369a613986d 100644 --- a/sd/source/ui/dlg/headerfooterdlg.cxx +++ b/sd/source/ui/dlg/headerfooterdlg.cxx @@ -703,7 +703,7 @@ PresLayoutPreview::~PresLayoutPreview() Size PresLayoutPreview::GetOptimalSize() const { - return LogicToPixel(Size(80, 80), MAP_APPFONT); + return LogicToPixel(Size(80, 80), MapUnit::MapAppFont); } void PresLayoutPreview::init( SdPage *pMaster ) diff --git a/sd/source/ui/dlg/sdpreslt.cxx b/sd/source/ui/dlg/sdpreslt.cxx index a39c9fdc9fd9..8b9fba0396ad 100644 --- a/sd/source/ui/dlg/sdpreslt.cxx +++ b/sd/source/ui/dlg/sdpreslt.cxx @@ -40,7 +40,7 @@ SdPresLayoutDlg::SdPresLayoutDlg(::sd::DrawDocShell* pDocShell, , maStrNone(SD_RESSTR(STR_NULL)) { get(m_pVS, "select"); - Size aPref(LogicToPixel(Size(144 , 141), MAP_APPFONT)); + Size aPref(LogicToPixel(Size(144 , 141), MapUnit::MapAppFont)); m_pVS->set_width_request(aPref.Width()); m_pVS->set_height_request(aPref.Height()); get(m_pCbxMasterPage, "masterpage"); diff --git a/sd/source/ui/dlg/vectdlg.cxx b/sd/source/ui/dlg/vectdlg.cxx index 685658ae26db..54818e24a3be 100644 --- a/sd/source/ui/dlg/vectdlg.cxx +++ b/sd/source/ui/dlg/vectdlg.cxx @@ -45,7 +45,7 @@ SdVectorizeDlg::SdVectorizeDlg(vcl::Window* pParent, const Bitmap& rBmp, ::sd::D get(m_pBmpWin, "source"); get(m_pMtfWin, "vectorized"); - Size aSize(LogicToPixel(Size(92, 100), MAP_APPFONT)); + Size aSize(LogicToPixel(Size(92, 100), MapUnit::MapAppFont)); m_pBmpWin->set_width_request(aSize.Width()); m_pMtfWin->set_width_request(aSize.Width()); m_pBmpWin->set_height_request(aSize.Height()); diff --git a/sd/source/ui/docshell/docshel2.cxx b/sd/source/ui/docshell/docshel2.cxx index c10dbc1c2b34..058851baea1c 100644 --- a/sd/source/ui/docshell/docshel2.cxx +++ b/sd/source/ui/docshell/docshel2.cxx @@ -128,10 +128,10 @@ Rectangle DrawDocShell::GetVisArea(sal_uInt16 nAspect) const if( ( ASPECT_THUMBNAIL == nAspect ) || ( ASPECT_DOCPRINT == nAspect ) ) { // provide size of first page - MapMode aSrcMapMode(MAP_PIXEL); - MapMode aDstMapMode(MAP_100TH_MM); + MapMode aSrcMapMode(MapUnit::MapPixel); + MapMode aDstMapMode(MapUnit::Map100thMM); Size aSize = mpDoc->GetSdPage(0, PK_STANDARD)->GetSize(); - aSrcMapMode.SetMapUnit(MAP_100TH_MM); + aSrcMapMode.SetMapUnit(MapUnit::Map100thMM); aSize = Application::GetDefaultDevice()->LogicToLogic(aSize, &aSrcMapMode, &aDstMapMode); aVisArea.SetSize(aSize); @@ -190,7 +190,7 @@ Size DrawDocShell::GetFirstPageSize() Bitmap DrawDocShell::GetPagePreviewBitmap(SdPage* pPage) { const sal_uInt16 nMaxEdgePixel = 90; - MapMode aMapMode( MAP_100TH_MM ); + MapMode aMapMode( MapUnit::Map100thMM ); const Size aSize( pPage->GetSize() ); const Point aNullPt; ScopedVclPtrInstance< VirtualDevice > pVDev( *Application::GetDefaultDevice() ); diff --git a/sd/source/ui/docshell/docshel4.cxx b/sd/source/ui/docshell/docshel4.cxx index 63696aa45269..b6467f2dcd7e 100644 --- a/sd/source/ui/docshell/docshel4.cxx +++ b/sd/source/ui/docshell/docshel4.cxx @@ -126,7 +126,7 @@ SfxPrinter* DrawDocShell::GetPrinter(bool bCreate) mpPrinter->SetDrawMode( nMode ); MapMode aMM (mpPrinter->GetMapMode()); - aMM.SetMapUnit(MAP_100TH_MM); + aMM.SetMapUnit(MapUnit::Map100thMM); mpPrinter->SetMapMode(aMM); UpdateRefDevice(); } diff --git a/sd/source/ui/docshell/sdclient.cxx b/sd/source/ui/docshell/sdclient.cxx index 1588c9f94a03..dfe544d35671 100644 --- a/sd/source/ui/docshell/sdclient.cxx +++ b/sd/source/ui/docshell/sdclient.cxx @@ -163,7 +163,7 @@ void Client::ViewChanged() // TODO/LEAN: maybe we can do this without requesting the VisualArea? // working with the visual area might need running state, so the object may switch itself to this state - MapMode aMap100( MAP_100TH_MM ); + MapMode aMap100( MapUnit::Map100thMM ); Rectangle aVisArea; Size aSize = pSdrOle2Obj->GetOrigObjSize( &aMap100 ); diff --git a/sd/source/ui/func/fuinsert.cxx b/sd/source/ui/func/fuinsert.cxx index 720b1681f170..68a6f320218c 100644 --- a/sd/source/ui/func/fuinsert.cxx +++ b/sd/source/ui/func/fuinsert.cxx @@ -370,14 +370,14 @@ void FuInsertOLE::DoExecute( SfxRequest& rReq ) // rectangle with balanced edge ratio aSize.Width() = 14100; aSize.Height() = 10000; - Size aTmp = OutputDevice::LogicToLogic( aSize, MAP_100TH_MM, aUnit ); + Size aTmp = OutputDevice::LogicToLogic( aSize, MapUnit::Map100thMM, aUnit ); aSz.Width = aTmp.Width(); aSz.Height = aTmp.Height(); xObj->setVisualAreaSize( nAspect, aSz ); } else { - aSize = OutputDevice::LogicToLogic(aSize, aUnit, MAP_100TH_MM); + aSize = OutputDevice::LogicToLogic(aSize, aUnit, MapUnit::Map100thMM); } Point aPos; @@ -433,7 +433,7 @@ void FuInsertOLE::DoExecute( SfxRequest& rReq ) } pOleObj->SetLogicRect(aRect); - Size aTmp( OutputDevice::LogicToLogic( aRect.GetSize(), MAP_100TH_MM, aUnit ) ); + Size aTmp( OutputDevice::LogicToLogic( aRect.GetSize(), MapUnit::Map100thMM, aUnit ) ); awt::Size aVisualSize; aVisualSize.Width = aTmp.Width(); aVisualSize.Height = aTmp.Height(); @@ -529,7 +529,7 @@ void FuInsertOLE::DoExecute( SfxRequest& rReq ) bool bInsertNewObject = true; Size aSize; - MapUnit aMapUnit = MAP_100TH_MM; + MapUnit aMapUnit = MapUnit::Map100thMM; if ( nAspect != embed::Aspects::MSOLE_ICON ) { awt::Size aSz; @@ -550,14 +550,14 @@ void FuInsertOLE::DoExecute( SfxRequest& rReq ) // rectangle with balanced edge ratio aSize.Width() = 14100; aSize.Height() = 10000; - 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 ); } else { - aSize = OutputDevice::LogicToLogic(aSize, aMapUnit, MAP_100TH_MM); + aSize = OutputDevice::LogicToLogic(aSize, aMapUnit, MapUnit::Map100thMM); } } @@ -593,7 +593,7 @@ void FuInsertOLE::DoExecute( SfxRequest& rReq ) } else { - Size aTmp = OutputDevice::LogicToLogic( aRect.GetSize(), MAP_100TH_MM, aMapUnit ); + Size aTmp = OutputDevice::LogicToLogic( aRect.GetSize(), MapUnit::Map100thMM, aMapUnit ); awt::Size aSz( aTmp.Width(), aTmp.Height() ); xObj->setVisualAreaSize( nAspect, aSz ); } @@ -613,7 +613,7 @@ void FuInsertOLE::DoExecute( SfxRequest& rReq ) if ( nAspect == embed::Aspects::MSOLE_ICON ) { aObjRef.SetGraphicStream( xIconMetaFile, aIconMediaType ); - MapMode aMapMode( MAP_100TH_MM ); + MapMode aMapMode( MapUnit::Map100thMM ); aSize = aObjRef.GetSize( &aMapMode ); } @@ -636,7 +636,7 @@ void FuInsertOLE::DoExecute( SfxRequest& rReq ) awt::Size aSz = xObj->getVisualAreaSize( nAspect ); Size aNewSize = Window::LogicToLogic( Size( aSz.Width, aSz.Height ), - MapMode( aMapUnit ), MapMode( MAP_100TH_MM ) ); + MapMode( aMapUnit ), MapMode( MapUnit::Map100thMM ) ); if ( aNewSize != aSize ) { aRect.SetSize( aNewSize ); @@ -653,7 +653,7 @@ void FuInsertOLE::DoExecute( SfxRequest& rReq ) if ( nAspect != embed::Aspects::MSOLE_ICON ) { - Size aTmp = OutputDevice::LogicToLogic( aRect.GetSize(), MAP_100TH_MM, aMapUnit ); + Size aTmp = OutputDevice::LogicToLogic( aRect.GetSize(), MapUnit::Map100thMM, aMapUnit ); awt::Size aSz( aTmp.Width(), aTmp.Height() ); xObj->setVisualAreaSize( nAspect, aSz ); } @@ -737,9 +737,9 @@ void FuInsertAVMedia::DoExecute( SfxRequest& rReq ) if( aPrefSize.Width() && aPrefSize.Height() ) { if( mpWindow ) - aSize = mpWindow->PixelToLogic( aPrefSize, MAP_100TH_MM ); + aSize = mpWindow->PixelToLogic( aPrefSize, MapUnit::Map100thMM ); else - aSize = Application::GetDefaultDevice()->PixelToLogic( aPrefSize, MAP_100TH_MM ); + aSize = Application::GetDefaultDevice()->PixelToLogic( aPrefSize, MapUnit::Map100thMM ); } else aSize = Size( 5000, 5000 ); @@ -816,9 +816,9 @@ void FuInsert3DModel::DoExecute( SfxRequest& ) Size aSize(480,360); if( mpWindow ) - aSize = mpWindow->PixelToLogic( aSize, MAP_100TH_MM ); + aSize = mpWindow->PixelToLogic( aSize, MapUnit::Map100thMM ); else - aSize = Application::GetDefaultDevice()->PixelToLogic( aSize, MAP_100TH_MM ); + aSize = Application::GetDefaultDevice()->PixelToLogic( aSize, MapUnit::Map100thMM ); if( mpWindow ) { diff --git a/sd/source/ui/presenter/PresenterHelper.cxx b/sd/source/ui/presenter/PresenterHelper.cxx index 8d7ffc8e3630..d103a84fa0db 100644 --- a/sd/source/ui/presenter/PresenterHelper.cxx +++ b/sd/source/ui/presenter/PresenterHelper.cxx @@ -97,7 +97,7 @@ Reference<awt::XWindow> SAL_CALL PresenterHelper::createWindow ( pWindow->Show(bInitiallyVisible); - pWindow->SetMapMode(MAP_PIXEL); + pWindow->SetMapMode(MapUnit::MapPixel); pWindow->SetBackground(); if ( ! bEnableParentClip) { diff --git a/sd/source/ui/presenter/PresenterTextView.cxx b/sd/source/ui/presenter/PresenterTextView.cxx index 39fec898ad74..62cb7141cdb4 100644 --- a/sd/source/ui/presenter/PresenterTextView.cxx +++ b/sd/source/ui/presenter/PresenterTextView.cxx @@ -252,7 +252,7 @@ PresenterTextView::Implementation::Implementation() mnTop(0), mnTotalHeight(-1) { - mpOutputDevice->SetMapMode(MAP_PIXEL); + mpOutputDevice->SetMapMode(MapUnit::MapPixel); GetEditEngine(); } @@ -330,7 +330,7 @@ EditEngine* PresenterTextView::Implementation::CreateEditEngine() EEControlBits(~EEControlBits::PASTESPECIAL) ); pEditEngine->SetWordDelimiters (" .=+-*/(){}[];\""); - pEditEngine->SetRefMapMode (MAP_PIXEL); + pEditEngine->SetRefMapMode (MapUnit::MapPixel); pEditEngine->SetPaperSize (Size(800, 0)); pEditEngine->EraseVirtualDevice(); pEditEngine->ClearModifyFlag(); @@ -387,7 +387,7 @@ void PresenterTextView::Implementation::SetFontDescriptor ( SvxFontHeightItem aFontHeight( Application::GetDefaultDevice()->LogicToPixel( - Size(0, nFontHeight), MapMode (MAP_POINT)).Height(), + Size(0, nFontHeight), MapMode (MapUnit::MapPoint)).Height(), 100, EE_CHAR_FONTHEIGHT); mpEditEngineItemPool->SetPoolDefaultItem( aFontHeight); @@ -454,7 +454,7 @@ Reference<rendering::XBitmap> const & PresenterTextView::Implementation::GetBitm mpOutputDevice.disposeAndClear(); mpOutputDevice = VclPtr<VirtualDevice>::Create(*Application::GetDefaultDevice(), DeviceFormat::DEFAULT, DeviceFormat::DEFAULT); - mpOutputDevice->SetMapMode(MAP_PIXEL); + mpOutputDevice->SetMapMode(MapUnit::MapPixel); mpOutputDevice->SetOutputSizePixel(maSize); mpOutputDevice->SetLineColor(); mpOutputDevice->SetFillColor(); diff --git a/sd/source/ui/sidebar/SlideBackground.cxx b/sd/source/ui/sidebar/SlideBackground.cxx index ab7c1fb68fc1..fcf4bf45e37a 100644 --- a/sd/source/ui/sidebar/SlideBackground.cxx +++ b/sd/source/ui/sidebar/SlideBackground.cxx @@ -718,7 +718,7 @@ void SlideBackground::NotifyItemUpdate( if(mpPaperOrientation->GetSelectEntryPos() == 0) Swap(aPaperSize); - Paper ePaper = SvxPaperInfo::GetSvxPaper(aPaperSize, static_cast<MapUnit>(meUnit),true); + Paper ePaper = SvxPaperInfo::GetSvxPaper(aPaperSize, meUnit, true); mpPaperSizeBox->SetSelection( ePaper ); } } diff --git a/sd/source/ui/slideshow/showwin.cxx b/sd/source/ui/slideshow/showwin.cxx index ba757dc4b0a8..11d2ae362039 100644 --- a/sd/source/ui/slideshow/showwin.cxx +++ b/sd/source/ui/slideshow/showwin.cxx @@ -59,7 +59,7 @@ ShowWindow::ShowWindow( const ::rtl::Reference< SlideshowImpl >& xController, vc EnableRTL (false); MapMode aMap(GetMapMode()); - aMap.SetMapUnit(MAP_100TH_MM); + aMap.SetMapUnit(MapUnit::Map100thMM); SetMapMode(aMap); // set HelpId @@ -462,8 +462,8 @@ void ShowWindow::DrawPauseScene( bool bTimeoutOnly ) const MapMode& rMap = GetMapMode(); const Point aOutOrg( PixelToLogic( Point() ) ); const Size aOutSize( GetOutputSize() ); - const Size aTextSize( LogicToLogic( Size( 0, 14 ), MAP_POINT, rMap ) ); - const Size aOffset( LogicToLogic( Size( 1000, 1000 ), MAP_100TH_MM, rMap ) ); + const Size aTextSize( LogicToLogic( Size( 0, 14 ), MapUnit::MapPoint, rMap ) ); + const Size aOffset( LogicToLogic( Size( 1000, 1000 ), MapUnit::Map100thMM, rMap ) ); OUString aText( SdResId( STR_PRES_PAUSE ) ); bool bDrawn = false; @@ -479,7 +479,7 @@ void ShowWindow::DrawPauseScene( bool bTimeoutOnly ) { Size aGrfSize; - if( maLogo.GetPrefMapMode() == MAP_PIXEL ) + if( maLogo.GetPrefMapMode() == MapUnit::MapPixel ) aGrfSize = PixelToLogic( maLogo.GetPrefSize() ); else aGrfSize = LogicToLogic( maLogo.GetPrefSize(), maLogo.GetPrefMapMode(), rMap ); @@ -536,7 +536,7 @@ void ShowWindow::DrawEndScene() vcl::Font aFont( GetSettings().GetStyleSettings().GetMenuFont() ); const Point aOutOrg( PixelToLogic( Point() ) ); - const Size aTextSize( LogicToLogic( Size( 0, 14 ), MAP_POINT, GetMapMode() ) ); + const Size aTextSize( LogicToLogic( Size( 0, 14 ), MapUnit::MapPoint, GetMapMode() ) ); const OUString aText( SdResId( STR_PRES_SOFTEND ) ); aFont.SetFontSize( aTextSize ); diff --git a/sd/source/ui/slidesorter/controller/SlideSorterController.cxx b/sd/source/ui/slidesorter/controller/SlideSorterController.cxx index b762a68cd172..0b36058aadb4 100644 --- a/sd/source/ui/slidesorter/controller/SlideSorterController.cxx +++ b/sd/source/ui/slidesorter/controller/SlideSorterController.cxx @@ -133,7 +133,7 @@ SlideSorterController::SlideSorterController (SlideSorter& rSlideSorter) // class. pWindow->SetBackground(Wallpaper()); pWindow->SetCenterAllowed(false); - pWindow->SetMapMode(MapMode(MAP_PIXEL)); + pWindow->SetMapMode(MapMode(MapUnit::MapPixel)); pWindow->SetViewSize(mrView.GetModelArea().GetSize()); } } diff --git a/sd/source/ui/slidesorter/view/SlsTheme.cxx b/sd/source/ui/slidesorter/view/SlsTheme.cxx index 45806df08f0e..86bf11a0b81d 100644 --- a/sd/source/ui/slidesorter/view/SlsTheme.cxx +++ b/sd/source/ui/slidesorter/view/SlsTheme.cxx @@ -156,7 +156,7 @@ std::shared_ptr<vcl::Font> Theme::GetFont ( if (pFont) { // Transform the point size to pixel size. - const MapMode aFontMapMode (MAP_POINT); + const MapMode aFontMapMode (MapUnit::MapPoint); const Size aFontSize (rDevice.LogicToPixel(pFont->GetFontSize(), aFontMapMode)); // Transform the font size to the logical coordinates of the device. diff --git a/sd/source/ui/tools/PreviewRenderer.cxx b/sd/source/ui/tools/PreviewRenderer.cxx index d4b8aca487cf..8a2cf3f8d3d7 100644 --- a/sd/source/ui/tools/PreviewRenderer.cxx +++ b/sd/source/ui/tools/PreviewRenderer.cxx @@ -160,7 +160,7 @@ Image PreviewRenderer::RenderSubstitution ( // Set a map mode that makes a typical substitution text completely // visible. MapMode aMapMode (mpPreviewDevice->GetMapMode()); - aMapMode.SetMapUnit(MAP_100TH_MM); + aMapMode.SetMapUnit(MapUnit::Map100thMM); Fraction aFinalScale(25 * rPreviewPixelSize.Width(), 28000); aMapMode.SetScaleX(aFinalScale); aMapMode.SetScaleY(aFinalScale); @@ -365,7 +365,7 @@ void PreviewRenderer::SetupOutputSize ( // First set the map mode to some arbitrary scale that is numerically // stable. MapMode aMapMode (mpPreviewDevice->GetMapMode()); - aMapMode.SetMapUnit(MAP_PIXEL); + aMapMode.SetMapUnit(MapUnit::MapPixel); // Adapt it to the desired width. const Size aPageModelSize (rPage.GetSize()); @@ -449,7 +449,7 @@ Image PreviewRenderer::ScaleBitmap ( (long)((nWidth*1.0 * aSize.Height()) / aSize.Width() + 0.5)); Size aPreviewSize (aFrameSize.Width()-2,aFrameSize.Height()-2); MapMode aMapMode (mpPreviewDevice->GetMapMode()); - aMapMode.SetMapUnit(MAP_PIXEL); + aMapMode.SetMapUnit(MapUnit::MapPixel); aMapMode.SetOrigin (Point()); aMapMode.SetScaleX (1.0); aMapMode.SetScaleY (1.0); diff --git a/sd/source/ui/unoidl/UnoDocumentSettings.cxx b/sd/source/ui/unoidl/UnoDocumentSettings.cxx index afd08350bc90..125684283896 100644 --- a/sd/source/ui/unoidl/UnoDocumentSettings.cxx +++ b/sd/source/ui/unoidl/UnoDocumentSettings.cxx @@ -766,7 +766,7 @@ throw (UnknownPropertyException, PropertyVetoException, pPrinter = SfxPrinter::Create ( aStream, pItemSet ); MapMode aMM (pPrinter->GetMapMode()); - aMM.SetMapUnit(MAP_100TH_MM); + aMM.SetMapUnit(MapUnit::Map100thMM); pPrinter->SetMapMode(aMM); pDocSh->SetPrinter( pPrinter ); diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx index 72d53f7375e5..f4037ce1dbb1 100644 --- a/sd/source/ui/unoidl/unomodel.cxx +++ b/sd/source/ui/unoidl/unomodel.cxx @@ -1925,7 +1925,7 @@ void SAL_CALL SdXImpressDocument::render( sal_Int32 nRenderer, const uno::Any& r pView->SetPageVisible( false ); pView->SetGlueVisible( false ); - pOut->SetMapMode( MAP_100TH_MM ); + pOut->SetMapMode( MapUnit::Map100thMM ); pOut->IntersectClipRegion( aVisArea ); uno::Reference< frame::XModel > xModel; @@ -2268,7 +2268,7 @@ void SdXImpressDocument::paintTile( VirtualDevice& rDevice, nTilePosY = convertTwipToMm100( nTilePosY ); MapMode aMapMode = rDevice.GetMapMode(); - aMapMode.SetMapUnit( MAP_100TH_MM ); + aMapMode.SetMapUnit( MapUnit::Map100thMM ); aMapMode.SetOrigin( Point( -nTilePosX, -nTilePosY) ); aMapMode.SetScaleX( scaleX ); diff --git a/sd/source/ui/unoidl/unopage.cxx b/sd/source/ui/unoidl/unopage.cxx index 206cc01f233b..3033a115369e 100644 --- a/sd/source/ui/unoidl/unopage.cxx +++ b/sd/source/ui/unoidl/unopage.cxx @@ -1135,7 +1135,7 @@ Any SAL_CALL SdGenericDrawPage::getPropertyValue( const OUString& PropertyName ) Size aSize( GetPage()->GetSize() ); xMetaFile->AddAction( static_cast<MetaAction*>(new MetaFillColorAction( COL_WHITE, true )), 0 ); xMetaFile->AddAction( static_cast<MetaAction*>(new MetaRectAction( Rectangle( aPoint, aSize ) )), 1 ); - xMetaFile->SetPrefMapMode( MAP_100TH_MM ); + xMetaFile->SetPrefMapMode( MapUnit::Map100thMM ); xMetaFile->SetPrefSize( aSize ); SvMemoryStream aDestStrm( 65535, 65535 ); diff --git a/sd/source/ui/view/DocumentRenderer.cxx b/sd/source/ui/view/DocumentRenderer.cxx index 5361f5abc725..359906e911f3 100644 --- a/sd/source/ui/view/DocumentRenderer.cxx +++ b/sd/source/ui/view/DocumentRenderer.cxx @@ -1432,7 +1432,7 @@ private: { MapMode aMap (aInfo.mpPrinter->GetMapMode()); - aMap.SetMapUnit(MAP_100TH_MM); + aMap.SetMapUnit(MapUnit::Map100thMM); aInfo.maMap = aMap; mpPrinter->SetMapMode(aMap); @@ -1623,7 +1623,7 @@ private: Rectangle aOutRect(aPageOfs, rInfo.mpPrinter->GetOutputSize()); if( aOutRect.GetWidth() > aOutRect.GetHeight() ) { - Size aPaperSize( rInfo.mpPrinter->PixelToLogic( rInfo.mpPrinter->GetPaperSizePixel(), MapMode( MAP_100TH_MM ) ) ); + Size aPaperSize( rInfo.mpPrinter->PixelToLogic( rInfo.mpPrinter->GetPaperSizePixel(), MapMode( MapUnit::Map100thMM ) ) ); maPrintSize.Width = aPaperSize.Height(); maPrintSize.Height = aPaperSize.Width(); const long nRotatedWidth = aOutRect.GetHeight(); diff --git a/sd/source/ui/view/ViewShellBase.cxx b/sd/source/ui/view/ViewShellBase.cxx index 97c6b502b949..8aee92b7e04d 100644 --- a/sd/source/ui/view/ViewShellBase.cxx +++ b/sd/source/ui/view/ViewShellBase.cxx @@ -478,7 +478,7 @@ void ViewShellBase::InnerResizePixel (const Point& rOrigin, const Size &rSize) Size aSize( rSize ); aSize.Width() -= (aBorder.Left() + aBorder.Right()); aSize.Height() -= (aBorder.Top() + aBorder.Bottom()); - Size aObjSizePixel = mpImpl->mpViewWindow->LogicToPixel( aObjSize, MAP_100TH_MM ); + Size aObjSizePixel = mpImpl->mpViewWindow->LogicToPixel( aObjSize, MapUnit::Map100thMM ); SfxViewShell::SetZoomFactor( Fraction( aSize.Width(), std::max( aObjSizePixel.Width(), (long int)1 ) ), Fraction( aSize.Height(), std::max( aObjSizePixel.Height(), (long int)1) ) ); @@ -550,7 +550,7 @@ sal_uInt16 ViewShellBase::SetPrinter ( nDiffFlags & SfxPrinterChangeFlags::CHG_SIZE) && pNewPrinter ) { MapMode aMap = pNewPrinter->GetMapMode(); - aMap.SetMapUnit(MAP_100TH_MM); + aMap.SetMapUnit(MapUnit::Map100thMM); MapMode aOldMap = pNewPrinter->GetMapMode(); pNewPrinter->SetMapMode(aMap); Size aNewSize = pNewPrinter->GetOutputSize(); @@ -1064,8 +1064,8 @@ void ViewShellBase::NotifyCursor(SfxViewShell* pOtherShell) const { Rectangle aRectangle = pOutlinerView->GetOutputArea(); vcl::Window* pWin = pThisShell->GetActiveWindow(); - if (pWin && pWin->GetMapMode().GetMapUnit() == MAP_100TH_MM) - aRectangle = OutputDevice::LogicToLogic(aRectangle, MAP_100TH_MM, MAP_TWIP); + if (pWin && pWin->GetMapMode().GetMapUnit() == MapUnit::Map100thMM) + aRectangle = OutputDevice::LogicToLogic(aRectangle, MapUnit::Map100thMM, MapUnit::MapTwip); OString sRectangle = aRectangle.toString(); SfxLokHelper::notifyOtherView(&pDrawViewShell->GetViewShellBase(), pOtherShell, LOK_CALLBACK_VIEW_LOCK, "rectangle", sRectangle); } diff --git a/sd/source/ui/view/drviews8.cxx b/sd/source/ui/view/drviews8.cxx index 4ef3dce4e7f1..f1c07f6102ed 100644 --- a/sd/source/ui/view/drviews8.cxx +++ b/sd/source/ui/view/drviews8.cxx @@ -65,12 +65,12 @@ void DrawViewShell::ScannerEvent( const css::lang::EventObject& ) const SolarMutexGuard aGuard; SdrPage* pPage = mpDrawView->GetSdrPageView()->GetPage(); Size aBmpSize( aScanBmp.GetPrefSize() ), aPageSize( pPage->GetSize() ); - const MapMode aMap100( MAP_100TH_MM ); + const MapMode aMap100( MapUnit::Map100thMM ); if( !aBmpSize.Width() || !aBmpSize.Height() ) aBmpSize = aScanBmp.GetSizePixel(); - if( aScanBmp.GetPrefMapMode().GetMapUnit() == MAP_PIXEL ) + if( aScanBmp.GetPrefMapMode().GetMapUnit() == MapUnit::MapPixel ) aBmpSize = GetActiveWindow()->PixelToLogic( aBmpSize, aMap100 ); else aBmpSize = OutputDevice::LogicToLogic( aBmpSize, aScanBmp.GetPrefMapMode(), aMap100 ); diff --git a/sd/source/ui/view/drviews9.cxx b/sd/source/ui/view/drviews9.cxx index 6b3b0606b5ca..25899a943c03 100644 --- a/sd/source/ui/view/drviews9.cxx +++ b/sd/source/ui/view/drviews9.cxx @@ -91,7 +91,7 @@ void DrawViewShell::ExecGallery(SfxRequest& rReq) ScopedVclPtrInstance< Window > aWindow(GetActiveWindow()); aWindow->SetMapMode(aGraphic.GetPrefMapMode()); Size aSizePix = aWindow->LogicToPixel(aGraphic.GetPrefSize()); - aWindow->SetMapMode( MapMode(MAP_100TH_MM) ); + aWindow->SetMapMode( MapMode(MapUnit::Map100thMM) ); Size aSize = aWindow->PixelToLogic(aSizePix); // constrain size to page size if necessary diff --git a/sd/source/ui/view/sdview.cxx b/sd/source/ui/view/sdview.cxx index 061b28aecb2e..b98f8009db0d 100644 --- a/sd/source/ui/view/sdview.cxx +++ b/sd/source/ui/view/sdview.cxx @@ -719,8 +719,8 @@ bool View::SdrBeginTextEdit( if (OutlinerView* pView = GetTextEditOutlinerView()) { Rectangle aRectangle = pView->GetOutputArea(); - if (pWin && pWin->GetMapMode().GetMapUnit() == MAP_100TH_MM) - aRectangle = OutputDevice::LogicToLogic(aRectangle, MAP_100TH_MM, MAP_TWIP); + if (pWin && pWin->GetMapMode().GetMapUnit() == MapUnit::Map100thMM) + aRectangle = OutputDevice::LogicToLogic(aRectangle, MapUnit::Map100thMM, MapUnit::MapTwip); OString sRectangle = aRectangle.toString(); SfxLokHelper::notifyOtherViews(&mpViewSh->GetViewShellBase(), LOK_CALLBACK_VIEW_LOCK, "rectangle", sRectangle); } @@ -886,7 +886,7 @@ void View::SetMarkedOriginalSize() if ( nAspect == embed::Aspects::MSOLE_ICON ) { - MapMode aMap100( MAP_100TH_MM ); + MapMode aMap100( MapUnit::Map100thMM ); aOleSize = static_cast<SdrOle2Obj*>(pObj)->GetOrigObjSize( &aMap100 ); bOK = true; } @@ -896,7 +896,7 @@ void View::SetMarkedOriginalSize() try { awt::Size aSz = xObj->getVisualAreaSize( nAspect ); - aOleSize = OutputDevice::LogicToLogic( Size( aSz.Width, aSz.Height ), aUnit, MAP_100TH_MM ); + aOleSize = OutputDevice::LogicToLogic( Size( aSz.Width, aSz.Height ), aUnit, MapUnit::Map100thMM ); bOK = true; } catch( embed::NoVisualAreaSizeException& ) diff --git a/sd/source/ui/view/sdview3.cxx b/sd/source/ui/view/sdview3.cxx index ec2764825c76..452a7e4bc5da 100644 --- a/sd/source/ui/view/sdview3.cxx +++ b/sd/source/ui/view/sdview3.cxx @@ -948,7 +948,7 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper, aSize = aObjDesc.maSize; else { - MapMode aMapMode( MAP_100TH_MM ); + MapMode aMapMode( MapUnit::Map100thMM ); aSize = aObjRef.GetSize( &aMapMode ); } } @@ -958,7 +958,7 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper, MapUnit aMapUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( xObj->getMapUnit( aObjDesc.mnViewAspect ) ); if( aObjDesc.maSize.Width() && aObjDesc.maSize.Height() ) { - Size aTmp( OutputDevice::LogicToLogic( aObjDesc.maSize, MAP_100TH_MM, aMapUnit ) ); + Size aTmp( OutputDevice::LogicToLogic( aObjDesc.maSize, MapUnit::Map100thMM, aMapUnit ) ); aSz.Width = aTmp.Width(); aSz.Height = aTmp.Height(); xObj->setVisualAreaSize( aObjDesc.mnViewAspect, aSz ); @@ -979,13 +979,13 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper, { aSize.Width() = 14100; aSize.Height() = 10000; - aSize = OutputDevice::LogicToLogic( Size(14100, 10000), MAP_100TH_MM, aMapUnit ); + aSize = OutputDevice::LogicToLogic( Size(14100, 10000), MapUnit::Map100thMM, aMapUnit ); aSz.Width = aSize.Width(); aSz.Height = aSize.Height(); xObj->setVisualAreaSize( aObjDesc.mnViewAspect, aSz ); } - aSize = OutputDevice::LogicToLogic( aSize, aMapUnit, MAP_100TH_MM ); + aSize = OutputDevice::LogicToLogic( aSize, aMapUnit, MapUnit::Map100thMM ); } Size aMaxSize( mrDoc.GetMaxObjSize() ); @@ -1117,7 +1117,7 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper, aSize = aObjDesc.maSize; else { - MapMode aMapMode( MAP_100TH_MM ); + MapMode aMapMode( MapUnit::Map100thMM ); aSize = aObjRef.GetSize( &aMapMode ); } } @@ -1136,7 +1136,7 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper, if( aObjDesc.maSize.Width() && aObjDesc.maSize.Height() ) { - Size aTmp( OutputDevice::LogicToLogic( aObjDesc.maSize, MAP_100TH_MM, aMapUnit ) ); + Size aTmp( OutputDevice::LogicToLogic( aObjDesc.maSize, MapUnit::Map100thMM, aMapUnit ) ); if ( aSz.Width != aTmp.Width() || aSz.Height != aTmp.Height() ) { aSz.Width = aTmp.Width(); @@ -1149,13 +1149,13 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper, if( !aSize.Width() || !aSize.Height() ) { - aSize = OutputDevice::LogicToLogic( Size(14100, 10000), MAP_100TH_MM, aMapUnit ); + aSize = OutputDevice::LogicToLogic( Size(14100, 10000), MapUnit::Map100thMM, aMapUnit ); aSz.Width = aSize.Width(); aSz.Height = aSize.Height(); xObj->setVisualAreaSize( aObjDesc.mnViewAspect, aSz ); } - aSize = OutputDevice::LogicToLogic( aSize, aMapUnit, MAP_100TH_MM ); + aSize = OutputDevice::LogicToLogic( aSize, aMapUnit, MapUnit::Map100thMM ); } Size aMaxSize( mrDoc.GetMaxObjSize() ); @@ -1226,7 +1226,7 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper, // restrict movement to WorkArea Size aImageMapSize = OutputDevice::LogicToLogic(aGraphic.GetPrefSize(), - aGraphic.GetPrefMapMode(), MapMode(MAP_100TH_MM)); + aGraphic.GetPrefMapMode(), MapMode(MapUnit::Map100thMM)); ImpCheckInsertPos(aInsertPos, aImageMapSize, GetWorkArea()); @@ -1523,7 +1523,7 @@ bool View::PasteRTFTable( const ::tools::SvRef<SotStorageStream>& xStm, SdrPage* { std::unique_ptr<SdDrawDocument> pModel(new SdDrawDocument( DOCUMENT_TYPE_IMPRESS, mpDocSh )); pModel->NewOrLoadCompleted(NEW_DOC); - pModel->GetItemPool().SetDefaultMetric(MAP_100TH_MM); + pModel->GetItemPool().SetDefaultMetric(MapUnit::Map100thMM); pModel->InsertPage(pModel->AllocPage(false)); Reference< XComponent > xComponent( new SdXImpressDocument( pModel.get(), true ) ); diff --git a/sd/source/ui/view/sdview4.cxx b/sd/source/ui/view/sdview4.cxx index 6ad4b1d7901c..756f2fff2963 100644 --- a/sd/source/ui/view/sdview4.cxx +++ b/sd/source/ui/view/sdview4.cxx @@ -173,7 +173,7 @@ SdrGrafObj* View::InsertGraphic( const Graphic& rGraphic, sal_Int8& rAction, // create new object Size aSize; - if ( rGraphic.GetPrefMapMode().GetMapUnit() == MAP_PIXEL ) + if ( rGraphic.GetPrefMapMode().GetMapUnit() == MapUnit::MapPixel ) { ::OutputDevice* pOutDev = nullptr; if( mpViewSh ) @@ -183,13 +183,13 @@ SdrGrafObj* View::InsertGraphic( const Graphic& rGraphic, sal_Int8& rAction, pOutDev = Application::GetDefaultDevice(); if( pOutDev ) - aSize = pOutDev->PixelToLogic( rGraphic.GetPrefSize(), MAP_100TH_MM ); + aSize = pOutDev->PixelToLogic( rGraphic.GetPrefSize(), MapUnit::Map100thMM ); } else { aSize = OutputDevice::LogicToLogic( rGraphic.GetPrefSize(), rGraphic.GetPrefMapMode(), - MapMode( MAP_100TH_MM ) ); + MapMode( MapUnit::Map100thMM ) ); } pNewGrafObj = new SdrGrafObj( rGraphic, Rectangle( rPos, aSize ) ); @@ -489,9 +489,9 @@ IMPL_LINK_NOARG(View, DropInsertFileHdl, Idle *, void) ::sd::Window* pWin = mpViewSh->GetActiveWindow(); if( pWin ) - aPrefSize = pWin->PixelToLogic( aPrefSize, MAP_100TH_MM ); + aPrefSize = pWin->PixelToLogic( aPrefSize, MapUnit::Map100thMM ); else - aPrefSize = Application::GetDefaultDevice()->PixelToLogic( aPrefSize, MAP_100TH_MM ); + aPrefSize = Application::GetDefaultDevice()->PixelToLogic( aPrefSize, MapUnit::Map100thMM ); } else aPrefSize = Size( 5000, 5000 ); diff --git a/sd/source/ui/view/sdwindow.cxx b/sd/source/ui/view/sdwindow.cxx index 728d40a89a55..abcaaeecea6c 100644 --- a/sd/source/ui/view/sdwindow.cxx +++ b/sd/source/ui/view/sdwindow.cxx @@ -74,7 +74,7 @@ Window::Window(vcl::Window* pParent) SetDialogControlFlags( DialogControlFlags::Return | DialogControlFlags::WantFocus ); MapMode aMap(GetMapMode()); - aMap.SetMapUnit(MAP_100TH_MM); + aMap.SetMapUnit(MapUnit::Map100thMM); SetMapMode(aMap); // whit it, the vcl::WindowColor is used in the slide mode @@ -1004,8 +1004,8 @@ void Window::LogicInvalidate(const Rectangle* pRectangle) else { Rectangle aRectangle(*pRectangle); - 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); sRectangle = aRectangle.toString(); } SfxViewShell& rSfxViewShell = mpViewShell->GetViewShellBase(); |