tdf#125146 Disable the reply command in UI

... when the focus isn't inside a comment. That's likely
a regression of 6e463381b43d888a632e652a873f2b5abe7e5458
("lok: Allow to reply to comments using postit id"),
which enabled the command also in the text context.

The current solution is to only enable the command when
lok is active, which is where it's used. This is similar
to what is done in the code nearby for FN_REDLINE_COMMENT.

If that turns out to not be enough (e.g. executing the
command useful outside lok), another possible solution
might be to add FastCall = TRUE; to FN_REPLY in
_textsh.sdi. That will allow executing the command via
api even when disabled in ui.

Change-Id: Ibf2248a82599801af63a169fc2d34b27d080c048
Reviewed-on: https://gerrit.libreoffice.org/73972
Tested-by: Jenkins
Reviewed-by: Maxim Monastirsky <momonasmon@gmail.com>
diff --git a/sw/source/uibase/shells/textfld.cxx b/sw/source/uibase/shells/textfld.cxx
index 54b674e..376fdb2 100644
--- a/sw/source/uibase/shells/textfld.cxx
+++ b/sw/source/uibase/shells/textfld.cxx
@@ -900,12 +900,16 @@
            break;

        case FN_REPLY:
            if (!comphelper::LibreOfficeKit::isActive())
                rSet.DisableItem(nWhich);
            break;

        case FN_POSTIT :
        case FN_JAVAEDIT :
            {
                bool bCurField = false;
                pField = rSh.GetCurField();
                if(nWhich == FN_POSTIT || nWhich == FN_REPLY)
                if(nWhich == FN_POSTIT)
                    bCurField = pField && pField->GetTyp()->Which() == SwFieldIds::Postit;
                else
                    bCurField = pField && pField->GetTyp()->Which() == SwFieldIds::Script;