diff options
Diffstat (limited to 'sc/source/ui/view/viewfunc.cxx')
-rw-r--r-- | sc/source/ui/view/viewfunc.cxx | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx index a0e1185a6d3f..51738b4951af 100644 --- a/sc/source/ui/view/viewfunc.cxx +++ b/sc/source/ui/view/viewfunc.cxx @@ -1487,7 +1487,8 @@ void ScViewFunc::OnLOKInsertDeleteColumn(SCCOL nStartCol, long nOffset) ScTabViewShell* pTabViewShell = dynamic_cast<ScTabViewShell*>(pViewShell); if (pTabViewShell) { - 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. @@ -1542,7 +1543,8 @@ void ScViewFunc::OnLOKInsertDeleteRow(SCROW nStartRow, long nOffset) ScTabViewShell* pTabViewShell = dynamic_cast<ScTabViewShell*>(pViewShell); if (pTabViewShell) { - 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. @@ -1598,9 +1600,15 @@ void ScViewFunc::OnLOKSetWidthOrHeight(SCCOLROW nStart, bool bWidth) if (pTabViewShell) { 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); } |