summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSzymon Kłos <szymon.klos@collabora.com>2020-06-26 12:56:38 +0200
committerSzymon Kłos <szymon.klos@collabora.com>2020-06-30 08:15:17 +0200
commita09b5f46c4b577668e2f5b4450dab3e4eb7e6066 (patch)
treee41c33e41b9021bbde5c32a44989d01e7b4c44a3
parentec0b3af329e8096d791504429db8ebc27fc83a39 (diff)
notebookbar: early init
Change-Id: I2a129911b6949fd0e165065fd6d02f3546613407 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97232 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
-rw-r--r--desktop/source/lib/init.cxx24
1 files changed, 24 insertions, 0 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 51a8c80ad049..9bd636910959 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -140,6 +140,7 @@
#include <vcl/dialog.hxx>
#include <unicode/uchar.h>
#include <unotools/configmgr.hxx>
+#include <unotools/confignode.hxx>
#include <unotools/syslocaleoptions.hxx>
#include <unotools/mediadescriptor.hxx>
#include <unotools/pathoptions.hxx>
@@ -6044,6 +6045,19 @@ public:
}
};
+static void activateNotebookbar(const OUString& rApp)
+{
+ OUString aPath = "org.openoffice.Office.UI.ToolbarMode/Applications/" + rApp;
+
+ const utl::OConfigurationTreeRoot aAppNode(xContext, aPath, true);
+
+ if (aAppNode.isValid())
+ {
+ aAppNode.setNodeValue("Active", makeAny(OUString("notebookbar.ui")));
+ aAppNode.commit();
+ }
+}
+
static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath, const char* pUserProfileUrl)
{
enum {
@@ -6056,6 +6070,7 @@ static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath, const char
static bool bPreInited = false;
static bool bUnipoll = false;
static bool bProfileZones = false;
+ static bool bNotebookbar = false;
{ // cf. string lifetime for preinit
std::vector<OUString> aOpts;
@@ -6076,6 +6091,8 @@ static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath, const char
else if (it == "sc_print_twips_msgs")
comphelper::LibreOfficeKit::setCompatFlag(
comphelper::LibreOfficeKit::Compat::scPrintTwipsMsgs);
+ else if (it == "notebookbar")
+ bNotebookbar = true;
}
}
@@ -6350,6 +6367,13 @@ static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath, const char
}
#endif
+ if (bNotebookbar)
+ {
+ activateNotebookbar("Writer");
+ activateNotebookbar("Calc");
+ activateNotebookbar("Impress");
+ }
+
return bInitialized;
}