diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-09-20 16:41:39 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-10-05 06:51:20 +0000 |
commit | 954f752cf10fc6a8777af2a6a93e496688464687 (patch) | |
tree | 0fc776cdcb6ad9b1d2b9673ac044bb5b4f496972 /cui | |
parent | c1e18e05a53c1d55afe36a887ca25f74f3f1d32d (diff) |
convert MapUnit to scoped enum
I left a prefix on the names "Map" so that I would not have to re-arrange
each name too much, since I can't start identifiers with digits like "100thMM"
And remove RSC_EXTRAMAPUNIT, which doesn't seem to be doing anything anymore.
Change-Id: I5187824aa87e30caf5357b51b5384b5ab919d224
Reviewed-on: https://gerrit.libreoffice.org/29096
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'cui')
38 files changed, 157 insertions, 157 deletions
diff --git a/cui/source/customize/acccfg.cxx b/cui/source/customize/acccfg.cxx index 65281aadce3d..c3f14d1c6adf 100644 --- a/cui/source/customize/acccfg.cxx +++ b/cui/source/customize/acccfg.cxx @@ -761,20 +761,20 @@ SfxAcceleratorConfigPage::SfxAcceleratorConfigPage( vcl::Window* pParent, const get(m_pSaveButton, "save"); get(m_pResetButton, "reset"); get(m_pEntriesBox, "shortcuts"); - Size aSize(LogicToPixel(Size(174, 100), MAP_APPFONT)); + Size aSize(LogicToPixel(Size(174, 100), MapUnit::MapAppFont)); m_pEntriesBox->set_width_request(aSize.Width()); m_pEntriesBox->set_height_request(aSize.Height()); m_pEntriesBox->SetAccelConfigPage(this); get(m_pGroupLBox, "category"); - aSize = LogicToPixel(Size(78 , 91), MAP_APPFONT); + aSize = LogicToPixel(Size(78 , 91), MapUnit::MapAppFont); m_pGroupLBox->set_width_request(aSize.Width()); m_pGroupLBox->set_height_request(aSize.Height()); get(m_pFunctionBox, "function"); - aSize = LogicToPixel(Size(88, 91), MAP_APPFONT); + aSize = LogicToPixel(Size(88, 91), MapUnit::MapAppFont); m_pFunctionBox->set_width_request(aSize.Width()); m_pFunctionBox->set_height_request(aSize.Height()); get(m_pKeyBox, "keys"); - aSize = LogicToPixel(Size(80, 91), MAP_APPFONT); + aSize = LogicToPixel(Size(80, 91), MapUnit::MapAppFont); m_pKeyBox->set_width_request(aSize.Width()); m_pKeyBox->set_height_request(aSize.Height()); @@ -810,7 +810,7 @@ SfxAcceleratorConfigPage::SfxAcceleratorConfigPage( vcl::Window* pParent, const nMaxWidth = nTmp; } // recalc second tab - long nNewTab = PixelToLogic( Size( nMaxWidth, 0 ), MAP_APPFONT ).Width(); + long nNewTab = PixelToLogic( Size( nMaxWidth, 0 ), MapUnit::MapAppFont ).Width(); nNewTab = nNewTab + 5; // additional space m_pEntriesBox->SetTab( 1, nNewTab ); diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx index bfda9e3f3551..dcbe98f2acab 100644 --- a/cui/source/customize/cfg.cxx +++ b/cui/source/customize/cfg.cxx @@ -1763,7 +1763,7 @@ SvxConfigPage::SvxConfigPage(vcl::Window *pParent, const SfxItemSet& rSet) get(m_pDescriptionField, "desc"); m_pDescriptionField->set_height_request(m_pDescriptionField->GetTextHeight()*4); get(m_pEntries, "entries"); - Size aSize(LogicToPixel(Size(108, 115), MAP_APPFONT)); + Size aSize(LogicToPixel(Size(108, 115), MapUnit::MapAppFont)); m_pEntries->set_height_request(aSize.Height()); m_pEntries->set_width_request(aSize.Width()); @@ -5015,7 +5015,7 @@ SvxIconSelectorDialog::SvxIconSelectorDialog( vcl::Window *pWindow, get(pBtnImport, "importButton"); get(pBtnDelete, "deleteButton"); - aTbSize = pTbSymbol->LogicToPixel(Size(160, 80), MapMode(MAP_APPFONT)); + aTbSize = pTbSymbol->LogicToPixel(Size(160, 80), MapMode(MapUnit::MapAppFont)); pTbSymbol->set_width_request(aTbSize.Width()); pTbSymbol->set_height_request(aTbSize.Height()); pTbSymbol->SetStyle(pTbSymbol->GetStyle() | WB_SCROLL | WB_LINESPACING); @@ -5630,7 +5630,7 @@ SvxIconChangeDialog::SvxIconChangeDialog( get(pFImageInfo, "infoImage"); get(pLineEditDescription, "addrTextview"); - Size aSize(LogicToPixel(Size(140, 83), MapMode(MAP_APPFONT))); + Size aSize(LogicToPixel(Size(140, 83), MapMode(MapUnit::MapAppFont))); pLineEditDescription->set_width_request(aSize.Width()); pLineEditDescription->set_height_request(aSize.Height()); diff --git a/cui/source/customize/eventdlg.cxx b/cui/source/customize/eventdlg.cxx index 082194fdc66d..9e422eb9ba84 100644 --- a/cui/source/customize/eventdlg.cxx +++ b/cui/source/customize/eventdlg.cxx @@ -65,7 +65,7 @@ SvxEventConfigPage::SvxEventConfigPage(vcl::Window *pParent, const SfxItemSet& r mpImpl->sStrEvent = get<FixedText>("eventft")->GetText(); mpImpl->sAssignedMacro = get<FixedText>("actionft")->GetText(); get(mpImpl->pEventLB, "events"); - Size aSize(LogicToPixel(Size(205, 229), MAP_APPFONT)); + Size aSize(LogicToPixel(Size(205, 229), MapUnit::MapAppFont)); mpImpl->pEventLB->set_width_request(aSize.Width()); mpImpl->pEventLB->set_height_request(aSize.Height()); get(mpImpl->pAssignPB, "macro"); diff --git a/cui/source/customize/macropg.cxx b/cui/source/customize/macropg.cxx index 3826bf53713f..7ff2f551da7a 100644 --- a/cui/source/customize/macropg.cxx +++ b/cui/source/customize/macropg.cxx @@ -110,7 +110,7 @@ IMPL_LINK( MacroEventListBox, HeaderEndDrag_Impl, HeaderBar*, pBar, void ) long _nWidth = maHeaderBar->GetItemSize( i ); aSz.Width() = _nWidth + nTmpSz; nTmpSz += _nWidth; - maListBox->SetTab( i, PixelToLogic( aSz, MapMode( MAP_APPFONT ) ).Width() ); + maListBox->SetTab( i, PixelToLogic( aSz, MapMode( MapUnit::MapAppFont ) ).Width() ); } } } @@ -166,7 +166,7 @@ VCL_BUILDER_DECL_FACTORY(MacroEventListBox) Size MacroEventListBox::GetOptimalSize() const { - return LogicToPixel(Size(192, 72), MapMode(MAP_APPFONT )); + return LogicToPixel(Size(192, 72), MapMode(MapUnit::MapAppFont )); } void MacroEventListBox::Resize() @@ -727,9 +727,9 @@ void SvxMacroTabPage_::InitAndSetHandler( const Reference< container::XNameRepla rListBox.SetSelectionMode( SelectionMode::Single ); rListBox.SetTabs( &nTabs[0] ); Size aSize( nTabs[ 2 ], 0 ); - rHeaderBar.InsertItem( ITEMID_EVENT, mpImpl->sStrEvent, LogicToPixel( aSize, MapMode( MAP_APPFONT ) ).Width() ); + rHeaderBar.InsertItem( ITEMID_EVENT, mpImpl->sStrEvent, LogicToPixel( aSize, MapMode( MapUnit::MapAppFont ) ).Width() ); aSize.Width() = 1764; // don't know what, so 42^2 is best to use... - rHeaderBar.InsertItem( ITMEID_ASSMACRO, mpImpl->sAssignedMacro, LogicToPixel( aSize, MapMode( MAP_APPFONT ) ).Width() ); + rHeaderBar.InsertItem( ITMEID_ASSMACRO, mpImpl->sAssignedMacro, LogicToPixel( aSize, MapMode( MapUnit::MapAppFont ) ).Width() ); rListBox.SetSpaceBetweenEntries( 0 ); mpImpl->pEventLB->Show(); diff --git a/cui/source/dialogs/SpellDialog.cxx b/cui/source/dialogs/SpellDialog.cxx index 56bbd308123f..a08ec7546344 100644 --- a/cui/source/dialogs/SpellDialog.cxx +++ b/cui/source/dialogs/SpellDialog.cxx @@ -201,7 +201,7 @@ SpellDialog::SpellDialog(SpellDialogChildWindow* pChildWindow, get(m_pExplainLink, "explainlink"); get(m_pNotInDictFT, "notindictft"); get(m_pSentenceED, "sentence"); - Size aEdSize(LogicToPixel(Size(197, 48), MAP_APPFONT)); + Size aEdSize(LogicToPixel(Size(197, 48), MapUnit::MapAppFont)); m_pSentenceED->set_width_request(aEdSize.Width()); m_pSentenceED->set_height_request(aEdSize.Height()); get(m_pSuggestionFT, "suggestionsft"); diff --git a/cui/source/dialogs/colorpicker.cxx b/cui/source/dialogs/colorpicker.cxx index c1c7ac64e61b..5591310489c7 100644 --- a/cui/source/dialogs/colorpicker.cxx +++ b/cui/source/dialogs/colorpicker.cxx @@ -276,7 +276,7 @@ VCL_BUILDER_DECL_FACTORY(ColorFieldControl) Size ColorFieldControl::GetOptimalSize() const { - return LogicToPixel(Size(158, 158), MAP_APPFONT); + return LogicToPixel(Size(158, 158), MapUnit::MapAppFont); } void ColorFieldControl::UpdateBitmap() diff --git a/cui/source/dialogs/cuigaldlg.cxx b/cui/source/dialogs/cuigaldlg.cxx index 2484a03dddd8..f90e719022aa 100644 --- a/cui/source/dialogs/cuigaldlg.cxx +++ b/cui/source/dialogs/cuigaldlg.cxx @@ -733,7 +733,7 @@ TPGalleryThemeProperties::TPGalleryThemeProperties( vcl::Window* pWindow, const { get(m_pCbbFileType, "filetype"); get(m_pLbxFound, "files"); - Size aSize(LogicToPixel(Size(172, 156), MAP_APPFONT)); + Size aSize(LogicToPixel(Size(172, 156), MapUnit::MapAppFont)); m_pLbxFound->set_width_request(aSize.Width()); m_pLbxFound->set_height_request(aSize.Height()); m_pLbxFound->EnableMultiSelection(true); diff --git a/cui/source/dialogs/cuigrfflt.cxx b/cui/source/dialogs/cuigrfflt.cxx index dc680de5bd48..43217dc39d96 100644 --- a/cui/source/dialogs/cuigrfflt.cxx +++ b/cui/source/dialogs/cuigrfflt.cxx @@ -53,7 +53,7 @@ VCL_BUILDER_DECL_FACTORY(GraphicPreviewWindow) Size GraphicPreviewWindow::GetOptimalSize() const { - return LogicToPixel(Size(81, 73), MAP_APPFONT); + return LogicToPixel(Size(81, 73), MapUnit::MapAppFont); } @@ -532,7 +532,7 @@ void EmbossControl::MouseButtonDown( const MouseEvent& rEvt ) Size EmbossControl::GetOptimalSize() const { - return LogicToPixel(Size(77, 60), MAP_APPFONT); + return LogicToPixel(Size(77, 60), MapUnit::MapAppFont); } diff --git a/cui/source/dialogs/hlmarkwn.cxx b/cui/source/dialogs/hlmarkwn.cxx index 986e608a6598..f2087cc4840e 100644 --- a/cui/source/dialogs/hlmarkwn.cxx +++ b/cui/source/dialogs/hlmarkwn.cxx @@ -95,7 +95,7 @@ VCL_BUILDER_DECL_FACTORY(SvxHlmarkTreeLBox) Size SvxHlmarkTreeLBox::GetOptimalSize() const { - return LogicToPixel(Size(103, 162), MAP_APPFONT); + return LogicToPixel(Size(103, 162), MapUnit::MapAppFont); } void SvxHlmarkTreeLBox::Paint(vcl::RenderContext& rRenderContext, const Rectangle& rRect) diff --git a/cui/source/dialogs/linkdlg.cxx b/cui/source/dialogs/linkdlg.cxx index 4ee16b38bf1c..7df24bd982d3 100644 --- a/cui/source/dialogs/linkdlg.cxx +++ b/cui/source/dialogs/linkdlg.cxx @@ -99,7 +99,7 @@ SvBaseLinksDlg::SvBaseLinksDlg( vcl::Window * pParent, LinkManager* pMgr, bool b aUpdateIdle("cui SvBaseLinksDlg UpdateIdle") { get(m_pTbLinks, "TB_LINKS"); - Size aSize(LogicToPixel(Size(257, 87), MAP_APPFONT)); + Size aSize(LogicToPixel(Size(257, 87), MapUnit::MapAppFont)); m_pTbLinks->set_width_request(aSize.Width()); m_pTbLinks->set_height_request(aSize.Height()); get(m_pFtFullFileName, "FULL_FILE_NAME"); @@ -115,11 +115,11 @@ SvBaseLinksDlg::SvBaseLinksDlg( vcl::Window * pParent, LinkManager* pMgr, bool b m_pTbLinks->SetSelectionMode( SelectionMode::Multiple ); m_pTbLinks->SetTabs( &nTabs[0] ); FixedText *pFtFiles = get<FixedText>("FILES"); - pFtFiles->set_width_request(LogicToPixel(Size(nTabs[2] - nTabs[1] - 2, 0), MAP_APPFONT).Width()); + pFtFiles->set_width_request(LogicToPixel(Size(nTabs[2] - nTabs[1] - 2, 0), MapUnit::MapAppFont).Width()); FixedText *pFtLinks = get<FixedText>("LINKS"); - pFtLinks->set_width_request(LogicToPixel(Size(nTabs[3] - nTabs[2] - 2, 0), MAP_APPFONT).Width()); + pFtLinks->set_width_request(LogicToPixel(Size(nTabs[3] - nTabs[2] - 2, 0), MapUnit::MapAppFont).Width()); FixedText *pFtTypes = get<FixedText>("TYPE"); - pFtTypes->set_width_request(LogicToPixel(Size(nTabs[4] - nTabs[3] - 2, 0), MAP_APPFONT).Width()); + pFtTypes->set_width_request(LogicToPixel(Size(nTabs[4] - nTabs[3] - 2, 0), MapUnit::MapAppFont).Width()); m_pTbLinks->Resize(); // OS: hack for correct selection // UpdateTimer for DDE-/Grf-links, which are waited for diff --git a/cui/source/dialogs/multipat.cxx b/cui/source/dialogs/multipat.cxx index afe5584e8b15..f20db7a4583c 100644 --- a/cui/source/dialogs/multipat.cxx +++ b/cui/source/dialogs/multipat.cxx @@ -179,7 +179,7 @@ SvxMultiPathDialog::SvxMultiPathDialog(vcl::Window* pParent) get(m_pDelBtn, "delete"); SvSimpleTableContainer* pRadioLBContainer = get<SvSimpleTableContainer>("paths"); - Size aSize(LogicToPixel(Size(195, 77), MAP_APPFONT)); + Size aSize(LogicToPixel(Size(195, 77), MapUnit::MapAppFont)); pRadioLBContainer->set_width_request(aSize.Width()); pRadioLBContainer->set_height_request(aSize.Height()); m_pRadioLB = VclPtr<svx::SvxRadioButtonListBox>::Create(*pRadioLBContainer, 0); @@ -207,7 +207,7 @@ SvxPathSelectDialog::SvxPathSelectDialog(vcl::Window* pParent) get(m_pAddBtn, "add"); get(m_pDelBtn, "delete"); get(m_pPathLB, "paths"); - Size aSize(LogicToPixel(Size(189, 80), MAP_APPFONT)); + Size aSize(LogicToPixel(Size(189, 80), MapUnit::MapAppFont)); m_pPathLB->set_width_request(aSize.Width()); m_pPathLB->set_height_request(aSize.Height()); diff --git a/cui/source/options/certpath.cxx b/cui/source/options/certpath.cxx index 18ad0b14abac..f853ce3e9b50 100644 --- a/cui/source/options/certpath.cxx +++ b/cui/source/options/certpath.cxx @@ -31,7 +31,7 @@ CertPathDialog::CertPathDialog(vcl::Window* pParent) get(m_pOKBtn, "ok"); get(m_pAddBtn, "add"); get(m_pCertPathListContainer, "paths"); - Size aSize(LogicToPixel(Size(210, 60), MAP_APPFONT)); + Size aSize(LogicToPixel(Size(210, 60), MapUnit::MapAppFont)); m_pCertPathListContainer->set_width_request(aSize.Width()); m_pCertPathListContainer->set_height_request(aSize.Height()); m_pCertPathList = diff --git a/cui/source/options/connpooloptions.cxx b/cui/source/options/connpooloptions.cxx index 9362469caf3a..bf34078cac9a 100644 --- a/cui/source/options/connpooloptions.cxx +++ b/cui/source/options/connpooloptions.cxx @@ -127,11 +127,11 @@ namespace offapp { EditBrowseBox::Init(); - Size aColWidth = LogicToPixel(Size(160, 0), MAP_APPFONT); + Size aColWidth = LogicToPixel(Size(160, 0), MapUnit::MapAppFont); InsertDataColumn(1, OUString(CUI_RES(RID_SVXSTR_DRIVER_NAME)), aColWidth.Width()); - aColWidth = LogicToPixel(Size(30, 0), MAP_APPFONT); + aColWidth = LogicToPixel(Size(30, 0), MapUnit::MapAppFont); InsertDataColumn(2, OUString(CUI_RES(RID_SVXSTR_POOLED_FLAG)), aColWidth.Width()); - aColWidth = LogicToPixel(Size(60, 0), MAP_APPFONT); + aColWidth = LogicToPixel(Size(60, 0), MapUnit::MapAppFont); InsertDataColumn(3, OUString(CUI_RES(RID_SVXSTR_POOL_TIMEOUT)), aColWidth.Width()); // Attention: the resource of the string is local to the resource of the enclosing dialog! } @@ -303,7 +303,7 @@ namespace offapp get(m_pTimeout, "timeout"); Size aControlSize(248, 100); - aControlSize = LogicToPixel(aControlSize, MAP_APPFONT); + aControlSize = LogicToPixel(aControlSize, MapUnit::MapAppFont); m_pDriverList->set_width_request(aControlSize.Width()); m_pDriverList->set_height_request(aControlSize.Height()); m_pDriverList->Init(); diff --git a/cui/source/options/dbregister.cxx b/cui/source/options/dbregister.cxx index be470fc95c0b..c34f7b60919b 100644 --- a/cui/source/options/dbregister.cxx +++ b/cui/source/options/dbregister.cxx @@ -110,7 +110,7 @@ DbRegistrationOptionsPage::DbRegistrationOptionsPage( vcl::Window* pParent, cons { get(m_pPathCtrl, "pathctrl"); Size aControlSize(248, 147); - aControlSize = LogicToPixel(aControlSize, MAP_APPFONT); + aControlSize = LogicToPixel(aControlSize, MapUnit::MapAppFont); m_pPathCtrl->set_width_request(aControlSize.Width()); m_pPathCtrl->set_height_request(aControlSize.Height()); @@ -134,11 +134,11 @@ DbRegistrationOptionsPage::DbRegistrationOptionsPage( vcl::Window* pParent, cons Size aSz; aSz.Width() = TAB_WIDTH1; rBar.InsertItem( ITEMID_TYPE, m_aTypeText, - LogicToPixel( aSz, MapMode( MAP_APPFONT ) ).Width(), + LogicToPixel( aSz, MapMode( MapUnit::MapAppFont ) ).Width(), HeaderBarItemBits::LEFT | HeaderBarItemBits::VCENTER | HeaderBarItemBits::CLICKABLE | HeaderBarItemBits::UPARROW ); aSz.Width() = TAB_WIDTH2; rBar.InsertItem( ITEMID_PATH, m_aPathText, - LogicToPixel( aSz, MapMode( MAP_APPFONT ) ).Width(), + LogicToPixel( aSz, MapMode( MapUnit::MapAppFont ) ).Width(), HeaderBarItemBits::LEFT | HeaderBarItemBits::VCENTER ); static long aTabs[] = {3, 0, TAB_WIDTH1, TAB_WIDTH1 + TAB_WIDTH2 }; @@ -364,7 +364,7 @@ IMPL_LINK( DbRegistrationOptionsPage, HeaderEndDrag_Impl, HeaderBar*, pBar, void long _nWidth = pBar->GetItemSize(i); aSz.Width() = _nWidth + nTmpSz; nTmpSz += _nWidth; - m_pPathBox->SetTab( i, PixelToLogic( aSz, MapMode(MAP_APPFONT) ).Width() ); + m_pPathBox->SetTab( i, PixelToLogic( aSz, MapMode(MapUnit::MapAppFont) ).Width() ); } } } diff --git a/cui/source/options/fontsubs.cxx b/cui/source/options/fontsubs.cxx index 9abe7d4db52b..7264c0d194c9 100644 --- a/cui/source/options/fontsubs.cxx +++ b/cui/source/options/fontsubs.cxx @@ -59,7 +59,7 @@ SvxFontSubstTabPage::SvxFontSubstTabPage( vcl::Window* pParent, SvSimpleTableContainer *pCheckLBContainer = get<SvSimpleTableContainer>("checklb"); Size aControlSize(248, 75); - aControlSize = LogicToPixel(aControlSize, MAP_APPFONT); + aControlSize = LogicToPixel(aControlSize, MapUnit::MapAppFont); pCheckLBContainer->set_width_request(aControlSize.Width()); pCheckLBContainer->set_height_request(aControlSize.Height()); @@ -421,7 +421,7 @@ void SvxFontSubstCheckListBox::setColSizes() long nW1 = rBar.GetTextWidth(rBar.GetItemText(3)); long nW2 = rBar.GetTextWidth(rBar.GetItemText(4)); long nMax = std::max( nW1, nW2 ) + 6; // width of the longest header + a little offset - long nMin = rBar.LogicToPixel(Size(10, 0), MAP_APPFONT).Width(); + long nMin = rBar.LogicToPixel(Size(10, 0), MapUnit::MapAppFont).Width(); nMax = std::max( nMax, nMin ); const long nDoubleMax = 2*nMax; const long nRest = GetSizePixel().Width() - nDoubleMax; @@ -429,7 +429,7 @@ void SvxFontSubstCheckListBox::setColSizes() aStaticTabs[2] = nMax; aStaticTabs[3] = nDoubleMax; aStaticTabs[4] = nDoubleMax + nRest/2; - SvSimpleTable::SetTabs(aStaticTabs, MAP_PIXEL); + SvSimpleTable::SetTabs(aStaticTabs, MapUnit::MapPixel); } void SvxFontSubstCheckListBox::Resize() diff --git a/cui/source/options/optaboutconfig.cxx b/cui/source/options/optaboutconfig.cxx index a6c06a9c4ba4..bacba9e98b78 100644 --- a/cui/source/options/optaboutconfig.cxx +++ b/cui/source/options/optaboutconfig.cxx @@ -137,7 +137,7 @@ void CuiCustomMultilineEdit::KeyInput( const KeyEvent& rKeyEvent ) Size CuiCustomMultilineEdit::GetOptimalSize() const { - return LogicToPixel(Size(150, GetTextHeight()), MAP_APPFONT); + return LogicToPixel(Size(150, GetTextHeight()), MapUnit::MapAppFont); } CuiAboutConfigTabPage::CuiAboutConfigTabPage( vcl::Window* pParent/*, const SfxItemSet& rItemSet*/ ) : @@ -150,7 +150,7 @@ CuiAboutConfigTabPage::CuiAboutConfigTabPage( vcl::Window* pParent/*, const SfxI m_vectorOfModified(), m_pPrefBox( VclPtr<SvSimpleTable>::Create(*m_pPrefCtrl, WB_SCROLL | WB_HSCROLL | WB_VSCROLL ) ) { - Size aControlSize(LogicToPixel(Size(385, 230), MAP_APPFONT)); + Size aControlSize(LogicToPixel(Size(385, 230), MapUnit::MapAppFont)); m_pPrefCtrl->set_width_request(aControlSize.Width()); m_pPrefCtrl->set_height_request(aControlSize.Height()); @@ -179,7 +179,7 @@ CuiAboutConfigTabPage::CuiAboutConfigTabPage( vcl::Window* pParent/*, const SfxI m_options.searchFlag |= (util::SearchFlags::REG_NOT_BEGINOFLINE | util::SearchFlags::REG_NOT_ENDOFLINE); - m_pPrefBox->SetTabs(aTabs, MAP_PIXEL); + m_pPrefBox->SetTabs(aTabs, MapUnit::MapPixel); m_pPrefBox->SetAlternatingRowColors( true ); } diff --git a/cui/source/options/optfltr.cxx b/cui/source/options/optfltr.cxx index d3c9fc1002c8..6e791c8911ca 100644 --- a/cui/source/options/optfltr.cxx +++ b/cui/source/options/optfltr.cxx @@ -158,7 +158,7 @@ OfaMSFilterTabPage2::OfaMSFilterTabPage2( vcl::Window* pParent, const SfxItemSet get( aShadingRB, "shading" ); Size aControlSize(248, 55); - aControlSize = LogicToPixel(aControlSize, MAP_APPFONT); + aControlSize = LogicToPixel(aControlSize, MapUnit::MapAppFont); m_pCheckLBContainer->set_width_request(aControlSize.Width()); m_pCheckLBContainer->set_height_request(aControlSize.Height()); diff --git a/cui/source/options/optjava.cxx b/cui/source/options/optjava.cxx index 9ddc4fff0cf8..c8bb0cb241eb 100644 --- a/cui/source/options/optjava.cxx +++ b/cui/source/options/optjava.cxx @@ -108,7 +108,7 @@ public: if (rBar.GetItemCount() < 4) return; long nCheckWidth = std::max(GetControlColumnWidth() + 12, - rBar.LogicToPixel(Size(15, 0), MAP_APPFONT).Width()); + rBar.LogicToPixel(Size(15, 0), MapUnit::MapAppFont).Width()); long nVersionWidth = 12 + std::max(rBar.GetTextWidth(rBar.GetItemText(3)), GetTextWidth("0.0.0_00-icedtea")); @@ -123,7 +123,7 @@ public: aStaticTabs[2] = nCheckWidth; aStaticTabs[3] = aStaticTabs[2] + nVendorWidth; aStaticTabs[4] = aStaticTabs[3] + nVersionWidth; - SvSimpleTable::SetTabs(aStaticTabs, MAP_PIXEL); + SvSimpleTable::SetTabs(aStaticTabs, MapUnit::MapPixel); } virtual void Resize() override { @@ -163,7 +163,7 @@ SvxJavaOptionsPage::SvxJavaOptionsPage( vcl::Window* pParent, const SfxItemSet& SvSimpleTableContainer *pJavaListContainer = get<SvSimpleTableContainer>("javas"); Size aControlSize(177, 60); - aControlSize = LogicToPixel(aControlSize, MAP_APPFONT); + aControlSize = LogicToPixel(aControlSize, MapUnit::MapAppFont); pJavaListContainer->set_width_request(aControlSize.Width()); pJavaListContainer->set_height_request(aControlSize.Height()); m_pJavaList = VclPtr<SvxJavaListBox>::Create(*pJavaListContainer, m_sAccessibilityText); diff --git a/cui/source/options/optlingu.cxx b/cui/source/options/optlingu.cxx index fc9f3c612240..6e3c09993cff 100644 --- a/cui/source/options/optlingu.cxx +++ b/cui/source/options/optlingu.cxx @@ -1816,7 +1816,7 @@ SvxEditModulesDlg::SvxEditModulesDlg(vcl::Window* pParent, SvxLinguData_Impl& rD get(m_pPrioDownPB, "down"); get(m_pPrioUpPB, "up"); get(m_pModulesCLB, "lingudicts"); - Size aListSize(m_pModulesCLB->LogicToPixel(Size(166, 120), MAP_APPFONT)); + Size aListSize(m_pModulesCLB->LogicToPixel(Size(166, 120), MapUnit::MapAppFont)); m_pModulesCLB->set_height_request(aListSize.Height()); m_pModulesCLB->set_width_request(aListSize.Width()); get(m_pLanguageLB, "language"); diff --git a/cui/source/options/optpath.cxx b/cui/source/options/optpath.cxx index 88d7fd5b6eb8..f3511513f88b 100644 --- a/cui/source/options/optpath.cxx +++ b/cui/source/options/optpath.cxx @@ -204,7 +204,7 @@ SvxPathTabPage::SvxPathTabPage(vcl::Window* pParent, const SfxItemSet& rSet) m_pPathBtn->SetClickHdl( LINK( this, SvxPathTabPage, PathHdl_Impl ) ); Size aControlSize(236 , 147); - aControlSize = LogicToPixel(aControlSize, MAP_APPFONT); + aControlSize = LogicToPixel(aControlSize, MapUnit::MapAppFont); m_pPathCtrl->set_width_request(aControlSize.Width()); m_pPathCtrl->set_height_request(aControlSize.Height()); WinBits nBits = WB_SORT | WB_HSCROLL | WB_CLIPCHILDREN | WB_TABSTOP; @@ -227,7 +227,7 @@ SvxPathTabPage::SvxPathTabPage(vcl::Window* pParent, const SfxItemSet& rSet) long aTabs[] = {3, 0, 0, 0}; aTabs[2] = nWidth1 + 12; aTabs[3] = aTabs[2] + nWidth2 + 12; - pPathBox->SetTabs(aTabs, MAP_PIXEL); + pPathBox->SetTabs(aTabs, MapUnit::MapPixel); pPathBox->SetDoubleClickHdl( LINK( this, SvxPathTabPage, DoubleClickPathHdl_Impl ) ); pPathBox->SetSelectHdl( LINK( this, SvxPathTabPage, PathSelect_Impl ) ); @@ -342,7 +342,7 @@ void SvxPathTabPage::Reset( const SfxItemSet* ) long aTabs[] = {3, 0, 0, 0}; aTabs[2] = nWidth1 + 12; aTabs[3] = aTabs[2] + nWidth2 + 12; - pPathBox->SetTabs(aTabs, MAP_PIXEL); + pPathBox->SetTabs(aTabs, MapUnit::MapPixel); #if 0 String aUserData = GetUserData(); @@ -716,7 +716,7 @@ IMPL_LINK( SvxPathTabPage, HeaderEndDrag_Impl, HeaderBar*, pBar, void ) long _nWidth = pBar->GetItemSize(i); aSz.Width() = _nWidth + nTmpSz; nTmpSz += _nWidth; - pPathBox->SetTab( i, PixelToLogic( aSz, MapMode(MAP_APPFONT) ).Width() ); + pPathBox->SetTab( i, PixelToLogic( aSz, MapMode(MapUnit::MapAppFont) ).Width() ); } } } diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx index 716bb2a253e1..3ecfdf624a84 100644 --- a/cui/source/options/treeopt.cxx +++ b/cui/source/options/treeopt.cxx @@ -498,7 +498,7 @@ void OfaTreeOptionsDialog::InitWidgets() get(pBackPB, "revert"); get(pTreeLB, "pages"); get(pTabBox, "box"); - Size aSize(pTabBox->LogicToPixel(Size(278, 259), MAP_APPFONT)); + Size aSize(pTabBox->LogicToPixel(Size(278, 259), MapUnit::MapAppFont)); pTabBox->set_width_request(aSize.Width()); pTabBox->set_height_request(aSize.Height() - get_action_area()->get_preferred_size().Height()); pTreeLB->set_width_request(pTreeLB->approximate_char_width() * 25); diff --git a/cui/source/options/webconninfo.cxx b/cui/source/options/webconninfo.cxx index 21ed6daa0e88..d9473ea8f7ab 100644 --- a/cui/source/options/webconninfo.cxx +++ b/cui/source/options/webconninfo.cxx @@ -96,7 +96,7 @@ void PasswordTable::setColWidths() GetSizePixel().Width() - nUserNameWidth); long aStaticTabs[]= { 2, 0, 0 }; aStaticTabs[2] = nWebSiteWidth; - SvSimpleTable::SetTabs(aStaticTabs, MAP_PIXEL); + SvSimpleTable::SetTabs(aStaticTabs, MapUnit::MapPixel); } // class WebConnectionInfoDialog ----------------------------------------- diff --git a/cui/source/tabpages/autocdlg.cxx b/cui/source/tabpages/autocdlg.cxx index 64ab34f826f5..67efba2e1b2c 100644 --- a/cui/source/tabpages/autocdlg.cxx +++ b/cui/source/tabpages/autocdlg.cxx @@ -437,7 +437,7 @@ OfaSwAutoFmtOptionsPage::OfaSwAutoFmtOptionsPage( vcl::Window* pParent, SvSimpleTableContainer* pCheckLBContainer(get<SvSimpleTableContainer>("list")); Size aControlSize(248 , 149); - aControlSize = LogicToPixel(aControlSize, MAP_APPFONT); + aControlSize = LogicToPixel(aControlSize, MapUnit::MapAppFont); pCheckLBContainer->set_width_request(aControlSize.Width()); pCheckLBContainer->set_height_request(aControlSize.Height()); m_pCheckLB = VclPtr<OfaACorrCheckListBox>::Create(*pCheckLBContainer); @@ -1773,7 +1773,7 @@ void AutoCorrEdit::Resize() Edit::Resize(); if (!m_xReplaceTLB) return; - m_xReplaceTLB->SetTab(m_nCol, GetPosPixel().X(), MAP_PIXEL); + m_xReplaceTLB->SetTab(m_nCol, GetPosPixel().X(), MapUnit::MapPixel); } enum OfaQuoteOptions @@ -1823,7 +1823,7 @@ OfaQuoteTabPage::OfaQuoteTabPage(vcl::Window* pParent, const SfxItemSet& rSet) SvSimpleTableContainer *pListContainer = get<SvSimpleTableContainer>("list"); Size aControlSize(252 , 85); - aControlSize = LogicToPixel(aControlSize, MAP_APPFONT); + aControlSize = LogicToPixel(aControlSize, MapUnit::MapAppFont); pListContainer->set_width_request(aControlSize.Width()); pListContainer->set_height_request(aControlSize.Height()); m_pSwCheckLB = VclPtr<OfaACorrCheckListBox>::Create(*pListContainer); @@ -2195,7 +2195,7 @@ OfaAutoCompleteTabPage::OfaAutoCompleteTabPage(vcl::Window* pParent, get(m_pNFMaxEntries, "maxentries"); get(m_pLBEntries, "entries"); m_pLBEntries->SetPage(this); - aSize = LogicToPixel(Size(121, 158), MAP_APPFONT); + aSize = LogicToPixel(Size(121, 158), MapUnit::MapAppFont); m_pLBEntries->set_width_request(aSize.Width()); m_pLBEntries->set_height_request(aSize.Height()); get(m_pPBEntries, "delete"); @@ -2477,7 +2477,7 @@ OfaSmartTagOptionsTabPage::OfaSmartTagOptionsTabPage( vcl::Window* pParent, // some options for the list box: m_pSmartTagTypesLB->SetStyle( m_pSmartTagTypesLB->GetStyle() | WB_HSCROLL | WB_HIDESELECTION ); m_pSmartTagTypesLB->SetHighlightRange(); - Size aControlSize(LogicToPixel(Size(172, 154), MAP_APPFONT)); + Size aControlSize(LogicToPixel(Size(172, 154), MapUnit::MapAppFont)); m_pSmartTagTypesLB->set_width_request(aControlSize.Width()); m_pSmartTagTypesLB->set_height_request(aControlSize.Height()); diff --git a/cui/source/tabpages/border.cxx b/cui/source/tabpages/border.cxx index f94fb4aba33c..2a2a32065d9a 100644 --- a/cui/source/tabpages/border.cxx +++ b/cui/source/tabpages/border.cxx @@ -251,7 +251,7 @@ SvxBorderTabPage::SvxBorderTabPage(vcl::Window* pParent, const SfxItemSet& rCore } bIsDontCare = !pBoxInfo->IsValid( SvxBoxInfoItemValidFlags::DISABLE ); } - if(!mbUseMarginItem && eFUnit == FUNIT_MM && MAP_TWIP == rCoreAttrs.GetPool()->GetMetric( GetWhich( SID_ATTR_BORDER_INNER ) )) + if(!mbUseMarginItem && eFUnit == FUNIT_MM && MapUnit::MapTwip == rCoreAttrs.GetPool()->GetMetric( GetWhich( SID_ATTR_BORDER_INNER ) )) { //#i91548# changing the number of decimal digits changes the minimum values, too lcl_SetDecimalDigitsTo1(*m_pLeftMF); @@ -540,7 +540,7 @@ void SvxBorderTabPage::Reset( const SfxItemSet* rSet ) // Determine the width first as some styles can be missing depending on it sal_Int64 nWidthPt = static_cast<sal_Int64>(MetricField::ConvertDoubleValue( sal_Int64( nWidth ), m_pLineWidthMF->GetDecimalDigits( ), - MAP_TWIP,m_pLineWidthMF->GetUnit() )); + MapUnit::MapTwip, m_pLineWidthMF->GetUnit() )); m_pLineWidthMF->SetValue( nWidthPt ); m_pLbLineStyle->SetWidth( nWidth ); @@ -896,7 +896,7 @@ IMPL_LINK_NOARG(SvxBorderTabPage, ModifyWidthHdl_Impl, Edit&, void) sal_Int64 nVal = static_cast<sal_Int64>(MetricField::ConvertDoubleValue( m_pLineWidthMF->GetValue( ), m_pLineWidthMF->GetDecimalDigits( ), - m_pLineWidthMF->GetUnit(), MAP_TWIP )); + m_pLineWidthMF->GetUnit(), MapUnit::MapTwip )); m_pLbLineStyle->SetWidth( nVal ); m_pFrameSel->SetStyleToSelection( nVal, @@ -911,7 +911,7 @@ IMPL_LINK( SvxBorderTabPage, SelStyleHdl_Impl, ListBox&, rLb, void ) sal_Int64 nVal = static_cast<sal_Int64>(MetricField::ConvertDoubleValue( m_pLineWidthMF->GetValue( ), m_pLineWidthMF->GetDecimalDigits( ), - m_pLineWidthMF->GetUnit(), MAP_TWIP )); + m_pLineWidthMF->GetUnit(), MapUnit::MapTwip )); m_pFrameSel->SetStyleToSelection ( nVal, SvxBorderStyle( m_pLbLineStyle->GetSelectEntryStyle() ) ); } @@ -1111,7 +1111,7 @@ void SvxBorderTabPage::FillLineListBox_Impl() sal_Int64 nVal = static_cast<sal_Int64>(MetricField::ConvertDoubleValue( m_pLineWidthMF->GetValue( ), m_pLineWidthMF->GetDecimalDigits( ), - m_pLineWidthMF->GetUnit(), MAP_TWIP )); + m_pLineWidthMF->GetUnit(), MapUnit::MapTwip )); m_pLbLineStyle->SetWidth( nVal ); } diff --git a/cui/source/tabpages/chardlg.cxx b/cui/source/tabpages/chardlg.cxx index 444fd626376e..1d270844ce60 100644 --- a/cui/source/tabpages/chardlg.cxx +++ b/cui/source/tabpages/chardlg.cxx @@ -780,9 +780,9 @@ void SvxCharNamePage::Reset_Impl( const SfxItemSet& rSet, LanguageGroup eLangGrp MapUnit eUnit = rSet.GetPool()->GetMetric( nWhich ); const SvxFontHeightItem& rItem = static_cast<const SvxFontHeightItem&>(rSet.Get( nWhich )); - if( rItem.GetProp() != 100 || MAP_RELATIVE != rItem.GetPropUnit() ) + if( rItem.GetProp() != 100 || MapUnit::MapRelative != rItem.GetPropUnit() ) { - bool bPtRel = MAP_POINT == rItem.GetPropUnit(); + bool bPtRel = MapUnit::MapPoint == rItem.GetPropUnit(); pSizeBox->SetPtRelative( bPtRel ); pSizeBox->SetValue( bPtRel ? ((short)rItem.GetProp()) * 10 : rItem.GetProp() ); } @@ -1079,7 +1079,7 @@ bool SvxCharNamePage::FillItemSet_Impl( SfxItemSet& rSet, LanguageGroup eLangGrp } if ( bChanged || !pOldHeight || - bRel != ( MAP_RELATIVE != pOldHeight->GetPropUnit() || 100 != pOldHeight->GetProp() ) ) + bRel != ( MapUnit::MapRelative != pOldHeight->GetPropUnit() || 100 != pOldHeight->GetProp() ) ) { MapUnit eUnit = rSet.GetPool()->GetMetric( nWhich ); if ( pSizeBox->IsRelative() ) @@ -1090,7 +1090,7 @@ bool SvxCharNamePage::FillItemSet_Impl( SfxItemSet& rSet, LanguageGroup eLangGrp SvxFontHeightItem aHeight( 240, 100, nWhich ); if ( pSizeBox->IsPtRelative() ) - aHeight.SetHeight( rOldItem.GetHeight(), (sal_uInt16)( nSize / 10 ), MAP_POINT, eUnit ); + aHeight.SetHeight( rOldItem.GetHeight(), (sal_uInt16)( nSize / 10 ), MapUnit::MapPoint, eUnit ); else aHeight.SetHeight( rOldItem.GetHeight(), (sal_uInt16)nSize ); rSet.Put( aHeight ); @@ -2826,7 +2826,7 @@ IMPL_LINK( SvxCharPositionPage, FitToLineHdl_Impl, Button*, pBox, void ) IMPL_LINK_NOARG(SvxCharPositionPage, KerningModifyHdl_Impl, Edit&, void) { long nVal = static_cast<long>(m_pKerningMF->GetValue()); - nVal = LogicToLogic( nVal, MAP_POINT, MAP_TWIP ); + nVal = LogicToLogic( nVal, MapUnit::MapPoint, MapUnit::MapTwip ); long nKern = (short)m_pKerningMF->Denormalize( nVal ); SvxFont& rFont = GetPreviewFont(); @@ -3005,12 +3005,12 @@ void SvxCharPositionPage::Reset( const SfxItemSet* rSet ) const SvxKerningItem& rItem = static_cast<const SvxKerningItem&>(rSet->Get( nWhich )); MapUnit eUnit = rSet->GetPool()->GetMetric( nWhich ); MapUnit eOrgUnit = (MapUnit)eUnit; - MapUnit ePntUnit( MAP_POINT ); + MapUnit ePntUnit( MapUnit::MapPoint ); long nBig = static_cast<long>(m_pKerningMF->Normalize( static_cast<long>(rItem.GetValue()) )); long nKerning = LogicToLogic( nBig, eOrgUnit, ePntUnit ); // set Kerning at the Font, convert into Twips before - long nKern = LogicToLogic( rItem.GetValue(), (MapUnit)eUnit, MAP_TWIP ); + long nKern = LogicToLogic( rItem.GetValue(), (MapUnit)eUnit, MapUnit::MapTwip ); rFont.SetFixKerning( (short)nKern ); rCJKFont.SetFixKerning( (short)nKern ); rCTLFont.SetFixKerning( (short)nKern ); @@ -3179,7 +3179,7 @@ bool SvxCharPositionPage::FillItemSet( SfxItemSet* rSet ) MapUnit eUnit = rSet->GetPool()->GetMetric( nWhich ); long nTmp = static_cast<long>(m_pKerningMF->GetValue()); - long nVal = LogicToLogic( nTmp, MAP_POINT, (MapUnit)eUnit ); + long nVal = LogicToLogic( nTmp, MapUnit::MapPoint, (MapUnit)eUnit ); nKerning = (short)m_pKerningMF->Denormalize( nVal ); SfxItemState eOldKernState = rOldSet.GetItemState( nWhich, false ); diff --git a/cui/source/tabpages/grfpage.cxx b/cui/source/tabpages/grfpage.cxx index 5c09f6b10d39..0e0965819b27 100644 --- a/cui/source/tabpages/grfpage.cxx +++ b/cui/source/tabpages/grfpage.cxx @@ -217,7 +217,7 @@ void SvxGrfCropPage::Reset( const SfxItemSet *rSet ) { aPageSize = OutputDevice::LogicToLogic( Size( CM_1_TO_TWIP, CM_1_TO_TWIP ), - MapMode( MAP_TWIP ), + MapMode( MapUnit::MapTwip ), MapMode( (MapUnit)rSet->GetPool()->GetMetric( nW ) ) ); } @@ -749,9 +749,9 @@ IMPL_LINK( SvxGrfCropPage, CropModifyHdl, Edit&, rField, void ) Size SvxGrfCropPage::GetGrfOrigSize( const Graphic& rGrf ) const { - const MapMode aMapTwip( MAP_TWIP ); + const MapMode aMapTwip( MapUnit::MapTwip ); Size aSize( rGrf.GetPrefSize() ); - if( MAP_PIXEL == rGrf.GetPrefMapMode().GetMapUnit() ) + if( MapUnit::MapPixel == rGrf.GetPrefMapMode().GetMapUnit() ) aSize = PixelToLogic( aSize, aMapTwip ); else aSize = OutputDevice::LogicToLogic( aSize, @@ -765,7 +765,7 @@ SvxCropExample::SvxCropExample( vcl::Window* pPar, WinBits nStyle ) : Window( pPar, nStyle) , aFrameSize( OutputDevice::LogicToLogic( Size( CM_1_TO_TWIP / 2, CM_1_TO_TWIP / 2 ), - MapMode( MAP_TWIP ), GetMapMode() )) + MapMode( MapUnit::MapTwip ), GetMapMode() )) , aTopLeft(0,0) , aBottomRight(0,0) { @@ -774,7 +774,7 @@ SvxCropExample::SvxCropExample( vcl::Window* pPar, WinBits nStyle ) Size SvxCropExample::GetOptimalSize() const { - return LogicToPixel(Size(78, 78), MAP_APPFONT); + return LogicToPixel(Size(78, 78), MapUnit::MapAppFont); } VCL_BUILDER_DECL_FACTORY(SvxCropExample) diff --git a/cui/source/tabpages/labdlg.cxx b/cui/source/tabpages/labdlg.cxx index c325ff9d19a3..e255e9cec723 100644 --- a/cui/source/tabpages/labdlg.cxx +++ b/cui/source/tabpages/labdlg.cxx @@ -87,7 +87,7 @@ SvxCaptionTabPage::SvxCaptionTabPage(vcl::Window* pParent, const SfxItemSet& rIn { get(m_pCT_CAPTTYPE, "valueset"); - Size aSize(m_pCT_CAPTTYPE->LogicToPixel(Size(187, 38), MAP_APPFONT)); + Size aSize(m_pCT_CAPTTYPE->LogicToPixel(Size(187, 38), MapUnit::MapAppFont)); m_pCT_CAPTTYPE->set_width_request(aSize.Width()); m_pCT_CAPTTYPE->set_height_request(aSize.Height()); diff --git a/cui/source/tabpages/macroass.cxx b/cui/source/tabpages/macroass.cxx index b980bc1f38cb..8c7a4e0f0387 100644 --- a/cui/source/tabpages/macroass.cxx +++ b/cui/source/tabpages/macroass.cxx @@ -398,9 +398,9 @@ void SfxMacroTabPage::InitAndSetHandler() rListBox.SetSelectionMode( SelectionMode::Single ); rListBox.SetTabs( &nTabs[0] ); Size aSize( nTabs[ 2 ], 0 ); - rHeaderBar.InsertItem( ITEMID_EVENT, mpImpl->sStrEvent, LogicToPixel( aSize, MapMode( MAP_APPFONT ) ).Width() ); + rHeaderBar.InsertItem( ITEMID_EVENT, mpImpl->sStrEvent, LogicToPixel( aSize, MapMode( MapUnit::MapAppFont ) ).Width() ); aSize.Width() = 1764; // don't know what, so 42^2 is best to use... - rHeaderBar.InsertItem( ITMEID_ASSMACRO, mpImpl->sAssignedMacro, LogicToPixel( aSize, MapMode( MAP_APPFONT ) ).Width() ); + rHeaderBar.InsertItem( ITMEID_ASSMACRO, mpImpl->sAssignedMacro, LogicToPixel( aSize, MapMode( MapUnit::MapAppFont ) ).Width() ); rListBox.SetSpaceBetweenEntries( 0 ); mpImpl->pEventLB->Show(); diff --git a/cui/source/tabpages/measure.cxx b/cui/source/tabpages/measure.cxx index 6fabe1fee2a1..e023463ee431 100644 --- a/cui/source/tabpages/measure.cxx +++ b/cui/source/tabpages/measure.cxx @@ -86,7 +86,7 @@ SvxMeasurePage::SvxMeasurePage( vcl::Window* pWindow, const SfxItemSet& rInAttrs rOutAttrs ( rInAttrs ), aAttrSet ( *rInAttrs.GetPool() ), pView( nullptr ), - eUnit( MAP_100TH_MM ), + eUnit( MapUnit::Map100thMM ), bPositionModified ( false ) { get(m_pMtrFldLineDist, "MTR_LINE_DIST"); diff --git a/cui/source/tabpages/numpages.cxx b/cui/source/tabpages/numpages.cxx index 04cabab006d1..1d7ab68557e5 100644 --- a/cui/source/tabpages/numpages.cxx +++ b/cui/source/tabpages/numpages.cxx @@ -969,7 +969,7 @@ IMPL_LINK_NOARG(SvxBitmapPickTabPage, NumSelectHdl_Impl, ValueSet*, void) { Size aSize = SvxNumberFormat::GetGraphicSizeMM100(&aGraphic); sal_Int16 eOrient = text::VertOrientation::LINE_CENTER; - aSize = OutputDevice::LogicToLogic(aSize, MAP_100TH_MM, (MapUnit)eCoreUnit); + aSize = OutputDevice::LogicToLogic(aSize, MapUnit::Map100thMM, (MapUnit)eCoreUnit); SvxBrushItem aBrush(aGraphic, GPOS_AREA, SID_ATTR_BRUSH ); aFmt.SetGraphicBrush( &aBrush, &aSize, &eOrient ); } @@ -2013,7 +2013,7 @@ IMPL_LINK( SvxNumOptionsTabPage, GraphicHdl_Impl, MenuButton *, pButton, void ) } if(bSucc) { - aSize = OutputDevice::LogicToLogic(aSize, MAP_100TH_MM, (MapUnit)eCoreUnit); + aSize = OutputDevice::LogicToLogic(aSize, MapUnit::Map100thMM, (MapUnit)eCoreUnit); sal_uInt16 nMask = 1; for(sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++) @@ -2171,9 +2171,9 @@ IMPL_LINK( SvxNumOptionsTabPage, SizeHdl_Impl, Edit&, rField, void) long nWidthVal = static_cast<long>(m_pWidthMF->Denormalize(m_pWidthMF->GetValue(FUNIT_100TH_MM))); long nHeightVal = static_cast<long>(m_pHeightMF->Denormalize(m_pHeightMF->GetValue(FUNIT_100TH_MM))); nWidthVal = OutputDevice::LogicToLogic( nWidthVal , - MAP_100TH_MM, (MapUnit)eCoreUnit ); + MapUnit::Map100thMM, (MapUnit)eCoreUnit ); nHeightVal = OutputDevice::LogicToLogic( nHeightVal, - MAP_100TH_MM, (MapUnit)eCoreUnit); + MapUnit::Map100thMM, (MapUnit)eCoreUnit); double fSizeRatio; bool bRepaint = false; @@ -2201,7 +2201,7 @@ IMPL_LINK( SvxNumOptionsTabPage, SizeHdl_Impl, Edit&, rField, void) { aSize.Height() = aInitSize[i].Height() + (long)((double)nDelta / fSizeRatio); m_pHeightMF->SetUserValue(m_pHeightMF->Normalize( - OutputDevice::LogicToLogic( aSize.Height(), (MapUnit)eCoreUnit, MAP_100TH_MM )), + OutputDevice::LogicToLogic( aSize.Height(), (MapUnit)eCoreUnit, MapUnit::Map100thMM )), FUNIT_100TH_MM); } } @@ -2213,7 +2213,7 @@ IMPL_LINK( SvxNumOptionsTabPage, SizeHdl_Impl, Edit&, rField, void) { aSize.Width() = aInitSize[i].Width() + (long)((double)nDelta * fSizeRatio); m_pWidthMF->SetUserValue(m_pWidthMF->Normalize( - OutputDevice::LogicToLogic( aSize.Width(), (MapUnit)eCoreUnit, MAP_100TH_MM )), + OutputDevice::LogicToLogic( aSize.Width(), (MapUnit)eCoreUnit, MapUnit::Map100thMM )), FUNIT_100TH_MM); } } diff --git a/cui/source/tabpages/page.cxx b/cui/source/tabpages/page.cxx index b0940e4f85f7..a6097ea8aaa2 100644 --- a/cui/source/tabpages/page.cxx +++ b/cui/source/tabpages/page.cxx @@ -118,7 +118,7 @@ Size GetMinBorderSpace_Impl( const SvxShadowItem& rShadow, const SvxBoxItem& rBo long ConvertLong_Impl( const long nIn, MapUnit eUnit ) { - return OutputDevice::LogicToLogic( nIn, eUnit, MAP_TWIP ); + return OutputDevice::LogicToLogic( nIn, eUnit, MapUnit::MapTwip ); } bool IsEqualSize_Impl( const SvxSizeItem* pSize, const Size& rSize ) @@ -290,7 +290,7 @@ SvxPageDescPage::SvxPageDescPage( vcl::Window* pParent, const SfxItemSet& rAttr } MapMode aOldMode = mpDefPrinter->GetMapMode(); - mpDefPrinter->SetMapMode( MAP_TWIP ); + mpDefPrinter->SetMapMode( MapUnit::MapTwip ); // set first- and last-values for the margins Size aPaperSize = mpDefPrinter->GetPaperSize(); @@ -535,22 +535,22 @@ void SvxPageDescPage::Reset( const SfxItemSet* rSet ) m_pBspWin->SetSize( Size( ConvertLong_Impl( aPaperSize.Width(), eUnit ), ConvertLong_Impl( aPaperSize.Height(), eUnit ) ) ); - aPaperSize = OutputDevice::LogicToLogic(aPaperSize, (MapUnit)eUnit, MAP_100TH_MM); + aPaperSize = OutputDevice::LogicToLogic(aPaperSize, (MapUnit)eUnit, MapUnit::Map100thMM); if ( bLandscape ) Swap( aPaperSize ); // Actual Paper Format - Paper ePaper = SvxPaperInfo::GetSvxPaper( aPaperSize, MAP_100TH_MM, true ); + Paper ePaper = SvxPaperInfo::GetSvxPaper( aPaperSize, MapUnit::Map100thMM, true ); if ( PAPER_USER != ePaper ) - aPaperSize = SvxPaperInfo::GetPaperSize( ePaper, MAP_100TH_MM ); + aPaperSize = SvxPaperInfo::GetPaperSize( ePaper, MapUnit::Map100thMM ); if ( bLandscape ) Swap( aPaperSize ); // write values into the edits - SetMetricValue( *m_pPaperHeightEdit, aPaperSize.Height(), MAP_100TH_MM ); - SetMetricValue( *m_pPaperWidthEdit, aPaperSize.Width(), MAP_100TH_MM ); + SetMetricValue( *m_pPaperHeightEdit, aPaperSize.Height(), MapUnit::Map100thMM ); + SetMetricValue( *m_pPaperWidthEdit, aPaperSize.Width(), MapUnit::Map100thMM ); m_pPaperSizeBox->Clear(); m_pPaperSizeBox->FillPaperSizeEntries( ( ePaperStart == PAPER_A3 ) ? PaperSizeApp::Std : PaperSizeApp::Draw ); @@ -953,7 +953,7 @@ IMPL_LINK( SvxPageDescPage, PaperSizeSelect_Impl, ListBox&, rBox, void ) if ( ePaper != PAPER_USER ) { - Size aSize( SvxPaperInfo::GetPaperSize( ePaper, MAP_100TH_MM ) ); + Size aSize( SvxPaperInfo::GetPaperSize( ePaper, MapUnit::Map100thMM ) ); if ( m_pLandscapeBtn->IsChecked() ) Swap( aSize ); @@ -964,8 +964,8 @@ IMPL_LINK( SvxPageDescPage, PaperSizeSelect_Impl, ListBox&, rBox, void ) if ( aSize.Width() < m_pPaperWidthEdit->GetMin( FUNIT_100TH_MM ) ) m_pPaperWidthEdit->SetMin( m_pPaperWidthEdit->Normalize( aSize.Width() ), FUNIT_100TH_MM ); - SetMetricValue( *m_pPaperHeightEdit, aSize.Height(), MAP_100TH_MM ); - SetMetricValue( *m_pPaperWidthEdit, aSize.Width(), MAP_100TH_MM ); + SetMetricValue( *m_pPaperHeightEdit, aSize.Height(), MapUnit::Map100thMM ); + SetMetricValue( *m_pPaperWidthEdit, aSize.Width(), MapUnit::Map100thMM ); CalcMargin_Impl(); @@ -984,28 +984,28 @@ IMPL_LINK( SvxPageDescPage, PaperSizeSelect_Impl, ListBox&, rBox, void ) if ( bScreen || m_pRightMarginEdit->GetValue() == 0 ) { - SetMetricValue( *m_pRightMarginEdit, nTmp, MAP_CM ); + SetMetricValue( *m_pRightMarginEdit, nTmp, MapUnit::MapCM ); if ( !bScreen && m_pRightMarginEdit->GetFirst() > m_pRightMarginEdit->GetValue() ) m_pRightMarginEdit->SetValue( m_pRightMarginEdit->GetFirst() ); } if ( bScreen || m_pLeftMarginEdit->GetValue() == 0 ) { - SetMetricValue( *m_pLeftMarginEdit, nTmp, MAP_CM ); + SetMetricValue( *m_pLeftMarginEdit, nTmp, MapUnit::MapCM ); if ( !bScreen && m_pLeftMarginEdit->GetFirst() > m_pLeftMarginEdit->GetValue() ) m_pLeftMarginEdit->SetValue( m_pLeftMarginEdit->GetFirst() ); } if ( bScreen || m_pBottomMarginEdit->GetValue() == 0 ) { - SetMetricValue( *m_pBottomMarginEdit, nTmp, MAP_CM ); + SetMetricValue( *m_pBottomMarginEdit, nTmp, MapUnit::MapCM ); if ( !bScreen && m_pBottomMarginEdit->GetFirst() > m_pBottomMarginEdit->GetValue() ) m_pBottomMarginEdit->SetValue( m_pBottomMarginEdit->GetFirst() ); } if ( bScreen || m_pTopMarginEdit->GetValue() == 0 ) { - SetMetricValue( *m_pTopMarginEdit, nTmp, MAP_CM ); + SetMetricValue( *m_pTopMarginEdit, nTmp, MapUnit::MapCM ); if ( !bScreen && m_pTopMarginEdit->GetFirst() > m_pTopMarginEdit->GetValue() ) m_pTopMarginEdit->SetValue( m_pTopMarginEdit->GetFirst() ); @@ -1038,12 +1038,12 @@ IMPL_LINK( SvxPageDescPage, SwapOrientation_Impl, Button *, pBtn, void ) { bLandscape = m_pLandscapeBtn->IsChecked(); - const long lWidth = GetCoreValue( *m_pPaperWidthEdit, MAP_100TH_MM ); - const long lHeight = GetCoreValue( *m_pPaperHeightEdit, MAP_100TH_MM ); + const long lWidth = GetCoreValue( *m_pPaperWidthEdit, MapUnit::Map100thMM ); + const long lHeight = GetCoreValue( *m_pPaperHeightEdit, MapUnit::Map100thMM ); // swap width and height - SetMetricValue( *m_pPaperWidthEdit, lHeight, MAP_100TH_MM ); - SetMetricValue( *m_pPaperHeightEdit, lWidth, MAP_100TH_MM ); + SetMetricValue( *m_pPaperWidthEdit, lHeight, MapUnit::Map100thMM ); + SetMetricValue( *m_pPaperHeightEdit, lWidth, MapUnit::Map100thMM ); // recalculate margins if necessary CalcMargin_Impl(); @@ -1065,7 +1065,7 @@ void SvxPageDescPage::SwapFirstValues_Impl( bool bSet ) eOri = Orientation::Landscape; Orientation eOldOri = mpDefPrinter->GetOrientation(); mpDefPrinter->SetOrientation( eOri ); - mpDefPrinter->SetMapMode( MAP_TWIP ); + mpDefPrinter->SetMapMode( MapUnit::MapTwip ); // set first- and last-values for margins Size aPaperSize = mpDefPrinter->GetPaperSize(); @@ -1133,16 +1133,16 @@ IMPL_LINK_NOARG(SvxPageDescPage, BorderModify_Impl, Edit&, void) void SvxPageDescPage::UpdateExample_Impl( bool bResetbackground ) { // Size - Size aSize( GetCoreValue( *m_pPaperWidthEdit, MAP_TWIP ), - GetCoreValue( *m_pPaperHeightEdit, MAP_TWIP ) ); + Size aSize( GetCoreValue( *m_pPaperWidthEdit, MapUnit::MapTwip ), + GetCoreValue( *m_pPaperHeightEdit, MapUnit::MapTwip ) ); m_pBspWin->SetSize( aSize ); // Margins - m_pBspWin->SetTop( GetCoreValue( *m_pTopMarginEdit, MAP_TWIP ) ); - m_pBspWin->SetBottom( GetCoreValue( *m_pBottomMarginEdit, MAP_TWIP ) ); - m_pBspWin->SetLeft( GetCoreValue( *m_pLeftMarginEdit, MAP_TWIP ) ); - m_pBspWin->SetRight( GetCoreValue( *m_pRightMarginEdit, MAP_TWIP ) ); + m_pBspWin->SetTop( GetCoreValue( *m_pTopMarginEdit, MapUnit::MapTwip ) ); + m_pBspWin->SetBottom( GetCoreValue( *m_pBottomMarginEdit, MapUnit::MapTwip ) ); + m_pBspWin->SetLeft( GetCoreValue( *m_pLeftMarginEdit, MapUnit::MapTwip ) ); + m_pBspWin->SetRight( GetCoreValue( *m_pRightMarginEdit, MapUnit::MapTwip ) ); // Layout m_pBspWin->SetUsage( PosToPageUsage_Impl( m_pLayoutBox->GetSelectEntryPos() ) ); @@ -1540,14 +1540,14 @@ IMPL_LINK_NOARG(SvxPageDescPage, RangeHdl_Impl, Control&, void) void SvxPageDescPage::CalcMargin_Impl() { // current values for page margins - long nBT = GetCoreValue( *m_pTopMarginEdit, MAP_TWIP ); - long nBB = GetCoreValue( *m_pBottomMarginEdit, MAP_TWIP ); + long nBT = GetCoreValue( *m_pTopMarginEdit, MapUnit::MapTwip ); + long nBB = GetCoreValue( *m_pBottomMarginEdit, MapUnit::MapTwip ); - long nBL = GetCoreValue( *m_pLeftMarginEdit, MAP_TWIP ); - long nBR = GetCoreValue( *m_pRightMarginEdit, MAP_TWIP ); + long nBL = GetCoreValue( *m_pLeftMarginEdit, MapUnit::MapTwip ); + long nBR = GetCoreValue( *m_pRightMarginEdit, MapUnit::MapTwip ); - long nH = GetCoreValue( *m_pPaperHeightEdit, MAP_TWIP ); - long nW = GetCoreValue( *m_pPaperWidthEdit, MAP_TWIP ); + long nH = GetCoreValue( *m_pPaperHeightEdit, MapUnit::MapTwip ); + long nW = GetCoreValue( *m_pPaperWidthEdit, MapUnit::MapTwip ); long nWidth = nBL + nBR + MINBODY; long nHeight = nBT + nBB + MINBODY; @@ -1560,9 +1560,9 @@ void SvxPageDescPage::CalcMargin_Impl() nTmp -= nWidth - nW; if ( nBL <= nBR ) - SetMetricValue( *m_pRightMarginEdit, nTmp, MAP_TWIP ); + SetMetricValue( *m_pRightMarginEdit, nTmp, MapUnit::MapTwip ); else - SetMetricValue( *m_pLeftMarginEdit, nTmp, MAP_TWIP ); + SetMetricValue( *m_pLeftMarginEdit, nTmp, MapUnit::MapTwip ); } if ( nHeight > nH ) @@ -1571,9 +1571,9 @@ void SvxPageDescPage::CalcMargin_Impl() nTmp -= nHeight - nH; if ( nBT <= nBB ) - SetMetricValue( *m_pBottomMarginEdit, nTmp, MAP_TWIP ); + SetMetricValue( *m_pBottomMarginEdit, nTmp, MapUnit::MapTwip ); else - SetMetricValue( *m_pTopMarginEdit, nTmp, MAP_TWIP ); + SetMetricValue( *m_pTopMarginEdit, nTmp, MapUnit::MapTwip ); } } } diff --git a/cui/source/tabpages/paragrph.cxx b/cui/source/tabpages/paragrph.cxx index 1266cc67d36c..55a080c66d2d 100644 --- a/cui/source/tabpages/paragrph.cxx +++ b/cui/source/tabpages/paragrph.cxx @@ -365,7 +365,7 @@ bool SvxStdParagraphTabPage::FillItemSet( SfxItemSet* rOutSet ) if ( bNullTab ) { MapUnit eUnit = (MapUnit)pPool->GetMetric( GetWhich( SID_ATTR_TABSTOP ) ); - if ( MAP_100TH_MM != eUnit ) + if ( MapUnit::Map100thMM != eUnit ) { // negative first line indent -> set null default tabstob if applicable @@ -837,7 +837,7 @@ IMPL_LINK( SvxStdParagraphTabPage, LineDistHdl_Impl, ListBox&, rBox, void ) // if the value has been changed at SetMin, // it is time for the default if ( m_pLineDistAtMetricBox->GetValue() != nTemp ) - SetMetricValue( *m_pLineDistAtMetricBox, FIX_DIST_DEF, MAP_TWIP ); // fix is only in Writer + SetMetricValue( *m_pLineDistAtMetricBox, FIX_DIST_DEF, MapUnit::MapTwip ); // fix is only in Writer m_pLineDistAtPercentBox->Hide(); m_pLineDistAtMetricBox->Show(); m_pLineDistAtMetricBox->Enable(); @@ -908,7 +908,7 @@ void SvxStdParagraphTabPage::UpdateExample_Impl() case LLINESPACE_DURCH: case LLINESPACE_FIX: m_pExampleWin->SetLineSpace( (SvxPrevLineSpace)nPos, - (sal_uInt16)GetCoreValue( *m_pLineDistAtMetricBox, MAP_TWIP ) ); + (sal_uInt16)GetCoreValue( *m_pLineDistAtMetricBox, MapUnit::MapTwip ) ); break; } m_pExampleWin->Invalidate(); diff --git a/cui/source/tabpages/tabstpge.cxx b/cui/source/tabpages/tabstpge.cxx index 477ac3bce31a..239406398e9f 100644 --- a/cui/source/tabpages/tabstpge.cxx +++ b/cui/source/tabpages/tabstpge.cxx @@ -224,7 +224,7 @@ bool SvxTabulatorTabPage::FillItemSet(SfxItemSet* rSet) MapUnit eUnit = (MapUnit)pPool->GetMetric(GetWhich(SID_ATTR_TABSTOP)); const SfxPoolItem* pOld = GetOldItem(*rSet, SID_ATTR_TABSTOP); - if (MAP_100TH_MM != eUnit) + if (MapUnit::Map100thMM != eUnit) { // If the ItemSet contains a LRSpaceItem with negative first line indent, // the TabStopItem needs to have a DefTab at position 0. @@ -245,7 +245,7 @@ bool SvxTabulatorTabPage::FillItemSet(SfxItemSet* rSet) for (sal_uInt16 i = 0; i < aNewTabs.Count(); ++i) { SvxTabStop aTmpStop = aNewTabs[i]; - aTmpStop.GetTabPos() = LogicToLogic(aTmpStop.GetTabPos(), MAP_100TH_MM, eUnit); + aTmpStop.GetTabPos() = LogicToLogic(aTmpStop.GetTabPos(), MapUnit::Map100thMM, eUnit); aTmp.Insert(aTmpStop); } @@ -278,7 +278,7 @@ void SvxTabulatorTabPage::Reset(const SfxItemSet* rSet) if (pItem) { - if (MAP_100TH_MM != eUnit) + if (MapUnit::Map100thMM != eUnit) { SvxTabStopItem aTmp(*static_cast<const SvxTabStopItem*>(pItem)); aNewTabs.Remove(0, aNewTabs.Count()); @@ -286,7 +286,7 @@ void SvxTabulatorTabPage::Reset(const SfxItemSet* rSet) for (sal_uInt16 i = 0; i < aTmp.Count(); ++i) { SvxTabStop aTmpStop = aTmp[i]; - aTmpStop.GetTabPos() = LogicToLogic(aTmpStop.GetTabPos(), eUnit, MAP_100TH_MM); + aTmpStop.GetTabPos() = LogicToLogic(aTmpStop.GetTabPos(), eUnit, MapUnit::Map100thMM); aNewTabs.Insert(aTmpStop); } } @@ -301,7 +301,7 @@ void SvxTabulatorTabPage::Reset(const SfxItemSet* rSet) pItem = GetItem(*rSet, SID_ATTR_TABSTOP_DEFAULTS); if (pItem) - nDefDist = LogicToLogic(long(static_cast<const SfxUInt16Item*>(pItem)->GetValue()), eUnit, MAP_100TH_MM); + nDefDist = LogicToLogic(long(static_cast<const SfxUInt16Item*>(pItem)->GetValue()), eUnit, MapUnit::Map100thMM); // Tab pos currently selected sal_uInt16 nTabPos = 0; @@ -373,7 +373,7 @@ void SvxTabulatorTabPage::InitTabPos_Impl( sal_uInt16 nTabPos ) { nOffset = static_cast<const SfxInt32Item*>(pItem)->GetValue(); MapUnit eUnit = (MapUnit)GetItemSet().GetPool()->GetMetric(GetWhich(SID_ATTR_TABSTOP)); - nOffset = OutputDevice::LogicToLogic(nOffset, eUnit, MAP_100TH_MM); + nOffset = OutputDevice::LogicToLogic(nOffset, eUnit, MapUnit::Map100thMM); } // Correct current TabPos and default tabs @@ -479,7 +479,7 @@ IMPL_LINK( SvxTabulatorTabPage, NewHdl_Impl, Button *, pBtn, void ) { nOffset = static_cast<const SfxInt32Item*>(pItem)->GetValue(); MapUnit eUnit = (MapUnit)GetItemSet().GetPool()->GetMetric( GetWhich( SID_ATTR_TABSTOP ) ); - nOffset = OutputDevice::LogicToLogic( nOffset, eUnit, MAP_100TH_MM ); + nOffset = OutputDevice::LogicToLogic( nOffset, eUnit, MapUnit::Map100thMM ); } const long nReal = nVal - nOffset; sal_Int32 nSize = m_pTabBox->GetEntryCount(); diff --git a/cui/source/tabpages/tparea.cxx b/cui/source/tabpages/tparea.cxx index a9022678b390..d89945dbd8e3 100644 --- a/cui/source/tabpages/tparea.cxx +++ b/cui/source/tabpages/tparea.cxx @@ -137,7 +137,7 @@ SvxAreaTabPage::SvxAreaTabPage( vcl::Window* pParent, const SfxItemSet& rInAttrs m_pCtlXRectPreview->EnableRTL(false); // Calculate size of dropdown listboxes - Size aSize = LogicToPixel(Size(108, 103), MAP_APPFONT); + Size aSize = LogicToPixel(Size(108, 103), MapUnit::MapAppFont); m_pLbColor->set_width_request(aSize.Width()); m_pLbColor->set_height_request(aSize.Height()); @@ -151,7 +151,7 @@ SvxAreaTabPage::SvxAreaTabPage( vcl::Window* pParent, const SfxItemSet& rInAttrs m_pLbBitmap->set_height_request(aSize.Height()); // Calculate size of display boxes - Size aSize2 = LogicToPixel(Size(110, 42), MAP_APPFONT); + Size aSize2 = LogicToPixel(Size(110, 42), MapUnit::MapAppFont); m_pCtlBitmapPreview->set_width_request(aSize2.Width()); m_pCtlBitmapPreview->set_height_request(aSize2.Height()); m_pCtlXRectPreview->set_width_request(aSize2.Width()); diff --git a/cui/source/tabpages/tpbitmap.cxx b/cui/source/tabpages/tpbitmap.cxx index 5265f34fbb12..55f8ea55a82e 100644 --- a/cui/source/tabpages/tpbitmap.cxx +++ b/cui/source/tabpages/tpbitmap.cxx @@ -298,12 +298,12 @@ void SvxBitmapTabPage::Reset( const SfxItemSet* rAttrs ) pItem = GetItem( rGeoAttr, SID_ATTR_TRANSFORM_WIDTH ); m_fObjectWidth = std::max( pItem ? (double)static_cast<const SfxUInt32Item*>(pItem)->GetValue() : 0.0, 1.0 ); - double fTmpWidth((OutputDevice::LogicToLogic(static_cast<sal_Int32>(m_fObjectWidth),(MapUnit)mePoolUnit, MAP_100TH_MM )) / fUIScale); + double fTmpWidth((OutputDevice::LogicToLogic(static_cast<sal_Int32>(m_fObjectWidth), mePoolUnit, MapUnit::Map100thMM )) / fUIScale); m_fObjectWidth = fTmpWidth; pItem = GetItem( rGeoAttr, SID_ATTR_TRANSFORM_HEIGHT ); m_fObjectHeight = std::max( pItem ? (double)static_cast<const SfxUInt32Item*>(pItem)->GetValue() : 0.0, 1.0 ); - double fTmpHeight((OutputDevice::LogicToLogic(static_cast<sal_Int32>(m_fObjectHeight),(MapUnit)mePoolUnit, MAP_100TH_MM )) / fUIScale); + double fTmpHeight((OutputDevice::LogicToLogic(static_cast<sal_Int32>(m_fObjectHeight), mePoolUnit, MapUnit::Map100thMM )) / fUIScale); m_fObjectHeight = fTmpHeight; XFillBitmapItem aItem( static_cast<const XFillBitmapItem&>(rAttrs->Get(XATTR_FILLBITMAP)) ); @@ -324,8 +324,8 @@ void SvxBitmapTabPage::Reset( const SfxItemSet* rAttrs ) { BitmapEx aBmpEx(pGraphicObject->GetGraphic().GetBitmapEx()); Size aTempBitmapSize = aBmpEx.GetSizePixel(); - rBitmapSize.Width() = ((OutputDevice::LogicToLogic(static_cast<sal_Int32>(aTempBitmapSize.Width()),MAP_PIXEL, MAP_100TH_MM )) / fUIScale); - rBitmapSize.Height() = ((OutputDevice::LogicToLogic(static_cast<sal_Int32>(aTempBitmapSize.Height()),MAP_PIXEL, MAP_100TH_MM )) / fUIScale); + rBitmapSize.Width() = ((OutputDevice::LogicToLogic(static_cast<sal_Int32>(aTempBitmapSize.Width()),MapUnit::MapPixel, MapUnit::Map100thMM )) / fUIScale); + rBitmapSize.Height() = ((OutputDevice::LogicToLogic(static_cast<sal_Int32>(aTempBitmapSize.Height()),MapUnit::MapPixel, MapUnit::Map100thMM )) / fUIScale); CalculateBitmapPresetSize(); } @@ -376,8 +376,8 @@ void SvxBitmapTabPage::Reset( const SfxItemSet* rAttrs ) if(eRelative != TRISTATE_TRUE) { - nWidth = (OutputDevice::LogicToLogic(static_cast<long>(nWidth),(MapUnit)mePoolUnit, MAP_100TH_MM )) / fUIScale; - nHeight = (OutputDevice::LogicToLogic(static_cast<long>(nHeight),(MapUnit)mePoolUnit, MAP_100TH_MM )) / fUIScale; + nWidth = (OutputDevice::LogicToLogic(static_cast<long>(nWidth), mePoolUnit, MapUnit::Map100thMM )) / fUIScale; + nHeight = (OutputDevice::LogicToLogic(static_cast<long>(nHeight), mePoolUnit, MapUnit::Map100thMM )) / fUIScale; } if(m_pBitmapStyleLB->GetSelectEntryPos() == 0) @@ -537,8 +537,8 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ModifyBitmapHdl, ValueSet*, void) Size aTempBitmapSize = aBmpEx.GetSizePixel(); const double fUIScale(double(mpView->GetModel()->GetUIScale())); - rBitmapSize.Width() = ((OutputDevice::LogicToLogic(static_cast<sal_Int32>(aTempBitmapSize.Width()),MAP_PIXEL, MAP_100TH_MM )) / fUIScale); - rBitmapSize.Height() = ((OutputDevice::LogicToLogic(static_cast<sal_Int32>(aTempBitmapSize.Height()),MAP_PIXEL, MAP_100TH_MM )) / fUIScale); + rBitmapSize.Width() = ((OutputDevice::LogicToLogic(static_cast<sal_Int32>(aTempBitmapSize.Width()),MapUnit::MapPixel, MapUnit::Map100thMM )) / fUIScale); + rBitmapSize.Height() = ((OutputDevice::LogicToLogic(static_cast<sal_Int32>(aTempBitmapSize.Height()),MapUnit::MapPixel, MapUnit::Map100thMM )) / fUIScale); CalculateBitmapPresetSize(); ModifyBitmapStyleHdl( *m_pBitmapStyleLB ); ModifyBitmapPositionHdl( *m_pPositionLB ); diff --git a/cui/source/tabpages/tpcolor.cxx b/cui/source/tabpages/tpcolor.cxx index d0335f325bee..36abaf503b79 100644 --- a/cui/source/tabpages/tpcolor.cxx +++ b/cui/source/tabpages/tpcolor.cxx @@ -72,13 +72,13 @@ SvxColorTabPage::SvxColorTabPage(vcl::Window* pParent, const SfxItemSet& rInAttr { get(m_pSelectPalette, "paletteselector"); get(m_pValSetColorList, "colorset"); - Size aSize = LogicToPixel(Size(100 , 120), MAP_APPFONT); + Size aSize = LogicToPixel(Size(100 , 120), MapUnit::MapAppFont); m_pValSetColorList->set_width_request(aSize.Width()); m_pValSetColorList->set_height_request(aSize.Height()); get(m_pValSetRecentList, "recentcolorset"); get(m_pCtlPreviewOld, "oldpreview"); get(m_pCtlPreviewNew, "newpreview"); - aSize = LogicToPixel(Size(34 , 25), MAP_APPFONT); + aSize = LogicToPixel(Size(34 , 25), MapUnit::MapAppFont); m_pCtlPreviewOld->set_width_request(aSize.Width()); m_pCtlPreviewOld->set_height_request(aSize.Height()); m_pCtlPreviewNew->set_width_request(aSize.Width()); diff --git a/cui/source/tabpages/tpline.cxx b/cui/source/tabpages/tpline.cxx index 6b5ade69f9eb..43f51a5485fd 100644 --- a/cui/source/tabpages/tpline.cxx +++ b/cui/source/tabpages/tpline.cxx @@ -353,7 +353,7 @@ void SvxLineTabPage::InitSymbols(MenuButton* pButton) if(!pButton->GetPopupMenu()->GetPopupMenu( MN_SYMBOLS ) && m_pSymbolList) { ScopedVclPtrInstance< VirtualDevice > pVDev; - pVDev->SetMapMode(MapMode(MAP_100TH_MM)); + pVDev->SetMapMode(MapMode(MapUnit::Map100thMM)); std::unique_ptr<SdrModel> pModel(new SdrModel); pModel->GetItemPool().FreezeIdRanges(); // Page @@ -498,7 +498,7 @@ void SvxLineTabPage::SymbolSelected(MenuButton* pButton) if(pGraphic) { Size aSize = SvxNumberFormat::GetGraphicSizeMM100(pGraphic); - aSize = OutputDevice::LogicToLogic(aSize, MAP_100TH_MM, (MapUnit)m_ePoolUnit); + aSize = OutputDevice::LogicToLogic(aSize, MapUnit::Map100thMM, (MapUnit)m_ePoolUnit); m_aSymbolGraphic=*pGraphic; if( bResetSize ) { @@ -1134,7 +1134,7 @@ void SvxLineTabPage::Reset( const SfxItemSet* rAttrs ) else if(nSymType >= 0) { ScopedVclPtrInstance< VirtualDevice > pVDev; - pVDev->SetMapMode(MapMode(MAP_100TH_MM)); + pVDev->SetMapMode(MapMode(MapUnit::Map100thMM)); std::unique_ptr<SdrModel> pModel(new SdrModel); pModel->GetItemPool().FreezeIdRanges(); @@ -1181,7 +1181,7 @@ void SvxLineTabPage::Reset( const SfxItemSet* rAttrs ) m_aSymbolGraphic=Graphic(aMeta); m_aSymbolSize=pObj->GetSnapRect().GetSize(); m_aSymbolGraphic.SetPrefSize(pInvisibleSquare->GetSnapRect().GetSize()); - m_aSymbolGraphic.SetPrefMapMode(MAP_100TH_MM); + m_aSymbolGraphic.SetPrefMapMode(MapUnit::Map100thMM); bPrevSym=true; bEnable=true; bIgnoreGraphic=true; @@ -1209,7 +1209,7 @@ void SvxLineTabPage::Reset( const SfxItemSet* rAttrs ) { m_aSymbolSize=OutputDevice::LogicToLogic( pGraphic->GetPrefSize(), pGraphic->GetPrefMapMode(), - MAP_100TH_MM ); + MapUnit::Map100thMM ); } bPrevSym=true; } @@ -1733,8 +1733,8 @@ IMPL_LINK( SvxLineTabPage, SizeHdl_Impl, Edit&, rField, void) bool bRatio = m_pSymbolRatioCB->IsChecked(); long nWidthVal = static_cast<long>(m_pSymbolWidthMF->Denormalize(m_pSymbolWidthMF->GetValue(FUNIT_100TH_MM))); long nHeightVal= static_cast<long>(m_pSymbolHeightMF->Denormalize(m_pSymbolHeightMF->GetValue(FUNIT_100TH_MM))); - nWidthVal = OutputDevice::LogicToLogic(nWidthVal,MAP_100TH_MM,(MapUnit)m_ePoolUnit ); - nHeightVal = OutputDevice::LogicToLogic(nHeightVal,MAP_100TH_MM,(MapUnit)m_ePoolUnit); + nWidthVal = OutputDevice::LogicToLogic(nWidthVal,MapUnit::Map100thMM,(MapUnit)m_ePoolUnit ); + nHeightVal = OutputDevice::LogicToLogic(nHeightVal,MapUnit::Map100thMM,(MapUnit)m_ePoolUnit); m_aSymbolSize = Size(nWidthVal,nHeightVal); double fSizeRatio = (double)1; @@ -1753,7 +1753,7 @@ IMPL_LINK( SvxLineTabPage, SizeHdl_Impl, Edit&, rField, void) if (bRatio) { m_aSymbolSize.Height() = m_aSymbolLastSize.Height() + (long)((double)nDelta / fSizeRatio); - m_aSymbolSize.Height() = OutputDevice::LogicToLogic( m_aSymbolSize.Height(),(MapUnit)m_ePoolUnit, MAP_100TH_MM ); + m_aSymbolSize.Height() = OutputDevice::LogicToLogic( m_aSymbolSize.Height(),(MapUnit)m_ePoolUnit, MapUnit::Map100thMM ); m_pSymbolHeightMF->SetUserValue(m_pSymbolHeightMF->Normalize(m_aSymbolSize.Height()), FUNIT_100TH_MM); } } @@ -1764,7 +1764,7 @@ IMPL_LINK( SvxLineTabPage, SizeHdl_Impl, Edit&, rField, void) if (bRatio) { m_aSymbolSize.Width() = m_aSymbolLastSize.Width() + (long)((double)nDelta * fSizeRatio); - m_aSymbolSize.Width() = OutputDevice::LogicToLogic( m_aSymbolSize.Width(), (MapUnit)m_ePoolUnit, MAP_100TH_MM ); + m_aSymbolSize.Width() = OutputDevice::LogicToLogic( m_aSymbolSize.Width(), (MapUnit)m_ePoolUnit, MapUnit::Map100thMM ); m_pSymbolWidthMF->SetUserValue(m_pSymbolWidthMF->Normalize(m_aSymbolSize.Width()), FUNIT_100TH_MM); } } diff --git a/cui/source/tabpages/transfrm.cxx b/cui/source/tabpages/transfrm.cxx index d673aa64725a..98d1f9b765f4 100644 --- a/cui/source/tabpages/transfrm.cxx +++ b/cui/source/tabpages/transfrm.cxx @@ -900,8 +900,8 @@ void SvxPositionSizeTabPage::Construct() // take UI units into account const sal_uInt16 nDigits(m_pMtrPosX->GetDecimalDigits()); - TransfrmHelper::ConvertRect( maWorkRange, nDigits, (MapUnit) mePoolUnit, meDlgUnit ); - TransfrmHelper::ConvertRect( maRange, nDigits, (MapUnit) mePoolUnit, meDlgUnit ); + TransfrmHelper::ConvertRect( maWorkRange, nDigits, mePoolUnit, meDlgUnit ); + TransfrmHelper::ConvertRect( maRange, nDigits, mePoolUnit, meDlgUnit ); SetMinMaxPosition(); } @@ -969,14 +969,14 @@ bool SvxPositionSizeTabPage::FillItemSet( SfxItemSet* rOutAttrs ) double nWidth = static_cast<double>(m_pMtrWidth->GetValue( meDlgUnit )); nWidth = MetricField::ConvertDoubleValue( nWidth, m_pMtrWidth->GetBaseValue(), m_pMtrWidth->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 = static_cast<long>(m_pMtrWidth->Denormalize( lWidth )); // get Height double nHeight = static_cast<double>(m_pMtrHeight->GetValue( meDlgUnit )); nHeight = MetricField::ConvertDoubleValue( nHeight, m_pMtrHeight->GetBaseValue(), m_pMtrHeight->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 = static_cast<long>(m_pMtrHeight->Denormalize( lHeight )); // put Width & Height to itemset @@ -1073,7 +1073,7 @@ void SvxPositionSizeTabPage::Reset( const SfxItemSet* ) { // #i75273# set width pItem = GetItem( mrOutAttrs, SID_ATTR_TRANSFORM_WIDTH ); mfOldWidth = std::max( pItem ? (double)static_cast<const SfxUInt32Item*>(pItem)->GetValue() : 0.0, 1.0 ); - double fTmpWidth((OutputDevice::LogicToLogic(static_cast<sal_Int32>(mfOldWidth), (MapUnit)mePoolUnit, MAP_100TH_MM)) / fUIScale); + double fTmpWidth((OutputDevice::LogicToLogic(static_cast<sal_Int32>(mfOldWidth), mePoolUnit, MapUnit::Map100thMM)) / fUIScale); if(m_pMtrWidth->GetDecimalDigits()) fTmpWidth *= pow(10.0, m_pMtrWidth->GetDecimalDigits()); @@ -1085,7 +1085,7 @@ void SvxPositionSizeTabPage::Reset( const SfxItemSet* ) { // #i75273# set height pItem = GetItem( mrOutAttrs, SID_ATTR_TRANSFORM_HEIGHT ); mfOldHeight = std::max( pItem ? (double)static_cast<const SfxUInt32Item*>(pItem)->GetValue() : 0.0, 1.0 ); - double fTmpHeight((OutputDevice::LogicToLogic(static_cast<sal_Int32>(mfOldHeight), (MapUnit)mePoolUnit, MAP_100TH_MM)) / fUIScale); + double fTmpHeight((OutputDevice::LogicToLogic(static_cast<sal_Int32>(mfOldHeight), mePoolUnit, MapUnit::Map100thMM)) / fUIScale); if(m_pMtrHeight->GetDecimalDigits()) fTmpHeight *= pow(10.0, m_pMtrHeight->GetDecimalDigits()); @@ -1310,7 +1310,7 @@ void SvxPositionSizeTabPage::SetMinMaxPosition() } } - 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); |