sfx2/source/dialog/backingwindow.cxx |   10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

New commits:
commit 1e3d7374a2e70c56d082954d9ecad718b01c27fb
Author:     Balazs Varga <balazs.varga.ext...@allotropia.de>
AuthorDate: Tue May 7 10:03:53 2024 +0200
Commit:     Balazs Varga <balazs.varga.ext...@allotropia.de>
CommitDate: Tue May 7 17:08:49 2024 +0200

    tdf#160961: hide open remote file button from startcenter if the
    
    .uno:OpenRemote command is not available (e.g disabled in a config file).
    We also hide the Open remote file (and other) buttons in the Menubar
    if they are settled to disable.
    
    cherry-picked from commit: 2fdcdad742bc26be509dde53f061f96a9620fd0a
    
    Change-Id: I413e2c381ad5651c2cbef728bc5568fdcd746e9c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167263
    Tested-by: allotropia jenkins <jenk...@allotropia.de>
    Reviewed-by: Balazs Varga <balazs.varga.ext...@allotropia.de>

diff --git a/sfx2/source/dialog/backingwindow.cxx 
b/sfx2/source/dialog/backingwindow.cxx
index e4059d50c275..41998fbfa8bd 100644
--- a/sfx2/source/dialog/backingwindow.cxx
+++ b/sfx2/source/dialog/backingwindow.cxx
@@ -30,6 +30,7 @@
 #include <unotools/dynamicmenuoptions.hxx>
 #include <unotools/historyoptions.hxx>
 #include <unotools/moduleoptions.hxx>
+#include <unotools/cmdoptions.hxx>
 #include <svtools/openfiledroptargetlistener.hxx>
 #include <svtools/colorcfg.hxx>
 #include <svtools/langhelp.hxx>
@@ -239,7 +240,14 @@ void BackingWindow::initControls()
     mpLocalView->ShowTooltips( true );
 
     setupButton( mpOpenButton );
-    setupButton( mpRemoteButton );
+
+    // Hide OpenRemote button on startpage if the OpenRemote uno command is 
not available
+    SvtCommandOptions aCmdOptions;
+    if (aCmdOptions.Lookup(SvtCommandOptions::CMDOPTION_DISABLED, 
"OpenRemote"))
+        mpRemoteButton->Hide();
+    else
+        setupButton( mpRemoteButton );
+
     setupButton( mpRecentButton );
     setupButton( mpTemplateButton );
     setupButton( mpWriterAllButton );

Reply via email to