summaryrefslogtreecommitdiff
path: root/sc/source/ui/view/viewfunc.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/ui/view/viewfunc.cxx')
-rw-r--r--sc/source/ui/view/viewfunc.cxx19
1 files changed, 14 insertions, 5 deletions
diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx
index e5b1da40162c..08f8ac2f8ce2 100644
--- a/sc/source/ui/view/viewfunc.cxx
+++ b/sc/source/ui/view/viewfunc.cxx
@@ -1479,7 +1479,8 @@ void ScViewFunc::OnLOKInsertDeleteColumn(SCCOL nStartCol, long nOffset)
ScTabViewShell* pTabViewShell = dynamic_cast<ScTabViewShell*>(pViewShell);
if (pTabViewShell && pTabViewShell->GetDocId() == pCurrentViewShell->GetDocId())
{
- pTabViewShell->GetViewData().GetLOKWidthHelper(nCurrentTabIndex)->invalidateByIndex(nStartCol);
+ if (ScPositionHelper* pPosHelper = pTabViewShell->GetViewData().GetLOKWidthHelper(nCurrentTabIndex))
+ pPosHelper->invalidateByIndex(nStartCol);
// if we remove a column the cursor position and the current selection
// in other views could need to be moved on the left by one column.
@@ -1535,7 +1536,8 @@ void ScViewFunc::OnLOKInsertDeleteRow(SCROW nStartRow, long nOffset)
ScTabViewShell* pTabViewShell = dynamic_cast<ScTabViewShell*>(pViewShell);
if (pTabViewShell && pTabViewShell->GetDocId() == pCurrentViewShell->GetDocId())
{
- pTabViewShell->GetViewData().GetLOKHeightHelper(nCurrentTabIndex)->invalidateByIndex(nStartRow);
+ if (ScPositionHelper* pPosHelper = pTabViewShell->GetViewData().GetLOKHeightHelper(nCurrentTabIndex))
+ pPosHelper->invalidateByIndex(nStartRow);
// if we remove a row the cursor position and the current selection
// in other views could need to be moved up by one row.
@@ -1592,9 +1594,15 @@ void ScViewFunc::OnLOKSetWidthOrHeight(SCCOLROW nStart, bool bWidth)
if (pTabViewShell && pTabViewShell->GetDocId() == pCurrentViewShell->GetDocId())
{
if (bWidth)
- pTabViewShell->GetViewData().GetLOKWidthHelper(nCurTab)->invalidateByIndex(nStart);
+ {
+ if (ScPositionHelper* pPosHelper = pTabViewShell->GetViewData().GetLOKWidthHelper(nCurTab))
+ pPosHelper->invalidateByIndex(nStart);
+ }
else
- pTabViewShell->GetViewData().GetLOKHeightHelper(nCurTab)->invalidateByIndex(nStart);
+ {
+ if (ScPositionHelper* pPosHelper = pTabViewShell->GetViewData().GetLOKHeightHelper(nCurTab))
+ pPosHelper->invalidateByIndex(nStart);
+ }
}
pViewShell = SfxViewShell::GetNext(*pViewShell);
}
@@ -1605,7 +1613,8 @@ void ScViewFunc::OnLOKSetWidthOrHeight(SCCOLROW nStart, bool bWidth)
bool ScViewFunc::InsertCells( InsCellCmd eCmd, bool bRecord, bool bPartOfPaste )
{
ScRange aRange;
- if (GetViewData().GetSimpleArea(aRange) == SC_MARK_SIMPLE)
+ ScMarkType eMarkType = GetViewData().GetSimpleArea(aRange);
+ if (eMarkType == SC_MARK_SIMPLE || eMarkType == SC_MARK_SIMPLE_FILTERED)
{
ScDocShell* pDocSh = GetViewData().GetDocShell();
const ScMarkData& rMark = GetViewData().GetMarkData();