summaryrefslogtreecommitdiff
path: root/sw/source/ui
diff options
context:
space:
mode:
authorChris Sherlock <chris.sherlock79@gmail.com>2021-09-21 07:19:15 +1000
committerMike Kaganski <mike.kaganski@collabora.com>2021-09-21 07:54:59 +0200
commitf5a81a119cb63152c2c2e2473a1ea183a30c8db9 (patch)
treeba72abd1a3ab858f38a6716ed9bdb059018fde36 /sw/source/ui
parent4bd09020870e708b7ff1500356952d15fb52836d (diff)
vcl: remove OutputDevice's GetDevFontSizeCount() and GetDevFontSize()
The OutputDevice::GetDevFontSize() function is only used for non-scalable (bitmap) fonts. We have stopped supporting bitmap fonts since LO 5.3, see tdf#103514: Support for bitmap-only fonts on Windows has been removed (Khaled Hosny) I found the following when removing PhysicalFontFace::SetBitmapSize(): 1. as mnHeight and mnWidth and not set by anyone, I realized I could remove them, which meant removing GetHeight() and GetWidth() 2. PhysicalFontFamily::GetFontHeights() populates heights from the collection of font faces into a sorted vector of font heights taken from PhysicalFontFace. As this no longer exists this function serves no purpose, it has been removed. 3. PhysicalFontFamily::GetDeviceFontSizeList() calls upon PhysicalFontFace::GetFontHeights(). This function takes this sorted list of font heights, and then populates and returns a new list of sizes (or rather, heights). As the heights aren't available any more, this function is also unneeded, so it has been removed. 4. OutputDevice::GetDevFontSizeCount() calls upon PhysicalFontFamily::GetDeviceFontSizeList(). This function has the side effect of initializing the list of fonts. 5. When I checked what calls on GetDevFontSizeCount(), there is only one caller - FontList::GetSizeAry() in svtools. The function returns a standard font size list if the family name is empty, or there are no font sizes (via OutputDevice::GetDevFontSizeCount()). As this will *always* be empty (see chain above) then this function just needs to always return a standard font size list. Thus OutputDevice::GetDevFontSizeCount() and GetFontSizeList() are no longer called upon by anything, so they can be removed. 6. svtool's FontList::GetSizeAry() no longer uses the FontMetric parameter, so this has been removed from the function signature, and cleanup done of the function that calls upon it in svtools, framework, editeng, and desktop. A number of variables that were no longer used due to this change were also removed. 7. This change removed the need for the mpSizeAry unique_ptr in FontList. ImplFontListFontMetric::GetDevice() and mpDevice could also be removed as it was no longer used anywhere. 8. After simplifying GetSizeAry(), it turns out it was the same as GetStdSizeAry(), so removed FontList::GetSizeAry() and used FontList::GetStdSizeAry() in its place. 9. Changing to use GetStdSizeAry() revealed that FontSizeBox::Fill() no longer used the pFontMetric paramter, so this was removed, and call sites updated. 10. Due to change to Fill(): a. SvxFontSizeBox_Base::UpdateFont() no longer uses the const css::awt::FontDescriptor& rCurrentFont parameter, so removed this. This also removed the member variable m_aCurrentFont b. SvxCharNamePage::FillSizeBox_Impl() had a number of newly unused variables removed. c. SwStdFontTabPage::Reset() and SwStdFontTabPage::LoseFocusHdl() had a number of newly unused variables removed. Change-Id: If840e240155c36ed351c63e3136b5b44bb058697 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121932 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sw/source/ui')
-rw-r--r--sw/source/ui/config/optpage.cxx21
1 files changed, 8 insertions, 13 deletions
diff --git a/sw/source/ui/config/optpage.cxx b/sw/source/ui/config/optpage.cxx
index cd1ef329e70b..eb5da1804e48 100644
--- a/sw/source/ui/config/optpage.cxx
+++ b/sw/source/ui/config/optpage.cxx
@@ -884,16 +884,11 @@ void SwStdFontTabPage::Reset( const SfxItemSet* rSet)
m_xLabelBox->set_entry_text(sCapBackup );
m_xIdxBox->set_entry_text(sIdxBackup );
- FontMetric aFontMetric( m_pFontList->Get(sStdBackup, sStdBackup) );
- m_xStandardHeightLB->Fill( &aFontMetric, m_pFontList.get() );
- aFontMetric = m_pFontList->Get(sOutBackup, sOutBackup );
- m_xTitleHeightLB->Fill( &aFontMetric, m_pFontList.get() );
- aFontMetric = m_pFontList->Get(sListBackup,sListBackup);
- m_xListHeightLB->Fill( &aFontMetric, m_pFontList.get() );
- aFontMetric = m_pFontList->Get(sCapBackup, sCapBackup );
- m_xLabelHeightLB->Fill( &aFontMetric, m_pFontList.get() );
- aFontMetric = m_pFontList->Get(sIdxBackup, sIdxBackup );
- m_xIndexHeightLB->Fill( &aFontMetric, m_pFontList.get() );
+ m_xStandardHeightLB->Fill( m_pFontList.get() );
+ m_xTitleHeightLB->Fill( m_pFontList.get() );
+ m_xListHeightLB->Fill( m_pFontList.get() );
+ m_xLabelHeightLB->Fill( m_pFontList.get() );
+ m_xIndexHeightLB->Fill( m_pFontList.get() );
m_xStandardHeightLB->set_value( CalcToPoint( nStandardHeight, MapUnit::MapTwip, 10 ) );
m_xTitleHeightLB->set_value( CalcToPoint( nTitleHeight , MapUnit::MapTwip, 10 ) );
@@ -976,7 +971,7 @@ IMPL_LINK( SwStdFontTabPage, LoseFocusHdl, weld::Widget&, rControl, void )
{
weld::ComboBox& rBox = dynamic_cast<weld::ComboBox&>(rControl);
FontSizeBox* pHeightLB = nullptr;
- const OUString sEntry = rBox.get_active_text();
+
if (&rBox == m_xStandardBox.get())
{
pHeightLB = m_xStandardHeightLB.get();
@@ -997,8 +992,8 @@ IMPL_LINK( SwStdFontTabPage, LoseFocusHdl, weld::Widget&, rControl, void )
{
pHeightLB = m_xIndexHeightLB.get();
}
- FontMetric aFontMetric( m_pFontList->Get(sEntry, sEntry) );
- pHeightLB->Fill( &aFontMetric, m_pFontList.get() );
+
+ pHeightLB->Fill( m_pFontList.get() );
}
void SwStdFontTabPage::PageCreated( const SfxAllItemSet& aSet)