summaryrefslogtreecommitdiff
path: root/desktop/source/app/app.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'desktop/source/app/app.cxx')
-rw-r--r--desktop/source/app/app.cxx74
1 files changed, 36 insertions, 38 deletions
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index e107c48b1efe..1ed400fd236b 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -67,6 +67,7 @@
#include <com/sun/star/task/XJobExecutor.hpp>
#include <com/sun/star/task/XRestartManager.hpp>
#include <com/sun/star/document/XEventListener.hpp>
+#include <com/sun/star/ui/UICommandDescription.hpp>
#include <com/sun/star/ui/XUIElementFactoryRegistration.hpp>
#include <com/sun/star/frame/XUIControllerRegistration.hpp>
@@ -2090,8 +2091,8 @@ void Desktop::PreloadModuleData( const CommandLineArgs& rArgs )
void Desktop::PreloadConfigurationData()
{
Reference< XMultiServiceFactory > rFactory = ::comphelper::getProcessServiceFactory();
- Reference< XNameAccess > xNameAccess( rFactory->createInstance(
- rtl::OUString( "com.sun.star.frame.UICommandDescription" )), UNO_QUERY );
+ Reference< XComponentContext > xContext = ::comphelper::getProcessComponentContext();
+ Reference< XNameAccess > xNameAccess( css::ui::UICommandDescription::create(xContext) );
rtl::OUString aWriterDoc( "com.sun.star.text.TextDocument" );
rtl::OUString aCalcDoc( "com.sun.star.sheet.SpreadsheetDocument" );
@@ -2099,47 +2100,44 @@ void Desktop::PreloadConfigurationData()
rtl::OUString aImpressDoc( "com.sun.star.presentation.PresentationDocument" );
// preload commands configuration
- if ( xNameAccess.is() )
- {
- Any a;
- Reference< XNameAccess > xCmdAccess;
+ Any a;
+ Reference< XNameAccess > xCmdAccess;
- try
- {
- a = xNameAccess->getByName( aWriterDoc );
- a >>= xCmdAccess;
- if ( xCmdAccess.is() )
- {
- xCmdAccess->getByName( rtl::OUString( ".uno:BasicShapes" ));
- xCmdAccess->getByName( rtl::OUString( ".uno:EditGlossary" ));
- }
- }
- catch ( const ::com::sun::star::uno::Exception& )
+ try
+ {
+ a = xNameAccess->getByName( aWriterDoc );
+ a >>= xCmdAccess;
+ if ( xCmdAccess.is() )
{
+ xCmdAccess->getByName( rtl::OUString( ".uno:BasicShapes" ));
+ xCmdAccess->getByName( rtl::OUString( ".uno:EditGlossary" ));
}
+ }
+ catch ( const ::com::sun::star::uno::Exception& )
+ {
+ }
- try
- {
- a = xNameAccess->getByName( aCalcDoc );
- a >>= xCmdAccess;
- if ( xCmdAccess.is() )
- xCmdAccess->getByName( rtl::OUString( ".uno:InsertObjectStarMath" ));
- }
- catch ( const ::com::sun::star::uno::Exception& )
- {
- }
+ try
+ {
+ a = xNameAccess->getByName( aCalcDoc );
+ a >>= xCmdAccess;
+ if ( xCmdAccess.is() )
+ xCmdAccess->getByName( rtl::OUString( ".uno:InsertObjectStarMath" ));
+ }
+ catch ( const ::com::sun::star::uno::Exception& )
+ {
+ }
- try
- {
- // draw and impress share the same configuration file (DrawImpressCommands.xcu)
- a = xNameAccess->getByName( aDrawDoc );
- a >>= xCmdAccess;
- if ( xCmdAccess.is() )
- xCmdAccess->getByName( rtl::OUString( ".uno:Polygon" ));
- }
- catch ( const ::com::sun::star::uno::Exception& )
- {
- }
+ try
+ {
+ // draw and impress share the same configuration file (DrawImpressCommands.xcu)
+ a = xNameAccess->getByName( aDrawDoc );
+ a >>= xCmdAccess;
+ if ( xCmdAccess.is() )
+ xCmdAccess->getByName( rtl::OUString( ".uno:Polygon" ));
+ }
+ catch ( const ::com::sun::star::uno::Exception& )
+ {
}
// preload window state configuration