Blob Blame History Raw
From ca8a6d4ff366f0ad7c2da6b76f76f624c593592f Mon Sep 17 00:00:00 2001
From: Kohei Yoshida <kohei.yoshida@collabora.com>
Date: Tue, 29 Jul 2014 22:33:56 -0400
Subject: [PATCH 070/137] fdo#81330: When moving to a different sheet, set 3D
 flag on.

Change-Id: I16c6e687259635c4d0ac0e5dab0140941b409bc8
(cherry picked from commit 5e55d5ffb70437e917e4092f4030d5a454fd20d6)
Reviewed-on: https://gerrit.libreoffice.org/10637
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
---
 sc/source/core/tool/token.cxx | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx
index c289960..d392550 100644
--- a/sc/source/core/tool/token.cxx
+++ b/sc/source/core/tool/token.cxx
@@ -2827,6 +2827,8 @@ sc::RefUpdateResult ScTokenArray::AdjustReferenceOnMove(
     ScRange aOldRange = rCxt.maRange;
     aOldRange.Move(-rCxt.mnColDelta, -rCxt.mnRowDelta, -rCxt.mnTabDelta);
 
+    bool b3DFlag = rOldPos.Tab() != rNewPos.Tab();
+
     FormulaToken** p = pCode;
     FormulaToken** pEnd = p + static_cast<size_t>(nLen);
     for (; p != pEnd; ++p)
@@ -2845,6 +2847,7 @@ sc::RefUpdateResult ScTokenArray::AdjustReferenceOnMove(
                 }
 
                 rRef.SetAddress(aAbs, rNewPos);
+                rRef.SetFlag3D(b3DFlag);
             }
             break;
             case svDoubleRef:
@@ -2859,6 +2862,8 @@ sc::RefUpdateResult ScTokenArray::AdjustReferenceOnMove(
                 }
 
                 rRef.SetRange(aAbs, rNewPos);
+                if (b3DFlag)
+                    rRef.Ref1.SetFlag3D(true);
             }
             break;
             case svIndex:
-- 
1.9.3