diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-11-21 13:34:02 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-11-22 07:34:15 +0100 |
commit | bab2753312c960c9eea610e927492775308fdfd5 (patch) | |
tree | 59c8168999ce2bf6a3647e712c8fb3e6c6df3fbc /editeng | |
parent | 2e6a38b7f007b36719f5fc002cb4363dec45e0d4 (diff) |
loplugin:unusedenumconstants in EEControlBits
(*) remove effectivly unused enum constants
(*) tweak the plugins heuristics some more to remove false+ in this enum
(*) twweak the python post-processing step to avoid a KeyError
Change-Id: I2943ec94c00f71dcd049f5c9ef33db259c005ba3
Reviewed-on: https://gerrit.libreoffice.org/63709
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/source/editeng/editeng.cxx | 14 | ||||
-rw-r--r-- | editeng/source/editeng/editstt2.hxx | 9 | ||||
-rw-r--r-- | editeng/source/editeng/impedit2.cxx | 2 | ||||
-rw-r--r-- | editeng/source/editeng/impedit3.cxx | 10 |
4 files changed, 4 insertions, 31 deletions
diff --git a/editeng/source/editeng/editeng.cxx b/editeng/source/editeng/editeng.cxx index b8667061e42a..32918b296b4a 100644 --- a/editeng/source/editeng/editeng.cxx +++ b/editeng/source/editeng/editeng.cxx @@ -1208,12 +1208,7 @@ bool EditEngine::PostKeyEvent( const KeyEvent& rKeyEvent, EditView* pEditView, v if ( !bReadOnly && !rKeyEvent.GetKeyCode().IsMod1() && !rKeyEvent.GetKeyCode().IsMod2() ) { bool bShift = rKeyEvent.GetKeyCode().IsShift(); - if ( pImpEditEngine->GetStatus().DoTabIndenting() && - ( aCurSel.Min().GetNode() != aCurSel.Max().GetNode() ) ) - { - pImpEditEngine->IndentBlock( pEditView, !bShift ); - } - else if ( !bShift ) + if ( !bShift ) { bool bSel = pEditView->HasSelection(); if ( bSel ) @@ -1854,18 +1849,15 @@ void EditEngine::SetControlWord( EEControlBits nWord ) { // possibly reformat: if ( ( nChanges & EEControlBits::USECHARATTRIBS ) || - ( nChanges & EEControlBits::USEPARAATTRIBS ) || ( nChanges & EEControlBits::ONECHARPERLINE ) || ( nChanges & EEControlBits::STRETCHING ) || ( nChanges & EEControlBits::OUTLINER ) || ( nChanges & EEControlBits::NOCOLORS ) || ( nChanges & EEControlBits::OUTLINER2 ) ) { - if ( ( nChanges & EEControlBits::USECHARATTRIBS ) || - ( nChanges & EEControlBits::USEPARAATTRIBS ) ) + if ( nChanges & EEControlBits::USECHARATTRIBS ) { - bool bUseCharAttribs = bool( nWord & EEControlBits::USECHARATTRIBS ); - pImpEditEngine->GetEditDoc().CreateDefFont( bUseCharAttribs ); + pImpEditEngine->GetEditDoc().CreateDefFont( true ); } pImpEditEngine->FormatFullDoc(); diff --git a/editeng/source/editeng/editstt2.hxx b/editeng/source/editeng/editstt2.hxx index cf7dc7a787e1..15726ef24032 100644 --- a/editeng/source/editeng/editstt2.hxx +++ b/editeng/source/editeng/editstt2.hxx @@ -81,9 +81,6 @@ public: bool MarkUrlFields() const { return bool( nControlBits & EEControlBits::MARKURLFIELDS ); } - bool DoRestoreFont() const - { return bool( nControlBits & EEControlBits::RESTOREFONT ); } - bool DoImportRTFStyleSheets() const { return bool( nControlBits & EEControlBits::RTFSTYLESHEETS ); } @@ -93,17 +90,11 @@ public: bool DoAutoComplete() const { return bool( nControlBits & EEControlBits::AUTOCOMPLETE ); } - bool DoTabIndenting() const - { return bool( nControlBits & EEControlBits::TABINDENTING ); } - bool DoFormat100() const { return bool( nControlBits & EEControlBits::FORMAT100 ); } bool ULSpaceSummation() const { return bool( nControlBits & EEControlBits::ULSPACESUMMATION ); } - - bool ULSpaceFirstParagraph() const - { return bool( nControlBits & EEControlBits::ULSPACEFIRSTPARA ); } }; #endif // INCLUDED_EDITENG_SOURCE_EDITENG_EDITSTT2_HXX diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx index e8dab77f120f..d892953fb062 100644 --- a/editeng/source/editeng/impedit2.cxx +++ b/editeng/source/editeng/impedit2.cxx @@ -4111,7 +4111,7 @@ void ImpEditEngine::CalcHeight( ParaPortion* pPortion ) } sal_Int32 nPortion = GetParaPortions().GetPos( pPortion ); - if ( nPortion || aStatus.ULSpaceFirstParagraph() ) + if ( nPortion ) { sal_uInt16 nUpper = GetYValue( rULItem.GetUpper() ); pPortion->nHeight += nUpper; diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index 369b80def020..ee2b003fc46d 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -462,8 +462,6 @@ void ImpEditEngine::FormatDoc() } } - if ( aStatus.DoRestoreFont() ) - GetRefDevice()->SetFont( aOldFont ); bIsFormatting = false; bFormatted = true; @@ -3337,8 +3335,6 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, tools::Rectangle aClipRect, Po vcl::Font _aOldFont( GetRefDevice()->GetFont() ); aTmpFont.SetPhysFont( GetRefDevice() ); aTmpFont.QuickGetTextSize( GetRefDevice(), aText, nTextStart, nTextLen, pTmpDXArray.get() ); - if ( aStatus.DoRestoreFont() ) - GetRefDevice()->SetFont( _aOldFont ); // add a meta file comment if we record to a metafile if( bMetafileValid ) @@ -3367,8 +3363,6 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, tools::Rectangle aClipRect, Po vcl::Font _aOldFont( GetRefDevice()->GetFont() ); aTmpFont.SetPhysFont( GetRefDevice() ); aTmpFont.QuickGetTextSize( GetRefDevice(), aText, 0, aText.getLength(), pTmpDXArray.get() ); - if ( aStatus.DoRestoreFont() ) - GetRefDevice()->SetFont( _aOldFont ); } long nTxtWidth = rTextPortion.GetSize().Width(); @@ -3823,8 +3817,6 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, tools::Rectangle aClipRect, Po if (IsVertical() && !IsTopToBottom() && ( aStartPos.X() > aClipRect.Right() ) ) break; } - if ( aStatus.DoRestoreFont() ) - pOutDev->SetFont( aOldFont ); } void ImpEditEngine::Paint( ImpEditView* pView, const tools::Rectangle& rRect, OutputDevice* pTargetDevice ) @@ -3964,8 +3956,6 @@ void ImpEditEngine::ShowParagraph( sal_Int32 nParagraph, bool bShow ) { vcl::Font aOldFont( GetRefDevice()->GetFont() ); CreateLines( nParagraph, 0 ); // 0: No TextRanger - if ( aStatus.DoRestoreFont() ) - GetRefDevice()->SetFont( aOldFont ); } else { |