summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDennis Francis <dennis.francis@collabora.co.uk>2018-06-21 15:13:44 +0530
committerEike Rathke <erack@redhat.com>2018-06-26 15:07:05 +0200
commiteebd2c72ce2d6003975de6b5bfe14b204b382a6e (patch)
tree07a1645c1b2e7daa74066d07f5e7636c0d5fc506
parent3f750c1e7f8b4dac1dac0333a3f8270e1d7fea00 (diff)
tdf#112452 : Refine the fix for tdf#94561
Do the changes in 7c0f6b9d0fb8d7d9e54865ccf1047bb8f8148101 only if the destination is not an undo document. Also removes the below unnecessary change in that commit. if ( IsNoteCaption( pOldObject ) ) { pOldObject = aIter.Next(); continue; } Change-Id: Ib18324ed16e91dbd932d449858a489dc09c53713 Reviewed-on: https://gerrit.libreoffice.org/56287 Tested-by: Jenkins Reviewed-by: Eike Rathke <erack@redhat.com>
-rw-r--r--sc/source/core/data/drwlayer.cxx5
-rw-r--r--sc/source/core/data/table2.cxx7
2 files changed, 4 insertions, 8 deletions
diff --git a/sc/source/core/data/drwlayer.cxx b/sc/source/core/data/drwlayer.cxx
index c1c8149e2972..a9cbb8ddcbaf 100644
--- a/sc/source/core/data/drwlayer.cxx
+++ b/sc/source/core/data/drwlayer.cxx
@@ -452,11 +452,6 @@ void ScDrawLayer::ScCopyPage( sal_uInt16 nOldPos, sal_uInt16 nNewPos )
SdrObject* pOldObject = aIter.Next();
while (pOldObject)
{
- if ( IsNoteCaption( pOldObject ) )
- {
- pOldObject = aIter.Next();
- continue;
- }
ScDrawObjData* pOldData = GetObjData(pOldObject);
if (pOldData)
{
diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx
index e542c735ed94..c6c88e44a9b7 100644
--- a/sc/source/core/data/table2.cxx
+++ b/sc/source/core/data/table2.cxx
@@ -1129,19 +1129,20 @@ void ScTable::CopyToTable(
if (!ValidColRow(nCol1, nRow1) || !ValidColRow(nCol2, nRow2))
return;
+ bool bIsUndoDoc = pDestTab->pDocument->IsUndo();
if (nFlags != InsertDeleteFlags::NONE)
{
InsertDeleteFlags nTempFlags( nFlags &
~InsertDeleteFlags( InsertDeleteFlags::NOTE | InsertDeleteFlags::ADDNOTES));
for (SCCOL i = nCol1; i <= nCol2; i++)
- aCol[i].CopyToColumn(rCxt, nRow1, nRow2, nTempFlags, bMarked,
+ aCol[i].CopyToColumn(rCxt, nRow1, nRow2, bIsUndoDoc ? nFlags : nTempFlags, bMarked,
pDestTab->aCol[i], pMarkData, bAsLink, bGlobalNamesToLocal);
}
if (!bColRowFlags) // Column widths/Row heights/Flags
return;
- if(pDestTab->pDocument->IsUndo() && (nFlags & InsertDeleteFlags::ATTRIB))
+ if(bIsUndoDoc && (nFlags & InsertDeleteFlags::ATTRIB))
{
pDestTab->mpCondFormatList.reset(new ScConditionalFormatList(pDestTab->pDocument, *mpCondFormatList));
}
@@ -1249,7 +1250,7 @@ void ScTable::CopyToTable(
if(nFlags & InsertDeleteFlags::OUTLINE) // also only when bColRowFlags
pDestTab->SetOutlineTable( pOutlineTable.get() );
- if (bCopyCaptions && (nFlags & (InsertDeleteFlags::NOTE | InsertDeleteFlags::ADDNOTES)))
+ if (!bIsUndoDoc && bCopyCaptions && (nFlags & (InsertDeleteFlags::NOTE | InsertDeleteFlags::ADDNOTES)))
{
bool bCloneCaption = (nFlags & InsertDeleteFlags::NOCAPTIONS) == InsertDeleteFlags::NONE;
CopyCaptionsToTable( nCol1, nRow1, nCol2, nRow2, pDestTab, bCloneCaption);