From 6cbf151fa91ce50f7b1582c6e502a4474ba54b8e Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Wed, 13 Jan 2016 09:58:40 +0200 Subject: loplugin:unusedmethods unused return value in include/svtools Change-Id: Ibc83f032bb703559cc643933e53e8670bd6560b3 --- svtools/source/brwbox/brwbox1.cxx | 17 +++------------- svtools/source/contnr/ivctrl.cxx | 4 ++-- svtools/source/contnr/svlbitm.cxx | 4 +--- svtools/source/contnr/treelistbox.cxx | 35 +++++++++++++------------------- svtools/source/control/ctrlbox.cxx | 4 +--- svtools/source/control/tabbar.cxx | 6 +----- svtools/source/control/valueset.cxx | 8 +++----- svtools/source/dialogs/wizardmachine.cxx | 9 ++++---- svtools/source/graphic/grfmgr.cxx | 6 +++--- svtools/source/misc/ehdl.cxx | 5 +---- svtools/source/svhtml/htmlsupp.cxx | 4 +--- svtools/source/table/tablecontrol.cxx | 4 ++-- svtools/source/uno/contextmenuhelper.cxx | 6 +----- svtools/source/urlobj/inetimg.cxx | 5 +---- 14 files changed, 38 insertions(+), 79 deletions(-) (limited to 'svtools/source') diff --git a/svtools/source/brwbox/brwbox1.cxx b/svtools/source/brwbox/brwbox1.cxx index 77b44538b3e7..61e17bd68a7e 100644 --- a/svtools/source/brwbox/brwbox1.cxx +++ b/svtools/source/brwbox/brwbox1.cxx @@ -1968,7 +1968,7 @@ bool BrowseBox::IsColumnSelected( sal_uInt16 nColumnId ) const -bool BrowseBox::MakeFieldVisible +void BrowseBox::MakeFieldVisible ( long nRow, // line number of the field (starting with 0) sal_uInt16 nColId, // column ID of the field @@ -1981,14 +1981,6 @@ bool BrowseBox::MakeFieldVisible accordingly. If 'bComplete' is set, the field should become visible in its entirety. - [Returned Value] - - bool true - The given field is already visible or was already visible. - - false - The given field could not be made visible or in the case of - 'bComplete' could not be made visible in its entirety. */ { @@ -1996,12 +1988,12 @@ bool BrowseBox::MakeFieldVisible if ( !bBootstrapped || ( aTestSize.Width() == 0 && aTestSize.Height() == 0 ) ) - return false; + return; // is it visible already? bool bVisible = IsFieldVisible( nRow, nColId, bComplete ); if ( bVisible ) - return true; + return; // calculate column position, field rectangle and painting area sal_uInt16 nColPos = GetColumnPos( nColId ); @@ -2041,9 +2033,6 @@ bool BrowseBox::MakeFieldVisible if ( nRow > nBottomRow ) // scroll further to the top ScrollRows( nRow - nBottomRow ); - - // it might still not actually fit, e.g. if the window is too small - return IsFieldVisible( nRow, nColId, bComplete ); } diff --git a/svtools/source/contnr/ivctrl.cxx b/svtools/source/contnr/ivctrl.cxx index b69ce115308e..afa032a08c6e 100644 --- a/svtools/source/contnr/ivctrl.cxx +++ b/svtools/source/contnr/ivctrl.cxx @@ -286,9 +286,9 @@ bool SvtIconChoiceCtrl::IsEntryEditing() const return _pImp->IsEntryEditing(); } -bool SvtIconChoiceCtrl::SetChoiceWithCursor ( bool bDo ) +void SvtIconChoiceCtrl::SetChoiceWithCursor ( bool bDo ) { - return _pImp->SetChoiceWithCursor (bDo); + _pImp->SetChoiceWithCursor (bDo); } void SvtIconChoiceCtrl::KeyInput( const KeyEvent& rKEvt ) diff --git a/svtools/source/contnr/svlbitm.cxx b/svtools/source/contnr/svlbitm.cxx index 365c1a5817a7..c5e5403d2cdd 100644 --- a/svtools/source/contnr/svlbitm.cxx +++ b/svtools/source/contnr/svlbitm.cxx @@ -470,12 +470,10 @@ sal_uInt16 SvLBoxContextBmp::GetType() const return SV_ITEM_ID_LBOXCONTEXTBMP; } -bool SvLBoxContextBmp::SetModeImages( const Image& _rBitmap1, const Image& _rBitmap2 ) +void SvLBoxContextBmp::SetModeImages( const Image& _rBitmap1, const Image& _rBitmap2 ) { - bool bSuccess = true; m_pImpl->m_aImage1 = _rBitmap1; m_pImpl->m_aImage2 = _rBitmap2; - return bSuccess; } Image& SvLBoxContextBmp::implGetImageStore( bool _bFirst ) diff --git a/svtools/source/contnr/treelistbox.cxx b/svtools/source/contnr/treelistbox.cxx index 05ee850a4933..e7d19a0f4be6 100644 --- a/svtools/source/contnr/treelistbox.cxx +++ b/svtools/source/contnr/treelistbox.cxx @@ -1412,7 +1412,7 @@ void SvTreeListBox::InitTreeView() nContextBmpWidthMax = 0; SetFont( GetFont() ); - AdjustEntryHeightAndRecalc( GetFont() ); + AdjustEntryHeightAndRecalc(); SetSpaceBetweenEntries( 0 ); SetLineColor(); @@ -2183,7 +2183,7 @@ void SvTreeListBox::ModelHasCleared() if( !(nTreeFlags & SvTreeFlags::FIXEDHEIGHT )) nEntryHeight = 0; - AdjustEntryHeight( GetFont() ); + AdjustEntryHeight(); AdjustEntryHeight( GetDefaultExpandedEntryBmp() ); AdjustEntryHeight( GetDefaultCollapsedEntryBmp() ); @@ -2249,13 +2249,9 @@ short SvTreeListBox::GetHeightOffset(const Image& rBmp, Size& aSizeLogic ) return nOffset; } -short SvTreeListBox::GetHeightOffset(const vcl::Font& /* rFont */, Size& aSizeLogic ) +void SvTreeListBox::GetHeightOffset(Size& aSizeLogic ) { - short nOffset = 0; aSizeLogic = Size(GetTextWidth(OUString('X')), GetTextHeight()); - if( GetEntryHeight() > aSizeLogic.Height() ) - nOffset = ( GetEntryHeight() - (short)aSizeLogic.Height()) / 2; - return nOffset; } void SvTreeListBox::SetEntryHeight( SvTreeListEntry* pEntry ) @@ -2307,10 +2303,10 @@ void SvTreeListBox::AdjustEntryHeight( const Image& rBmp ) } } -void SvTreeListBox::AdjustEntryHeight( const vcl::Font& rFont ) +void SvTreeListBox::AdjustEntryHeight() { Size aSize; - GetHeightOffset( rFont, aSize ); + GetHeightOffset( aSize ); if( aSize.Height() > nEntryHeight ) { nEntryHeight = (short)aSize.Height() + nEntryHeightOffs; @@ -2504,12 +2500,12 @@ void SvTreeListBox::SetFont( const vcl::Font& rFont ) if (aTempFont == aOrigFont) return; - AdjustEntryHeightAndRecalc( GetFont() ); + AdjustEntryHeightAndRecalc(); } -void SvTreeListBox::AdjustEntryHeightAndRecalc( const vcl::Font& rFont ) +void SvTreeListBox::AdjustEntryHeightAndRecalc() { - AdjustEntryHeight( rFont ); + AdjustEntryHeight(); // always invalidate, else things go wrong in SetEntryHeight RecalcViewData(); } @@ -2567,7 +2563,7 @@ void SvTreeListBox::SetSpaceBetweenEntries( short nOffsLogic ) nEntryHeight = nEntryHeight - nEntryHeightOffs; nEntryHeightOffs = (short)nOffsLogic; nEntryHeight = nEntryHeight + nOffsLogic; - AdjustEntryHeightAndRecalc( GetFont() ); + AdjustEntryHeightAndRecalc(); pImp->SetEntryHeight( nEntryHeight ); } } @@ -2818,7 +2814,7 @@ void SvTreeListBox::InvalidateEntry(SvTreeListEntry* pEntry) } } -long SvTreeListBox::PaintEntry1(SvTreeListEntry& rEntry, long nLine, vcl::RenderContext& rRenderContext, +void SvTreeListBox::PaintEntry1(SvTreeListEntry& rEntry, long nLine, vcl::RenderContext& rRenderContext, SvLBoxTabFlags nTabFlags, bool bHasClipRegion) { @@ -3138,8 +3134,6 @@ long SvTreeListBox::PaintEntry1(SvTreeListEntry& rEntry, long nLine, vcl::Render if (bHasClipRegion && bResetClipRegion) rRenderContext.SetClipRegion(); - - return 0; // nRowLen; } void SvTreeListBox::PreparePaint(vcl::RenderContext& /*rRenderContext*/, SvTreeListEntry& /*rEntry*/) @@ -3560,7 +3554,7 @@ SvLBoxTab* SvTreeListBox::GetFirstTab( SvLBoxTabFlags nFlagMask, sal_uInt16& rPo return nullptr; } -SvLBoxTab* SvTreeListBox::GetLastTab( SvLBoxTabFlags nFlagMask, sal_uInt16& rTabPos ) +void SvTreeListBox::GetLastTab( SvLBoxTabFlags nFlagMask, sal_uInt16& rTabPos ) { sal_uInt16 nPos = (sal_uInt16)aTabs.size(); while( nPos ) @@ -3570,11 +3564,10 @@ SvLBoxTab* SvTreeListBox::GetLastTab( SvLBoxTabFlags nFlagMask, sal_uInt16& rTab if( (pTab->nFlags & nFlagMask) ) { rTabPos = nPos; - return pTab; + return; } } rTabPos = 0xffff; - return nullptr; } void SvTreeListBox::RequestHelp( const HelpEvent& rHEvt ) @@ -3746,7 +3739,7 @@ void SvTreeListBox::ApplySettings(vcl::RenderContext& rRenderContext) aFont = rStyleSettings.GetFieldFont(); aFont.SetColor(rStyleSettings.GetWindowTextColor()); SetPointFont(rRenderContext, aFont); - AdjustEntryHeightAndRecalc(aFont); + AdjustEntryHeightAndRecalc(); rRenderContext.SetTextColor(rStyleSettings.GetFieldTextColor()); rRenderContext.SetTextFillColor(); @@ -3766,7 +3759,7 @@ void SvTreeListBox::InitSettings(bool bFont, bool bForeground, bool bBackground) aFont = rStyleSettings.GetFieldFont(); aFont.SetColor(rStyleSettings.GetWindowTextColor()); SetPointFont(*this, aFont); - AdjustEntryHeightAndRecalc(aFont); + AdjustEntryHeightAndRecalc(); } if (bForeground || bFont) diff --git a/svtools/source/control/ctrlbox.cxx b/svtools/source/control/ctrlbox.cxx index 92f18c38fcf4..5c411202463c 100644 --- a/svtools/source/control/ctrlbox.cxx +++ b/svtools/source/control/ctrlbox.cxx @@ -827,7 +827,7 @@ sal_uInt16 LineListBox::GetEntryStyle( sal_Int32 nPos ) const return ( pData ) ? pData->GetStyle() : css::table::BorderLineStyle::NONE; } -bool LineListBox::UpdatePaintLineColor() +void LineListBox::UpdatePaintLineColor() { const StyleSettings& rSettings = GetSettings().GetStyleSettings(); Color aNewCol( rSettings.GetWindowColor().IsDark()? rSettings.GetLabelTextColor() : aColor ); @@ -836,8 +836,6 @@ bool LineListBox::UpdatePaintLineColor() if( bRet ) maPaintCol = aNewCol; - - return bRet; } void LineListBox::UpdateEntries( long nOldWidth ) diff --git a/svtools/source/control/tabbar.cxx b/svtools/source/control/tabbar.cxx index a71036bd04d8..307987955451 100644 --- a/svtools/source/control/tabbar.cxx +++ b/svtools/source/control/tabbar.cxx @@ -2510,9 +2510,8 @@ void TabBar::HideDropPos() } } -bool TabBar::SwitchPage(const Point& rPos) +void TabBar::SwitchPage(const Point& rPos) { - bool bSwitch = false; sal_uInt16 nSwitchId = GetPageId(rPos); if (!nSwitchId) EndSwitchPage(); @@ -2537,15 +2536,12 @@ bool TabBar::SwitchPage(const Point& rPos) Update(); ImplActivatePage(); ImplSelect(); - bSwitch = true; } mbInSwitching = false; } } } } - - return bSwitch; } void TabBar::EndSwitchPage() diff --git a/svtools/source/control/valueset.cxx b/svtools/source/control/valueset.cxx index e6481b9b7e9d..fe799ff8cf68 100644 --- a/svtools/source/control/valueset.cxx +++ b/svtools/source/control/valueset.cxx @@ -2167,10 +2167,10 @@ void ValueSet::SetFormat(bool bFormat) mbFormat = bFormat; } -bool ValueSet::StartDrag( const CommandEvent& rEvent, vcl::Region& rRegion ) +void ValueSet::StartDrag( const CommandEvent& rEvent, vcl::Region& rRegion ) { if ( rEvent.GetCommand() != CommandEventId::StartDrag ) - return false; + return; // if necessary abort an existing action EndSelection(); @@ -2186,7 +2186,7 @@ bool ValueSet::StartDrag( const CommandEvent& rEvent, vcl::Region& rRegion ) // don't activate dragging if no item was clicked on if ( !nSelId ) - return false; + return; // Check out if the page was selected. If not set as current page and // call select. @@ -2201,8 +2201,6 @@ bool ValueSet::StartDrag( const CommandEvent& rEvent, vcl::Region& rRegion ) // assign region rRegion = aRegion; - - return true; } Size ValueSet::CalcWindowSizePixel( const Size& rItemSize, sal_uInt16 nDesireCols, diff --git a/svtools/source/dialogs/wizardmachine.cxx b/svtools/source/dialogs/wizardmachine.cxx index b1f08ef15160..ec4ce04f06e9 100644 --- a/svtools/source/dialogs/wizardmachine.cxx +++ b/svtools/source/dialogs/wizardmachine.cxx @@ -506,12 +506,12 @@ namespace svt } - bool OWizardMachine::skip(sal_Int32 _nSteps) + void OWizardMachine::skip(sal_Int32 _nSteps) { DBG_ASSERT(_nSteps > 0, "OWizardMachine::skip: invalid number of steps!"); // allowed to leave the current page? if ( !prepareLeaveCurrentState( eTravelForward ) ) - return false; + return; WizardState nCurrentState = getCurrentState(); WizardState nNextState = determineNextState(nCurrentState); @@ -519,7 +519,7 @@ namespace svt while (_nSteps-- > 0) { if (WZS_INVALID_STATE == nNextState) - return false; + return; // remember the skipped state in the history m_pImpl->aStateHistory.push(nCurrentState); @@ -538,11 +538,10 @@ namespace svt // if somebody does a skip and then does not allow to leave ... // (can't be a commit error, as we've already committed the current page. So if ShowPage fails here, // somebody behaves really strange ...) - return false; + return; } // all fine - return true; } diff --git a/svtools/source/graphic/grfmgr.cxx b/svtools/source/graphic/grfmgr.cxx index 40b601ea09ce..74346e9aa064 100644 --- a/svtools/source/graphic/grfmgr.cxx +++ b/svtools/source/graphic/grfmgr.cxx @@ -574,11 +574,11 @@ bool GraphicObject::Draw( OutputDevice* pOut, const Point& rPt, const Size& rSz, return bRet; } -bool GraphicObject::DrawTiled( OutputDevice* pOut, const Rectangle& rArea, const Size& rSize, +void GraphicObject::DrawTiled( OutputDevice* pOut, const Rectangle& rArea, const Size& rSize, const Size& rOffset, const GraphicAttr* pAttr, GraphicManagerDrawFlags nFlags, int nTileCacheSize1D ) { if( pOut == nullptr || rSize.Width() == 0 || rSize.Height() == 0 ) - return false; + return; const MapMode aOutMapMode( pOut->GetMapMode() ); const MapMode aMapMode( aOutMapMode.GetMapUnit(), Point(), aOutMapMode.GetScaleX(), aOutMapMode.GetScaleY() ); @@ -593,7 +593,7 @@ bool GraphicObject::DrawTiled( OutputDevice* pOut, const Rectangle& rArea, const while (((sal_Int64)rSize.Height() * nTileCacheSize1D) > SAL_MAX_UINT16) nTileCacheSize1D /= 2; - return ImplDrawTiled( pOut, rArea, aOutTileSize, rOffset, pAttr, nFlags, nTileCacheSize1D ); + ImplDrawTiled( pOut, rArea, aOutTileSize, rOffset, pAttr, nFlags, nTileCacheSize1D ); } bool GraphicObject::StartAnimation( OutputDevice* pOut, const Point& rPt, const Size& rSz, diff --git a/svtools/source/misc/ehdl.cxx b/svtools/source/misc/ehdl.cxx index c7248717dbbd..f98407097ae1 100644 --- a/svtools/source/misc/ehdl.cxx +++ b/svtools/source/misc/ehdl.cxx @@ -263,7 +263,7 @@ struct ErrorResource_Impl : private Resource }; -bool SfxErrorHandler::GetClassString(sal_uLong lClassId, OUString &rStr) const +void SfxErrorHandler::GetClassString(sal_uLong lClassId, OUString &rStr) const /* [Description] @@ -273,7 +273,6 @@ bool SfxErrorHandler::GetClassString(sal_uLong lClassId, OUString &rStr) const */ { - bool bRet = false; std::unique_ptr pResMgr(ResMgr::CreateResMgr("ofa", Application::GetSettings().GetUILanguageTag() )); if( pResMgr ) { @@ -282,10 +281,8 @@ bool SfxErrorHandler::GetClassString(sal_uLong lClassId, OUString &rStr) const if(aEr) { rStr = static_cast(aEr).GetString(); - bRet = true; } } - return bRet; } diff --git a/svtools/source/svhtml/htmlsupp.cxx b/svtools/source/svhtml/htmlsupp.cxx index f2963081ebed..2f075997e0ab 100644 --- a/svtools/source/svhtml/htmlsupp.cxx +++ b/svtools/source/svhtml/htmlsupp.cxx @@ -35,7 +35,7 @@ static HTMLOptionEnum const aScriptLangOptEnums[] = { nullptr, 0 } }; -bool HTMLParser::ParseScriptOptions( OUString& rLangString, const OUString& rBaseURL, +void HTMLParser::ParseScriptOptions( OUString& rLangString, const OUString& rBaseURL, HTMLScriptLanguage& rLang, OUString& rSrc, OUString& rLibrary, @@ -77,8 +77,6 @@ bool HTMLParser::ParseScriptOptions( OUString& rLangString, const OUString& rBas break; } } - - return true; } void HTMLParser::RemoveSGMLComment( OUString &rString, bool bFull ) diff --git a/svtools/source/table/tablecontrol.cxx b/svtools/source/table/tablecontrol.cxx index b30d5836504e..5975b67c8ebe 100644 --- a/svtools/source/table/tablecontrol.cxx +++ b/svtools/source/table/tablecontrol.cxx @@ -194,9 +194,9 @@ namespace svt { namespace table } - bool TableControl::GoToCell(sal_Int32 _nColPos, sal_Int32 _nRowPos) + void TableControl::GoToCell(sal_Int32 _nColPos, sal_Int32 _nRowPos) { - return m_pImpl->goTo( _nColPos, _nRowPos ); + m_pImpl->goTo( _nColPos, _nRowPos ); } diff --git a/svtools/source/uno/contextmenuhelper.cxx b/svtools/source/uno/contextmenuhelper.cxx index 3ae2b5b10129..6c74a1be305f 100644 --- a/svtools/source/uno/contextmenuhelper.cxx +++ b/svtools/source/uno/contextmenuhelper.cxx @@ -377,7 +377,7 @@ ContextMenuHelper::dispatchCommand( // retrieves and stores references to our user-interface // configuration managers, like image manager, ui command // description manager. -bool +void ContextMenuHelper::associateUIConfigurationManagers() { uno::Reference< frame::XFrame > xFrame( m_xWeakFrame ); @@ -445,13 +445,9 @@ ContextMenuHelper::associateUIConfigurationManagers() } catch ( uno::Exception& ) { - m_bUICfgMgrAssociated = true; - return false; } m_bUICfgMgrAssociated = true; } - - return true; } Image diff --git a/svtools/source/urlobj/inetimg.cxx b/svtools/source/urlobj/inetimg.cxx index d1b7fd74717c..4bcea5ae65d4 100644 --- a/svtools/source/urlobj/inetimg.cxx +++ b/svtools/source/urlobj/inetimg.cxx @@ -25,9 +25,8 @@ static const sal_Unicode TOKEN_SEPARATOR = '\001'; -bool INetImage::Write( SvStream& rOStm, SotClipboardFormatId nFormat ) const +void INetImage::Write( SvStream& rOStm, SotClipboardFormatId nFormat ) const { - bool bRet = false; switch( nFormat ) { case SotClipboardFormatId::INET_IMAGE: @@ -47,7 +46,6 @@ bool INetImage::Write( SvStream& rOStm, SotClipboardFormatId nFormat ) const rOStm.Write(sOut.getStr(), sOut.getLength()); static const sal_Char aEndChar[2] = { 0 }; rOStm.Write( aEndChar, sizeof( aEndChar )); - bRet = 0 == rOStm.GetError(); } break; @@ -55,7 +53,6 @@ bool INetImage::Write( SvStream& rOStm, SotClipboardFormatId nFormat ) const break; default: break; } - return bRet; } bool INetImage::Read( SvStream& rIStm, SotClipboardFormatId nFormat ) -- cgit