sfx2/source/control/unoctitm.cxx |   14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

New commits:
commit 2a263f9114985fcdcab9e9bfc035c6593ec40f1c
Author:     Darshan11 <darshan.upadh...@collabora.com>
AuthorDate: Wed Mar 13 16:34:38 2024 +0530
Commit:     Szymon Kłos <szymon.k...@collabora.com>
CommitDate: Fri Mar 15 10:05:47 2024 +0100

    Send ParaRightToLeft state messageto client side
    
     - Before this patch in online text in paragraph was changing according to 
uno command but client was not getting and info about is RTL true or TRL true
     - this will send message [:unoParaRightToLeft=true || 
:unoParaLeftToRight=true] at client side
     - added more properties like disabled and state information to handle both 
case at same time in online
     - which will be helpful to our existing locgic where to add or from where 
to remove selected class on element according to response
    Change-Id: Ia443215342d6a81f4e60fa9237149f6b18420e16
    
    Change-Id: I08fb7e474e099822b26c732fe1e5dac8e773c58f
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164767
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Szymon Kłos <szymon.k...@collabora.com>

diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx
index 38db25888c1f..b31a93fc9c9b 100644
--- a/sfx2/source/control/unoctitm.cxx
+++ b/sfx2/source/control/unoctitm.cxx
@@ -1058,8 +1058,6 @@ static void InterceptLOKStateChangeEvent(sal_uInt16 nSID, 
SfxViewFrame* pViewFra
              aEvent.FeatureURL.Path == "DeleteNote" ||
              aEvent.FeatureURL.Path == "AcceptChanges" ||
              aEvent.FeatureURL.Path == "SetDefault" ||
-             aEvent.FeatureURL.Path == "ParaLeftToRight" ||
-             aEvent.FeatureURL.Path == "ParaRightToLeft" ||
              aEvent.FeatureURL.Path == "ParaspaceIncrease" ||
              aEvent.FeatureURL.Path == "ParaspaceDecrease" ||
              aEvent.FeatureURL.Path == "TableDialog" ||
@@ -1131,6 +1129,18 @@ static void InterceptLOKStateChangeEvent(sal_uInt16 
nSID, SfxViewFrame* pViewFra
     {
         aBuffer.append(aEvent.IsEnabled ? std::u16string_view(u"enabled") : 
std::u16string_view(u"disabled"));
     }
+    else if (aEvent.FeatureURL.Path == "ParaLeftToRight" ||
+             aEvent.FeatureURL.Path == "ParaRightToLeft")
+    {
+        tools::JsonWriter aTree;
+        bool bTemp = false;
+        aEvent.State >>= bTemp;
+        aTree.put("commandName", aEvent.FeatureURL.Complete);
+        aTree.put("disabled", std::to_string(aEvent.IsEnabled) == "0" ? "true" 
: "false");
+        aTree.put("state", std::to_string(bTemp) == "1" ? "true" : "false");
+        
SfxViewShell::Current()->libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED, 
aTree.extractData());
+        return;
+    }
     else if (aEvent.FeatureURL.Path == "AssignLayout" ||
              aEvent.FeatureURL.Path == "StatusSelectionMode" ||
              aEvent.FeatureURL.Path == "Signature" ||

Reply via email to