compilerplugins/clang/unusedmethods.py | 57 +++++++----- editeng/qa/unit/core-test.cxx | 3 editeng/source/accessibility/AccessibleEditableTextPara.cxx | 3 editeng/source/editeng/editeng.cxx | 22 ++-- editeng/source/editeng/editobj.cxx | 6 - editeng/source/editeng/editview.cxx | 3 editeng/source/editeng/edtspell.cxx | 6 - editeng/source/editeng/edtspell.hxx | 4 editeng/source/items/numitem.cxx | 14 -- editeng/source/misc/splwrap.cxx | 3 editeng/source/misc/svxacorr.cxx | 13 -- editeng/source/outliner/outliner.cxx | 3 editeng/source/outliner/outlvw.cxx | 7 - include/editeng/AccessibleEditableTextPara.hxx | 2 include/editeng/editeng.hxx | 10 +- include/editeng/editobj.hxx | 2 include/editeng/editview.hxx | 2 include/editeng/numitem.hxx | 6 - include/editeng/outliner.hxx | 6 - include/editeng/outlobj.hxx | 1 include/editeng/splwrap.hxx | 2 include/editeng/svxacorr.hxx | 10 +- include/editeng/tstpitem.hxx | 2 sw/source/core/edit/acorrect.cxx | 3 sw/source/core/inc/acorrect.hxx | 2 sw/source/uibase/inc/hyp.hxx | 2 sw/source/uibase/lingu/hyp.cxx | 4 27 files changed, 92 insertions(+), 106 deletions(-)
New commits: commit 1f9a610de1e1e540386972c010ebfc99e5f55df7 Author: Noel Grandin <n...@peralex.com> Date: Mon Jan 11 16:02:17 2016 +0200 loplugin:unusedmethods unused return value in include/editeng Change-Id: I1314480950b0d3a3e5ed066d71c175604dd41970 Reviewed-on: https://gerrit.libreoffice.org/21361 Reviewed-by: Noel Grandin <noelgran...@gmail.com> Tested-by: Noel Grandin <noelgran...@gmail.com> diff --git a/compilerplugins/clang/unusedmethods.py b/compilerplugins/clang/unusedmethods.py index 4834427..fb2ad7f 100755 --- a/compilerplugins/clang/unusedmethods.py +++ b/compilerplugins/clang/unusedmethods.py @@ -141,6 +141,31 @@ for k, definitions in sourceLocationToDefinitionMap.iteritems(): if len(definitions) > 1: for d in definitions: definitionSet.remove(d) + +def isOtherConstness( d, callSet ): + clazz = d[0] + " " + d[1] + # if this method is const, and there is a non-const variant of it, and the non-const variant is in use, then leave it alone + if d[0].startswith("const ") and d[1].endswith(" const"): + if ((d[0][6:],d[1][:-6]) in callSet): + return True + elif clazz.endswith(" const"): + clazz2 = clazz[:len(clazz)-6] # strip off " const" + if ((d[0],clazz2) in callSet): + return True + if clazz.endswith(" const") and ("::iterator" in clazz): + clazz2 = clazz[:len(clazz)-6] # strip off " const" + clazz2 = clazz2.replace("::const_iterator", "::iterator") + if ((d[0],clazz2) in callSet): + return True + # if this method is non-const, and there is a const variant of it, and the const variant is in use, then leave it alone + if (not clazz.endswith(" const")) and ((d[0],"const " + clazz + " const") in callSet): + return True + if (not clazz.endswith(" const")) and ("::iterator" in clazz): + clazz2 = clazz.replace("::iterator", "::const_iterator") + " const" + if ((d[0],clazz2) in callSet): + return True + return False + # ------------------------------------------- # Do the "unused methods" part @@ -161,26 +186,8 @@ for d in definitionSet: or ("::IsA(" in d[1]) or ("::Type()" in d[1])): continue - # if this method is const, and there is a non-const variant of it, and the non-const variant is in use, then leave it alone - if d[0].startswith("const ") and d[1].endswith(" const"): - if ((d[0][6:],d[1][:-6]) in callSet): - continue - elif clazz.endswith(" const"): - clazz2 = clazz[:len(clazz)-6] # strip off " const" - if ((d[0],clazz2) in callSet): - continue - if clazz.endswith(" const") and ("::iterator" in clazz): - clazz2 = clazz[:len(clazz)-6] # strip off " const" - clazz2 = clazz2.replace("::const_iterator", "::iterator") - if ((d[0],clazz2) in callSet): - continue - # if this method is non-const, and there is a const variant of it, and the const variant is in use, then leave it alone - if (not clazz.endswith(" const")) and ((d[0],"const " + clazz + " const") in callSet): - continue - if (not clazz.endswith(" const")) and ("::iterator" in clazz): - clazz2 = clazz.replace("::iterator", "::const_iterator") + " const" - if ((d[0],clazz2) in callSet): - continue + if isOtherConstness(d, callSet): + continue # just ignore iterators, they normally occur in pairs, and we typically want to leave one constness version alone # alone if the other one is in use. if d[1] == "begin() const" or d[1] == "begin()" or d[1] == "end()" or d[1] == "end() const": @@ -252,6 +259,8 @@ for d in definitionSet: continue if d in returnSet: continue + if isOtherConstness(d, returnSet): + continue if d[0] == "void": continue # ignore UNO constructor method entrypoints @@ -261,11 +270,17 @@ for d in definitionSet: if "operator new" in d[1]: continue # unused return type is not a problem here - if "operator=(" in d[1]: + if ("operator=(" in d[1] or "operator&=" in d[1] or "operator|=" in d[1] or "operator^=" in d[1] + or "operator+=" in d[1] or "operator-=" in d[1] + or "operator<<" in d[1] or "operator>>" in d[1] + or "operator++" in d[1] or "operator--" in d[1]): continue # ignore external code if definitionToSourceLocationMap[d].startswith("external/"): continue + # ignore the SfxPoolItem CreateDefault methods for now + if "::CreateDefault" in d[1]: + continue tmp2set.add((clazz, definitionToSourceLocationMap[d])) # sort results by name and line number diff --git a/editeng/qa/unit/core-test.cxx b/editeng/qa/unit/core-test.cxx index 0c6acef..d1c73af 100644 --- a/editeng/qa/unit/core-test.cxx +++ b/editeng/qa/unit/core-test.cxx @@ -260,10 +260,9 @@ private: m_rText = m_rText.replaceAt(nPos, nLen, rTxt); return true; } - virtual bool SetAttr( sal_Int32, sal_Int32, sal_uInt16, SfxPoolItem& ) override + virtual void SetAttr( sal_Int32, sal_Int32, sal_uInt16, SfxPoolItem& ) override { //fprintf(stderr, "TestAutoCorrDoc::SetAttr\n"); - return true; } virtual bool SetINetAttr( sal_Int32, sal_Int32, const OUString& ) override { diff --git a/editeng/source/accessibility/AccessibleEditableTextPara.cxx b/editeng/source/accessibility/AccessibleEditableTextPara.cxx index 8b097ae..9781f93 100644 --- a/editeng/source/accessibility/AccessibleEditableTextPara.cxx +++ b/editeng/source/accessibility/AccessibleEditableTextPara.cxx @@ -1681,7 +1681,7 @@ namespace accessibility } return nIndex; } - bool AccessibleEditableTextPara::ExtendByField( css::accessibility::TextSegment& Segment ) + void AccessibleEditableTextPara::ExtendByField( css::accessibility::TextSegment& Segment ) { sal_Int32 nParaIndex = GetParagraphIndex(); SvxAccessibleTextAdapter& rCacheTF = GetTextForwarder(); @@ -1744,7 +1744,6 @@ namespace accessibility Segment.SegmentText = GetTextRange(Segment.SegmentStart, Segment.SegmentEnd); } } - return bExtend; } css::accessibility::TextSegment SAL_CALL AccessibleEditableTextPara::getTextAtIndex( sal_Int32 nIndex, sal_Int16 aTextType ) throw (css::lang::IndexOutOfBoundsException, css::lang::IllegalArgumentException, css::uno::RuntimeException, std::exception) diff --git a/editeng/source/editeng/editeng.cxx b/editeng/source/editeng/editeng.cxx index b829715..d6b3e66 100644 --- a/editeng/source/editeng/editeng.cxx +++ b/editeng/source/editeng/editeng.cxx @@ -340,16 +340,15 @@ EditView* EditEngine::RemoveView( EditView* pView ) return pRemoved; } -EditView* EditEngine::RemoveView(size_t nIndex) +void EditEngine::RemoveView(size_t nIndex) { ImpEditEngine::ViewsType& rViews = pImpEditEngine->GetEditViews(); if (nIndex >= rViews.size()) - return nullptr; + return; EditView* pView = rViews[nIndex]; if ( pView ) - return RemoveView( pView ); - return nullptr; + RemoveView( pView ); } EditView* EditEngine::GetView(size_t nIndex) const @@ -707,9 +706,9 @@ EditPaM EditEngine::ConnectContents(sal_Int32 nLeftNode, bool bBackward) return pImpEditEngine->ConnectContents(nLeftNode, bBackward); } -EditPaM EditEngine::InsertFeature(const EditSelection& rEditSelection, const SfxPoolItem& rItem) +void EditEngine::InsertFeature(const EditSelection& rEditSelection, const SfxPoolItem& rItem) { - return pImpEditEngine->ImpInsertFeature(rEditSelection, rItem); + pImpEditEngine->ImpInsertFeature(rEditSelection, rItem); } EditSelection EditEngine::MoveParagraphs(const Range& rParagraphs, sal_Int32 nNewPos, EditView* pCurView) @@ -747,14 +746,14 @@ void EditEngine::FormatAndUpdate(EditView* pCurView) pImpEditEngine->FormatAndUpdate(pCurView); } -bool EditEngine::Undo(EditView* pView) +void EditEngine::Undo(EditView* pView) { - return pImpEditEngine->Undo(pView); + pImpEditEngine->Undo(pView); } -bool EditEngine::Redo(EditView* pView) +void EditEngine::Redo(EditView* pView) { - return pImpEditEngine->Redo(pView); + pImpEditEngine->Redo(pView); } uno::Reference<datatransfer::XTransferable> EditEngine::CreateTransferable(const EditSelection& rSelection) @@ -1466,12 +1465,11 @@ sal_uLong EditEngine::Read( SvStream& rInput, const OUString& rBaseURL, EETextFo return rInput.GetError(); } -sal_uLong EditEngine::Write( SvStream& rOutput, EETextFormat eFormat ) +void EditEngine::Write( SvStream& rOutput, EETextFormat eFormat ) { EditPaM aStartPaM( pImpEditEngine->GetEditDoc().GetStartPaM() ); EditPaM aEndPaM( pImpEditEngine->GetEditDoc().GetEndPaM() ); pImpEditEngine->Write( rOutput, eFormat, EditSelection( aStartPaM, aEndPaM ) ); - return rOutput.GetError(); } EditTextObject* EditEngine::CreateTextObject() diff --git a/editeng/source/editeng/editobj.cxx b/editeng/source/editeng/editobj.cxx index d6bb729..de10b02 100644 --- a/editeng/source/editeng/editobj.cxx +++ b/editeng/source/editeng/editobj.cxx @@ -374,10 +374,10 @@ SvtScriptType EditTextObject::GetScriptType() const } -bool EditTextObject::Store( SvStream& rOStream ) const +void EditTextObject::Store( SvStream& rOStream ) const { if ( rOStream.GetError() ) - return false; + return; sal_Size nStartPos = rOStream.Tell(); @@ -394,8 +394,6 @@ bool EditTextObject::Store( SvStream& rOStream ) const rOStream.Seek( nStartPos + sizeof( nWhich ) ); rOStream.WriteUInt32( nStructSz ); rOStream.Seek( nEndPos ); - - return rOStream.GetError() == 0; } EditTextObject* EditTextObject::Create( SvStream& rIStream, SfxItemPool* pGlobalTextObjectPool ) diff --git a/editeng/source/editeng/editview.cxx b/editeng/source/editeng/editview.cxx index d28c562..d9d3148 100644 --- a/editeng/source/editeng/editview.cxx +++ b/editeng/source/editeng/editview.cxx @@ -1045,7 +1045,7 @@ void EditView::ExecuteSpellPopup( const Point& rPosPixel, Link<SpellCallbackInfo } } -bool EditView::SelectCurrentWord( sal_Int16 nWordType ) +void EditView::SelectCurrentWord( sal_Int16 nWordType ) { EditSelection aCurSel( pImpEditView->GetEditSelection() ); pImpEditView->DrawSelection(); @@ -1053,7 +1053,6 @@ bool EditView::SelectCurrentWord( sal_Int16 nWordType ) pImpEditView->SetEditSelection( aCurSel ); pImpEditView->DrawSelection(); ShowCursor( true, false ); - return aCurSel.HasRange(); } void EditView::InsertField( const SvxFieldItem& rFld ) diff --git a/editeng/source/editeng/edtspell.cxx b/editeng/source/editeng/edtspell.cxx index 896a562..4182822 100644 --- a/editeng/source/editeng/edtspell.cxx +++ b/editeng/source/editeng/edtspell.cxx @@ -105,10 +105,9 @@ void EditSpellWrapper::SpellStart( SvxSpellArea eArea ) } } -bool EditSpellWrapper::SpellContinue() +void EditSpellWrapper::SpellContinue() { SetLast( pEditView->GetImpEditEngine()->ImpSpell( pEditView ) ); - return GetLast().is(); } void EditSpellWrapper::SpellEnd() @@ -612,7 +611,7 @@ bool EdtAutoCorrDoc::ReplaceRange(sal_Int32 nPos, sal_Int32 nSourceLength, const return true; } -bool EdtAutoCorrDoc::SetAttr(sal_Int32 nStt, sal_Int32 nEnd, +void EdtAutoCorrDoc::SetAttr(sal_Int32 nStt, sal_Int32 nEnd, sal_uInt16 nSlotId, SfxPoolItem& rItem) { SfxItemPool* pPool = &mpEditEngine->GetEditDoc().GetItemPool(); @@ -635,7 +634,6 @@ bool EdtAutoCorrDoc::SetAttr(sal_Int32 nStt, sal_Int32 nEnd, mpEditEngine->SetAttribs( aSel, aSet, ATTRSPECIAL_EDGE ); bAllowUndoAction = false; } - return true; } bool EdtAutoCorrDoc::SetINetAttr(sal_Int32 nStt, sal_Int32 nEnd, diff --git a/editeng/source/editeng/edtspell.hxx b/editeng/source/editeng/edtspell.hxx index fb37d85..2cd6b5b 100644 --- a/editeng/source/editeng/edtspell.hxx +++ b/editeng/source/editeng/edtspell.hxx @@ -46,7 +46,7 @@ private: protected: virtual void SpellStart( SvxSpellArea eArea ) override; - virtual bool SpellContinue() override; // Check area + virtual void SpellContinue() override; // Check area virtual void ReplaceAll( const OUString &rNewText, sal_Int16 nLanguage ) override; virtual void SpellEnd() override; virtual bool SpellMore() override; @@ -138,7 +138,7 @@ public: virtual bool Replace( sal_Int32 nPos, const OUString& rTxt ) override; virtual bool ReplaceRange( sal_Int32 nPos, sal_Int32 nLen, const OUString& rTxt ) override; - virtual bool SetAttr( sal_Int32 nStt, sal_Int32 nEnd, sal_uInt16 nSlotId, SfxPoolItem& ) override; + virtual void SetAttr( sal_Int32 nStt, sal_Int32 nEnd, sal_uInt16 nSlotId, SfxPoolItem& ) override; virtual bool SetINetAttr( sal_Int32 nStt, sal_Int32 nEnd, const OUString& rURL ) override; virtual OUString const* GetPrevPara(bool bAtNormalPos) override; diff --git a/editeng/source/items/numitem.cxx b/editeng/source/items/numitem.cxx index bd68ff0..4d59e45 100644 --- a/editeng/source/items/numitem.cxx +++ b/editeng/source/items/numitem.cxx @@ -243,7 +243,7 @@ SvxNumberFormat::~SvxNumberFormat() delete pBulletFont; } -SvStream& SvxNumberFormat::Store(SvStream &rStream, FontToSubsFontConverter pConverter) +void SvxNumberFormat::Store(SvStream &rStream, FontToSubsFontConverter pConverter) { if(pConverter && pBulletFont) { @@ -308,8 +308,6 @@ SvStream& SvxNumberFormat::Store(SvStream &rStream, FontToSubsFontConverter pC rStream.WriteInt32( mnListtabPos ); rStream.WriteInt32( mnFirstLineIndent ); rStream.WriteInt32( mnIndentAt ); - - return rStream; } SvxNumberFormat& SvxNumberFormat::operator=( const SvxNumberFormat& rFormat ) @@ -658,7 +656,7 @@ SvxNumRule::SvxNumRule( SvStream &rStream ) rStream.ReadUInt16( nTmp16 ); nFeatureFlags = static_cast<SvxNumRuleFlags>(nTmp16); } -SvStream& SvxNumRule::Store( SvStream &rStream ) +void SvxNumRule::Store( SvStream &rStream ) { rStream.WriteUInt16( NUMITEM_VERSION_03 ); rStream.WriteUInt16( nLevelCount ); @@ -691,9 +689,8 @@ SvStream& SvxNumRule::Store( SvStream &rStream ) rStream.WriteUInt16( static_cast<sal_uInt16>(nFeatureFlags) ); if(pConverter) DestroyFontToSubsFontConverter(pConverter); - - return rStream; } + SvxNumRule::~SvxNumRule() { for(sal_uInt16 i = 0; i < SVX_MAX_NUM; i++) @@ -863,9 +860,8 @@ OUString SvxNumRule::MakeNumString( const SvxNodeNum& rNum, bool bInclStrings ) } // changes linked to embedded bitmaps -bool SvxNumRule::UnLinkGraphics() +void SvxNumRule::UnLinkGraphics() { - bool bRet = false; for(sal_uInt16 i = 0; i < GetLevelCount(); i++) { SvxNumberFormat aFmt(GetLevel(i)); @@ -882,14 +878,12 @@ bool SvxNumRule::UnLinkGraphics() aTempItem.SetGraphic(*pGraphic); sal_Int16 eOrient = aFmt.GetVertOrient(); aFmt.SetGraphicBrush( &aTempItem, &aFmt.GetGraphicSize(), &eOrient ); - bRet = true; } } else if((SVX_NUM_BITMAP|LINK_TOKEN) == aFmt.GetNumberingType()) aFmt.SetNumberingType(SVX_NUM_BITMAP); SetLevel(i, aFmt); } - return bRet; } SvxNumBulletItem::SvxNumBulletItem(SvxNumRule& rRule) : diff --git a/editeng/source/misc/splwrap.cxx b/editeng/source/misc/splwrap.cxx index 031d405..9ea4d8e 100644 --- a/editeng/source/misc/splwrap.cxx +++ b/editeng/source/misc/splwrap.cxx @@ -268,9 +268,8 @@ void SvxSpellWrapper::SpellEnd() ShowLanguageErrors(); } -bool SvxSpellWrapper::SpellContinue() +void SvxSpellWrapper::SpellContinue() { - return false; } void SvxSpellWrapper::ReplaceAll( const OUString &, sal_Int16 ) diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx index 6568380..8461634 100644 --- a/editeng/source/misc/svxacorr.cxx +++ b/editeng/source/misc/svxacorr.cxx @@ -1206,8 +1206,7 @@ OUString SvxAutoCorrect::GetQuote( SvxAutoCorrDoc& rDoc, sal_Int32 nInsPos, return sRet; } -sal_uLong -SvxAutoCorrect::DoAutoCorrect( SvxAutoCorrDoc& rDoc, const OUString& rTxt, +void SvxAutoCorrect::DoAutoCorrect( SvxAutoCorrDoc& rDoc, const OUString& rTxt, sal_Int32 nInsPos, sal_Unicode cChar, bool bInsert, vcl::Window* pFrameWin ) { @@ -1418,8 +1417,6 @@ SvxAutoCorrect::DoAutoCorrect( SvxAutoCorrDoc& rDoc, const OUString& rTxt, } } while( false ); - - return nRet; } SvxAutoCorrectLanguageLists& SvxAutoCorrect::_GetLanguageList( @@ -1608,7 +1605,7 @@ bool SvxAutoCorrect::PutText( const OUString& rShort, const OUString& rLong, return false; } -bool SvxAutoCorrect::MakeCombinedChanges( std::vector<SvxAutocorrWord>& aNewEntries, +void SvxAutoCorrect::MakeCombinedChanges( std::vector<SvxAutocorrWord>& aNewEntries, std::vector<SvxAutocorrWord>& aDeleteEntries, LanguageType eLang ) { @@ -1616,14 +1613,12 @@ bool SvxAutoCorrect::MakeCombinedChanges( std::vector<SvxAutocorrWord>& aNewEntr auto const iter = m_pLangTable->find(aLanguageTag); if (iter != m_pLangTable->end()) { - return iter->second->MakeCombinedChanges( aNewEntries, aDeleteEntries ); + iter->second->MakeCombinedChanges( aNewEntries, aDeleteEntries ); } else if(CreateLanguageFile( aLanguageTag )) { - return m_pLangTable->find( aLanguageTag )->second->MakeCombinedChanges( aNewEntries, aDeleteEntries ); + m_pLangTable->find( aLanguageTag )->second->MakeCombinedChanges( aNewEntries, aDeleteEntries ); } - return false; - } // - return the replacement text (only for SWG-Format, all other diff --git a/editeng/source/outliner/outliner.cxx b/editeng/source/outliner/outliner.cxx index 0643fd7..fac21c1 100644 --- a/editeng/source/outliner/outliner.cxx +++ b/editeng/source/outliner/outliner.cxx @@ -1334,7 +1334,7 @@ size_t Outliner::InsertView( OutlinerView* pView, size_t nIndex ) return ActualIndex; } -OutlinerView* Outliner::RemoveView( OutlinerView* pView ) +void Outliner::RemoveView( OutlinerView* pView ) { for ( ViewList::iterator it = aViewList.begin(); it != aViewList.end(); ++it ) @@ -1347,7 +1347,6 @@ OutlinerView* Outliner::RemoveView( OutlinerView* pView ) break; } } - return nullptr; // return superfluous } OutlinerView* Outliner::RemoveView( size_t nIndex ) diff --git a/editeng/source/outliner/outlvw.cxx b/editeng/source/outliner/outlvw.cxx index 782d0e2..9de935e 100644 --- a/editeng/source/outliner/outlvw.cxx +++ b/editeng/source/outliner/outlvw.cxx @@ -576,10 +576,9 @@ void OutlinerView::Indent( short nDiff ) pOwner->UndoActionEnd( OLUNDO_DEPTH ); } -bool OutlinerView::AdjustHeight( long nDY ) +void OutlinerView::AdjustHeight( long nDY ) { pEditView->MoveParagraphs( nDY ); - return true; // remove return value... } Rectangle OutlinerView::GetVisArea() const @@ -1275,9 +1274,9 @@ OUString OutlinerView::GetSelected() const return pEditView->GetSelected(); } -EESpellState OutlinerView::StartSpeller( bool bMultiDoc ) +void OutlinerView::StartSpeller( bool bMultiDoc ) { - return pEditView->StartSpeller( bMultiDoc ); + pEditView->StartSpeller( bMultiDoc ); } EESpellState OutlinerView::StartThesaurus() diff --git a/include/editeng/AccessibleEditableTextPara.hxx b/include/editeng/AccessibleEditableTextPara.hxx index 0d1b8e4..8ac3bd6 100644 --- a/include/editeng/AccessibleEditableTextPara.hxx +++ b/include/editeng/AccessibleEditableTextPara.hxx @@ -344,7 +344,7 @@ namespace accessibility void _correctValues( const sal_Int32 nIndex, css::uno::Sequence< css::beans::PropertyValue >& rValues ); sal_Int32 SkipField(sal_Int32 nIndex, bool bForward); // get overlapped field, extend return string. Only extend forward for now - bool ExtendByField( css::accessibility::TextSegment& Segment ); + void ExtendByField( css::accessibility::TextSegment& Segment ); OUString GetFieldTypeNameAtIndex(sal_Int32 nIndex); // the paragraph index in the edit engine (guarded by solar mutex) sal_Int32 mnParagraphIndex; diff --git a/include/editeng/editeng.hxx b/include/editeng/editeng.hxx index 11e1203..b35dffe 100644 --- a/include/editeng/editeng.hxx +++ b/include/editeng/editeng.hxx @@ -230,7 +230,7 @@ public: void InsertView(EditView* pEditView, size_t nIndex = EE_APPEND); EditView* RemoveView( EditView* pEditView ); - EditView* RemoveView(size_t nIndex = EE_APPEND); + void RemoveView(size_t nIndex = EE_APPEND); EditView* GetView(size_t nIndex = 0) const; size_t GetViewCount() const; bool HasView( EditView* pView ) const; @@ -371,7 +371,7 @@ public: // sal_uInt32: Error code of the stream. sal_uLong Read( SvStream& rInput, const OUString& rBaseURL, EETextFormat, SvKeyValueIterator* pHTTPHeaderAttrs = nullptr ); - sal_uLong Write( SvStream& rOutput, EETextFormat ); + void Write( SvStream& rOutput, EETextFormat ); void SetStatusEventHdl( const Link<EditStatus&,void>& rLink ); Link<EditStatus&,void> GetStatusEventHdl() const; @@ -590,7 +590,7 @@ public: EditPaM SplitContent(sal_Int32 nNode, sal_Int32 nSepPos); EditPaM ConnectContents(sal_Int32 nLeftNode, bool bBackward); - EditPaM InsertFeature(const EditSelection& rEditSelection, const SfxPoolItem& rItem); + void InsertFeature(const EditSelection& rEditSelection, const SfxPoolItem& rItem); EditSelection MoveParagraphs(const Range& rParagraphs, sal_Int32 nNewPos, EditView* pCurView); @@ -603,8 +603,8 @@ public: void SetUndoMode(bool b); void FormatAndUpdate(EditView* pCurView = nullptr); - bool Undo(EditView* pView); - bool Redo(EditView* pView); + void Undo(EditView* pView); + void Redo(EditView* pView); sal_Int32 GetOverflowingParaNum() const; sal_Int32 GetOverflowingLineNum() const; diff --git a/include/editeng/editobj.hxx b/include/editeng/editobj.hxx index 495571a..4a3939c 100644 --- a/include/editeng/editobj.hxx +++ b/include/editeng/editobj.hxx @@ -98,7 +98,7 @@ public: EditTextObject* Clone() const; - bool Store( SvStream& rOStream ) const; + void Store( SvStream& rOStream ) const; static EditTextObject* Create( SvStream& rIStream, SfxItemPool* pGlobalTextObjectPool = nullptr ); diff --git a/include/editeng/editview.hxx b/include/editeng/editview.hxx index 369f7db..33adc6e 100644 --- a/include/editeng/editview.hxx +++ b/include/editeng/editview.hxx @@ -120,7 +120,7 @@ public: bool HasSelection() const; ESelection GetSelection() const; void SetSelection( const ESelection& rNewSel ); - bool SelectCurrentWord( sal_Int16 nWordType = css::i18n::WordType::ANYWORD_IGNOREWHITESPACES ); + void SelectCurrentWord( sal_Int16 nWordType = css::i18n::WordType::ANYWORD_IGNOREWHITESPACES ); /// Returns the rectangles of the current selection in TWIPs. void GetSelectionRectangles(std::vector<Rectangle>& rLogicRects) const; diff --git a/include/editeng/numitem.hxx b/include/editeng/numitem.hxx index fe39ef2..d338a51 100644 --- a/include/editeng/numitem.hxx +++ b/include/editeng/numitem.hxx @@ -148,7 +148,7 @@ public: virtual ~SvxNumberFormat(); - SvStream& Store(SvStream &rStream, FontToSubsFontConverter pConverter); + void Store(SvStream &rStream, FontToSubsFontConverter pConverter); SvxNumberFormat& operator=( const SvxNumberFormat& ); bool operator==( const SvxNumberFormat& ) const; @@ -265,7 +265,7 @@ public: SvxNumRule& operator=( const SvxNumRule& ); - SvStream& Store(SvStream &rStream); + void Store(SvStream &rStream); const SvxNumberFormat* Get(sal_uInt16 nLevel)const; const SvxNumberFormat& GetLevel(sal_uInt16 nLevel)const; void SetLevel(sal_uInt16 nLevel, const SvxNumberFormat& rFmt, bool bIsValid = true); @@ -286,7 +286,7 @@ public: SvxNumRuleType GetNumRuleType() const { return eNumberingType; } - bool UnLinkGraphics(); + void UnLinkGraphics(); }; class EDITENG_DLLPUBLIC SvxNumBulletItem : public SfxPoolItem diff --git a/include/editeng/outliner.hxx b/include/editeng/outliner.hxx index f212b8c..b2c018e 100644 --- a/include/editeng/outliner.hxx +++ b/include/editeng/outliner.hxx @@ -259,7 +259,7 @@ public: void Indent( short nDiff ); void AdjustDepth( short nDX ); // Later replace with Indent! - bool AdjustHeight( long nDY ); + void AdjustHeight( long nDY ); sal_uLong Read( SvStream& rInput, const OUString& rBaseURL, EETextFormat eFormat, bool bSelect = false, SvKeyValueIterator* pHTTPHeaderAttrs = nullptr ); @@ -297,7 +297,7 @@ public: Pointer GetPointer( const Point& rPosPixel ); void Command( const CommandEvent& rCEvt ); - EESpellState StartSpeller( bool bMultipleDoc = false ); + void StartSpeller( bool bMultipleDoc = false ); EESpellState StartThesaurus(); sal_Int32 StartSearchAndReplace( const SvxSearchItem& rSearchItem ); @@ -690,7 +690,7 @@ public: void SetAddExtLeading( bool b ); size_t InsertView( OutlinerView* pView, size_t nIndex = size_t(-1) ); - OutlinerView* RemoveView( OutlinerView* pView ); + void RemoveView( OutlinerView* pView ); OutlinerView* RemoveView( size_t nIndex ); OutlinerView* GetView( size_t nIndex ) const; size_t GetViewCount() const; diff --git a/include/editeng/outlobj.hxx b/include/editeng/outlobj.hxx index eac443b..f4d9c6a 100644 --- a/include/editeng/outlobj.hxx +++ b/include/editeng/outlobj.hxx @@ -69,7 +69,6 @@ public: // compare operator bool operator==(const OutlinerParaObject& rCandidate) const; - bool operator!=(const OutlinerParaObject& rCandidate) const { return !operator==(rCandidate); } // #i102062# bool isWrongListEqual(const OutlinerParaObject& rCompare) const; diff --git a/include/editeng/splwrap.hxx b/include/editeng/splwrap.hxx index 8ca6a22..e2c0af7 100644 --- a/include/editeng/splwrap.hxx +++ b/include/editeng/splwrap.hxx @@ -106,7 +106,7 @@ protected: virtual bool SpellMore(); // examine further documents? virtual bool HasOtherCnt(); // Are there any special areas? virtual void SpellStart( SvxSpellArea eSpell ); // Preparing the area - virtual bool SpellContinue(); // Check Areas + virtual void SpellContinue(); // Check Areas // Result available through GetLast virtual void ReplaceAll( const OUString &rNewText, sal_Int16 nLanguage ); //Replace word from the replace list static css::uno::Reference< css::linguistic2::XDictionary > diff --git a/include/editeng/svxacorr.hxx b/include/editeng/svxacorr.hxx index a839e22..b5c54a0 100644 --- a/include/editeng/svxacorr.hxx +++ b/include/editeng/svxacorr.hxx @@ -87,7 +87,7 @@ public: virtual bool Replace( sal_Int32 nPos, const OUString& rTxt ) = 0; virtual bool ReplaceRange( sal_Int32 nPos, sal_Int32 nLen, const OUString& rTxt ) = 0; - virtual bool SetAttr( sal_Int32 nStt, sal_Int32 nEnd, sal_uInt16 nSlotId, + virtual void SetAttr( sal_Int32 nStt, sal_Int32 nEnd, sal_uInt16 nSlotId, SfxPoolItem& ) = 0; virtual bool SetINetAttr( sal_Int32 nStt, sal_Int32 nEnd, const OUString& rURL ) = 0; @@ -279,7 +279,7 @@ public: // FIXME: this has the horrible flaw that the rTxt must be a reference // to the actual SwTxtNode/EditNode string because it inserts the character // in rDoc and expects that to side-effect rTxt - sal_uLong DoAutoCorrect( SvxAutoCorrDoc& rDoc, const OUString& rTxt, + void DoAutoCorrect( SvxAutoCorrDoc& rDoc, const OUString& rTxt, sal_Int32 nPos, sal_Unicode cInsChar, bool bInsert, vcl::Window* pFrameWin = nullptr ); // Return for the autotext expansion the previous word, @@ -339,11 +339,11 @@ public: // - pure Text bool PutText( const OUString& rShort, const OUString& rLong, LanguageType eLang = LANGUAGE_SYSTEM ); // - Text with attribution (only in the SWG - SWG format!) - bool PutText( const OUString& rShort, SfxObjectShell& rShell, + void PutText( const OUString& rShort, SfxObjectShell& rShell, LanguageType eLang = LANGUAGE_SYSTEM ) - { return _GetLanguageList( eLang ).PutText(rShort, rShell ); } + { _GetLanguageList( eLang ).PutText(rShort, rShell ); } - bool MakeCombinedChanges( std::vector<SvxAutocorrWord>& aNewEntries, + void MakeCombinedChanges( std::vector<SvxAutocorrWord>& aNewEntries, std::vector<SvxAutocorrWord>& aDeleteEntries, LanguageType eLang = LANGUAGE_SYSTEM ); diff --git a/include/editeng/tstpitem.hxx b/include/editeng/tstpitem.hxx index d11b20f..5a9667b 100644 --- a/include/editeng/tstpitem.hxx +++ b/include/editeng/tstpitem.hxx @@ -72,8 +72,6 @@ public: } // For the SortedArray: - bool operator==( const SvxTabStop& rTS ) const - { return nTabPos == rTS.nTabPos; } bool operator <( const SvxTabStop& rTS ) const { return nTabPos < rTS.nTabPos; } diff --git a/sw/source/core/edit/acorrect.cxx b/sw/source/core/edit/acorrect.cxx index e84ddf3..ef4efb1 100644 --- a/sw/source/core/edit/acorrect.cxx +++ b/sw/source/core/edit/acorrect.cxx @@ -229,7 +229,7 @@ bool SwAutoCorrDoc::ReplaceRange( sal_Int32 nPos, sal_Int32 nSourceLength, const return true; } -bool SwAutoCorrDoc::SetAttr( sal_Int32 nStt, sal_Int32 nEnd, sal_uInt16 nSlotId, +void SwAutoCorrDoc::SetAttr( sal_Int32 nStt, sal_Int32 nEnd, sal_uInt16 nSlotId, SfxPoolItem& rItem ) { const SwNodeIndex& rNd = rCursor.GetPoint()->nNode; @@ -249,7 +249,6 @@ bool SwAutoCorrDoc::SetAttr( sal_Int32 nStt, sal_Int32 nEnd, sal_uInt16 nSlotId, if( bUndoIdInitialized ) bUndoIdInitialized = true; } - return 0 != nWhich; } bool SwAutoCorrDoc::SetINetAttr( sal_Int32 nStt, sal_Int32 nEnd, const OUString& rURL ) diff --git a/sw/source/core/inc/acorrect.hxx b/sw/source/core/inc/acorrect.hxx index b04df8c..50bc87c 100644 --- a/sw/source/core/inc/acorrect.hxx +++ b/sw/source/core/inc/acorrect.hxx @@ -62,7 +62,7 @@ public: virtual bool Replace( sal_Int32 nPos, const OUString& rText ) override; virtual bool ReplaceRange( sal_Int32 nPos, sal_Int32 nLen, const OUString& rText ) override; - virtual bool SetAttr( sal_Int32 nStt, sal_Int32 nEnd, sal_uInt16 nSlotId, + virtual void SetAttr( sal_Int32 nStt, sal_Int32 nEnd, sal_uInt16 nSlotId, SfxPoolItem& ) override; virtual bool SetINetAttr( sal_Int32 nStt, sal_Int32 nEnd, const OUString& rURL ) override; diff --git a/sw/source/uibase/inc/hyp.hxx b/sw/source/uibase/inc/hyp.hxx index 8d4e167..c8881ba 100644 --- a/sw/source/uibase/inc/hyp.hxx +++ b/sw/source/uibase/inc/hyp.hxx @@ -37,7 +37,7 @@ private: protected: virtual void SpellStart( SvxSpellArea eSpell ) override; - virtual bool SpellContinue() override; + virtual void SpellContinue() override; virtual void SpellEnd( ) override; virtual bool SpellMore() override; virtual void InsertHyphen( const sal_Int32 nPos ) override; // insert hyphen diff --git a/sw/source/uibase/lingu/hyp.cxx b/sw/source/uibase/lingu/hyp.cxx index 1959cff..f5a4dcd 100644 --- a/sw/source/uibase/lingu/hyp.cxx +++ b/sw/source/uibase/lingu/hyp.cxx @@ -68,7 +68,7 @@ void SwHyphWrapper::SpellStart( SvxSpellArea eSpell ) pView->HyphStart( eSpell ); } -bool SwHyphWrapper::SpellContinue() +void SwHyphWrapper::SpellContinue() { // for automatic separation, make actions visible only at the end std::unique_ptr<SwWait> pWait; @@ -89,8 +89,6 @@ bool SwHyphWrapper::SpellContinue() PSH->EndAllAction(); pWait.reset(); } - - return GetLast().is(); } void SwHyphWrapper::SpellEnd() _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits