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 /sw/source/ui/config/optpage.cxx | |
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 'sw/source/ui/config/optpage.cxx')
-rw-r--r-- | sw/source/ui/config/optpage.cxx | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/sw/source/ui/config/optpage.cxx b/sw/source/ui/config/optpage.cxx index 05335159f7ec..bd0ab49f141e 100644 --- a/sw/source/ui/config/optpage.cxx +++ b/sw/source/ui/config/optpage.cxx @@ -648,7 +648,7 @@ static void lcl_SetColl(SwWrtShell* pWrtShell, sal_uInt16 nType, sal_Int32 nHeight, sal_uInt16 nFontHeightWhich) { float fSize = (float)nHeight / 10; - nHeight = CalcToUnit( fSize, MAP_TWIP ); + nHeight = CalcToUnit( fSize, MapUnit::MapTwip ); SwTextFormatColl *pColl = pWrtShell->GetTextCollFromPool(nType); pColl->SetFormatAttr(SvxFontHeightItem(nHeight, 100, nFontHeightWhich)); } @@ -677,27 +677,27 @@ bool SwStdFontTabPage::FillItemSet( SfxItemSet* ) if(bStandardHeightChanged) { float fSize = (float)m_pStandardHeightLB->GetValue() / 10; - m_pFontConfig->SetFontHeight( CalcToUnit( fSize, MAP_TWIP ), FONT_STANDARD, m_nFontGroup ); + m_pFontConfig->SetFontHeight( CalcToUnit( fSize, MapUnit::MapTwip ), FONT_STANDARD, m_nFontGroup ); } if(bTitleHeightChanged) { float fSize = (float)m_pTitleHeightLB->GetValue() / 10; - m_pFontConfig->SetFontHeight( CalcToUnit( fSize, MAP_TWIP ), FONT_OUTLINE, m_nFontGroup ); + m_pFontConfig->SetFontHeight( CalcToUnit( fSize, MapUnit::MapTwip ), FONT_OUTLINE, m_nFontGroup ); } if(bListHeightChanged) { float fSize = (float)m_pListHeightLB->GetValue() / 10; - m_pFontConfig->SetFontHeight( CalcToUnit( fSize, MAP_TWIP ), FONT_LIST, m_nFontGroup ); + m_pFontConfig->SetFontHeight( CalcToUnit( fSize, MapUnit::MapTwip ), FONT_LIST, m_nFontGroup ); } if(bLabelHeightChanged) { float fSize = (float)m_pLabelHeightLB->GetValue() / 10; - m_pFontConfig->SetFontHeight( CalcToUnit( fSize, MAP_TWIP ), FONT_CAPTION, m_nFontGroup ); + m_pFontConfig->SetFontHeight( CalcToUnit( fSize, MapUnit::MapTwip ), FONT_CAPTION, m_nFontGroup ); } if(bIndexHeightChanged) { float fSize = (float)m_pIndexHeightLB->GetValue() / 10; - m_pFontConfig->SetFontHeight( CalcToUnit( fSize, MAP_TWIP ), FONT_INDEX, m_nFontGroup ); + m_pFontConfig->SetFontHeight( CalcToUnit( fSize, MapUnit::MapTwip ), FONT_INDEX, m_nFontGroup ); } if(m_pWrtShell) @@ -725,7 +725,7 @@ bool SwStdFontTabPage::FillItemSet( SfxItemSet* ) if(bStandardHeightChanged) { float fSize = (float)m_pStandardHeightLB->GetValue() / 10; - m_pWrtShell->SetDefault(SvxFontHeightItem( CalcToUnit( fSize, MAP_TWIP ), 100, nFontHeightWhich ) ); + m_pWrtShell->SetDefault(SvxFontHeightItem( CalcToUnit( fSize, MapUnit::MapTwip ), 100, nFontHeightWhich ) ); SwTextFormatColl *pColl = m_pWrtShell->GetTextCollFromPool(RES_POOLCOLL_STANDARD); pColl->ResetFormatAttr(nFontHeightWhich); bMod = true; @@ -949,11 +949,11 @@ void SwStdFontTabPage::Reset( const SfxItemSet* rSet) aFontMetric = m_pFontList->Get(sIdxBackup, sIdxBackup ); m_pIndexHeightLB->Fill( &aFontMetric, m_pFontList ); - m_pStandardHeightLB->SetValue( CalcToPoint( nStandardHeight, MAP_TWIP, 10 ) ); - m_pTitleHeightLB-> SetValue( CalcToPoint( nTitleHeight , MAP_TWIP, 10 ) ); - m_pListHeightLB-> SetValue( CalcToPoint( nListHeight , MAP_TWIP, 10 ) ); - m_pLabelHeightLB-> SetValue( CalcToPoint( nLabelHeight , MAP_TWIP, 10 )); - m_pIndexHeightLB-> SetValue( CalcToPoint( nIndexHeight , MAP_TWIP, 10 )); + m_pStandardHeightLB->SetValue( CalcToPoint( nStandardHeight, MapUnit::MapTwip, 10 ) ); + m_pTitleHeightLB-> SetValue( CalcToPoint( nTitleHeight , MapUnit::MapTwip, 10 ) ); + m_pListHeightLB-> SetValue( CalcToPoint( nListHeight , MapUnit::MapTwip, 10 ) ); + m_pLabelHeightLB-> SetValue( CalcToPoint( nLabelHeight , MapUnit::MapTwip, 10 )); + m_pIndexHeightLB-> SetValue( CalcToPoint( nIndexHeight , MapUnit::MapTwip, 10 )); m_pStandardBox->SaveValue(); m_pTitleBox->SaveValue(); @@ -985,19 +985,19 @@ IMPL_LINK_NOARG(SwStdFontTabPage, StandardHdl, Button*, void) m_pStandardHeightLB->SetValue( CalcToPoint( SwStdFontConfig::GetDefaultHeightFor(FONT_STANDARD + nFontOffset, m_eLanguage), - MAP_TWIP, 10 ) ); + MapUnit::MapTwip, 10 ) ); m_pTitleHeightLB ->SetValue(CalcToPoint( SwStdFontConfig::GetDefaultHeightFor(FONT_OUTLINE + - nFontOffset, m_eLanguage), MAP_TWIP, 10 )); + nFontOffset, m_eLanguage), MapUnit::MapTwip, 10 )); m_pListHeightLB ->SetValue(CalcToPoint( SwStdFontConfig::GetDefaultHeightFor(FONT_LIST + nFontOffset, m_eLanguage), - MAP_TWIP, 10 )); + MapUnit::MapTwip, 10 )); m_pLabelHeightLB ->SetValue(CalcToPoint( SwStdFontConfig::GetDefaultHeightFor(FONT_CAPTION + nFontOffset, m_eLanguage), - MAP_TWIP, 10 )); + MapUnit::MapTwip, 10 )); m_pIndexHeightLB ->SetValue(CalcToPoint( SwStdFontConfig::GetDefaultHeightFor(FONT_INDEX + nFontOffset, m_eLanguage), - MAP_TWIP, 10 )); + MapUnit::MapTwip, 10 )); } IMPL_LINK( SwStdFontTabPage, ModifyHdl, Edit&, rBox, void ) @@ -1570,7 +1570,7 @@ SwMarkPreview::SwMarkPreview( vcl::Window *pParent, WinBits nWinBits ) : { m_aInitialSize = getPreviewOptionsSize(this); InitColors(); - SetMapMode(MAP_PIXEL); + SetMapMode(MapUnit::MapPixel); } VCL_BUILDER_FACTORY_ARGS(SwMarkPreview, 0) |