diff options
author | Noel Grandin <noel@peralex.com> | 2016-03-17 14:27:08 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2016-03-18 06:02:18 +0000 |
commit | 9391688f616a22cfd4521f2472bdbda4c6609383 (patch) | |
tree | 321262883cbce93fdea8e8ac650ef0a40caa5e1d /editeng | |
parent | 9704207c386867d1859b06dd25232e06022965d9 (diff) |
loplugin:constantfunction in editeng
Change-Id: I8f8414b4867d3248e6d836ed8037de4da41b97f1
Reviewed-on: https://gerrit.libreoffice.org/23331
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/source/editeng/editeng.cxx | 6 | ||||
-rw-r--r-- | editeng/source/editeng/edtspell.cxx | 2 | ||||
-rw-r--r-- | editeng/source/editeng/edtspell.hxx | 2 | ||||
-rw-r--r-- | editeng/source/editeng/impedit3.cxx | 6 | ||||
-rw-r--r-- | editeng/source/items/borderline.cxx | 4 | ||||
-rw-r--r-- | editeng/source/misc/splwrap.cxx | 15 | ||||
-rw-r--r-- | editeng/source/misc/svxacorr.cxx | 2 | ||||
-rw-r--r-- | editeng/source/outliner/outleeng.cxx | 3 | ||||
-rw-r--r-- | editeng/source/outliner/outleeng.hxx | 1 | ||||
-rw-r--r-- | editeng/source/outliner/outlvw.cxx | 15 | ||||
-rw-r--r-- | editeng/source/rtf/svxrtf.cxx | 5 | ||||
-rw-r--r-- | editeng/source/uno/unoedprx.cxx | 2 | ||||
-rw-r--r-- | editeng/source/uno/unofored.cxx | 4 | ||||
-rw-r--r-- | editeng/source/uno/unoforou.cxx | 4 | ||||
-rw-r--r-- | editeng/source/uno/unotext.cxx | 4 |
15 files changed, 33 insertions, 42 deletions
diff --git a/editeng/source/editeng/editeng.cxx b/editeng/source/editeng/editeng.cxx index b0f2a512f4c0..64b5a6dc3854 100644 --- a/editeng/source/editeng/editeng.cxx +++ b/editeng/source/editeng/editeng.cxx @@ -810,9 +810,9 @@ EditPaM EditEngine::GetPaM(const Point& aDocPos, bool bSmart) } EditSelection EditEngine::SelectWord( - const EditSelection& rCurSelection, sal_Int16 nWordType, bool bAcceptStartOfWord) + const EditSelection& rCurSelection, sal_Int16 nWordType) { - return pImpEditEngine->SelectWord(rCurSelection, nWordType, bAcceptStartOfWord); + return pImpEditEngine->SelectWord(rCurSelection, nWordType); } long EditEngine::GetXPos( @@ -2407,7 +2407,7 @@ css::uno::Reference< css::datatransfer::XTransferable > void EditEngine::DrawingText( const Point&, const OUString&, sal_Int32, sal_Int32, const long*, const SvxFont&, sal_Int32 /*nPara*/, sal_uInt8 /*nRightToLeft*/, - const EEngineData::WrongSpellVector*, const SvxFieldData*, bool, bool, bool, + const EEngineData::WrongSpellVector*, const SvxFieldData*, bool, bool, const css::lang::Locale*, const Color&, const Color&) { diff --git a/editeng/source/editeng/edtspell.cxx b/editeng/source/editeng/edtspell.cxx index ccc4e0f6661b..25efa4fb2901 100644 --- a/editeng/source/editeng/edtspell.cxx +++ b/editeng/source/editeng/edtspell.cxx @@ -730,7 +730,7 @@ bool EdtAutoCorrDoc::ChgAutoCorrWord( sal_Int32& rSttPos, return bRet; } -LanguageType EdtAutoCorrDoc::GetLanguage( sal_Int32 nPos, bool ) const +LanguageType EdtAutoCorrDoc::GetLanguage( sal_Int32 nPos ) const { return mpEditEngine->GetLanguage( EditPaM( pCurNode, nPos+1 ) ); } diff --git a/editeng/source/editeng/edtspell.hxx b/editeng/source/editeng/edtspell.hxx index 2cd6b5be14b4..6ce576858999 100644 --- a/editeng/source/editeng/edtspell.hxx +++ b/editeng/source/editeng/edtspell.hxx @@ -146,7 +146,7 @@ public: virtual bool ChgAutoCorrWord( sal_Int32& rSttPos, sal_Int32 nEndPos, SvxAutoCorrect& rACorrect, OUString* pPara ) override; - virtual LanguageType GetLanguage( sal_Int32 nPos, bool bPrevPara = false ) const override; + virtual LanguageType GetLanguage( sal_Int32 nPos ) const override; sal_Int32 GetCursor() const { return nCursor; } diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index dac9f8b3ab18..ac74c7c88547 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -3347,7 +3347,7 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, Rectangle aClipRect, Point aSt aTmpFont, n, rTextPortion.GetRightToLeft(), aWrongSpellVector.size() ? &aWrongSpellVector : nullptr, pFieldData, - bEndOfLine, bEndOfParagraph, false, // support for EOL/EOP TEXT comments + bEndOfLine, bEndOfParagraph, // support for EOL/EOP TEXT comments &aLocale, aOverlineColor, aTextLineColor); @@ -3595,7 +3595,7 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, Rectangle aClipRect, Point aSt aTmpFont, n, 0, nullptr, nullptr, - bEndOfLine, bEndOfParagraph, false, + bEndOfLine, bEndOfParagraph, nullptr, aOverlineColor, aTextLineColor); @@ -3652,7 +3652,7 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, Rectangle aClipRect, Point aSt aTmpFont, n, 0, nullptr, nullptr, - false, true, false, // support for EOL/EOP TEXT comments + false, true, // support for EOL/EOP TEXT comments nullptr, aOverlineColor, aTextLineColor); diff --git a/editeng/source/items/borderline.cxx b/editeng/source/items/borderline.cxx index 0c9f0c52b9d7..9abc38f5da29 100644 --- a/editeng/source/items/borderline.cxx +++ b/editeng/source/items/borderline.cxx @@ -90,7 +90,7 @@ Color SvxBorderLine::threeDMediumColor( Color aMain ) } SvxBorderLine::SvxBorderLine( const Color *pCol, long nWidth, - SvxBorderStyle nStyle, bool bUseLeftTop, + SvxBorderStyle nStyle, Color (*pColorOutFn)( Color ), Color (*pColorInFn)( Color ), Color (*pColorGapFn)( Color ) ) : m_nWidth( nWidth ) @@ -99,7 +99,7 @@ SvxBorderLine::SvxBorderLine( const Color *pCol, long nWidth, , m_nMult( 1 ) , m_nDiv( 1 ) , m_nStyle( nStyle ) -, m_bUseLeftTop( bUseLeftTop ) +, m_bUseLeftTop( false ) , m_pColorOutFn( pColorOutFn ) , m_pColorInFn( pColorInFn ) , m_pColorGapFn( pColorGapFn ) diff --git a/editeng/source/misc/splwrap.cxx b/editeng/source/misc/splwrap.cxx index 8881c08dc095..ce565ee80094 100644 --- a/editeng/source/misc/splwrap.cxx +++ b/editeng/source/misc/splwrap.cxx @@ -144,23 +144,22 @@ SvxSpellWrapper::~SvxSpellWrapper() --------------------------------------------------------------------*/ SvxSpellWrapper::SvxSpellWrapper( vcl::Window* pWn, - const bool bStart, const bool bIsAllRight, - const bool bOther, const bool bRevAllow ) : + const bool bStart, const bool bIsAllRight ) : pWin ( pWn ), mpTextObj ( nullptr), - bOtherCntnt ( bOther ), + bOtherCntnt ( false ), bDialog ( false ), bHyphen ( false ), - bStartChk ( bOther ), - bRevAllowed ( bRevAllow ), + bStartChk ( false ), + bRevAllowed ( true ), bAllRight ( bIsAllRight ) { Reference< linguistic2::XLinguProperties > xProp( SvxGetLinguPropertySet() ); bool bWrapReverse = xProp.is() && xProp->getIsWrapReverse(); - bReverse = bRevAllow && bWrapReverse; - bStartDone = bOther || ( !bReverse && bStart ); - bEndDone = bReverse && bStart && !bOther; + bReverse = bWrapReverse; + bStartDone = !bReverse && bStart; + bEndDone = bReverse && bStart; } diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx index 156f6a9766c2..8dc6aefaad4b 100644 --- a/editeng/source/misc/svxacorr.cxx +++ b/editeng/source/misc/svxacorr.cxx @@ -178,7 +178,7 @@ void SvxAutoCorrDoc::SaveCpltSttWord( sal_uLong, sal_Int32, const OUString&, { } -LanguageType SvxAutoCorrDoc::GetLanguage( sal_Int32, bool ) const +LanguageType SvxAutoCorrDoc::GetLanguage( sal_Int32 ) const { return LANGUAGE_SYSTEM; } diff --git a/editeng/source/outliner/outleeng.cxx b/editeng/source/outliner/outleeng.cxx index 575bb5eee323..84866840157b 100644 --- a/editeng/source/outliner/outleeng.cxx +++ b/editeng/source/outliner/outleeng.cxx @@ -152,13 +152,12 @@ void OutlinerEditEng::DrawingText( const Point& rStartPos, const OUString& rText const SvxFieldData* pFieldData, bool bEndOfLine, bool bEndOfParagraph, - bool bEndOfBullet, const css::lang::Locale* pLocale, const Color& rOverlineColor, const Color& rTextLineColor) { pOwner->DrawingText(rStartPos,rText,nTextStart,nTextLen,pDXArray,rFont,nPara,nRightToLeft, - pWrongSpellVector, pFieldData, bEndOfLine, bEndOfParagraph, bEndOfBullet, pLocale, rOverlineColor, rTextLineColor); + pWrongSpellVector, pFieldData, bEndOfLine, bEndOfParagraph, false/*bEndOfBullet*/, pLocale, rOverlineColor, rTextLineColor); } void OutlinerEditEng::DrawingTab( const Point& rStartPos, long nWidth, const OUString& rChar, diff --git a/editeng/source/outliner/outleeng.hxx b/editeng/source/outliner/outleeng.hxx index 04e44c2bcdff..f165e3220d86 100644 --- a/editeng/source/outliner/outleeng.hxx +++ b/editeng/source/outliner/outleeng.hxx @@ -51,7 +51,6 @@ public: const SvxFieldData* pFieldData, bool bEndOfLine, bool bEndOfParagraph, - bool bEndOfBullet, const css::lang::Locale* pLocale, const Color& rOverlineColor, const Color& rTextLineColor) override; diff --git a/editeng/source/outliner/outlvw.cxx b/editeng/source/outliner/outlvw.cxx index ffefab17fd8e..cd855b7a03c5 100644 --- a/editeng/source/outliner/outlvw.cxx +++ b/editeng/source/outliner/outlvw.cxx @@ -374,21 +374,16 @@ void OutlinerView::ImpToggleExpand( Paragraph* pPara ) pEditView->ShowCursor(); } -sal_Int32 OutlinerView::Select( Paragraph* pParagraph, bool bSelect, - bool bWithChildren ) +sal_Int32 OutlinerView::Select( Paragraph* pParagraph, bool bSelect ) { sal_Int32 nPara = pOwner->pParaList->GetAbsPos( pParagraph ); sal_Int32 nEnd = 0; if ( bSelect ) nEnd = SAL_MAX_INT32; - sal_Int32 nChildCount = 0; - if ( bWithChildren ) - nChildCount = pOwner->pParaList->GetChildCount( pParagraph ); - - ESelection aSel( nPara, 0, nPara + nChildCount, nEnd ); + ESelection aSel( nPara, 0, nPara, nEnd ); pEditView->SetSelection( aSel ); - return nChildCount+1; + return 1; } @@ -1387,13 +1382,13 @@ void OutlinerView::ExecuteSpellPopup( const Point& rPosPixel, Link<SpellCallback pEditView->ExecuteSpellPopup( rPosPixel, pStartDlg ); } -sal_uLong OutlinerView::Read( SvStream& rInput, const OUString& rBaseURL, EETextFormat eFormat, bool bSelect, SvKeyValueIterator* pHTTPHeaderAttrs ) +sal_uLong OutlinerView::Read( SvStream& rInput, const OUString& rBaseURL, EETextFormat eFormat, SvKeyValueIterator* pHTTPHeaderAttrs ) { sal_Int32 nOldParaCount = pEditView->GetEditEngine()->GetParagraphCount(); ESelection aOldSel = pEditView->GetSelection(); aOldSel.Adjust(); - sal_uLong nRet = pEditView->Read( rInput, rBaseURL, eFormat, bSelect, pHTTPHeaderAttrs ); + sal_uLong nRet = pEditView->Read( rInput, rBaseURL, eFormat, false/*bSelect*/, pHTTPHeaderAttrs ); long nParaDiff = pEditView->GetEditEngine()->GetParagraphCount() - nOldParaCount; sal_Int32 nChangesStart = aOldSel.nStartPara; diff --git a/editeng/source/rtf/svxrtf.cxx b/editeng/source/rtf/svxrtf.cxx index d03c2ce4f685..b4b9d79ab6c3 100644 --- a/editeng/source/rtf/svxrtf.cxx +++ b/editeng/source/rtf/svxrtf.cxx @@ -59,8 +59,7 @@ static rtl_TextEncoding lcl_GetDefaultTextEncodingForRTF() // -------------- Methods -------------------- SvxRTFParser::SvxRTFParser( SfxItemPool& rPool, SvStream& rIn, - uno::Reference<document::XDocumentProperties> i_xDocProps, - bool const bReadNewDoc ) + uno::Reference<document::XDocumentProperties> i_xDocProps ) : SvRTFParser( rIn, 5 ) , aPlainMap(rPool) , aPardMap(rPool) @@ -69,7 +68,7 @@ SvxRTFParser::SvxRTFParser( SfxItemPool& rPool, SvStream& rIn, , m_xDocProps( i_xDocProps ) , pRTFDefaults( nullptr ) , nDfltFont( 0) - , bNewDoc( bReadNewDoc ) + , bNewDoc( true ) , bNewGroup( false) , bIsSetDfltTab( false) , bChkStyleAttr( false ) diff --git a/editeng/source/uno/unoedprx.cxx b/editeng/source/uno/unoedprx.cxx index 5126b6d29927..b1ee919221d5 100644 --- a/editeng/source/uno/unoedprx.cxx +++ b/editeng/source/uno/unoedprx.cxx @@ -528,7 +528,7 @@ void SvxAccessibleTextAdapter::SetParaAttribs( sal_Int32 nPara, const SfxItemSet mpTextForwarder->SetParaAttribs( nPara, rSet ); } -void SvxAccessibleTextAdapter::RemoveAttribs( const ESelection& , bool , sal_uInt16 ) +void SvxAccessibleTextAdapter::RemoveAttribs( const ESelection& , sal_uInt16 ) { } diff --git a/editeng/source/uno/unofored.cxx b/editeng/source/uno/unofored.cxx index 793f979a55fa..03b290c988bd 100644 --- a/editeng/source/uno/unofored.cxx +++ b/editeng/source/uno/unofored.cxx @@ -112,9 +112,9 @@ void SvxEditEngineForwarder::SetParaAttribs( sal_Int32 nPara, const SfxItemSet& rEditEngine.SetParaAttribs( nPara, rSet ); } -void SvxEditEngineForwarder::RemoveAttribs( const ESelection& rSelection, bool bRemoveParaAttribs, sal_uInt16 nWhich ) +void SvxEditEngineForwarder::RemoveAttribs( const ESelection& rSelection, sal_uInt16 nWhich ) { - rEditEngine.RemoveAttribs( rSelection, bRemoveParaAttribs, nWhich ); + rEditEngine.RemoveAttribs( rSelection, false/*bRemoveParaAttribs*/, nWhich ); } SfxItemPool* SvxEditEngineForwarder::GetPool() const diff --git a/editeng/source/uno/unoforou.cxx b/editeng/source/uno/unoforou.cxx index d3be942fe710..9646a98d1ee7 100644 --- a/editeng/source/uno/unoforou.cxx +++ b/editeng/source/uno/unoforou.cxx @@ -180,9 +180,9 @@ void SvxOutlinerForwarder::SetParaAttribs( sal_Int32 nPara, const SfxItemSet& rS const_cast<SfxItemSet*>(&rSet)->SetParent( pOldParent ); } -void SvxOutlinerForwarder::RemoveAttribs( const ESelection& rSelection, bool bRemoveParaAttribs, sal_uInt16 nWhich ) +void SvxOutlinerForwarder::RemoveAttribs( const ESelection& rSelection, sal_uInt16 nWhich ) { - rOutliner.RemoveAttribs( rSelection, bRemoveParaAttribs, nWhich ); + rOutliner.RemoveAttribs( rSelection, false/*bRemoveParaAttribs*/, nWhich ); } SfxItemPool* SvxOutlinerForwarder::GetPool() const diff --git a/editeng/source/uno/unotext.cxx b/editeng/source/uno/unotext.cxx index 181ff4a4d9ff..9b253bc30d16 100644 --- a/editeng/source/uno/unotext.cxx +++ b/editeng/source/uno/unotext.cxx @@ -2185,7 +2185,7 @@ uno::Reference< text::XTextRange > SAL_CALL SvxUnoTextBase::appendTextPortion( // set properties for the new text portion ESelection aSel( nPara, nStart, nPara, nEnd ); - pTextForwarder->RemoveAttribs( aSel, false, 0 ); + pTextForwarder->RemoveAttribs( aSel, 0 ); pEditSource->UpdateData(); SfxItemSet aItemSet( *pTextForwarder->GetEmptyItemSetPtr() ); @@ -2415,7 +2415,7 @@ void SvxDummyTextSource::SetParaAttribs( sal_Int32, const SfxItemSet& ) { } -void SvxDummyTextSource::RemoveAttribs( const ESelection& , bool , sal_uInt16 ) +void SvxDummyTextSource::RemoveAttribs( const ESelection& , sal_uInt16 ) { } |