summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-01-25 11:05:59 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-01-25 12:02:43 +0200
commitcd28eb89d779091fafba0cf6c39a75498d4eab22 (patch)
tree922b23769e855dd056164d47fef2b6f4c161b509 /sw
parent907a9ce8b8c0d2fe8564e3bfab8dcbd4347f916d (diff)
use rtl::Reference in SwView_Impl
instead of storing both raw pointers and uno::Reference Change-Id: I75fbb279c5698a1d29b989a03c7daf5d279e869e
Diffstat (limited to 'sw')
-rw-r--r--sw/source/uibase/inc/uivwimp.hxx19
-rw-r--r--sw/source/uibase/uiview/uivwimp.cxx24
2 files changed, 21 insertions, 22 deletions
diff --git a/sw/source/uibase/inc/uivwimp.hxx b/sw/source/uibase/inc/uivwimp.hxx
index edf2f05cfa45..903af9a20f29 100644
--- a/sw/source/uibase/inc/uivwimp.hxx
+++ b/sw/source/uibase/inc/uivwimp.hxx
@@ -89,24 +89,25 @@ class SwMailMergeConfigItem;
class SwView_Impl
{
- css::uno::Reference< css::lang::XEventListener > xScanEvtLstnr;
- css::uno::Reference< css::lang::XEventListener > xClipEvtLstnr;
css::uno::Reference< css::frame::XDispatchProviderInterceptor > xDisProvInterceptor;
css::uno::Reference< css::view::XSelectionSupplier > mxXTextView; // UNO object
- css::uno::WeakReference< css::lang::XUnoTunnel > xTransferable;
+ css::uno::WeakReference< css::lang::XUnoTunnel > xTransferable;
// temporary document for printing text of selection / multi selection
// in PDF export.
- SfxObjectShellLock xTmpSelDocSh;
+ SfxObjectShellLock xTmpSelDocSh;
- SwView* pView;
- SwScannerEventListener* pScanEvtLstnr;
- SwClipboardChangeListener* pClipEvtLstnr;
+ SwView* pView;
+ rtl::Reference<SwScannerEventListener>
+ mxScanEvtLstnr;
+ rtl::Reference<SwClipboardChangeListener>
+ mxClipEvtLstnr;
ShellModes eShellMode;
#if HAVE_FEATURE_DBCONNECTIVITY
- std::shared_ptr<SwMailMergeConfigItem> xConfigItem;
- sal_uInt16 nMailMergeRestartPage;
+ std::shared_ptr<SwMailMergeConfigItem>
+ xConfigItem;
+ sal_uInt16 nMailMergeRestartPage;
#endif
sfx2::DocumentInserter* m_pDocInserter;
diff --git a/sw/source/uibase/uiview/uivwimp.cxx b/sw/source/uibase/uiview/uivwimp.cxx
index bdd224f7ece3..0c2af38b7679 100644
--- a/sw/source/uibase/uiview/uivwimp.cxx
+++ b/sw/source/uibase/uiview/uivwimp.cxx
@@ -55,8 +55,6 @@ using namespace ::com::sun::star::datatransfer::clipboard;
SwView_Impl::SwView_Impl(SwView* pShell)
: mxXTextView()
, pView(pShell)
- , pScanEvtLstnr(nullptr)
- , pClipEvtLstnr(nullptr)
, eShellMode(SHELL_MODE_TEXT)
#if HAVE_FEATURE_DBCONNECTIVITY
, nMailMergeRestartPage(0)
@@ -85,12 +83,12 @@ SwView_Impl::~SwView_Impl()
view::XSelectionSupplier* pTextView = mxXTextView.get();
static_cast<SwXTextView*>(pTextView)->Invalidate();
mxXTextView.clear();
- if( xScanEvtLstnr.is() )
- pScanEvtLstnr->ViewDestroyed();
- if( xClipEvtLstnr.is() )
+ if( mxScanEvtLstnr.is() )
+ mxScanEvtLstnr->ViewDestroyed();
+ if( mxClipEvtLstnr.is() )
{
- pClipEvtLstnr->AddRemoveListener( false );
- pClipEvtLstnr->ViewDestroyed();
+ mxClipEvtLstnr->AddRemoveListener( false );
+ mxClipEvtLstnr->ViewDestroyed();
}
#if HAVE_FEATURE_DBCONNECTIVITY
xConfigItem.reset();
@@ -195,17 +193,17 @@ void SwView_Impl::ExecuteScan( SfxRequest& rReq )
SwScannerEventListener& SwView_Impl::GetScannerEventListener()
{
- if(!xScanEvtLstnr.is())
- xScanEvtLstnr = pScanEvtLstnr = new SwScannerEventListener(*pView);
- return *pScanEvtLstnr;
+ if(!mxScanEvtLstnr.is())
+ mxScanEvtLstnr = new SwScannerEventListener(*pView);
+ return *mxScanEvtLstnr;
}
void SwView_Impl::AddClipboardListener()
{
- if(!xClipEvtLstnr.is())
+ if(!mxClipEvtLstnr.is())
{
- xClipEvtLstnr = pClipEvtLstnr = new SwClipboardChangeListener( *pView );
- pClipEvtLstnr->AddRemoveListener( true );
+ mxClipEvtLstnr = new SwClipboardChangeListener( *pView );
+ mxClipEvtLstnr->AddRemoveListener( true );
}
}