diff options
author | Noel Grandin <noel@peralex.com> | 2016-06-23 13:13:28 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2016-06-24 10:51:45 +0000 |
commit | 920d4463f6e59b815852c173e2974ffc7b4bb284 (patch) | |
tree | ac56efa2d79ad622f261e8664a57afa7c7ea0e49 /vcl/source/edit | |
parent | 2b7109a12ab772bf53766d6e06b422c8e687d482 (diff) |
loplugin:singlevalfields in vcl(part1)
Change-Id: I0031199937cc95793951a070c4b3d8910933e69f
Reviewed-on: https://gerrit.libreoffice.org/26595
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'vcl/source/edit')
-rw-r--r-- | vcl/source/edit/texteng.cxx | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/vcl/source/edit/texteng.cxx b/vcl/source/edit/texteng.cxx index eaba9167c0a5..8f7765410fa4 100644 --- a/vcl/source/edit/texteng.cxx +++ b/vcl/source/edit/texteng.cxx @@ -72,7 +72,6 @@ TextEngine::TextEngine() , mpIMEInfos {nullptr} , mpLocaleDataWrapper {nullptr} , maTextColor {COL_BLACK} - , mnFixCharWidth100 {0} , mnMaxTextLen {0} , mnMaxTextWidth {0} , mnCharHeight {0} @@ -199,7 +198,6 @@ void TextEngine::SetFont( const vcl::Font& rFont ) if ( !mnDefTab ) mnDefTab = 1; mnCharHeight = mpRefDev->GetTextHeight(); - mnFixCharWidth100 = 0; FormatFullDoc(); UpdateViews(); @@ -1206,20 +1204,11 @@ long TextEngine::CalcTextWidth( sal_uInt32 nPara, sal_Int32 nPortionStart, sal_I SAL_WARN_IF( nTabPos != -1 && nTabPos < (nPortionStart+nLen), "vcl", "CalcTextWidth: Tab!" ); #endif - long nWidth; - if ( mnFixCharWidth100 ) - { - nWidth = static_cast<long>(nLen)*mnFixCharWidth100/100; - } - else - { - vcl::Font aFont; - SeekCursor( nPara, nPortionStart+1, aFont, nullptr ); - mpRefDev->SetFont( aFont ); - TextNode* pNode = mpDoc->GetNodes()[ nPara ]; - nWidth = mpRefDev->GetTextWidth( pNode->GetText(), nPortionStart, nLen ); - - } + vcl::Font aFont; + SeekCursor( nPara, nPortionStart+1, aFont, nullptr ); + mpRefDev->SetFont( aFont ); + TextNode* pNode = mpDoc->GetNodes()[ nPara ]; + long nWidth = mpRefDev->GetTextWidth( pNode->GetText(), nPortionStart, nLen ); return nWidth; } |