summaryrefslogtreecommitdiff
path: root/dbaccess
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-02-26 16:24:53 +0200
committerNoel Grandin <noel@peralex.com>2013-03-07 08:23:38 +0200
commitcd8ea20aa4b85128956a79c80f7953d30e99e802 (patch)
tree2ec962196db84427e97bbc9bb73f9566d70b6fd1 /dbaccess
parent1b4b53a2ecd7f2283a2c86b2c474786918cbfbf2 (diff)
fdo#46808, Convert ui::UIConfigurationManager to new-style
Change-Id: I62c37eb6d0e0b2a681a84e1fa0067d0a9f967cf2
Diffstat (limited to 'dbaccess')
-rw-r--r--dbaccess/source/core/dataaccess/databasedocument.cxx55
-rw-r--r--dbaccess/source/core/dataaccess/databasedocument.hxx11
2 files changed, 36 insertions, 30 deletions
diff --git a/dbaccess/source/core/dataaccess/databasedocument.cxx b/dbaccess/source/core/dataaccess/databasedocument.cxx
index 45af1b04e5b9..a230856224fa 100644
--- a/dbaccess/source/core/dataaccess/databasedocument.cxx
+++ b/dbaccess/source/core/dataaccess/databasedocument.cxx
@@ -46,17 +46,18 @@
#include <com/sun/star/io/XOutputStream.hpp>
#include <com/sun/star/io/XTruncate.hpp>
#include <com/sun/star/script/provider/XScriptProviderFactory.hpp>
+#include <com/sun/star/sdb/DatabaseContext.hpp>
+#include <com/sun/star/sdb/application/XDatabaseDocumentUI.hpp>
#include <com/sun/star/task/ErrorCodeIOException.hpp>
#include <com/sun/star/task/XStatusIndicator.hpp>
#include <com/sun/star/task/XStatusIndicatorFactory.hpp>
#include <com/sun/star/ucb/SimpleFileAccess.hpp>
+#include <com/sun/star/ucb/XContent.hpp>
+#include <com/sun/star/ui/UIConfigurationManager.hpp>
#include <com/sun/star/ui/XUIConfigurationStorage.hpp>
#include <com/sun/star/view/XSelectionSupplier.hpp>
#include <com/sun/star/xml/sax/XDocumentHandler.hpp>
#include <com/sun/star/xml/sax/Writer.hpp>
-#include <com/sun/star/ucb/XContent.hpp>
-#include <com/sun/star/sdb/DatabaseContext.hpp>
-#include <com/sun/star/sdb/application/XDatabaseDocumentUI.hpp>
#include <com/sun/star/script/XStorageBasedLibraryContainer.hpp>
#include <com/sun/star/awt/XControl.hpp>
@@ -1689,37 +1690,39 @@ void ODatabaseDocument::impl_writeStorage_throw( const Reference< XStorage >& _r
Reference< XUIConfigurationManager > SAL_CALL ODatabaseDocument::getUIConfigurationManager( ) throw (RuntimeException)
{
+ return Reference< XUIConfigurationManager >( getUIConfigurationManager2(), UNO_QUERY_THROW );
+}
+
+Reference< XUIConfigurationManager2 > ODatabaseDocument::getUIConfigurationManager2( ) throw (RuntimeException)
+{
DocumentGuard aGuard( *this );
if ( !m_xUIConfigurationManager.is() )
{
- m_pImpl->m_aContext.createComponent( "com.sun.star.ui.UIConfigurationManager", m_xUIConfigurationManager );
- Reference< XUIConfigurationStorage > xUIConfigStorage( m_xUIConfigurationManager, UNO_QUERY );
- if ( xUIConfigStorage.is() )
- {
- OUString aUIConfigFolderName( "Configurations2" );
- Reference< XStorage > xConfigStorage;
+ m_xUIConfigurationManager = UIConfigurationManager::create( m_pImpl->m_aContext.getUNOContext() );
- // First try to open with READWRITE and then READ
- xConfigStorage = getDocumentSubStorage( aUIConfigFolderName, ElementModes::READWRITE );
- if ( xConfigStorage.is() )
+ OUString aUIConfigFolderName( "Configurations2" );
+ Reference< XStorage > xConfigStorage;
+
+ // First try to open with READWRITE and then READ
+ xConfigStorage = getDocumentSubStorage( aUIConfigFolderName, ElementModes::READWRITE );
+ if ( xConfigStorage.is() )
+ {
+ OUString aUIConfigMediaType( "application/vnd.sun.xml.ui.configuration" );
+ OUString aMediaType;
+ Reference< XPropertySet > xPropSet( xConfigStorage, UNO_QUERY );
+ Any a = xPropSet->getPropertyValue( INFO_MEDIATYPE );
+ if ( !( a >>= aMediaType ) || aMediaType.isEmpty() )
{
- OUString aUIConfigMediaType( "application/vnd.sun.xml.ui.configuration" );
- OUString aMediaType;
- Reference< XPropertySet > xPropSet( xConfigStorage, UNO_QUERY );
- Any a = xPropSet->getPropertyValue( INFO_MEDIATYPE );
- if ( !( a >>= aMediaType ) || aMediaType.isEmpty() )
- {
- a <<= aUIConfigMediaType;
- xPropSet->setPropertyValue( INFO_MEDIATYPE, a );
- }
+ a <<= aUIConfigMediaType;
+ xPropSet->setPropertyValue( INFO_MEDIATYPE, a );
}
- else
- xConfigStorage = getDocumentSubStorage( aUIConfigFolderName, ElementModes::READ );
-
- // initialize ui configuration manager with document substorage
- xUIConfigStorage->setStorage( xConfigStorage );
}
+ else
+ xConfigStorage = getDocumentSubStorage( aUIConfigFolderName, ElementModes::READ );
+
+ // initialize ui configuration manager with document substorage
+ m_xUIConfigurationManager->setStorage( xConfigStorage );
}
return m_xUIConfigurationManager;
diff --git a/dbaccess/source/core/dataaccess/databasedocument.hxx b/dbaccess/source/core/dataaccess/databasedocument.hxx
index 2ff9ec6cc895..56d111149470 100644
--- a/dbaccess/source/core/dataaccess/databasedocument.hxx
+++ b/dbaccess/source/core/dataaccess/databasedocument.hxx
@@ -22,17 +22,14 @@
#include "ModelImpl.hxx"
#include "documenteventnotifier.hxx"
-#include <com/sun/star/ui/XUIConfigurationManagerSupplier.hpp>
#include <com/sun/star/document/XDocumentSubStorageSupplier.hpp>
#include <com/sun/star/frame/XModel2.hpp>
#include <com/sun/star/frame/XTitle.hpp>
#include <com/sun/star/frame/XTitleChangeBroadcaster.hpp>
#include <com/sun/star/frame/XUntitledNumbers.hpp>
-#include <com/sun/star/util/XModifiable.hpp>
#include <com/sun/star/frame/XStorable.hpp>
#include <com/sun/star/sdb/XReportDocumentsSupplier.hpp>
#include <com/sun/star/sdb/XFormDocumentsSupplier.hpp>
-#include <com/sun/star/util/XCloseable.hpp>
#include <com/sun/star/view/XPrintable.hpp>
#include <com/sun/star/frame/XModuleManager2.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
@@ -49,6 +46,10 @@
#include <com/sun/star/document/XEventBroadcaster.hpp>
#include <com/sun/star/document/XDocumentEventBroadcaster.hpp>
#include <com/sun/star/document/XDocumentRecovery.hpp>
+#include <com/sun/star/ui/XUIConfigurationManager2.hpp>
+#include <com/sun/star/ui/XUIConfigurationManagerSupplier.hpp>
+#include <com/sun/star/util/XCloseable.hpp>
+#include <com/sun/star/util/XModifiable.hpp>
#ifndef INCLUDED_COMPHELPER_IMPLBASE_VAR_HXX_17
#define INCLUDED_COMPHELPER_IMPLBASE_VAR_HXX_17
@@ -171,7 +172,7 @@ class ODatabaseDocument :public ModelDependentComponent // ModelDepe
};
DECLARE_STL_USTRINGACCESS_MAP(::com::sun::star::uno::Reference< ::com::sun::star::frame::XUntitledNumbers >,TNumberedController);
- ::com::sun::star::uno::Reference< ::com::sun::star::ui::XUIConfigurationManager> m_xUIConfigurationManager;
+ ::com::sun::star::uno::Reference< ::com::sun::star::ui::XUIConfigurationManager2> m_xUIConfigurationManager;
::cppu::OInterfaceContainerHelper m_aModifyListeners;
::cppu::OInterfaceContainerHelper m_aCloseListener;
@@ -480,6 +481,8 @@ public:
}
private:
+ ::com::sun::star::uno::Reference< ::com::sun::star::ui::XUIConfigurationManager2 > getUIConfigurationManager2() throw (::com::sun::star::uno::RuntimeException);
+
/** returns whether the model is currently being initialized
*/
bool impl_isInitializing() const { return m_eInitState == Initializing; }