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-07-06 16:08:12 +0200
commit6c97e5d0d5012fe0ad8bad9157463a6293f34b8d (patch)
treec783ca57f1968074c987a6e4532ce1d94c94560c
parent1cd0e02cdf7fc5b5903320ffd24865d11465d14b (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> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97206 Tested-by: Jenkins
-rw-r--r--desktop/source/lib/init.cxx25
1 files changed, 25 insertions, 0 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index f499213cf0a2..bdfcc69b5764 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -132,6 +132,8 @@
#include <vcl/ITiledRenderable.hxx>
#include <vcl/dialoghelper.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>
@@ -6036,6 +6038,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)
@@ -6050,6 +6065,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;
@@ -6070,6 +6086,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;
}
}
@@ -6344,6 +6362,13 @@ static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath, const char
}
#endif
+ if (bNotebookbar)
+ {
+ activateNotebookbar("Writer");
+ activateNotebookbar("Calc");
+ activateNotebookbar("Impress");
+ }
+
return bInitialized;
}