summaryrefslogtreecommitdiff
path: root/desktop/source/app/app.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2012-12-11 08:16:08 +0200
committerNoel Grandin <noel@peralex.com>2012-12-13 05:20:58 +0200
commitc1e42d60c572d23c61a703cd66495eab1cea4e05 (patch)
tree431e056f9e19802e87df477996a298771bafa237 /desktop/source/app/app.cxx
parent9779ae8bdeffe1c296803dffefa0d69b0fb8f975 (diff)
fdo#46808, use service constructor for ui::WindowStateConfiguration
Change-Id: I0b7f773a7db47049d7df4138d07e7fc38c657a65
Diffstat (limited to 'desktop/source/app/app.cxx')
-rw-r--r--desktop/source/app/app.cxx88
1 files changed, 42 insertions, 46 deletions
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index abea8e1e556f..c78c76b2214d 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -63,6 +63,7 @@
#include <com/sun/star/document/XEventListener.hpp>
#include <com/sun/star/frame/UICommandDescription.hpp>
#include <com/sun/star/ui/XUIElementFactoryRegistration.hpp>
+#include <com/sun/star/ui/WindowStateConfiguration.hpp>
#include <com/sun/star/frame/XUIControllerRegistration.hpp>
#include <toolkit/unohlp.hxx>
@@ -127,6 +128,7 @@ using namespace ::com::sun::star::document;
using namespace ::com::sun::star::view;
using namespace ::com::sun::star::task;
using namespace ::com::sun::star::system;
+using namespace ::com::sun::star::ui;
using namespace ::com::sun::star::ui::dialogs;
using namespace ::com::sun::star::container;
@@ -1977,8 +1979,6 @@ void Desktop::EnableOleAutomation()
void Desktop::PreloadModuleData( const CommandLineArgs& rArgs )
{
- Reference< XMultiServiceFactory > rFactory = ::comphelper::getProcessServiceFactory();
-
Sequence < com::sun::star::beans::PropertyValue > args(1);
args[0].Name = ::rtl::OUString("Hidden");
args[0].Value <<= sal_True;
@@ -2092,51 +2092,47 @@ void Desktop::PreloadConfigurationData()
}
// preload window state configuration
- xNameAccess = Reference< XNameAccess >( rFactory->createInstance(
- rtl::OUString( "com.sun.star.ui.WindowStateConfiguration" )), UNO_QUERY );
- if ( xNameAccess.is() )
+ xNameAccess = WindowStateConfiguration::create( xContext );
+ Reference< XNameAccess > xWindowAccess;
+ try
+ {
+ a = xNameAccess->getByName( aWriterDoc );
+ a >>= xWindowAccess;
+ if ( xWindowAccess.is() )
+ xWindowAccess->getByName( rtl::OUString( "private:resource/toolbar/standardbar" ));
+ }
+ catch ( const ::com::sun::star::uno::Exception& )
+ {
+ }
+ try
+ {
+ a = xNameAccess->getByName( aCalcDoc );
+ a >>= xWindowAccess;
+ if ( xWindowAccess.is() )
+ xWindowAccess->getByName( rtl::OUString( "private:resource/toolbar/standardbar" ));
+ }
+ catch ( const ::com::sun::star::uno::Exception& )
+ {
+ }
+ try
+ {
+ a = xNameAccess->getByName( aDrawDoc );
+ a >>= xWindowAccess;
+ if ( xWindowAccess.is() )
+ xWindowAccess->getByName( rtl::OUString( "private:resource/toolbar/standardbar" ));
+ }
+ catch ( const ::com::sun::star::uno::Exception& )
+ {
+ }
+ try
+ {
+ a = xNameAccess->getByName( aImpressDoc );
+ a >>= xWindowAccess;
+ if ( xWindowAccess.is() )
+ xWindowAccess->getByName( rtl::OUString( "private:resource/toolbar/standardbar" ));
+ }
+ catch ( const ::com::sun::star::uno::Exception& )
{
- Reference< XNameAccess > xWindowAccess;
- try
- {
- a = xNameAccess->getByName( aWriterDoc );
- a >>= xWindowAccess;
- if ( xWindowAccess.is() )
- xWindowAccess->getByName( rtl::OUString( "private:resource/toolbar/standardbar" ));
- }
- catch ( const ::com::sun::star::uno::Exception& )
- {
- }
- try
- {
- a = xNameAccess->getByName( aCalcDoc );
- a >>= xWindowAccess;
- if ( xWindowAccess.is() )
- xWindowAccess->getByName( rtl::OUString( "private:resource/toolbar/standardbar" ));
- }
- catch ( const ::com::sun::star::uno::Exception& )
- {
- }
- try
- {
- a = xNameAccess->getByName( aDrawDoc );
- a >>= xWindowAccess;
- if ( xWindowAccess.is() )
- xWindowAccess->getByName( rtl::OUString( "private:resource/toolbar/standardbar" ));
- }
- catch ( const ::com::sun::star::uno::Exception& )
- {
- }
- try
- {
- a = xNameAccess->getByName( aImpressDoc );
- a >>= xWindowAccess;
- if ( xWindowAccess.is() )
- xWindowAccess->getByName( rtl::OUString( "private:resource/toolbar/standardbar" ));
- }
- catch ( const ::com::sun::star::uno::Exception& )
- {
- }
}
// preload user interface element factories