[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.1' - sc/source

Kohei Yoshida kohei.yoshida at collabora.com
Fri Feb 10 23:29:49 UTC 2017


 sc/source/core/tool/token.cxx |   13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

New commits:
commit 3b6eaa2db7d7014b94d13a5f8e1ab34b9e263fa0
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Wed Feb 8 21:43:01 2017 -0500

    tdf#103890: Fix the logic on setting 3D flag on reference.
    
    This is a backport commit that combines 3 original commits from the
    master branch.
    
    (cherry picked from commit bf8d4fb60da5e583b3a90639af45b901e19cb5aa)
    (cherry picked from commit 6e1efe7b6bd16e3183cdb7c87d786cb714a61959)
    (cherry picked from commit aeb465a458fc7ba02e3b1ca6b4193488defef511)
    
    Change-Id: I401d379be058cc45a5715a4a8a8f72aa56208655

diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx
index 3a5f1a6..2e2d81c 100644
--- a/sc/source/core/tool/token.cxx
+++ b/sc/source/core/tool/token.cxx
@@ -3068,8 +3068,6 @@ sc::RefUpdateResult ScTokenArray::AdjustReferenceOnMove(
         assert(!"can't move");
     }
 
-    bool b3DFlag = rOldPos.Tab() != rNewPos.Tab() || rCxt.mnTabDelta;
-
     TokenPointers aPtrs( pCode, nLen, pRPN, nRPN);
     for (size_t j=0; j<2; ++j)
     {
@@ -3096,8 +3094,7 @@ sc::RefUpdateResult ScTokenArray::AdjustReferenceOnMove(
                         }
 
                         rRef.SetAddress(aAbs, rNewPos);
-                        if (b3DFlag)
-                            rRef.SetFlag3D(b3DFlag);
+                        rRef.SetFlag3D(aAbs.Tab() != rNewPos.Tab() || !rRef.IsTabRel());
                     }
                     break;
                 case svDoubleRef:
@@ -3113,8 +3110,12 @@ sc::RefUpdateResult ScTokenArray::AdjustReferenceOnMove(
                         }
 
                         rRef.SetRange(aAbs, rNewPos);
-                        if (b3DFlag)
-                            rRef.Ref1.SetFlag3D(true);
+                        // Absolute sheet reference => set 3D flag.
+                        // More than one sheet referenced => has to have both 3D flags.
+                        // If end part has 3D flag => start part must have it too.
+                        rRef.Ref2.SetFlag3D(aAbs.aStart.Tab() != aAbs.aEnd.Tab() || !rRef.Ref2.IsTabRel());
+                        rRef.Ref1.SetFlag3D(aAbs.aStart.Tab() != rNewPos.Tab() || !rRef.Ref1.IsTabRel() ||
+                                rRef.Ref2.IsFlag3D());
                     }
                     break;
                 case svExternalSingleRef:


More information about the Libreoffice-commits mailing list