diff options
author | Caolán McNamara <caolan.mcnamara@collabora.com> | 2023-08-17 15:57:28 +0100 |
---|---|---|
committer | Caolán McNamara <caolan.mcnamara@collabora.com> | 2023-08-18 09:58:08 +0200 |
commit | a43a9dd8205f089c92737cb5519ed2a96a8d8ff2 (patch) | |
tree | 51252c9742e5763de99c8e94348a4cf0102bf851 | |
parent | 60d91bed3fdfb0a3d89c51831b27d2187bd24c40 (diff) |
logs full of "OConfigurationNode::hasByName: object is invalid"
warn:legacy.osl:3509:3314:unotools/source/config/confignode.cxx:408: OConfigurationNode::hasByName: object is invalid!
warn:legacy.osl:3509:3314:unotools/source/config/confignode.cxx:409: OConfigurationNode::hasByName: object is invalid!
warn:legacy.osl:3509:3314:comphelper/source/misc/types.cxx:90: comphelper::getBOOL : invalid argument !
in cool, open a document, switch from light to dark with sidebar open,
click on a paragraph and then on another with different properties, e.g.
normal vs heading and each change of a sidebar context triggers the
warning over and over again.
The config has no mention of notebookbar_online.ui but we set
notebookbar_online.ui as the default to use for a notebookbar
so replace mentions in the config of notebookbar.ui with
notebookbar_online.ui for consistency when we do that and we
can drop the constant log spam.
Change-Id: I41860f5422d4426d8e3786b38c967e52bc803ae3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155804
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
-rw-r--r-- | desktop/source/lib/init.cxx | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 6d5295222f74..86a32708e59b 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -82,6 +82,7 @@ #include <comphelper/propertyvalue.hxx> #include <comphelper/scopeguard.hxx> #include <comphelper/threadpool.hxx> +#include <comphelper/types.hxx> #include <comphelper/servicehelper.hxx> #include <comphelper/sequenceashashmap.hxx> @@ -202,6 +203,7 @@ #include <officecfg/Office/Common.hxx> #include <officecfg/Office/Impress.hxx> #include <officecfg/Office/Linguistic.hxx> +#include <officecfg/Office/UI/ToolbarMode.hxx> #include <unotools/optionsdlg.hxx> #include <svl/ctloptions.hxx> #include <svtools/accessibilityoptions.hxx> @@ -7427,7 +7429,23 @@ static void activateNotebookbar(std::u16string_view rApp) if (aAppNode.isValid()) { - aAppNode.setNodeValue("Active", Any(OUString("notebookbar_online.ui"))); + OUString sNoteBookbarName("notebookbar_online.ui"); + aAppNode.setNodeValue("Active", Any(sNoteBookbarName)); + + const utl::OConfigurationNode aImplsNode = aAppNode.openNode("Modes"); + const Sequence<OUString> aModeNodeNames( aImplsNode.getNodeNames() ); + + for (const auto& rModeNodeName : aModeNodeNames) + { + const utl::OConfigurationNode aImplNode(aImplsNode.openNode(rModeNodeName)); + if (!aImplNode.isValid()) + continue; + + OUString aCommandArg = comphelper::getString(aImplNode.getNodeValue("CommandArg")); + if (aCommandArg == "notebookbar.ui") + aImplNode.setNodeValue("CommandArg", Any(sNoteBookbarName)); + } + aAppNode.commit(); } } @@ -7866,6 +7884,13 @@ static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath, const char if (bNotebookbar) { + std::shared_ptr<comphelper::ConfigurationChanges> batch(comphelper::ConfigurationChanges::create()); + officecfg::Office::UI::ToolbarMode::ActiveWriter::set("notebookbar_online.ui", batch); + officecfg::Office::UI::ToolbarMode::ActiveCalc::set("notebookbar_online.ui", batch); + officecfg::Office::UI::ToolbarMode::ActiveImpress::set("notebookbar_online.ui", batch); + officecfg::Office::UI::ToolbarMode::ActiveDraw::set("notebookbar_online.ui", batch); + batch->commit(); + activateNotebookbar(u"Writer"); activateNotebookbar(u"Calc"); activateNotebookbar(u"Impress"); |