sc/source/ui/view/tabview4.cxx |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

New commits:
commit f2febdd756723a5835f98ca8cd749d51875f8bcc
Author:     Henry Castro <hcas...@collabora.com>
AuthorDate: Fri Aug 11 09:11:09 2023 -0400
Commit:     Henry Castro <hcas...@collabora.com>
CommitDate: Sun Aug 13 16:38:38 2023 +0200

    tdf#155799: sc: fix input formula reference
    
    If the start point reference mark is selected
    with mouse direction up, it should extend to show
    the correct input formula reference.
    
    Signed-off-by: Henry Castro <hcas...@collabora.com>
    Change-Id: I41f2ea52bf7de341eccadfba80e91fd76a6fd2de
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155618
    Reviewed-by: Tomaž Vajngerl <qui...@gmail.com>
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    (cherry picked from commit f4f171506dc64a288344cb3c1eacc2c2d53283e8)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155591
    Tested-by: Jenkins

diff --git a/sc/source/ui/view/tabview4.cxx b/sc/source/ui/view/tabview4.cxx
index 442ef9a79654..a7de6bdf67d2 100644
--- a/sc/source/ui/view/tabview4.cxx
+++ b/sc/source/ui/view/tabview4.cxx
@@ -229,9 +229,13 @@ void ScTabView::UpdateRef( SCCOL nCurX, SCROW nCurY, SCTAB 
nCurZ )
         ScRefType eType = aViewData.GetRefType();
         if ( eType == SC_REFTYPE_REF )
         {
+            if ((nStartX > nEndX || nStartY > nEndY) &&
+                rDoc.HasAttrib(nStartX, nStartY, nTab, HasAttrFlags::Merged))
+                rDoc.ExtendMerge( nStartX, nStartY, nStartX, nStartY, nTab );
+
             ScRange aRef(
-                    aViewData.GetRefStartX(), aViewData.GetRefStartY(), 
aViewData.GetRefStartZ(),
-                    aViewData.GetRefEndX(), aViewData.GetRefEndY(), 
aViewData.GetRefEndZ() );
+                    nStartX, nStartY, aViewData.GetRefStartZ(),
+                    nEndX, nEndY, aViewData.GetRefEndZ() );
             SC_MOD()->SetReference( aRef, rDoc, &rMark );
             ShowRefTip();
         }

Reply via email to