Kaydet (Commit) 9fa32e5d authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:unusedfields in sfx2

and fix leak of HelpListener_Impl in SfxHelpWindow_Impl

Change-Id: I7450be10c8deaf63b7c7f1f4359b4eaf0083bdd4
Reviewed-on: https://gerrit.libreoffice.org/54451Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst a0c15b39
......@@ -69,7 +69,6 @@ private:
std::unique_ptr<SfxPreviewWin_Impl> m_xPreviewWin;
std::unique_ptr<weld::Label> m_xAltTitleFt;
Idle m_aPrevIdle;
OUString m_sLoadTemplate;
SfxNewFileDialogMode m_nFlags;
SfxDocumentTemplates m_aTemplates;
......
......@@ -34,7 +34,6 @@ class SfxPrintOptionsDialog : public weld::GenericDialogController
{
private:
std::unique_ptr<SfxPrintOptDlg_Impl> pDlgImpl;
SfxViewShell* pViewSh;
std::unique_ptr<SfxItemSet> pOptions;
VclPtr<SfxTabPage> pPage;
std::unique_ptr<weld::Widget> m_xHelpBtn;
......
......@@ -87,7 +87,6 @@ private:
long mnItemMaxSize;
long mnTextHeight;
long mnItemPadding;
long mnItemMaxTextLength;
size_t mnLastMouseDownItem;
/// Image that appears when there is no recent document.
......
......@@ -107,11 +107,9 @@ class SfxDispatchController_Impl : public SfxControllerItem
SfxDispatcher* pDispatcher;
SfxBindings* pBindings;
const SfxPoolItem* pLastState;
sal_uInt16 nSlot;
SfxOfficeDispatch* pDispatch;
bool bMasterSlave;
bool bVisible;
const char* pUnoName;
css::uno::WeakReference< css::frame::XFrame > xFrame;
static void addParametersToArgs( const css::util::URL& aURL,
......
......@@ -503,7 +503,7 @@ friend class SfxHelpIndexWindow_Impl;
VclPtr<SfxHelpIndexWindow_Impl> pIndexWin;
VclPtr<SfxHelpTextWindow_Impl> pTextWin;
HelpInterceptor_Impl* pHelpInterceptor;
HelpListener_Impl* pHelpListener;
std::unique_ptr<HelpListener_Impl> pHelpListener;
sal_Int32 nExpandWidth;
sal_Int32 nCollapseWidth;
......
......@@ -84,7 +84,6 @@ namespace
class SfxPickListImpl : public SfxListener
{
private:
sal_uInt32 m_nAllowedMenuSize;
css::uno::Reference< css::util::XStringWidth > m_xStringLength;
/**
......@@ -95,7 +94,7 @@ private:
static void AddDocumentToPickList( SfxObjectShell* pDocShell );
public:
SfxPickListImpl(sal_uInt32 nMenuSize);
SfxPickListImpl();
virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
};
......@@ -178,8 +177,8 @@ void SfxPickListImpl::AddDocumentToPickList( SfxObjectShell* pDocSh )
pFilter ? pFilter->GetServiceName() : OUString() );
}
SfxPickList::SfxPickList(sal_uInt32 nAllowedMenuSize)
: mxImpl(new SfxPickListImpl(nAllowedMenuSize))
SfxPickList::SfxPickList()
: mxImpl(new SfxPickListImpl())
{
}
......@@ -191,14 +190,12 @@ SfxPickList::~SfxPickList()
void SfxPickList::ensure()
{
static SfxPickList aUniqueInstance(SvtHistoryOptions().GetSize(ePICKLIST));
static SfxPickList aUniqueInstance;
}
SfxPickListImpl::SfxPickListImpl( sal_uInt32 nAllowedMenuSize ) :
m_nAllowedMenuSize( nAllowedMenuSize )
SfxPickListImpl::SfxPickListImpl()
{
m_xStringLength = new StringLength;
m_nAllowedMenuSize = ::std::min( m_nAllowedMenuSize, sal_uInt32(PICKLIST_MAXSIZE) );
StartListening( *SfxGetpApp() );
}
......
......@@ -460,7 +460,6 @@ SfxWorkWindow::SfxWorkWindow( vcl::Window *pWin, SfxFrame *pFrm, SfxFrame* pMast
pParent( nullptr ),
pBindings(&pFrm->GetCurrentViewFrame()->GetBindings()),
pWorkWin (pWin),
pConfigShell( nullptr ),
pActiveChild( nullptr ),
nUpdateMode(SfxVisibilityFlags::Standard),
nChildren( 0 ),
......@@ -499,7 +498,7 @@ SfxWorkWindow::SfxWorkWindow( vcl::Window *pWin, SfxFrame *pFrm, SfxFrame* pMast
css::uno::UNO_QUERY );
pLayoutManagerListener->setFrame( xFrame );
pConfigShell = pFrm->GetCurrentViewFrame();
SfxShell* pConfigShell = pFrm->GetCurrentViewFrame();
if ( pConfigShell && pConfigShell->GetObjectShell() )
{
bShowStatusBar = ( !pConfigShell->GetObjectShell()->IsInPlaceActive() );
......
......@@ -127,12 +127,10 @@ class SfxFilterContainer_Impl
{
public:
OUString aName;
OUString aServiceName;
explicit SfxFilterContainer_Impl( const OUString& rName )
: aName( rName )
{
aServiceName = SfxObjectShell::GetServiceNameFromFactory( rName );
}
};
......
......@@ -119,7 +119,6 @@ RecentDocsView::RecentDocsView( vcl::Window* pParent )
, mnFileTypes(ApplicationType::TYPE_NONE)
, mnTextHeight(30)
, mnItemPadding(5)
, mnItemMaxTextLength(30)
, mnLastMouseDownItem(THUMBNAILVIEW_ITEM_NOTFOUND)
, maWelcomeImage(BitmapEx(BMP_WELCOME))
, maWelcomeLine1(SfxResId(STR_WELCOME_LINE1))
......@@ -129,7 +128,7 @@ RecentDocsView::RecentDocsView( vcl::Window* pParent )
mnItemMaxSize = std::min(aScreen.GetWidth(),aScreen.GetHeight()) > 800 ? 256 : 192;
SetStyle(GetStyle() | WB_VSCROLL);
setItemMaxTextLength( mnItemMaxTextLength );
setItemMaxTextLength( 30 );
setItemDimensions( mnItemMaxSize, mnItemMaxSize, mnTextHeight, mnItemPadding );
maFillColor = Color(officecfg::Office::Common::Help::StartCenter::StartCenterThumbnailsBackgroundColor::get());
......
......@@ -297,21 +297,18 @@ SfxDispatchController_Impl::SfxDispatchController_Impl(
, pDispatcher( pDispat )
, pBindings( pBind )
, pLastState( nullptr )
, nSlot( pSlot->GetSlotId() )
, pDispatch( pDisp )
, bMasterSlave( false )
, bVisible( true )
, pUnoName( pSlot->pUnoName )
{
if ( aDispatchURL.Protocol == "slot:" && pUnoName )
if ( aDispatchURL.Protocol == "slot:" && pSlot->pUnoName )
{
OStringBuffer aTmp(".uno:");
aTmp.append(pUnoName);
aDispatchURL.Complete = OStringToOUString(aTmp.makeStringAndClear(), RTL_TEXTENCODING_ASCII_US);
aDispatchURL.Complete = ".uno:" + OUString::createFromAscii(pSlot->pUnoName);
Reference< XURLTransformer > xTrans( URLTransformer::create( ::comphelper::getProcessComponentContext() ) );
xTrans->parseStrict( aDispatchURL );
}
sal_uInt16 nSlot = pSlot->GetSlotId();
SetId( nSlot );
if ( pBindings )
{
......
......@@ -95,12 +95,12 @@ class SfxCloseButton : public PushButton
{
basegfx::BColor m_aBackgroundColor;
basegfx::BColor m_aForegroundColor;
basegfx::BColor m_aMessageColor;
public:
explicit SfxCloseButton(vcl::Window* pParent) : PushButton(pParent, 0)
{
GetInfoBarColors(InfoBarType::Warning,m_aBackgroundColor,m_aForegroundColor,m_aMessageColor);
basegfx::BColor aMessageColor;
GetInfoBarColors(InfoBarType::Warning,m_aBackgroundColor,m_aForegroundColor,aMessageColor);
}
virtual void Paint(vcl::RenderContext& rRenderContext, const ::tools::Rectangle& rRect) override;
......
......@@ -249,7 +249,6 @@ SfxNewFileDialog::SfxNewFileDialog(weld::Window *pParent, SfxNewFileDialogMode n
, m_xMoreBt(m_xBuilder->weld_expander("expander"))
, m_xPreviewWin(new SfxPreviewWin_Impl(m_xBuilder->weld_drawing_area("image")))
, m_xAltTitleFt(m_xBuilder->weld_label("alttitle"))
, m_sLoadTemplate(m_xAltTitleFt->get_label())
, m_nFlags(nFlags)
{
const int nWidth = m_xRegionLb->get_approximate_digit_width() * 32;
......@@ -270,7 +269,7 @@ SfxNewFileDialog::SfxNewFileDialog(weld::Window *pParent, SfxNewFileDialogMode n
m_xMergeStyleCB->show();
m_xMoreBt->hide();
m_xTextStyleCB->set_active(true);
m_xDialog->set_title(m_sLoadTemplate);
m_xDialog->set_title(m_xAltTitleFt->get_label());
}
else
{
......
......@@ -35,7 +35,8 @@ class SfxPickList
private:
std::unique_ptr<SfxPickListImpl> mxImpl;
public:
SfxPickList(sal_uInt32 nAllowedMenuSize);
SfxPickList();
/// Ensure instantiation of listener that manages the internal recently-used list
static void ensure();
~SfxPickList();
};
......
......@@ -194,7 +194,6 @@ class SfxWorkWindow final
aChildWins;
SfxBindings* pBindings;
VclPtr<vcl::Window> pWorkWin;
SfxShell* pConfigShell;
VclPtr<vcl::Window> pActiveChild;
SfxVisibilityFlags nUpdateMode;
sal_uInt16 nChildren;
......
......@@ -70,7 +70,6 @@ class SfxGlobalEvents_Impl : public ModelCollectionMutexBase
::comphelper::OInterfaceContainerHelper2 m_aLegacyListeners;
::comphelper::OInterfaceContainerHelper2 m_aDocumentListeners;
TModelList m_lModels;
GlobalEventConfig* pImp;
public:
explicit SfxGlobalEvents_Impl(const css::uno::Reference < css::uno::XComponentContext >& rxContext);
......@@ -143,12 +142,10 @@ SfxGlobalEvents_Impl::SfxGlobalEvents_Impl( const uno::Reference < uno::XCompone
, m_xJobExecutorListener( task::theJobExecutor::get( rxContext ), uno::UNO_QUERY_THROW )
, m_aLegacyListeners (m_aLock)
, m_aDocumentListeners (m_aLock)
, pImp (nullptr )
{
m_refCount++;
SfxApplication::GetOrCreate();
pImp = new GlobalEventConfig();
m_xEvents = pImp;
m_xEvents = new GlobalEventConfig();
m_refCount--;
}
......
......@@ -195,13 +195,12 @@ SfxPrintOptionsDialog::SfxPrintOptionsDialog(weld::Window *pParent,
const SfxItemSet *pSet)
: GenericDialogController(pParent, "sfx/ui/printeroptionsdialog.ui", "PrinterOptionsDialog")
, pDlgImpl(new SfxPrintOptDlg_Impl)
, pViewSh(pViewShell)
, pOptions(pSet->Clone())
, m_xHelpBtn(m_xBuilder->weld_widget("help"))
, m_xContainer(m_xDialog->weld_content_area())
{
// Insert TabPage
pPage.reset(pViewSh->CreatePrintOptionsPage(m_xContainer.get(), *pOptions));
pPage.reset(pViewShell->CreatePrintOptionsPage(m_xContainer.get(), *pOptions));
DBG_ASSERT( pPage, "CreatePrintOptions != SFX_VIEW_HAS_PRINTOPTIONS" );
if( pPage )
{
......
......@@ -77,21 +77,6 @@ ShellExec::ShellExec( const Reference< XComponentContext >& xContext ) :
WeakImplHelper< XSystemShellExecute, XServiceInfo >(),
m_xContext(xContext)
{
try {
Reference< XCurrentContext > xCurrentContext(getCurrentContext());
if (xCurrentContext.is())
{
Any aValue = xCurrentContext->getValueByName( "system.desktop-environment" );
OUString aDesktopEnvironment;
if (aValue >>= aDesktopEnvironment)
{
m_aDesktopEnvironment = OUStringToOString(aDesktopEnvironment, RTL_TEXTENCODING_ASCII_US);
}
}
} catch (const RuntimeException &) {
}
}
void SAL_CALL ShellExec::execute( const OUString& aCommand, const OUString& aParameter, sal_Int32 nFlags )
......
......@@ -32,7 +32,6 @@
class ShellExec : public ::cppu::WeakImplHelper< css::system::XSystemShellExecute, css::lang::XServiceInfo >
{
OString m_aDesktopEnvironment;
css::uno::Reference< css::uno::XComponentContext > m_xContext;
public:
......
......@@ -376,10 +376,12 @@ bool StgAvlNode::Remove( StgAvlNode** pRoot, StgAvlNode* pDel, bool bDel )
StgAvlIterator::StgAvlIterator( StgAvlNode* p )
{
m_pRoot = p;
m_nCount = 0;
m_nCur = 0;
if( p )
p->StgEnum( m_nCount );
{
short nCount = 0; // tree size
p->StgEnum( nCount );
}
}
StgAvlNode* StgAvlIterator::Find( short n )
......
......@@ -52,7 +52,6 @@ public:
class StgAvlIterator {
StgAvlNode* m_pRoot; // root entry (parent)
short m_nCount; // tree size
short m_nCur; // current element
StgAvlNode* Find( short );
public:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment