diff options
author | Chris Sherlock <chris.sherlock79@gmail.com> | 2016-01-04 01:16:47 +1100 |
---|---|---|
committer | Chris Sherlock <chris.sherlock79@gmail.com> | 2016-01-03 16:19:03 +0000 |
commit | 8227b9955e4a06758f3e0a871e49731a0a607608 (patch) | |
tree | 05c35dccc631812ab269b347d1c270ad53c0bcad /cui | |
parent | 542b6253abc43bcc47b986841bfdafc737710c7c (diff) |
vcl: Excise vcl::FontInfo class
This may sound crazy, but literally vcl::FontInfo serves no purpose
that I can see. The inheritance chain is like this:
┌────────────────────────┐
│ │
│ vcl::Font │
│ │
└────────────────────────┘
^
╱ ╲
│
│
┌────────────────────────┐
│ │
│ vcl::FontInfo │
│ │
└────────────────────────┘
^
╱ ╲
│
│
┌────────────────────────┐
│ │
│ FontMetric │
│ │
└────────────────────────┘
vcl::FontInfo (which, incidentally, needs to be put into the vcl
namespace due to collisions with poppler!) literally does nothing
and is acting as a bridge between FontMetric and vcl::Font. Unlike
a bridge though, this bridge doesn't actually *do* anything.
So I'm removing it, which means one less class to deal with in the
vcl fonts world.
Change-Id: I32725669c9bca7fbb0846b6a062135464046e4f6
Reviewed-on: https://gerrit.libreoffice.org/21058
Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
Tested-by: Chris Sherlock <chris.sherlock79@gmail.com>
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/options/fontsubs.cxx | 2 | ||||
-rw-r--r-- | cui/source/tabpages/chardlg.cxx | 18 | ||||
-rw-r--r-- | cui/source/tabpages/numpages.cxx | 2 |
3 files changed, 11 insertions, 11 deletions
diff --git a/cui/source/options/fontsubs.cxx b/cui/source/options/fontsubs.cxx index 2130435bef02..4f7893d12ba1 100644 --- a/cui/source/options/fontsubs.cxx +++ b/cui/source/options/fontsubs.cxx @@ -359,7 +359,7 @@ IMPL_LINK_TYPED(SvxFontSubstTabPage, NonPropFontsHdl, Button*, pBox, void) sal_uInt16 nFontCount = aFntLst.GetFontNameCount(); for(sal_uInt16 nFont = 0; nFont < nFontCount; nFont++) { - const vcl::FontInfo& rInfo = aFntLst.GetFontName( nFont ); + const FontMetric& rInfo = aFntLst.GetFontName( nFont ); if(!bNonPropOnly || rInfo.GetPitch() == PITCH_FIXED) m_pFontNameLB->InsertEntry(rInfo.GetName()); } diff --git a/cui/source/tabpages/chardlg.cxx b/cui/source/tabpages/chardlg.cxx index ed1a26d09546..1747888e071b 100644 --- a/cui/source/tabpages/chardlg.cxx +++ b/cui/source/tabpages/chardlg.cxx @@ -474,7 +474,7 @@ const FontList* SvxCharNamePage::GetFontList() const namespace { - vcl::FontInfo calcFontInfo( SvxFont& _rFont, + FontMetric calcFontInfo( SvxFont& _rFont, SvxCharNamePage* _pPage, const FontNameBox* _pFontNameLB, const FontStyleBox* _pFontStyleLB, @@ -486,7 +486,7 @@ namespace { Size aSize = _rFont.GetSize(); aSize.Width() = 0; - vcl::FontInfo aFontInfo; + FontMetric aFontInfo; OUString sFontName(_pFontNameLB->GetText()); bool bFontAvailable = _pFontList->IsAvailable( sFontName ); if (bFontAvailable || _pFontNameLB->IsValueChangedFromSaved()) @@ -559,19 +559,19 @@ void SvxCharNamePage::UpdatePreview_Impl() // Font const FontList* pFontList = GetFontList(); - vcl::FontInfo aWestFontInfo = calcFontInfo(rFont, this, m_pWestFontNameLB, + FontMetric aWestFontInfo = calcFontInfo(rFont, this, m_pWestFontNameLB, m_pWestFontStyleLB, m_pWestFontSizeLB, m_pWestFontLanguageLB, pFontList, GetWhich(SID_ATTR_CHAR_FONT), GetWhich(SID_ATTR_CHAR_FONTHEIGHT)); m_pWestFontTypeFT->SetText(pFontList->GetFontMapText(aWestFontInfo)); - vcl::FontInfo aEastFontInfo = calcFontInfo(rCJKFont, this, m_pEastFontNameLB, + FontMetric aEastFontInfo = calcFontInfo(rCJKFont, this, m_pEastFontNameLB, m_pEastFontStyleLB, m_pEastFontSizeLB, m_pEastFontLanguageLB, pFontList, GetWhich(SID_ATTR_CHAR_CJK_FONT), GetWhich(SID_ATTR_CHAR_CJK_FONTHEIGHT)); m_pEastFontTypeFT->SetText(pFontList->GetFontMapText(aEastFontInfo)); - vcl::FontInfo aCTLFontInfo = calcFontInfo(rCTLFont, + FontMetric aCTLFontInfo = calcFontInfo(rCTLFont, this, m_pCTLFontNameLB, m_pCTLFontStyleLB, m_pCTLFontSizeLB, m_pCTLFontLanguageLB, pFontList, GetWhich(SID_ATTR_CHAR_CTL_FONT), GetWhich(SID_ATTR_CHAR_CTL_FONTHEIGHT)); @@ -648,7 +648,7 @@ void SvxCharNamePage::FillSizeBox_Impl( const FontNameBox* pNameBox ) return; } - vcl::FontInfo _aFontInfo( pFontList->Get( pNameBox->GetText(), pStyleBox->GetText() ) ); + FontMetric _aFontInfo( pFontList->Get( pNameBox->GetText(), pStyleBox->GetText() ) ); pSizeBox->Fill( &_aFontInfo, pFontList ); } @@ -759,7 +759,7 @@ void SvxCharNamePage::Reset_Impl( const SfxItemSet& rSet, LanguageGroup eLangGrp // currently chosen font if ( bStyle && pFontItem ) { - vcl::FontInfo aInfo = pFontList->Get( pFontItem->GetFamilyName(), eWeight, eItalic ); + FontMetric aInfo = pFontList->Get( pFontItem->GetFamilyName(), eWeight, eItalic ); pStyleBox->SetText( pFontList->GetStyleName( aInfo ) ); } else if ( !m_pImpl->m_bInSearchMode || !bStyle ) @@ -768,7 +768,7 @@ void SvxCharNamePage::Reset_Impl( const SfxItemSet& rSet, LanguageGroup eLangGrp } else if ( bStyle ) { - vcl::FontInfo aInfo = pFontList->Get( OUString(), eWeight, eItalic ); + FontMetric aInfo = pFontList->Get( OUString(), eWeight, eItalic ); pStyleBox->SetText( pFontList->GetStyleName( aInfo ) ); } if (!bStyleAvailable) @@ -930,7 +930,7 @@ bool SvxCharNamePage::FillItemSet_Impl( SfxItemSet& rSet, LanguageGroup eLangGrp sal_Int32 nEntryPos = pStyleBox->GetEntryPos( aStyleBoxText ); if ( nEntryPos >= m_pImpl->m_nExtraEntryPos ) aStyleBoxText.clear(); - vcl::FontInfo aInfo( pFontList->Get( rFontName, aStyleBoxText ) ); + FontMetric aInfo( pFontList->Get( rFontName, aStyleBoxText ) ); SvxFontItem aFontItem( aInfo.GetFamily(), aInfo.GetName(), aInfo.GetStyleName(), aInfo.GetPitch(), aInfo.GetCharSet(), nWhich ); pOld = GetOldItem( rSet, nSlot ); diff --git a/cui/source/tabpages/numpages.cxx b/cui/source/tabpages/numpages.cxx index c9b5b2a9f56e..0a25a788a1d8 100644 --- a/cui/source/tabpages/numpages.cxx +++ b/cui/source/tabpages/numpages.cxx @@ -736,7 +736,7 @@ IMPL_LINK_NOARG_TYPED(SvxNumPickTabPage, NumSelectHdl_Impl, ValueSet*, void) } if(pList && pList->IsAvailable( pLevelSettings->sBulletFont ) ) { - vcl::FontInfo aInfo = pList->Get( + FontMetric aInfo = pList->Get( pLevelSettings->sBulletFont,WEIGHT_NORMAL, ITALIC_NONE); vcl::Font aFont(aInfo); aFmt.SetBulletFont(&aFont); |