sw: prefix members of SwClipboardChangeListener, SwPagePreview, ...
... SwScannerEventListener and SwView_Impl See tdf#94879 for motivation. Change-Id: I19958bc70e7dd80ea3f1c75e06b9ac192d40f254 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129472 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
This commit is contained in:
parent
bcd5a154e4
commit
b78ef5d55b
8 changed files with 49 additions and 49 deletions
|
@ -122,20 +122,20 @@ enum class LOKDeviceFormFactor
|
|||
class SfxViewFactory;
|
||||
#define SFX_DECL_VIEWFACTORY(Class) \
|
||||
private: \
|
||||
static SfxViewFactory *m_pFactory; \
|
||||
static SfxViewFactory *s_pFactory; \
|
||||
public: \
|
||||
static SfxViewShell *CreateInstance(SfxViewFrame *pFrame, SfxViewShell *pOldView); \
|
||||
static void RegisterFactory( SfxInterfaceId nPrio ); \
|
||||
static SfxViewFactory*Factory() { return m_pFactory; } \
|
||||
static SfxViewFactory*Factory() { return s_pFactory; } \
|
||||
static void InitFactory()
|
||||
|
||||
#define SFX_IMPL_NAMED_VIEWFACTORY(Class, AsciiViewName) \
|
||||
SfxViewFactory* Class::m_pFactory; \
|
||||
SfxViewFactory* Class::s_pFactory; \
|
||||
SfxViewShell* Class::CreateInstance(SfxViewFrame *pFrame, SfxViewShell *pOldView) \
|
||||
{ return new Class(pFrame, pOldView); } \
|
||||
void Class::RegisterFactory( SfxInterfaceId nPrio ) \
|
||||
{ \
|
||||
m_pFactory = new SfxViewFactory(&CreateInstance,nPrio,AsciiViewName);\
|
||||
s_pFactory = new SfxViewFactory(&CreateInstance,nPrio,AsciiViewName);\
|
||||
InitFactory(); \
|
||||
} \
|
||||
void Class::InitFactory()
|
||||
|
|
|
@ -33,7 +33,7 @@ namespace sd
|
|||
// We have to expand the SFX_IMPL_VIEWFACTORY macro to call LateInit() after a
|
||||
// new GraphicViewShellBase object has been constructed.
|
||||
|
||||
SfxViewFactory* GraphicViewShellBase::m_pFactory;
|
||||
SfxViewFactory* GraphicViewShellBase::s_pFactory;
|
||||
SfxViewShell* GraphicViewShellBase::CreateInstance(SfxViewFrame* pFrame, SfxViewShell* pOldView)
|
||||
{
|
||||
GraphicViewShellBase* pBase = new GraphicViewShellBase(pFrame, pOldView);
|
||||
|
@ -42,7 +42,7 @@ SfxViewShell* GraphicViewShellBase::CreateInstance(SfxViewFrame* pFrame, SfxView
|
|||
}
|
||||
void GraphicViewShellBase::RegisterFactory(SfxInterfaceId nPrio)
|
||||
{
|
||||
m_pFactory = new SfxViewFactory(&CreateInstance, nPrio, "Default");
|
||||
s_pFactory = new SfxViewFactory(&CreateInstance, nPrio, "Default");
|
||||
InitFactory();
|
||||
}
|
||||
void GraphicViewShellBase::InitFactory() { SFX_VIEW_REGISTRATION(GraphicDocShell); }
|
||||
|
|
|
@ -36,7 +36,7 @@ namespace sd {
|
|||
// We have to expand the SFX_IMPL_VIEWFACTORY macro to call LateInit() after a
|
||||
// new ImpressViewShellBase object has been constructed.
|
||||
|
||||
SfxViewFactory* ImpressViewShellBase::m_pFactory;
|
||||
SfxViewFactory* ImpressViewShellBase::s_pFactory;
|
||||
SfxViewShell* ImpressViewShellBase::CreateInstance (
|
||||
SfxViewFrame *pFrame, SfxViewShell *pOldView)
|
||||
{
|
||||
|
@ -46,7 +46,7 @@ SfxViewShell* ImpressViewShellBase::CreateInstance (
|
|||
}
|
||||
void ImpressViewShellBase::RegisterFactory( SfxInterfaceId nPrio )
|
||||
{
|
||||
m_pFactory = new SfxViewFactory(&CreateInstance,nPrio,"Default");
|
||||
s_pFactory = new SfxViewFactory(&CreateInstance,nPrio,"Default");
|
||||
InitFactory();
|
||||
}
|
||||
void ImpressViewShellBase::InitFactory()
|
||||
|
|
|
@ -32,7 +32,7 @@ class DrawDocShell;
|
|||
// We have to expand the SFX_IMPL_VIEWFACTORY macro to call LateInit() after a
|
||||
// new OutlineViewShellBase object has been constructed.
|
||||
|
||||
SfxViewFactory* OutlineViewShellBase::m_pFactory;
|
||||
SfxViewFactory* OutlineViewShellBase::s_pFactory;
|
||||
SfxViewShell* OutlineViewShellBase::CreateInstance (
|
||||
SfxViewFrame *pFrame, SfxViewShell *pOldView)
|
||||
{
|
||||
|
@ -42,7 +42,7 @@ SfxViewShell* OutlineViewShellBase::CreateInstance (
|
|||
}
|
||||
void OutlineViewShellBase::RegisterFactory( SfxInterfaceId nPrio )
|
||||
{
|
||||
m_pFactory = new SfxViewFactory(&CreateInstance,nPrio,"Outline");
|
||||
s_pFactory = new SfxViewFactory(&CreateInstance,nPrio,"Outline");
|
||||
InitFactory();
|
||||
}
|
||||
void OutlineViewShellBase::InitFactory()
|
||||
|
|
|
@ -39,7 +39,7 @@ class DrawDocShell;
|
|||
// We have to expand the SFX_IMPL_VIEWFACTORY macro to call LateInit() after a
|
||||
// new PresentationViewShellBase object has been constructed.
|
||||
|
||||
SfxViewFactory* PresentationViewShellBase::m_pFactory;
|
||||
SfxViewFactory* PresentationViewShellBase::s_pFactory;
|
||||
SfxViewShell* PresentationViewShellBase::CreateInstance (
|
||||
SfxViewFrame *_pFrame, SfxViewShell *pOldView)
|
||||
{
|
||||
|
@ -50,7 +50,7 @@ SfxViewShell* PresentationViewShellBase::CreateInstance (
|
|||
}
|
||||
void PresentationViewShellBase::RegisterFactory( SfxInterfaceId nPrio )
|
||||
{
|
||||
m_pFactory = new SfxViewFactory(
|
||||
s_pFactory = new SfxViewFactory(
|
||||
&CreateInstance,nPrio,"FullScreenPresentation");
|
||||
InitFactory();
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ class DrawDocShell;
|
|||
// We have to expand the SFX_IMPL_VIEWFACTORY macro to call LateInit() after a
|
||||
// new SlideSorterViewShellBase object has been constructed.
|
||||
|
||||
SfxViewFactory* SlideSorterViewShellBase::m_pFactory;
|
||||
SfxViewFactory* SlideSorterViewShellBase::s_pFactory;
|
||||
SfxViewShell* SlideSorterViewShellBase::CreateInstance (
|
||||
SfxViewFrame *pFrame, SfxViewShell *pOldView)
|
||||
{
|
||||
|
@ -43,7 +43,7 @@ SfxViewShell* SlideSorterViewShellBase::CreateInstance (
|
|||
|
||||
void SlideSorterViewShellBase::RegisterFactory( SfxInterfaceId nPrio )
|
||||
{
|
||||
m_pFactory = new SfxViewFactory(&CreateInstance,nPrio,"SlideSorter");
|
||||
s_pFactory = new SfxViewFactory(&CreateInstance,nPrio,"SlideSorter");
|
||||
InitFactory();
|
||||
}
|
||||
|
||||
|
|
|
@ -45,25 +45,25 @@ namespace com::sun::star {
|
|||
class SwScannerEventListener final : public ::cppu::WeakImplHelper<
|
||||
css::lang::XEventListener >
|
||||
{
|
||||
SwView* pView;
|
||||
SwView* m_pView;
|
||||
|
||||
public:
|
||||
|
||||
SwScannerEventListener( SwView& rView ) : pView( &rView ) {}
|
||||
SwScannerEventListener( SwView& rView ) : m_pView( &rView ) {}
|
||||
virtual ~SwScannerEventListener() override;
|
||||
|
||||
// XEventListener
|
||||
virtual void SAL_CALL disposing(
|
||||
const css::lang::EventObject& rEventObject ) override;
|
||||
|
||||
void ViewDestroyed() { pView = nullptr; }
|
||||
void ViewDestroyed() { m_pView = nullptr; }
|
||||
};
|
||||
|
||||
// Clipboard EventListener
|
||||
class SwClipboardChangeListener final : public ::cppu::WeakImplHelper<
|
||||
css::datatransfer::clipboard::XClipboardListener >
|
||||
{
|
||||
SwView* pView;
|
||||
SwView* m_pView;
|
||||
|
||||
// XEventListener
|
||||
virtual void SAL_CALL disposing( const css::lang::EventObject& rEventObject ) override;
|
||||
|
@ -72,10 +72,10 @@ class SwClipboardChangeListener final : public ::cppu::WeakImplHelper<
|
|||
virtual void SAL_CALL changedContents( const css::datatransfer::clipboard::ClipboardEvent& rEventObject ) override;
|
||||
|
||||
public:
|
||||
SwClipboardChangeListener( SwView& rView ) : pView( &rView ) {}
|
||||
SwClipboardChangeListener( SwView& rView ) : m_pView( &rView ) {}
|
||||
virtual ~SwClipboardChangeListener() override;
|
||||
|
||||
void ViewDestroyed() { pView = nullptr; }
|
||||
void ViewDestroyed() { m_pView = nullptr; }
|
||||
|
||||
void AddRemoveListener( bool bAdd );
|
||||
};
|
||||
|
@ -84,23 +84,23 @@ class SwMailMergeConfigItem;
|
|||
|
||||
class SwView_Impl
|
||||
{
|
||||
css::uno::Reference< css::frame::XDispatchProviderInterceptor > xDisProvInterceptor;
|
||||
css::uno::Reference< css::frame::XDispatchProviderInterceptor > m_xDispatchProviderInterceptor;
|
||||
css::uno::Reference< css::view::XSelectionSupplier > mxXTextView; // UNO object
|
||||
std::vector< css::uno::WeakReference< css::lang::XUnoTunnel > > mxTransferables;
|
||||
|
||||
// temporary document for printing text of selection / multi selection
|
||||
// in PDF export.
|
||||
SfxObjectShellLock xTmpSelDocSh;
|
||||
SfxObjectShellLock m_xTmpSelDocShell;
|
||||
|
||||
SwView* pView;
|
||||
SwView* m_pView;
|
||||
rtl::Reference<SwScannerEventListener>
|
||||
mxScanEvtLstnr;
|
||||
rtl::Reference<SwClipboardChangeListener>
|
||||
mxClipEvtLstnr;
|
||||
ShellMode eShellMode;
|
||||
ShellMode m_eShellMode;
|
||||
|
||||
std::shared_ptr<SwMailMergeConfigItem>
|
||||
xConfigItem;
|
||||
m_xConfigItem;
|
||||
|
||||
std::unique_ptr<sfx2::DocumentInserter> m_pDocInserter;
|
||||
std::unique_ptr<SfxRequest> m_pRequest;
|
||||
|
@ -123,7 +123,7 @@ public:
|
|||
SwXTextView* GetUNOObject_Impl();
|
||||
void Invalidate();
|
||||
|
||||
ShellMode GetShellMode() const {return eShellMode;}
|
||||
ShellMode GetShellMode() const {return m_eShellMode;}
|
||||
|
||||
void ExecuteScan(SfxRequest& rReq);
|
||||
SwScannerEventListener& GetScannerEventListener();
|
||||
|
@ -134,9 +134,9 @@ public:
|
|||
|
||||
void SetMailMergeConfigItem(std::shared_ptr<SwMailMergeConfigItem> const & rItem)
|
||||
{
|
||||
xConfigItem = rItem;
|
||||
m_xConfigItem = rItem;
|
||||
}
|
||||
std::shared_ptr<SwMailMergeConfigItem> const & GetMailMergeConfigItem() const {return xConfigItem;}
|
||||
std::shared_ptr<SwMailMergeConfigItem> const & GetMailMergeConfigItem() const {return m_xConfigItem;}
|
||||
|
||||
//#i33307# restore editing position
|
||||
void SetRestorePosition(const Point& rCursorPos, bool bSelectObj)
|
||||
|
|
|
@ -49,19 +49,19 @@ using namespace ::com::sun::star::lang;
|
|||
using namespace ::com::sun::star::datatransfer::clipboard;
|
||||
|
||||
SwView_Impl::SwView_Impl(SwView* pShell)
|
||||
: pView(pShell)
|
||||
, eShellMode(ShellMode::Text)
|
||||
: m_pView(pShell)
|
||||
, m_eShellMode(ShellMode::Text)
|
||||
, m_nParam(0)
|
||||
, m_bSelectObject(false)
|
||||
, m_bEditingPositionSet(false)
|
||||
{
|
||||
mxXTextView = new SwXTextView(pView);
|
||||
xDisProvInterceptor = new SwXDispatchProviderInterceptor(*pView);
|
||||
mxXTextView = new SwXTextView(m_pView);
|
||||
m_xDispatchProviderInterceptor = new SwXDispatchProviderInterceptor(*m_pView);
|
||||
}
|
||||
|
||||
SwView_Impl::~SwView_Impl()
|
||||
{
|
||||
auto pInterceptor = comphelper::getFromUnoTunnel<SwXDispatchProviderInterceptor>(xDisProvInterceptor);
|
||||
auto pInterceptor = comphelper::getFromUnoTunnel<SwXDispatchProviderInterceptor>(m_xDispatchProviderInterceptor);
|
||||
if(pInterceptor)
|
||||
pInterceptor->Invalidate();
|
||||
view::XSelectionSupplier* pTextView = mxXTextView.get();
|
||||
|
@ -75,7 +75,7 @@ SwView_Impl::~SwView_Impl()
|
|||
mxClipEvtLstnr->ViewDestroyed();
|
||||
}
|
||||
#if HAVE_FEATURE_DBCONNECTIVITY && !ENABLE_FUZZERS
|
||||
xConfigItem.reset();
|
||||
m_xConfigItem.reset();
|
||||
#endif
|
||||
m_pDocInserter.reset();
|
||||
m_pRequest.reset();
|
||||
|
@ -83,7 +83,7 @@ SwView_Impl::~SwView_Impl()
|
|||
|
||||
void SwView_Impl::SetShellMode(ShellMode eSet)
|
||||
{
|
||||
eShellMode = eSet;
|
||||
m_eShellMode = eSet;
|
||||
}
|
||||
|
||||
view::XSelectionSupplier* SwView_Impl::GetUNOObject()
|
||||
|
@ -182,7 +182,7 @@ void SwView_Impl::ExecuteScan( SfxRequest& rReq )
|
|||
else
|
||||
{
|
||||
rReq.Done();
|
||||
SfxBindings& rBind = pView->GetViewFrame()->GetBindings();
|
||||
SfxBindings& rBind = m_pView->GetViewFrame()->GetBindings();
|
||||
rBind.Invalidate( SID_TWAIN_SELECT );
|
||||
rBind.Invalidate( SID_TWAIN_TRANSFER );
|
||||
}
|
||||
|
@ -194,7 +194,7 @@ void SwView_Impl::ExecuteScan( SfxRequest& rReq )
|
|||
SwScannerEventListener& SwView_Impl::GetScannerEventListener()
|
||||
{
|
||||
if(!mxScanEvtLstnr.is())
|
||||
mxScanEvtLstnr = new SwScannerEventListener(*pView);
|
||||
mxScanEvtLstnr = new SwScannerEventListener(*m_pView);
|
||||
return *mxScanEvtLstnr;
|
||||
}
|
||||
|
||||
|
@ -202,7 +202,7 @@ void SwView_Impl::AddClipboardListener()
|
|||
{
|
||||
if(!mxClipEvtLstnr.is())
|
||||
{
|
||||
mxClipEvtLstnr = new SwClipboardChangeListener( *pView );
|
||||
mxClipEvtLstnr = new SwClipboardChangeListener( *m_pView );
|
||||
mxClipEvtLstnr->AddRemoveListener( true );
|
||||
}
|
||||
}
|
||||
|
@ -254,7 +254,7 @@ void SwView_Impl::StartDocumentInserter(
|
|||
break;
|
||||
}
|
||||
|
||||
m_pDocInserter.reset(new ::sfx2::DocumentInserter(pView->GetFrameWeld(), rFactory, mode));
|
||||
m_pDocInserter.reset(new ::sfx2::DocumentInserter(m_pView->GetFrameWeld(), rFactory, mode));
|
||||
m_pDocInserter->StartExecuteModal( rEndDialogHdl );
|
||||
}
|
||||
|
||||
|
@ -276,8 +276,8 @@ void SAL_CALL SwScannerEventListener::disposing( const EventObject& /*rEventObje
|
|||
{
|
||||
#if defined(_WIN32) || defined UNX
|
||||
SolarMutexGuard aGuard;
|
||||
if( pView )
|
||||
pView->ScannerEventHdl();
|
||||
if( m_pView )
|
||||
m_pView->ScannerEventHdl();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -288,29 +288,29 @@ SwClipboardChangeListener::~SwClipboardChangeListener()
|
|||
void SAL_CALL SwClipboardChangeListener::disposing( const EventObject& /*rEventObject*/ )
|
||||
{
|
||||
SolarMutexGuard aGuard;
|
||||
pView = nullptr; // so we don't touch the view if changedContents somehow fires afterwards
|
||||
m_pView = nullptr; // so we don't touch the view if changedContents somehow fires afterwards
|
||||
}
|
||||
|
||||
void SAL_CALL SwClipboardChangeListener::changedContents( const css::datatransfer::clipboard::ClipboardEvent& rEventObject )
|
||||
|
||||
{
|
||||
const SolarMutexGuard aGuard;
|
||||
if( !pView )
|
||||
if( !m_pView )
|
||||
return;
|
||||
|
||||
{
|
||||
TransferableDataHelper aDataHelper( rEventObject.Contents );
|
||||
SwWrtShell& rSh = pView->GetWrtShell();
|
||||
SwWrtShell& rSh = m_pView->GetWrtShell();
|
||||
|
||||
pView->m_nLastPasteDestination = SwTransferable::GetSotDestination( rSh );
|
||||
pView->m_bPasteState = aDataHelper.GetXTransferable().is() &&
|
||||
m_pView->m_nLastPasteDestination = SwTransferable::GetSotDestination( rSh );
|
||||
m_pView->m_bPasteState = aDataHelper.GetXTransferable().is() &&
|
||||
SwTransferable::IsPaste( rSh, aDataHelper );
|
||||
|
||||
pView->m_bPasteSpecialState = aDataHelper.GetXTransferable().is() &&
|
||||
m_pView->m_bPasteSpecialState = aDataHelper.GetXTransferable().is() &&
|
||||
SwTransferable::IsPasteSpecial( rSh, aDataHelper );
|
||||
}
|
||||
|
||||
SfxBindings& rBind = pView->GetViewFrame()->GetBindings();
|
||||
SfxBindings& rBind = m_pView->GetViewFrame()->GetBindings();
|
||||
rBind.Invalidate( SID_PASTE );
|
||||
rBind.Invalidate( SID_PASTE_SPECIAL );
|
||||
rBind.Invalidate( SID_CLIPBOARD_FORMAT_ITEMS );
|
||||
|
@ -318,7 +318,7 @@ void SAL_CALL SwClipboardChangeListener::changedContents( const css::datatransfe
|
|||
|
||||
void SwClipboardChangeListener::AddRemoveListener( bool bAdd )
|
||||
{
|
||||
pView->AddRemoveClipboardListener( Reference< XClipboardListener >( this ), bAdd );
|
||||
m_pView->AddRemoveClipboardListener( Reference< XClipboardListener >( this ), bAdd );
|
||||
}
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
||||
|
|
Loading…
Reference in a new issue