loplugin:unusedmethods

Change-Id: Ifeb818227a960cab8fd2e8e7352468efbfe1232c
Reviewed-on: https://gerrit.libreoffice.org/25668
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
This commit is contained in:
Noel Grandin
2016-05-30 15:37:25 +02:00
committed by Noel Grandin
parent fafb2cf4de
commit 3d73258985
22 changed files with 8 additions and 254 deletions

View File

@@ -270,6 +270,8 @@ for d in definitionSet:
# ignore the SfxPoolItem CreateDefault methods for now
if d[1].endswith("::CreateDefault()"):
continue
if "::operator" in d[1]:
continue
unusedSet.add(d) # used by the "unused return types" analysis
tmp1set.add((method, definitionToSourceLocationMap[d]))

View File

@@ -127,7 +127,6 @@
#define SID_PRINTDOCDIRECT (SID_SFX_START + 509)
#define SID_PICKLIST (SID_SFX_START + 510)
#define SID_DOC_SERVICE (SID_SFX_START + 511)
#define SID_ATTR_XWINDOW (SID_SFX_START + 777)
#define SID_PLUGIN_MODE (SID_SFX_START + 827)
#define SID_EXPORTDOC (SID_SFX_START + 829)
#define SID_EXPORTDOCASPDF (SID_SFX_START + 1673)

View File

@@ -181,7 +181,6 @@ namespace svl
virtual ~IUndoManager() { };
virtual void SetMaxUndoActionCount( size_t nMaxUndoActionCount ) = 0;
virtual size_t GetMaxUndoActionCount() const = 0;
virtual void AddUndoAction( SfxUndoAction *pAction, bool bTryMerg=false ) = 0;
@@ -300,7 +299,6 @@ public:
// IUndoManager overridables
virtual void SetMaxUndoActionCount( size_t nMaxUndoActionCount ) override;
virtual size_t GetMaxUndoActionCount() const override;
virtual void AddUndoAction( SfxUndoAction *pAction, bool bTryMerg=false ) override;
virtual size_t GetUndoActionCount( bool const i_currentLevel = CurrentLevel ) const override;
virtual sal_uInt16 GetUndoActionId() const override;

View File

@@ -1,53 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#ifndef INCLUDED_SVTOOLS_XWINDOWITEM_HXX
#define INCLUDED_SVTOOLS_XWINDOWITEM_HXX
#include <svtools/svtdllapi.h>
#include <svl/poolitem.hxx>
#include <toolkit/helper/vclunohelper.hxx>
#include <com/sun/star/awt/XWindow.hpp>
namespace vcl { class Window; }
class SVT_DLLPUBLIC XWindowItem : public SfxPoolItem
{
css::uno::Reference< css::awt::XWindow > m_xWin;
XWindowItem & operator = ( const XWindowItem & ) = delete;
public:
XWindowItem();
XWindowItem( const XWindowItem &rItem );
virtual ~XWindowItem();
virtual SfxPoolItem* Clone(SfxItemPool* pPool = nullptr) const override;
virtual bool operator == ( const SfxPoolItem& rAttr ) const override;
vcl::Window * GetWindowPtr() const { return VCLUnoHelper::GetWindow( m_xWin ); }
};
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@@ -73,7 +73,6 @@ public:
sal_uInt16 GetItemCount() const;
sal_uInt16 GetItemId( sal_uInt16 nPos ) const;
vcl::KeyCode GetKeyCode( sal_uInt16 nItemId ) const;
Accelerator* GetAccel( sal_uInt16 nItemId ) const;

View File

@@ -113,18 +113,8 @@ public:
BitmapColor GetColorWithFallback( double fY, double fX, const BitmapColor& rFallback ) const;
private:
BitmapReadAccess()
{}
BitmapReadAccess(const BitmapReadAccess&)
: BitmapInfoAccess()
{}
BitmapReadAccess& operator=(const BitmapReadAccess&)
{
return *this;
}
BitmapReadAccess(const BitmapReadAccess&) = delete;
BitmapReadAccess& operator=(const BitmapReadAccess&) = delete;
protected:
Scanline* mpScanBuf;

View File

@@ -281,7 +281,6 @@ public:
virtual void doDeferredInit(WinBits nBits);
protected:
DockingWindow( WindowType nType );
DockingWindow(vcl::Window* pParent, const ResId& rResId);
public:
DockingWindow(vcl::Window* pParent, WinBits nStyle = WB_STDDOCKWIN);

View File

@@ -39,7 +39,6 @@ private:
public:
KeyCode() { nKeyCodeAndModifiers = 0; eFunc = KeyFuncType::DONTKNOW; }
KeyCode( const ResId& rResId );
KeyCode( sal_uInt16 nKey, sal_uInt16 nModifier = 0 );
KeyCode( sal_uInt16 nKey, bool bShift, bool bMod1, bool bMod2, bool bMod3 );
KeyCode( KeyFuncType eFunction );

View File

@@ -391,7 +391,6 @@ public:
vcl::Window* GetWindow() const { return pWindow; }
void SetAccessibleName( sal_uInt16 nItemId, const OUString& rStr );
OUString GetAccessibleName( sal_uInt16 nItemId ) const;
// returns whether the item a position nItemPos is highlighted or not.

View File

@@ -448,7 +448,6 @@ class VCL_DLLPUBLIC TabitemValue : public ImplControlValue
bool isBothAligned() const { return isLeftAligned() && isRightAligned(); }
bool isNotAligned() const { return !(mnAlignment & (TabitemFlags::LeftAligned | TabitemFlags::RightAligned)); }
bool isFirst() const { return bool(mnAlignment & TabitemFlags::FirstInGroup); }
bool isLast() const { return bool(mnAlignment & TabitemFlags::LastInGroup); }
const Rectangle& getContentRect() const { return maContentRect; }
};

View File

@@ -404,8 +404,6 @@ public:
/// Convenience method to hide items (via ShowItem).
void HideItem(sal_uInt16 nItemId) { ShowItem( nItemId, false ); }
/// Overload to provide HideItem via command id.
void HideItem(const OUString& rCommand) { ShowItem(rCommand, false); }
bool IsItemVisible( sal_uInt16 nItemId ) const;
bool IsItemReallyVisible( sal_uInt16 nItemId ) const;

View File

@@ -148,7 +148,6 @@ class RscTypCont
inline void SETCONST( RscConst *p1, const char * p2, SymbolType p3 ) { SETCONST(p1, p2, static_cast<sal_uInt32>(p3)); }
inline void SETCONST( RscConst *p1, Atom p2, ToolBoxItemBits p3 ) { SETCONST(p1, p2, static_cast<sal_uInt32>(p3)); }
inline void SETCONST( RscConst *p1, Atom p2, RSWND p3 ) { SETCONST(p1, p2, static_cast<sal_uInt32>(p3)); }
inline void SETCONST( RscConst *p1, Atom p2, WindowBorderStyle p3 ) { SETCONST(p1, p2, static_cast<sal_uInt32>(p3)); }
inline void SETCONST( RscConst *p1, const char * p2, KeyFuncType p3 ) { SETCONST(p1, p2, static_cast<sal_uInt32>(p3)); }
inline void SETCONST( RscConst *p1, Atom p2, MenuItemBits p3 ) { SETCONST(p1, p2, static_cast<sal_uInt32>(p3)); }
inline void SETCONST( RscConst *p1, const char * p2, ToolBoxItemType p3 ) { SETCONST(p1, p2, static_cast<sal_uInt32>(p3)); }

View File

@@ -42,7 +42,6 @@ using namespace ::com::sun::star;
#include <svx/dataaccessdescriptor.hxx>
#include <svx/drawitem.hxx>
#include <svx/fmshell.hxx>
#include <svtools/xwindowitem.hxx>
#include <sfx2/passwd.hxx>
#include <sfx2/filedlghelper.hxx>
#include <sfx2/dispatch.hxx>
@@ -562,13 +561,6 @@ void ScDocShell::Execute( SfxRequest& rReq )
const SfxBoolItem* pItem = rReq.GetArg<SfxBoolItem>(FID_CHG_RECORD);
bool bDo = true;
// xmlsec05/06:
// getting real parent window when called from Security-Options TP
vcl::Window* pParent = nullptr;
const SfxPoolItem* pParentItem;
if( pReqArgs && SfxItemState::SET == pReqArgs->GetItemState( SID_ATTR_XWINDOW, false, &pParentItem ) )
pParent = static_cast<const XWindowItem*>( pParentItem )->GetWindowPtr();
// desired state
ScChangeTrack* pChangeTrack = rDoc.GetChangeTrack();
bool bActivateTracking = (pChangeTrack == nullptr); // toggle
@@ -580,7 +572,7 @@ void ScDocShell::Execute( SfxRequest& rReq )
if ( !pItem )
{
// no dialog on playing the macro
ScopedVclPtrInstance<WarningBox> aBox( pParent ? pParent : GetActiveDialogParent(),
ScopedVclPtrInstance<WarningBox> aBox( GetActiveDialogParent(),
WinBits(WB_YES_NO | WB_DEF_NO),
ScGlobal::GetRscString( STR_END_REDLINING ) );
bDo = ( aBox->Execute() == RET_YES );
@@ -626,11 +618,7 @@ void ScDocShell::Execute( SfxRequest& rReq )
case SID_CHG_PROTECT :
{
vcl::Window* pParent = nullptr;
const SfxPoolItem* pParentItem;
if( pReqArgs && SfxItemState::SET == pReqArgs->GetItemState( SID_ATTR_XWINDOW, false, &pParentItem ) )
pParent = static_cast<const XWindowItem*>( pParentItem )->GetWindowPtr();
if ( ExecuteChangeProtectionDialog( pParent ) )
if ( ExecuteChangeProtectionDialog( nullptr ) )
{
rReq.Done();
SetDocumentModified();

View File

@@ -37,7 +37,6 @@
#include <svl/poolitem.hxx>
#include <svl/intitem.hxx>
#include <svl/PasswordHelper.hxx>
#include <svtools/xwindowitem.hxx>
#include "../appl/app.hrc"

View File

@@ -492,13 +492,6 @@ void SfxUndoManager::SetMaxUndoActionCount( size_t nMaxUndoActionCount )
}
size_t SfxUndoManager::GetMaxUndoActionCount() const
{
UndoManagerGuard aGuard( *m_xData );
return m_xData->pActUndoArray->nMaxUndoActions;
}
void SfxUndoManager::ImplClearCurrentLevel_NoNotify( UndoManagerGuard& i_guard )
{
// clear array

View File

@@ -195,7 +195,6 @@ $(eval $(call gb_Library_add_exception_objects,svt,\
svtools/source/misc/transfer \
svtools/source/misc/transfer2 \
svtools/source/misc/unitconv \
svtools/source/misc/xwindowitem \
svtools/source/svhtml/htmlkywd \
svtools/source/svhtml/htmlout \
svtools/source/svhtml/htmlsupp \

View File

@@ -1,62 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <svtools/xwindowitem.hxx>
#include <vcl/window.hxx>
using namespace ::com::sun::star;
XWindowItem::XWindowItem() :
SfxPoolItem()
{
}
XWindowItem::XWindowItem( const XWindowItem &rItem ) :
SfxPoolItem( Which() ),
m_xWin( rItem.m_xWin )
{
}
XWindowItem::~XWindowItem()
{
}
SfxPoolItem * XWindowItem::Clone( SfxItemPool* /*pPool*/ ) const
{
return new XWindowItem( *this );
}
bool XWindowItem::operator == ( const SfxPoolItem & rAttr ) const
{
DBG_ASSERT( SfxPoolItem::operator==(rAttr), "unequal types" );
const XWindowItem * pItem = dynamic_cast< const XWindowItem * >(&rAttr);
return pItem && m_xWin == pItem->m_xWin;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@@ -47,7 +47,6 @@
#include <editeng/langitem.hxx>
#include <svx/viewlayoutitem.hxx>
#include <svx/zoomslideritem.hxx>
#include <svtools/xwindowitem.hxx>
#include <svx/linkwarn.hxx>
#include <sfx2/htmlmode.hxx>
#include <vcl/svapp.hxx>
@@ -579,12 +578,7 @@ void SwView::Execute(SfxRequest &rReq)
{
OSL_ENSURE( !static_cast<const SfxBoolItem*>(pItem)->GetValue(), "SwView::Execute(): password set an redlining off doesn't match!" );
// xmlsec05: new password dialog
vcl::Window* pParent;
const SfxPoolItem* pParentItem;
if( SfxItemState::SET == pArgs->GetItemState( SID_ATTR_XWINDOW, false, &pParentItem ) )
pParent = static_cast<const XWindowItem*>( pParentItem )->GetWindowPtr();
else
pParent = &GetViewFrame()->GetWindow();
vcl::Window* pParent = &GetViewFrame()->GetWindow();
ScopedVclPtrInstance< SfxPasswordDialog > aPasswdDlg( pParent );
aPasswdDlg->SetMinLen( 1 );
//#i69751# the result of Execute() can be ignored
@@ -617,12 +611,7 @@ void SwView::Execute(SfxRequest &rReq)
// xmlsec05: new password dialog
// message box for wrong password
vcl::Window* pParent;
const SfxPoolItem* pParentItem;
if( pArgs && SfxItemState::SET == pArgs->GetItemState( SID_ATTR_XWINDOW, false, &pParentItem ) )
pParent = static_cast<const XWindowItem*>( pParentItem )->GetWindowPtr();
else
pParent = &GetViewFrame()->GetWindow();
vcl::Window* pParent = &GetViewFrame()->GetWindow();
ScopedVclPtrInstance< SfxPasswordDialog > aPasswdDlg( pParent );
aPasswdDlg->SetMinLen( 1 );
if(!aPasswd.getLength())

View File

@@ -123,25 +123,6 @@ static void ImplAccelEntryInsert( ImplAccelList* pList, ImplAccelEntry* pEntry )
}
}
static sal_uInt16 ImplAccelEntryGetFirstPos( ImplAccelList* pList, sal_uInt16 nId )
{
sal_uInt16 nIndex = ImplAccelEntryGetIndex( pList, nId );
if ( nIndex != ACCELENTRY_NOTFOUND )
{
while ( nIndex )
{
nIndex--;
if ( (*pList)[ nIndex ]->mnId != nId )
break;
}
if ( (*pList)[ nIndex ]->mnId != nId )
nIndex++;
}
return nIndex;
}
void Accelerator::ImplInit()
{
mnCurId = 0;
@@ -295,16 +276,6 @@ sal_uInt16 Accelerator::GetItemCount() const
return (sal_uInt16)mpData->maIdList.size();
}
vcl::KeyCode Accelerator::GetKeyCode( sal_uInt16 nItemId ) const
{
sal_uInt16 nIndex = ImplAccelEntryGetFirstPos( &(mpData->maIdList), nItemId );
if ( nIndex != ACCELENTRY_NOTFOUND )
return mpData->maIdList[ nIndex ]->maKeyCode;
else
return vcl::KeyCode();
}
sal_uInt16 Accelerator::GetItemId( sal_uInt16 nPos ) const
{

View File

@@ -427,19 +427,6 @@ DockingWindow::DockingWindow( vcl::Window* pParent, WinBits nStyle ) :
ImplInit( pParent, nStyle );
}
DockingWindow::DockingWindow( vcl::Window* pParent, const ResId& rResId ) :
Window( WINDOW_DOCKINGWINDOW )
{
ImplInitDockingWindowData();
rResId.SetRT( RSC_DOCKINGWINDOW );
WinBits nStyle = ImplInitRes( rResId );
ImplInit( pParent, nStyle );
ImplLoadRes( rResId );
if ( !(nStyle & WB_HIDE) )
Show();
}
//Find the real parent stashed in mpDialogParent.
void DockingWindow::doDeferredInit(WinBits nBits)
{

View File

@@ -75,32 +75,6 @@ vcl::KeyCode::KeyCode( KeyFuncType eFunction )
eFunc = eFunction;
}
vcl::KeyCode::KeyCode( const ResId& rResId )
: nKeyCodeAndModifiers(0)
, eFunc(KeyFuncType::DONTKNOW)
{
rResId.SetRT( RSC_KEYCODE );
ResMgr* pResMgr = rResId.GetResMgr();
if ( pResMgr && pResMgr->GetResource( rResId ) )
{
pResMgr->Increment( sizeof( RSHEADER_TYPE ) );
sal_uLong nKeyCode = pResMgr->ReadLong();
sal_uLong nModifier = pResMgr->ReadLong();
sal_uLong nKeyFunc = pResMgr->ReadLong();
eFunc = (KeyFuncType)nKeyFunc;
if ( eFunc != KeyFuncType::DONTKNOW )
{
sal_uInt16 nDummy;
ImplGetKeyCode( eFunc, nKeyCodeAndModifiers, nDummy, nDummy, nDummy );
}
else
nKeyCodeAndModifiers = sal::static_int_cast<sal_uInt16>(nKeyCode | nModifier);
}
}
OUString vcl::KeyCode::GetName( vcl::Window* pWindow ) const
{
if ( !pWindow )

View File

@@ -2339,18 +2339,6 @@ Rectangle Menu::GetBoundingRectangle( sal_uInt16 nPos ) const
return aRet;
}
void Menu::SetAccessibleName( sal_uInt16 nItemId, const OUString& rStr )
{
size_t nPos;
MenuItemData* pData = pItemList->GetData( nItemId, nPos );
if (pData && !rStr.equals(pData->aAccessibleName))
{
pData->aAccessibleName = rStr;
ImplCallEventListeners(VCLEVENT_MENU_ACCESSIBLENAMECHANGED, nPos);
}
}
OUString Menu::GetAccessibleName( sal_uInt16 nItemId ) const
{
MenuItemData* pData = pItemList->GetData( nItemId );