sc/source/ui/view/gridwin.cxx |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 965770d61d2fe98f8b255f71d05a00cc795a29bb
Author:     Justin Luth <[email protected]>
AuthorDate: Wed Oct 8 19:49:31 2025 -0400
Commit:     Justin Luth <[email protected]>
CommitDate: Thu Oct 9 03:56:48 2025 +0200

    tdf#164641 sc: no SpellPopup when IsCellMarked
    
    Just like Writer (forever) and Draw/Impress (26.2),
    don't show the spelling context menu on a right-click
    if the cell is selected (unless it is the cell being
    actively edited somehow).
    
    The problem is that the spellPopup menu is NOT
    based on the cell under the mouse,
    but on the Point of the selected area (bPosIsInEditView).
    This has always been super confusing and unexpected,
    so simply refuse to handle spell-checking inside a selection.
    
    Note that even in selection, you can click into the
    "Input Line" to put the cell into bPosIsInEditView.
    In that case do still allow a spellcheck context menu
    even though it is technically still in a selection.
    
    Change-Id: I9a13447614d35c43f9aa01dd9a9ecf720d0260a1
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192084
    Tested-by: Jenkins
    Reviewed-by: Justin Luth <[email protected]>

diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index 3ee29d55bc59..4e6e191c52a9 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -3396,7 +3396,8 @@ void ScGridWindow::Command( const CommandEvent& rCEvt )
             // Selecting this cell is not allowed, neither is context menu.
             return;
 
-        if (mpSpellCheckCxt)
+        if (mpSpellCheckCxt
+            && (bPosIsInEditView || 
!mrViewData.GetMarkData().IsCellMarked(nCellX, nCellY)))
         {
             // Find the first string to the left for spell checking in case 
the current cell is empty.
             ScAddress aPos(nCellX, nCellY, nTab);

Reply via email to