From 889fc93087ae1b57348803014c0a6090fd48c06f Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 11 Jan 2016 08:39:44 +0200 Subject: loplugin:unusedmethods unused return value in cui Change-Id: Ib65ceeeb5e1be0de5e3808e652e910fff3820bf8 --- cui/source/customize/cfg.cxx | 19 ++++--------------- cui/source/dialogs/SpellDialog.cxx | 5 ++--- cui/source/dialogs/cuihyperdlg.cxx | 3 +-- cui/source/dialogs/hangulhanjadlg.cxx | 6 ++---- cui/source/dialogs/iconcdlg.cxx | 7 +------ cui/source/inc/SpellDialog.hxx | 2 +- cui/source/inc/cfg.hxx | 10 +++++----- cui/source/inc/cuihyperdlg.hxx | 2 +- cui/source/inc/cuitabline.hxx | 4 ++-- cui/source/inc/iconcdlg.hxx | 5 +---- cui/source/inc/swpossizetabpage.hxx | 2 +- cui/source/options/dbregistersettings.hxx | 4 ---- cui/source/options/optaboutconfig.cxx | 7 +------ cui/source/options/optaboutconfig.hxx | 2 +- cui/source/tabpages/swpossizetabpage.cxx | 4 +--- cui/source/tabpages/tpline.cxx | 4 +--- cui/source/tabpages/tplneend.cxx | 5 ++--- 17 files changed, 27 insertions(+), 64 deletions(-) (limited to 'cui/source') diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx index 89cc606ec466..cd941bebdcb4 100644 --- a/cui/source/customize/cfg.cxx +++ b/cui/source/customize/cfg.cxx @@ -2580,7 +2580,7 @@ void SvxMenuConfigPage::DeleteSelectedTopLevel() GetSaveInData()->SetModified( ); } -bool SvxMenuConfigPage::DeleteSelectedContent() +void SvxMenuConfigPage::DeleteSelectedContent() { SvTreeListEntry *pActEntry = m_pContentsListBox->FirstSelected(); @@ -2610,10 +2610,7 @@ bool SvxMenuConfigPage::DeleteSelectedContent() GetSaveInData()->SetModified(); pMenu->SetModified(); - - return true; } - return false; } short SvxMenuConfigPage::QueryReset() @@ -3220,7 +3217,7 @@ void SvxToolbarConfigPage::DeleteSelectedTopLevel() } } -bool SvxToolbarConfigPage::DeleteSelectedContent() +void SvxToolbarConfigPage::DeleteSelectedContent() { SvTreeListEntry *pActEntry = m_pContentsListBox->FirstSelected(); @@ -3258,11 +3255,7 @@ bool SvxToolbarConfigPage::DeleteSelectedContent() DeleteSelectedTopLevel(); } } - - return true; } - - return false; } IMPL_LINK_TYPED( SvxToolbarConfigPage, MoveHdl, Button *, pButton, void ) @@ -4403,7 +4396,7 @@ void ToolbarSaveInData::RestoreToolbar( SvxConfigEntry* pToolbar ) } } -bool ToolbarSaveInData::LoadToolbar( +void ToolbarSaveInData::LoadToolbar( const uno::Reference< container::XIndexAccess >& xToolbarSettings, SvxConfigEntry* pParentData ) { @@ -4486,8 +4479,6 @@ bool ToolbarSaveInData::LoadToolbar( } } } - - return true; } IMPL_LINK_NOARG_TYPED( SvxToolbarConfigPage, SelectToolbarEntry, SvTreeListBox *, void ) @@ -4706,7 +4697,7 @@ IMPL_LINK_NOARG_TYPED( SvxToolbarConfigPage, AddFunctionHdl, SvxScriptSelectorDi AddFunction(); } -SvTreeListEntry* SvxToolbarConfigPage::AddFunction( +void SvxToolbarConfigPage::AddFunction( SvTreeListEntry* pTarget, bool bFront, bool bAllowDuplicates ) { SvTreeListEntry* pNewLBEntry = @@ -4733,8 +4724,6 @@ SvTreeListEntry* SvxToolbarConfigPage::AddFunction( { static_cast( GetSaveInData() )->ApplyToolbar( pToolbar ); } - - return pNewLBEntry; } SvxToolbarEntriesListBox::SvxToolbarEntriesListBox(vcl::Window* pParent, SvxToolbarConfigPage* pPg) diff --git a/cui/source/dialogs/SpellDialog.cxx b/cui/source/dialogs/SpellDialog.cxx index f0e27d1217c7..ee2d52068fa1 100644 --- a/cui/source/dialogs/SpellDialog.cxx +++ b/cui/source/dialogs/SpellDialog.cxx @@ -905,7 +905,7 @@ IMPL_LINK_TYPED(SpellDialog, AddToDictSelectHdl, MenuButton*, pButton, void ) } -int SpellDialog::AddToDictionaryExecute( sal_uInt16 nItemId, PopupMenu *pMenu ) +void SpellDialog::AddToDictionaryExecute( sal_uInt16 nItemId, PopupMenu *pMenu ) { m_pSentenceED->UndoActionStart( SPELLUNDO_CHANGE_GROUP ); @@ -944,13 +944,12 @@ int SpellDialog::AddToDictionaryExecute( sal_uInt16 nItemId, PopupMenu *pMenu ) if (DictionaryError::NONE != nAddRes) { SvxDicError( this, nAddRes ); - return 0; // don't continue + return; // don't continue } // go on SpellContinue_Impl(); m_pSentenceED->UndoActionEnd(); - return 0; } diff --git a/cui/source/dialogs/cuihyperdlg.cxx b/cui/source/dialogs/cuihyperdlg.cxx index 6e06fd9c5815..88429636510f 100644 --- a/cui/source/dialogs/cuihyperdlg.cxx +++ b/cui/source/dialogs/cuihyperdlg.cxx @@ -305,7 +305,7 @@ IMPL_LINK_NOARG_TYPED(SvxHpLinkDlg, ClickCloseHdl_Impl, Button*, void) |* |************************************************************************/ -sal_uInt16 SvxHpLinkDlg::SetPage ( SvxHyperlinkItem* pItem ) +void SvxHpLinkDlg::SetPage ( SvxHyperlinkItem* pItem ) { sal_uInt16 nPageId = RID_SVXPAGE_HYPERLINK_INTERNET; @@ -355,7 +355,6 @@ sal_uInt16 SvxHpLinkDlg::SetPage ( SvxHyperlinkItem* pItem ) mbGrabFocus = false; } } - return nPageId; } /************************************************************************* diff --git a/cui/source/dialogs/hangulhanjadlg.cxx b/cui/source/dialogs/hangulhanjadlg.cxx index 5665b0d58843..8ebe2f49296c 100644 --- a/cui/source/dialogs/hangulhanjadlg.cxx +++ b/cui/source/dialogs/hangulhanjadlg.cxx @@ -1247,7 +1247,7 @@ namespace svx SuggestionList(); ~SuggestionList(); - bool Set( const OUString& _rElement, sal_uInt16 _nNumOfElement ); + void Set( const OUString& _rElement, sal_uInt16 _nNumOfElement ); bool Reset( sal_uInt16 _nNumOfElement ); const OUString* Get( sal_uInt16 _nNumOfElement ) const; void Clear(); @@ -1269,7 +1269,7 @@ namespace svx Clear(); } - bool SuggestionList::Set( const OUString& _rElement, sal_uInt16 _nNumOfElement ) + void SuggestionList::Set( const OUString& _rElement, sal_uInt16 _nNumOfElement ) { bool bRet = _nNumOfElement < m_vElements.size(); if( bRet ) @@ -1282,8 +1282,6 @@ namespace svx ++m_nNumOfEntries; } } - - return bRet; } bool SuggestionList::Reset( sal_uInt16 _nNumOfElement ) diff --git a/cui/source/dialogs/iconcdlg.cxx b/cui/source/dialogs/iconcdlg.cxx index 575064151ff0..99a67551ca8a 100644 --- a/cui/source/dialogs/iconcdlg.cxx +++ b/cui/source/dialogs/iconcdlg.cxx @@ -494,7 +494,7 @@ void IconChoiceDialog::ActivatePageImpl () -bool IconChoiceDialog::DeActivatePageImpl () +void IconChoiceDialog::DeActivatePageImpl () { IconChoicePageData *pData = GetPageData ( mnCurrentPageId ); @@ -551,11 +551,6 @@ bool IconChoiceDialog::DeActivatePageImpl () } } } - - if ( nRet & IconChoicePage::LEAVE_PAGE ) - return true; - else - return false; } diff --git a/cui/source/inc/SpellDialog.hxx b/cui/source/inc/SpellDialog.hxx index 021178120351..bae843e436fe 100644 --- a/cui/source/inc/SpellDialog.hxx +++ b/cui/source/inc/SpellDialog.hxx @@ -197,7 +197,7 @@ private: DECL_LINK_TYPED( InitHdl, void*, void ); - int AddToDictionaryExecute( sal_uInt16 ItemId, PopupMenu *pMenu ); + void AddToDictionaryExecute( sal_uInt16 ItemId, PopupMenu *pMenu ); void StartSpellOptDlg_Impl(); int InitUserDicts(); void UpdateBoxes_Impl(); diff --git a/cui/source/inc/cfg.hxx b/cui/source/inc/cfg.hxx index a77cbeb11259..0b47d2c9675b 100644 --- a/cui/source/inc/cfg.hxx +++ b/cui/source/inc/cfg.hxx @@ -443,7 +443,7 @@ public: bool FillItemSet( SfxItemSet* ) override; void Reset( const SfxItemSet* ) override; - virtual bool DeleteSelectedContent() = 0; + virtual void DeleteSelectedContent() = 0; virtual void DeleteSelectedTopLevel() = 0; SvxConfigEntry* GetTopLevelSelection() @@ -481,7 +481,7 @@ private: void Init() override; void UpdateButtonStates() override; short QueryReset() override; - bool DeleteSelectedContent() override; + void DeleteSelectedContent() override; void DeleteSelectedTopLevel() override; public: @@ -574,7 +574,7 @@ private: void UpdateButtonStates() override; short QueryReset() override; void Init() override; - bool DeleteSelectedContent() override; + void DeleteSelectedContent() override; void DeleteSelectedTopLevel() override; public: @@ -582,7 +582,7 @@ public: virtual ~SvxToolbarConfigPage(); virtual void dispose() override; - SvTreeListEntry* AddFunction( SvTreeListEntry* pTarget = nullptr, + void AddFunction( SvTreeListEntry* pTarget = nullptr, bool bFront = false, bool bAllowDuplicates = true ); @@ -607,7 +607,7 @@ private: css::uno::Reference < css::container::XNameAccess > m_xPersistentWindowState; - bool LoadToolbar( + void LoadToolbar( const css::uno::Reference< css::container::XIndexAccess >& xToolBarSettings, SvxConfigEntry* pParentData ); diff --git a/cui/source/inc/cuihyperdlg.hxx b/cui/source/inc/cuihyperdlg.hxx index f67e51e38532..8b47df782023 100644 --- a/cui/source/inc/cuihyperdlg.hxx +++ b/cui/source/inc/cuihyperdlg.hxx @@ -85,7 +85,7 @@ public: virtual void PageCreated( sal_uInt16 nId, IconChoicePage& rPage ) override; - sal_uInt16 SetPage( SvxHyperlinkItem* pItem ); + void SetPage( SvxHyperlinkItem* pItem ); void SetReadOnlyMode( bool bReadOnly ); inline bool IsHTMLDoc() const { return mbIsHTMLDoc; } diff --git a/cui/source/inc/cuitabline.hxx b/cui/source/inc/cuitabline.hxx index 41ba413e7f60..00b4ce502324 100644 --- a/cui/source/inc/cuitabline.hxx +++ b/cui/source/inc/cuitabline.hxx @@ -191,7 +191,7 @@ private: // LineCaps DECL_LINK_TYPED( ChangeCapStyleHdl_Impl, ListBox&, void ); - bool FillXLSet_Impl(); + void FillXLSet_Impl(); void InitSymbols(MenuButton* pButton); void SymbolSelected(MenuButton* pButton); @@ -366,7 +366,7 @@ private: DECL_LINK_TYPED( ClickLoadHdl_Impl, Button*, void ); DECL_LINK_TYPED( ClickSaveHdl_Impl, Button*, void ); DECL_LINK_TYPED( SelectLineEndHdl_Impl, ListBox&, void ); - long ChangePreviewHdl_Impl( void* p ); + void ChangePreviewHdl_Impl(); void CheckChanges_Impl(); diff --git a/cui/source/inc/iconcdlg.hxx b/cui/source/inc/iconcdlg.hxx index a852d92828a0..76d8d37f71c8 100644 --- a/cui/source/inc/iconcdlg.hxx +++ b/cui/source/inc/iconcdlg.hxx @@ -164,7 +164,7 @@ protected: static void RefreshInputSet(); void ActivatePageImpl (); - bool DeActivatePageImpl (); + void DeActivatePageImpl (); void ResetPageImpl (); short Ok(); @@ -191,11 +191,8 @@ public: const sal_uInt16* GetInputRanges( const SfxItemPool& ); void SetInputSet( const SfxItemSet* pInSet ); - const OKButton& GetOKButton() const { return *m_pOKBtn; } OKButton& GetOKButton() { return *m_pOKBtn; } - const PushButton& GetApplyButton() const { return *m_pApplyBtn; } PushButton& GetApplyButton() { return *m_pApplyBtn; } - const CancelButton& GetCancelButton() const { return *m_pCancelBtn; } CancelButton& GetCancelButton() { return *m_pCancelBtn; } short Execute() override; diff --git a/cui/source/inc/swpossizetabpage.hxx b/cui/source/inc/swpossizetabpage.hxx index 69605d713eb6..b29ccec012a0 100644 --- a/cui/source/inc/swpossizetabpage.hxx +++ b/cui/source/inc/swpossizetabpage.hxx @@ -116,7 +116,7 @@ class SvxSwPosSizeTabPage : public SfxTabPage static short GetAlignment(FrmMap *pMap, sal_uInt16 nMapPos, ListBox &rAlignLB, ListBox &rRelationLB); static short GetRelation(FrmMap *pMap, ListBox &rRelationLB); short GetAnchorType(bool* pbHasChanged = nullptr); - sal_uLong FillRelLB(FrmMap *pMap, sal_uInt16 nLBSelPos, sal_uInt16 nAlign, sal_uInt16 nRel, ListBox &rLB, FixedText &rFT); + void FillRelLB(FrmMap *pMap, sal_uInt16 nLBSelPos, sal_uInt16 nAlign, sal_uInt16 nRel, ListBox &rLB, FixedText &rFT); sal_uInt16 FillPosLB(FrmMap *pMap, sal_uInt16 nAlign, const sal_uInt16 _nRel, ListBox &rLB); void UpdateExample(); diff --git a/cui/source/options/dbregistersettings.hxx b/cui/source/options/dbregistersettings.hxx index 9c85d9be7edb..131cef4c804a 100644 --- a/cui/source/options/dbregistersettings.hxx +++ b/cui/source/options/dbregistersettings.hxx @@ -55,10 +55,6 @@ namespace svx // properly set when filling the struct from the XDatabaseRegistrations data } - bool operator!=( const DatabaseRegistration& _rhs ) const - { - return !( this->operator==( _rhs ) ); - } }; typedef ::std::map< OUString, DatabaseRegistration > DatabaseRegistrations; diff --git a/cui/source/options/optaboutconfig.cxx b/cui/source/options/optaboutconfig.cxx index 58838fc67505..bf596513261a 100644 --- a/cui/source/options/optaboutconfig.cxx +++ b/cui/source/options/optaboutconfig.cxx @@ -234,10 +234,8 @@ void CuiAboutConfigTabPage::Reset() m_pPrefBox->SetUpdateMode(true); } -bool CuiAboutConfigTabPage::FillItemSet() +void CuiAboutConfigTabPage::FillItemSet() { - bool bModified = false; - std::vector< std::shared_ptr< Prop_Impl > >::iterator pIter; for( pIter = m_vectorOfModified.begin() ; pIter != m_vectorOfModified.end(); ++pIter ) { @@ -245,13 +243,10 @@ bool CuiAboutConfigTabPage::FillItemSet() Reference< XNameReplace > xNameReplace( xUpdateAccess, UNO_QUERY_THROW ); xNameReplace->replaceByName( (*pIter)->Property, (*pIter)->Value ); - bModified = true; Reference< util::XChangesBatch > xChangesBatch( xUpdateAccess, UNO_QUERY_THROW ); xChangesBatch->commitChanges(); } - - return bModified; } void CuiAboutConfigTabPage::FillItems(const Reference< XNameAccess >& xNameAccess, SvTreeListEntry *pParentEntry, diff --git a/cui/source/options/optaboutconfig.hxx b/cui/source/options/optaboutconfig.hxx index d03d6635c1be..db0df56e41dc 100644 --- a/cui/source/options/optaboutconfig.hxx +++ b/cui/source/options/optaboutconfig.hxx @@ -75,7 +75,7 @@ public: void FillItems(const css::uno::Reference& xNameAccess, SvTreeListEntry *pParentEntry = nullptr, int lineage = 0, bool bLoadAll = false); static css::uno::Reference< css::container::XNameAccess > getConfigAccess( const OUString& sNodePath, bool bUpdate ); - bool FillItemSet(); + void FillItemSet(); }; class CuiAboutConfigValueDialog : public ModalDialog diff --git a/cui/source/tabpages/swpossizetabpage.cxx b/cui/source/tabpages/swpossizetabpage.cxx index 2679637a785a..4af228b46e3d 100644 --- a/cui/source/tabpages/swpossizetabpage.cxx +++ b/cui/source/tabpages/swpossizetabpage.cxx @@ -1668,7 +1668,7 @@ void SvxSwPosSizeTabPage::UpdateExample() m_pExampleWN->Invalidate(); } -sal_uLong SvxSwPosSizeTabPage::FillRelLB(FrmMap *pMap, sal_uInt16 nMapPos, sal_uInt16 nAlign, +void SvxSwPosSizeTabPage::FillRelLB(FrmMap *pMap, sal_uInt16 nMapPos, sal_uInt16 nAlign, sal_uInt16 nRel, ListBox &rLB, FixedText &rFT) { OUString sSelEntry; @@ -1810,8 +1810,6 @@ sal_uLong SvxSwPosSizeTabPage::FillRelLB(FrmMap *pMap, sal_uInt16 nMapPos, sal_u rFT.Enable(rLB.GetEntryCount() != 0); RelHdl(rLB); - - return nLBRelations; } sal_uInt16 SvxSwPosSizeTabPage::FillPosLB(FrmMap *_pMap, diff --git a/cui/source/tabpages/tpline.cxx b/cui/source/tabpages/tpline.cxx index f0add14c2b1c..3f33c73c3298 100644 --- a/cui/source/tabpages/tpline.cxx +++ b/cui/source/tabpages/tpline.cxx @@ -986,7 +986,7 @@ bool SvxLineTabPage::FillItemSet( SfxItemSet* rAttrs ) -bool SvxLineTabPage::FillXLSet_Impl() +void SvxLineTabPage::FillXLSet_Impl() { sal_Int32 nPos; @@ -1103,8 +1103,6 @@ bool SvxLineTabPage::FillXLSet_Impl() m_rXLSet.Put( XLineTransparenceItem( nVal ) ); m_pCtlPreview->SetLineAttributes(m_aXLineAttr.GetItemSet()); - - return true; } diff --git a/cui/source/tabpages/tplneend.cxx b/cui/source/tabpages/tplneend.cxx index 254fa299c28f..3f29be40482e 100644 --- a/cui/source/tabpages/tplneend.cxx +++ b/cui/source/tabpages/tplneend.cxx @@ -311,10 +311,9 @@ IMPL_LINK_NOARG_TYPED(SvxLineEndDefTabPage, SelectLineEndHdl_Impl, ListBox&, voi -long SvxLineEndDefTabPage::ChangePreviewHdl_Impl( void* ) +void SvxLineEndDefTabPage::ChangePreviewHdl_Impl() { m_pCtlPreview->Invalidate(); - return 0L; } @@ -534,7 +533,7 @@ IMPL_LINK_NOARG_TYPED(SvxLineEndDefTabPage, ClickDeleteHdl_Impl, Button*, void) *pnLineEndListState |= ChangeType::MODIFIED; - ChangePreviewHdl_Impl( this ); + ChangePreviewHdl_Impl(); } } // determine button state -- cgit