summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-01-10 20:01:27 +0000
committerCaolán McNamara <caolanm@redhat.com>2021-01-11 10:16:07 +0100
commit8322580ff751cc3f2a176dfae99ab43289385a01 (patch)
tree70a007cca66e1991d24b314776010c873bf64c65
parentc43d66e94e730299b5f1c9f924db7e33fbbc166d (diff)
PasteFromClipboard never passed a null ScViewData*
Change-Id: I472e280ed110bb54fc204426c50ec98acbd3a556 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109063 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--sc/source/ui/drawfunc/drawsh5.cxx2
-rw-r--r--sc/source/ui/inc/cliputil.hxx2
-rw-r--r--sc/source/ui/view/cellsh1.cxx2
-rw-r--r--sc/source/ui/view/cliputil.cxx14
-rw-r--r--sc/source/ui/view/gridwin.cxx2
5 files changed, 11 insertions, 11 deletions
diff --git a/sc/source/ui/drawfunc/drawsh5.cxx b/sc/source/ui/drawfunc/drawsh5.cxx
index 60e126f8a82b..bec44bcab4d3 100644
--- a/sc/source/ui/drawfunc/drawsh5.cxx
+++ b/sc/source/ui/drawfunc/drawsh5.cxx
@@ -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:
diff --git a/sc/source/ui/inc/cliputil.hxx b/sc/source/ui/inc/cliputil.hxx
index 241cd00e49b0..be9c7f1e0d70 100644
--- a/sc/source/ui/inc/cliputil.hxx
+++ b/sc/source/ui/inc/cliputil.hxx
@@ -20,7 +20,7 @@ class ScRangeList;
namespace ScClipUtil
{
- void PasteFromClipboard( ScViewData* pViewData, ScTabViewShell* pTabViewShell, bool bShowDialog );
+ void PasteFromClipboard( ScViewData& rViewData, ScTabViewShell* pTabViewShell, bool bShowDialog );
bool CheckDestRanges(
const ScDocument& rDoc, SCCOL nSrcCols, SCROW nSrcRows, const ScMarkData& rMark,
diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx
index 89f2434e68ea..e7c9887b3e12 100644
--- a/sc/source/ui/view/cellsh1.cxx
+++ b/sc/source/ui/view/cellsh1.cxx
@@ -1294,7 +1294,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
case SID_PASTE:
{
- ScClipUtil::PasteFromClipboard( &GetViewData(), pTabViewShell, true );
+ ScClipUtil::PasteFromClipboard( GetViewData(), pTabViewShell, true );
rReq.Done();
}
break;
diff --git a/sc/source/ui/view/cliputil.cxx b/sc/source/ui/view/cliputil.cxx
index aa07e6d216c7..95378d76b545 100644
--- a/sc/source/ui/view/cliputil.cxx
+++ b/sc/source/ui/view/cliputil.cxx
@@ -43,12 +43,12 @@ bool lcl_checkClassification(ScDocument* pSourceDoc, const ScDocument& rDestinat
}
-void ScClipUtil::PasteFromClipboard( ScViewData* pViewData, ScTabViewShell* pTabViewShell, bool bShowDialog )
+void ScClipUtil::PasteFromClipboard( ScViewData& rViewData, ScTabViewShell* pTabViewShell, bool bShowDialog )
{
- const ScTransferObj* pOwnClip = ScTransferObj::GetOwnClipboard(ScTabViewShell::GetClipData(pViewData->GetActiveWin()));
- ScDocument& rThisDoc = pViewData->GetDocument();
- ScDPObject* pDPObj = rThisDoc.GetDPAtCursor( pViewData->GetCurX(),
- pViewData->GetCurY(), pViewData->GetTabNo() );
+ const ScTransferObj* pOwnClip = ScTransferObj::GetOwnClipboard(ScTabViewShell::GetClipData(rViewData.GetActiveWin()));
+ ScDocument& rThisDoc = rViewData.GetDocument();
+ ScDPObject* pDPObj = rThisDoc.GetDPAtCursor( rViewData.GetCurX(),
+ rViewData.GetCurY(), rViewData.GetTabNo() );
if ( pOwnClip && pDPObj )
{
// paste from Calc into DataPilot table: sort (similar to drag & drop)
@@ -66,14 +66,14 @@ void ScClipUtil::PasteFromClipboard( ScViewData* pViewData, ScTabViewShell* pTab
nClipEndY = nClipEndY + nClipStartY; // GetClipArea returns the difference
ScRange aSource( nClipStartX, nClipStartY, nSourceTab, nClipEndX, nClipEndY, nSourceTab );
- bool bDone = pTabViewShell->DataPilotMove( aSource, pViewData->GetCurPos() );
+ bool bDone = pTabViewShell->DataPilotMove( aSource, rViewData.GetCurPos() );
if ( !bDone )
pTabViewShell->ErrorMessage( STR_ERR_DATAPILOT_INPUT );
}
else
{
// normal paste
- weld::WaitObject aWait( pViewData->GetDialogParent() );
+ weld::WaitObject aWait( rViewData.GetDialogParent() );
if (!pOwnClip)
pTabViewShell->PasteFromSystem();
else
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index b4cc7e3cf84a..37bc1ea211e6 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -3254,7 +3254,7 @@ void ScGridWindow::KeyInput(const KeyEvent& rKEvt)
&& SC_MOD()->GetInputOptions().GetEnterPasteMode() )
{
ScTabViewShell* pTabViewShell = mrViewData.GetViewShell();
- ScClipUtil::PasteFromClipboard( &mrViewData, pTabViewShell, true );
+ ScClipUtil::PasteFromClipboard( mrViewData, pTabViewShell, true );
// Clear clipboard content.
uno::Reference<datatransfer::clipboard::XClipboard> xSystemClipboard =