[Libreoffice-commits] core.git: 2 commits - framework/source officecfg/registry
Maxim Monastirsky
momonasmon at gmail.com
Sun Aug 28 18:14:14 UTC 2016
framework/source/uielement/resourcemenucontroller.cxx | 30 +++++++++----
officecfg/registry/schema/org/openoffice/Office/Common.xcs | 2
2 files changed, 24 insertions(+), 8 deletions(-)
New commits:
commit 34dad6cf5d68c50746bb387debc89726fad2aa69
Author: Maxim Monastirsky <momonasmon at gmail.com>
Date: Sun Aug 28 17:03:53 2016 +0300
Silence "non-nillable property without value" warnings
Change-Id: I8135dde19023754dac506334ed576daba68b9365
diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
index 778638d..394b00d 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
@@ -5704,6 +5704,7 @@
</info>
</enumeration>
</constraints>
+ <value>0</value>
</prop>
<prop oor:name="NotebookbarIconSize" oor:type="xs:short" oor:nillable="false">
<!-- UIHints: Tools Options General View -->
@@ -5728,6 +5729,7 @@
</info>
</enumeration>
</constraints>
+ <value>0</value>
</prop>
<prop oor:name="SymbolStyle" oor:type="xs:string" oor:nillable="false">
<!-- UIHints: Tools Options General View -->
commit 6bf7d1d0f69097b267d348d8d264e9b669f423a0
Author: Maxim Monastirsky <momonasmon at gmail.com>
Date: Sun Aug 28 20:55:55 2016 +0300
ResourceMenuController: Better error handling
This should stop crashes in framework::MenuBarManager::FillMenu
as seen in crashreport. Unfortunately no idea how to reproduce
those crashes other than corrupting the installation (e.g.
removing files).
Change-Id: Iaed8e888dd74c4c1bb5d6fd7996ecf80f4645b68
diff --git a/framework/source/uielement/resourcemenucontroller.cxx b/framework/source/uielement/resourcemenucontroller.cxx
index 47c3f1c..cfb2d83 100644
--- a/framework/source/uielement/resourcemenucontroller.cxx
+++ b/framework/source/uielement/resourcemenucontroller.cxx
@@ -159,14 +159,28 @@ void ResourceMenuController::updatePopupMenu()
{}
}
- if ( !m_xMenuContainer.is() )
+ if ( !m_xMenuContainer.is() && m_xConfigManager.is() )
{
try
{
- if ( m_xConfigManager.is() && m_xConfigManager->hasSettings( m_aMenuURL ) )
- m_xMenuContainer.set( m_xConfigManager->getSettings( m_aMenuURL, false ) );
- else if ( m_xModuleConfigManager.is() && m_xModuleConfigManager->hasSettings( m_aMenuURL ) )
- m_xMenuContainer.set( m_xModuleConfigManager->getSettings( m_aMenuURL, false ) );
+ m_xMenuContainer.set( m_xConfigManager->getSettings( m_aMenuURL, false ) );
+ }
+ catch ( const css::container::NoSuchElementException& )
+ {
+ // Not an error - element may exist only in the module.
+ }
+ catch ( const css::lang::IllegalArgumentException& )
+ {
+ SAL_WARN( "fwk.uielement", "The given URL is not valid: " << m_aMenuURL );
+ return;
+ }
+ }
+
+ if ( !m_xMenuContainer.is() && m_xModuleConfigManager.is() )
+ {
+ try
+ {
+ m_xMenuContainer.set( m_xModuleConfigManager->getSettings( m_aMenuURL, false ) );
}
catch ( const css::container::NoSuchElementException& )
{
@@ -180,6 +194,9 @@ void ResourceMenuController::updatePopupMenu()
}
}
+ if ( !m_xMenuContainer.is() )
+ return;
+
// Clear previous content.
if ( m_xMenuBarManager.is() )
{
@@ -245,9 +262,6 @@ void ResourceMenuController::addVerbs( const css::uno::Sequence< css::embed::Ver
void ResourceMenuController::fillToolbarData()
{
- if ( !m_xMenuContainer.is() )
- return;
-
VCLXMenu* pAwtMenu = VCLXMenu::GetImplementation( m_xPopupMenu );
Menu* pVCLMenu = pAwtMenu->GetMenu();
More information about the Libreoffice-commits
mailing list