diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-02-05 19:45:45 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-02-06 12:44:26 +0100 |
commit | 17f83e391297f86f264dabd447d48280662b2435 (patch) | |
tree | 9ffd75887d6ccf4180f1473de3b7c40e7b551b53 /svtools/source/control/ctrlbox.cxx | |
parent | 8950cb8ae6a1621729ec43a6dd1c29cf04260797 (diff) |
drop newly unused FontSizeBox
Change-Id: I8a84ce74888e1d3c468251ddd3633aedf6339a11
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88064
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svtools/source/control/ctrlbox.cxx')
-rw-r--r-- | svtools/source/control/ctrlbox.cxx | 146 |
1 files changed, 0 insertions, 146 deletions
diff --git a/svtools/source/control/ctrlbox.cxx b/svtools/source/control/ctrlbox.cxx index 6ecbfd596bc5..5b0cb9fe018a 100644 --- a/svtools/source/control/ctrlbox.cxx +++ b/svtools/source/control/ctrlbox.cxx @@ -856,152 +856,6 @@ void FontStyleBox::Fill( const OUString& rName, const FontList* pList ) m_xComboBox->thaw(); } -FontSizeBox::FontSizeBox( vcl::Window* pParent, WinBits nWinSize ) : - MetricBox( pParent, nWinSize ) -{ - EnableSelectAll(); - ImplInit(); -} - -void FontSizeBox::ImplInit() -{ - EnableAutocomplete( false ); - - bStdSize = false; - - SetShowTrailingZeros( false ); - SetDecimalDigits( 1 ); - SetMin( 20 ); - SetMax( 9999 ); - SetProminentEntryType( ProminentEntry::MIDDLE ); -} - -void FontSizeBox::Reformat() -{ - FontSizeNames aFontSizeNames( GetSettings().GetUILanguageTag().getLanguageType() ); - long nNewValue = aFontSizeNames.Name2Size( GetText() ); - if ( nNewValue) - { - mnLastValue = nNewValue; - return; - } - - MetricBox::Reformat(); -} - -void FontSizeBox::Fill( const FontMetric* pFontMetric, const FontList* pList ) -{ - // query font sizes - const sal_IntPtr* pTempAry; - const sal_IntPtr* pAry = nullptr; - - if( pFontMetric ) - { - pAry = pList->GetSizeAry( *pFontMetric ); - } - else - { - pAry = FontList::GetStdSizeAry(); - } - - // first insert font size names (for simplified/traditional chinese) - FontSizeNames aFontSizeNames( GetSettings().GetUILanguageTag().getLanguageType() ); - if ( pAry == FontList::GetStdSizeAry() ) - { - // for standard sizes we don't need to bother - if ( bStdSize && GetEntryCount() && aFontSizeNames.IsEmpty() ) - return; - bStdSize = true; - } - else - bStdSize = false; - - Selection aSelection = GetSelection(); - OUString aStr = GetText(); - - Clear(); - sal_Int32 nPos = 0; - - if ( !aFontSizeNames.IsEmpty() ) - { - if ( pAry == FontList::GetStdSizeAry() ) - { - // for scalable fonts all font size names - sal_Int32 nCount = aFontSizeNames.Count(); - for( sal_Int32 i = 0; i < nCount; i++ ) - { - OUString aSizeName = aFontSizeNames.GetIndexName( i ); - sal_Int32 nSize = aFontSizeNames.GetIndexSize( i ); - ComboBox::InsertEntry( aSizeName, nPos ); - ComboBox::SetEntryData( nPos, reinterpret_cast<void*>(-nSize) ); // mark as special - nPos++; - } - } - else - { - // for fixed size fonts only selectable font size names - pTempAry = pAry; - while ( *pTempAry ) - { - OUString aSizeName = aFontSizeNames.Size2Name( *pTempAry ); - if ( !aSizeName.isEmpty() ) - { - ComboBox::InsertEntry( aSizeName, nPos ); - ComboBox::SetEntryData( nPos, reinterpret_cast<void*>(-(*pTempAry)) ); // mark as special - nPos++; - } - pTempAry++; - } - } - } - - // then insert numerical font size values - pTempAry = pAry; - while ( *pTempAry ) - { - InsertValue( *pTempAry, FieldUnit::NONE, nPos ); - ComboBox::SetEntryData( nPos, reinterpret_cast<void*>(*pTempAry) ); - nPos++; - pTempAry++; - } - - SetText( aStr ); - SetSelection( aSelection ); -} - -void FontSizeBox::SetValue( sal_Int64 nNewValue, FieldUnit eInUnit ) -{ - sal_Int64 nTempValue = MetricField::ConvertValue( nNewValue, GetBaseValue(), GetDecimalDigits(), eInUnit, GetUnit() ); - FontSizeNames aFontSizeNames( GetSettings().GetUILanguageTag().getLanguageType() ); - // conversion loses precision; however font sizes should - // never have a problem with that - OUString aName = aFontSizeNames.Size2Name( static_cast<long>(nTempValue) ); - if ( !aName.isEmpty() && (GetEntryPos( aName ) != LISTBOX_ENTRY_NOTFOUND) ) - { - mnLastValue = nTempValue; - SetText( aName ); - SetEmptyFieldValueData( false ); - return; - } - - MetricBox::SetValue( nNewValue, eInUnit ); -} - -void FontSizeBox::SetValue( sal_Int64 nNewValue ) -{ - SetValue( nNewValue, FieldUnit::NONE ); -} - -sal_Int64 FontSizeBox::GetValueFromStringUnit(const OUString& rStr, FieldUnit eOutUnit) const -{ - FontSizeNames aFontSizeNames( GetSettings().GetUILanguageTag().getLanguageType() ); - sal_Int64 nValue = aFontSizeNames.Name2Size( rStr ); - if ( nValue ) - return MetricField::ConvertValue( nValue, GetBaseValue(), GetDecimalDigits(), GetUnit(), eOutUnit ); - - return MetricBox::GetValueFromStringUnit( rStr, eOutUnit ); -} - SvtFontSizeBox::SvtFontSizeBox(std::unique_ptr<weld::ComboBox> p) : pFontList(nullptr) , nSavedValue(0) |