sw/source/uibase/shells/drwtxtex.cxx |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 87fafdb9dc045735e235cbba2ef37198043422c7
Author:     Justin Luth <justin_l...@sil.org>
AuthorDate: Tue Nov 23 10:23:37 2021 +0200
Commit:     Justin Luth <jl...@mail.com>
CommitDate: Tue Nov 23 11:27:20 2021 +0100

    tdf#131150 sw menu: use nSlotId=0 to avoid adding to set
    
    This fixes a regression in LO 6.4 caused by
    commit 86cb2a1f98c0585d2121e6ae34fe62f072ef9a63
    
    Not surprisingly, adding a new condition that multiple
    other items match on caused a regression.
    
    bFlag is always set to false at the top of the loop.
    In the above commit, bFlag was not set to true,
    and so thus it would always be false.
    So just set the SlotId to 0
    to avoid rSet.Put - like so many other cases already do.
    
    Change-Id: I02e9ca9d8dd75db519e801ad0e86fc8d541ae20a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125688
    Tested-by: Jenkins
    Reviewed-by: Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de>
    Reviewed-by: Justin Luth <jl...@mail.com>

diff --git a/sw/source/uibase/shells/drwtxtex.cxx 
b/sw/source/uibase/shells/drwtxtex.cxx
index 1d0a8ee58ccc..3f7a1e5e5dad 100644
--- a/sw/source/uibase/shells/drwtxtex.cxx
+++ b/sw/source/uibase/shells/drwtxtex.cxx
@@ -957,6 +957,7 @@ void SwDrawTextShell::GetState(SfxItemSet& rSet)
             {
                 if (!URLFieldHelper::IsCursorAtURLField(pOLV))
                     rSet.DisableItem(nWhich);
+                nSlotId = 0;
             }
             break;
             default:
@@ -964,7 +965,7 @@ void SwDrawTextShell::GetState(SfxItemSet& rSet)
                 break;
         }
 
-        if (nSlotId && bFlag)
+        if (nSlotId)
             rSet.Put(SfxBoolItem(nWhich, bFlag));
 
         nWhich = aIter.NextWhich();

Reply via email to