[Libreoffice-commits] core.git: sc/source

Dennis Francis dennis.francis at collabora.co.uk
Tue Jun 26 13:07:28 UTC 2018


 sc/source/core/data/drwlayer.cxx |    5 -----
 sc/source/core/data/table2.cxx   |    7 ++++---
 2 files changed, 4 insertions(+), 8 deletions(-)

New commits:
commit eebd2c72ce2d6003975de6b5bfe14b204b382a6e
Author: Dennis Francis <dennis.francis at collabora.co.uk>
Date:   Thu Jun 21 15:13:44 2018 +0530

    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 at redhat.com>

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);


More information about the Libreoffice-commits mailing list