diff options
Diffstat (limited to 'svx')
94 files changed, 369 insertions, 369 deletions
diff --git a/svx/source/customshapes/EnhancedCustomShape3d.cxx b/svx/source/customshapes/EnhancedCustomShape3d.cxx index 94e8eff10db8..a52bfffe4097 100644 --- a/svx/source/customshapes/EnhancedCustomShape3d.cxx +++ b/svx/source/customshapes/EnhancedCustomShape3d.cxx @@ -269,9 +269,9 @@ SdrObject* EnhancedCustomShape3d::Create3DObject( const SdrObject* pShape2d, con fMap /= aFraction.GetDenominator(); pMap = &fMap; } - if ( pModel->GetScaleUnit() != MAP_100TH_MM ) + if ( pModel->GetScaleUnit() != MapUnit::Map100thMM ) { - DBG_ASSERT( pModel->GetScaleUnit() == MAP_TWIP, "EnhancedCustomShape3d::Current MapMode is Unsupported" ); + DBG_ASSERT( pModel->GetScaleUnit() == MapUnit::MapTwip, "EnhancedCustomShape3d::Current MapMode is Unsupported" ); fMap *= 1440.0 / 2540.0; pMap = &fMap; } @@ -500,14 +500,14 @@ SdrObject* EnhancedCustomShape3d::Create3DObject( const SdrObject* pShape2d, con // from regular 3D objects for some time, also needs to be removed from CustomShapes //Size aLogicalSize = aFillBmp.GetPrefSize(); - //if ( aFillBmp.GetPrefMapMode() == MAP_PIXEL ) - // aLogicalSize = Application::GetDefaultDevice()->PixelToLogic( aLogicalSize, MAP_100TH_MM ); + //if ( aFillBmp.GetPrefMapMode() == MapUnit::MapPixel ) + // aLogicalSize = Application::GetDefaultDevice()->PixelToLogic( aLogicalSize, MapUnit::Map100thMM ); //else - // aLogicalSize = OutputDevice::LogicToLogic( aLogicalSize, aFillBmp.GetPrefMapMode(), MAP_100TH_MM ); + // aLogicalSize = OutputDevice::LogicToLogic( aLogicalSize, aFillBmp.GetPrefMapMode(), MapUnit::Map100thMM ); //aLogicalSize.Width() *= 5; ;// :-( nice scaling, look at engine3d/obj3d.cxx //aLogicalSize.Height() *= 5; //aFillBmp.SetPrefSize( aLogicalSize ); - //aFillBmp.SetPrefMapMode( MAP_100TH_MM ); + //aFillBmp.SetPrefMapMode( MapUnit::Map100thMM ); //p3DObj->SetMergedItem(XFillBitmapItem(String(), Graphic(aFillBmp))); } else diff --git a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx index def4e5bae4f8..a999791a5c5a 100644 --- a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx +++ b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx @@ -167,7 +167,7 @@ void CalculateHorizontalScalingFactor( const SdrObject* pCustomShape, // initializing virtual device ScopedVclPtrInstance< VirtualDevice > pVirDev(DeviceFormat::BITMASK); - pVirDev->SetMapMode( MAP_100TH_MM ); + pVirDev->SetMapMode( MapUnit::Map100thMM ); pVirDev->SetFont( aFont ); if ( nOutlinesCount2d & 1 ) @@ -261,7 +261,7 @@ void GetTextAreaOutline( const FWData& rFWData, const SdrObject* pCustomShape, F // initializing virtual device ScopedVclPtrInstance< VirtualDevice > pVirDev(DeviceFormat::BITMASK); - pVirDev->SetMapMode( MAP_100TH_MM ); + pVirDev->SetMapMode( MapUnit::Map100thMM ); pVirDev->SetFont( aFont ); pVirDev->EnableRTL(); if ( aParagraphIter->nFrameDirection == FRMDIR_HORI_RIGHT_TOP ) diff --git a/svx/source/dialog/_bmpmask.cxx b/svx/source/dialog/_bmpmask.cxx index d8d0ebc3f281..77ca04fc3a01 100644 --- a/svx/source/dialog/_bmpmask.cxx +++ b/svx/source/dialog/_bmpmask.cxx @@ -76,7 +76,7 @@ public: virtual Size GetOptimalSize() const override { - return LogicToPixel(Size(43, 14), MAP_APPFONT); + return LogicToPixel(Size(43, 14), MapUnit::MapAppFont); } }; @@ -93,7 +93,7 @@ public: virtual void GetFocus() override; virtual Size GetOptimalSize() const override { - return LogicToPixel(Size(24, 12), MAP_APPFONT); + return LogicToPixel(Size(24, 12), MapUnit::MapAppFont); } void onEditColor(); diff --git a/svx/source/dialog/_contdlg.cxx b/svx/source/dialog/_contdlg.cxx index faedbde8feb0..2f316de609d3 100644 --- a/svx/source/dialog/_contdlg.cxx +++ b/svx/source/dialog/_contdlg.cxx @@ -273,7 +273,7 @@ SvxSuperContourDlg::SvxSuperContourDlg(SfxBindings *_pBindings, SfxChildWindow * m_pTbx1->SetSizePixel( aTbxSize ); m_pTbx1->SetSelectHdl( LINK( this, SvxSuperContourDlg, Tbx1ClickHdl ) ); - aPos.X() += aTbxSize.Width() + LogicToPixel( Size( 3, 0 ), MapMode( MAP_APPFONT ) ).Width(); + aPos.X() += aTbxSize.Width() + LogicToPixel( Size( 3, 0 ), MapMode( MapUnit::MapAppFont ) ).Width(); m_pMtfTolerance->SetPosPixel( aPos ); m_pMtfTolerance->SetValue( 10L ); @@ -355,10 +355,10 @@ void SvxSuperContourDlg::SetPolyPolygon( const tools::PolyPolygon& rPolyPoly ) DBG_ASSERT( m_pContourWnd->GetGraphic().GetType() != GraphicType::NONE, "Graphic must've been set first!" ); tools::PolyPolygon aPolyPoly( rPolyPoly ); - const MapMode aMap100( MAP_100TH_MM ); + const MapMode aMap100( MapUnit::Map100thMM ); const MapMode aGrfMap( aGraphic.GetPrefMapMode() ); OutputDevice* pOutDev = Application::GetDefaultDevice(); - bool bPixelMap = aGrfMap.GetMapUnit() == MAP_PIXEL; + bool bPixelMap = aGrfMap.GetMapUnit() == MapUnit::MapPixel; for ( sal_uInt16 j = 0, nPolyCount = aPolyPoly.Count(); j < nPolyCount; j++ ) { @@ -383,10 +383,10 @@ tools::PolyPolygon SvxSuperContourDlg::GetPolyPolygon() { tools::PolyPolygon aRetPolyPoly( m_pContourWnd->GetPolyPolygon() ); - const MapMode aMap100( MAP_100TH_MM ); + const MapMode aMap100( MapUnit::Map100thMM ); const MapMode aGrfMap( aGraphic.GetPrefMapMode() ); OutputDevice* pOutDev = Application::GetDefaultDevice(); - bool bPixelMap = aGrfMap.GetMapUnit() == MAP_PIXEL; + bool bPixelMap = aGrfMap.GetMapUnit() == MapUnit::MapPixel; for ( sal_uInt16 j = 0, nPolyCount = aRetPolyPoly.Count(); j < nPolyCount; j++ ) { @@ -598,7 +598,7 @@ IMPL_LINK_NOARG(SvxSuperContourDlg, CreateHdl, Idle *, void) { aCreateIdle.Stop(); - const Rectangle aWorkRect = m_pContourWnd->LogicToPixel( m_pContourWnd->GetWorkRect(), MapMode( MAP_100TH_MM ) ); + const Rectangle aWorkRect = m_pContourWnd->LogicToPixel( m_pContourWnd->GetWorkRect(), MapMode( MapUnit::Map100thMM ) ); const Graphic& rGraphic = m_pContourWnd->GetGraphic(); const bool bValid = aWorkRect.Left() != aWorkRect.Right() && aWorkRect.Top() != aWorkRect.Bottom(); diff --git a/svx/source/dialog/compressgraphicdialog.cxx b/svx/source/dialog/compressgraphicdialog.cxx index 059cb552a06b..17a577c91bff 100644 --- a/svx/source/dialog/compressgraphicdialog.cxx +++ b/svx/source/dialog/compressgraphicdialog.cxx @@ -189,7 +189,7 @@ void CompressGraphicsDialog::Update() pDummyVDev->SetMapMode( m_aGraphic.GetPrefMapMode() ); Size aPixelSize = m_aGraphic.GetSizePixel(); - Size aOriginalSize100mm( pDummyVDev->PixelToLogic( m_aGraphic.GetSizePixel(), MAP_100TH_MM ) ); + Size aOriginalSize100mm( pDummyVDev->PixelToLogic( m_aGraphic.GetSizePixel(), MapUnit::Map100thMM ) ); OUString aBitmapSizeString = SVX_RESSTR(STR_IMAGE_ORIGINAL_SIZE); OUString aWidthString = GetUnitString( aOriginalSize100mm.Width(), eFieldUnit, cSeparator ); @@ -243,12 +243,12 @@ void CompressGraphicsDialog::UpdateResolutionLB() double CompressGraphicsDialog::GetViewWidthInch() { - return (double) MetricField::ConvertValue(m_aViewSize100mm.Width(), 2, MAP_100TH_MM, FUNIT_INCH) / 100.0; + return (double) MetricField::ConvertValue(m_aViewSize100mm.Width(), 2, MapUnit::Map100thMM, FUNIT_INCH) / 100.0; } double CompressGraphicsDialog::GetViewHeightInch() { - return (double) MetricField::ConvertValue(m_aViewSize100mm.Height(), 2, MAP_100TH_MM, FUNIT_INCH) / 100.0; + return (double) MetricField::ConvertValue(m_aViewSize100mm.Height(), 2, MapUnit::Map100thMM, FUNIT_INCH) / 100.0; } BmpScaleFlag CompressGraphicsDialog::GetSelectedInterpolationType() diff --git a/svx/source/dialog/connctrl.cxx b/svx/source/dialog/connctrl.cxx index 6360cfd934da..807f361489b2 100644 --- a/svx/source/dialog/connctrl.cxx +++ b/svx/source/dialog/connctrl.cxx @@ -42,7 +42,7 @@ SvxXConnectionPreview::SvxXConnectionPreview( vcl::Window* pParent, WinBits nSty , pObjList(nullptr) , pView(nullptr) { - SetMapMode( MAP_100TH_MM ); + SetMapMode( MapUnit::Map100thMM ); SetStyles(); } @@ -77,7 +77,7 @@ void SvxXConnectionPreview::Resize() Size SvxXConnectionPreview::GetOptimalSize() const { - return LogicToPixel(Size(118 , 121), MapMode(MAP_APPFONT)); + return LogicToPixel(Size(118 , 121), MapMode(MapUnit::MapAppFont)); } void SvxXConnectionPreview::AdaptSize() @@ -85,7 +85,7 @@ void SvxXConnectionPreview::AdaptSize() // Adapt size if( pObjList ) { - SetMapMode( MAP_100TH_MM ); + SetMapMode( MapUnit::Map100thMM ); OutputDevice* pOD = pView->GetFirstOutputDevice(); // GetWin( 0 ); Rectangle aRect = pObjList->GetAllObjBoundRect(); diff --git a/svx/source/dialog/contwnd.cxx b/svx/source/dialog/contwnd.cxx index e0faf2d196e0..c258847ec408 100644 --- a/svx/source/dialog/contwnd.cxx +++ b/svx/source/dialog/contwnd.cxx @@ -252,7 +252,7 @@ void ContourWindow::Paint(vcl::RenderContext& rRenderContext, const Rectangle& r Size ContourWindow::GetOptimalSize() const { - return LogicToPixel(Size(270, 170), MAP_APPFONT); + return LogicToPixel(Size(270, 170), MapUnit::MapAppFont); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/dialog/ctredlin.cxx b/svx/source/dialog/ctredlin.cxx index 005284fc65c4..7d85606ca724 100644 --- a/svx/source/dialog/ctredlin.cxx +++ b/svx/source/dialog/ctredlin.cxx @@ -379,7 +379,7 @@ SvxTPView::SvxTPView(vcl::Window *pParent, VclBuilderContainer *pTopLevel) SvSimpleTableContainer* pTable = get<SvSimpleTableContainer>("changes"); Size aControlSize(80, 65); - aControlSize = LogicToPixel(aControlSize, MAP_APPFONT); + aControlSize = LogicToPixel(aControlSize, MapUnit::MapAppFont); pTable->set_width_request(aControlSize.Width()); pTable->set_height_request(aControlSize.Height()); m_pViewData = VclPtr<SvxRedlinTable>::Create(*pTable, 0); diff --git a/svx/source/dialog/dialcontrol.cxx b/svx/source/dialog/dialcontrol.cxx index 50b9f089966b..4f7a240e146b 100644 --- a/svx/source/dialog/dialcontrol.cxx +++ b/svx/source/dialog/dialcontrol.cxx @@ -378,7 +378,7 @@ sal_Int32 DialControl::GetRotation() const Size DialControl::GetOptimalSize() const { - return LogicToPixel(Size(42 , 43), MAP_APPFONT); + return LogicToPixel(Size(42 , 43), MapUnit::MapAppFont); } void DialControl::SetRotation( sal_Int32 nAngle ) diff --git a/svx/source/dialog/dlgctl3d.cxx b/svx/source/dialog/dlgctl3d.cxx index 67bbd780c1db..84b5a5029c7e 100644 --- a/svx/source/dialog/dlgctl3d.cxx +++ b/svx/source/dialog/dlgctl3d.cxx @@ -59,7 +59,7 @@ Svx3DPreviewControl::Svx3DPreviewControl(vcl::Window* pParent, WinBits nStyle) Size Svx3DPreviewControl::GetOptimalSize() const { - return LogicToPixel(Size(80, 100), MAP_APPFONT); + return LogicToPixel(Size(80, 100), MapUnit::MapAppFont); } VCL_BUILDER_FACTORY(Svx3DPreviewControl) @@ -81,7 +81,7 @@ void Svx3DPreviewControl::Construct() // Do never mirror the preview window. This explicitly includes right // to left writing environments. EnableRTL (false); - SetMapMode( MAP_100TH_MM ); + SetMapMode( MapUnit::Map100thMM ); // Model mpModel = new FmFormModel(); @@ -952,7 +952,7 @@ SvxLightCtl3D::SvxLightCtl3D( vcl::Window* pParent) Size SvxLightCtl3D::GetOptimalSize() const { - return LogicToPixel(Size(80, 100), MAP_APPFONT); + return LogicToPixel(Size(80, 100), MapUnit::MapAppFont); } VCL_BUILDER_FACTORY(SvxLightCtl3D) diff --git a/svx/source/dialog/dlgctrl.cxx b/svx/source/dialog/dlgctrl.cxx index a9c8b598f815..570ae38136ca 100644 --- a/svx/source/dialog/dlgctrl.cxx +++ b/svx/source/dialog/dlgctrl.cxx @@ -80,7 +80,7 @@ SvxRectCtl::SvxRectCtl(vcl::Window* pParent, RectPoint eRpt, , mbUpdateForeground(true) , mbUpdateBackground(true) { - SetMapMode(MAP_100TH_MM); + SetMapMode(MapUnit::Map100thMM); Resize_Impl(); } @@ -95,7 +95,7 @@ void SvxRectCtl::SetControlSettings(RectPoint eRpt, sal_uInt16 nBorder, sal_uInt Size SvxRectCtl::GetOptimalSize() const { - return LogicToPixel(Size(78, 39), MAP_APPFONT); + return LogicToPixel(Size(78, 39), MapUnit::MapAppFont); } VCL_BUILDER_FACTORY(SvxRectCtl) @@ -824,7 +824,7 @@ void SvxPixelCtl::Resize() Size SvxPixelCtl::GetOptimalSize() const { - return LogicToPixel(Size(72, 72), MAP_APPFONT); + return LogicToPixel(Size(72, 72), MapUnit::MapAppFont); } VCL_BUILDER_FACTORY_ARGS(SvxPixelCtl, 8) @@ -1705,7 +1705,7 @@ SvxPreviewBase::SvxPreviewBase(vcl::Window* pParent) // Draw the control's border as a flat thin black line. SetBorderStyle(WindowBorderStyle::MONO); SetDrawMode( GetSettings().GetStyleSettings().GetHighContrastMode() ? OUTPUT_DRAWMODE_CONTRAST : OUTPUT_DRAWMODE_COLOR ); - SetMapMode(MAP_100TH_MM); + SetMapMode(MapUnit::Map100thMM); // init model mpModel->GetItemPool().FreezeIdRanges(); diff --git a/svx/source/dialog/dlgunit.hxx b/svx/source/dialog/dlgunit.hxx index 5b380620a878..2af023651d32 100644 --- a/svx/source/dialog/dlgunit.hxx +++ b/svx/source/dialog/dlgunit.hxx @@ -25,7 +25,7 @@ inline OUString GetUnitString( long nVal_100, FieldUnit eFieldUnit, sal_Unicode cSep ) { OUStringBuffer aVal = OUString::number( - MetricField::ConvertValue(nVal_100, 2, MAP_100TH_MM, eFieldUnit)); + MetricField::ConvertValue(nVal_100, 2, MapUnit::Map100thMM, eFieldUnit)); while( aVal.getLength() < 3 ) aVal.insert( 0, "0" ); diff --git a/svx/source/dialog/docrecovery.cxx b/svx/source/dialog/docrecovery.cxx index 2f968ccfeb56..051b23356c97 100644 --- a/svx/source/dialog/docrecovery.cxx +++ b/svx/source/dialog/docrecovery.cxx @@ -865,7 +865,7 @@ RecoveryDialog::RecoveryDialog(vcl::Window* pParent, RecoveryCore* pCore) get(m_pCancelBtn, "cancel"); SvSimpleTableContainer* pFileListLBContainer = get<SvSimpleTableContainer>("filelist"); - Size aSize(LogicToPixel(Size(RECOV_CONTROLWIDTH, RECOV_FILELISTHEIGHT), MAP_APPFONT)); + Size aSize(LogicToPixel(Size(RECOV_CONTROLWIDTH, RECOV_FILELISTHEIGHT), MapUnit::MapAppFont)); pFileListLBContainer->set_height_request(aSize.Height()); m_pFileListLB = VclPtr<RecovDocList>::Create(*pFileListLBContainer, DIALOG_MGR()); diff --git a/svx/source/dialog/fntctrl.cxx b/svx/source/dialog/fntctrl.cxx index 367b3be927a4..81d36d4f063b 100644 --- a/svx/source/dialog/fntctrl.cxx +++ b/svx/source/dialog/fntctrl.cxx @@ -493,7 +493,7 @@ void SvxFontPrevWindow::Init() pImpl->mpPrinter = VclPtr<Printer>::Create(); pImpl->mbDelPrinter = true; } - SetMapMode(MapMode(MAP_TWIP)); + SetMapMode(MapMode(MapUnit::MapTwip)); initFont(pImpl->maFont); initFont(pImpl->maCJKFont); initFont(pImpl->maCTLFont); @@ -906,7 +906,7 @@ void SvxFontPrevWindow::SetFontSize( const SfxItemSet& rSet, sal_uInt16 nSlot, S { nH = LogicToLogic(static_cast<const SvxFontHeightItem&>(rSet.Get(nWhich)).GetHeight(), (MapUnit) rSet.GetPool()->GetMetric(nWhich), - MAP_TWIP); + MapUnit::MapTwip); } else nH = 240;// as default 12pt @@ -1122,7 +1122,7 @@ void SvxFontPrevWindow::SetFromItemSet(const SfxItemSet &rSet, bool bPreviewBack { const SvxKerningItem& rItem = static_cast<const SvxKerningItem&>( rSet.Get( nWhich ) ); short nKern = ( short ) - LogicToLogic( rItem.GetValue(), ( MapUnit ) rSet.GetPool()->GetMetric( nWhich ), MAP_TWIP ); + LogicToLogic( rItem.GetValue(), ( MapUnit ) rSet.GetPool()->GetMetric( nWhich ), MapUnit::MapTwip ); rFont.SetFixKerning( nKern ); rCJKFont.SetFixKerning( nKern ); rCTLFont.SetFixKerning( nKern ); @@ -1366,7 +1366,7 @@ void SvxFontPrevWindow::Init(const SfxItemSet& rSet) { const SvxKerningItem& rItem = static_cast<const SvxKerningItem&>( rSet.Get( nWhich ) ); short nKern = ( short ) - LogicToLogic( rItem.GetValue(), ( MapUnit ) rSet.GetPool()->GetMetric( nWhich ), MAP_TWIP ); + LogicToLogic( rItem.GetValue(), ( MapUnit ) rSet.GetPool()->GetMetric( nWhich ), MapUnit::MapTwip ); rFont.SetFixKerning( nKern ); rCJKFont.SetFixKerning( nKern ); rCTLFont.SetFixKerning( nKern ); diff --git a/svx/source/dialog/fontwork.cxx b/svx/source/dialog/fontwork.cxx index 123b4e6c0db6..166277cc42b4 100644 --- a/svx/source/dialog/fontwork.cxx +++ b/svx/source/dialog/fontwork.cxx @@ -421,7 +421,7 @@ void SvxFontWorkDialog::SetDistance_Impl(const XFormTextDistanceItem* pItem) // Use HasChildPathFocus() instead of HasFocus() at SpinFields if ( pItem && !m_pMtrFldDistance->HasChildPathFocus() ) { - SetMetricValue(*m_pMtrFldDistance, pItem->GetValue(), MAP_100TH_MM); + SetMetricValue(*m_pMtrFldDistance, pItem->GetValue(), MapUnit::Map100thMM); } } @@ -432,7 +432,7 @@ void SvxFontWorkDialog::SetStart_Impl(const XFormTextStartItem* pItem) // Use HasChildPathFocus() instead of HasFocus() at SpinFields if ( pItem && !m_pMtrFldTextStart->HasChildPathFocus() ) { - SetMetricValue(*m_pMtrFldTextStart, pItem->GetValue(), MAP_100TH_MM); + SetMetricValue(*m_pMtrFldTextStart, pItem->GetValue(), MapUnit::Map100thMM); } } @@ -513,8 +513,8 @@ void SvxFontWorkDialog::SetShadow_Impl(const XFormTextShadowItem* pItem, if ( bRestoreValues ) { - SetMetricValue(*m_pMtrFldShadowX, nSaveShadowX, MAP_100TH_MM); - SetMetricValue(*m_pMtrFldShadowY, nSaveShadowY, MAP_100TH_MM); + SetMetricValue(*m_pMtrFldShadowX, nSaveShadowX, MapUnit::Map100thMM); + SetMetricValue(*m_pMtrFldShadowY, nSaveShadowY, MapUnit::Map100thMM); XFormTextShadowXValItem aXItem( nSaveShadowX ); XFormTextShadowYValItem aYItem( nSaveShadowY ); @@ -604,7 +604,7 @@ void SvxFontWorkDialog::SetShadowXVal_Impl(const XFormTextShadowXValItem* pItem) } else { - SetMetricValue(*m_pMtrFldShadowX, pItem->GetValue(), MAP_100TH_MM); + SetMetricValue(*m_pMtrFldShadowX, pItem->GetValue(), MapUnit::Map100thMM); } } } @@ -626,7 +626,7 @@ void SvxFontWorkDialog::SetShadowYVal_Impl(const XFormTextShadowYValItem* pItem) } else { - SetMetricValue(*m_pMtrFldShadowY, pItem->GetValue(), MAP_100TH_MM); + SetMetricValue(*m_pMtrFldShadowY, pItem->GetValue(), MapUnit::Map100thMM); } } } @@ -712,8 +712,8 @@ IMPL_LINK_NOARG(SvxFontWorkDialog, SelectShadowHdl_Impl, ToolBox *, void) if (nLastShadowTbxId == nShadowNormalId) { - nSaveShadowX = GetCoreValue(*m_pMtrFldShadowX, MAP_100TH_MM); - nSaveShadowY = GetCoreValue(*m_pMtrFldShadowY, MAP_100TH_MM); + nSaveShadowX = GetCoreValue(*m_pMtrFldShadowX, MapUnit::Map100thMM); + nSaveShadowY = GetCoreValue(*m_pMtrFldShadowY, MapUnit::Map100thMM); } else if (nLastShadowTbxId == nShadowSlantId) { @@ -759,9 +759,9 @@ IMPL_LINK_NOARG(SvxFontWorkDialog, InputTimoutHdl_Impl, Idle *, void) m_pMtrFldShadowY->SetSpinSize( eDlgUnit == FUNIT_MM ? 50 : 10 ); } - long nValue = GetCoreValue(*m_pMtrFldDistance, MAP_100TH_MM); + long nValue = GetCoreValue(*m_pMtrFldDistance, MapUnit::Map100thMM); XFormTextDistanceItem aDistItem( nValue ); - nValue = GetCoreValue(*m_pMtrFldTextStart, MAP_100TH_MM); + nValue = GetCoreValue(*m_pMtrFldTextStart, MapUnit::Map100thMM); XFormTextStartItem aStartItem( nValue ); sal_Int32 nValueX(0L); @@ -773,8 +773,8 @@ IMPL_LINK_NOARG(SvxFontWorkDialog, InputTimoutHdl_Impl, Idle *, void) // methos regarding to the kind of value accessed. if (nLastShadowTbxId == nShadowNormalId) { - nValueX = GetCoreValue(*m_pMtrFldShadowX, MAP_100TH_MM); - nValueY = GetCoreValue(*m_pMtrFldShadowY, MAP_100TH_MM); + nValueX = GetCoreValue(*m_pMtrFldShadowX, MapUnit::Map100thMM); + nValueY = GetCoreValue(*m_pMtrFldShadowY, MapUnit::Map100thMM); } else if (nLastShadowTbxId == nShadowSlantId) { diff --git a/svx/source/dialog/frmsel.cxx b/svx/source/dialog/frmsel.cxx index 26719c96ba91..4fbc52751cf6 100644 --- a/svx/source/dialog/frmsel.cxx +++ b/svx/source/dialog/frmsel.cxx @@ -1244,7 +1244,7 @@ void FrameSelector::Resize() Size FrameSelector::GetOptimalSize() const { - return LogicToPixel(Size(61, 65), MAP_APPFONT); + return LogicToPixel(Size(61, 65), MapUnit::MapAppFont); } diff --git a/svx/source/dialog/graphctl.cxx b/svx/source/dialog/graphctl.cxx index 37a330fdbd37..6cd7ca83500e 100644 --- a/svx/source/dialog/graphctl.cxx +++ b/svx/source/dialog/graphctl.cxx @@ -58,7 +58,7 @@ void GraphCtrlUserCall::Changed( const SdrObject& rObj, SdrUserCallType eType, c GraphCtrl::GraphCtrl( vcl::Window* pParent, WinBits nStyle ) : Control ( pParent, nStyle ), aUpdateIdle ( "svx GraphCtrl Update" ), - aMap100 ( MAP_100TH_MM ), + aMap100 ( MapUnit::Map100thMM ), nWinStyle ( 0 ), eObjKind ( OBJ_NONE ), nPolyEdit ( 0 ), @@ -195,7 +195,7 @@ void GraphCtrl::SetGraphic( const Graphic& rGraphic, bool bNewModel ) else aGraphic = rGraphic; - if ( aGraphic.GetPrefMapMode().GetMapUnit() == MAP_PIXEL ) + if ( aGraphic.GetPrefMapMode().GetMapUnit() == MapUnit::MapPixel ) aGraphSize = Application::GetDefaultDevice()->PixelToLogic( aGraphic.GetPrefSize(), aMap100 ); else aGraphSize = OutputDevice::LogicToLogic( aGraphic.GetPrefSize(), aGraphic.GetPrefMapMode(), aMap100 ); diff --git a/svx/source/dialog/hdft.cxx b/svx/source/dialog/hdft.cxx index bc70898c7306..20c634cab5fe 100644 --- a/svx/source/dialog/hdft.cxx +++ b/svx/source/dialog/hdft.cxx @@ -438,8 +438,8 @@ void SvxHFPage::Reset( const SfxItemSet* rSet ) { // defaults for distance and height long nDefaultDist = bIsCalc ? DEF_DIST_CALC : DEF_DIST_WRITER; - SetMetricValue( *m_pDistEdit, nDefaultDist, MAP_100TH_MM ); - SetMetricValue( *m_pHeightEdit, 500, MAP_100TH_MM ); + SetMetricValue( *m_pDistEdit, nDefaultDist, MapUnit::Map100thMM ); + SetMetricValue( *m_pHeightEdit, 500, MapUnit::Map100thMM ); } if ( !pSetItem ) @@ -746,18 +746,18 @@ void SvxHFPage::UpdateExample() if ( nId == SID_ATTR_PAGE_HEADERSET ) { m_pBspWin->SetHeader( m_pTurnOnBox->IsChecked() ); - m_pBspWin->SetHdHeight( GetCoreValue( *m_pHeightEdit, MAP_TWIP ) ); - m_pBspWin->SetHdDist( GetCoreValue( *m_pDistEdit, MAP_TWIP ) ); - m_pBspWin->SetHdLeft( GetCoreValue( *m_pLMEdit, MAP_TWIP ) ); - m_pBspWin->SetHdRight( GetCoreValue( *m_pRMEdit, MAP_TWIP ) ); + m_pBspWin->SetHdHeight( GetCoreValue( *m_pHeightEdit, MapUnit::MapTwip ) ); + m_pBspWin->SetHdDist( GetCoreValue( *m_pDistEdit, MapUnit::MapTwip ) ); + m_pBspWin->SetHdLeft( GetCoreValue( *m_pLMEdit, MapUnit::MapTwip ) ); + m_pBspWin->SetHdRight( GetCoreValue( *m_pRMEdit, MapUnit::MapTwip ) ); } else { m_pBspWin->SetFooter( m_pTurnOnBox->IsChecked() ); - m_pBspWin->SetFtHeight( GetCoreValue( *m_pHeightEdit, MAP_TWIP ) ); - m_pBspWin->SetFtDist( GetCoreValue( *m_pDistEdit, MAP_TWIP ) ); - m_pBspWin->SetFtLeft( GetCoreValue( *m_pLMEdit, MAP_TWIP ) ); - m_pBspWin->SetFtRight( GetCoreValue( *m_pRMEdit, MAP_TWIP ) ); + m_pBspWin->SetFtHeight( GetCoreValue( *m_pHeightEdit, MapUnit::MapTwip ) ); + m_pBspWin->SetFtDist( GetCoreValue( *m_pDistEdit, MapUnit::MapTwip ) ); + m_pBspWin->SetFtLeft( GetCoreValue( *m_pLMEdit, MapUnit::MapTwip ) ); + m_pBspWin->SetFtRight( GetCoreValue( *m_pRMEdit, MapUnit::MapTwip ) ); } m_pBspWin->Invalidate(); } diff --git a/svx/source/dialog/imapwnd.cxx b/svx/source/dialog/imapwnd.cxx index 5d8147b1d01e..f0c8b0d01868 100644 --- a/svx/source/dialog/imapwnd.cxx +++ b/svx/source/dialog/imapwnd.cxx @@ -84,7 +84,7 @@ void IMapWindow::dispose() Size IMapWindow::GetOptimalSize() const { - return LogicToPixel(Size(270, 170), MAP_APPFONT); + return LogicToPixel(Size(270, 170), MapUnit::MapAppFont); } void IMapWindow::SetImageMap( const ImageMap& rImageMap ) diff --git a/svx/source/dialog/measctrl.cxx b/svx/source/dialog/measctrl.cxx index 1dc190d8b5ce..37d005ef6f4b 100644 --- a/svx/source/dialog/measctrl.cxx +++ b/svx/source/dialog/measctrl.cxx @@ -30,7 +30,7 @@ SvxXMeasurePreview::SvxXMeasurePreview(vcl::Window* pParent, WinBits nStyle) : Control(pParent, nStyle) { - SetMapMode(MAP_100TH_MM); + SetMapMode(MapUnit::Map100thMM); // Scale: 1:2 MapMode aMapMode = GetMapMode(); diff --git a/svx/source/dialog/pagectrl.cxx b/svx/source/dialog/pagectrl.cxx index f5e12ddeb840..fcff9579a5c7 100644 --- a/svx/source/dialog/pagectrl.cxx +++ b/svx/source/dialog/pagectrl.cxx @@ -76,7 +76,7 @@ SvxPageWindow::SvxPageWindow(vcl::Window* pParent) eUsage(SVX_PAGE_ALL) { // Count in Twips by default - SetMapMode(MapMode(MAP_TWIP)); + SetMapMode(MapMode(MapUnit::MapTwip)); aWinSize = GetOptimalSize(); aWinSize.Height() -= 4; aWinSize.Width() -= 4; @@ -439,7 +439,7 @@ void SvxPageWindow::ResetBackground() Size SvxPageWindow::GetOptimalSize() const { - return LogicToPixel(Size(75, 46), MapMode(MAP_APPFONT)); + return LogicToPixel(Size(75, 46), MapMode(MapUnit::MapAppFont)); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/dialog/paraprev.cxx b/svx/source/dialog/paraprev.cxx index b43470352f9c..817429bcadad 100644 --- a/svx/source/dialog/paraprev.cxx +++ b/svx/source/dialog/paraprev.cxx @@ -36,7 +36,7 @@ SvxParaPrevWindow::SvxParaPrevWindow( vcl::Window* pParent, WinBits nBits) : { // Count in Twips by default - SetMapMode(MapMode(MAP_TWIP)); + SetMapMode(MapMode(MapUnit::MapTwip)); aSize = Size(11905, 16837); diff --git a/svx/source/dialog/rubydialog.cxx b/svx/source/dialog/rubydialog.cxx index b7a3e3d359dc..f9a9a40f74b3 100644 --- a/svx/source/dialog/rubydialog.cxx +++ b/svx/source/dialog/rubydialog.cxx @@ -792,7 +792,7 @@ void RubyPreview::Paint(vcl::RenderContext& rRenderContext, const Rectangle& /*r { rRenderContext.Push(PushFlags::MAPMODE); - rRenderContext.SetMapMode(MAP_TWIP); + rRenderContext.SetMapMode(MapUnit::MapTwip); Size aWinSize = rRenderContext.GetOutputSize(); @@ -909,7 +909,7 @@ void RubyPreview::Paint(vcl::RenderContext& rRenderContext, const Rectangle& /*r Size RubyPreview::GetOptimalSize() const { - return LogicToPixel(Size(215, 50), MapMode(MAP_APPFONT)); + return LogicToPixel(Size(215, 50), MapMode(MapUnit::MapAppFont)); } void RubyEdit::GetFocus() diff --git a/svx/source/dialog/srchdlg.cxx b/svx/source/dialog/srchdlg.cxx index e69b91c3ec72..177dd16fea87 100644 --- a/svx/source/dialog/srchdlg.cxx +++ b/svx/source/dialog/srchdlg.cxx @@ -2148,21 +2148,21 @@ OUString& SvxSearchDialog::BuildAttrText_Impl( OUString& rStr, return rStr; // Metric query - MapUnit eMapUnit = MAP_CM; + MapUnit eMapUnit = MapUnit::MapCM; FieldUnit eFieldUnit = pSh->GetModule()->GetFieldUnit(); switch ( eFieldUnit ) { - case FUNIT_MM: eMapUnit = MAP_MM; break; + case FUNIT_MM: eMapUnit = MapUnit::MapMM; break; case FUNIT_CM: case FUNIT_M: - case FUNIT_KM: eMapUnit = MAP_CM; break; - case FUNIT_TWIP: eMapUnit = MAP_TWIP; break; + case FUNIT_KM: eMapUnit = MapUnit::MapCM; break; + case FUNIT_TWIP: eMapUnit = MapUnit::MapTwip; break; case FUNIT_POINT: - case FUNIT_PICA: eMapUnit = MAP_POINT; break; + case FUNIT_PICA: eMapUnit = MapUnit::MapPoint; break; case FUNIT_INCH: case FUNIT_FOOT: - case FUNIT_MILE: eMapUnit = MAP_INCH; break; - case FUNIT_100TH_MM: eMapUnit = MAP_100TH_MM; break; + case FUNIT_MILE: eMapUnit = MapUnit::MapInch; break; + case FUNIT_100TH_MM: eMapUnit = MapUnit::Map100thMM; break; default: ;//prevent warning } diff --git a/svx/source/dialog/swframeexample.cxx b/svx/source/dialog/swframeexample.cxx index 25d4d226410f..19539641bbc7 100644 --- a/svx/source/dialog/swframeexample.cxx +++ b/svx/source/dialog/swframeexample.cxx @@ -67,7 +67,7 @@ VCL_BUILDER_FACTORY_ARGS(SvxSwFrameExample, 0) Size SvxSwFrameExample::GetOptimalSize() const { - return LogicToPixel(Size(52, 86), MapMode(MAP_APPFONT)); + return LogicToPixel(Size(52, 86), MapMode(MapUnit::MapAppFont)); } void SvxSwFrameExample::InitColors_Impl() @@ -474,7 +474,7 @@ Rectangle SvxSwFrameExample::DrawInnerFrame_Impl(vcl::RenderContext& rRenderCont void SvxSwFrameExample::Paint(vcl::RenderContext& rRenderContext, const Rectangle&) { - rRenderContext.SetMapMode(MAP_PIXEL); + rRenderContext.SetMapMode(MapUnit::MapPixel); InitAllRects_Impl(rRenderContext); diff --git a/svx/source/engine3d/float3d.cxx b/svx/source/engine3d/float3d.cxx index 0422f84e41b6..b5ed0de3e87a 100644 --- a/svx/source/engine3d/float3d.cxx +++ b/svx/source/engine3d/float3d.cxx @@ -97,7 +97,7 @@ Svx3DWin::Svx3DWin(SfxBindings* pInBindings, SfxChildWindow *pCW, vcl::Window* p , pConvertTo3DItem(nullptr) , pConvertTo3DLatheItem(nullptr) , mpImpl(new Svx3DWinImpl()) - , ePoolUnit(MAP_MM) + , ePoolUnit(MapUnit::MapMM) , mpRemember2DAttributes(nullptr) { get(m_pBtnGeo, "geometry"); @@ -191,7 +191,7 @@ Svx3DWin::Svx3DWin(SfxBindings* pInBindings, SfxChildWindow *pCW, vcl::Window* p get(m_pCtlPreview, "preview"); get(m_pCtlLightPreview, "lightpreview"); - Size aSize(LogicToPixel(Size(83, 76), MAP_APPFONT)); + Size aSize(LogicToPixel(Size(83, 76), MapUnit::MapAppFont)); m_pCtlPreview->set_width_request(aSize.Width()); m_pCtlLightPreview->set_width_request(aSize.Width()); m_pCtlPreview->set_height_request(aSize.Height()); diff --git a/svx/source/fmcomp/fmgridcl.cxx b/svx/source/fmcomp/fmgridcl.cxx index a1efee19d1d4..27994a36cb4a 100644 --- a/svx/source/fmcomp/fmgridcl.cxx +++ b/svx/source/fmcomp/fmgridcl.cxx @@ -1458,7 +1458,7 @@ bool FmGridControl::isColumnMarked(sal_uInt16 nId) const long FmGridControl::QueryMinimumRowHeight() { long nMinimalLogicHeight = 20; // 0.2 cm - long nMinimalPixelHeight = LogicToPixel( Point( 0, nMinimalLogicHeight ), MAP_10TH_MM ).Y(); + long nMinimalPixelHeight = LogicToPixel( Point( 0, nMinimalLogicHeight ), MapUnit::Map10thMM ).Y(); return CalcZoom( nMinimalPixelHeight ); } @@ -1473,7 +1473,7 @@ void FmGridControl::RowHeightChanged() try { sal_Int32 nUnzoomedPixelHeight = CalcReverseZoom( GetDataRowHeight() ); - Any aProperty = makeAny( (sal_Int32)PixelToLogic( Point( 0, nUnzoomedPixelHeight ), MAP_10TH_MM ).Y() ); + Any aProperty = makeAny( (sal_Int32)PixelToLogic( Point( 0, nUnzoomedPixelHeight ), MapUnit::Map10thMM ).Y() ); xModel->setPropertyValue( FM_PROP_ROWHEIGHT, aProperty ); } catch( const Exception& ) @@ -1496,7 +1496,7 @@ void FmGridControl::ColumnResized(sal_uInt16 nId) sal_Int32 nColumnWidth = GetColumnWidth(nId); nColumnWidth = CalcReverseZoom(nColumnWidth); // Umrechnen in 10THMM - aWidth <<= (sal_Int32)PixelToLogic(Point(nColumnWidth,0),MAP_10TH_MM).X(); + aWidth <<= (sal_Int32)PixelToLogic(Point(nColumnWidth,0),MapUnit::Map10thMM).X(); xColModel->setPropertyValue(FM_PROP_WIDTH, aWidth); } } @@ -1589,7 +1589,7 @@ void FmGridControl::InitColumnsByModels(const Reference< css::container::XIndexC aWidth = xCol->getPropertyValue(FM_PROP_WIDTH); sal_Int32 nWidth = 0; if (aWidth >>= nWidth) - nWidth = LogicToPixel(Point(nWidth,0),MAP_10TH_MM).X(); + nWidth = LogicToPixel(Point(nWidth,0),MapUnit::Map10thMM).X(); AppendColumn(aName, (sal_uInt16)nWidth); DbGridColumn* pCol = DbGridControl::GetColumns().at( i ); diff --git a/svx/source/fmcomp/fmgridif.cxx b/svx/source/fmcomp/fmgridif.cxx index dcc54523cde0..a14585b6b967 100644 --- a/svx/source/fmcomp/fmgridif.cxx +++ b/svx/source/fmcomp/fmgridif.cxx @@ -1416,7 +1416,7 @@ void FmXGridPeer::propertyChange(const PropertyChangeEvent& evt) throw( RuntimeE sal_Int32 nTest = 0; if (evt.NewValue >>= nTest) { - nWidth = pGrid->LogicToPixel(Point(nTest,0),MAP_10TH_MM).X(); + nWidth = pGrid->LogicToPixel(Point(nTest,0),MapUnit::Map10thMM).X(); // take the zoom factor into account nWidth = pGrid->CalcZoom(nWidth); } @@ -1731,7 +1731,7 @@ void FmXGridPeer::elementInserted(const ContainerEvent& evt) throw( RuntimeExcep Any aWidth = xNewColumn->getPropertyValue(FM_PROP_WIDTH); sal_Int32 nWidth = 0; if (aWidth >>= nWidth) - nWidth = pGrid->LogicToPixel(Point(nWidth,0),MAP_10TH_MM).X(); + nWidth = pGrid->LogicToPixel(Point(nWidth,0),MapUnit::Map10thMM).X(); pGrid->AppendColumn(aName, (sal_uInt16)nWidth, (sal_Int16)::comphelper::getINT32(evt.Accessor)); @@ -1774,7 +1774,7 @@ void FmXGridPeer::elementReplaced(const ContainerEvent& evt) throw( RuntimeExcep Any aWidth = xNewColumn->getPropertyValue(FM_PROP_WIDTH); sal_Int32 nWidth = 0; if (aWidth >>= nWidth) - nWidth = pGrid->LogicToPixel(Point(nWidth,0),MAP_10TH_MM).X(); + nWidth = pGrid->LogicToPixel(Point(nWidth,0),MapUnit::Map10thMM).X(); sal_uInt16 nNewId = pGrid->AppendColumn(aName, (sal_uInt16)nWidth, (sal_Int16)::comphelper::getINT32(evt.Accessor)); sal_uInt16 nNewPos = pGrid->GetModelColumnPos(nNewId); @@ -1965,7 +1965,7 @@ void FmXGridPeer::setProperty( const OUString& PropertyName, const Any& Value) t sal_Int32 nLogHeight(0); if (Value >>= nLogHeight) { - sal_Int32 nHeight = pGrid->LogicToPixel(Point(0,nLogHeight),MAP_10TH_MM).Y(); + sal_Int32 nHeight = pGrid->LogicToPixel(Point(0,nLogHeight),MapUnit::Map10thMM).Y(); // take the zoom factor into account nHeight = pGrid->CalcZoom(nHeight); pGrid->SetDataRowHeight(nHeight); @@ -2057,7 +2057,7 @@ Any FmXGridPeer::getProperty( const OUString& _rPropertyName ) throw( RuntimeExc sal_Int32 nPixelHeight = pGrid->GetDataRowHeight(); // take the zoom factor into account nPixelHeight = pGrid->CalcReverseZoom(nPixelHeight); - aProp <<= (sal_Int32)pGrid->PixelToLogic(Point(0,nPixelHeight),MAP_10TH_MM).Y(); + aProp <<= (sal_Int32)pGrid->PixelToLogic(Point(0,nPixelHeight),MapUnit::Map10thMM).Y(); } else if ( _rPropertyName == FM_PROP_HASNAVIGATION ) { diff --git a/svx/source/fmcomp/gridctrl.cxx b/svx/source/fmcomp/gridctrl.cxx index 454a5b227322..6834a812332a 100644 --- a/svx/source/fmcomp/gridctrl.cxx +++ b/svx/source/fmcomp/gridctrl.cxx @@ -427,7 +427,7 @@ sal_uInt16 DbGridControl::NavigationBar::ArrangeControls() Rectangle aRect(static_cast<DbGridControl*>(GetParent())->GetControlArea()); long nH = aRect.GetSize().Height(); long nW = GetParent()->GetOutputSizePixel().Width(); - Size aBorder = LogicToPixel(Size(2, 2),MAP_APPFONT); + Size aBorder = LogicToPixel(Size(2, 2),MapUnit::MapAppFont); aBorder = Size(CalcZoom(aBorder.Width()), CalcZoom(aBorder.Height())); sal_uInt16 nX = 1; sal_uInt16 nY = 0; @@ -436,7 +436,7 @@ sal_uInt16 DbGridControl::NavigationBar::ArrangeControls() if (m_aAbsolute->GetTextHeight() > nH) { vcl::Font aApplFont (m_aAbsolute->GetFont()); - const Size pointAbsoluteSize(m_aAbsolute->PixelToLogic( Size( 0, nH - 2 ), MapMode(MAP_POINT) )); + const Size pointAbsoluteSize(m_aAbsolute->PixelToLogic( Size( 0, nH - 2 ), MapMode(MapUnit::MapPoint) )); aApplFont.SetFontSize( pointAbsoluteSize ); m_aAbsolute->SetControlFont( aApplFont ); diff --git a/svx/source/form/datanavi.cxx b/svx/source/form/datanavi.cxx index 115e96dfa524..077a88f0ef39 100644 --- a/svx/source/form/datanavi.cxx +++ b/svx/source/form/datanavi.cxx @@ -314,7 +314,7 @@ namespace svxform { get(m_pToolBox, "toolbar"); get(m_pItemList, "items"); - Size aSize(LogicToPixel(Size(63, 100), MAP_APPFONT)); + Size aSize(LogicToPixel(Size(63, 100), MapUnit::MapAppFont)); m_pItemList->set_width_request(aSize.Width()); m_pItemList->set_height_request(aSize.Height()); @@ -2155,7 +2155,7 @@ namespace svxform SetText( SVX_RES( RID_STR_DATANAVIGATOR ) ); Size aSize = m_aDataWin->GetOutputSizePixel(); - Size aLogSize = PixelToLogic( aSize, MAP_APPFONT ); + Size aLogSize = PixelToLogic( aSize, MapUnit::MapAppFont ); SfxDockingWindow::SetFloatingSize( aLogSize ); m_aDataWin->Show(); @@ -2213,13 +2213,13 @@ namespace svxform { SfxDockingWindow::Resize(); - Size aLogOutputSize = PixelToLogic( GetOutputSizePixel(), MAP_APPFONT ); + Size aLogOutputSize = PixelToLogic( GetOutputSizePixel(), MapUnit::MapAppFont ); Size aLogExplSize = aLogOutputSize; aLogExplSize.Width() -= 2; aLogExplSize.Height() -= 2; - Point aExplPos = LogicToPixel( Point(1,1), MAP_APPFONT ); - Size aExplSize = LogicToPixel( aLogExplSize, MAP_APPFONT ); + Point aExplPos = LogicToPixel( Point(1,1), MapUnit::MapAppFont ); + Size aExplSize = LogicToPixel( aLogExplSize, MapUnit::MapAppFont ); m_aDataWin->SetPosSizePixel( aExplPos, aExplSize ); } @@ -2630,7 +2630,7 @@ namespace svxform SAL_WARN( "svx.form", "AddDataItemDialog::InitFromNode(): exception caught" ); } - Size a3and1Sz = LogicToPixel( Size( 3, 1 ), MAP_APPFONT ); + Size a3and1Sz = LogicToPixel( Size( 3, 1 ), MapUnit::MapAppFont ); Size aNewSz = m_pDefaultED->GetSizePixel(); Point aNewPnt = m_pDefaultED->GetPosPixel(); aNewPnt.Y() += a3and1Sz.Height(); @@ -2894,7 +2894,7 @@ namespace svxform SvSimpleTableContainer* pNamespacesListContainer = get<SvSimpleTableContainer>("namespaces"); Size aControlSize(175, 72); - aControlSize = LogicToPixel(aControlSize, MAP_APPFONT); + aControlSize = LogicToPixel(aControlSize, MapUnit::MapAppFont); pNamespacesListContainer->set_width_request(aControlSize.Width()); pNamespacesListContainer->set_height_request(aControlSize.Height()); m_pNamespacesList = VclPtr<SvSimpleTable>::Create(*pNamespacesListContainer, 0); diff --git a/svx/source/form/filtnav.cxx b/svx/source/form/filtnav.cxx index d1a3773a8b68..b9afc8992bc7 100644 --- a/svx/source/form/filtnav.cxx +++ b/svx/source/form/filtnav.cxx @@ -1936,13 +1936,13 @@ void FmFilterNavigatorWin::Resize() { SfxDockingWindow::Resize(); - Size aLogOutputSize = PixelToLogic( GetOutputSizePixel(), MAP_APPFONT ); + Size aLogOutputSize = PixelToLogic( GetOutputSizePixel(), MapUnit::MapAppFont ); Size aLogExplSize = aLogOutputSize; aLogExplSize.Width() -= 6; aLogExplSize.Height() -= 6; - Point aExplPos = LogicToPixel( Point(3,3), MAP_APPFONT ); - Size aExplSize = LogicToPixel( aLogExplSize, MAP_APPFONT ); + Point aExplPos = LogicToPixel( Point(3,3), MapUnit::MapAppFont ); + Size aExplSize = LogicToPixel( aLogExplSize, MapUnit::MapAppFont ); m_pNavigator->SetPosSizePixel( aExplPos, aExplSize ); } diff --git a/svx/source/form/fmexpl.cxx b/svx/source/form/fmexpl.cxx index 3ca6326362b0..755403338a2f 100644 --- a/svx/source/form/fmexpl.cxx +++ b/svx/source/form/fmexpl.cxx @@ -587,13 +587,13 @@ namespace svxform { SfxDockingWindow::Resize(); - Size aLogOutputSize = PixelToLogic( GetOutputSizePixel(), MAP_APPFONT ); + Size aLogOutputSize = PixelToLogic( GetOutputSizePixel(), MapUnit::MapAppFont ); Size aLogExplSize = aLogOutputSize; aLogExplSize.Width() -= 6; aLogExplSize.Height() -= 6; - Point aExplPos = LogicToPixel( Point(3,3), MAP_APPFONT ); - Size aExplSize = LogicToPixel( aLogExplSize, MAP_APPFONT ); + Point aExplPos = LogicToPixel( Point(3,3), MapUnit::MapAppFont ); + Size aExplSize = LogicToPixel( aLogExplSize, MapUnit::MapAppFont ); m_pNavigatorTree->SetPosSizePixel( aExplPos, aExplSize ); } diff --git a/svx/source/form/fmvwimp.cxx b/svx/source/form/fmvwimp.cxx index 3ee22cca727c..4890141215b5 100644 --- a/svx/source/form/fmvwimp.cxx +++ b/svx/source/form/fmvwimp.cxx @@ -1475,7 +1475,7 @@ SdrObject* FmXFormView::implCreateXFormsControl( const svx::OXFormsDescriptor &_ // create a button control const MapMode eTargetMode( pOutDev->GetMapMode() ); - const MapMode eSourceMode(MAP_100TH_MM); + const MapMode eSourceMode(MapUnit::Map100thMM); const sal_uInt16 nObjID = OBJ_FM_BUTTON; ::Size controlSize(4000, 500); FmFormObj *pControl = static_cast<FmFormObj*>(SdrObjFactory::MakeNewObject( FmFormInventor, nObjID, nullptr )); @@ -1556,7 +1556,7 @@ bool FmXFormView::createControlLabelPair( OutputDevice& _rOutDev, sal_Int32 _nXO ::Size aTextSize( _rOutDev.GetTextWidth(sFieldName + _rFieldPostfix), _rOutDev.GetTextHeight() ); MapMode eTargetMode( _rOutDev.GetMapMode() ), - eSourceMode( MAP_100TH_MM ); + eSourceMode( MapUnit::Map100thMM ); // Textbreite ist mindestens 4cm // Texthoehe immer halber cm diff --git a/svx/source/gallery2/GalleryControl.cxx b/svx/source/gallery2/GalleryControl.cxx index 99f3f06663e5..f9070492b3a0 100644 --- a/svx/source/gallery2/GalleryControl.cxx +++ b/svx/source/gallery2/GalleryControl.cxx @@ -133,7 +133,7 @@ void GalleryControl::Resize() } mbIsInitialResize = false; - const long nFrameLen = LogicToPixel( Size( 3, 0 ), MAP_APPFONT ).Width(); + const long nFrameLen = LogicToPixel( Size( 3, 0 ), MapUnit::MapAppFont ).Width(); const long nFrameLen2 = nFrameLen << 1; if(bNewLayoutHorizontal) diff --git a/svx/source/gallery2/galbrws1.cxx b/svx/source/gallery2/galbrws1.cxx index dd53ecef93ca..e4316449a632 100644 --- a/svx/source/gallery2/galbrws1.cxx +++ b/svx/source/gallery2/galbrws1.cxx @@ -181,7 +181,7 @@ sal_uIntPtr GalleryBrowser1::ImplInsertThemeEntry( const GalleryThemeEntry* pEnt void GalleryBrowser1::ImplAdjustControls() { const Size aOutSize( GetOutputSizePixel() ); - const long nNewThemeHeight = LogicToPixel( Size( 0, 14 ), MAP_APPFONT ).Height(); + const long nNewThemeHeight = LogicToPixel( Size( 0, 14 ), MapUnit::MapAppFont ).Height(); const long nStartY = nNewThemeHeight + 4; maNewTheme->SetPosSizePixel( Point(), diff --git a/svx/source/gallery2/galctrl.cxx b/svx/source/gallery2/galctrl.cxx index e5436375fcc5..117997126d8e 100644 --- a/svx/source/gallery2/galctrl.cxx +++ b/svx/source/gallery2/galctrl.cxx @@ -59,7 +59,7 @@ VCL_BUILDER_DECL_FACTORY(GalleryPreview) Size GalleryPreview::GetOptimalSize() const { - return LogicToPixel(Size(70, 88), MAP_APPFONT); + return LogicToPixel(Size(70, 88), MapUnit::MapAppFont); } bool GalleryPreview::SetGraphic( const INetURLObject& _aURL ) diff --git a/svx/source/gallery2/galmisc.cxx b/svx/source/gallery2/galmisc.cxx index 70c9ad68d002..48fdd15d11ff 100644 --- a/svx/source/gallery2/galmisc.cxx +++ b/svx/source/gallery2/galmisc.cxx @@ -139,7 +139,7 @@ bool GallerySvDrawImport( SvStream& rIStm, SdrModel& rModel ) // read as XML uno::Reference< io::XInputStream > xInputStream( new utl::OInputStreamWrapper( rIStm ) ); - rModel.GetItemPool().SetDefaultMetric( MAP_100TH_MM ); + rModel.GetItemPool().SetDefaultMetric( MapUnit::Map100thMM ); uno::Reference< lang::XComponent > xComponent; bRet = SvxDrawingLayerImport( &rModel, xInputStream, xComponent, "com.sun.star.comp.Draw.XMLOasisImporter" ); diff --git a/svx/source/gallery2/galobj.cxx b/svx/source/gallery2/galobj.cxx index 2a05f697ddb9..45af5e587330 100644 --- a/svx/source/gallery2/galobj.cxx +++ b/svx/source/gallery2/galobj.cxx @@ -100,11 +100,11 @@ bool SgaObject::CreateThumb( const Graphic& rGraphic ) if( aBmpSize.Width() && aBmpSize.Height() ) { - if( aBmpEx.GetPrefMapMode().GetMapUnit() != MAP_PIXEL && + if( aBmpEx.GetPrefMapMode().GetMapUnit() != MapUnit::MapPixel && aBmpEx.GetPrefSize().Width() > 0 && aBmpEx.GetPrefSize().Height() > 0 ) { - Size aLogSize( OutputDevice::LogicToLogic( aBmpEx.GetPrefSize(), aBmpEx.GetPrefMapMode(), MAP_100TH_MM ) ); + Size aLogSize( OutputDevice::LogicToLogic( aBmpEx.GetPrefSize(), aBmpEx.GetPrefMapMode(), MapUnit::Map100thMM ) ); if( aLogSize.Width() > 0 && aLogSize.Height() > 0 ) { diff --git a/svx/source/gallery2/galtheme.cxx b/svx/source/gallery2/galtheme.cxx index 81a7a6af356f..45969cb56e34 100644 --- a/svx/source/gallery2/galtheme.cxx +++ b/svx/source/gallery2/galtheme.cxx @@ -801,7 +801,7 @@ bool GalleryTheme::GetGraphic( sal_uIntPtr nPos, Graphic& rGraphic, bool bProgre else { ScopedVclPtrInstance< VirtualDevice > pVDev; - pVDev->SetMapMode( MapMode( MAP_100TH_MM ) ); + pVDev->SetMapMode( MapMode( MapUnit::Map100thMM ) ); FmFormView aView( aModel.GetModel(), pVDev ); aView.hideMarkHandles(); diff --git a/svx/source/items/grfitem.cxx b/svx/source/items/grfitem.cxx index c76e654a447c..f338b7553d1a 100644 --- a/svx/source/items/grfitem.cxx +++ b/svx/source/items/grfitem.cxx @@ -144,10 +144,10 @@ bool SvxGrfCrop::GetPresentation( case SfxItemPresentation::Nameless: return true; case SfxItemPresentation::Complete: - rText = "L: " + OUString(::GetMetricText( GetLeft(), eCoreUnit, MAP_MM, pIntl )) + - " R: " + OUString(::GetMetricText( GetRight(), eCoreUnit, MAP_MM, pIntl )) + - " T: " + OUString(::GetMetricText( GetTop(), eCoreUnit, MAP_MM, pIntl )) + - " B: " + OUString(::GetMetricText( GetBottom(), eCoreUnit, MAP_MM, pIntl )); + rText = "L: " + OUString(::GetMetricText( GetLeft(), eCoreUnit, MapUnit::MapMM, pIntl )) + + " R: " + OUString(::GetMetricText( GetRight(), eCoreUnit, MapUnit::MapMM, pIntl )) + + " T: " + OUString(::GetMetricText( GetTop(), eCoreUnit, MapUnit::MapMM, pIntl )) + + " B: " + OUString(::GetMetricText( GetBottom(), eCoreUnit, MapUnit::MapMM, pIntl )); return true; break; diff --git a/svx/source/sdr/contact/viewcontactofgraphic.cxx b/svx/source/sdr/contact/viewcontactofgraphic.cxx index 8cb09022e000..c4c336bff959 100644 --- a/svx/source/sdr/contact/viewcontactofgraphic.cxx +++ b/svx/source/sdr/contact/viewcontactofgraphic.cxx @@ -106,13 +106,13 @@ namespace sdr // safe to assume 100th mm as target. Size aPrefSize(GetGrafObject().GetGrafPrefSize()); - if(MAP_PIXEL == GetGrafObject().GetGrafPrefMapMode().GetMapUnit()) + if(MapUnit::MapPixel == GetGrafObject().GetGrafPrefMapMode().GetMapUnit()) { - aPrefSize = Application::GetDefaultDevice()->PixelToLogic(aPrefSize, MAP_100TH_MM); + aPrefSize = Application::GetDefaultDevice()->PixelToLogic(aPrefSize, MapUnit::Map100thMM); } else { - aPrefSize = OutputDevice::LogicToLogic(aPrefSize, GetGrafObject().GetGrafPrefMapMode(), MAP_100TH_MM); + aPrefSize = OutputDevice::LogicToLogic(aPrefSize, GetGrafObject().GetGrafPrefMapMode(), MapUnit::Map100thMM); } // decompose object matrix to get single values @@ -198,13 +198,13 @@ namespace sdr { Size aPrefSize(aDraftBitmap.GetPrefSize()); - if(MAP_PIXEL == aDraftBitmap.GetPrefMapMode().GetMapUnit()) + if(MapUnit::MapPixel == aDraftBitmap.GetPrefMapMode().GetMapUnit()) { - aPrefSize = Application::GetDefaultDevice()->PixelToLogic(aDraftBitmap.GetSizePixel(), MAP_100TH_MM); + aPrefSize = Application::GetDefaultDevice()->PixelToLogic(aDraftBitmap.GetSizePixel(), MapUnit::Map100thMM); } else { - aPrefSize = OutputDevice::LogicToLogic(aPrefSize, aDraftBitmap.GetPrefMapMode(), MAP_100TH_MM); + aPrefSize = OutputDevice::LogicToLogic(aPrefSize, aDraftBitmap.GetPrefMapMode(), MapUnit::Map100thMM); } const double fBitmapScaling(2.0); diff --git a/svx/source/sdr/overlay/overlayobjectlist.cxx b/svx/source/sdr/overlay/overlayobjectlist.cxx index c744f2923793..6438bc762115 100644 --- a/svx/source/sdr/overlay/overlayobjectlist.cxx +++ b/svx/source/sdr/overlay/overlayobjectlist.cxx @@ -79,8 +79,8 @@ namespace sdr if (comphelper::LibreOfficeKit::isActive()) { aSizeLogic = Size(DEFAULT_VALUE_FOR_HITTEST_TWIP, DEFAULT_VALUE_FOR_HITTEST_TWIP); - if (pManager->getOutputDevice().GetMapMode().GetMapUnit() == MAP_100TH_MM) - aSizeLogic = OutputDevice::LogicToLogic(aSizeLogic, MAP_TWIP, MAP_100TH_MM); + if (pManager->getOutputDevice().GetMapMode().GetMapUnit() == MapUnit::Map100thMM) + aSizeLogic = OutputDevice::LogicToLogic(aSizeLogic, MapUnit::MapTwip, MapUnit::Map100thMM); } fLogicTolerance = aSizeLogic.Width(); diff --git a/svx/source/sdr/primitive2d/sdrattributecreator.cxx b/svx/source/sdr/primitive2d/sdrattributecreator.cxx index bbfbbd87d8fa..e150b19469f5 100644 --- a/svx/source/sdr/primitive2d/sdrattributecreator.cxx +++ b/svx/source/sdr/primitive2d/sdrattributecreator.cxx @@ -642,7 +642,7 @@ namespace drawinglayer if(GraphicType::Bitmap == aGraphic.GetType()) { aGraphic.SetPrefSize(aGraphic.GetBitmapEx().GetSizePixel()); - aGraphic.SetPrefMapMode(MAP_PIXEL); + aGraphic.SetPrefMapMode(MapUnit::MapPixel); } } @@ -659,11 +659,11 @@ namespace drawinglayer if(aGraphic.GetPrefMapMode() != aDestinationMapUnit) { - // #i100360# for MAP_PIXEL, LogicToLogic will not work properly, + // #i100360# for MapUnit::MapPixel, LogicToLogic will not work properly, // so fallback to Application::GetDefaultDevice() Size aNewSize(0, 0); - if(MAP_PIXEL == aGraphic.GetPrefMapMode().GetMapUnit()) + if(MapUnit::MapPixel == aGraphic.GetPrefMapMode().GetMapUnit()) { aNewSize = Application::GetDefaultDevice()->PixelToLogic( aGraphic.GetPrefSize(), diff --git a/svx/source/sdr/primitive2d/sdrolecontentprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrolecontentprimitive2d.cxx index 276f68d98452..a4fa9e4f3419 100644 --- a/svx/source/sdr/primitive2d/sdrolecontentprimitive2d.cxx +++ b/svx/source/sdr/primitive2d/sdrolecontentprimitive2d.cxx @@ -73,13 +73,13 @@ namespace drawinglayer // get PrefSize from the graphic in 100th mm Size aPrefSize(aGraphic.GetPrefSize()); - if(MAP_PIXEL == aGraphic.GetPrefMapMode().GetMapUnit()) + if(MapUnit::MapPixel == aGraphic.GetPrefMapMode().GetMapUnit()) { - aPrefSize = Application::GetDefaultDevice()->PixelToLogic(aPrefSize, MAP_100TH_MM); + aPrefSize = Application::GetDefaultDevice()->PixelToLogic(aPrefSize, MapUnit::Map100thMM); } else { - aPrefSize = OutputDevice::LogicToLogic(aPrefSize, aGraphic.GetPrefMapMode(), MAP_100TH_MM); + aPrefSize = OutputDevice::LogicToLogic(aPrefSize, aGraphic.GetPrefMapMode(), MapUnit::Map100thMM); } const double fOffsetX((aScale.getX() - aPrefSize.getWidth()) / 2.0); diff --git a/svx/source/sidebar/area/AreaTransparencyGradientControl.cxx b/svx/source/sidebar/area/AreaTransparencyGradientControl.cxx index dc50fb1f8b00..922f104b6e6e 100644 --- a/svx/source/sidebar/area/AreaTransparencyGradientControl.cxx +++ b/svx/source/sidebar/area/AreaTransparencyGradientControl.cxx @@ -30,24 +30,24 @@ namespace svx { namespace sidebar { // positioning helpers -#define APOS1_1 Point(LogicToPixel(Point(POPUPPANEL_MARGIN_HORIZONTAL,POPUPPANEL_MARGIN_VERTICAL), MAP_APPFONT)) -#define APOS2_1 Point(LogicToPixel(Point(POPUPPANEL_MARGIN_HORIZONTAL,POPUPPANEL_MARGIN_VERTICAL + FIXED_TEXT_HEIGHT + TEXT_CONTROL_SPACING_VERTICAL), MAP_APPFONT)) -#define APOS1_2 Point(LogicToPixel(Point(POPUPPANEL_MARGIN_HORIZONTAL+CONTROL_WIDTH+CONTROL_SPACING_HORIZONTAL,POPUPPANEL_MARGIN_VERTICAL), MAP_APPFONT)) -#define APOS2_2 Point(LogicToPixel(Point(POPUPPANEL_MARGIN_HORIZONTAL+CONTROL_WIDTH+CONTROL_SPACING_HORIZONTAL,POPUPPANEL_MARGIN_VERTICAL + FIXED_TEXT_HEIGHT + TEXT_CONTROL_SPACING_VERTICAL), MAP_APPFONT)) -#define APOS1_3 Point(LogicToPixel(Point(POPUPPANEL_MARGIN_HORIZONTAL,POPUPPANEL_MARGIN_VERTICAL + FIXED_TEXT_HEIGHT + TEXT_CONTROL_SPACING_VERTICAL+MBOX_HEIGHT+CONTROL_SPACING_VERTICAL), MAP_APPFONT)) -#define APOS1_4 Point(LogicToPixel(Point(POPUPPANEL_MARGIN_HORIZONTAL,POPUPPANEL_MARGIN_VERTICAL + 2*(FIXED_TEXT_HEIGHT + TEXT_CONTROL_SPACING_VERTICAL)+MBOX_HEIGHT+CONTROL_SPACING_VERTICAL), MAP_APPFONT)) -#define APOS2_3 Point(LogicToPixel(Point(POPUPPANEL_MARGIN_HORIZONTAL+CONTROL_WIDTH+CONTROL_SPACING_HORIZONTAL,POPUPPANEL_MARGIN_VERTICAL + FIXED_TEXT_HEIGHT + TEXT_CONTROL_SPACING_VERTICAL+MBOX_HEIGHT+CONTROL_SPACING_VERTICAL), MAP_APPFONT)) -#define APOS2_4 Point(LogicToPixel(Point(POPUPPANEL_MARGIN_HORIZONTAL+CONTROL_WIDTH+CONTROL_SPACING_HORIZONTAL,POPUPPANEL_MARGIN_VERTICAL + 2*(FIXED_TEXT_HEIGHT + TEXT_CONTROL_SPACING_VERTICAL)+MBOX_HEIGHT+CONTROL_SPACING_VERTICAL), MAP_APPFONT)) -#define APOS1_5 Point(LogicToPixel(Point(POPUPPANEL_MARGIN_HORIZONTAL,POPUPPANEL_MARGIN_VERTICAL + 2*(FIXED_TEXT_HEIGHT + TEXT_CONTROL_SPACING_VERTICAL+MBOX_HEIGHT+CONTROL_SPACING_VERTICAL)), MAP_APPFONT)) -#define APOS1_6 Point(LogicToPixel(Point(POPUPPANEL_MARGIN_HORIZONTAL,POPUPPANEL_MARGIN_VERTICAL + 3*(FIXED_TEXT_HEIGHT + TEXT_CONTROL_SPACING_VERTICAL)+2*(MBOX_HEIGHT+CONTROL_SPACING_VERTICAL)), MAP_APPFONT)) -#define APOS2_5 Point(LogicToPixel(Point(POPUPPANEL_MARGIN_HORIZONTAL+CONTROL_WIDTH+CONTROL_SPACING_HORIZONTAL,POPUPPANEL_MARGIN_VERTICAL + 2*(FIXED_TEXT_HEIGHT + TEXT_CONTROL_SPACING_VERTICAL+MBOX_HEIGHT+CONTROL_SPACING_VERTICAL)), MAP_APPFONT)) -#define APOS2_6 Point(LogicToPixel(Point(POPUPPANEL_MARGIN_HORIZONTAL+CONTROL_WIDTH+CONTROL_SPACING_HORIZONTAL,POPUPPANEL_MARGIN_VERTICAL + 3*(FIXED_TEXT_HEIGHT + TEXT_CONTROL_SPACING_VERTICAL)+2*(MBOX_HEIGHT+CONTROL_SPACING_VERTICAL)), MAP_APPFONT)) -#define APOS1_7 Point(LogicToPixel(Point(POPUPPANEL_MARGIN_HORIZONTAL,POPUPPANEL_MARGIN_VERTICAL + 3*(FIXED_TEXT_HEIGHT + TEXT_CONTROL_SPACING_VERTICAL+MBOX_HEIGHT+CONTROL_SPACING_VERTICAL)), MAP_APPFONT)) -#define APOS1_8 Point(LogicToPixel(Point(POPUPPANEL_MARGIN_HORIZONTAL,POPUPPANEL_MARGIN_VERTICAL + 4*(FIXED_TEXT_HEIGHT + TEXT_CONTROL_SPACING_VERTICAL)+3*(MBOX_HEIGHT+CONTROL_SPACING_VERTICAL)), MAP_APPFONT)) -#define APOS_Left_Right_1 Point(LogicToPixel(Point(LEFT_RIGHT_X1,LEFT_RIGHT_Y1), MAP_APPFONT)) -#define APOS_Left_Right_2 Point(LogicToPixel(Point(LEFT_RIGHT_X2,LEFT_RIGHT_Y1), MAP_APPFONT)) -#define APOS_Left_Right_3 Point(LogicToPixel(Point(LEFT_RIGHT_X1,LEFT_RIGHT_Y2), MAP_APPFONT)) -#define APOS_Left_Right_4 Point(LogicToPixel(Point(LEFT_RIGHT_X2,LEFT_RIGHT_Y2), MAP_APPFONT)) +#define APOS1_1 Point(LogicToPixel(Point(POPUPPANEL_MARGIN_HORIZONTAL,POPUPPANEL_MARGIN_VERTICAL), MapUnit::MapAppFont)) +#define APOS2_1 Point(LogicToPixel(Point(POPUPPANEL_MARGIN_HORIZONTAL,POPUPPANEL_MARGIN_VERTICAL + FIXED_TEXT_HEIGHT + TEXT_CONTROL_SPACING_VERTICAL), MapUnit::MapAppFont)) +#define APOS1_2 Point(LogicToPixel(Point(POPUPPANEL_MARGIN_HORIZONTAL+CONTROL_WIDTH+CONTROL_SPACING_HORIZONTAL,POPUPPANEL_MARGIN_VERTICAL), MapUnit::MapAppFont)) +#define APOS2_2 Point(LogicToPixel(Point(POPUPPANEL_MARGIN_HORIZONTAL+CONTROL_WIDTH+CONTROL_SPACING_HORIZONTAL,POPUPPANEL_MARGIN_VERTICAL + FIXED_TEXT_HEIGHT + TEXT_CONTROL_SPACING_VERTICAL), MapUnit::MapAppFont)) +#define APOS1_3 Point(LogicToPixel(Point(POPUPPANEL_MARGIN_HORIZONTAL,POPUPPANEL_MARGIN_VERTICAL + FIXED_TEXT_HEIGHT + TEXT_CONTROL_SPACING_VERTICAL+MBOX_HEIGHT+CONTROL_SPACING_VERTICAL), MapUnit::MapAppFont)) +#define APOS1_4 Point(LogicToPixel(Point(POPUPPANEL_MARGIN_HORIZONTAL,POPUPPANEL_MARGIN_VERTICAL + 2*(FIXED_TEXT_HEIGHT + TEXT_CONTROL_SPACING_VERTICAL)+MBOX_HEIGHT+CONTROL_SPACING_VERTICAL), MapUnit::MapAppFont)) +#define APOS2_3 Point(LogicToPixel(Point(POPUPPANEL_MARGIN_HORIZONTAL+CONTROL_WIDTH+CONTROL_SPACING_HORIZONTAL,POPUPPANEL_MARGIN_VERTICAL + FIXED_TEXT_HEIGHT + TEXT_CONTROL_SPACING_VERTICAL+MBOX_HEIGHT+CONTROL_SPACING_VERTICAL), MapUnit::MapAppFont)) +#define APOS2_4 Point(LogicToPixel(Point(POPUPPANEL_MARGIN_HORIZONTAL+CONTROL_WIDTH+CONTROL_SPACING_HORIZONTAL,POPUPPANEL_MARGIN_VERTICAL + 2*(FIXED_TEXT_HEIGHT + TEXT_CONTROL_SPACING_VERTICAL)+MBOX_HEIGHT+CONTROL_SPACING_VERTICAL), MapUnit::MapAppFont)) +#define APOS1_5 Point(LogicToPixel(Point(POPUPPANEL_MARGIN_HORIZONTAL,POPUPPANEL_MARGIN_VERTICAL + 2*(FIXED_TEXT_HEIGHT + TEXT_CONTROL_SPACING_VERTICAL+MBOX_HEIGHT+CONTROL_SPACING_VERTICAL)), MapUnit::MapAppFont)) +#define APOS1_6 Point(LogicToPixel(Point(POPUPPANEL_MARGIN_HORIZONTAL,POPUPPANEL_MARGIN_VERTICAL + 3*(FIXED_TEXT_HEIGHT + TEXT_CONTROL_SPACING_VERTICAL)+2*(MBOX_HEIGHT+CONTROL_SPACING_VERTICAL)), MapUnit::MapAppFont)) +#define APOS2_5 Point(LogicToPixel(Point(POPUPPANEL_MARGIN_HORIZONTAL+CONTROL_WIDTH+CONTROL_SPACING_HORIZONTAL,POPUPPANEL_MARGIN_VERTICAL + 2*(FIXED_TEXT_HEIGHT + TEXT_CONTROL_SPACING_VERTICAL+MBOX_HEIGHT+CONTROL_SPACING_VERTICAL)), MapUnit::MapAppFont)) +#define APOS2_6 Point(LogicToPixel(Point(POPUPPANEL_MARGIN_HORIZONTAL+CONTROL_WIDTH+CONTROL_SPACING_HORIZONTAL,POPUPPANEL_MARGIN_VERTICAL + 3*(FIXED_TEXT_HEIGHT + TEXT_CONTROL_SPACING_VERTICAL)+2*(MBOX_HEIGHT+CONTROL_SPACING_VERTICAL)), MapUnit::MapAppFont)) +#define APOS1_7 Point(LogicToPixel(Point(POPUPPANEL_MARGIN_HORIZONTAL,POPUPPANEL_MARGIN_VERTICAL + 3*(FIXED_TEXT_HEIGHT + TEXT_CONTROL_SPACING_VERTICAL+MBOX_HEIGHT+CONTROL_SPACING_VERTICAL)), MapUnit::MapAppFont)) +#define APOS1_8 Point(LogicToPixel(Point(POPUPPANEL_MARGIN_HORIZONTAL,POPUPPANEL_MARGIN_VERTICAL + 4*(FIXED_TEXT_HEIGHT + TEXT_CONTROL_SPACING_VERTICAL)+3*(MBOX_HEIGHT+CONTROL_SPACING_VERTICAL)), MapUnit::MapAppFont)) +#define APOS_Left_Right_1 Point(LogicToPixel(Point(LEFT_RIGHT_X1,LEFT_RIGHT_Y1), MapUnit::MapAppFont)) +#define APOS_Left_Right_2 Point(LogicToPixel(Point(LEFT_RIGHT_X2,LEFT_RIGHT_Y1), MapUnit::MapAppFont)) +#define APOS_Left_Right_3 Point(LogicToPixel(Point(LEFT_RIGHT_X1,LEFT_RIGHT_Y2), MapUnit::MapAppFont)) +#define APOS_Left_Right_4 Point(LogicToPixel(Point(LEFT_RIGHT_X2,LEFT_RIGHT_Y2), MapUnit::MapAppFont)) AreaTransparencyGradientControl::AreaTransparencyGradientControl ( vcl::Window* pParent, @@ -128,9 +128,9 @@ void AreaTransparencyGradientControl::Rearrange(XFillFloatTransparenceItem* pGra const XGradient& rGradient = pGradientItem->GetGradientValue(); css::awt::GradientStyle eXGS(rGradient.GetGradientStyle()); Size aSize(POP_WIDTH,POP_HEIGHT); - aSize = LogicToPixel( aSize, MapMode(MAP_APPFONT) ); + aSize = LogicToPixel( aSize, MapMode(MapUnit::MapAppFont) ); Size aSize2(POP_WIDTH,POP_HEIGHT2); - aSize2 = LogicToPixel( aSize2, MapMode(MAP_APPFONT) ); + aSize2 = LogicToPixel( aSize2, MapMode(MapUnit::MapAppFont) ); long aPosY = 0; Point aPointAngle; Size aSizeAngle = maMtrTrgrAngle->GetSizePixel(); diff --git a/svx/source/sidebar/line/LinePropertyPanelBase.cxx b/svx/source/sidebar/line/LinePropertyPanelBase.cxx index 4d1ff4a309f1..2047408efd12 100644 --- a/svx/source/sidebar/line/LinePropertyPanelBase.cxx +++ b/svx/source/sidebar/line/LinePropertyPanelBase.cxx @@ -165,7 +165,7 @@ LinePropertyPanelBase::LinePropertyPanelBase( mpStyleItem(), mpDashItem(), mnTrans(0), - meMapUnit(MAP_MM), + meMapUnit(MapUnit::MapMM), mnWidthCoreValue(0), mpStartItem(), mpEndItem(), @@ -705,7 +705,7 @@ void LinePropertyPanelBase::SetWidthIcon() return; } - long nVal = LogicToLogic(mnWidthCoreValue * 10,(MapUnit)meMapUnit , MAP_POINT); + long nVal = LogicToLogic(mnWidthCoreValue * 10,(MapUnit)meMapUnit , MapUnit::MapPoint); const sal_uInt16 nIdWidth = mpTBWidth->GetItemId(UNO_SELECTWIDTH); if(nVal <= 6) diff --git a/svx/source/sidebar/line/LineWidthPopup.cxx b/svx/source/sidebar/line/LineWidthPopup.cxx index b455758f8216..52f60d0b67bc 100644 --- a/svx/source/sidebar/line/LineWidthPopup.cxx +++ b/svx/source/sidebar/line/LineWidthPopup.cxx @@ -32,7 +32,7 @@ LineWidthPopup::LineWidthPopup(LinePropertyPanelBase& rParent) , m_rParent(rParent) , m_pStr(nullptr) , m_sPt(SVX_RESSTR(RID_SVXSTR_PT)) - , m_eMapUnit(MAP_TWIP) + , m_eMapUnit(MapUnit::MapTwip) , m_bVSFocus(true) , m_bCustom(false) , m_bCloseByEdit(false) @@ -116,7 +116,7 @@ IMPL_LINK(LineWidthPopup, VSSelectHdl, ValueSet*, /*pControl*/, void) sal_uInt16 iPos = m_xVSWidth->GetSelectItemId(); if (iPos >= 1 && iPos <= 8) { - sal_IntPtr nVal = LogicToLogic(reinterpret_cast<sal_IntPtr>(m_xVSWidth->GetItemData( iPos )), MAP_POINT, (MapUnit)m_eMapUnit); + sal_IntPtr nVal = LogicToLogic(reinterpret_cast<sal_IntPtr>(m_xVSWidth->GetItemData( iPos )), MapUnit::MapPoint, (MapUnit)m_eMapUnit); nVal = m_xMFWidth->Denormalize(nVal); XLineWidthItem aWidthItem( nVal ); m_rParent.setLineWidth(aWidthItem); @@ -130,7 +130,7 @@ IMPL_LINK(LineWidthPopup, VSSelectHdl, ValueSet*, /*pControl*/, void) //modified if (m_bCustom) { - long nVal = LogicToLogic(m_nCustomWidth , MAP_POINT, (MapUnit)m_eMapUnit); + long nVal = LogicToLogic(m_nCustomWidth , MapUnit::MapPoint, (MapUnit)m_eMapUnit); nVal = m_xMFWidth->Denormalize(nVal); XLineWidthItem aWidthItem( nVal ); m_rParent.setLineWidth(aWidthItem); @@ -165,7 +165,7 @@ IMPL_LINK(LineWidthPopup, MFModifyHdl, Edit&, /*rControl*/, void) m_xVSWidth->StartSelection(); } long nTmp = static_cast<long>(m_xMFWidth->GetValue()); - long nVal = LogicToLogic( nTmp, MAP_POINT, (MapUnit)m_eMapUnit ); + long nVal = LogicToLogic( nTmp, MapUnit::MapPoint, (MapUnit)m_eMapUnit ); sal_Int32 nNewWidth = (short)m_xMFWidth->Denormalize( nVal ); XLineWidthItem aWidthItem(nNewWidth); m_rParent.setLineWidth(aWidthItem); @@ -208,7 +208,7 @@ void LineWidthPopup::SetWidthSelect(long lValue, bool bValuable, MapUnit eMapUni if (bValuable) { - sal_Int64 nVal = OutputDevice::LogicToLogic(lValue, (MapUnit) eMapUnit, MAP_100TH_MM ); + sal_Int64 nVal = OutputDevice::LogicToLogic(lValue, (MapUnit) eMapUnit, MapUnit::Map100thMM ); nVal = m_xMFWidth->Normalize(nVal); m_xMFWidth->SetValue( nVal, FUNIT_100TH_MM ); } diff --git a/svx/source/sidebar/line/LineWidthValueSet.cxx b/svx/source/sidebar/line/LineWidthValueSet.cxx index 0d7503fac64b..7b406b4575a6 100644 --- a/svx/source/sidebar/line/LineWidthValueSet.cxx +++ b/svx/source/sidebar/line/LineWidthValueSet.cxx @@ -173,7 +173,7 @@ void LineWidthValueSet::UserDraw( const UserDrawEvent& rUDEvt ) Size LineWidthValueSet::GetOptimalSize() const { - return LogicToPixel(Size(80, 12 * 9), MAP_APPFONT); + return LogicToPixel(Size(80, 12 * 9), MapUnit::MapAppFont); } } } // end of namespace svx::sidebar diff --git a/svx/source/sidebar/nbdtmg.cxx b/svx/source/sidebar/nbdtmg.cxx index 765e0f80a900..e4b3a0f1460f 100644 --- a/svx/source/sidebar/nbdtmg.cxx +++ b/svx/source/sidebar/nbdtmg.cxx @@ -154,7 +154,7 @@ void NBOTypeMgrBase::ImplLoad(const OUString& filename) { bIsLoading = true; MapUnit eOldCoreUnit=eCoreUnit; - eCoreUnit = MAP_100TH_MM; + eCoreUnit = MapUnit::Map100thMM; INetURLObject aFile( SvtPathOptions().GetUserConfigPath() ); aFile.Append( filename); std::unique_ptr<SvStream> xIStm(::utl::UcbStreamHelper::CreateStream( aFile.GetMainURL( INetURLObject::NO_DECODE ), StreamMode::READ )); @@ -193,7 +193,7 @@ void NBOTypeMgrBase::ImplStore(const OUString& filename) { if (bIsLoading) return; MapUnit eOldCoreUnit=eCoreUnit; - eCoreUnit = MAP_100TH_MM; + eCoreUnit = MapUnit::Map100thMM; INetURLObject aFile( SvtPathOptions().GetUserConfigPath() ); aFile.Append( filename); std::unique_ptr<SvStream> xOStm(::utl::UcbStreamHelper::CreateStream( aFile.GetMainURL( INetURLObject::NO_DECODE ), StreamMode::WRITE )); @@ -975,7 +975,7 @@ void OutlineTypeMgr::ApplyNumRule(SvxNumRule& aNum, sal_uInt16 nIndex, sal_uInt1 aSize = SvxNumberFormat::GetGraphicSizeMM100( pGrf ); } } - aSize = OutputDevice::LogicToLogic(aSize, MAP_100TH_MM, (MapUnit)GetMapUnit()); + aSize = OutputDevice::LogicToLogic(aSize, MapUnit::Map100thMM, (MapUnit)GetMapUnit()); aFmt.SetGraphicBrush( pLevelSettings->pBrushItem, &aSize, &eOrient ); } } else diff --git a/svx/source/sidebar/paragraph/ParaLineSpacingControl.cxx b/svx/source/sidebar/paragraph/ParaLineSpacingControl.cxx index f58cb6bc11ad..46ca5b89fcd8 100644 --- a/svx/source/sidebar/paragraph/ParaLineSpacingControl.cxx +++ b/svx/source/sidebar/paragraph/ParaLineSpacingControl.cxx @@ -62,7 +62,7 @@ ParaLineSpacingControl::ParaLineSpacingControl(sal_uInt16 nId) mpActLineDistFld = mpLineDistAtPercentBox.get(); - meLNSpaceUnit = MAP_100TH_MM; + meLNSpaceUnit = MapUnit::Map100thMM; Link<Button*,void> aLink = LINK(this, ParaLineSpacingControl, PredefinedValuesHandler); mpSpacing1Button->SetClickHdl(aLink); @@ -120,7 +120,7 @@ void ParaLineSpacingControl::Initialize() if( eState >= SfxItemState::DEFAULT ) { - MapUnit eUnit = MAP_100TH_MM; + MapUnit eUnit = MapUnit::Map100thMM; meLNSpaceUnit = eUnit; switch( currSPItem->GetLineSpaceRule() ) @@ -309,7 +309,7 @@ void ParaLineSpacingControl::UpdateMetricFields() mpLineDistAtMetricBox->SetMin(mpLineDistAtMetricBox->Normalize(MIN_FIXED_DISTANCE), FUNIT_TWIP); if (mpLineDistAtMetricBox->GetValue() != nTemp) - SetMetricValue(*mpLineDistAtMetricBox, FIX_DIST_DEF, MAP_TWIP); + SetMetricValue(*mpLineDistAtMetricBox, FIX_DIST_DEF, MapUnit::MapTwip); mpLineDistLabel->Enable(); mpActLineDistFld->Show(); diff --git a/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx b/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx index b3e7e078145d..1f288e9deeaa 100644 --- a/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx +++ b/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx @@ -136,7 +136,7 @@ void ParaPropertyPanel::HandleContextChange ( mpToolBoxHighlight->Hide(); Size aSize(PROPERTYPAGE_WIDTH,TEXT_SECTIONPAGE_HEIGHT); - aSize = LogicToPixel( aSize,MapMode(MAP_APPFONT) ); + aSize = LogicToPixel( aSize,MapMode(MapUnit::MapAppFont) ); aSize.setWidth(GetOutputSizePixel().Width()); SetSizePixel(aSize); }*/ @@ -225,8 +225,8 @@ IMPL_LINK(ParaPropertyPanel, ClickIndent_IncDec_Hdl_Impl, ToolBox *, pControl, v SvxLRSpaceItem aMargin( SID_ATTR_PARA_LRSPACE ); maTxtLeft += INDENT_STEP; - sal_Int64 nVal = OutputDevice::LogicToLogic( maTxtLeft, (MapUnit)(MAP_TWIP), MAP_100TH_MM ); - nVal = OutputDevice::LogicToLogic( (long)nVal, MAP_100TH_MM, (MapUnit)m_eLRSpaceUnit ); + sal_Int64 nVal = OutputDevice::LogicToLogic( maTxtLeft, (MapUnit)(MapUnit::MapTwip), MapUnit::Map100thMM ); + nVal = OutputDevice::LogicToLogic( (long)nVal, MapUnit::Map100thMM, (MapUnit)m_eLRSpaceUnit ); aMargin.SetTextLeft( (const long)nVal ); aMargin.SetRight( (const long)GetCoreValue( *mpRightIndent, m_eLRSpaceUnit ) ); aMargin.SetTextFirstLineOfst( (const short)GetCoreValue( *mpFLineIndent, m_eLRSpaceUnit ) ); @@ -258,8 +258,8 @@ IMPL_LINK(ParaPropertyPanel, ClickIndent_IncDec_Hdl_Impl, ToolBox *, pControl, v SvxLRSpaceItem aMargin( SID_ATTR_PARA_LRSPACE ); - sal_Int64 nVal = OutputDevice::LogicToLogic( maTxtLeft, (MapUnit)(MAP_TWIP), MAP_100TH_MM ); - nVal = OutputDevice::LogicToLogic( (long)nVal, MAP_100TH_MM, (MapUnit)m_eLRSpaceUnit ); + sal_Int64 nVal = OutputDevice::LogicToLogic( maTxtLeft, (MapUnit)(MapUnit::MapTwip), MapUnit::Map100thMM ); + nVal = OutputDevice::LogicToLogic( (long)nVal, MapUnit::Map100thMM, (MapUnit)m_eLRSpaceUnit ); aMargin.SetTextLeft( (const long)nVal ); aMargin.SetRight( (const long)GetCoreValue( *mpRightIndent, m_eLRSpaceUnit ) ); @@ -369,18 +369,18 @@ void ParaPropertyPanel::StateChangedIndentImpl( sal_uInt16 /*nSID*/, SfxItemStat { const SvxLRSpaceItem* pSpace = static_cast<const SvxLRSpaceItem*>(pState); maTxtLeft = pSpace->GetTextLeft(); - maTxtLeft = OutputDevice::LogicToLogic( maTxtLeft, (MapUnit)m_eLRSpaceUnit, MAP_100TH_MM ); - maTxtLeft = OutputDevice::LogicToLogic( maTxtLeft, MAP_100TH_MM, (MapUnit)(MAP_TWIP) ); + maTxtLeft = OutputDevice::LogicToLogic( maTxtLeft, (MapUnit)m_eLRSpaceUnit, MapUnit::Map100thMM ); + maTxtLeft = OutputDevice::LogicToLogic( maTxtLeft, MapUnit::Map100thMM, (MapUnit)(MapUnit::MapTwip) ); long aTxtRight = pSpace->GetRight(); - aTxtRight = OutputDevice::LogicToLogic( aTxtRight, (MapUnit)m_eLRSpaceUnit, MAP_100TH_MM ); - aTxtRight = OutputDevice::LogicToLogic( aTxtRight, MAP_100TH_MM, (MapUnit)(MAP_TWIP) ); + aTxtRight = OutputDevice::LogicToLogic( aTxtRight, (MapUnit)m_eLRSpaceUnit, MapUnit::Map100thMM ); + aTxtRight = OutputDevice::LogicToLogic( aTxtRight, MapUnit::Map100thMM, (MapUnit)(MapUnit::MapTwip) ); long aTxtFirstLineOfst = pSpace->GetTextFirstLineOfst(); - aTxtFirstLineOfst = OutputDevice::LogicToLogic( aTxtFirstLineOfst, (MapUnit)m_eLRSpaceUnit, MAP_100TH_MM ); - aTxtFirstLineOfst = OutputDevice::LogicToLogic( aTxtFirstLineOfst, MAP_100TH_MM, (MapUnit)(MAP_TWIP) ); + aTxtFirstLineOfst = OutputDevice::LogicToLogic( aTxtFirstLineOfst, (MapUnit)m_eLRSpaceUnit, MapUnit::Map100thMM ); + aTxtFirstLineOfst = OutputDevice::LogicToLogic( aTxtFirstLineOfst, MapUnit::Map100thMM, (MapUnit)(MapUnit::MapTwip) ); - long nVal = OutputDevice::LogicToLogic( maTxtLeft, (MapUnit)(MAP_TWIP), MAP_100TH_MM ); + long nVal = OutputDevice::LogicToLogic( maTxtLeft, (MapUnit)(MapUnit::MapTwip), MapUnit::Map100thMM ); nVal = (long)mpLeftIndent->Normalize( (long)nVal ); if ( maContext.GetCombinedContext_DI() != CombinedEnumContext(Application_WriterVariants, Context_Text) @@ -390,7 +390,7 @@ void ParaPropertyPanel::StateChangedIndentImpl( sal_uInt16 /*nSID*/, SfxItemStat mpFLineIndent->SetMin( nVal*(-1), FUNIT_100TH_MM ); } - long nrVal = OutputDevice::LogicToLogic( aTxtRight, (MapUnit)(MAP_TWIP), MAP_100TH_MM ); + long nrVal = OutputDevice::LogicToLogic( aTxtRight, (MapUnit)(MapUnit::MapTwip), MapUnit::Map100thMM ); nrVal = (long)mpRightIndent->Normalize( (long)nrVal ); switch (maContext.GetCombinedContext_DI()) @@ -421,7 +421,7 @@ void ParaPropertyPanel::StateChangedIndentImpl( sal_uInt16 /*nSID*/, SfxItemStat mpLeftIndent->SetValue( nVal, FUNIT_100TH_MM ); mpRightIndent->SetValue( nrVal, FUNIT_100TH_MM ); - long nfVal = OutputDevice::LogicToLogic( aTxtFirstLineOfst, (MapUnit)(MAP_TWIP), MAP_100TH_MM ); + long nfVal = OutputDevice::LogicToLogic( aTxtFirstLineOfst, (MapUnit)(MapUnit::MapTwip), MapUnit::Map100thMM ); nfVal = (long)mpFLineIndent->Normalize( (long)nfVal ); mpFLineIndent->SetValue( nfVal, FUNIT_100TH_MM ); @@ -475,18 +475,18 @@ void ParaPropertyPanel::StateChangedULImpl( sal_uInt16 /*nSID*/, SfxItemState eS const SvxULSpaceItem* pOldItem = static_cast<const SvxULSpaceItem*>(pState); maUpper = pOldItem->GetUpper(); - maUpper = OutputDevice::LogicToLogic( maUpper, (MapUnit)m_eULSpaceUnit, MAP_100TH_MM ); - maUpper = OutputDevice::LogicToLogic( maUpper, MAP_100TH_MM, (MapUnit)(MAP_TWIP) ); + maUpper = OutputDevice::LogicToLogic( maUpper, (MapUnit)m_eULSpaceUnit, MapUnit::Map100thMM ); + maUpper = OutputDevice::LogicToLogic( maUpper, MapUnit::Map100thMM, (MapUnit)(MapUnit::MapTwip) ); maLower = pOldItem->GetLower(); - maLower = OutputDevice::LogicToLogic( maLower, (MapUnit)m_eULSpaceUnit, MAP_100TH_MM ); - maLower = OutputDevice::LogicToLogic( maLower, MAP_100TH_MM, (MapUnit)(MAP_TWIP) ); + maLower = OutputDevice::LogicToLogic( maLower, (MapUnit)m_eULSpaceUnit, MapUnit::Map100thMM ); + maLower = OutputDevice::LogicToLogic( maLower, MapUnit::Map100thMM, (MapUnit)(MapUnit::MapTwip) ); - sal_Int64 nVal = OutputDevice::LogicToLogic( maUpper, (MapUnit)(MAP_TWIP), MAP_100TH_MM ); + sal_Int64 nVal = OutputDevice::LogicToLogic( maUpper, (MapUnit)(MapUnit::MapTwip), MapUnit::Map100thMM ); nVal = mpTopDist->Normalize( nVal ); mpTopDist->SetValue( nVal, FUNIT_100TH_MM ); - nVal = OutputDevice::LogicToLogic( maLower, (MapUnit)(MAP_TWIP), MAP_100TH_MM ); + nVal = OutputDevice::LogicToLogic( maLower, (MapUnit)(MapUnit::MapTwip), MapUnit::Map100thMM ); nVal = mpBottomDist->Normalize( nVal ); mpBottomDist->SetValue( nVal, FUNIT_100TH_MM ); } diff --git a/svx/source/sidebar/paragraph/ParaSpacingWindow.cxx b/svx/source/sidebar/paragraph/ParaSpacingWindow.cxx index 576da6087e28..41a7e45bab1c 100644 --- a/svx/source/sidebar/paragraph/ParaSpacingWindow.cxx +++ b/svx/source/sidebar/paragraph/ParaSpacingWindow.cxx @@ -36,7 +36,7 @@ using namespace svx; ParaULSpacingWindow::ParaULSpacingWindow(vcl::Window* pParent, css::uno::Reference<css::frame::XFrame>& xFrame) : VclVBox(pParent) - , m_eUnit(MAP_TWIP) + , m_eUnit(MapUnit::MapTwip) { m_pUIBuilder = new VclBuilder(this, getUIRootDir(), "svx/ui/paraulspacing.ui", @@ -105,7 +105,7 @@ IMPL_LINK_NOARG(ParaULSpacingWindow, ModifySpacingHdl, Edit&, void) ParaLRSpacingWindow::ParaLRSpacingWindow(vcl::Window* pParent, css::uno::Reference<css::frame::XFrame>& xFrame) : VclVBox(pParent) - , m_eUnit(MAP_TWIP) + , m_eUnit(MapUnit::MapTwip) { m_pUIBuilder = new VclBuilder(this, getUIRootDir(), "svx/ui/paralrspacing.ui", diff --git a/svx/source/sidebar/possize/PosSizePropertyPanel.cxx b/svx/source/sidebar/possize/PosSizePropertyPanel.cxx index 6dc0f9025179..856bef27a3d5 100644 --- a/svx/source/sidebar/possize/PosSizePropertyPanel.cxx +++ b/svx/source/sidebar/possize/PosSizePropertyPanel.cxx @@ -810,14 +810,14 @@ void PosSizePropertyPanel::executeSize() double nWidth = (double)mpMtrWidth->GetValue( meDlgUnit ); nWidth = MetricField::ConvertDoubleValue( nWidth, mpMtrWidth->GetBaseValue(), mpMtrWidth->GetDecimalDigits(), meDlgUnit, FUNIT_100TH_MM ); long lWidth = (long)(nWidth * (double)aUIScale); - lWidth = OutputDevice::LogicToLogic( lWidth, MAP_100TH_MM, (MapUnit)mePoolUnit ); + lWidth = OutputDevice::LogicToLogic( lWidth, MapUnit::Map100thMM, mePoolUnit ); lWidth = (long)mpMtrWidth->Denormalize( lWidth ); // get Height double nHeight = (double)mpMtrHeight->GetValue( meDlgUnit ); nHeight = MetricField::ConvertDoubleValue( nHeight, mpMtrHeight->GetBaseValue(), mpMtrHeight->GetDecimalDigits(), meDlgUnit, FUNIT_100TH_MM ); long lHeight = (long)(nHeight * (double)aUIScale); - lHeight = OutputDevice::LogicToLogic( lHeight, MAP_100TH_MM, (MapUnit)mePoolUnit ); + lHeight = OutputDevice::LogicToLogic( lHeight, MapUnit::Map100thMM, mePoolUnit ); lHeight = (long)mpMtrWidth->Denormalize( lHeight ); // put Width & Height to itemset @@ -1067,8 +1067,8 @@ void PosSizePropertyPanel::SetPosSizeMinMax() TransfrmHelper::ScaleRect( maRect, aUIScale ); const sal_uInt16 nDigits(mpMtrPosX->GetDecimalDigits()); - TransfrmHelper::ConvertRect( maWorkArea, nDigits, (MapUnit) mePoolUnit, meDlgUnit ); - TransfrmHelper::ConvertRect( maRect, nDigits, (MapUnit) mePoolUnit, meDlgUnit ); + TransfrmHelper::ConvertRect( maWorkArea, nDigits, mePoolUnit, meDlgUnit ); + TransfrmHelper::ConvertRect( maRect, nDigits, mePoolUnit, meDlgUnit ); double fLeft(maWorkArea.getMinX()); double fTop(maWorkArea.getMinY()); @@ -1080,7 +1080,7 @@ void PosSizePropertyPanel::SetPosSizeMinMax() fRight -= maRect.getWidth(); fBottom -= maRect.getHeight(); - const double fMaxLong((double)(MetricField::ConvertValue( LONG_MAX, 0, MAP_100TH_MM, meDlgUnit ) - 1L)); + const double fMaxLong((double)(MetricField::ConvertValue( LONG_MAX, 0, MapUnit::Map100thMM, meDlgUnit ) - 1L)); fLeft = basegfx::clamp(fLeft, -fMaxLong, fMaxLong); fRight = basegfx::clamp(fRight, -fMaxLong, fMaxLong); fTop = basegfx::clamp(fTop, - fMaxLong, fMaxLong); diff --git a/svx/source/sidebar/possize/SidebarDialControl.cxx b/svx/source/sidebar/possize/SidebarDialControl.cxx index 8f9db397e023..831fcbca1266 100644 --- a/svx/source/sidebar/possize/SidebarDialControl.cxx +++ b/svx/source/sidebar/possize/SidebarDialControl.cxx @@ -34,7 +34,7 @@ VCL_BUILDER_FACTORY_ARGS(SidebarDialControl, WB_TABSTOP) Size SidebarDialControl::GetOptimalSize() const { - return LogicToPixel(Size(10, 10), MAP_APPFONT); + return LogicToPixel(Size(10, 10), MapUnit::MapAppFont); } void SidebarDialControl::MouseButtonDown( const MouseEvent& rMEvt ) diff --git a/svx/source/sidebar/text/TextCharacterSpacingControl.cxx b/svx/source/sidebar/text/TextCharacterSpacingControl.cxx index 5005f59c873a..3275033926d0 100644 --- a/svx/source/sidebar/text/TextCharacterSpacingControl.cxx +++ b/svx/source/sidebar/text/TextCharacterSpacingControl.cxx @@ -127,7 +127,7 @@ void TextCharacterSpacingControl::Initialize() { MapUnit eUnit = GetCoreMetric(); MapUnit eOrgUnit = (MapUnit)eUnit; - MapUnit ePntUnit(MAP_POINT); + MapUnit ePntUnit(MapUnit::MapPoint); long nBig = maEditKerning->Normalize(nKerning); nKerning = LogicToLogic(nBig, eOrgUnit, ePntUnit); maEditKerning->SetValue(nKerning); @@ -151,7 +151,7 @@ void TextCharacterSpacingControl::ExecuteCharacterSpacing(long nValue, bool bClo long nSign = (nValue < 0) ? -1 : 1; nValue = nValue * nSign; - long nVal = LogicToLogic(nValue, MAP_POINT, (MapUnit)eUnit); + long nVal = LogicToLogic(nValue, MapUnit::MapPoint, (MapUnit)eUnit); short nKern = (nValue == 0) ? 0 : (short)maEditKerning->Denormalize(nVal); SvxKerningItem aKernItem(nSign * nKern, SID_ATTR_CHAR_KERNING); diff --git a/svx/source/svdraw/svddrgmt.cxx b/svx/source/svdraw/svddrgmt.cxx index 6dde7207ca34..5c235813ced1 100644 --- a/svx/source/svdraw/svddrgmt.cxx +++ b/svx/source/svdraw/svddrgmt.cxx @@ -3779,10 +3779,10 @@ bool SdrDragCrop::EndSdrDrag(bool /*bCopy*/) return false; const GraphicObject& rGraphicObject = pObj->GetGraphicObject(); - const MapMode aMapMode100thmm(MAP_100TH_MM); + const MapMode aMapMode100thmm(MapUnit::Map100thMM); Size aGraphicSize(rGraphicObject.GetPrefSize()); - if( MAP_PIXEL == rGraphicObject.GetPrefMapMode().GetMapUnit() ) + if( MapUnit::MapPixel == rGraphicObject.GetPrefMapMode().GetMapUnit() ) aGraphicSize = Application::GetDefaultDevice()->PixelToLogic( aGraphicSize, aMapMode100thmm ); else aGraphicSize = OutputDevice::LogicToLogic( aGraphicSize, rGraphicObject.GetPrefMapMode(), aMapMode100thmm); diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx index 3876de9157f7..f8e7c727fe52 100644 --- a/svx/source/svdraw/svdedxv.cxx +++ b/svx/source/svdraw/svdedxv.cxx @@ -1337,7 +1337,7 @@ bool SdrObjEditView::IsTextEditHit(const Point& rHit) const long nHitTol = 2000; OutputDevice* pRef = pTextEditOutliner->GetRefDevice(); if( pRef ) - nHitTol = OutputDevice::LogicToLogic( nHitTol, MAP_100TH_MM, pRef->GetMapMode().GetMapUnit() ); + nHitTol = OutputDevice::LogicToLogic( nHitTol, MapUnit::Map100thMM, pRef->GetMapMode().GetMapUnit() ); bOk = pTextEditOutliner->IsTextPos( aPnt, (sal_uInt16)nHitTol ); } diff --git a/svx/source/svdraw/svdibrow.cxx b/svx/source/svdraw/svdibrow.cxx index c006538f6ab4..d3152c536893 100644 --- a/svx/source/svdraw/svdibrow.cxx +++ b/svx/source/svdraw/svdibrow.cxx @@ -1005,7 +1005,7 @@ void SdrItemBrowserControl::SetAttributes(const SfxItemSet* pSet, const SfxItemS rItem.GetPresentation(SfxItemPresentation::Nameless, pPool->GetMetric(nWhich), - MAP_MM, aEntry.aValue); + MapUnit::MapMM, aEntry.aValue); if (aEntry.bCanNum) { aEntry.aValue = OUString::number(aEntry.nVal) + ": " + aEntry.aValue; diff --git a/svx/source/svdraw/svdmodel.cxx b/svx/source/svdraw/svdmodel.cxx index 4bfb71beba97..dab3a8659519 100644 --- a/svx/source/svdraw/svdmodel.cxx +++ b/svx/source/svdraw/svdmodel.cxx @@ -937,20 +937,20 @@ void SdrModel::ImpSetUIUnit() // normalize on meters resp. inch switch (eObjUnit) { - case MAP_100TH_MM : nUIUnitKomma+=5; break; - case MAP_10TH_MM : nUIUnitKomma+=4; break; - case MAP_MM : nUIUnitKomma+=3; break; - case MAP_CM : nUIUnitKomma+=2; break; - case MAP_1000TH_INCH: nUIUnitKomma+=3; break; - case MAP_100TH_INCH : nUIUnitKomma+=2; break; - case MAP_10TH_INCH : nUIUnitKomma+=1; break; - case MAP_INCH : nUIUnitKomma+=0; break; - case MAP_POINT : nDiv=72; break; // 1Pt = 1/72" - case MAP_TWIP : nDiv=144; nUIUnitKomma++; break; // 1Twip = 1/1440" - case MAP_PIXEL : break; - case MAP_SYSFONT : break; - case MAP_APPFONT : break; - case MAP_RELATIVE : break; + case MapUnit::Map100thMM : nUIUnitKomma+=5; break; + case MapUnit::Map10thMM : nUIUnitKomma+=4; break; + case MapUnit::MapMM : nUIUnitKomma+=3; break; + case MapUnit::MapCM : nUIUnitKomma+=2; break; + case MapUnit::Map1000thInch: nUIUnitKomma+=3; break; + case MapUnit::Map100thInch : nUIUnitKomma+=2; break; + case MapUnit::Map10thInch : nUIUnitKomma+=1; break; + case MapUnit::MapInch : nUIUnitKomma+=0; break; + case MapUnit::MapPoint : nDiv=72; break; // 1Pt = 1/72" + case MapUnit::MapTwip : nDiv=144; nUIUnitKomma++; break; // 1Twip = 1/1440" + case MapUnit::MapPixel : break; + case MapUnit::MapSysFont : break; + case MapUnit::MapAppFont : break; + case MapUnit::MapRelative : break; default: break; } // switch diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx index 383c51fc967d..8e618690cb0b 100644 --- a/svx/source/svdraw/svdmrkv.cxx +++ b/svx/source/svdraw/svdmrkv.cxx @@ -219,8 +219,8 @@ void SdrMarkView::ModelHasChanged() { if (OutputDevice* pOutputDevice = mpMarkedPV->GetView().GetFirstOutputDevice()) { - if (pOutputDevice->GetMapMode().GetMapUnit() == MAP_100TH_MM) - aSelection = OutputDevice::LogicToLogic(aSelection, MAP_100TH_MM, MAP_TWIP); + if (pOutputDevice->GetMapMode().GetMapUnit() == MapUnit::Map100thMM) + aSelection = OutputDevice::LogicToLogic(aSelection, MapUnit::Map100thMM, MapUnit::MapTwip); } } @@ -753,8 +753,8 @@ void SdrMarkView::SetMarkHandles(SfxViewShell* pOtherShell) { if (OutputDevice* pOutputDevice = mpMarkedPV->GetView().GetFirstOutputDevice()) { - if (pOutputDevice->GetMapMode().GetMapUnit() == MAP_100TH_MM) - aSelection = OutputDevice::LogicToLogic(aSelection, MAP_100TH_MM, MAP_TWIP); + if (pOutputDevice->GetMapMode().GetMapUnit() == MapUnit::Map100thMM) + aSelection = OutputDevice::LogicToLogic(aSelection, MapUnit::Map100thMM, MapUnit::MapTwip); } } diff --git a/svx/source/svdraw/svdoashp.cxx b/svx/source/svdraw/svdoashp.cxx index ea37cf640e4d..52545fbcd768 100644 --- a/svx/source/svdraw/svdoashp.cxx +++ b/svx/source/svdraw/svdoashp.cxx @@ -2970,11 +2970,11 @@ void SdrObjCustomShape::TRSetBaseGeometry(const basegfx::B2DHomMatrix& rMatrix, // force metric to pool metric const MapUnit eMapUnit(GetObjectMapUnit()); - if(eMapUnit != MAP_100TH_MM) + if(eMapUnit != MapUnit::Map100thMM) { switch(eMapUnit) { - case MAP_TWIP : + case MapUnit::MapTwip : { // position aTranslate.setX(ImplMMToTwips(aTranslate.getX())); @@ -3122,11 +3122,11 @@ bool SdrObjCustomShape::TRGetBaseGeometry(basegfx::B2DHomMatrix& rMatrix, basegf // force MapUnit to 100th mm const MapUnit eMapUnit(GetObjectMapUnit()); - if(eMapUnit != MAP_100TH_MM) + if(eMapUnit != MapUnit::Map100thMM) { switch(eMapUnit) { - case MAP_TWIP : + case MapUnit::MapTwip : { // position aTranslate.setX(ImplTwipsToMM(aTranslate.getX())); diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx index 669689451666..f440b121d537 100644 --- a/svx/source/svdraw/svdobj.cxx +++ b/svx/source/svdraw/svdobj.cxx @@ -2958,11 +2958,11 @@ bool SdrObject::TRGetBaseGeometry(basegfx::B2DHomMatrix& rMatrix, basegfx::B2DPo // force MapUnit to 100th mm const MapUnit eMapUnit(GetObjectMapUnit()); - if(eMapUnit != MAP_100TH_MM) + if(eMapUnit != MapUnit::Map100thMM) { switch(eMapUnit) { - case MAP_TWIP : + case MapUnit::MapTwip : { // position aTranslate.setX(ImplTwipsToMM(aTranslate.getX())); @@ -3008,11 +3008,11 @@ void SdrObject::TRSetBaseGeometry(const basegfx::B2DHomMatrix& rMatrix, const ba // force metric to pool metric const MapUnit eMapUnit(GetObjectMapUnit()); - if(eMapUnit != MAP_100TH_MM) + if(eMapUnit != MapUnit::Map100thMM) { switch(eMapUnit) { - case MAP_TWIP : + case MapUnit::MapTwip : { // position aTranslate.setX(ImplMMToTwips(aTranslate.getX())); diff --git a/svx/source/svdraw/svdocapt.cxx b/svx/source/svdraw/svdocapt.cxx index bc917815586c..15e3dfe649fd 100644 --- a/svx/source/svdraw/svdocapt.cxx +++ b/svx/source/svdraw/svdocapt.cxx @@ -774,11 +774,11 @@ void SdrCaptionObj::TRSetBaseGeometry(const basegfx::B2DHomMatrix& rMatrix, cons // force metric to pool metric MapUnit eMapUnit = pModel->GetItemPool().GetMetric(0); - if(eMapUnit != MAP_100TH_MM) + if(eMapUnit != MapUnit::Map100thMM) { switch(eMapUnit) { - case MAP_TWIP : + case MapUnit::MapTwip : { // position aTranslate.setX(ImplMMToTwips(aTranslate.getX())); diff --git a/svx/source/svdraw/svdograf.cxx b/svx/source/svdraw/svdograf.cxx index 602ec30b3d65..766083354c77 100644 --- a/svx/source/svdraw/svdograf.cxx +++ b/svx/source/svdraw/svdograf.cxx @@ -584,7 +584,7 @@ Size SdrGrafObj::getOriginalSize() const aSize = Size ( aCroppedWidth, aCroppedHeight); } - if ( GetGrafPrefMapMode().GetMapUnit() == MAP_PIXEL ) + if ( GetGrafPrefMapMode().GetMapUnit() == MapUnit::MapPixel ) aSize = Application::GetDefaultDevice()->PixelToLogic( aSize, GetModel()->GetScaleUnit() ); else aSize = OutputDevice::LogicToLogic( aSize, GetGrafPrefMapMode(), GetModel()->GetScaleUnit() ); @@ -1243,12 +1243,12 @@ void SdrGrafObj::AdjustToMaxRect( const Rectangle& rMaxRect, bool bShrinkOnly ) { Size aSize; Size aMaxSize( rMaxRect.GetSize() ); - if ( pGraphic->GetPrefMapMode().GetMapUnit() == MAP_PIXEL ) - aSize = Application::GetDefaultDevice()->PixelToLogic( pGraphic->GetPrefSize(), MAP_100TH_MM ); + if ( pGraphic->GetPrefMapMode().GetMapUnit() == MapUnit::MapPixel ) + aSize = Application::GetDefaultDevice()->PixelToLogic( pGraphic->GetPrefSize(), MapUnit::Map100thMM ); else aSize = OutputDevice::LogicToLogic( pGraphic->GetPrefSize(), pGraphic->GetPrefMapMode(), - MapMode( MAP_100TH_MM ) ); + MapMode( MapUnit::Map100thMM ) ); if( aSize.Height() != 0 && aSize.Width() != 0 ) { diff --git a/svx/source/svdraw/svdomeas.cxx b/svx/source/svdraw/svdomeas.cxx index dcfda7e93744..286e6088fdf8 100644 --- a/svx/source/svdraw/svdomeas.cxx +++ b/svx/source/svdraw/svdomeas.cxx @@ -1391,11 +1391,11 @@ bool SdrMeasureObj::TRGetBaseGeometry(basegfx::B2DHomMatrix& rMatrix, basegfx::B // force MapUnit to 100th mm MapUnit eMapUnit = pModel->GetItemPool().GetMetric(0); - if(eMapUnit != MAP_100TH_MM) + if(eMapUnit != MapUnit::Map100thMM) { switch(eMapUnit) { - case MAP_TWIP : + case MapUnit::MapTwip : { // position aTranslate.setX(ImplTwipsToMM(aTranslate.getX())); @@ -1428,11 +1428,11 @@ void SdrMeasureObj::TRSetBaseGeometry(const basegfx::B2DHomMatrix& rMatrix, cons // force metric to pool metric MapUnit eMapUnit = pModel->GetItemPool().GetMetric(0); - if(eMapUnit != MAP_100TH_MM) + if(eMapUnit != MapUnit::Map100thMM) { switch(eMapUnit) { - case MAP_TWIP : + case MapUnit::MapTwip : { // position aPosA.setX(ImplMMToTwips(aPosA.getX())); diff --git a/svx/source/svdraw/svdomedia.cxx b/svx/source/svdraw/svdomedia.cxx index ada1c4aaa57f..7a55d02b49e4 100644 --- a/svx/source/svdraw/svdomedia.cxx +++ b/svx/source/svdraw/svdomedia.cxx @@ -184,7 +184,7 @@ const uno::Reference< graphic::XGraphic > SdrMediaObj::getSnapshot() const void SdrMediaObj::AdjustToMaxRect( const Rectangle& rMaxRect, bool bShrinkOnly /* = false */ ) { - Size aSize( Application::GetDefaultDevice()->PixelToLogic( getPreferredSize(), MAP_100TH_MM ) ); + Size aSize( Application::GetDefaultDevice()->PixelToLogic( getPreferredSize(), MapUnit::Map100thMM ) ); Size aMaxSize( rMaxRect.GetSize() ); if( aSize.Height() != 0 && aSize.Width() != 0 ) diff --git a/svx/source/svdraw/svdoole2.cxx b/svx/source/svdraw/svdoole2.cxx index 2c9bdca4c8d1..6e6609164b75 100644 --- a/svx/source/svdraw/svdoole2.cxx +++ b/svx/source/svdraw/svdoole2.cxx @@ -227,7 +227,7 @@ void SAL_CALL SdrLightEmbeddedClient_Impl::notifyEvent( const document::EventObj { try { - MapUnit aContainerMapUnit( MAP_100TH_MM ); + MapUnit aContainerMapUnit( MapUnit::Map100thMM ); uno::Reference< embed::XVisualObject > xParentVis( mpObj->GetParentXModel(), uno::UNO_QUERY ); if ( xParentVis.is() ) aContainerMapUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( xParentVis->getMapUnit( mpObj->GetAspect() ) ); @@ -462,7 +462,7 @@ awt::Rectangle SAL_CALL SdrLightEmbeddedClient_Impl::getPlacement() throw uno::RuntimeException(); Rectangle aLogicRect = impl_getScaledRect_nothrow(); - MapUnit aContainerMapUnit( MAP_100TH_MM ); + MapUnit aContainerMapUnit( MapUnit::Map100thMM ); uno::Reference< embed::XVisualObject > xParentVis( mpObj->GetParentXModel(), uno::UNO_QUERY ); if ( xParentVis.is() ) aContainerMapUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( xParentVis->getMapUnit( mpObj->GetAspect() ) ); @@ -512,7 +512,7 @@ void SAL_CALL SdrLightEmbeddedClient_Impl::changedPlacement( const awt::Rectangl return; // new scaled object area - MapUnit aContainerMapUnit( MAP_100TH_MM ); + MapUnit aContainerMapUnit( MapUnit::Map100thMM ); uno::Reference< embed::XVisualObject > xParentVis( mpObj->GetParentXModel(), uno::UNO_QUERY ); if ( xParentVis.is() ) aContainerMapUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( xParentVis->getMapUnit( mpObj->GetAspect() ) ); diff --git a/svx/source/svdraw/svdopath.cxx b/svx/source/svdraw/svdopath.cxx index 0f6071dde53d..f91413b00426 100644 --- a/svx/source/svdraw/svdopath.cxx +++ b/svx/source/svdraw/svdopath.cxx @@ -2946,11 +2946,11 @@ bool SdrPathObj::TRGetBaseGeometry(basegfx::B2DHomMatrix& rMatrix, basegfx::B2DP // force MapUnit to 100th mm const MapUnit eMapUnit(GetObjectMapUnit()); - if(eMapUnit != MAP_100TH_MM) + if(eMapUnit != MapUnit::Map100thMM) { switch(eMapUnit) { - case MAP_TWIP : + case MapUnit::MapTwip : { // position aTranslate.setX(ImplTwipsToMM(aTranslate.getX())); @@ -3016,11 +3016,11 @@ void SdrPathObj::TRSetBaseGeometry(const basegfx::B2DHomMatrix& rMatrix, const b // force metric to pool metric const MapUnit eMapUnit(GetObjectMapUnit()); - if(eMapUnit != MAP_100TH_MM) + if(eMapUnit != MapUnit::Map100thMM) { switch(eMapUnit) { - case MAP_TWIP : + case MapUnit::MapTwip : { // position aTranslate.setX(ImplMMToTwips(aTranslate.getX())); diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx index 8bf65851dacf..2b7774006df9 100644 --- a/svx/source/svdraw/svdotext.cxx +++ b/svx/source/svdraw/svdotext.cxx @@ -1631,11 +1631,11 @@ bool SdrTextObj::TRGetBaseGeometry(basegfx::B2DHomMatrix& rMatrix, basegfx::B2DP // force MapUnit to 100th mm const MapUnit eMapUnit(GetObjectMapUnit()); - if(eMapUnit != MAP_100TH_MM) + if(eMapUnit != MapUnit::Map100thMM) { switch(eMapUnit) { - case MAP_TWIP : + case MapUnit::MapTwip : { // position aTranslate.setX(ImplTwipsToMM(aTranslate.getX())); @@ -1696,11 +1696,11 @@ void SdrTextObj::TRSetBaseGeometry(const basegfx::B2DHomMatrix& rMatrix, const b // force metric to pool metric const MapUnit eMapUnit(GetObjectMapUnit()); - if(eMapUnit != MAP_100TH_MM) + if(eMapUnit != MapUnit::Map100thMM) { switch(eMapUnit) { - case MAP_TWIP : + case MapUnit::MapTwip : { // position aTranslate.setX(ImplMMToTwips(aTranslate.getX())); diff --git a/svx/source/svdraw/svdtrans.cxx b/svx/source/svdraw/svdtrans.cxx index 554731b220be..5b18a2b3cd24 100644 --- a/svx/source/svdraw/svdtrans.cxx +++ b/svx/source/svdraw/svdtrans.cxx @@ -575,27 +575,27 @@ long BigMulDiv(long nVal, long nMul, long nDiv) FrPair GetInchOrMM(MapUnit eU) { switch (eU) { - case MAP_1000TH_INCH: return FrPair(1000,1); - case MAP_100TH_INCH : return FrPair( 100,1); - case MAP_10TH_INCH : return FrPair( 10,1); - case MAP_INCH : return FrPair( 1,1); - case MAP_POINT : return FrPair( 72,1); - case MAP_TWIP : return FrPair(1440,1); - case MAP_100TH_MM : return FrPair( 100,1); - case MAP_10TH_MM : return FrPair( 10,1); - case MAP_MM : return FrPair( 1,1); - case MAP_CM : return FrPair( 1,10); - case MAP_PIXEL : { + case MapUnit::Map1000thInch: return FrPair(1000,1); + case MapUnit::Map100thInch : return FrPair( 100,1); + case MapUnit::Map10thInch : return FrPair( 10,1); + case MapUnit::MapInch : return FrPair( 1,1); + case MapUnit::MapPoint : return FrPair( 72,1); + case MapUnit::MapTwip : return FrPair(1440,1); + case MapUnit::Map100thMM : return FrPair( 100,1); + case MapUnit::Map10thMM : return FrPair( 10,1); + case MapUnit::MapMM : return FrPair( 1,1); + case MapUnit::MapCM : return FrPair( 1,10); + case MapUnit::MapPixel : { ScopedVclPtrInstance< VirtualDevice > pVD; - pVD->SetMapMode(MapMode(MAP_100TH_MM)); + pVD->SetMapMode(MapMode(MapUnit::Map100thMM)); Point aP(pVD->PixelToLogic(Point(64,64))); // 64 pixels for more accuracy return FrPair(6400,aP.X(),6400,aP.Y()); } - case MAP_APPFONT: case MAP_SYSFONT: { + case MapUnit::MapAppFont: case MapUnit::MapSysFont: { ScopedVclPtrInstance< VirtualDevice > pVD; pVD->SetMapMode(MapMode(eU)); Point aP(pVD->LogicToPixel(Point(32,32))); // 32 units for more accuracy - pVD->SetMapMode(MapMode(MAP_100TH_MM)); + pVD->SetMapMode(MapMode(MapUnit::Map100thMM)); aP=pVD->PixelToLogic(aP); return FrPair(3200,aP.X(),3200,aP.Y()); } @@ -667,22 +667,22 @@ void GetMeterOrInch(MapUnit eMU, short& rnKomma, long& rnMul, long& rnDiv, bool& bool bMetr = false, bInch = false; switch (eMU) { // Metrisch - case MAP_100TH_MM : bMetr = true; nKomma=5; break; - case MAP_10TH_MM : bMetr = true; nKomma=4; break; - case MAP_MM : bMetr = true; nKomma=3; break; - case MAP_CM : bMetr = true; nKomma=2; break; + case MapUnit::Map100thMM : bMetr = true; nKomma=5; break; + case MapUnit::Map10thMM : bMetr = true; nKomma=4; break; + case MapUnit::MapMM : bMetr = true; nKomma=3; break; + case MapUnit::MapCM : bMetr = true; nKomma=2; break; // Inch - case MAP_1000TH_INCH: bInch = true; nKomma=3; break; - case MAP_100TH_INCH : bInch = true; nKomma=2; break; - case MAP_10TH_INCH : bInch = true; nKomma=1; break; - case MAP_INCH : bInch = true; nKomma=0; break; - case MAP_POINT : bInch = true; rnDiv=72; break; // 1Pt = 1/72" - case MAP_TWIP : bInch = true; rnDiv=144; nKomma=1; break; // 1Twip = 1/1440" + case MapUnit::Map1000thInch: bInch = true; nKomma=3; break; + case MapUnit::Map100thInch : bInch = true; nKomma=2; break; + case MapUnit::Map10thInch : bInch = true; nKomma=1; break; + case MapUnit::MapInch : bInch = true; nKomma=0; break; + case MapUnit::MapPoint : bInch = true; rnDiv=72; break; // 1Pt = 1/72" + case MapUnit::MapTwip : bInch = true; rnDiv=144; nKomma=1; break; // 1Twip = 1/1440" // Sonstiges - case MAP_PIXEL : break; - case MAP_SYSFONT : break; - case MAP_APPFONT : break; - case MAP_RELATIVE : break; + case MapUnit::MapPixel : break; + case MapUnit::MapSysFont : break; + case MapUnit::MapAppFont : break; + case MapUnit::MapRelative : break; default: break; } // switch rnKomma=nKomma; @@ -840,76 +840,76 @@ void SdrFormatter::TakeUnitStr(MapUnit eUnit, OUString& rStr) switch(eUnit) { // metrically - case MAP_100TH_MM : + case MapUnit::Map100thMM : { rStr = "/100mm"; break; } - case MAP_10TH_MM : + case MapUnit::Map10thMM : { rStr = "/10mm"; break; } - case MAP_MM : + case MapUnit::MapMM : { rStr = "mm"; break; } - case MAP_CM : + case MapUnit::MapCM : { rStr = "cm"; break; } // Inch - case MAP_1000TH_INCH: + case MapUnit::Map1000thInch: { rStr = "/1000\""; break; } - case MAP_100TH_INCH : + case MapUnit::Map100thInch : { rStr = "/100\""; break; } - case MAP_10TH_INCH : + case MapUnit::Map10thInch : { rStr = "/10\""; break; } - case MAP_INCH : + case MapUnit::MapInch : { rStr = "\""; break; } - case MAP_POINT : + case MapUnit::MapPoint : { rStr = "pt"; break; } - case MAP_TWIP : + case MapUnit::MapTwip : { rStr = "twip"; break; } // others - case MAP_PIXEL : + case MapUnit::MapPixel : { rStr = "pixel"; break; } - case MAP_SYSFONT : + case MapUnit::MapSysFont : { rStr = "sysfont"; break; } - case MAP_APPFONT : + case MapUnit::MapAppFont : { rStr = "appfont"; break; } - case MAP_RELATIVE : + case MapUnit::MapRelative : { rStr = "%"; break; diff --git a/svx/source/table/tablecontroller.cxx b/svx/source/table/tablecontroller.cxx index 83a4d99067a4..db9501b3ede3 100644 --- a/svx/source/table/tablecontroller.cxx +++ b/svx/source/table/tablecontroller.cxx @@ -2115,11 +2115,11 @@ void SvxTableController::updateSelectionOverlay() Rectangle aSelectionEnd(aEndRect.Right(), aEndRect.Top(), aEndRect.Right(), aEndRect.Bottom()); Rectangle aSelection(a2DRange.getMinX(), a2DRange.getMinY(), a2DRange.getMaxX(), a2DRange.getMaxY()); - if (pOutDev->GetMapMode().GetMapUnit() == MAP_100TH_MM) + if (pOutDev->GetMapMode().GetMapUnit() == MapUnit::Map100thMM) { - aSelectionStart = OutputDevice::LogicToLogic(aSelectionStart, MAP_100TH_MM, MAP_TWIP); - aSelectionEnd = OutputDevice::LogicToLogic(aSelectionEnd, MAP_100TH_MM, MAP_TWIP); - aSelection = OutputDevice::LogicToLogic(aSelection, MAP_100TH_MM, MAP_TWIP); + aSelectionStart = OutputDevice::LogicToLogic(aSelectionStart, MapUnit::Map100thMM, MapUnit::MapTwip); + aSelectionEnd = OutputDevice::LogicToLogic(aSelectionEnd, MapUnit::Map100thMM, MapUnit::MapTwip); + aSelection = OutputDevice::LogicToLogic(aSelection, MapUnit::Map100thMM, MapUnit::MapTwip); } if(SfxViewShell* pViewShell = SfxViewShell::Current()) diff --git a/svx/source/table/tablertfexporter.cxx b/svx/source/table/tablertfexporter.cxx index 7806c9d47249..eb5d9271d7e0 100644 --- a/svx/source/table/tablertfexporter.cxx +++ b/svx/source/table/tablertfexporter.cxx @@ -79,7 +79,7 @@ SdrTableRtfExporter::SdrTableRtfExporter( SvStream& rStrm, SdrTableObj& rObj ) long HundMMToTwips( long nIn ) { - long nRet = OutputDevice::LogicToLogic( nIn, MAP_100TH_MM, MAP_TWIP ); + long nRet = OutputDevice::LogicToLogic( nIn, MapUnit::Map100thMM, MapUnit::MapTwip ); return nRet; } diff --git a/svx/source/table/tablertfimporter.cxx b/svx/source/table/tablertfimporter.cxx index 22186a1a2aee..3dc19aec3b41 100644 --- a/svx/source/table/tablertfimporter.cxx +++ b/svx/source/table/tablertfimporter.cxx @@ -320,7 +320,7 @@ void SdrTableRTFParser::NextColumn() long TwipsToHundMM( long nIn ) { - long nRet = OutputDevice::LogicToLogic( nIn, MAP_TWIP, MAP_100TH_MM ); + long nRet = OutputDevice::LogicToLogic( nIn, MapUnit::MapTwip, MapUnit::Map100thMM ); return nRet; } diff --git a/svx/source/tbxctrls/bulletsnumbering.cxx b/svx/source/tbxctrls/bulletsnumbering.cxx index 847d4022276d..9ac5972e3f4d 100644 --- a/svx/source/tbxctrls/bulletsnumbering.cxx +++ b/svx/source/tbxctrls/bulletsnumbering.cxx @@ -103,7 +103,7 @@ NumberingPopup::NumberingPopup( NumberingToolBoxControl& rController, } } - Size aItemSize( LogicToPixel( Size( 30, 42 ), MAP_APPFONT ) ); + Size aItemSize( LogicToPixel( Size( 30, 42 ), MapUnit::MapAppFont ) ); mpValueSet->SetExtraSpacing( 2 ); mpValueSet->SetOutputSizePixel( mpValueSet->CalcWindowSizePixel( aItemSize ) ); mpValueSet->SetColor( GetSettings().GetStyleSettings().GetFieldColor() ); diff --git a/svx/source/tbxctrls/colrctrl.cxx b/svx/source/tbxctrls/colrctrl.cxx index 61ecfa9f7ece..72b3ccbe0d57 100644 --- a/svx/source/tbxctrls/colrctrl.cxx +++ b/svx/source/tbxctrls/colrctrl.cxx @@ -190,13 +190,13 @@ SvxColorDockingWindow::SvxColorDockingWindow nCount ( 0 ) { SetText(SVX_RESSTR(STR_COLORTABLE)); - SetSizePixel(LogicToPixel(Size(150, 22), MapMode(MAP_APPFONT))); + SetSizePixel(LogicToPixel(Size(150, 22), MapMode(MapUnit::MapAppFont))); SetHelpId(HID_CTRL_COLOR); aColorSet->SetSelectHdl( LINK( this, SvxColorDockingWindow, SelectHdl ) ); aColorSet->SetHelpId(HID_COLOR_CTL_COLORS); - aColorSet->SetPosSizePixel(LogicToPixel(Point(2, 2), MapMode(MAP_APPFONT)), - LogicToPixel(Size(146, 18), MapMode(MAP_APPFONT))); + aColorSet->SetPosSizePixel(LogicToPixel(Point(2, 2), MapMode(MapUnit::MapAppFont)), + LogicToPixel(Size(146, 18), MapMode(MapUnit::MapAppFont))); // Get the model from the view shell. Using SfxObjectShell::Current() // is unreliable when called at the wrong times. diff --git a/svx/source/tbxctrls/fillctrl.cxx b/svx/source/tbxctrls/fillctrl.cxx index f29663067f81..bbbaf61f47ff 100644 --- a/svx/source/tbxctrls/fillctrl.cxx +++ b/svx/source/tbxctrls/fillctrl.cxx @@ -890,7 +890,7 @@ void FillControl::Resize() void FillControl::SetOptimalSize() { const Size aLogicalAttrSize(50,0); - Size aSize(LogicToPixel(aLogicalAttrSize,MAP_APPFONT)); + Size aSize(LogicToPixel(aLogicalAttrSize,MapUnit::MapAppFont)); Point aAttrPnt = mpLbFillAttr->GetPosPixel(); diff --git a/svx/source/tbxctrls/fontworkgallery.cxx b/svx/source/tbxctrls/fontworkgallery.cxx index 5400cea008c6..0ee971dd8865 100644 --- a/svx/source/tbxctrls/fontworkgallery.cxx +++ b/svx/source/tbxctrls/fontworkgallery.cxx @@ -76,7 +76,7 @@ FontWorkGalleryDialog::FontWorkGalleryDialog( SdrView* pSdrView, vcl::Window* pP { get(mpOKButton, "ok"); get(mpCtlFavorites, "ctlFavorites"); - Size aSize(LogicToPixel(Size(200, 200), MAP_APPFONT)); + Size aSize(LogicToPixel(Size(200, 200), MapUnit::MapAppFont)); mpCtlFavorites->set_width_request(aSize.Width()); mpCtlFavorites->set_height_request(aSize.Height()); diff --git a/svx/source/tbxctrls/grafctrl.cxx b/svx/source/tbxctrls/grafctrl.cxx index ed7e047b5c2c..22cc91850634 100644 --- a/svx/source/tbxctrls/grafctrl.cxx +++ b/svx/source/tbxctrls/grafctrl.cxx @@ -672,11 +672,11 @@ void SvxGrafAttrHelper::ExecuteGrafAttr( SfxRequest& rReq, SdrView& rView ) { SfxItemSet aGrfAttr( rPool, SDRATTR_GRAFCROP, SDRATTR_GRAFCROP, 0 ); const MapUnit eOldMetric = rPool.GetMetric( 0 ); - const MapMode aMap100( MAP_100TH_MM ); - const MapMode aMapTwip( MAP_TWIP ); + const MapMode aMap100( MapUnit::Map100thMM ); + const MapMode aMapTwip( MapUnit::MapTwip ); aGrfAttr.Put(pObj->GetMergedItemSet()); - rPool.SetDefaultMetric( MAP_TWIP ); + rPool.SetDefaultMetric( MapUnit::MapTwip ); SfxItemSet aCropDlgAttr( rPool, SDRATTR_GRAFCROP, SDRATTR_GRAFCROP, diff --git a/svx/source/tbxctrls/itemwin.cxx b/svx/source/tbxctrls/itemwin.cxx index 1b7da6d23514..0aa0942a5bf1 100644 --- a/svx/source/tbxctrls/itemwin.cxx +++ b/svx/source/tbxctrls/itemwin.cxx @@ -60,7 +60,7 @@ SvxLineBox::SvxLineBox( vcl::Window* pParent, const Reference< XFrame >& rFrame mpSh ( nullptr ), mxFrame ( rFrame ) { - SetSizePixel( LogicToPixel( aLogicalSize, MAP_APPFONT )); + SetSizePixel( LogicToPixel( aLogicalSize, MapUnit::MapAppFont )); Show(); aDelayTimer.SetTimeout( DELAY_TIMEOUT ); @@ -221,7 +221,7 @@ void SvxLineBox::DataChanged( const DataChangedEvent& rDCEvt ) if ( (rDCEvt.GetType() == DataChangedEventType::SETTINGS) && (rDCEvt.GetFlags() & AllSettingsFlags::STYLE) ) { - SetSizePixel(LogicToPixel(aLogicalSize, MAP_APPFONT)); + SetSizePixel(LogicToPixel(aLogicalSize, MapUnit::MapAppFont)); } LineLB::DataChanged( rDCEvt ); @@ -245,14 +245,14 @@ SvxMetricField::SvxMetricField( vcl::Window* pParent, const Reference< XFrame >& rFrame, WinBits nBits ) : MetricField(pParent, nBits) , aCurTxt() - , ePoolUnit(MAP_CM) + , ePoolUnit(MapUnit::MapCM) , mxFrame(rFrame) { Size aSize(GetTextWidth( "99,99mm" ),GetTextHeight()); aSize.Width() += 20; aSize.Height() += 6; SetSizePixel( aSize ); - aLogicalSize = PixelToLogic(aSize, MAP_APPFONT); + aLogicalSize = PixelToLogic(aSize, MapUnit::MapAppFont); SetUnit( FUNIT_MM ); SetDecimalDigits( 2 ); SetMax( 5000 ); @@ -376,7 +376,7 @@ void SvxMetricField::DataChanged( const DataChangedEvent& rDCEvt ) if ( (rDCEvt.GetType() == DataChangedEventType::SETTINGS) && (rDCEvt.GetFlags() & AllSettingsFlags::STYLE) ) { - SetSizePixel(LogicToPixel(aLogicalSize, MAP_APPFONT)); + SetSizePixel(LogicToPixel(aLogicalSize, MapUnit::MapAppFont)); } MetricField::DataChanged( rDCEvt ); @@ -388,7 +388,7 @@ SvxFillTypeBox::SvxFillTypeBox( vcl::Window* pParent ) : bSelect ( false ), bRelease( true ) { - SetSizePixel( LogicToPixel( Size(40, 40 ),MAP_APPFONT )); + SetSizePixel( LogicToPixel( Size(40, 40 ),MapUnit::MapAppFont )); Fill(); SelectEntryPos( drawing::FillStyle_SOLID ); Show(); @@ -470,7 +470,7 @@ SvxFillAttrBox::SvxFillAttrBox( vcl::Window* pParent ) : { SetPosPixel( Point( 90, 0 ) ); - SetSizePixel( LogicToPixel( Size(50, 80 ), MAP_APPFONT )); + SetSizePixel( LogicToPixel( Size(50, 80 ), MapUnit::MapAppFont )); Show(); } diff --git a/svx/source/tbxctrls/layctrl.cxx b/svx/source/tbxctrls/layctrl.cxx index c439d848b24d..868f834c2cfe 100644 --- a/svx/source/tbxctrls/layctrl.cxx +++ b/svx/source/tbxctrls/layctrl.cxx @@ -432,7 +432,7 @@ ColumnsWindow::ColumnsWindow( sal_uInt16 nId, const OUString& rCmd, const OUStri SetText( rText ); - Size aLogicSize = LogicToPixel( Size( 95, 155 ), MapMode( MAP_10TH_MM ) ); + Size aLogicSize = LogicToPixel( Size( 95, 155 ), MapMode( MapUnit::Map10thMM ) ); nMX = aLogicSize.Width(); SetOutputSizePixel( Size( nMX*nWidth-1, aLogicSize.Height()+nTextHeight ) ); StartCascading(); diff --git a/svx/source/tbxctrls/lboxctrl.cxx b/svx/source/tbxctrls/lboxctrl.cxx index 9305a369a9da..7dcd54cc7987 100644 --- a/svx/source/tbxctrls/lboxctrl.cxx +++ b/svx/source/tbxctrls/lboxctrl.cxx @@ -85,7 +85,7 @@ SvxPopupWindowListBox::SvxPopupWindowListBox(sal_uInt16 nSlotId, const OUString& WinBits nBits(m_pListBox->GetStyle()); nBits &= ~(WB_SIMPLEMODE); m_pListBox->SetStyle(nBits); - Size aSize(LogicToPixel(Size(100, 85), MAP_APPFONT)); + Size aSize(LogicToPixel(Size(100, 85), MapUnit::MapAppFont)); m_pListBox->set_width_request(aSize.Width()); m_pListBox->set_height_request(aSize.Height()); m_pListBox->EnableMultiSelection( true, true ); diff --git a/svx/source/tbxctrls/linectrl.cxx b/svx/source/tbxctrls/linectrl.cxx index 8d78bd1a3870..c0b1c3eb45a0 100644 --- a/svx/source/tbxctrls/linectrl.cxx +++ b/svx/source/tbxctrls/linectrl.cxx @@ -226,7 +226,7 @@ void SvxLineWidthToolBoxControl::StateChanged( // Core-Unit handed over to MetricField // Should not happen in CreateItemWin ()! - MapUnit eUnit = MAP_100TH_MM; // CD!!! GetCoreMetric(); + MapUnit eUnit = MapUnit::Map100thMM; // CD!!! GetCoreMetric(); pFld->SetCoreUnit( eUnit ); pFld->Update( static_cast<const XLineWidthItem*>(pState) ); diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx index 1998590f69f3..cba6820ed361 100644 --- a/svx/source/tbxctrls/tbcontrl.cxx +++ b/svx/source/tbxctrls/tbcontrl.cxx @@ -360,7 +360,7 @@ SvxStyleBox_Impl::SvxStyleBox_Impl(vcl::Window* pParent, m_pMenu->SetSelectHdl( LINK( this, SvxStyleBox_Impl, MenuSelectHdl ) ); for(VclPtr<MenuButton> & rpButton : m_pButtons) rpButton = nullptr; - aLogicalSize = PixelToLogic( GetSizePixel(), MAP_APPFONT ); + aLogicalSize = PixelToLogic( GetSizePixel(), MapUnit::MapAppFont ); SetOptimalSize(); EnableAutocomplete( true ); EnableUserDraw( true ); @@ -617,7 +617,7 @@ bool SvxStyleBox_Impl::AdjustFontForItemHeight(OutputDevice* pDevice, Rectangle& void SvxStyleBox_Impl::SetOptimalSize() { - Size aSize(LogicToPixel(aLogicalSize, MAP_APPFONT)); + Size aSize(LogicToPixel(aLogicalSize, MapUnit::MapAppFont)); set_width_request(aSize.Width()); set_height_request(aSize.Height()); SetSizePixel(aSize); @@ -1094,7 +1094,7 @@ bool SvxFontNameBox_Impl::Notify( NotifyEvent& rNEvt ) void SvxFontNameBox_Impl::SetOptimalSize() { - Size aSize(LogicToPixel(aLogicalSize, MAP_APPFONT)); + Size aSize(LogicToPixel(aLogicalSize, MapUnit::MapAppFont)); set_width_request(aSize.Width()); set_height_request(aSize.Height()); SetSizePixel(aSize); diff --git a/svx/source/tbxctrls/tbunocontroller.cxx b/svx/source/tbxctrls/tbunocontroller.cxx index ff9bb9e1c55b..c6fc28f4a469 100644 --- a/svx/source/tbxctrls/tbunocontroller.cxx +++ b/svx/source/tbxctrls/tbunocontroller.cxx @@ -247,7 +247,7 @@ bool SvxFontSizeBox_Impl::Notify( NotifyEvent& rNEvt ) void SvxFontSizeBox_Impl::SetOptimalSize() { - Size aPrefSize(LogicToPixel(m_aLogicalSize, MAP_APPFONT)); + Size aPrefSize(LogicToPixel(m_aLogicalSize, MapUnit::MapAppFont)); aPrefSize.Width() = get_preferred_size().Width(); SetSizePixel(aPrefSize); } diff --git a/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx b/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx index f68aed90f6c1..b00726280c67 100644 --- a/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx +++ b/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx @@ -371,7 +371,7 @@ void DictionaryList::setColSizes() long nRemainder = nWidth - (nWidth1 + nWidth2 + nWidth3); long aStaticTabs[] = { 3, 0, nWidth1 + (nRemainder/2), nPos3 }; - SvSimpleTable::SetTabs(aStaticTabs, MAP_PIXEL); + SvSimpleTable::SetTabs(aStaticTabs, MapUnit::MapPixel); } void DictionaryList::Resize() @@ -414,7 +414,7 @@ void DictionaryList::init(const Reference< linguistic2::XConversionDictionary>& rHeaderBar.InsertItem( 3, aColumn3, nWidth3, nBits ); long pTabs[] = { 3, 0, nWidth1, nWidth1 + nWidth2 }; - SetTabs( &pTabs[0], MAP_PIXEL ); + SetTabs( &pTabs[0], MapUnit::MapPixel ); } void ChineseDictionaryDialog::initDictionaryControl(DictionaryList *pList, diff --git a/svx/source/unodraw/UnoGraphicExporter.cxx b/svx/source/unodraw/UnoGraphicExporter.cxx index be81e31c7ca1..deedad6885b5 100644 --- a/svx/source/unodraw/UnoGraphicExporter.cxx +++ b/svx/source/unodraw/UnoGraphicExporter.cxx @@ -194,7 +194,7 @@ namespace { { // use 100th mm for primitive bitmap converter tool, input is pixel // use a real OutDev to get the correct DPI, the static LogicToLogic assumes 72dpi which is wrong (!) - const Size aSize100th(Application::GetDefaultDevice()->PixelToLogic(*pSize, MapMode(MAP_100TH_MM))); + const Size aSize100th(Application::GetDefaultDevice()->PixelToLogic(*pSize, MapMode(MapUnit::Map100thMM))); aRange.expand(basegfx::B2DPoint(aSize100th.Width(), aSize100th.Height())); @@ -205,7 +205,7 @@ namespace { else { // use 100th mm for primitive bitmap converter tool - const Size aSize100th(OutputDevice::LogicToLogic(rMtf.GetPrefSize(), rMtf.GetPrefMapMode(), MapMode(MAP_100TH_MM))); + const Size aSize100th(OutputDevice::LogicToLogic(rMtf.GetPrefSize(), rMtf.GetPrefMapMode(), MapMode(MapUnit::Map100thMM))); aRange.expand(basegfx::B2DPoint(aSize100th.Width(), aSize100th.Height())); } @@ -394,7 +394,7 @@ IMPL_LINK(GraphicExporter, CalcFieldValueHdl, EditFieldInfo*, pInfo, void) VclPtr<VirtualDevice> GraphicExporter::CreatePageVDev( SdrPage* pPage, sal_uIntPtr nWidthPixel, sal_uIntPtr nHeightPixel ) const { VclPtr<VirtualDevice> pVDev = VclPtr<VirtualDevice>::Create(); - MapMode aMM( MAP_100TH_MM ); + MapMode aMM( MapUnit::Map100thMM ); Point aPoint( 0, 0 ); Size aPageSize(pPage->GetSize()); diff --git a/svx/source/unodraw/unopool.cxx b/svx/source/unodraw/unopool.cxx index c62a7ed26d2c..15752f7bd7c4 100644 --- a/svx/source/unodraw/unopool.cxx +++ b/svx/source/unodraw/unopool.cxx @@ -120,7 +120,7 @@ void SvxUnoDrawPool::getAny( SfxItemPool* pPool, const comphelper::PropertyMapEn const MapUnit eMapUnit = pPool->GetMetric((sal_uInt16)pEntry->mnHandle); sal_uInt8 nMemberId = pEntry->mnMemberId & (~SFX_METRIC_ITEM); - if( eMapUnit == MAP_100TH_MM ) + if( eMapUnit == MapUnit::Map100thMM ) nMemberId &= (~CONVERT_TWIPS); // DVO, OD 10.10.2003 #i18732# @@ -133,7 +133,7 @@ void SvxUnoDrawPool::getAny( SfxItemPool* pPool, const comphelper::PropertyMapEn // check for needed metric translation const MapUnit eMapUnit = pPool->GetMetric((sal_uInt16)pEntry->mnHandle); - if(pEntry->mnMemberId & SFX_METRIC_ITEM && eMapUnit != MAP_100TH_MM) + if(pEntry->mnMemberId & SFX_METRIC_ITEM && eMapUnit != MapUnit::Map100thMM) { SvxUnoConvertToMM( eMapUnit, rValue ); } @@ -153,7 +153,7 @@ void SvxUnoDrawPool::putAny( SfxItemPool* pPool, const comphelper::PropertyMapEn uno::Any aValue( rValue ); const MapUnit eMapUnit = pPool->GetMetric((sal_uInt16)pEntry->mnHandle); - if(pEntry->mnMemberId & SFX_METRIC_ITEM && eMapUnit != MAP_100TH_MM) + if(pEntry->mnMemberId & SFX_METRIC_ITEM && eMapUnit != MapUnit::Map100thMM) { SvxUnoConvertFromMM( eMapUnit, aValue ); } @@ -187,7 +187,7 @@ void SvxUnoDrawPool::putAny( SfxItemPool* pPool, const comphelper::PropertyMapEn { std::unique_ptr<SfxPoolItem> pNewItem( pPool->GetDefaultItem( nWhich ).Clone() ); sal_uInt8 nMemberId = pEntry->mnMemberId & (~SFX_METRIC_ITEM); - if( pPool->GetMetric(nWhich) == MAP_100TH_MM ) + if( pPool->GetMetric(nWhich) == MapUnit::Map100thMM ) nMemberId &= (~CONVERT_TWIPS); if( !pNewItem->PutValue( aValue, nMemberId ) ) diff --git a/svx/source/unodraw/unoprov.cxx b/svx/source/unodraw/unoprov.cxx index 37b311ac8e0e..2d9f97c47a24 100644 --- a/svx/source/unodraw/unoprov.cxx +++ b/svx/source/unodraw/unoprov.cxx @@ -971,17 +971,17 @@ sal_Bool SvxMeasureUnitToMapUnit( const short eApi, int& eVcl ) throw() { switch( eVcl ) { - case util::MeasureUnit::MM_100TH: eVcl = MAP_100TH_MM; break; - case util::MeasureUnit::MM_10TH: eVcl = MAP_10TH_MM; break; - case util::MeasureUnit::MM: eVcl = MAP_MM; break; - case util::MeasureUnit::CM: eVcl = MAP_CM; break; - case util::MeasureUnit::INCH_1000TH: eVcl = MAP_1000TH_INCH; break; - case util::MeasureUnit::INCH_100TH: eVcl = MAP_100TH_INCH; break; - case util::MeasureUnit::INCH_10TH: eVcl = MAP_10TH_INCH; break; - case util::MeasureUnit::INCH: eVcl = MAP_INCH; break; - case util::MeasureUnit::POINT: eVcl = MAP_POINT; break; - case util::MeasureUnit::TWIP: eVcl = MAP_TWIP; break; - case util::MeasureUnit::PERCENT: eVcl = MAP_RELATIVE; break; + case util::MeasureUnit::MM_100TH: eVcl = MapUnit::Map100thMM; break; + case util::MeasureUnit::MM_10TH: eVcl = MapUnit::Map10thMM; break; + case util::MeasureUnit::MM: eVcl = MapUnit::MapMM; break; + case util::MeasureUnit::CM: eVcl = MapUnit::MapCM; break; + case util::MeasureUnit::INCH_1000TH: eVcl = MapUnit::Map1000thInch; break; + case util::MeasureUnit::INCH_100TH: eVcl = MapUnit::Map100thInch; break; + case util::MeasureUnit::INCH_10TH: eVcl = MapUnit::Map10thInch; break; + case util::MeasureUnit::INCH: eVcl = MapUnit::MapInch; break; + case util::MeasureUnit::POINT: eVcl = MapUnit::MapPoint; break; + case util::MeasureUnit::TWIP: eVcl = MapUnit::MapTwip; break; + case util::MeasureUnit::PERCENT: eVcl = MapUnit::MapRelative; break; default: return false; } @@ -997,17 +997,17 @@ bool SvxMapUnitToMeasureUnit( const MapUnit eVcl, short& eApi ) throw() { switch( eVcl ) { - case MAP_100TH_MM: eApi = util::MeasureUnit::MM_100TH; break; - case MAP_10TH_MM: eApi = util::MeasureUnit::MM_10TH; break; - case MAP_MM: eApi = util::MeasureUnit::MM; break; - case MAP_CM: eApi = util::MeasureUnit::CM; break; - case MAP_1000TH_INCH: eApi = util::MeasureUnit::INCH_1000TH; break; - case MAP_100TH_INCH: eApi = util::MeasureUnit::INCH_100TH; break; - case MAP_10TH_INCH: eApi = util::MeasureUnit::INCH_10TH; break; - case MAP_INCH: eApi = util::MeasureUnit::INCH; break; - case MAP_POINT: eApi = util::MeasureUnit::POINT; break; - case MAP_TWIP: eApi = util::MeasureUnit::TWIP; break; - case MAP_RELATIVE: eApi = util::MeasureUnit::PERCENT; break; + case MapUnit::Map100thMM: eApi = util::MeasureUnit::MM_100TH; break; + case MapUnit::Map10thMM: eApi = util::MeasureUnit::MM_10TH; break; + case MapUnit::MapMM: eApi = util::MeasureUnit::MM; break; + case MapUnit::MapCM: eApi = util::MeasureUnit::CM; break; + case MapUnit::Map1000thInch: eApi = util::MeasureUnit::INCH_1000TH; break; + case MapUnit::Map100thInch: eApi = util::MeasureUnit::INCH_100TH; break; + case MapUnit::Map10thInch: eApi = util::MeasureUnit::INCH_10TH; break; + case MapUnit::MapInch: eApi = util::MeasureUnit::INCH; break; + case MapUnit::MapPoint: eApi = util::MeasureUnit::POINT; break; + case MapUnit::MapTwip: eApi = util::MeasureUnit::TWIP; break; + case MapUnit::MapRelative: eApi = util::MeasureUnit::PERCENT; break; default: return false; } diff --git a/svx/source/unodraw/unoshap4.cxx b/svx/source/unodraw/unoshap4.cxx index 97fa794b71a9..4b0232d6074b 100644 --- a/svx/source/unodraw/unoshap4.cxx +++ b/svx/source/unodraw/unoshap4.cxx @@ -102,7 +102,7 @@ bool SvxOle2Shape::setPropertyValueImpl( const OUString& rName, const SfxItemPro { try { - MapUnit aMapUnit( MAP_100TH_MM ); // the API handles with MAP_100TH_MM map mode + MapUnit aMapUnit( MapUnit::Map100thMM ); // the API handles with MapUnit::Map100thMM map mode MapUnit aObjUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( xObj->getMapUnit( embed::Aspects::MSOLE_CONTENT ) ); aTmp = OutputDevice::LogicToLogic( aTmp, aMapUnit, aObjUnit ); xObj->setVisualAreaSize( embed::Aspects::MSOLE_CONTENT, awt::Size( aTmp.Width(), aTmp.Height() ) ); @@ -266,7 +266,7 @@ bool SvxOle2Shape::getPropertyValueImpl( const OUString& rName, const SfxItemPro awt::Rectangle aVisArea; if( dynamic_cast<const SdrOle2Obj* >(mpObj.get()) != nullptr) { - MapMode aMapMode( MAP_100TH_MM ); // the API uses this map mode + MapMode aMapMode( MapUnit::Map100thMM ); // the API uses this map mode Size aTmp = static_cast<SdrOle2Obj*>(mpObj.get())->GetOrigObjSize( &aMapMode ); // get the size in the requested map mode aVisArea = awt::Rectangle( 0, 0, aTmp.Width(), aTmp.Height() ); } diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx index 4b2037352c62..323df4fd5eb9 100644 --- a/svx/source/unodraw/unoshape.cxx +++ b/svx/source/unodraw/unoshape.cxx @@ -485,11 +485,11 @@ void SvxShape::ForceMetricToItemPoolMetric(Pair& rPoint) const throw() if(mpModel) { MapUnit eMapUnit = mpModel->GetItemPool().GetMetric(0); - if(eMapUnit != MAP_100TH_MM) + if(eMapUnit != MapUnit::Map100thMM) { switch(eMapUnit) { - case MAP_TWIP : + case MapUnit::MapTwip : { rPoint.A() = MM_TO_TWIPS(rPoint.A()); rPoint.B() = MM_TO_TWIPS(rPoint.B()); @@ -511,11 +511,11 @@ void SvxShape::ForceMetricToItemPoolMetric(basegfx::B2DPolyPolygon& rPolyPolygon if(mpModel) { MapUnit eMapUnit = mpModel->GetItemPool().GetMetric(0); - if(eMapUnit != MAP_100TH_MM) + if(eMapUnit != MapUnit::Map100thMM) { switch(eMapUnit) { - case MAP_TWIP : + case MapUnit::MapTwip : { basegfx::B2DHomMatrix aTransform; const double fMMToTWIPS(72.0 / 127.0); @@ -537,15 +537,15 @@ void SvxShape::ForceMetricToItemPoolMetric(basegfx::B2DPolyPolygon& rPolyPolygon void SvxShape::ForceMetricTo100th_mm(Pair& rPoint) const throw() { DBG_TESTSOLARMUTEX(); - MapUnit eMapUnit = MAP_100TH_MM; + MapUnit eMapUnit = MapUnit::Map100thMM; if(mpModel) { eMapUnit = mpModel->GetItemPool().GetMetric(0); - if(eMapUnit != MAP_100TH_MM) + if(eMapUnit != MapUnit::Map100thMM) { switch(eMapUnit) { - case MAP_TWIP : + case MapUnit::MapTwip : { rPoint.A() = TWIPS_TO_MM(rPoint.A()); rPoint.B() = TWIPS_TO_MM(rPoint.B()); @@ -564,15 +564,15 @@ void SvxShape::ForceMetricTo100th_mm(Pair& rPoint) const throw() void SvxShape::ForceMetricTo100th_mm(basegfx::B2DPolyPolygon& rPolyPolygon) const throw() { DBG_TESTSOLARMUTEX(); - MapUnit eMapUnit = MAP_100TH_MM; + MapUnit eMapUnit = MapUnit::Map100thMM; if(mpModel) { eMapUnit = mpModel->GetItemPool().GetMetric(0); - if(eMapUnit != MAP_100TH_MM) + if(eMapUnit != MapUnit::Map100thMM) { switch(eMapUnit) { - case MAP_TWIP : + case MapUnit::MapTwip : { basegfx::B2DHomMatrix aTransform; const double fTWIPSToMM(127.0 / 72.0); @@ -660,7 +660,7 @@ uno::Any SvxShape::GetBitmap( bool bMetaFile /* = false */ ) const return aAny; ScopedVclPtrInstance< VirtualDevice > pVDev; - pVDev->SetMapMode(MapMode(MAP_100TH_MM)); + pVDev->SetMapMode(MapMode(MapUnit::Map100thMM)); SdrModel* pModel = mpObj->GetModel(); SdrPage* pPage = mpObj->GetPage(); @@ -690,7 +690,7 @@ uno::Any SvxShape::GetBitmap( bool bMetaFile /* = false */ ) const { Graphic aGraph(aMtf); aGraph.SetPrefSize(aSize); - aGraph.SetPrefMapMode(MAP_100TH_MM); + aGraph.SetPrefMapMode(MapUnit::Map100thMM); Reference< awt::XBitmap > xBmp( aGraph.GetXGraphic(), UNO_QUERY ); aAny <<= xBmp; diff --git a/svx/source/xoutdev/_xoutbmp.cxx b/svx/source/xoutdev/_xoutbmp.cxx index af5d94e83abe..d458802091a1 100644 --- a/svx/source/xoutdev/_xoutbmp.cxx +++ b/svx/source/xoutdev/_xoutbmp.cxx @@ -272,7 +272,7 @@ sal_uInt16 XOutBitmap::WriteGraphic( const Graphic& rGraphic, OUString& rFileNam if( pMtfSize_100TH_MM && ( rGraphic.GetType() != GraphicType::Bitmap ) ) { ScopedVclPtrInstance< VirtualDevice > pVDev; - const Size aSize( pVDev->LogicToPixel( *pMtfSize_100TH_MM, MAP_100TH_MM ) ); + const Size aSize( pVDev->LogicToPixel( *pMtfSize_100TH_MM, MapUnit::Map100thMM ) ); if( pVDev->SetOutputSizePixel( aSize ) ) { @@ -305,7 +305,7 @@ sal_uInt16 XOutBitmap::WriteGraphic( const Graphic& rGraphic, OUString& rFileNam if( pMtfSize_100TH_MM && ( rGraphic.GetType() != GraphicType::Bitmap ) ) { ScopedVclPtrInstance< VirtualDevice > pVDev; - const Size aSize( pVDev->LogicToPixel( *pMtfSize_100TH_MM, MAP_100TH_MM ) ); + const Size aSize( pVDev->LogicToPixel( *pMtfSize_100TH_MM, MapUnit::Map100thMM ) ); if( pVDev->SetOutputSizePixel( aSize ) ) { diff --git a/svx/source/xoutdev/xattr.cxx b/svx/source/xoutdev/xattr.cxx index 656e70e88a21..1a5e82549ad0 100644 --- a/svx/source/xoutdev/xattr.cxx +++ b/svx/source/xoutdev/xattr.cxx @@ -2208,7 +2208,7 @@ void XFillStyleItem::dumpAsXml(xmlTextWriterPtr pWriter) const xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"), BAD_CAST(OString::number(GetValue()).getStr())); OUString aPresentation; - GetPresentation(SfxItemPresentation::Nameless, MAP_100TH_MM, MAP_100TH_MM, aPresentation); + GetPresentation(SfxItemPresentation::Nameless, MapUnit::Map100thMM, MapUnit::Map100thMM, aPresentation); xmlTextWriterWriteAttribute(pWriter, BAD_CAST("presentation"), BAD_CAST(aPresentation.toUtf8().getStr())); xmlTextWriterEndElement(pWriter); diff --git a/svx/source/xoutdev/xtabdash.cxx b/svx/source/xoutdev/xtabdash.cxx index 962ff658fb05..d2d309b9bd70 100644 --- a/svx/source/xoutdev/xtabdash.cxx +++ b/svx/source/xoutdev/xtabdash.cxx @@ -101,7 +101,7 @@ Bitmap XDashList::ImpCreateBitmapForXDash(const XDash* pDash) if(pDash && (pDash->GetDots() || pDash->GetDashes())) { - const basegfx::B2DHomMatrix aScaleMatrix(OutputDevice::LogicToLogic(MAP_100TH_MM, MAP_PIXEL)); + const basegfx::B2DHomMatrix aScaleMatrix(OutputDevice::LogicToLogic(MapUnit::Map100thMM, MapUnit::MapPixel)); const basegfx::B2DVector aScaleVector(aScaleMatrix * basegfx::B2DVector(1.0, 0.0)); const double fScaleValue(aScaleVector.getLength() * (nFactor * (1.4 / 2.0))); const double fLineWidthInUnits(fLineWidth / fScaleValue); diff --git a/svx/source/xoutdev/xtabhtch.cxx b/svx/source/xoutdev/xtabhtch.cxx index 51b71def653d..34438a4f1ea5 100644 --- a/svx/source/xoutdev/xtabhtch.cxx +++ b/svx/source/xoutdev/xtabhtch.cxx @@ -112,7 +112,7 @@ Bitmap XHatchList::CreateBitmap( long nIndex, const Size& rSize) const } } - const basegfx::B2DHomMatrix aScaleMatrix(OutputDevice::LogicToLogic(MAP_100TH_MM, MAP_PIXEL)); + const basegfx::B2DHomMatrix aScaleMatrix(OutputDevice::LogicToLogic(MapUnit::Map100thMM, MapUnit::MapPixel)); const basegfx::B2DVector aScaleVector(aScaleMatrix * basegfx::B2DVector(1.0, 0.0)); const double fScaleValue(aScaleVector.getLength()); |