summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-05-16 11:54:52 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-05-18 13:00:38 +0200
commit9fa32e5dce345dea17129587c401c03520fb398b (patch)
treee33696647bcce308420d45b4d25246201f0a27a5 /sfx2
parenta0c15b39cb30736e04564420f55c50fefb51e41a (diff)
loplugin:unusedfields in sfx2
and fix leak of HelpListener_Impl in SfxHelpWindow_Impl Change-Id: I7450be10c8deaf63b7c7f1f4359b4eaf0083bdd4 Reviewed-on: https://gerrit.libreoffice.org/54451 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/appl/newhelp.hxx2
-rw-r--r--sfx2/source/appl/sfxpicklist.cxx13
-rw-r--r--sfx2/source/appl/workwin.cxx3
-rw-r--r--sfx2/source/bastyp/fltfnc.cxx2
-rw-r--r--sfx2/source/control/recentdocsview.cxx3
-rw-r--r--sfx2/source/control/unoctitm.cxx9
-rw-r--r--sfx2/source/dialog/infobar.cxx4
-rw-r--r--sfx2/source/doc/new.cxx3
-rw-r--r--sfx2/source/inc/sfxpicklist.hxx3
-rw-r--r--sfx2/source/inc/workwin.hxx1
-rw-r--r--sfx2/source/notify/globalevents.cxx5
-rw-r--r--sfx2/source/view/printer.cxx3
12 files changed, 18 insertions, 33 deletions
diff --git a/sfx2/source/appl/newhelp.hxx b/sfx2/source/appl/newhelp.hxx
index 48213720b426..ab95c195ec77 100644
--- a/sfx2/source/appl/newhelp.hxx
+++ b/sfx2/source/appl/newhelp.hxx
@@ -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;
diff --git a/sfx2/source/appl/sfxpicklist.cxx b/sfx2/source/appl/sfxpicklist.cxx
index cb9b54426d2b..c243dac224e3 100644
--- a/sfx2/source/appl/sfxpicklist.cxx
+++ b/sfx2/source/appl/sfxpicklist.cxx
@@ -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() );
}
diff --git a/sfx2/source/appl/workwin.cxx b/sfx2/source/appl/workwin.cxx
index fc0b94c37e1b..20ad05d51573 100644
--- a/sfx2/source/appl/workwin.cxx
+++ b/sfx2/source/appl/workwin.cxx
@@ -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() );
diff --git a/sfx2/source/bastyp/fltfnc.cxx b/sfx2/source/bastyp/fltfnc.cxx
index c4eca2d5b0d8..58ec1f7ac2a5 100644
--- a/sfx2/source/bastyp/fltfnc.cxx
+++ b/sfx2/source/bastyp/fltfnc.cxx
@@ -127,12 +127,10 @@ class SfxFilterContainer_Impl
{
public:
OUString aName;
- OUString aServiceName;
explicit SfxFilterContainer_Impl( const OUString& rName )
: aName( rName )
{
- aServiceName = SfxObjectShell::GetServiceNameFromFactory( rName );
}
};
diff --git a/sfx2/source/control/recentdocsview.cxx b/sfx2/source/control/recentdocsview.cxx
index 31591e3db568..cecebe60a496 100644
--- a/sfx2/source/control/recentdocsview.cxx
+++ b/sfx2/source/control/recentdocsview.cxx
@@ -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());
diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx
index 0b02bd0f2ae4..372a7751ca2c 100644
--- a/sfx2/source/control/unoctitm.cxx
+++ b/sfx2/source/control/unoctitm.cxx
@@ -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 )
{
diff --git a/sfx2/source/dialog/infobar.cxx b/sfx2/source/dialog/infobar.cxx
index a79df9603f38..349d09cf405f 100644
--- a/sfx2/source/dialog/infobar.cxx
+++ b/sfx2/source/dialog/infobar.cxx
@@ -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;
diff --git a/sfx2/source/doc/new.cxx b/sfx2/source/doc/new.cxx
index cc88976587f1..1d860d18275e 100644
--- a/sfx2/source/doc/new.cxx
+++ b/sfx2/source/doc/new.cxx
@@ -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
{
diff --git a/sfx2/source/inc/sfxpicklist.hxx b/sfx2/source/inc/sfxpicklist.hxx
index 2ff52d1c44b3..bce382461c7d 100644
--- a/sfx2/source/inc/sfxpicklist.hxx
+++ b/sfx2/source/inc/sfxpicklist.hxx
@@ -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();
};
diff --git a/sfx2/source/inc/workwin.hxx b/sfx2/source/inc/workwin.hxx
index c3286960a568..cf332f74c3bd 100644
--- a/sfx2/source/inc/workwin.hxx
+++ b/sfx2/source/inc/workwin.hxx
@@ -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;
diff --git a/sfx2/source/notify/globalevents.cxx b/sfx2/source/notify/globalevents.cxx
index a94540659109..ed495f8d23ef 100644
--- a/sfx2/source/notify/globalevents.cxx
+++ b/sfx2/source/notify/globalevents.cxx
@@ -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--;
}
diff --git a/sfx2/source/view/printer.cxx b/sfx2/source/view/printer.cxx
index 4b8ef5bd1cc9..7d04b54226aa 100644
--- a/sfx2/source/view/printer.cxx
+++ b/sfx2/source/view/printer.cxx
@@ -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 )
{