sc/source/core/tool/interpr1.cxx |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 4bd8eb13e1e2693961fdb9c19c403fde9d163de1
Author:     Eike Rathke <er...@redhat.com>
AuthorDate: Fri May 13 01:30:20 2022 +0200
Commit:     Eike Rathke <er...@redhat.com>
CommitDate: Fri May 13 02:18:58 2022 +0200

    Use interpreter stack to determine JumpMatrix context, tdf#148863 follow-up
    
    pJumpMatrix may or may not be set; actually may need some rework,
    but get this straight here.
    
    Change-Id: I0948e6aeb6637e7a5009a17f63f01d0733c0205c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134252
    Reviewed-by: Eike Rathke <er...@redhat.com>
    Tested-by: Jenkins

diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index 5b8e326a3c19..c6bcb29b28bb 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -1746,10 +1746,10 @@ void ScInterpreter::ScRandomImpl( const 
std::function<double( double fFirst, dou
         // In JumpMatrix context use its dimensions for the return matrix; the
         // formula cell range selected may differ, for example if the result is
         // to be transposed.
-        if (pJumpMatrix)
+        if (GetStackType(1) == svJumpMatrix)
         {
             SCSIZE nC, nR;
-            pJumpMatrix->GetDimensions( nC, nR);
+            pStack[sp-1]->GetJumpMatrix()->GetDimensions( nC, nR);
             nCols = std::max<SCCOL>(0, static_cast<SCCOL>(nC));
             nRows = std::max<SCROW>(0, static_cast<SCROW>(nR));
         }

Reply via email to