[Libreoffice-commits] core.git: sc/source
Caolán McNamara (via logerrit)
logerrit at kemper.freedesktop.org
Sun Sep 27 19:28:18 UTC 2020
sc/source/ui/drawfunc/chartsh.cxx | 10 ++---
sc/source/ui/drawfunc/drawsh.cxx | 36 +++++++++----------
sc/source/ui/drawfunc/drawsh2.cxx | 28 +++++++--------
sc/source/ui/drawfunc/drawsh4.cxx | 2 -
sc/source/ui/drawfunc/drawsh5.cxx | 48 +++++++++++++-------------
sc/source/ui/drawfunc/drformsh.cxx | 4 +-
sc/source/ui/drawfunc/drtxtob.cxx | 68 ++++++++++++++++++-------------------
sc/source/ui/drawfunc/drtxtob1.cxx | 12 +++---
sc/source/ui/drawfunc/drtxtob2.cxx | 18 ++++-----
sc/source/ui/drawfunc/graphsh.cxx | 38 ++++++++++----------
sc/source/ui/drawfunc/mediash.cxx | 8 ++--
sc/source/ui/drawfunc/oleobjsh.cxx | 4 +-
sc/source/ui/inc/auditsh.hxx | 4 +-
sc/source/ui/inc/cellsh.hxx | 2 -
sc/source/ui/inc/chartsh.hxx | 2 -
sc/source/ui/inc/drawsh.hxx | 6 +--
sc/source/ui/inc/drformsh.hxx | 2 -
sc/source/ui/inc/drtxtob.hxx | 4 +-
sc/source/ui/inc/editsh.hxx | 4 +-
sc/source/ui/inc/graphsh.hxx | 2 -
sc/source/ui/inc/mediash.hxx | 2 -
sc/source/ui/inc/oleobjsh.hxx | 2 -
sc/source/ui/view/auditsh.cxx | 18 ++++-----
sc/source/ui/view/cellsh.cxx | 4 +-
sc/source/ui/view/editsh.cxx | 64 +++++++++++++++++-----------------
sc/source/ui/view/tabvwsh4.cxx | 20 +++++-----
26 files changed, 206 insertions(+), 206 deletions(-)
New commits:
commit 3f7b48c4a726f51bdc5c78886957c08506e4d336
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Sun Sep 27 14:09:02 2020 +0100
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Sun Sep 27 21:27:41 2020 +0200
never null ScViewData*
Change-Id: If5ad4c637a8c4db67ca4bfe99612e90ae6237ff6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103513
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/sc/source/ui/drawfunc/chartsh.cxx b/sc/source/ui/drawfunc/chartsh.cxx
index 70a46b8d5e71..25b66b0fb7e2 100644
--- a/sc/source/ui/drawfunc/chartsh.cxx
+++ b/sc/source/ui/drawfunc/chartsh.cxx
@@ -49,8 +49,8 @@ void ScChartShell::InitInterface_Impl()
}
-ScChartShell::ScChartShell(ScViewData* pData) :
- ScDrawShell(pData)
+ScChartShell::ScChartShell(ScViewData& rData) :
+ ScDrawShell(rData)
{
SetName( "ChartObject" );
SfxShell::SetContextName(vcl::EnumContext::GetContextName(vcl::EnumContext::Context::Chart));
@@ -62,7 +62,7 @@ ScChartShell::~ScChartShell()
void ScChartShell::GetExportAsGraphicState( SfxItemSet& rSet )
{
- ScDrawView* pView = GetViewData()->GetScDrawView();
+ ScDrawView* pView = GetViewData().GetScDrawView();
const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
bool bEnable = false;
if( rMarkList.GetMarkCount() == 1 )
@@ -82,7 +82,7 @@ void ScChartShell::GetExportAsGraphicState( SfxItemSet& rSet )
void ScChartShell::ExecuteExportAsGraphic( SfxRequest& )
{
- ScDrawView* pView = GetViewData()->GetScDrawView();
+ ScDrawView* pView = GetViewData().GetScDrawView();
const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
if( rMarkList.GetMarkCount() == 1 )
@@ -91,7 +91,7 @@ void ScChartShell::ExecuteExportAsGraphic( SfxRequest& )
if( dynamic_cast<const SdrOle2Obj*>( pObject) )
{
- vcl::Window* pWin = GetViewData()->GetActiveWin();
+ vcl::Window* pWin = GetViewData().GetActiveWin();
Reference< drawing::XShape > xSourceDoc( pObject->getUnoShape(), UNO_QUERY_THROW );
GraphicHelper::SaveShapeAsGraphic(pWin ? pWin->GetFrameWeld() : nullptr, xSourceDoc);
}
diff --git a/sc/source/ui/drawfunc/drawsh.cxx b/sc/source/ui/drawfunc/drawsh.cxx
index 5b63d210f2df..f295e8715947 100644
--- a/sc/source/ui/drawfunc/drawsh.cxx
+++ b/sc/source/ui/drawfunc/drawsh.cxx
@@ -178,9 +178,9 @@ static void lcl_invalidateTransformAttr(const ScTabViewShell* pViewShell)
void ScDrawShell::ExecDrawAttr( SfxRequest& rReq )
{
sal_uInt16 nSlot = rReq.GetSlot();
- vcl::Window* pWin = pViewData->GetActiveWin();
- ScDrawView* pView = pViewData->GetScDrawView();
- SdrModel* pDoc = pViewData->GetDocument().GetDrawLayer();
+ vcl::Window* pWin = rViewData.GetActiveWin();
+ ScDrawView* pView = rViewData.GetScDrawView();
+ SdrModel* pDoc = rViewData.GetDocument().GetDrawLayer();
const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
const size_t nMarkCount = rMarkList.GetMarkCount();
@@ -299,7 +299,7 @@ void ScDrawShell::ExecDrawAttr( SfxRequest& rReq )
case SID_DRAW_HLINK_EDIT:
if ( pSingleSelectedObj )
- pViewData->GetDispatcher().Execute( SID_HYPERLINK_DIALOG );
+ rViewData.GetDispatcher().Execute( SID_HYPERLINK_DIALOG );
break;
case SID_DRAW_HLINK_DELETE:
@@ -314,7 +314,7 @@ void ScDrawShell::ExecDrawAttr( SfxRequest& rReq )
if ( pObj->IsGroupObject() )
{
SdrPageView* pPV = nullptr;
- SdrObject* pHit = pView->PickObj(pWin->PixelToLogic(pViewData->GetMousePosPixel()), pView->getHitTolLog(), pPV, SdrSearchOptions::DEEP);
+ SdrObject* pHit = pView->PickObj(pWin->PixelToLogic(rViewData.GetMousePosPixel()), pView->getHitTolLog(), pPV, SdrSearchOptions::DEEP);
if (pHit)
pObj = pHit;
}
@@ -364,7 +364,7 @@ void ScDrawShell::ExecDrawAttr( SfxRequest& rReq )
pView->SetGeoAttrToMarked(*pDlg->GetOutputItemSet());
}
- lcl_invalidateTransformAttr(pViewData->GetViewShell());
+ lcl_invalidateTransformAttr(rViewData.GetViewShell());
pDlg->disposeOnce();
});
}
@@ -382,7 +382,7 @@ void ScDrawShell::ExecDrawAttr( SfxRequest& rReq )
pView->SetGeoAttrToMarked(*pDlg->GetOutputItemSet());
}
- lcl_invalidateTransformAttr(pViewData->GetViewShell());
+ lcl_invalidateTransformAttr(rViewData.GetViewShell());
pDlg->disposeOnce();
});
}
@@ -393,7 +393,7 @@ void ScDrawShell::ExecDrawAttr( SfxRequest& rReq )
pView->SetGeoAttrToMarked( *pArgs );
}
- lcl_invalidateTransformAttr(pViewData->GetViewShell());
+ lcl_invalidateTransformAttr(rViewData.GetViewShell());
}
break;
@@ -467,7 +467,7 @@ void ScDrawShell::ExecuteMacroAssign(SdrObject* pObj, weld::Window* pWin)
void ScDrawShell::ExecuteLineDlg( const SfxRequest& rReq )
{
- ScDrawView* pView = pViewData->GetScDrawView();
+ ScDrawView* pView = rViewData.GetScDrawView();
bool bHasMarked = pView->AreObjectsMarked();
const SdrObject* pObj = nullptr;
const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
@@ -482,9 +482,9 @@ void ScDrawShell::ExecuteLineDlg( const SfxRequest& rReq )
pView->MergeAttrFromMarked( aNewAttr, false );
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
- VclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateSvxLineTabDialog( pViewData->GetDialogParent(),
+ VclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateSvxLineTabDialog( rViewData.GetDialogParent(),
&aNewAttr,
- pViewData->GetDocument().GetDrawLayer(),
+ rViewData.GetDocument().GetDrawLayer(),
pObj,
bHasMarked));
@@ -505,7 +505,7 @@ void ScDrawShell::ExecuteLineDlg( const SfxRequest& rReq )
void ScDrawShell::ExecuteAreaDlg( const SfxRequest& rReq )
{
- ScDrawView* pView = pViewData->GetScDrawView();
+ ScDrawView* pView = rViewData.GetScDrawView();
bool bHasMarked = pView->AreObjectsMarked();
std::shared_ptr<SfxRequest> pRequest = std::make_shared<SfxRequest>(rReq);
@@ -515,10 +515,10 @@ void ScDrawShell::ExecuteAreaDlg( const SfxRequest& rReq )
pView->MergeAttrFromMarked( aNewAttr, false );
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
- weld::Window* pWin = pViewData->GetDialogParent();
+ weld::Window* pWin = rViewData.GetDialogParent();
VclPtr<AbstractSvxAreaTabDialog> pDlg(pFact->CreateSvxAreaTabDialog(
pWin, &aNewAttr,
- pViewData->GetDocument().GetDrawLayer(), true));
+ rViewData.GetDocument().GetDrawLayer(), true));
pDlg->StartExecuteAsync([=](sal_Int32 nResult){
if ( nResult == RET_OK )
@@ -537,7 +537,7 @@ void ScDrawShell::ExecuteAreaDlg( const SfxRequest& rReq )
void ScDrawShell::ExecuteTextAttrDlg( SfxRequest& rReq )
{
- ScDrawView* pView = pViewData->GetScDrawView();
+ ScDrawView* pView = rViewData.GetScDrawView();
bool bHasMarked = pView->AreObjectsMarked();
SfxItemSet aNewAttr ( pView->GetDefaultAttr() );
@@ -545,7 +545,7 @@ void ScDrawShell::ExecuteTextAttrDlg( SfxRequest& rReq )
pView->MergeAttrFromMarked( aNewAttr, false );
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
- weld::Window* pWin = pViewData->GetDialogParent();
+ weld::Window* pWin = rViewData.GetDialogParent();
ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateTextTabDialog(pWin, &aNewAttr, pView));
sal_uInt16 nResult = pDlg->Execute();
@@ -564,7 +564,7 @@ void ScDrawShell::ExecuteTextAttrDlg( SfxRequest& rReq )
void ScDrawShell::ExecuteMeasureDlg( SfxRequest& rReq )
{
- ScDrawView* pView = pViewData->GetScDrawView();
+ ScDrawView* pView = rViewData.GetScDrawView();
bool bHasMarked = pView->AreObjectsMarked();
SfxItemSet aNewAttr ( pView->GetDefaultAttr() );
@@ -572,7 +572,7 @@ void ScDrawShell::ExecuteMeasureDlg( SfxRequest& rReq )
pView->MergeAttrFromMarked( aNewAttr, false );
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
- weld::Window* pWin = pViewData->GetDialogParent();
+ weld::Window* pWin = rViewData.GetDialogParent();
ScopedVclPtr<SfxAbstractDialog> pDlg(pFact->CreateSfxDialog(pWin, aNewAttr, pView, RID_SVXPAGE_MEASURE));
sal_uInt16 nResult = pDlg->Execute();
diff --git a/sc/source/ui/drawfunc/drawsh2.cxx b/sc/source/ui/drawfunc/drawsh2.cxx
index 1fb57fcaae1e..e51adeabe86b 100644
--- a/sc/source/ui/drawfunc/drawsh2.cxx
+++ b/sc/source/ui/drawfunc/drawsh2.cxx
@@ -58,18 +58,18 @@ using namespace com::sun::star::drawing;
using namespace com::sun::star;
-ScDrawShell::ScDrawShell( ScViewData* pData ) :
- SfxShell(pData->GetViewShell()),
- pViewData( pData ),
+ScDrawShell::ScDrawShell( ScViewData& rData ) :
+ SfxShell(rData.GetViewShell()),
+ rViewData( rData ),
mpSelectionChangeHandler(new svx::sidebar::SelectionChangeHandler(
[this] () { return this->GetSidebarContextName(); },
GetFrame()->GetFrame().GetController(),
vcl::EnumContext::Context::Cell))
{
- SetPool( &pViewData->GetScDrawView()->GetModel()->GetItemPool() );
- SfxUndoManager* pMgr = pViewData->GetSfxDocShell()->GetUndoManager();
+ SetPool( &rViewData.GetScDrawView()->GetModel()->GetItemPool() );
+ SfxUndoManager* pMgr = rViewData.GetSfxDocShell()->GetUndoManager();
SetUndoManager( pMgr );
- if ( !pViewData->GetDocument().IsUndoEnabled() )
+ if ( !rViewData.GetDocument().IsUndoEnabled() )
{
pMgr->SetMaxUndoActionCount( 0 );
}
@@ -85,7 +85,7 @@ ScDrawShell::~ScDrawShell()
void ScDrawShell::GetState( SfxItemSet& rSet ) // Conditions / Toggles
{
- ScDrawView* pView = pViewData->GetScDrawView();
+ ScDrawView* pView = rViewData.GetScDrawView();
SdrDragMode eMode = pView->GetDragMode();
rSet.Put( SfxBoolItem( SID_OBJECT_ROTATE, eMode == SdrDragMode::Rotate ) );
@@ -93,7 +93,7 @@ void ScDrawShell::GetState( SfxItemSet& rSet ) // Conditions / Toggles
rSet.Put( SfxBoolItem( SID_BEZIER_EDIT, !pView->IsFrameDragSingles() ) );
sal_uInt16 nFWId = ScGetFontWorkId();
- SfxViewFrame* pViewFrm = pViewData->GetViewShell()->GetViewFrame();
+ SfxViewFrame* pViewFrm = rViewData.GetViewShell()->GetViewFrame();
rSet.Put(SfxBoolItem(SID_FONTWORK, pViewFrm->HasChildWindow(nFWId)));
// Notes always default to Page anchor.
@@ -144,7 +144,7 @@ void ScDrawShell::GetState( SfxItemSet& rSet ) // Conditions / Toggles
void ScDrawShell::GetDrawFuncState( SfxItemSet& rSet ) // disable functions
{
- ScDrawView* pView = pViewData->GetScDrawView();
+ ScDrawView* pView = rViewData.GetScDrawView();
// call IsMirrorAllowed first to make sure ForcePossibilities (and thus CheckMarked)
// is called before GetMarkCount, so the nMarkCount value is valid for the rest of this method.
@@ -312,9 +312,9 @@ void ScDrawShell::GetDrawFuncState( SfxItemSet& rSet ) // disable functions
void ScDrawShell::GetDrawAttrState( SfxItemSet& rSet )
{
- Point aMousePos = pViewData->GetMousePosPixel();
- vcl::Window* pWindow = pViewData->GetActiveWin();
- ScDrawView* pDrView = pViewData->GetScDrawView();
+ Point aMousePos = rViewData.GetMousePosPixel();
+ vcl::Window* pWindow = rViewData.GetActiveWin();
+ ScDrawView* pDrView = rViewData.GetScDrawView();
Point aPos = pWindow->PixelToLogic(aMousePos);
bool bHasMarked = pDrView->AreObjectsMarked();
@@ -377,7 +377,7 @@ void ScDrawShell::GetAttrFuncState(SfxItemSet &rSet)
{
// Disable dialogs for Draw-attributes if necessary
- ScDrawView* pDrView = pViewData->GetScDrawView();
+ ScDrawView* pDrView = rViewData.GetScDrawView();
SfxItemSet aViewSet = pDrView->GetAttrFromMarked(false);
const SdrMarkList& rMarkList = pDrView->GetMarkedObjectList();
const size_t nMarkCount = rMarkList.GetMarkCount();
@@ -442,7 +442,7 @@ bool ScDrawShell::AreAllObjectsOnLayer(SdrLayerID nLayerNo,const SdrMarkList& rM
void ScDrawShell::GetDrawAttrStateForIFBX( SfxItemSet& rSet )
{
- ScDrawView* pView = pViewData->GetScDrawView();
+ ScDrawView* pView = rViewData.GetScDrawView();
const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
if( rMarkList.GetMark(0) != nullptr )
diff --git a/sc/source/ui/drawfunc/drawsh4.cxx b/sc/source/ui/drawfunc/drawsh4.cxx
index 7184889a6773..fdb0efe91615 100644
--- a/sc/source/ui/drawfunc/drawsh4.cxx
+++ b/sc/source/ui/drawfunc/drawsh4.cxx
@@ -27,7 +27,7 @@
void ScDrawShell::GetFormTextState(SfxItemSet& rSet)
{
const SdrObject* pObj = nullptr;
- ScDrawView* pDrView = pViewData->GetScDrawView();
+ ScDrawView* pDrView = rViewData.GetScDrawView();
const SdrMarkList& rMarkList = pDrView->GetMarkedObjectList();
if ( rMarkList.GetMarkCount() == 1 )
diff --git a/sc/source/ui/drawfunc/drawsh5.cxx b/sc/source/ui/drawfunc/drawsh5.cxx
index 1c4e9f24c2f5..810966d82177 100644
--- a/sc/source/ui/drawfunc/drawsh5.cxx
+++ b/sc/source/ui/drawfunc/drawsh5.cxx
@@ -53,7 +53,7 @@ using namespace com::sun::star;
void ScDrawShell::GetHLinkState( SfxItemSet& rSet ) // Hyperlink
{
- ScDrawView* pView = pViewData->GetScDrawView();
+ ScDrawView* pView = rViewData.GetScDrawView();
const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
// Hyperlink
@@ -150,7 +150,7 @@ void ScDrawShell::ExecuteHLink( const SfxRequest& rReq )
bool bDone = false;
if ( eMode == HLINK_FIELD || eMode == HLINK_BUTTON )
{
- ScDrawView* pView = pViewData->GetScDrawView();
+ ScDrawView* pView = rViewData.GetScDrawView();
const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
if ( rMarkList.GetMarkCount() == 1 )
{
@@ -182,7 +182,7 @@ void ScDrawShell::ExecuteHLink( const SfxRequest& rReq )
xPropSet->setPropertyValue( sPropLabel, uno::Any(rName) );
}
- OUString aTmp = INetURLObject::GetAbsURL( pViewData->GetDocShell()->GetMedium()->GetBaseURL(), rURL );
+ OUString aTmp = INetURLObject::GetAbsURL( rViewData.GetDocShell()->GetMedium()->GetBaseURL(), rURL );
xPropSet->setPropertyValue( sPropTargetURL, uno::Any(aTmp) );
if( !rTarget.isEmpty() && xInfo->hasPropertyByName( sPropTargetFrame ) )
@@ -196,7 +196,7 @@ void ScDrawShell::ExecuteHLink( const SfxRequest& rReq )
}
//! Undo ???
- pViewData->GetDocShell()->SetDocumentModified();
+ rViewData.GetDocShell()->SetDocumentModified();
bDone = true;
}
}
@@ -209,7 +209,7 @@ void ScDrawShell::ExecuteHLink( const SfxRequest& rReq )
}
if (!bDone)
- pViewData->GetViewShell()->
+ rViewData.GetViewShell()->
InsertURL( rName, rURL, rTarget, static_cast<sal_uInt16>(eMode) );
// If "text" is received by InsertURL of ViewShell, then the DrawShell is turned off !!!
@@ -225,8 +225,8 @@ void ScDrawShell::ExecuteHLink( const SfxRequest& rReq )
void ScDrawShell::ExecDrawFunc( SfxRequest& rReq )
{
- SfxBindings& rBindings = pViewData->GetBindings();
- ScTabView* pTabView = pViewData->GetView();
+ SfxBindings& rBindings = rViewData.GetBindings();
+ ScTabView* pTabView = rViewData.GetView();
ScDrawView* pView = pTabView->GetScDrawView();
sal_uInt16 nSlotId = rReq.GetSlot();
@@ -242,7 +242,7 @@ void ScDrawShell::ExecDrawFunc( SfxRequest& rReq )
rBindings.Invalidate(SID_OBJECT_HEAVEN);
rBindings.Invalidate(SID_OBJECT_HELL);
// leave draw shell if nothing selected (layer may be locked)
- pViewData->GetViewShell()->UpdateDrawShell();
+ rViewData.GetViewShell()->UpdateDrawShell();
break;
case SID_FRAME_TO_TOP:
@@ -316,12 +316,12 @@ void ScDrawShell::ExecDrawFunc( SfxRequest& rReq )
case SID_DELETE:
case SID_DELETE_CONTENTS:
pView->DeleteMarked();
- pViewData->GetViewShell()->UpdateDrawShell();
+ rViewData.GetViewShell()->UpdateDrawShell();
break;
case SID_CUT:
pView->DoCut();
- pViewData->GetViewShell()->UpdateDrawShell();
+ rViewData.GetViewShell()->UpdateDrawShell();
break;
case SID_COPY:
@@ -329,7 +329,7 @@ void ScDrawShell::ExecDrawFunc( SfxRequest& rReq )
break;
case SID_PASTE:
- ScClipUtil::PasteFromClipboard ( GetViewData(), GetViewData()->GetViewShell(), true );
+ ScClipUtil::PasteFromClipboard(&GetViewData(), GetViewData().GetViewShell(), true);
break;
case SID_SELECTALL:
@@ -426,7 +426,7 @@ void ScDrawShell::ExecDrawFunc( SfxRequest& rReq )
case SID_FONTWORK:
{
sal_uInt16 nId = ScGetFontWorkId();
- SfxViewFrame* pViewFrm = pViewData->GetViewShell()->GetViewFrame();
+ SfxViewFrame* pViewFrm = rViewData.GetViewShell()->GetViewFrame();
if ( rReq.GetArgs() )
pViewFrm->SetChildWindow( nId,
@@ -476,14 +476,14 @@ void ScDrawShell::ExecDrawFunc( SfxRequest& rReq )
OUString aName = pSelected->GetName();
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
- vcl::Window* pWin = pViewData->GetActiveWin();
+ vcl::Window* pWin = rViewData.GetActiveWin();
ScopedVclPtr<AbstractSvxObjectNameDialog> pDlg(pFact->CreateSvxObjectNameDialog(pWin ? pWin->GetFrameWeld() : nullptr, aName));
pDlg->SetCheckNameHdl(LINK(this, ScDrawShell, NameObjectHdl));
if(RET_OK == pDlg->Execute())
{
- ScDocShell* pDocSh = pViewData->GetDocShell();
+ ScDocShell* pDocSh = rViewData.GetDocShell();
pDlg->GetName(aName);
if (aName != pSelected->GetName())
@@ -495,7 +495,7 @@ void ScDrawShell::ExecDrawFunc( SfxRequest& rReq )
{
// graphics objects must have names
// (all graphics are supposed to be in the navigator)
- ScDrawLayer* pModel = pViewData->GetDocument().GetDrawLayer();
+ ScDrawLayer* pModel = rViewData.GetDocument().GetDrawLayer();
if(pModel)
{
@@ -544,13 +544,13 @@ void ScDrawShell::ExecDrawFunc( SfxRequest& rReq )
OUString aDescription(pSelected->GetDescription());
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
- vcl::Window* pWin = pViewData->GetActiveWin();
+ vcl::Window* pWin = rViewData.GetActiveWin();
ScopedVclPtr<AbstractSvxObjectTitleDescDialog> pDlg(pFact->CreateSvxObjectTitleDescDialog(
pWin ? pWin->GetFrameWeld() : nullptr, aTitle, aDescription));
if(RET_OK == pDlg->Execute())
{
- ScDocShell* pDocSh = pViewData->GetDocShell();
+ ScDocShell* pDocSh = rViewData.GetDocShell();
// handle Title and Description
pDlg->GetTitle(aTitle);
@@ -611,7 +611,7 @@ IMPL_LINK( ScDrawShell, NameObjectHdl, AbstractSvxObjectNameDialog&, rDialog, bo
OUString aName;
rDialog.GetName( aName );
- ScDrawLayer* pModel = pViewData->GetDocument().GetDrawLayer();
+ ScDrawLayer* pModel = rViewData.GetDocument().GetDrawLayer();
if ( !aName.isEmpty() && pModel )
{
SCTAB nDummyTab;
@@ -627,7 +627,7 @@ IMPL_LINK( ScDrawShell, NameObjectHdl, AbstractSvxObjectNameDialog&, rDialog, bo
void ScDrawShell::ExecFormText(const SfxRequest& rReq)
{
- ScDrawView* pDrView = pViewData->GetScDrawView();
+ ScDrawView* pDrView = rViewData.GetScDrawView();
const SdrMarkList& rMarkList = pDrView->GetMarkedObjectList();
if ( rMarkList.GetMarkCount() == 1 && rReq.GetArgs() )
@@ -643,7 +643,7 @@ void ScDrawShell::ExecFormText(const SfxRequest& rReq)
void ScDrawShell::ExecFormatPaintbrush( const SfxRequest& rReq )
{
- ScViewFunc* pView = pViewData->GetView();
+ ScViewFunc* pView = rViewData.GetView();
if ( pView->HasPaintBrush() )
{
// cancel paintbrush mode
@@ -656,7 +656,7 @@ void ScDrawShell::ExecFormatPaintbrush( const SfxRequest& rReq )
if( pArgs && pArgs->Count() >= 1 )
bLock = pArgs->Get(SID_FORMATPAINTBRUSH).GetValue();
- ScDrawView* pDrawView = pViewData->GetScDrawView();
+ ScDrawView* pDrawView = rViewData.GetScDrawView();
if ( pDrawView && pDrawView->AreObjectsMarked() )
{
std::unique_ptr<SfxItemSet> pItemSet(new SfxItemSet( pDrawView->GetAttrFromMarked(true/*bOnlyHardAttr*/) ));
@@ -667,9 +667,9 @@ void ScDrawShell::ExecFormatPaintbrush( const SfxRequest& rReq )
void ScDrawShell::StateFormatPaintbrush( SfxItemSet& rSet )
{
- ScDrawView* pDrawView = pViewData->GetScDrawView();
+ ScDrawView* pDrawView = rViewData.GetScDrawView();
bool bSelection = pDrawView && pDrawView->AreObjectsMarked();
- bool bHasPaintBrush = pViewData->GetView()->HasPaintBrush();
+ bool bHasPaintBrush = rViewData.GetView()->HasPaintBrush();
if ( !bHasPaintBrush && !bSelection )
rSet.DisableItem( SID_FORMATPAINTBRUSH );
@@ -679,7 +679,7 @@ void ScDrawShell::StateFormatPaintbrush( SfxItemSet& rSet )
ScDrawView* ScDrawShell::GetDrawView()
{
- return pViewData->GetView()->GetScDrawView();
+ return rViewData.GetView()->GetScDrawView();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/drawfunc/drformsh.cxx b/sc/source/ui/drawfunc/drformsh.cxx
index 4da5061b8e0e..b91e08646be7 100644
--- a/sc/source/ui/drawfunc/drformsh.cxx
+++ b/sc/source/ui/drawfunc/drformsh.cxx
@@ -41,8 +41,8 @@ void ScDrawFormShell::InitInterface_Impl()
}
-ScDrawFormShell::ScDrawFormShell(ScViewData* pData) :
- ScDrawShell(pData)
+ScDrawFormShell::ScDrawFormShell(ScViewData& rData) :
+ ScDrawShell(rData)
{
SetName("DrawForm");
SfxShell::SetContextName(vcl::EnumContext::GetContextName(vcl::EnumContext::Context::Form));
diff --git a/sc/source/ui/drawfunc/drtxtob.cxx b/sc/source/ui/drawfunc/drtxtob.cxx
index 73027fc89771..6d3ae53c2bcc 100644
--- a/sc/source/ui/drawfunc/drtxtob.cxx
+++ b/sc/source/ui/drawfunc/drtxtob.cxx
@@ -105,17 +105,17 @@ void ScDrawTextObjectBar::StateDisableItems( SfxItemSet &rSet )
}
}
-ScDrawTextObjectBar::ScDrawTextObjectBar(ScViewData* pData) :
- SfxShell(pData->GetViewShell()),
- pViewData(pData),
+ScDrawTextObjectBar::ScDrawTextObjectBar(ScViewData& rData) :
+ SfxShell(rData.GetViewShell()),
+ mrViewData(rData),
bPastePossible(false)
{
- SetPool( pViewData->GetScDrawView()->GetDefaultAttr().GetPool() );
+ SetPool( mrViewData.GetScDrawView()->GetDefaultAttr().GetPool() );
// At the switching-over the UndoManager is changed to edit mode
- SfxUndoManager* pMgr = pViewData->GetSfxDocShell()->GetUndoManager();
+ SfxUndoManager* pMgr = mrViewData.GetSfxDocShell()->GetUndoManager();
SetUndoManager( pMgr );
- if ( !pViewData->GetDocument().IsUndoEnabled() )
+ if ( !mrViewData.GetDocument().IsUndoEnabled() )
{
pMgr->SetMaxUndoActionCount( 0 );
}
@@ -128,7 +128,7 @@ ScDrawTextObjectBar::~ScDrawTextObjectBar()
{
if ( mxClipEvtLstnr.is() )
{
- mxClipEvtLstnr->RemoveListener( pViewData->GetActiveWin() );
+ mxClipEvtLstnr->RemoveListener( mrViewData.GetActiveWin() );
// The listener may just now be waiting for the SolarMutex and call the link
// afterwards, in spite of RemoveListener. So the link has to be reset, too.
@@ -140,7 +140,7 @@ ScDrawTextObjectBar::~ScDrawTextObjectBar()
void ScDrawTextObjectBar::Execute( SfxRequest &rReq )
{
- ScDrawView* pView = pViewData->GetScDrawView();
+ ScDrawView* pView = mrViewData.GetScDrawView();
OutlinerView* pOutView = pView->GetTextEditOutlinerView();
Outliner* pOutliner = pView->GetTextEditOutliner();
@@ -236,7 +236,7 @@ void ScDrawTextObjectBar::Execute( SfxRequest &rReq )
}
}
else
- ScViewUtil::ExecuteCharMap( rItem, *pViewData->GetViewShell()->GetViewFrame() );
+ ScViewUtil::ExecuteCharMap( rItem, *mrViewData.GetViewShell()->GetViewFrame() );
if ( !aString.isEmpty() )
{
@@ -307,7 +307,7 @@ void ScDrawTextObjectBar::Execute( SfxRequest &rReq )
{
// Ensure the field is selected first
pOutView->SelectFieldAtCursor();
- pViewData->GetViewShell()->GetViewFrame()->GetDispatcher()->Execute(SID_HYPERLINK_DIALOG);
+ mrViewData.GetViewShell()->GetViewFrame()->GetDispatcher()->Execute(SID_HYPERLINK_DIALOG);
}
break;
@@ -336,7 +336,7 @@ void ScDrawTextObjectBar::Execute( SfxRequest &rReq )
pView->ScEndTextEdit(); // end text edit before switching direction
ExecuteGlobal( rReq );
// restore consistent state between shells and functions:
- pViewData->GetDispatcher().Execute(SID_OBJECT_SELECT, SfxCallMode::SLOT | SfxCallMode::RECORD);
+ mrViewData.GetDispatcher().Execute(SID_OBJECT_SELECT, SfxCallMode::SLOT | SfxCallMode::RECORD);
break;
case SID_THES:
@@ -361,7 +361,7 @@ void ScDrawTextObjectBar::Execute( SfxRequest &rReq )
void ScDrawTextObjectBar::GetState( SfxItemSet& rSet )
{
- SfxViewFrame* pViewFrm = pViewData->GetViewShell()->GetViewFrame();
+ SfxViewFrame* pViewFrm = mrViewData.GetViewShell()->GetViewFrame();
bool bHasFontWork = pViewFrm->HasChildWindow(SID_FONTWORK);
bool bDisableFontWork = false;
@@ -379,7 +379,7 @@ void ScDrawTextObjectBar::GetState( SfxItemSet& rSet )
if ( rSet.GetItemState( SID_HYPERLINK_GETLINK ) != SfxItemState::UNKNOWN )
{
SvxHyperlinkItem aHLinkItem;
- SdrView* pView = pViewData->GetScDrawView();
+ SdrView* pView = mrViewData.GetScDrawView();
OutlinerView* pOutView = pView->GetTextEditOutlinerView();
if ( pOutView )
{
@@ -410,7 +410,7 @@ void ScDrawTextObjectBar::GetState( SfxItemSet& rSet )
|| rSet.GetItemState(SID_COPY_HYPERLINK_LOCATION) != SfxItemState::UNKNOWN
|| rSet.GetItemState(SID_REMOVE_HYPERLINK) != SfxItemState::UNKNOWN)
{
- SdrView* pView = pViewData->GetScDrawView();
+ SdrView* pView = mrViewData.GetScDrawView();
if( !URLFieldHelper::IsCursorAtURLField(pView->GetTextEditOutlinerView()) )
{
rSet.DisableItem( SID_OPEN_HYPERLINK );
@@ -431,7 +431,7 @@ void ScDrawTextObjectBar::GetState( SfxItemSet& rSet )
if ( rSet.GetItemState( SID_ENABLE_HYPHENATION ) != SfxItemState::UNKNOWN )
{
- SdrView* pView = pViewData->GetScDrawView();
+ SdrView* pView = mrViewData.GetScDrawView();
SfxItemSet aAttrs( pView->GetModel()->GetItemPool() );
pView->GetAttributes( aAttrs );
if( aAttrs.GetItemState( EE_PARA_HYPHENATE ) >= SfxItemState::DEFAULT )
@@ -444,7 +444,7 @@ void ScDrawTextObjectBar::GetState( SfxItemSet& rSet )
if ( rSet.GetItemState( SID_THES ) != SfxItemState::UNKNOWN ||
rSet.GetItemState( SID_THESAURUS ) != SfxItemState::UNKNOWN )
{
- SdrView * pView = pViewData->GetScDrawView();
+ SdrView * pView = mrViewData.GetScDrawView();
OutlinerView* pOutView = pView->GetTextEditOutlinerView();
OUString aStatusVal;
@@ -477,7 +477,7 @@ IMPL_LINK( ScDrawTextObjectBar, ClipboardChanged, TransferableDataHelper*, pData
bPastePossible = ( pDataHelper->HasFormat( SotClipboardFormatId::STRING ) || pDataHelper->HasFormat( SotClipboardFormatId::RTF )
|| pDataHelper->HasFormat( SotClipboardFormatId::RICHTEXT ) );
- SfxBindings& rBindings = pViewData->GetBindings();
+ SfxBindings& rBindings = mrViewData.GetBindings();
rBindings.Invalidate( SID_PASTE );
rBindings.Invalidate( SID_PASTE_SPECIAL );
rBindings.Invalidate( SID_PASTE_UNFORMATTED );
@@ -486,7 +486,7 @@ IMPL_LINK( ScDrawTextObjectBar, ClipboardChanged, TransferableDataHelper*, pData
void ScDrawTextObjectBar::GetClipState( SfxItemSet& rSet )
{
- SdrView* pView = pViewData->GetScDrawView();
+ SdrView* pView = mrViewData.GetScDrawView();
if ( !pView->GetTextEditOutlinerView() )
{
GetGlobalClipState( rSet );
@@ -497,11 +497,11 @@ void ScDrawTextObjectBar::GetClipState( SfxItemSet& rSet )
{
// create listener
mxClipEvtLstnr = new TransferableClipboardListener( LINK( this, ScDrawTextObjectBar, ClipboardChanged ) );
- vcl::Window* pWin = pViewData->GetActiveWin();
+ vcl::Window* pWin = mrViewData.GetActiveWin();
mxClipEvtLstnr->AddListener( pWin );
// get initial state
- TransferableDataHelper aDataHelper( TransferableDataHelper::CreateFromSystemClipboard( pViewData->GetActiveWin() ) );
+ TransferableDataHelper aDataHelper( TransferableDataHelper::CreateFromSystemClipboard( mrViewData.GetActiveWin() ) );
bPastePossible = ( aDataHelper.HasFormat( SotClipboardFormatId::STRING ) || aDataHelper.HasFormat( SotClipboardFormatId::RTF )
|| aDataHelper.HasFormat( SotClipboardFormatId::RICHTEXT ) );
}
@@ -523,7 +523,7 @@ void ScDrawTextObjectBar::GetClipState( SfxItemSet& rSet )
{
SvxClipboardFormatItem aFormats( SID_CLIPBOARD_FORMAT_ITEMS );
TransferableDataHelper aDataHelper(
- TransferableDataHelper::CreateFromSystemClipboard( pViewData->GetActiveWin() ) );
+ TransferableDataHelper::CreateFromSystemClipboard( mrViewData.GetActiveWin() ) );
if ( aDataHelper.HasFormat( SotClipboardFormatId::STRING ) )
aFormats.AddClipbrdFormat( SotClipboardFormatId::STRING );
@@ -548,7 +548,7 @@ void ScDrawTextObjectBar::ExecuteToggle( SfxRequest &rReq )
{
// Underline
- SdrView* pView = pViewData->GetScDrawView();
+ SdrView* pView = mrViewData.GetScDrawView();
sal_uInt16 nSlot = rReq.GetSlot();
@@ -581,7 +581,7 @@ void ScDrawTextObjectBar::ExecuteToggle( SfxRequest &rReq )
pView->SetAttributes( aSet );
rReq.Done();
- pViewData->GetScDrawView()->InvalidateDrawTextAttrs();
+ mrViewData.GetScDrawView()->InvalidateDrawTextAttrs();
}
static void lcl_RemoveFields( OutlinerView& rOutView )
@@ -662,7 +662,7 @@ static void lcl_RemoveFields( OutlinerView& rOutView )
void ScDrawTextObjectBar::ExecuteAttr( SfxRequest &rReq )
{
- SdrView* pView = pViewData->GetScDrawView();
+ SdrView* pView = mrViewData.GetScDrawView();
const SfxItemSet* pArgs = rReq.GetArgs();
sal_uInt16 nSlot = rReq.GetSlot();
@@ -812,7 +812,7 @@ void ScDrawTextObjectBar::ExecuteAttr( SfxRequest &rReq )
}
rReq.Done( aEmptyAttr );
- pViewData->GetScDrawView()->InvalidateDrawTextAttrs();
+ mrViewData.GetScDrawView()->InvalidateDrawTextAttrs();
bDone = false; // already happened here
}
break;
@@ -828,7 +828,7 @@ void ScDrawTextObjectBar::ExecuteAttr( SfxRequest &rReq )
( SfxObjectShell::Current()->GetItem( SID_ATTR_CHAR_FONTLIST ) );
const FontList* pFontList = pFontListItem ? pFontListItem->GetFontList() : nullptr;
pOutView->GetEditView().ChangeFontSize( nSlot == SID_GROW_FONT_SIZE, pFontList );
- pViewData->GetBindings().Invalidate( SID_ATTR_CHAR_FONTHEIGHT );
+ mrViewData.GetBindings().Invalidate( SID_ATTR_CHAR_FONTHEIGHT );
bDone = false;
}
}
@@ -876,7 +876,7 @@ void ScDrawTextObjectBar::ExecuteAttr( SfxRequest &rReq )
case SID_DRAWTEXT_ATTR_DLG:
{
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
- ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateTextTabDialog(pViewData->GetDialogParent(), &aEditAttr, pView));
+ ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateTextTabDialog(mrViewData.GetDialogParent(), &aEditAttr, pView));
bDone = ( RET_OK == pDlg->Execute() );
@@ -885,7 +885,7 @@ void ScDrawTextObjectBar::ExecuteAttr( SfxRequest &rReq )
pDlg.disposeAndClear();
- SfxBindings& rBindings = pViewData->GetBindings();
+ SfxBindings& rBindings = mrViewData.GetBindings();
rBindings.Invalidate( SID_TABLE_VERT_NONE );
rBindings.Invalidate( SID_TABLE_VERT_CENTER );
rBindings.Invalidate( SID_TABLE_VERT_BOTTOM );
@@ -956,7 +956,7 @@ void ScDrawTextObjectBar::ExecuteAttr( SfxRequest &rReq )
// use args directly
pView->SetAttributes( *pArgs );
}
- pViewData->GetScDrawView()->InvalidateDrawTextAttrs();
+ mrViewData.GetScDrawView()->InvalidateDrawTextAttrs();
}
void ScDrawTextObjectBar::GetAttrState( SfxItemSet& rDestSet )
@@ -970,7 +970,7 @@ void ScDrawTextObjectBar::GetAttrState( SfxItemSet& rDestSet )
bool bDisableCTLFont = !aLangOpt.IsCTLFontEnabled();
bool bDisableVerticalText = !aLangOpt.IsVerticalTextEnabled();
- SdrView* pView = pViewData->GetScDrawView();
+ SdrView* pView = mrViewData.GetScDrawView();
SfxItemSet aAttrSet(pView->GetModel()->GetItemPool());
pView->GetAttributes(aAttrSet);
@@ -987,7 +987,7 @@ void ScDrawTextObjectBar::GetAttrState( SfxItemSet& rDestSet )
OutlinerView* pOutView = pView->GetTextEditOutlinerView();
if (pOutView && !pOutView->GetSelection().HasRange())
{
- LanguageType nInputLang = pViewData->GetActiveWin()->GetInputLanguage();
+ LanguageType nInputLang = mrViewData.GetActiveWin()->GetInputLanguage();
if (nInputLang != LANGUAGE_DONTKNOW && nInputLang != LANGUAGE_SYSTEM)
nInputScript = SvtLanguageOptions::GetScriptTypeOfLanguage( nInputLang );
}
@@ -1158,7 +1158,7 @@ void ScDrawTextObjectBar::GetAttrState( SfxItemSet& rDestSet )
if ( eAttrDir == SvxFrameDirection::Environment )
{
// get "environment" direction from page style
- if ( pViewData->GetDocument().GetEditTextDirection( pViewData->GetTabNo() ) == EEHorizontalTextDirection::R2L )
+ if ( mrViewData.GetDocument().GetEditTextDirection( mrViewData.GetTabNo() ) == EEHorizontalTextDirection::R2L )
eAttrDir = SvxFrameDirection::Horizontal_RL_TB;
else
eAttrDir = SvxFrameDirection::Horizontal_LR_TB;
@@ -1174,7 +1174,7 @@ void ScDrawTextObjectBar::ExecuteTrans( const SfxRequest& rReq )
if ( nType == TransliterationFlags::NONE )
return;
- ScDrawView* pView = pViewData->GetScDrawView();
+ ScDrawView* pView = mrViewData.GetScDrawView();
OutlinerView* pOutView = pView->GetTextEditOutlinerView();
if ( pOutView )
{
@@ -1192,7 +1192,7 @@ void ScDrawTextObjectBar::GetStatePropPanelAttr(SfxItemSet &rSet)
SfxWhichIter aIter( rSet );
sal_uInt16 nWhich = aIter.FirstWhich();
- SdrView* pView = pViewData->GetScDrawView();
+ SdrView* pView = mrViewData.GetScDrawView();
SfxItemSet aEditAttr(pView->GetModel()->GetItemPool());
pView->GetAttributes(aEditAttr);
diff --git a/sc/source/ui/drawfunc/drtxtob1.cxx b/sc/source/ui/drawfunc/drtxtob1.cxx
index 76964b6ebdeb..2e3a76d9f425 100644
--- a/sc/source/ui/drawfunc/drtxtob1.cxx
+++ b/sc/source/ui/drawfunc/drtxtob1.cxx
@@ -42,8 +42,8 @@ bool ScDrawTextObjectBar::ExecuteCharDlg( const SfxItemSet& rArgs,
{
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateScCharDlg(
- pViewData->GetDialogParent(), &rArgs,
- pViewData->GetSfxDocShell(), true));
+ mrViewData.GetDialogParent(), &rArgs,
+ mrViewData.GetSfxDocShell(), true));
if (nSlot == SID_CHAR_DLG_EFFECT)
{
pDlg->SetCurPageId("fonteffects");
@@ -84,7 +84,7 @@ bool ScDrawTextObjectBar::ExecuteParaDlg( const SfxItemSet& rArgs,
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateScParagraphDlg(
- pViewData->GetDialogParent(), &aNewAttr));
+ mrViewData.GetDialogParent(), &aNewAttr));
bool bRet = ( pDlg->Execute() == RET_OK );
if ( bRet )
@@ -99,16 +99,16 @@ bool ScDrawTextObjectBar::ExecuteParaDlg( const SfxItemSet& rArgs,
void ScDrawTextObjectBar::ExecutePasteContents( SfxRequest & /* rReq */ )
{
- SdrView* pView = pViewData->GetScDrawView();
+ SdrView* pView = mrViewData.GetScDrawView();
OutlinerView* pOutView = pView->GetTextEditOutlinerView();
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
- ScopedVclPtr<SfxAbstractPasteDialog> pDlg(pFact->CreatePasteDialog(pViewData->GetDialogParent()));
+ ScopedVclPtr<SfxAbstractPasteDialog> pDlg(pFact->CreatePasteDialog(mrViewData.GetDialogParent()));
pDlg->Insert( SotClipboardFormatId::STRING, EMPTY_OUSTRING );
pDlg->Insert( SotClipboardFormatId::RTF, EMPTY_OUSTRING );
pDlg->Insert( SotClipboardFormatId::RICHTEXT, EMPTY_OUSTRING );
- TransferableDataHelper aDataHelper( TransferableDataHelper::CreateFromSystemClipboard( pViewData->GetActiveWin() ) );
+ TransferableDataHelper aDataHelper( TransferableDataHelper::CreateFromSystemClipboard( mrViewData.GetActiveWin() ) );
SotClipboardFormatId nFormat = pDlg->GetFormat( aDataHelper.GetTransferable() );
diff --git a/sc/source/ui/drawfunc/drtxtob2.cxx b/sc/source/ui/drawfunc/drtxtob2.cxx
index 08f23192f918..5dbfb4ade3d5 100644
--- a/sc/source/ui/drawfunc/drtxtob2.cxx
+++ b/sc/source/ui/drawfunc/drtxtob2.cxx
@@ -41,14 +41,14 @@ sal_uInt16 ScGetFontWorkId()
bool ScDrawTextObjectBar::IsNoteEdit() const
{
- return ScDrawLayer::IsNoteCaption( pViewData->GetView()->GetScDrawView()->GetTextEditObject() );
+ return ScDrawLayer::IsNoteCaption( mrViewData.GetView()->GetScDrawView()->GetTextEditObject() );
}
// if no text edited, functions like in drawsh
void ScDrawTextObjectBar::ExecuteGlobal( SfxRequest &rReq )
{
- ScTabView* pTabView = pViewData->GetView();
+ ScTabView* pTabView = mrViewData.GetView();
ScDrawView* pView = pTabView->GetScDrawView();
sal_uInt16 nSlot = rReq.GetSlot();
@@ -60,7 +60,7 @@ void ScDrawTextObjectBar::ExecuteGlobal( SfxRequest &rReq )
case SID_CUT:
pView->DoCut();
- pViewData->GetViewShell()->UpdateDrawShell();
+ mrViewData.GetViewShell()->UpdateDrawShell();
break;
case SID_PASTE:
@@ -88,7 +88,7 @@ void ScDrawTextObjectBar::ExecuteGlobal( SfxRequest &rReq )
css::text::WritingMode_LR_TB : css::text::WritingMode_TB_RL,
SDRATTR_TEXTDIRECTION ) );
pView->SetAttributes( aAttr );
- pViewData->GetScDrawView()->InvalidateDrawTextAttrs(); // Bidi slots may be disabled
+ mrViewData.GetScDrawView()->InvalidateDrawTextAttrs(); // Bidi slots may be disabled
rReq.Done( aAttr );
}
break;
@@ -126,7 +126,7 @@ void ScDrawTextObjectBar::GetGlobalClipState( SfxItemSet& rSet )
void ScDrawTextObjectBar::ExecuteExtra( SfxRequest &rReq )
{
- ScTabView* pTabView = pViewData->GetView();
+ ScTabView* pTabView = mrViewData.GetView();
ScDrawView* pView = pTabView->GetScDrawView();
sal_uInt16 nSlot = rReq.GetSlot();
@@ -135,7 +135,7 @@ void ScDrawTextObjectBar::ExecuteExtra( SfxRequest &rReq )
case SID_FONTWORK:
{
sal_uInt16 nId = SvxFontWorkChildWindow::GetChildWindowId();
- SfxViewFrame* pViewFrm = pViewData->GetViewShell()->GetViewFrame();
+ SfxViewFrame* pViewFrm = mrViewData.GetViewShell()->GetViewFrame();
if ( rReq.GetArgs() )
pViewFrm->SetChildWindow( nId,
@@ -164,7 +164,7 @@ void ScDrawTextObjectBar::ExecuteExtra( SfxRequest &rReq )
bLeft ? SvxAdjust::Left : SvxAdjust::Right,
EE_PARA_JUST ) );
pView->SetAttributes( aAttr );
- pViewData->GetScDrawView()->InvalidateDrawTextAttrs();
+ mrViewData.GetScDrawView()->InvalidateDrawTextAttrs();
rReq.Done(); //! Done(aAttr) ?
}
@@ -174,7 +174,7 @@ void ScDrawTextObjectBar::ExecuteExtra( SfxRequest &rReq )
void ScDrawTextObjectBar::ExecFormText(const SfxRequest& rReq)
{
- ScTabView* pTabView = pViewData->GetView();
+ ScTabView* pTabView = mrViewData.GetView();
ScDrawView* pDrView = pTabView->GetScDrawView();
const SdrMarkList& rMarkList = pDrView->GetMarkedObjectList();
@@ -192,7 +192,7 @@ void ScDrawTextObjectBar::ExecFormText(const SfxRequest& rReq)
void ScDrawTextObjectBar::GetFormTextState(SfxItemSet& rSet)
{
const SdrObject* pObj = nullptr;
- ScDrawView* pDrView = pViewData->GetView()->GetScDrawView();
+ ScDrawView* pDrView = mrViewData.GetView()->GetScDrawView();
const SdrMarkList& rMarkList = pDrView->GetMarkedObjectList();
if ( rMarkList.GetMarkCount() == 1 )
diff --git a/sc/source/ui/drawfunc/graphsh.cxx b/sc/source/ui/drawfunc/graphsh.cxx
index e48c425419d6..32091e5329ce 100644
--- a/sc/source/ui/drawfunc/graphsh.cxx
+++ b/sc/source/ui/drawfunc/graphsh.cxx
@@ -50,8 +50,8 @@ void ScGraphicShell::InitInterface_Impl()
}
-ScGraphicShell::ScGraphicShell(ScViewData* pData) :
- ScDrawShell(pData)
+ScGraphicShell::ScGraphicShell(ScViewData& rData) :
+ ScDrawShell(rData)
{
SetName("GraphicObject");
SfxShell::SetContextName(vcl::EnumContext::GetContextName(vcl::EnumContext::Context::Graphic));
@@ -63,7 +63,7 @@ ScGraphicShell::~ScGraphicShell()
void ScGraphicShell::GetAttrState( SfxItemSet& rSet )
{
- ScDrawView* pView = GetViewData()->GetScDrawView();
+ ScDrawView* pView = GetViewData().GetScDrawView();
if( pView )
SvxGrafAttrHelper::GetGrafAttrState( rSet, *pView );
@@ -71,7 +71,7 @@ void ScGraphicShell::GetAttrState( SfxItemSet& rSet )
void ScGraphicShell::Execute( SfxRequest& rReq )
{
- ScDrawView* pView = GetViewData()->GetScDrawView();
+ ScDrawView* pView = GetViewData().GetScDrawView();
if( pView )
{
@@ -82,7 +82,7 @@ void ScGraphicShell::Execute( SfxRequest& rReq )
void ScGraphicShell::GetFilterState( SfxItemSet& rSet )
{
- ScDrawView* pView = GetViewData()->GetScDrawView();
+ ScDrawView* pView = GetViewData().GetScDrawView();
const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
bool bEnable = false;
@@ -100,7 +100,7 @@ void ScGraphicShell::GetFilterState( SfxItemSet& rSet )
void ScGraphicShell::ExecuteFilter( const SfxRequest& rReq )
{
- ScDrawView* pView = GetViewData()->GetScDrawView();
+ ScDrawView* pView = GetViewData().GetScDrawView();
const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
if( rMarkList.GetMarkCount() == 1 )
@@ -134,7 +134,7 @@ void ScGraphicShell::ExecuteFilter( const SfxRequest& rReq )
void ScGraphicShell::GetExternalEditState( SfxItemSet& rSet )
{
- ScDrawView* pView = GetViewData()->GetScDrawView();
+ ScDrawView* pView = GetViewData().GetScDrawView();
const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
bool bEnable = false;
if( rMarkList.GetMarkCount() == 1 )
@@ -154,7 +154,7 @@ void ScGraphicShell::GetExternalEditState( SfxItemSet& rSet )
void ScGraphicShell::ExecuteExternalEdit( SAL_UNUSED_PARAMETER SfxRequest& )
{
- ScDrawView* pView = GetViewData()->GetScDrawView();
+ ScDrawView* pView = GetViewData().GetScDrawView();
const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
if( rMarkList.GetMarkCount() == 1 )
@@ -175,7 +175,7 @@ void ScGraphicShell::ExecuteExternalEdit( SAL_UNUSED_PARAMETER SfxRequest& )
void ScGraphicShell::GetCompressGraphicState( SfxItemSet& rSet )
{
- ScDrawView* pView = GetViewData()->GetScDrawView();
+ ScDrawView* pView = GetViewData().GetScDrawView();
const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
bool bEnable = false;
if( rMarkList.GetMarkCount() == 1 )
@@ -192,7 +192,7 @@ void ScGraphicShell::GetCompressGraphicState( SfxItemSet& rSet )
void ScGraphicShell::ExecuteCompressGraphic( SAL_UNUSED_PARAMETER SfxRequest& )
{
- ScDrawView* pView = GetViewData()->GetScDrawView();
+ ScDrawView* pView = GetViewData().GetScDrawView();
const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
if( rMarkList.GetMarkCount() == 1 )
@@ -202,7 +202,7 @@ void ScGraphicShell::ExecuteCompressGraphic( SAL_UNUSED_PARAMETER SfxRequest& )
if( dynamic_cast<const SdrGrafObj*>( pObj) && static_cast<SdrGrafObj*>(pObj)->GetGraphicType() == GraphicType::Bitmap )
{
SdrGrafObj* pGraphicObj = static_cast<SdrGrafObj*>(pObj);
- CompressGraphicsDialog dialog(GetViewData()->GetDialogParent(), pGraphicObj, GetViewData()->GetBindings());
+ CompressGraphicsDialog dialog(GetViewData().GetDialogParent(), pGraphicObj, GetViewData().GetBindings());
if (dialog.run() == RET_OK)
{
SdrGrafObj* pNewObject = dialog.GetCompressedSdrGrafObj();
@@ -220,7 +220,7 @@ void ScGraphicShell::ExecuteCompressGraphic( SAL_UNUSED_PARAMETER SfxRequest& )
void ScGraphicShell::GetCropGraphicState( SfxItemSet& rSet )
{
- ScDrawView* pView = GetViewData()->GetScDrawView();
+ ScDrawView* pView = GetViewData().GetScDrawView();
const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
bool bEnable = false;
if( rMarkList.GetMarkCount() == 1 )
@@ -237,7 +237,7 @@ void ScGraphicShell::GetCropGraphicState( SfxItemSet& rSet )
void ScGraphicShell::ExecuteCropGraphic( SAL_UNUSED_PARAMETER SfxRequest& )
{
- ScDrawView* pView = GetViewData()->GetScDrawView();
+ ScDrawView* pView = GetViewData().GetScDrawView();
const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
if( rMarkList.GetMarkCount() == 1 )
@@ -256,7 +256,7 @@ void ScGraphicShell::ExecuteCropGraphic( SAL_UNUSED_PARAMETER SfxRequest& )
void ScGraphicShell::ExecuteSaveGraphic( SAL_UNUSED_PARAMETER SfxRequest& /*rReq*/)
{
- ScDrawView* pView = GetViewData()->GetScDrawView();
+ ScDrawView* pView = GetViewData().GetScDrawView();
const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
if( rMarkList.GetMarkCount() == 1 )
{
@@ -265,7 +265,7 @@ void ScGraphicShell::ExecuteSaveGraphic( SAL_UNUSED_PARAMETER SfxRequest& /*rReq
{
GraphicAttr aGraphicAttr = pObj->GetGraphicAttr();
short nState = RET_CANCEL;
- vcl::Window* pWin = GetViewData()->GetActiveWin();
+ vcl::Window* pWin = GetViewData().GetActiveWin();
weld::Window* pWinFrame = pWin ? pWin->GetFrameWeld() : nullptr;
if (aGraphicAttr != GraphicAttr()) // the image has been modified
{
@@ -296,7 +296,7 @@ void ScGraphicShell::ExecuteSaveGraphic( SAL_UNUSED_PARAMETER SfxRequest& /*rReq
void ScGraphicShell::GetSaveGraphicState(SfxItemSet &rSet)
{
- ScDrawView* pView = GetViewData()->GetScDrawView();
+ ScDrawView* pView = GetViewData().GetScDrawView();
const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
bool bEnable = false;
if( rMarkList.GetMarkCount() == 1 )
@@ -316,7 +316,7 @@ void ScGraphicShell::GetSaveGraphicState(SfxItemSet &rSet)
void ScGraphicShell::ExecuteChangePicture( SAL_UNUSED_PARAMETER SfxRequest& /*rReq*/)
{
- ScDrawView* pView = GetViewData()->GetScDrawView();
+ ScDrawView* pView = GetViewData().GetScDrawView();
const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
if( rMarkList.GetMarkCount() == 1 )
@@ -326,7 +326,7 @@ void ScGraphicShell::ExecuteChangePicture( SAL_UNUSED_PARAMETER SfxRequest& /*rR
if( dynamic_cast<const SdrGrafObj*>( pObj) && static_cast<SdrGrafObj*>(pObj)->GetGraphicType() == GraphicType::Bitmap )
{
SdrGrafObj* pGraphicObj = static_cast<SdrGrafObj*>(pObj);
- vcl::Window* pWin = GetViewData()->GetActiveWin();
+ vcl::Window* pWin = GetViewData().GetActiveWin();
SvxOpenGraphicDialog aDlg(ScResId(STR_INSERTGRAPHIC), pWin ? pWin->GetFrameWeld() : nullptr);
if( aDlg.Execute() == ERRCODE_NONE )
@@ -352,7 +352,7 @@ void ScGraphicShell::ExecuteChangePicture( SAL_UNUSED_PARAMETER SfxRequest& /*rR
void ScGraphicShell::GetChangePictureState(SfxItemSet &rSet)
{
- ScDrawView* pView = GetViewData()->GetScDrawView();
+ ScDrawView* pView = GetViewData().GetScDrawView();
const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
bool bEnable = false;
if( rMarkList.GetMarkCount() == 1 )
diff --git a/sc/source/ui/drawfunc/mediash.cxx b/sc/source/ui/drawfunc/mediash.cxx
index 4ab6c187bb83..242ee95120b7 100644
--- a/sc/source/ui/drawfunc/mediash.cxx
+++ b/sc/source/ui/drawfunc/mediash.cxx
@@ -45,8 +45,8 @@ void ScMediaShell::InitInterface_Impl()
}
-ScMediaShell::ScMediaShell(ScViewData* pData) :
- ScDrawShell(pData)
+ScMediaShell::ScMediaShell(ScViewData& rData) :
+ ScDrawShell(rData)
{
SetName( ScResId( SCSTR_MEDIASHELL ) );
SfxShell::SetContextName(vcl::EnumContext::GetContextName(vcl::EnumContext::Context::Media));
@@ -58,7 +58,7 @@ ScMediaShell::~ScMediaShell()
void ScMediaShell::GetMediaState( SfxItemSet& rSet )
{
- ScDrawView* pView = GetViewData()->GetScDrawView();
+ ScDrawView* pView = GetViewData().GetScDrawView();
if( !pView )
return;
@@ -97,7 +97,7 @@ void ScMediaShell::GetMediaState( SfxItemSet& rSet )
void ScMediaShell::ExecuteMedia( const SfxRequest& rReq )
{
- ScDrawView* pView = GetViewData()->GetScDrawView();
+ ScDrawView* pView = GetViewData().GetScDrawView();
if( pView && SID_AVMEDIA_TOOLBOX == rReq.GetSlot() )
{
diff --git a/sc/source/ui/drawfunc/oleobjsh.cxx b/sc/source/ui/drawfunc/oleobjsh.cxx
index 981bf3a30a79..0e9f0075d904 100644
--- a/sc/source/ui/drawfunc/oleobjsh.cxx
+++ b/sc/source/ui/drawfunc/oleobjsh.cxx
@@ -37,8 +37,8 @@ void ScOleObjectShell::InitInterface_Impl()
}
-ScOleObjectShell::ScOleObjectShell(ScViewData* pData) :
- ScDrawShell(pData)
+ScOleObjectShell::ScOleObjectShell(ScViewData& rData) :
+ ScDrawShell(rData)
{
SetName("OleObject");
SfxShell::SetContextName(vcl::EnumContext::GetContextName(vcl::EnumContext::Context::OLE));
diff --git a/sc/source/ui/inc/auditsh.hxx b/sc/source/ui/inc/auditsh.hxx
index 70c48efb58b5..31a36bbdcd38 100644
--- a/sc/source/ui/inc/auditsh.hxx
+++ b/sc/source/ui/inc/auditsh.hxx
@@ -29,7 +29,7 @@ class ScViewData;
class ScAuditingShell : public SfxShell
{
private:
- ScViewData* pViewData;
+ ScViewData& rViewData;
sal_uInt16 nFunction;
public:
@@ -40,7 +40,7 @@ private:
static void InitInterface_Impl();
public:
- ScAuditingShell(ScViewData* pData);
+ ScAuditingShell(ScViewData& rData);
virtual ~ScAuditingShell() override;
void Execute(const SfxRequest& rReq);
diff --git a/sc/source/ui/inc/cellsh.hxx b/sc/source/ui/inc/cellsh.hxx
index 07702932d921..1d543ad557f5 100644
--- a/sc/source/ui/inc/cellsh.hxx
+++ b/sc/source/ui/inc/cellsh.hxx
@@ -79,7 +79,7 @@ private:
static void InitInterface_Impl();
public:
- ScCellShell( ScViewData* pData, const VclPtr<vcl::Window>& pFrameWin );
+ ScCellShell( ScViewData& rData, const VclPtr<vcl::Window>& pFrameWin );
virtual ~ScCellShell() override;
void Execute(SfxRequest &);
diff --git a/sc/source/ui/inc/chartsh.hxx b/sc/source/ui/inc/chartsh.hxx
index caa5a89f14f3..f9b41d2e98d4 100644
--- a/sc/source/ui/inc/chartsh.hxx
+++ b/sc/source/ui/inc/chartsh.hxx
@@ -37,7 +37,7 @@ private:
static void InitInterface_Impl();
public:
- ScChartShell(ScViewData* pData);
+ ScChartShell(ScViewData& rData);
virtual ~ScChartShell() override;
void ExecuteExportAsGraphic(SfxRequest& rReq);
diff --git a/sc/source/ui/inc/drawsh.hxx b/sc/source/ui/inc/drawsh.hxx
index 62d3a69515cf..a85e7ef07dc5 100644
--- a/sc/source/ui/inc/drawsh.hxx
+++ b/sc/source/ui/inc/drawsh.hxx
@@ -39,7 +39,7 @@ namespace svx::sidebar { class SelectionChangeHandler; }
class ScDrawShell : public SfxShell
{
- ScViewData* pViewData;
+ ScViewData& rViewData;
::rtl::Reference<svx::sidebar::SelectionChangeHandler> mpSelectionChangeHandler;
DECL_LINK( NameObjectHdl, AbstractSvxObjectNameDialog&, bool );
@@ -48,7 +48,7 @@ class ScDrawShell : public SfxShell
protected:
virtual void Activate(bool bMDI) override;
- ScViewData* GetViewData() { return pViewData; }
+ ScViewData& GetViewData() { return rViewData; }
public:
SFX_DECL_INTERFACE(SCID_DRAW_SHELL)
@@ -58,7 +58,7 @@ private:
static void InitInterface_Impl();
public:
- ScDrawShell(ScViewData* pData);
+ ScDrawShell(ScViewData& rData);
virtual ~ScDrawShell() override;
static void StateDisableItems( SfxItemSet &rSet );
diff --git a/sc/source/ui/inc/drformsh.hxx b/sc/source/ui/inc/drformsh.hxx
index 63ee223df8c1..ec335b2e516a 100644
--- a/sc/source/ui/inc/drformsh.hxx
+++ b/sc/source/ui/inc/drformsh.hxx
@@ -38,7 +38,7 @@ private:
static void InitInterface_Impl();
public:
- ScDrawFormShell(ScViewData* pData);
+ ScDrawFormShell(ScViewData& rData);
virtual ~ScDrawFormShell() override;
};
diff --git a/sc/source/ui/inc/drtxtob.hxx b/sc/source/ui/inc/drtxtob.hxx
index 83c75b552e89..b83c03fb218b 100644
--- a/sc/source/ui/inc/drtxtob.hxx
+++ b/sc/source/ui/inc/drtxtob.hxx
@@ -35,7 +35,7 @@ class TransferableClipboardListener;
class ScDrawTextObjectBar : public SfxShell
{
- ScViewData* pViewData;
+ ScViewData& mrViewData;
rtl::Reference<TransferableClipboardListener> mxClipEvtLstnr;
bool bPastePossible;
@@ -49,7 +49,7 @@ private:
static void InitInterface_Impl();
public:
- ScDrawTextObjectBar(ScViewData* pData);
+ ScDrawTextObjectBar(ScViewData& rData);
virtual ~ScDrawTextObjectBar() override;
static void StateDisableItems( SfxItemSet &rSet );
diff --git a/sc/source/ui/inc/editsh.hxx b/sc/source/ui/inc/editsh.hxx
index 7eb432b1f3fc..e6c69f1489de 100644
--- a/sc/source/ui/inc/editsh.hxx
+++ b/sc/source/ui/inc/editsh.hxx
@@ -38,7 +38,7 @@ class ScEditShell : public SfxShell
{
private:
EditView* pEditView;
- ScViewData* pViewData;
+ ScViewData& rViewData;
rtl::Reference<TransferableClipboardListener> mxClipEvtLstnr;
bool bPastePossible;
bool bIsInsertMode;
@@ -56,7 +56,7 @@ private:
static void InitInterface_Impl();
public:
- ScEditShell(EditView* pView, ScViewData* pData);
+ ScEditShell(EditView* pView, ScViewData& rData);
virtual ~ScEditShell() override;
void SetEditView(EditView* pView);
diff --git a/sc/source/ui/inc/graphsh.hxx b/sc/source/ui/inc/graphsh.hxx
index d2fee2481b9c..df854eedd0ef 100644
--- a/sc/source/ui/inc/graphsh.hxx
+++ b/sc/source/ui/inc/graphsh.hxx
@@ -43,7 +43,7 @@ private:
static void InitInterface_Impl();
public:
- ScGraphicShell(ScViewData* pData);
+ ScGraphicShell(ScViewData& rData);
virtual ~ScGraphicShell() override;
void Execute(SfxRequest& rReq);
diff --git a/sc/source/ui/inc/mediash.hxx b/sc/source/ui/inc/mediash.hxx
index 6d75a4b682b6..c5ea643f2617 100644
--- a/sc/source/ui/inc/mediash.hxx
+++ b/sc/source/ui/inc/mediash.hxx
@@ -38,7 +38,7 @@ private:
static void InitInterface_Impl();
public:
- ScMediaShell(ScViewData* pData);
+ ScMediaShell(ScViewData& rData);
virtual ~ScMediaShell() override;
void ExecuteMedia(const SfxRequest& rReq);
diff --git a/sc/source/ui/inc/oleobjsh.hxx b/sc/source/ui/inc/oleobjsh.hxx
index 07daf4215cc2..8b15c15c9486 100644
--- a/sc/source/ui/inc/oleobjsh.hxx
+++ b/sc/source/ui/inc/oleobjsh.hxx
@@ -38,7 +38,7 @@ private:
static void InitInterface_Impl();
public:
- ScOleObjectShell(ScViewData* pData);
+ ScOleObjectShell(ScViewData& rData);
virtual ~ScOleObjectShell() override;
};
diff --git a/sc/source/ui/view/auditsh.cxx b/sc/source/ui/view/auditsh.cxx
index 600dd4f221f8..3c366490de59 100644
--- a/sc/source/ui/view/auditsh.cxx
+++ b/sc/source/ui/view/auditsh.cxx
@@ -39,15 +39,15 @@ void ScAuditingShell::InitInterface_Impl()
GetStaticInterface()->RegisterPopupMenu("audit");
}
-ScAuditingShell::ScAuditingShell(ScViewData* pData) :
- SfxShell(pData->GetViewShell()),
- pViewData( pData ),
+ScAuditingShell::ScAuditingShell(ScViewData& rData) :
+ SfxShell(rData.GetViewShell()),
+ rViewData( rData ),
nFunction( SID_FILL_ADD_PRED )
{
- SetPool( &pViewData->GetViewShell()->GetPool() );
- SfxUndoManager* pMgr = pViewData->GetSfxDocShell()->GetUndoManager();
+ SetPool( &rViewData.GetViewShell()->GetPool() );
+ SfxUndoManager* pMgr = rViewData.GetSfxDocShell()->GetUndoManager();
SetUndoManager( pMgr );
- if ( !pViewData->GetDocument().IsUndoEnabled() )
+ if ( !rViewData.GetDocument().IsUndoEnabled() )
{
pMgr->SetMaxUndoActionCount( 0 );
}
@@ -61,7 +61,7 @@ ScAuditingShell::~ScAuditingShell()
void ScAuditingShell::Execute( const SfxRequest& rReq )
{
- SfxBindings& rBindings = pViewData->GetBindings();
+ SfxBindings& rBindings = rViewData.GetBindings();
sal_uInt16 nSlot = rReq.GetSlot();
switch ( nSlot )
{
@@ -77,7 +77,7 @@ void ScAuditingShell::Execute( const SfxRequest& rReq )
break;
case SID_CANCEL: // Escape
case SID_FILL_NONE:
- pViewData->GetViewShell()->SetAuditShell( false );
+ rViewData.GetViewShell()->SetAuditShell( false );
break;
case SID_FILL_SELECT:
@@ -94,7 +94,7 @@ void ScAuditingShell::Execute( const SfxRequest& rReq )
"wrong items" );
SCCOL nCol = static_cast<SCCOL>(static_cast<const SfxInt16Item*>(pXItem)->GetValue());
SCROW nRow = static_cast<SCROW>(static_cast<const SfxInt32Item*>(pYItem)->GetValue());
- ScViewFunc* pView = pViewData->GetView();
+ ScViewFunc* pView = rViewData.GetView();
pView->MoveCursorAbs( nCol, nRow, SC_FOLLOW_LINE, false, false );
switch ( nFunction )
{
diff --git a/sc/source/ui/view/cellsh.cxx b/sc/source/ui/view/cellsh.cxx
index 2fe440d84e12..cd46db595914 100644
--- a/sc/source/ui/view/cellsh.cxx
+++ b/sc/source/ui/view/cellsh.cxx
@@ -69,8 +69,8 @@ void ScCellShell::InitInterface_Impl()
GetStaticInterface()->RegisterPopupMenu("cell");
}
-ScCellShell::ScCellShell(ScViewData* pData, const VclPtr<vcl::Window>& frameWin) :
- ScFormatShell(pData),
+ScCellShell::ScCellShell(ScViewData& rData, const VclPtr<vcl::Window>& frameWin) :
+ ScFormatShell(&rData),
pImpl( new CellShell_Impl() ),
bPastePossible(false),
pFrameWin(frameWin)
diff --git a/sc/source/ui/view/editsh.cxx b/sc/source/ui/view/editsh.cxx
index 89e47e6e993e..c86437f6de8a 100644
--- a/sc/source/ui/view/editsh.cxx
+++ b/sc/source/ui/view/editsh.cxx
@@ -88,9 +88,9 @@ void ScEditShell::InitInterface_Impl()
GetStaticInterface()->RegisterPopupMenu("celledit");
}
-ScEditShell::ScEditShell(EditView* pView, ScViewData* pData) :
+ScEditShell::ScEditShell(EditView* pView, ScViewData& rData) :
pEditView (pView),
- pViewData (pData),
+ rViewData (rData),
bPastePossible (false),
bIsInsertMode (true)
{
@@ -104,7 +104,7 @@ ScEditShell::~ScEditShell()
{
if ( mxClipEvtLstnr.is() )
{
- mxClipEvtLstnr->RemoveListener( pViewData->GetActiveWin() );
+ mxClipEvtLstnr->RemoveListener( rViewData.GetActiveWin() );
// The listener may just now be waiting for the SolarMutex and call the link
// afterwards, in spite of RemoveListener. So the link has to be reset, too.
@@ -114,7 +114,7 @@ ScEditShell::~ScEditShell()
ScInputHandler* ScEditShell::GetMyInputHdl()
{
- return SC_MOD()->GetInputHdl( pViewData->GetViewShell() );
+ return SC_MOD()->GetInputHdl( rViewData.GetViewShell() );
}
void ScEditShell::SetEditView(EditView* pView)
@@ -159,7 +159,7 @@ void ScEditShell::Execute( SfxRequest& rReq )
{
const SfxItemSet* pReqArgs = rReq.GetArgs();
sal_uInt16 nSlot = rReq.GetSlot();
- SfxBindings& rBindings = pViewData->GetBindings();
+ SfxBindings& rBindings = rViewData.GetBindings();
ScInputHandler* pHdl = GetMyInputHdl();
OSL_ENSURE(pHdl,"no ScInputHandler");
@@ -269,7 +269,7 @@ void ScEditShell::Execute( SfxRequest& rReq )
case SID_PASTE_SPECIAL:
{
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
- ScopedVclPtr<SfxAbstractPasteDialog> pDlg(pFact->CreatePasteDialog(pViewData->GetDialogParent()));
+ ScopedVclPtr<SfxAbstractPasteDialog> pDlg(pFact->CreatePasteDialog(rViewData.GetDialogParent()));
SotClipboardFormatId nFormat = SotClipboardFormatId::NONE;
pDlg->Insert( SotClipboardFormatId::STRING, EMPTY_OUSTRING );
pDlg->Insert( SotClipboardFormatId::RTF, EMPTY_OUSTRING );
@@ -278,7 +278,7 @@ void ScEditShell::Execute( SfxRequest& rReq )
// in-cell paste.
TransferableDataHelper aDataHelper(
- TransferableDataHelper::CreateFromSystemClipboard( pViewData->GetActiveWin() ) );
+ TransferableDataHelper::CreateFromSystemClipboard( rViewData.GetActiveWin() ) );
nFormat = pDlg->GetFormat( aDataHelper.GetTransferable() );
pDlg.disposeAndClear();
@@ -422,7 +422,7 @@ void ScEditShell::Execute( SfxRequest& rReq )
}
else
{
- ScViewUtil::ExecuteCharMap( rItem, *pViewData->GetViewShell()->GetViewFrame() );
+ ScViewUtil::ExecuteCharMap( rItem, *rViewData.GetViewShell()->GetViewFrame() );
// while the dialog was open, edit mode may have been stopped
if (!SC_MOD()->IsInputMode())
@@ -433,7 +433,7 @@ void ScEditShell::Execute( SfxRequest& rReq )
{
// if string contains WEAK characters, set all fonts
SvtScriptType nSetScript;
- ScDocument& rDoc = pViewData->GetDocument();
+ ScDocument& rDoc = rViewData.GetDocument();
if ( rDoc.HasStringWeakCharacters( aString ) )
nSetScript = SvtScriptType::LATIN | SvtScriptType::ASIAN | SvtScriptType::COMPLEX;
else
@@ -467,7 +467,7 @@ void ScEditShell::Execute( SfxRequest& rReq )
{
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
- ScopedVclPtr<AbstractScNamePasteDlg> pDlg(pFact->CreateScNamePasteDlg(pViewData->GetDialogParent(), pViewData->GetDocShell()));
+ ScopedVclPtr<AbstractScNamePasteDlg> pDlg(pFact->CreateScNamePasteDlg(rViewData.GetDialogParent(), rViewData.GetDocShell()));
short nRet = pDlg->Execute();
// pDlg is needed below
@@ -502,12 +502,12 @@ void ScEditShell::Execute( SfxRequest& rReq )
{
SfxItemSet aAttrs( pTableView->GetAttribs() );
- SfxObjectShell* pObjSh = pViewData->GetSfxDocShell();
+ SfxObjectShell* pObjSh = rViewData.GetSfxDocShell();
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateScCharDlg(
- pViewData->GetDialogParent(), &aAttrs, pObjSh, false));
+ rViewData.GetDialogParent(), &aAttrs, pObjSh, false));
if (nSlot == SID_CHAR_DLG_EFFECT)
{
pDlg->SetCurPageId("fonteffects");
@@ -534,8 +534,8 @@ void ScEditShell::Execute( SfxRequest& rReq )
OUString aText = pEngine->GetText();
ESelection aSel = pEditView->GetSelection(); // current View
- ScDocument& rDoc = pViewData->GetDocument();
- ScRefFinder aFinder(aText, pViewData->GetCurPos(), rDoc, rDoc.GetAddressConvention());
+ ScDocument& rDoc = rViewData.GetDocument();
+ ScRefFinder aFinder(aText, rViewData.GetCurPos(), rDoc, rDoc.GetAddressConvention());
aFinder.ToggleRel( aSel.nStartPos, aSel.nEndPos );
if (aFinder.GetFound())
{
@@ -608,7 +608,7 @@ void ScEditShell::Execute( SfxRequest& rReq )
if (!bDone)
{
- pViewData->GetViewShell()->
+ rViewData.GetViewShell()->
InsertURL( rName, rURL, rTarget, static_cast<sal_uInt16>(eMode) );
// when "Button", the InsertURL in ViewShell turns the EditShell off
@@ -630,7 +630,7 @@ void ScEditShell::Execute( SfxRequest& rReq )
{
// Ensure the field is selected first
pEditView->SelectFieldAtCursor();
- pViewData->GetViewShell()->GetViewFrame()->GetDispatcher()->Execute(
+ rViewData.GetViewShell()->GetViewFrame()->GetDispatcher()->Execute(
SID_HYPERLINK_DIALOG);
}
break;
@@ -677,7 +677,7 @@ void ScEditShell::Execute( SfxRequest& rReq )
break;
case SID_INSERT_FIELD_SHEET:
{
- SvxTableField aField(pViewData->GetTabNo());
+ SvxTableField aField(rViewData.GetTabNo());
SvxFieldItem aItem(aField, EE_FEATURE_FIELD);
pTableView->InsertField(aItem);
}
@@ -719,7 +719,7 @@ void ScEditShell::GetState( SfxItemSet& rSet )
// When deactivating the view, edit mode is stopped, but the EditShell is left active
// (a shell can't be removed from within Deactivate). In that state, the EditView isn't inserted
// into the EditEngine, so it can have an invalid selection and must not be used.
- if ( !pViewData->HasEditView( pViewData->GetActivePart() ) )
+ if ( !rViewData.HasEditView( rViewData.GetActivePart() ) )
{
lcl_DisableAll( rSet );
return;
@@ -790,7 +790,7 @@ void ScEditShell::GetState( SfxItemSet& rSet )
case SID_TRANSLITERATE_KATAKANA:
case SID_INSERT_RLM:
case SID_INSERT_LRM:
- ScViewUtil::HideDisabledSlot( rSet, pViewData->GetBindings(), nWhich );
+ ScViewUtil::HideDisabledSlot( rSet, rViewData.GetBindings(), nWhich );
break;
case SID_THES:
@@ -845,7 +845,7 @@ IMPL_LINK( ScEditShell, ClipboardChanged, TransferableDataHelper*, pDataHelper,
|| pDataHelper->HasFormat( SotClipboardFormatId::RTF )
|| pDataHelper->HasFormat( SotClipboardFormatId::RICHTEXT ));
- SfxBindings& rBindings = pViewData->GetBindings();
+ SfxBindings& rBindings = rViewData.GetBindings();
rBindings.Invalidate( SID_PASTE );
rBindings.Invalidate( SID_PASTE_SPECIAL );
rBindings.Invalidate( SID_PASTE_UNFORMATTED );
@@ -860,11 +860,11 @@ void ScEditShell::GetClipState( SfxItemSet& rSet )
{
// create listener
mxClipEvtLstnr = new TransferableClipboardListener( LINK( this, ScEditShell, ClipboardChanged ) );
- vcl::Window* pWin = pViewData->GetActiveWin();
+ vcl::Window* pWin = rViewData.GetActiveWin();
mxClipEvtLstnr->AddListener( pWin );
// get initial state
- TransferableDataHelper aDataHelper( TransferableDataHelper::CreateFromSystemClipboard( pViewData->GetActiveWin() ) );
+ TransferableDataHelper aDataHelper( TransferableDataHelper::CreateFromSystemClipboard( rViewData.GetActiveWin() ) );
bPastePossible = ( aDataHelper.HasFormat( SotClipboardFormatId::STRING )
|| aDataHelper.HasFormat( SotClipboardFormatId::RTF )
|| aDataHelper.HasFormat( SotClipboardFormatId::RICHTEXT ) );
@@ -887,7 +887,7 @@ void ScEditShell::GetClipState( SfxItemSet& rSet )
{
SvxClipboardFormatItem aFormats( SID_CLIPBOARD_FORMAT_ITEMS );
TransferableDataHelper aDataHelper(
- TransferableDataHelper::CreateFromSystemClipboard( pViewData->GetActiveWin() ) );
+ TransferableDataHelper::CreateFromSystemClipboard( rViewData.GetActiveWin() ) );
if ( aDataHelper.HasFormat( SotClipboardFormatId::STRING ) )
aFormats.AddClipbrdFormat( SotClipboardFormatId::STRING );
@@ -916,7 +916,7 @@ static void lcl_InvalidateUnder( SfxBindings& rBindings )
void ScEditShell::ExecuteAttr(SfxRequest& rReq)
{
SfxItemSet aSet( pEditView->GetEmptyItemSet() );
- SfxBindings& rBindings = pViewData->GetBindings();
+ SfxBindings& rBindings = rViewData.GetBindings();
const SfxItemSet* pArgs = rReq.GetArgs();
sal_uInt16 nSlot = rReq.GetSlot();
@@ -1152,7 +1152,7 @@ void ScEditShell::ExecuteAttr(SfxRequest& rReq)
void ScEditShell::GetAttrState(SfxItemSet &rSet)
{
- if ( !pViewData->HasEditView( pViewData->GetActivePart() ) )
+ if ( !rViewData.HasEditView( rViewData.GetActivePart() ) )
{
lcl_DisableAll( rSet );
return;
@@ -1170,7 +1170,7 @@ void ScEditShell::GetAttrState(SfxItemSet &rSet)
SvtScriptType nInputScript = nScript;
if ( !pEditView->GetSelection().HasRange() )
{
- LanguageType nInputLang = pViewData->GetActiveWin()->GetInputLanguage();
+ LanguageType nInputLang = rViewData.GetActiveWin()->GetInputLanguage();
if (nInputLang != LANGUAGE_DONTKNOW && nInputLang != LANGUAGE_SYSTEM)
nInputScript = SvtLanguageOptions::GetScriptTypeOfLanguage( nInputLang );
}
@@ -1211,11 +1211,11 @@ void ScEditShell::GetAttrState(SfxItemSet &rSet)
SvxEscapement eEsc = static_cast<SvxEscapement>(aAttribs.Get( EE_CHAR_ESCAPEMENT ).GetEnumValue());
rSet.Put(SfxBoolItem(SID_SET_SUPER_SCRIPT, eEsc == SvxEscapement::Superscript));
rSet.Put(SfxBoolItem(SID_SET_SUB_SCRIPT, eEsc == SvxEscapement::Subscript));
- pViewData->GetBindings().Invalidate( SID_SET_SUPER_SCRIPT );
- pViewData->GetBindings().Invalidate( SID_SET_SUB_SCRIPT );
+ rViewData.GetBindings().Invalidate( SID_SET_SUPER_SCRIPT );
+ rViewData.GetBindings().Invalidate( SID_SET_SUB_SCRIPT );
eState = aAttribs.GetItemState( EE_CHAR_KERNING );
- pViewData->GetBindings().Invalidate( SID_ATTR_CHAR_KERNING );
+ rViewData.GetBindings().Invalidate( SID_ATTR_CHAR_KERNING );
if ( eState == SfxItemState::DONTCARE )
{
rSet.InvalidateItem(EE_CHAR_KERNING);
@@ -1226,7 +1226,7 @@ OUString ScEditShell::GetSelectionText( bool bWholeWord )
{
OUString aStrSelection;
- if ( pViewData->HasEditView( pViewData->GetActivePart() ) )
+ if ( rViewData.HasEditView( rViewData.GetActivePart() ) )
{
if ( bWholeWord )
{
@@ -1291,7 +1291,7 @@ void ScEditShell::ExecuteUndo(const SfxRequest& rReq)
}
break;
}
- pViewData->GetBindings().InvalidateAll(false);
+ rViewData.GetBindings().InvalidateAll(false);
pHdl->DataChanged();
}
@@ -1300,7 +1300,7 @@ void ScEditShell::GetUndoState(SfxItemSet &rSet)
{
// Undo state is taken from normal ViewFrame state function
- SfxViewFrame* pViewFrm = pViewData->GetViewShell()->GetViewFrame();
+ SfxViewFrame* pViewFrm = rViewData.GetViewShell()->GetViewFrame();
if ( pViewFrm && GetUndoManager() )
{
SfxWhichIter aIter(rSet);
diff --git a/sc/source/ui/view/tabvwsh4.cxx b/sc/source/ui/view/tabvwsh4.cxx
index 481b5c57c6fb..c173ca5e69bf 100644
--- a/sc/source/ui/view/tabvwsh4.cxx
+++ b/sc/source/ui/view/tabvwsh4.cxx
@@ -739,7 +739,7 @@ void ScTabViewShell::SetEditShell(EditView* pView, bool bActive )
if (pEditShell)
pEditShell->SetEditView( pView );
else
- pEditShell.reset( new ScEditShell( pView, &GetViewData() ) );
+ pEditShell.reset( new ScEditShell(pView, GetViewData()) );
SetCurSubShell(OST_Editing);
}
@@ -759,7 +759,7 @@ void ScTabViewShell::SetCurSubShell(ObjectSelectionType eOST, bool bForce)
if(!pCellShell) // is anyway always used
{
- pCellShell.reset( new ScCellShell( &GetViewData(), GetFrameWin() ) );
+ pCellShell.reset(new ScCellShell(GetViewData(), GetFrameWin()));
pCellShell->SetRepeatTarget( &aTarget );
}
@@ -807,7 +807,7 @@ void ScTabViewShell::SetCurSubShell(ObjectSelectionType eOST, bool bForce)
if ( !pDrawTextShell )
{
pDocSh->MakeDrawLayer();
- pDrawTextShell.reset( new ScDrawTextObjectBar( &GetViewData() ) );
+ pDrawTextShell.reset( new ScDrawTextObjectBar(GetViewData()) );
}
AddSubShell(*pDrawTextShell);
}
@@ -831,7 +831,7 @@ void ScTabViewShell::SetCurSubShell(ObjectSelectionType eOST, bool bForce)
if ( !pDrawShell )
{
pDocSh->MakeDrawLayer();
- pDrawShell.reset( new ScDrawShell( &GetViewData() ) );
+ pDrawShell.reset(new ScDrawShell(GetViewData()));
pDrawShell->SetRepeatTarget( &aTarget );
}
AddSubShell(*pDrawShell);
@@ -844,7 +844,7 @@ void ScTabViewShell::SetCurSubShell(ObjectSelectionType eOST, bool bForce)
if ( !pDrawFormShell )
{
pDocSh->MakeDrawLayer();
- pDrawFormShell.reset( new ScDrawFormShell( &GetViewData() ) );
+ pDrawFormShell.reset( new ScDrawFormShell(GetViewData()) );
pDrawFormShell->SetRepeatTarget( &aTarget );
}
AddSubShell(*pDrawFormShell);
@@ -857,7 +857,7 @@ void ScTabViewShell::SetCurSubShell(ObjectSelectionType eOST, bool bForce)
if ( !pChartShell )
{
pDocSh->MakeDrawLayer();
- pChartShell.reset( new ScChartShell( &GetViewData() ) );
+ pChartShell.reset( new ScChartShell(GetViewData()) );
pChartShell->SetRepeatTarget( &aTarget );
}
AddSubShell(*pChartShell);
@@ -870,7 +870,7 @@ void ScTabViewShell::SetCurSubShell(ObjectSelectionType eOST, bool bForce)
if ( !pOleObjectShell )
{
pDocSh->MakeDrawLayer();
- pOleObjectShell.reset( new ScOleObjectShell( &GetViewData() ) );
+ pOleObjectShell.reset( new ScOleObjectShell(GetViewData()) );
pOleObjectShell->SetRepeatTarget( &aTarget );
}
AddSubShell(*pOleObjectShell);
@@ -883,7 +883,7 @@ void ScTabViewShell::SetCurSubShell(ObjectSelectionType eOST, bool bForce)
if ( !pGraphicShell)
{
pDocSh->MakeDrawLayer();
- pGraphicShell.reset( new ScGraphicShell( &GetViewData() ) );
+ pGraphicShell.reset( new ScGraphicShell(GetViewData()) );
pGraphicShell->SetRepeatTarget( &aTarget );
}
AddSubShell(*pGraphicShell);
@@ -896,7 +896,7 @@ void ScTabViewShell::SetCurSubShell(ObjectSelectionType eOST, bool bForce)
if ( !pMediaShell)
{
pDocSh->MakeDrawLayer();
- pMediaShell.reset( new ScMediaShell( &GetViewData() ) );
+ pMediaShell.reset( new ScMediaShell(GetViewData()) );
pMediaShell->SetRepeatTarget( &aTarget );
}
AddSubShell(*pMediaShell);
@@ -926,7 +926,7 @@ void ScTabViewShell::SetCurSubShell(ObjectSelectionType eOST, bool bForce)
{
pDocSh->MakeDrawLayer(); // the waiting time rather now as on the click
- pAuditingShell.reset( new ScAuditingShell( &GetViewData() ) );
+ pAuditingShell.reset( new ScAuditingShell(GetViewData()) );
pAuditingShell->SetRepeatTarget( &aTarget );
}
AddSubShell(*pAuditingShell);
More information about the Libreoffice-commits
mailing list