diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-09-18 10:29:03 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-09-18 15:22:40 +0200 |
commit | d7f2c36d25dd693ac4ac3ab645ee841e617d2bd1 (patch) | |
tree | 46516895aefcb6e8f54dd286c6af9d89fbecb44d /svtools | |
parent | 5d86154f49d713dada4aaa541755076cfeefa2c6 (diff) |
loplugin:unusedmethods
Change-Id: I5f63ac44654ed3fc658e72e0d1148a5a22decc47
Reviewed-on: https://gerrit.libreoffice.org/60662
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/source/control/ctrlbox.cxx | 156 |
1 files changed, 0 insertions, 156 deletions
diff --git a/svtools/source/control/ctrlbox.cxx b/svtools/source/control/ctrlbox.cxx index 432663803437..1ff8801d316a 100644 --- a/svtools/source/control/ctrlbox.cxx +++ b/svtools/source/control/ctrlbox.cxx @@ -1083,144 +1083,6 @@ void FontStyleBox::Modify() ComboBox::Modify(); } -void FontStyleBox::Fill( const OUString& rName, const FontList* pList ) -{ - // note: this method must call ComboBox::SetText(), - // else aLastStyle will overwritten - // store prior selection position and clear box - OUString aOldText = GetText(); - sal_Int32 nPos = GetEntryPos( aOldText ); - Clear(); - - // does a font with this name already exist? - sal_Handle hFontMetric = pList->GetFirstFontMetric( rName ); - if ( hFontMetric ) - { - OUString aStyleText; - FontWeight eLastWeight = WEIGHT_DONTKNOW; - FontItalic eLastItalic = ITALIC_NONE; - FontWidth eLastWidth = WIDTH_DONTKNOW; - bool bNormal = false; - bool bItalic = false; - bool bBold = false; - bool bBoldItalic = false; - bool bInsert = false; - FontMetric aFontMetric; - while ( hFontMetric ) - { - aFontMetric = FontList::GetFontMetric( hFontMetric ); - - FontWeight eWeight = aFontMetric.GetWeight(); - FontItalic eItalic = aFontMetric.GetItalic(); - FontWidth eWidth = aFontMetric.GetWidthType(); - // Only if the attributes are different, we insert the - // Font to avoid double Entries in different languages - if ( (eWeight != eLastWeight) || (eItalic != eLastItalic) || - (eWidth != eLastWidth) ) - { - if ( bInsert ) - InsertEntry( aStyleText ); - - if ( eWeight <= WEIGHT_NORMAL ) - { - if ( eItalic != ITALIC_NONE ) - bItalic = true; - else - bNormal = true; - } - else - { - if ( eItalic != ITALIC_NONE ) - bBoldItalic = true; - else - bBold = true; - } - - // For wrong StyleNames we replace this with the correct once - aStyleText = pList->GetStyleName( aFontMetric ); - bInsert = GetEntryPos( aStyleText ) == LISTBOX_ENTRY_NOTFOUND; - if ( !bInsert ) - { - aStyleText = pList->GetStyleName( eWeight, eItalic ); - bInsert = GetEntryPos( aStyleText ) == LISTBOX_ENTRY_NOTFOUND; - } - - eLastWeight = eWeight; - eLastItalic = eItalic; - eLastWidth = eWidth; - } - else - { - if ( bInsert ) - { - // If we have two names for the same attributes - // we prefer the translated standard names - const OUString& rAttrStyleText = pList->GetStyleName( eWeight, eItalic ); - if (rAttrStyleText != aStyleText) - { - OUString aTempStyleText = pList->GetStyleName( aFontMetric ); - if (rAttrStyleText == aTempStyleText) - aStyleText = rAttrStyleText; - bInsert = GetEntryPos( aStyleText ) == LISTBOX_ENTRY_NOTFOUND; - } - } - } - - if ( !bItalic && (aStyleText == pList->GetItalicStr()) ) - bItalic = true; - else if ( !bBold && (aStyleText == pList->GetBoldStr()) ) - bBold = true; - else if ( !bBoldItalic && (aStyleText == pList->GetBoldItalicStr()) ) - bBoldItalic = true; - - hFontMetric = FontList::GetNextFontMetric( hFontMetric ); - } - - if ( bInsert ) - InsertEntry( aStyleText ); - - // certain style as copy - if ( bNormal ) - { - if ( !bItalic ) - InsertEntry( pList->GetItalicStr() ); - if ( !bBold ) - InsertEntry( pList->GetBoldStr() ); - } - if ( !bBoldItalic ) - { - if ( bNormal || bItalic || bBold ) - InsertEntry( pList->GetBoldItalicStr() ); - } - if (!aOldText.isEmpty()) - { - if ( GetEntryPos( aLastStyle ) != LISTBOX_ENTRY_NOTFOUND ) - ComboBox::SetText( aLastStyle ); - else - { - if ( nPos >= GetEntryCount() ) - ComboBox::SetText( GetEntry( 0 ) ); - else - ComboBox::SetText( GetEntry( nPos ) ); - } - } - } - else - { - // insert standard styles if no font - InsertEntry( pList->GetNormalStr() ); - InsertEntry( pList->GetItalicStr() ); - InsertEntry( pList->GetBoldStr() ); - InsertEntry( pList->GetBoldItalicStr() ); - if (!aOldText.isEmpty()) - { - if ( nPos > GetEntryCount() ) - ComboBox::SetText( GetEntry( 0 ) ); - else - ComboBox::SetText( GetEntry( nPos ) ); - } - } -} SvtFontStyleBox::SvtFontStyleBox(std::unique_ptr<weld::ComboBox> p) : m_xComboBox(std::move(p)) @@ -1568,24 +1430,6 @@ void FontSizeBox::Fill( const FontMetric* pFontMetric, const FontList* pList ) SetSelection( aSelection ); } -void FontSizeBox::EnableRelativeMode( sal_uInt16 nMin, sal_uInt16 nMax, sal_uInt16 nStep ) -{ - bRelativeMode = true; - nRelMin = nMin; - nRelMax = nMax; - nRelStep = nStep; - SetUnit( FUNIT_POINT ); -} - -void FontSizeBox::EnablePtRelativeMode( short nMin, short nMax, short nStep ) -{ - bRelativeMode = true; - nPtRelMin = nMin; - nPtRelMax = nMax; - nPtRelStep = nStep; - SetUnit( FUNIT_POINT ); -} - void FontSizeBox::SetRelative( bool bNewRelative ) { if ( !bRelativeMode ) |