sc/source/core/tool/compiler.cxx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
New commits: commit 2c0d9aa0345f6ce24ec9b9cd8b023ad53c728510 Author: Eike Rathke <er...@redhat.com> AuthorDate: Thu Feb 27 16:25:51 2025 +0100 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Thu Feb 27 20:07:54 2025 +0100 Resolves: tdf#165383 Write range reference also if absolute/relative differ ... and top left / bottom right point to a single cell, so $K$9:K9 remains expandable to $K$9:K10 Change-Id: Ibafd1f715ae72de21d268e934ffd82df9a48f625 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182313 Tested-by: Jenkins Reviewed-by: Eike Rathke <er...@redhat.com> (cherry picked from commit fbf053ac8f6983116014d8f24e153304794d1021) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182320 Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx index 6d7cd6fb6599..929c58c79e50 100644 --- a/sc/source/core/tool/compiler.cxx +++ b/sc/source/core/tool/compiler.cxx @@ -1386,7 +1386,9 @@ struct ConventionXL_A1 : public Convention_A1, public ConventionXL } makeSingleCellStr(rLimits, rBuf, aRef.Ref1, aAbs1); - if (!bSingleRef && (aAbs1.Row() != aAbs2.Row() || aAbs1.Col() != aAbs2.Col())) + if (!bSingleRef && + (aAbs1.Row() != aAbs2.Row() || aRef.Ref1.IsRowRel() != aRef.Ref2.IsRowRel() || + aAbs1.Col() != aAbs2.Col() || aRef.Ref1.IsColRel() != aRef.Ref2.IsColRel())) { rBuf.append( ':' ); makeSingleCellStr(rLimits, rBuf, aRef.Ref2, aAbs2); @@ -1734,7 +1736,8 @@ struct ConventionXL_R1C1 : public ScCompiler::Convention, public ConventionXL // additional condition similar to ConventionXL_A1::makeRefStr() could // be // - // && (aAbsRef.aStart.Row() != aAbsRef.aEnd.Row() || aAbsRef.aStart.Col() != aAbsRef.aEnd.Col()) + // && (aAbsRef.aStart.Row() != aAbsRef.aEnd.Row() || rRef.Ref1.IsRowRel() != rRef.Ref2.IsRowRel() || + // aAbsRef.aStart.Col() != aAbsRef.aEnd.Col() || rRef.Ref1.IsColRel() != rRef.Ref2.IsColRel()) if (!bSingleRef) { rBuf.append( ':' );