summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2018-08-21 23:23:14 +0200
committerJulien Nabet <serval2412@yahoo.fr>2018-08-24 09:30:32 +0200
commit2bc3bda3a9d0abc7435e5dc9004c74304330a121 (patch)
tree96e9e11b47727cb8cce95d6c6ef8697708e7e9d7 /sfx2
parentcbdcf8955b6bd1def3e6e8f728bd93746b8df203 (diff)
tdf#119364: fix by reverting some previous commits about notebookbar
Revert: - dcbb65f2a4a3ee70ccd4896d7a5e975dbd9e6509 which was to avoid Avoid com.sun.star.container.NoSuchElementException "Active" when opening embedded form - 6c89f41b02fcd8918e535460994daac4ecd5d37e which was to fix previous commit and fix tdf#119330 Just fix Avoid com.sun.star.container.NoSuchElementException "Active" by testing if OUString returned by lcl_getAppName is empty or not. If empty, just return false Change-Id: I51ec7cba457bafdd161e02f16e3e09fddcd04408 Reviewed-on: https://gerrit.libreoffice.org/59417 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/notebookbar/SfxNotebookBar.cxx11
1 files changed, 7 insertions, 4 deletions
diff --git a/sfx2/source/notebookbar/SfxNotebookBar.cxx b/sfx2/source/notebookbar/SfxNotebookBar.cxx
index c5ba5d5b7809..ee19f6f2bcc4 100644
--- a/sfx2/source/notebookbar/SfxNotebookBar.cxx
+++ b/sfx2/source/notebookbar/SfxNotebookBar.cxx
@@ -60,7 +60,6 @@ static OUString lcl_getAppName( vcl::EnumContext::Application eApp )
switch ( eApp )
{
case vcl::EnumContext::Application::Writer:
- case vcl::EnumContext::Application::WriterForm:
return OUString( "Writer" );
break;
case vcl::EnumContext::Application::Calc:
@@ -88,7 +87,6 @@ static void lcl_setNotebookbarFileName( vcl::EnumContext::Application eApp, cons
switch ( eApp )
{
case vcl::EnumContext::Application::Writer:
- case vcl::EnumContext::Application::WriterForm:
officecfg::Office::UI::ToolbarMode::ActiveWriter::set( sFileName, aBatch );
break;
case vcl::EnumContext::Application::Calc:
@@ -111,7 +109,6 @@ static OUString lcl_getNotebookbarFileName( vcl::EnumContext::Application eApp )
switch ( eApp )
{
case vcl::EnumContext::Application::Writer:
- case vcl::EnumContext::Application::WriterForm:
return officecfg::Office::UI::ToolbarMode::ActiveWriter::get();
break;
case vcl::EnumContext::Application::Calc:
@@ -215,8 +212,14 @@ bool SfxNotebookBar::IsActive()
else
return false;
+ OUString appName(lcl_getAppName( eApp ));
+
+ if (appName.isEmpty())
+ return false;
+
+
OUStringBuffer aPath("org.openoffice.Office.UI.ToolbarMode/Applications/");
- aPath.append( lcl_getAppName( eApp ) );
+ aPath.append( appName );
const utl::OConfigurationTreeRoot aAppNode(
::comphelper::getProcessComponentContext(),