[Libreoffice-commits] core.git: Branch 'libreoffice-5-3' - sc/source
Kohei Yoshida
kohei.yoshida at collabora.com
Tue Feb 14 12:09:15 UTC 2017
sc/source/core/tool/token.cxx | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
New commits:
commit 68b53bb080a73027661260b9927245b64a940161
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
Reviewed-on: https://gerrit.libreoffice.org/34138
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Eike Rathke <erack at redhat.com>
diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx
index 53f4dc4..77f5c36 100644
--- a/sc/source/core/tool/token.cxx
+++ b/sc/source/core/tool/token.cxx
@@ -3123,8 +3123,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)
{
@@ -3151,8 +3149,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:
@@ -3168,8 +3165,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