summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sc/source/ui/docshell/docfunc.cxx8
-rw-r--r--sc/source/ui/undo/undoblk.cxx16
2 files changed, 24 insertions, 0 deletions
diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx
index 188259354fb3..e77f4caafef0 100644
--- a/sc/source/ui/docshell/docfunc.cxx
+++ b/sc/source/ui/docshell/docfunc.cxx
@@ -1499,6 +1499,8 @@ sal_Bool ScDocFunc::InsertCells( const ScRange& rRange, const ScMarkData* pTabMa
itr = aMark.begin();
for (; itr != itrEnd && nTabCount; ++itr)
{
+ pDoc->InitializeNoteCaptions(*itr);
+
i = *itr;
if( pDoc->HasAttrib( nMergeTestStartX, nMergeTestStartY, i, nMergeTestEndX, nMergeTestEndY, i, HASATTR_MERGED | HASATTR_OVERLAPPED ) )
{
@@ -1721,6 +1723,8 @@ sal_Bool ScDocFunc::InsertCells( const ScRange& rRange, const ScMarkData* pTabMa
for (; itr != itrEnd && *itr < nTabCount; ++itr)
{
i = *itr;
+ pDoc->SetDrawPageSize(i);
+
if (bNeedRefresh)
pDoc->ExtendMerge( nMergeTestStartX, nMergeTestStartY, nMergeTestEndX, nMergeTestEndY, i, sal_True );
else
@@ -1904,6 +1908,8 @@ sal_Bool ScDocFunc::DeleteCells( const ScRange& rRange, const ScMarkData* pTabMa
itr = aMark.begin();
for (; itr != itrEnd && *itr < nTabCount; ++itr)
{
+ pDoc->InitializeNoteCaptions(*itr);
+
SCTAB i = *itr;
if ( pDoc->HasAttrib( nUndoStartX, nUndoStartY, i, nMergeTestEndX, nMergeTestEndY, i, HASATTR_MERGED | HASATTR_OVERLAPPED ))
{
@@ -2227,6 +2233,8 @@ sal_Bool ScDocFunc::DeleteCells( const ScRange& rRange, const ScMarkData* pTabMa
itr = aMark.begin(), itrEnd = aMark.end();
for (; itr != itrEnd && *itr < nTabCount; ++itr)
{
+ pDoc->SetDrawPageSize(*itr);
+
if ( eCmd == DEL_DELCOLS || eCmd == DEL_DELROWS )
pDoc->UpdatePageBreaks( *itr );
diff --git a/sc/source/ui/undo/undoblk.cxx b/sc/source/ui/undo/undoblk.cxx
index 3fe71b181e82..754aed1a8b36 100644
--- a/sc/source/ui/undo/undoblk.cxx
+++ b/sc/source/ui/undo/undoblk.cxx
@@ -284,6 +284,10 @@ void ScUndoInsertCells::Undo()
BeginUndo();
DoChange( sal_True );
EndUndo();
+
+ ScDocument* pDoc = pDocShell->GetDocument();
+ for (SCTAB i = 0; i < nCount; ++i)
+ pDoc->SetDrawPageSize(pTabs[i]);
}
void ScUndoInsertCells::Redo()
@@ -295,6 +299,10 @@ void ScUndoInsertCells::Redo()
if ( pPasteUndo )
pPasteUndo->Redo(); // redo paste last
+
+ ScDocument* pDoc = pDocShell->GetDocument();
+ for (SCTAB i = 0; i < nCount; ++i)
+ pDoc->SetDrawPageSize(pTabs[i]);
}
void ScUndoInsertCells::Repeat(SfxRepeatTarget& rTarget)
@@ -519,6 +527,10 @@ void ScUndoDeleteCells::Undo()
pViewShell->MarkRange( ScRange(aEffRange.aStart.Col(), aEffRange.aStart.Row(), pTabs[i], aEffRange.aEnd.Col(), aEffRange.aEnd.Row(), pTabs[i]+pScenarios[i]) );
}
}
+
+ ScDocument* pDoc = pDocShell->GetDocument();
+ for (SCTAB i = 0; i < nCount; ++i)
+ pDoc->SetDrawPageSize(pTabs[i]);
}
void ScUndoDeleteCells::Redo()
@@ -532,6 +544,10 @@ void ScUndoDeleteCells::Redo()
ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
if (pViewShell)
pViewShell->DoneBlockMode(); // current way
+
+ ScDocument* pDoc = pDocShell->GetDocument();
+ for (SCTAB i = 0; i < nCount; ++i)
+ pDoc->SetDrawPageSize(pTabs[i]);
}
void ScUndoDeleteCells::Repeat(SfxRepeatTarget& rTarget)