[Libreoffice-commits] core.git: Branch 'feature/cib_contract138c' - 2 commits - configure.ac include/sfx2 officecfg/files.mk officecfg/registry postprocess/CustomTarget_registry.mk sfx2/source

Samuel Mehrbrodt (via logerrit) logerrit at kemper.freedesktop.org
Thu Apr 23 08:53:06 UTC 2020


Rebased ref, commits from common ancestor:
commit 40356e9d8395a28236d542b961017fc36e067038
Author:     Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
AuthorDate: Thu Apr 23 10:51:58 2020 +0200
Commit:     Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
CommitDate: Thu Apr 23 10:51:58 2020 +0200

    Release 6.2.9.7
    
    Change-Id: Ie12a04646f1d051bd03799d1122325a388e954da

diff --git a/configure.ac b/configure.ac
index e9c6a8b04fa8..b5ff5b40713b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -9,7 +9,7 @@ dnl in order to create a configure script.
 # several non-alphanumeric characters, those are split off and used only for the
 # ABOUTBOXPRODUCTVERSIONSUFFIX in openoffice.lst. Why that is necessary, no idea.
 
-AC_INIT([LibreOffice],[6.2.9.6],[],[],[http://documentfoundation.org/])
+AC_INIT([LibreOffice],[6.2.9.7],[],[],[http://documentfoundation.org/])
 
 AC_PREREQ([2.59])
 
commit 3934ea4f224183f8e78f50e5fa673fb573e1e684
Author:     Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
AuthorDate: Thu Apr 23 10:40:01 2020 +0200
Commit:     Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
CommitDate: Thu Apr 23 10:50:35 2020 +0200

    Add config to disable individual infobars
    
    In some deployments users want to disable certain infobars
    to not interfere with their workflows.
    Also, there are individual users who want to disable certain infobars
    for various reasons.
    
    This could be a generic config setting where you can set a list
    of Infobar IDs which should be disabled.
    That however would require knowledge about the internal IDs which
    are not exposed (and might even change over time).
    
    So instead, add a config option for each known infobar where we suspect
    users might want to turn it off.
    
    This list might change over time.
    
    Change-Id: I13f0456435b59aafe929a46498de5a8847f138e2

diff --git a/include/sfx2/infobar.hxx b/include/sfx2/infobar.hxx
index caf8b5b82518..7bb21f96db00 100644
--- a/include/sfx2/infobar.hxx
+++ b/include/sfx2/infobar.hxx
@@ -101,6 +101,7 @@ class SfxInfoBarContainerWindow : public vcl::Window
         VclPtr<SfxInfoBarWindow> getInfoBar(const OUString& sId);
         bool hasInfoBarWithID(const OUString& sId);
         void removeInfoBar(VclPtr<SfxInfoBarWindow> const & pInfoBar);
+        static bool isInfobarEnabled(const OUString& sId);
 
         virtual void Resize() override;
 };
diff --git a/officecfg/files.mk b/officecfg/files.mk
index 3d3a5079f622..9a4b688391a0 100644
--- a/officecfg/files.mk
+++ b/officecfg/files.mk
@@ -77,6 +77,7 @@ officecfg_XCSFILES := \
     Office/UI/GenericCommands \
     Office/UI/GlobalSettings \
     Office/UI/ImpressWindowState \
+    Office/UI/Infobar \
     Office/UI/MathCommands \
     Office/UI/MathWindowState \
     Office/UI/ReportCommands \
diff --git a/officecfg/registry/schema/org/openoffice/Office/UI/Infobar.xcs b/officecfg/registry/schema/org/openoffice/Office/UI/Infobar.xcs
new file mode 100644
index 000000000000..c9b560fb2731
--- /dev/null
+++ b/officecfg/registry/schema/org/openoffice/Office/UI/Infobar.xcs
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+-->
+<!DOCTYPE oor:component-schema SYSTEM "../../../../../component-schema.dtd">
+<oor:component-schema xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" oor:name="Infobar" oor:package="org.openoffice.Office.UI" xml:lang="en-US">
+  <info>
+    <desc>Infobar configuration.</desc>
+  </info>
+  <template></template>
+  <component>
+    <group oor:name="Enabled">
+      <info>
+        <desc>Which Infobars are enabled.</desc>
+      </info>
+      <prop oor:name="Readonly" oor:type="xs:boolean" oor:nillable="false">
+        <info>
+          <desc>Whether the Infobar shown in read-only docs is enabled</desc>
+        </info>
+        <value>true</value>
+      </prop>
+      <prop oor:name="Signature" oor:type="xs:boolean" oor:nillable="false">
+        <info>
+          <desc>Whether the Infobar showing the Digital Signature state is enabled</desc>
+        </info>
+        <value>true</value>
+      </prop>
+      <prop oor:name="Donate" oor:type="xs:boolean" oor:nillable="false">
+        <info>
+          <desc>Whether the Infobar showing the call for donations is enabled</desc>
+        </info>
+        <value>true</value>
+      </prop>
+      <prop oor:name="GetInvolved" oor:type="xs:boolean" oor:nillable="false">
+        <info>
+          <desc>Whether the Infobar showing the call to 'Get Involved' is enabled</desc>
+        </info>
+        <value>true</value>
+      </prop>
+    </group>
+  </component>
+</oor:component-schema>
diff --git a/postprocess/CustomTarget_registry.mk b/postprocess/CustomTarget_registry.mk
index d1583f2f81f5..6f02c8d9c196 100644
--- a/postprocess/CustomTarget_registry.mk
+++ b/postprocess/CustomTarget_registry.mk
@@ -182,6 +182,7 @@ postprocess_FILES_main := \
 	$(postprocess_XCS)/Office/UI/GenericCategories.xcs \
 	$(postprocess_XCS)/Office/UI/GenericCommands.xcs \
 	$(postprocess_XCS)/Office/UI/GlobalSettings.xcs \
+	$(postprocess_XCS)/Office/UI/Infobar.xcs \
 	$(postprocess_XCS)/Office/UI/Sidebar.xcs \
 	$(postprocess_XCS)/Office/UI/StartModuleCommands.xcs \
 	$(postprocess_XCS)/Office/UI/StartModuleWindowState.xcs \
diff --git a/sfx2/source/dialog/infobar.cxx b/sfx2/source/dialog/infobar.cxx
index 349d09cf405f..1df9ce51f8f1 100644
--- a/sfx2/source/dialog/infobar.cxx
+++ b/sfx2/source/dialog/infobar.cxx
@@ -13,6 +13,7 @@
 #include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx>
 #include <drawinglayer/processor2d/baseprocessor2d.hxx>
 #include <drawinglayer/processor2d/processorfromoutputdevice.hxx>
+#include <officecfg/Office/UI/Infobar.hxx>
 #include <sfx2/bindings.hxx>
 #include <sfx2/dispatch.hxx>
 #include <sfx2/infobar.hxx>
@@ -343,6 +344,9 @@ VclPtr<SfxInfoBarWindow> SfxInfoBarContainerWindow::appendInfoBar(const OUString
                                                            InfoBarType ibType,
                                                            WinBits nMessageStyle)
 {
+    if (!isInfobarEnabled(sId))
+        return nullptr;
+
     Size aSize = GetSizePixel();
 
     auto pInfoBar = VclPtr<SfxInfoBarWindow>::Create(this, sId, sMessage, ibType, nMessageStyle);
@@ -407,6 +411,20 @@ void SfxInfoBarContainerWindow::removeInfoBar(VclPtr<SfxInfoBarWindow> const & p
     m_pChildWin->Update();
 }
 
+bool SfxInfoBarContainerWindow::isInfobarEnabled(const OUString& sId)
+{
+    if (sId == "readonly")
+        return officecfg::Office::UI::Infobar::Enabled::Readonly::get();
+    if (sId == "signature")
+        return officecfg::Office::UI::Infobar::Enabled::Signature::get();
+    if (sId == "getdonate")
+        return officecfg::Office::UI::Infobar::Enabled::Donate::get();
+    if (sId == "getinvolved")
+        return officecfg::Office::UI::Infobar::Enabled::GetInvolved::get();
+
+    return true;
+}
+
 void SfxInfoBarContainerWindow::Resize()
 {
     // Only need to change the width of the infobars


More information about the Libreoffice-commits mailing list