diff options
Diffstat (limited to 'dbaccess/source/core/inc')
35 files changed, 179 insertions, 273 deletions
diff --git a/dbaccess/source/core/inc/ContainerMediator.hxx b/dbaccess/source/core/inc/ContainerMediator.hxx index 8d1bf9d8d752..37bfc0ebac1a 100644 --- a/dbaccess/source/core/inc/ContainerMediator.hxx +++ b/dbaccess/source/core/inc/ContainerMediator.hxx @@ -16,8 +16,7 @@ * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_DBACCESS_SOURCE_CORE_INC_CONTAINERMEDIATOR_HXX -#define INCLUDED_DBACCESS_SOURCE_CORE_INC_CONTAINERMEDIATOR_HXX +#pragma once #include <com/sun/star/container/XContainerListener.hpp> #include <com/sun/star/container/XContainer.hpp> @@ -77,6 +76,4 @@ namespace dbaccess } // namespace dbaccess -#endif // INCLUDED_DBACCESS_SOURCE_CORE_INC_CONTAINERMEDIATOR_HXX - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/core/inc/ContentHelper.hxx b/dbaccess/source/core/inc/ContentHelper.hxx index 87686496a77d..d60521a4328d 100644 --- a/dbaccess/source/core/inc/ContentHelper.hxx +++ b/dbaccess/source/core/inc/ContentHelper.hxx @@ -16,8 +16,7 @@ * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_DBACCESS_SOURCE_CORE_INC_CONTENTHELPER_HXX -#define INCLUDED_DBACCESS_SOURCE_CORE_INC_CONTENTHELPER_HXX +#pragma once #include <com/sun/star/ucb/XContent.hpp> #include <com/sun/star/ucb/XCommandProcessor.hpp> @@ -26,11 +25,11 @@ #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/lang/XInitialization.hpp> #include <com/sun/star/sdbc/XRow.hpp> -#include <com/sun/star/lang/XUnoTunnel.hpp> #include <com/sun/star/uno/XComponentContext.hpp> #include <cppuhelper/compbase.hxx> #include <cppuhelper/basemutex.hxx> -#include <comphelper/interfacecontainer2.hxx> +#include <comphelper/interfacecontainer3.hxx> +#include <comphelper/multiinterfacecontainer3.hxx> #include <com/sun/star/beans/Property.hpp> #include <com/sun/star/container/XChild.hpp> #include <com/sun/star/sdbcx/XRename.hpp> @@ -72,7 +71,7 @@ namespace dbaccess typedef std::shared_ptr<OContentHelper_Impl> TContentPtr; - typedef cppu::OMultiTypeInterfaceContainerHelperVar<OUString> + typedef comphelper::OMultiTypeInterfaceContainerHelperVar3<css::beans::XPropertiesChangeListener, OUString> PropertyChangeListenerContainer; typedef ::cppu::WeakComponentImplHelper< css::ucb::XContent , css::ucb::XCommandProcessor @@ -80,7 +79,6 @@ namespace dbaccess , css::beans::XPropertiesChangeNotifier , css::beans::XPropertyContainer , css::lang::XInitialization - , css::lang::XUnoTunnel , css::container::XChild , css::sdbcx::XRename > OContentHelper_COMPBASE; @@ -94,7 +92,7 @@ namespace dbaccess void impl_rename_throw(const OUString& _sNewName,bool _bNotify = true); protected: - ::comphelper::OInterfaceContainerHelper2 m_aContentListeners; + ::comphelper::OInterfaceContainerHelper3<css::ucb::XContentEventListener> m_aContentListeners; PropertyChangeListenerContainer m_aPropertyChangeListeners; css::uno::Reference< css::uno::XInterface > m_xParentContainer; @@ -122,7 +120,7 @@ namespace dbaccess OContentHelper( const css::uno::Reference< css::uno::XComponentContext >& _xORB ,const css::uno::Reference< css::uno::XInterface >& _xParentContainer - ,const TContentPtr& _pImpl + ,TContentPtr _pImpl ); // css::lang::XTypeProvider @@ -155,10 +153,6 @@ namespace dbaccess // XInitialization virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) override; - // css::lang::XUnoTunnel - virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override; - static css::uno::Sequence< sal_Int8 > getUnoTunnelId(); - // css::container::XChild virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getParent( ) override; virtual void SAL_CALL setParent( const css::uno::Reference< css::uno::XInterface >& Parent ) override; @@ -180,6 +174,4 @@ namespace dbaccess } // namespace dbaccess -#endif // INCLUDED_DBACCESS_SOURCE_CORE_INC_CONTENTHELPER_HXX - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/core/inc/DatabaseDataProvider.hxx b/dbaccess/source/core/inc/DatabaseDataProvider.hxx index 68c066412a20..8c2029634b8a 100644 --- a/dbaccess/source/core/inc/DatabaseDataProvider.hxx +++ b/dbaccess/source/core/inc/DatabaseDataProvider.hxx @@ -16,8 +16,7 @@ * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_DBACCESS_SOURCE_CORE_INC_DATABASEDATAPROVIDER_HXX -#define INCLUDED_DBACCESS_SOURCE_CORE_INC_DATABASEDATAPROVIDER_HXX +#pragma once #include <sal/config.h> @@ -52,20 +51,12 @@ class DatabaseDataProvider: private ::cppu::BaseMutex, public: explicit DatabaseDataProvider(css::uno::Reference< css::uno::XComponentContext > const & context); - // css::lang::XServiceInfo - static methods - /// @throws css::uno::RuntimeException - static css::uno::Sequence< OUString > getSupportedServiceNames_Static(); - /// @throws css::uno::RuntimeException - static OUString getImplementationName_Static(); - static css::uno::Reference< css::uno::XInterface > - Create(css::uno::Reference< css::uno::XComponentContext > const & context); - private: // css::uno::XInterface: virtual css::uno::Any SAL_CALL queryInterface(css::uno::Type const & type) override; - virtual void SAL_CALL acquire() throw () override + virtual void SAL_CALL acquire() noexcept override { TDatabaseDataProvider::acquire(); } - virtual void SAL_CALL release() throw () override + virtual void SAL_CALL release() noexcept override { TDatabaseDataProvider::release(); } // css::lang::XServiceInfo @@ -82,7 +73,7 @@ private: virtual css::uno::Reference<css::chart2::data::XDataSequence> SAL_CALL createDataSequenceByValueArray( - const OUString& aRole, const OUString & aRangeRepresentation) override; + const OUString& aRole, const OUString & aRangeRepresentation, const OUString& aRoleQualifier) override; virtual css::uno::Reference< css::sheet::XRangeSelection > SAL_CALL getRangeSelection() override; @@ -229,7 +220,7 @@ private: ::osl::MutexGuard aGuard(m_aMutex); if ( _member != Value ) { - prepareSet(_sProperty, css::uno::makeAny(_member), css::uno::makeAny(Value), &l); + prepareSet(_sProperty, css::uno::Any(_member), css::uno::Any(Value), &l); _member = Value; } } @@ -268,6 +259,4 @@ private: } // namespace dbaccess -#endif // INCLUDED_DBACCESS_SOURCE_CORE_INC_DATABASEDATAPROVIDER_HXX - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/core/inc/FilteredContainer.hxx b/dbaccess/source/core/inc/FilteredContainer.hxx index b07892731f3f..968f3a1d622b 100644 --- a/dbaccess/source/core/inc/FilteredContainer.hxx +++ b/dbaccess/source/core/inc/FilteredContainer.hxx @@ -16,8 +16,7 @@ * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_DBACCESS_SOURCE_CORE_INC_FILTEREDCONTAINER_HXX -#define INCLUDED_DBACCESS_SOURCE_CORE_INC_FILTEREDCONTAINER_HXX +#pragma once #include <sal/config.h> @@ -134,6 +133,4 @@ namespace dbaccess }; } // namespace -#endif // INCLUDED_DBACCESS_SOURCE_CORE_INC_FILTEREDCONTAINER_HXX - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/core/inc/ModelImpl.hxx b/dbaccess/source/core/inc/ModelImpl.hxx index c67e67d57905..2fc19830ca42 100644 --- a/dbaccess/source/core/inc/ModelImpl.hxx +++ b/dbaccess/source/core/inc/ModelImpl.hxx @@ -17,8 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_DBACCESS_SOURCE_CORE_INC_MODELIMPL_HXX -#define INCLUDED_DBACCESS_SOURCE_CORE_INC_MODELIMPL_HXX +#pragma once #include "ContentHelper.hxx" #include "documentevents.hxx" @@ -28,18 +27,23 @@ #include <com/sun/star/document/XDocumentSubStorageSupplier.hpp> #include <com/sun/star/embed/XStorage.hpp> #include <com/sun/star/frame/XModel.hpp> +#include <com/sun/star/lang/XEventListener.hpp> #include <com/sun/star/lang/XSingleServiceFactory.hpp> +#include <com/sun/star/reflection/ProxyFactory.hpp> #include <com/sun/star/script/XStorageBasedLibraryContainer.hpp> #include <com/sun/star/sdbc/XDataSource.hpp> #include <com/sun/star/util/XNumberFormatsSupplier.hpp> + #include <comphelper/namedvaluecollection.hxx> #include <cppuhelper/weakref.hxx> #include <vcl/svapp.hxx> #include <sfx2/docmacromode.hxx> #include <sfx2/docstoragemodifylistener.hxx> #include <unotools/sharedunocomponent.hxx> +#include <rtl/digest.h> #include <rtl/ref.hxx> +#include <o3tl/enumarray.hxx> namespace comphelper { @@ -85,35 +89,95 @@ struct AsciiPropertyValue } }; -class ODatabaseContext; -class OSharedConnectionManager; - // ODatabaseModelImpl typedef ::utl::SharedUNOComponent< css::embed::XStorage > SharedStorage; class ODatabaseContext; class DocumentStorageAccess; -class OSharedConnectionManager; +class ODatabaseSource; + + +/** The class OSharedConnectionManager implements a structure to share connections. + It owns the master connections which will be disposed when the last connection proxy is gone. +*/ +// need to hold the digest +struct TDigestHolder +{ + sal_uInt8 m_pBuffer[RTL_DIGEST_LENGTH_SHA1]; + TDigestHolder() + { + m_pBuffer[0] = 0; + } + +}; + +class OSharedConnectionManager : public ::cppu::WeakImplHelper< css::lang::XEventListener > +{ + // contains the currently used master connections + struct TConnectionHolder + { + css::uno::Reference< css::sdbc::XConnection > xMasterConnection; + oslInterlockedCount nALiveCount; + }; + + // the less-compare functor, used for the stl::map + struct TDigestLess + { + bool operator() (const TDigestHolder& x, const TDigestHolder& y) const + { + sal_uInt32 i; + for(i=0;i < RTL_DIGEST_LENGTH_SHA1 && (x.m_pBuffer[i] >= y.m_pBuffer[i]); ++i) + ; + return i < RTL_DIGEST_LENGTH_SHA1; + } + }; + + typedef std::map< TDigestHolder,TConnectionHolder,TDigestLess> TConnectionMap; // holds the master connections + typedef std::map< css::uno::Reference< css::sdbc::XConnection >,TConnectionMap::iterator> TSharedConnectionMap;// holds the shared connections + + ::osl::Mutex m_aMutex; + TConnectionMap m_aConnections; // remember the master connection in conjunction with the digest + TSharedConnectionMap m_aSharedConnection; // the shared connections with conjunction with an iterator into the connections map + css::uno::Reference< css::reflection::XProxyFactory > m_xProxyFactory; + +protected: + virtual ~OSharedConnectionManager() override; + +public: + explicit OSharedConnectionManager(const css::uno::Reference< css::uno::XComponentContext >& _rxContext); + + void SAL_CALL disposing( const css::lang::EventObject& Source ) override; + css::uno::Reference< css::sdbc::XConnection > getConnection( const OUString& url, + const OUString& user, + const OUString& password, + const css::uno::Sequence< css::beans::PropertyValue >& _aInfo, + ODatabaseSource* _pDataSource); + void addEventListener(const css::uno::Reference< css::sdbc::XConnection >& _rxConnection, TConnectionMap::iterator const & _rIter); +}; + + class ODatabaseModelImpl :public ::sfx2::IMacroDocumentAccess ,public ::sfx2::IModifiableDocument { public: - enum ObjectType + + enum class ObjectType { - E_FORM = 0, - E_REPORT = 1, - E_QUERY = 2, - E_TABLE = 3 + Form = 0, + Report = 1, + Query = 2, + Table = 3, + LAST = Table }; - enum EmbeddedMacros + enum class EmbeddedMacros { // the database document (storage) itself contains macros - eDocumentWideMacros, + DocumentWide, // there are sub document( storage)s containing macros - eSubDocumentMacros, + SubDocument, // there are no known macro( storage)s - eNoMacros + NONE }; private: @@ -121,7 +185,7 @@ private: css::uno::WeakReference< css::sdbc::XDataSource > m_xDataSource; rtl::Reference<DocumentStorageAccess> m_pStorageAccess; - std::vector< TContentPtr > m_aContainer; // one for each ObjectType + o3tl::enumarray< ObjectType, TContentPtr > m_aContainer; // one for each ObjectType ::sfx2::DocumentMacroMode m_aMacroMode; sal_Int16 m_nImposedMacroExecMode; @@ -188,9 +252,7 @@ public: m_xSettings; css::uno::Sequence< OUString > m_aTableFilter; css::uno::Sequence< OUString > m_aTableTypeFilter; - OSharedConnectionManager* m_pSharedConnectionManager; - css::uno::Reference< css::lang::XEventListener > - m_xSharedConnectionManager; + rtl::Reference< OSharedConnectionManager > m_xSharedConnectionManager; css::uno::Reference<css::awt::XWindow> m_xDialogParent; sal_uInt16 m_nControllerLockCount; @@ -222,7 +284,7 @@ public: virtual ~ODatabaseModelImpl(); ODatabaseModelImpl( - const OUString& _rRegistrationName, + OUString _sRegistrationName, const css::uno::Reference< css::uno::XComponentContext >& _rxContext, ODatabaseContext& _rDBContext ); @@ -417,7 +479,8 @@ public: virtual bool macroCallsSeenWhileLoading() const override; virtual css::uno::Reference< css::document::XEmbeddedScripts > getEmbeddedDocumentScripts() const override; virtual SignatureState getScriptingSignatureState() override; - virtual bool hasTrustedScriptingSignature( bool bAllowUIToAddAuthor ) override; + virtual bool hasTrustedScriptingSignature( + const css::uno::Reference<css::task::XInteractionHandler>& _rxInteraction) override; // IModifiableDocument virtual void storageIsModified() override; @@ -452,7 +515,7 @@ protected: ::osl::Mutex m_aMutex; // only use this to init WeakComponentImplHelper protected: - explicit ModelDependentComponent( const ::rtl::Reference< ODatabaseModelImpl >& _model ); + explicit ModelDependentComponent( ::rtl::Reference< ODatabaseModelImpl > _model ); virtual ~ModelDependentComponent(); /** returns the component itself @@ -540,6 +603,4 @@ public: } // namespace dbaccess -#endif - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/core/inc/PropertyForward.hxx b/dbaccess/source/core/inc/PropertyForward.hxx index 1b20e76e9c6f..daf31758d000 100644 --- a/dbaccess/source/core/inc/PropertyForward.hxx +++ b/dbaccess/source/core/inc/PropertyForward.hxx @@ -16,8 +16,7 @@ * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_DBACCESS_SOURCE_CORE_INC_PROPERTYFORWARD_HXX -#define INCLUDED_DBACCESS_SOURCE_CORE_INC_PROPERTYFORWARD_HXX +#pragma once #include <com/sun/star/beans/XPropertyChangeListener.hpp> #include <com/sun/star/beans/XPropertySet.hpp> @@ -50,7 +49,7 @@ namespace dbaccess public: OPropertyForward( const css::uno::Reference< css::beans::XPropertySet>& _xSource, const css::uno::Reference< css::container::XNameAccess>& _xDestContainer, - const OUString& _sName, + OUString _sName, const std::vector< OUString >& _aPropertyList ); @@ -67,6 +66,4 @@ namespace dbaccess } // namespace dbaccess -#endif // INCLUDED_DBACCESS_SOURCE_CORE_INC_PROPERTYFORWARD_HXX - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/core/inc/RefreshListener.hxx b/dbaccess/source/core/inc/RefreshListener.hxx index 37c6ea511bc5..03836c308f2b 100644 --- a/dbaccess/source/core/inc/RefreshListener.hxx +++ b/dbaccess/source/core/inc/RefreshListener.hxx @@ -17,8 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_DBACCESS_SOURCE_CORE_INC_REFRESHLISTENER_HXX -#define INCLUDED_DBACCESS_SOURCE_CORE_INC_REFRESHLISTENER_HXX +#pragma once #include <com/sun/star/uno/Reference.h> @@ -40,6 +39,4 @@ namespace dbaccess } // namespace dbaccess -#endif // INCLUDED_DBACCESS_SOURCE_CORE_INC_REFRESHLISTENER_HXX - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/core/inc/SingleSelectQueryComposer.hxx b/dbaccess/source/core/inc/SingleSelectQueryComposer.hxx index be2f48fdb30d..fdde2d451d17 100644 --- a/dbaccess/source/core/inc/SingleSelectQueryComposer.hxx +++ b/dbaccess/source/core/inc/SingleSelectQueryComposer.hxx @@ -16,8 +16,7 @@ * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_DBACCESS_SOURCE_CORE_INC_SINGLESELECTQUERYCOMPOSER_HXX -#define INCLUDED_DBACCESS_SOURCE_CORE_INC_SINGLESELECTQUERYCOMPOSER_HXX +#pragma once #include <com/sun/star/sdb/XParametersSupplier.hpp> #include <com/sun/star/sdbcx/XTablesSupplier.hpp> @@ -77,6 +76,7 @@ namespace dbaccess typedef std::function<const ::connectivity::OSQLParseNode*(::connectivity::OSQLParseTreeIterator *)> TGetParseNode; ::svxform::OSystemParseContext m_aParseContext; + ::svxform::ONeutralParseContext m_aNeutralContext; ::connectivity::OSQLParser m_aSqlParser; ::connectivity::OSQLParseTreeIterator m_aSqlIterator; // the iterator for the complete statement ::connectivity::OSQLParseTreeIterator m_aAdditiveIterator; // the iterator for the "additive statement" (means without the clauses of the elementary statement) @@ -219,7 +219,10 @@ namespace dbaccess // XServiceInfo DECLARE_SERVICE_INFO(); - DECLARE_PROPERTYCONTAINER_DEFAULTS(); + virtual css::uno::Reference< css::beans::XPropertySetInfo> SAL_CALL getPropertySetInfo() override; + virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper() override; + virtual ::cppu::IPropertyArrayHelper* createArrayHelper() const override; + // css::sdb::XSingleSelectQueryComposer virtual OUString SAL_CALL getElementaryQuery() override; @@ -257,6 +260,5 @@ namespace dbaccess virtual css::uno::Reference< css::container::XIndexAccess > SAL_CALL getParameters( ) override; }; } -#endif // INCLUDED_DBACCESS_SOURCE_CORE_INC_SINGLESELECTQUERYCOMPOSER_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/core/inc/TableDeco.hxx b/dbaccess/source/core/inc/TableDeco.hxx index f7bec41b9d28..93a974dac4a4 100644 --- a/dbaccess/source/core/inc/TableDeco.hxx +++ b/dbaccess/source/core/inc/TableDeco.hxx @@ -17,8 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_DBACCESS_SOURCE_CORE_INC_TABLEDECO_HXX -#define INCLUDED_DBACCESS_SOURCE_CORE_INC_TABLEDECO_HXX +#pragma once #include <memory> #include <com/sun/star/util/XNumberFormatsSupplier.hpp> @@ -62,7 +61,6 @@ namespace dbaccess ,public ODBTableDecorator_PROP { void fillPrivileges() const; - protected: css::uno::Reference< css::container::XContainerListener > m_xColumnMediator; css::uno::Reference< css::sdbcx::XColumnsSupplier > m_xTable; css::uno::Reference< css::container::XNameAccess > m_xColumnDefinitions; @@ -76,8 +74,9 @@ namespace dbaccess // note: this thing uses the ref-count of "this", see OCollection::acquire()! std::unique_ptr<::connectivity::sdbcx::OCollection> m_pColumns; + protected: // IColumnFactory - virtual OColumn* createColumn(const OUString& _rName) const override; + virtual rtl::Reference<OColumn> createColumn(const OUString& _rName) const override; virtual css::uno::Reference< css::beans::XPropertySet > createColumnDescriptor() override; virtual void columnAppended( const css::uno::Reference< css::beans::XPropertySet >& _rxSourceDescriptor ) override; virtual void columnDropped(const OUString& _sName) override; @@ -121,8 +120,8 @@ namespace dbaccess //XInterface virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override; - virtual void SAL_CALL acquire() throw() override; - virtual void SAL_CALL release() throw() override; + virtual void SAL_CALL acquire() noexcept override; + virtual void SAL_CALL release() noexcept override; //XTypeProvider virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override; virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override; @@ -146,7 +145,7 @@ namespace dbaccess virtual void SAL_CALL setName( const OUString& aName ) override; // css::lang::XUnoTunnel virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override; - static css::uno::Sequence< sal_Int8 > getUnoTunnelId(); + static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId(); // XColumnsSupplier virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getColumns( ) override; @@ -161,6 +160,5 @@ namespace dbaccess using ODataSettings::getFastPropertyValue; }; } -#endif // INCLUDED_DBACCESS_SOURCE_CORE_INC_TABLEDECO_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/core/inc/View.hxx b/dbaccess/source/core/inc/View.hxx index 93985e068a74..d3889ff56d00 100644 --- a/dbaccess/source/core/inc/View.hxx +++ b/dbaccess/source/core/inc/View.hxx @@ -17,8 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_DBACCESS_SOURCE_CORE_INC_VIEW_HXX -#define INCLUDED_DBACCESS_SOURCE_CORE_INC_VIEW_HXX +#pragma once #include <connectivity/sdbcx/VView.hxx> @@ -69,6 +68,4 @@ namespace dbaccess } // namespace dbaccess -#endif // INCLUDED_DBACCESS_SOURCE_CORE_INC_VIEW_HXX - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/core/inc/bookmarkcontainer.hxx b/dbaccess/source/core/inc/bookmarkcontainer.hxx index 10da82a6ced3..464192542499 100644 --- a/dbaccess/source/core/inc/bookmarkcontainer.hxx +++ b/dbaccess/source/core/inc/bookmarkcontainer.hxx @@ -17,15 +17,14 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_DBACCESS_SOURCE_CORE_INC_BOOKMARKCONTAINER_HXX -#define INCLUDED_DBACCESS_SOURCE_CORE_INC_BOOKMARKCONTAINER_HXX +#pragma once #include <sal/config.h> #include <map> #include <vector> -#include <comphelper/interfacecontainer2.hxx> +#include <comphelper/interfacecontainer3.hxx> #include <cppuhelper/implbase.hxx> #include <osl/mutex.hxx> #include <com/sun/star/container/XChild.hpp> @@ -59,7 +58,7 @@ class OBookmarkContainer final MapIteratorVector m_aBookmarksIndexed; // for index access to the ::cppu::OWeakObject& m_rParent; // for the ref counting - ::comphelper::OInterfaceContainerHelper2 + ::comphelper::OInterfaceContainerHelper3<css::container::XContainerListener> m_aContainerListeners; ::osl::Mutex& m_rMutex; @@ -79,8 +78,8 @@ public: virtual ~OBookmarkContainer() override; // css::uno::XInterface - virtual void SAL_CALL acquire( ) throw() override; - virtual void SAL_CALL release( ) throw() override; + virtual void SAL_CALL acquire( ) noexcept override; + virtual void SAL_CALL release( ) noexcept override; // css::lang::XServiceInfo virtual OUString SAL_CALL getImplementationName( ) override; @@ -146,6 +145,4 @@ inline bool OBookmarkContainer::checkExistence(const OUString& _rName) } // namespace dbaccess -#endif - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/core/inc/callablestatement.hxx b/dbaccess/source/core/inc/callablestatement.hxx index 9ca89317c5d8..58e21189aa59 100644 --- a/dbaccess/source/core/inc/callablestatement.hxx +++ b/dbaccess/source/core/inc/callablestatement.hxx @@ -16,8 +16,7 @@ * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_DBACCESS_SOURCE_CORE_INC_CALLABLESTATEMENT_HXX -#define INCLUDED_DBACCESS_SOURCE_CORE_INC_CALLABLESTATEMENT_HXX +#pragma once #include <com/sun/star/sdbc/XRow.hpp> #include <com/sun/star/sdbc/XOutParameters.hpp> @@ -43,8 +42,8 @@ namespace dbaccess // css::uno::XInterface virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override; - virtual void SAL_CALL acquire() throw() override; - virtual void SAL_CALL release() throw() override; + virtual void SAL_CALL acquire() noexcept override; + virtual void SAL_CALL release() noexcept override; // css::lang::XServiceInfo virtual OUString SAL_CALL getImplementationName( ) override; @@ -77,6 +76,5 @@ namespace dbaccess virtual css::uno::Reference< css::sdbc::XArray > SAL_CALL getArray( sal_Int32 columnIndex ) override; }; } -#endif // INCLUDED_DBACCESS_SOURCE_CORE_INC_CALLABLESTATEMENT_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/core/inc/column.hxx b/dbaccess/source/core/inc/column.hxx index 3744715c7d6f..eae96fba3fd6 100644 --- a/dbaccess/source/core/inc/column.hxx +++ b/dbaccess/source/core/inc/column.hxx @@ -17,8 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_DBACCESS_SOURCE_CORE_INC_COLUMN_HXX -#define INCLUDED_DBACCESS_SOURCE_CORE_INC_COLUMN_HXX +#pragma once #include "columnsettings.hxx" @@ -68,8 +67,8 @@ namespace dbaccess // css::uno::XInterface virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override; - virtual void SAL_CALL acquire() throw() override; - virtual void SAL_CALL release() throw() override; + virtual void SAL_CALL acquire() noexcept override; + virtual void SAL_CALL release() noexcept override; // css::beans::XPropertySet virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override; @@ -98,7 +97,7 @@ namespace dbaccess public: /** creates an OColumn object which should represent the column with a given name */ - virtual OColumn* + virtual rtl::Reference<OColumn> createColumn( const OUString& _rName ) const = 0; /** creates a column descriptor object. @@ -129,7 +128,6 @@ namespace dbaccess { OContainerMediator* m_pMediator; - protected: // comes from the driver can be null css::uno::Reference< css::container::XNameAccess > m_xDrvColumns; css::uno::WeakReference< css::uno::XInterface > m_xParent; @@ -140,6 +138,7 @@ namespace dbaccess bool m_bAddColumn : 1; bool m_bDropColumn : 1; + protected: virtual void impl_refresh() override; virtual connectivity::sdbcx::ObjectType createObject(const OUString& _rName) override; virtual css::uno::Reference< css::beans::XPropertySet > createDescriptor() override; @@ -179,7 +178,7 @@ namespace dbaccess OColumns( ::cppu::OWeakObject& _rParent, ::osl::Mutex& _rMutex, - const css::uno::Reference< css::container::XNameAccess >& _rxDrvColumns, + css::uno::Reference< css::container::XNameAccess > _xDrvColumns, bool _bCaseSensitive, const std::vector< OUString> &_rVector, IColumnFactory* _pColFactory, @@ -191,8 +190,8 @@ namespace dbaccess //XInterface virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override; - virtual void SAL_CALL acquire() throw() override { OColumns_BASE::acquire(); } - virtual void SAL_CALL release() throw() override { OColumns_BASE::release(); } + virtual void SAL_CALL acquire() noexcept override { OColumns_BASE::acquire(); } + virtual void SAL_CALL release() noexcept override { OColumns_BASE::release(); } //XTypeProvider virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override; @@ -214,6 +213,5 @@ namespace dbaccess using OColumns_BASE::setParent; }; } -#endif // INCLUDED_DBACCESS_SOURCE_CORE_INC_COLUMN_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/core/inc/columnsettings.hxx b/dbaccess/source/core/inc/columnsettings.hxx index 29a93effadf4..6b6c5d4c16ec 100644 --- a/dbaccess/source/core/inc/columnsettings.hxx +++ b/dbaccess/source/core/inc/columnsettings.hxx @@ -17,8 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_DBACCESS_SOURCE_CORE_INC_COLUMNSETTINGS_HXX -#define INCLUDED_DBACCESS_SOURCE_CORE_INC_COLUMNSETTINGS_HXX +#pragma once #include <com/sun/star/beans/XPropertySet.hpp> @@ -86,6 +85,4 @@ namespace dbaccess } // namespace dbaccess -#endif // INCLUDED_DBACCESS_SOURCE_CORE_INC_COLUMNSETTINGS_HXX - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/core/inc/commandbase.hxx b/dbaccess/source/core/inc/commandbase.hxx index 725e348760ef..1a0bd91d83d6 100644 --- a/dbaccess/source/core/inc/commandbase.hxx +++ b/dbaccess/source/core/inc/commandbase.hxx @@ -17,8 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_DBACCESS_SOURCE_CORE_INC_COMMANDBASE_HXX -#define INCLUDED_DBACCESS_SOURCE_CORE_INC_COMMANDBASE_HXX +#pragma once #include <com/sun/star/uno/Sequence.hxx> #include <com/sun/star/beans/PropertyValue.hpp> @@ -48,6 +47,4 @@ protected: } // namespace dbaccess -#endif // INCLUDED_DBACCESS_SOURCE_CORE_INC_COMMANDBASE_HXX - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/core/inc/composertools.hxx b/dbaccess/source/core/inc/composertools.hxx index d0bfdc3ff7d6..337064757300 100644 --- a/dbaccess/source/core/inc/composertools.hxx +++ b/dbaccess/source/core/inc/composertools.hxx @@ -17,8 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_DBACCESS_SOURCE_CORE_INC_COMPOSERTOOLS_HXX -#define INCLUDED_DBACCESS_SOURCE_CORE_INC_COMPOSERTOOLS_HXX +#pragma once #include <rtl/ustrbuf.hxx> #include <osl/diagnose.h> @@ -119,6 +118,4 @@ namespace dbaccess } // namespace dbaccess -#endif // INCLUDED_DBACCESS_SOURCE_CORE_INC_COMPOSERTOOLS_HXX - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/core/inc/containerapprove.hxx b/dbaccess/source/core/inc/containerapprove.hxx index d350470adac0..f780e224affd 100644 --- a/dbaccess/source/core/inc/containerapprove.hxx +++ b/dbaccess/source/core/inc/containerapprove.hxx @@ -17,8 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_DBACCESS_SOURCE_CORE_INC_CONTAINERAPPROVE_HXX -#define INCLUDED_DBACCESS_SOURCE_CORE_INC_CONTAINERAPPROVE_HXX +#pragma once #include <rtl/ustring.hxx> @@ -55,6 +54,4 @@ namespace dbaccess } // namespace dbaccess -#endif // INCLUDED_DBACCESS_SOURCE_CORE_INC_CONTAINERAPPROVE_HXX - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/core/inc/databasecontext.hxx b/dbaccess/source/core/inc/databasecontext.hxx index 0c1848042b26..d94df018d1c0 100644 --- a/dbaccess/source/core/inc/databasecontext.hxx +++ b/dbaccess/source/core/inc/databasecontext.hxx @@ -17,8 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_DBACCESS_SOURCE_CORE_INC_DATABASECONTEXT_HXX -#define INCLUDED_DBACCESS_SOURCE_CORE_INC_DATABASECONTEXT_HXX +#pragma once #include <sal/config.h> @@ -29,7 +28,6 @@ #include "ModelImpl.hxx" #include <com/sun/star/lang/XServiceInfo.hpp> -#include <com/sun/star/lang/XUnoTunnel.hpp> #include <com/sun/star/sdb/XDatabaseContext.hpp> #include <com/sun/star/sdb/XDatabaseRegistrations.hpp> #include <com/sun/star/uno/XAggregation.hpp> @@ -56,7 +54,6 @@ class DatabaseDocumentLoader; typedef ::cppu::WeakComponentImplHelper< css::lang::XServiceInfo , css::sdb::XDatabaseContext - , css::lang::XUnoTunnel > DatabaseAccessContext_Base; class ODatabaseContext :public DatabaseAccessContext_Base @@ -85,13 +82,10 @@ private: BasicDLL m_aBasicDLL; #endif -protected: ::osl::Mutex m_aMutex; css::uno::Reference< css::uno::XComponentContext > m_aContext; - css::uno::Reference< css::uno::XAggregation > - m_xDBRegistrationAggregate; css::uno::Reference< css::sdb::XDatabaseRegistrations > m_xDatabaseRegistrations; @@ -106,7 +100,7 @@ protected: // recreated afterwards. So it's our (the context's) responsibility to store the session-persistent // properties. - ::comphelper::OInterfaceContainerHelper2 m_aContainerListeners; + ::comphelper::OInterfaceContainerHelper3<css::container::XContainerListener> m_aContainerListeners; rtl::Reference<DatabaseDocumentLoader> m_xDatabaseDocumentLoader; public: @@ -125,14 +119,6 @@ public: virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override; virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override; - // XServiceInfo - static methods - /// @throws css::uno::RuntimeException - static css::uno::Sequence< OUString > getSupportedServiceNames_static(); - /// @throws css::uno::RuntimeException - static OUString getImplementationName_static(); - static css::uno::Reference< css::uno::XInterface > - Create(const css::uno::Reference< css::uno::XComponentContext >&); - // XElementAccess virtual css::uno::Type SAL_CALL getElementType( ) override; virtual sal_Bool SAL_CALL hasElements( ) override; @@ -165,10 +151,6 @@ public: virtual void SAL_CALL addContainerListener( const css::uno::Reference< css::container::XContainerListener >& xListener ) override; virtual void SAL_CALL removeContainerListener( const css::uno::Reference< css::container::XContainerListener >& xListener ) override; - // css::lang::XUnoTunnel - virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override; - static css::uno::Sequence< sal_Int8 > getUnoTunnelId(); - void registerDatabaseDocument( ODatabaseModelImpl& _rModelImpl); void revokeDatabaseDocument( const ODatabaseModelImpl& _rModelImpl); void databaseDocumentURLChange(const OUString& _sOldName, const OUString& _sNewName); @@ -186,6 +168,4 @@ private: } // namespace dbaccess -#endif - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/core/inc/datasettings.hxx b/dbaccess/source/core/inc/datasettings.hxx index 9b6a7f686434..8e24ebb714de 100644 --- a/dbaccess/source/core/inc/datasettings.hxx +++ b/dbaccess/source/core/inc/datasettings.hxx @@ -17,8 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_DBACCESS_SOURCE_CORE_INC_DATASETTINGS_HXX -#define INCLUDED_DBACCESS_SOURCE_CORE_INC_DATASETTINGS_HXX +#pragma once #include <com/sun/star/awt/FontDescriptor.hpp> #include <rtl/ustring.hxx> @@ -75,6 +74,4 @@ protected: } // namespace dbaccess -#endif // INCLUDED_DBACCESS_SOURCE_CORE_INC_DATASETTINGS_HXX - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/core/inc/definitioncolumn.hxx b/dbaccess/source/core/inc/definitioncolumn.hxx index 69d2c3c8490d..b4c0a5c081a6 100644 --- a/dbaccess/source/core/inc/definitioncolumn.hxx +++ b/dbaccess/source/core/inc/definitioncolumn.hxx @@ -16,8 +16,7 @@ * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_DBACCESS_SOURCE_CORE_INC_DEFINITIONCOLUMN_HXX -#define INCLUDED_DBACCESS_SOURCE_CORE_INC_DEFINITIONCOLUMN_HXX +#pragma once #include "column.hxx" #include "columnsettings.hxx" @@ -152,7 +151,7 @@ namespace dbaccess OQueryColumn( const css::uno::Reference< css::beans::XPropertySet>& _rxParserColumn, const css::uno::Reference< css::sdbc::XConnection >& _rxConnection, - const OUString &i_sLabel + OUString i_sLabel ); // XTypeProvider @@ -273,7 +272,7 @@ namespace dbaccess public: OTableColumnWrapper( const css::uno::Reference< css::beans::XPropertySet >& rCol, - const css::uno::Reference< css::beans::XPropertySet >& rColDefintion, + const css::uno::Reference< css::beans::XPropertySet >& rColDefinition, const bool _bPureWrap ); // css::lang::XTypeProvider @@ -288,6 +287,5 @@ namespace dbaccess virtual ::cppu::IPropertyArrayHelper* createArrayHelper(sal_Int32 nId) const override; }; } -#endif // INCLUDED_DBACCESS_SOURCE_CORE_INC_DEFINITIONCOLUMN_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/core/inc/definitioncontainer.hxx b/dbaccess/source/core/inc/definitioncontainer.hxx index 98a4c3f140a3..02f145776c8f 100644 --- a/dbaccess/source/core/inc/definitioncontainer.hxx +++ b/dbaccess/source/core/inc/definitioncontainer.hxx @@ -17,8 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_DBACCESS_SOURCE_CORE_INC_DEFINITIONCONTAINER_HXX -#define INCLUDED_DBACCESS_SOURCE_CORE_INC_DEFINITIONCONTAINER_HXX +#pragma once #include <sal/config.h> @@ -37,6 +36,7 @@ #include "ContentHelper.hxx" #include "containerapprove.hxx" #include <comphelper/uno3.hxx> +#include <comphelper/interfacecontainer2.hxx> namespace dbaccess { @@ -130,7 +130,7 @@ protected: with a new one), this new element must pass our own internal approval, plus the approval given here. */ - void setElementApproval( PContainerApprove _pElementApproval ) { m_pElementApproval = _pElementApproval; } + void setElementApproval(const PContainerApprove& _pElementApproval ) { m_pElementApproval = _pElementApproval; } const PContainerApprove& getElementApproval() const { return m_pElementApproval; } protected: @@ -320,6 +320,4 @@ private: } // namespace dbaccess -#endif // INCLUDED_DBACCESS_SOURCE_CORE_INC_DEFINITIONCONTAINER_HXX - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/core/inc/documentevents.hxx b/dbaccess/source/core/inc/documentevents.hxx index 9a04074a3c68..224fc407d2fe 100644 --- a/dbaccess/source/core/inc/documentevents.hxx +++ b/dbaccess/source/core/inc/documentevents.hxx @@ -17,15 +17,13 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_DBACCESS_SOURCE_CORE_INC_DOCUMENTEVENTS_HXX -#define INCLUDED_DBACCESS_SOURCE_CORE_INC_DOCUMENTEVENTS_HXX +#pragma once #include <com/sun/star/container/XNameReplace.hpp> #include <com/sun/star/beans/PropertyValue.hpp> #include <cppuhelper/implbase.hxx> -#include <memory> #include <map> namespace dbaccess @@ -34,9 +32,6 @@ namespace dbaccess typedef std::map< OUString, css::uno::Sequence< css::beans::PropertyValue > > DocumentEventsData; - // DocumentEvents - struct DocumentEvents_Data; - typedef ::cppu::WeakImplHelper< css::container::XNameReplace > DocumentEvents_Base; @@ -49,11 +44,11 @@ namespace dbaccess DocumentEvents(const DocumentEvents&) = delete; const DocumentEvents& operator=(const DocumentEvents&) = delete; - static bool needsSynchronousNotification( const OUString& _rEventName ); + static bool needsSynchronousNotification( std::u16string_view _rEventName ); // XInterface - virtual void SAL_CALL acquire() throw() override; - virtual void SAL_CALL release() throw() override; + virtual void SAL_CALL acquire() noexcept override; + virtual void SAL_CALL release() noexcept override; // XNameReplace virtual void SAL_CALL replaceByName( const OUString& aName, const css::uno::Any& aElement ) override; @@ -68,11 +63,11 @@ namespace dbaccess virtual sal_Bool SAL_CALL hasElements( ) override; private: - std::unique_ptr< DocumentEvents_Data > m_pData; + ::cppu::OWeakObject& mrParent; + ::osl::Mutex& mrMutex; + DocumentEventsData& mrEventsData; }; } // namespace dbaccess -#endif - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/core/inc/migrwarndlg.hxx b/dbaccess/source/core/inc/migrwarndlg.hxx index e01c2b9f0099..24bacf300101 100644 --- a/dbaccess/source/core/inc/migrwarndlg.hxx +++ b/dbaccess/source/core/inc/migrwarndlg.hxx @@ -6,8 +6,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#ifndef INCLUDED_DBACCESS_SOURCE_CORE_INC_WARNDLG_HXX -#define INCLUDED_DBACCESS_SOURCE_CORE_INC_WARNDLG_HXX +#pragma once #include <vcl/weld.hxx> @@ -22,6 +21,4 @@ public: }; } -#endif // INCLUDED_DBACCESS_SOURCE_CORE_INC_WARNDLG_HXX - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/core/inc/object.hxx b/dbaccess/source/core/inc/object.hxx deleted file mode 100644 index a6f08560941b..000000000000 --- a/dbaccess/source/core/inc/object.hxx +++ /dev/null @@ -1,33 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_DBACCESS_SOURCE_CORE_INC_OBJECT_HXX -#define INCLUDED_DBACCESS_SOURCE_CORE_INC_OBJECT_HXX - -enum ObjectType -{ - dbaTable, - dbaQuery, - dbaForm, - dbaReport -}; - -#endif // INCLUDED_DBACCESS_SOURCE_CORE_INC_OBJECT_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/core/inc/objectnameapproval.hxx b/dbaccess/source/core/inc/objectnameapproval.hxx index 6e0ce4577b03..e503c347ea4e 100644 --- a/dbaccess/source/core/inc/objectnameapproval.hxx +++ b/dbaccess/source/core/inc/objectnameapproval.hxx @@ -17,19 +17,17 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_DBACCESS_SOURCE_CORE_INC_OBJECTNAMEAPPROVAL_HXX -#define INCLUDED_DBACCESS_SOURCE_CORE_INC_OBJECTNAMEAPPROVAL_HXX +#pragma once #include <memory> #include "containerapprove.hxx" - +#include <cppuhelper/weakref.hxx> #include <com/sun/star/sdbc/XConnection.hpp> namespace dbaccess { // ObjectNameApproval - struct ObjectNameApproval_Impl; /** implementation of the IContainerApprove interface which approves elements for insertion into a query or tables container. @@ -41,7 +39,8 @@ namespace dbaccess */ class ObjectNameApproval : public IContainerApprove { - std::unique_ptr< ObjectNameApproval_Impl > m_pImpl; + css::uno::WeakReference< css::sdbc::XConnection > mxConnection; + sal_Int32 mnCommandType; public: enum ObjectType @@ -73,6 +72,4 @@ namespace dbaccess } // namespace dbaccess -#endif // INCLUDED_DBACCESS_SOURCE_CORE_INC_OBJECTNAMEAPPROVAL_HXX - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/core/inc/preparedstatement.hxx b/dbaccess/source/core/inc/preparedstatement.hxx index d8e0f5b6a7b5..cea06d79a81e 100644 --- a/dbaccess/source/core/inc/preparedstatement.hxx +++ b/dbaccess/source/core/inc/preparedstatement.hxx @@ -16,8 +16,7 @@ * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_DBACCESS_SOURCE_CORE_INC_PREPAREDSTATEMENT_HXX -#define INCLUDED_DBACCESS_SOURCE_CORE_INC_PREPAREDSTATEMENT_HXX +#pragma once #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/sdbc/XPreparedStatement.hpp> @@ -53,8 +52,8 @@ namespace dbaccess // css::uno::XInterface virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override; - virtual void SAL_CALL acquire() throw() override; - virtual void SAL_CALL release() throw() override; + virtual void SAL_CALL acquire() noexcept override; + virtual void SAL_CALL release() noexcept override; // css::lang::XServiceInfo virtual OUString SAL_CALL getImplementationName( ) override; @@ -102,6 +101,5 @@ namespace dbaccess virtual void SAL_CALL clearParameters( ) override; }; } -#endif // INCLUDED_DBACCESS_SOURCE_CORE_INC_PREPAREDSTATEMENT_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/core/inc/querycomposer.hxx b/dbaccess/source/core/inc/querycomposer.hxx index 1e5ef2ab07ec..c5d764d98cf8 100644 --- a/dbaccess/source/core/inc/querycomposer.hxx +++ b/dbaccess/source/core/inc/querycomposer.hxx @@ -16,8 +16,7 @@ * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_DBACCESS_SOURCE_CORE_INC_QUERYCOMPOSER_HXX -#define INCLUDED_DBACCESS_SOURCE_CORE_INC_QUERYCOMPOSER_HXX +#pragma once #include <com/sun/star/sdb/XSQLQueryComposer.hpp> #include <com/sun/star/sdb/XParametersSupplier.hpp> @@ -63,8 +62,8 @@ namespace dbaccess // css::uno::XInterface virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override; - virtual void SAL_CALL acquire() throw() override; - virtual void SAL_CALL release() throw() override; + virtual void SAL_CALL acquire() noexcept override; + virtual void SAL_CALL release() noexcept override; // XServiceInfo virtual OUString SAL_CALL getImplementationName( ) override; virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override; @@ -88,6 +87,5 @@ namespace dbaccess virtual css::uno::Reference< css::container::XIndexAccess > SAL_CALL getParameters( ) override; }; } -#endif // INCLUDED_DBACCESS_SOURCE_CORE_INC_QUERYCOMPOSER_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/core/inc/querycontainer.hxx b/dbaccess/source/core/inc/querycontainer.hxx index 0aeb806aed7c..a04a1ddf3d31 100644 --- a/dbaccess/source/core/inc/querycontainer.hxx +++ b/dbaccess/source/core/inc/querycontainer.hxx @@ -17,8 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_DBACCESS_SOURCE_CORE_INC_QUERYCONTAINER_HXX -#define INCLUDED_DBACCESS_SOURCE_CORE_INC_QUERYCONTAINER_HXX +#pragma once #include <cppuhelper/implbase5.hxx> #include <connectivity/CommonTools.hxx> @@ -163,6 +162,4 @@ namespace dbaccess }; } // namespace dbaccess -#endif // INCLUDED_DBACCESS_SOURCE_CORE_INC_QUERYCONTAINER_HXX - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/core/inc/recovery/dbdocrecovery.hxx b/dbaccess/source/core/inc/recovery/dbdocrecovery.hxx index c5dadce4549d..4f0f68d306c9 100644 --- a/dbaccess/source/core/inc/recovery/dbdocrecovery.hxx +++ b/dbaccess/source/core/inc/recovery/dbdocrecovery.hxx @@ -17,21 +17,18 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_DBACCESS_SOURCE_CORE_INC_RECOVERY_DBDOCRECOVERY_HXX -#define INCLUDED_DBACCESS_SOURCE_CORE_INC_RECOVERY_DBDOCRECOVERY_HXX +#pragma once #include <com/sun/star/embed/XStorage.hpp> #include <com/sun/star/frame/XController.hpp> #include <com/sun/star/uno/XComponentContext.hpp> #include <vector> -#include <memory> namespace dbaccess { // DatabaseDocumentRecovery - struct DatabaseDocumentRecovery_Data; class DatabaseDocumentRecovery { public: @@ -64,11 +61,9 @@ namespace dbaccess ); private: - const std::unique_ptr< DatabaseDocumentRecovery_Data > m_pData; + css::uno::Reference<css::uno::XComponentContext> mxContext; }; } // namespace dbaccess -#endif // INCLUDED_DBACCESS_SOURCE_CORE_INC_RECOVERY_DBDOCRECOVERY_HXX - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/core/inc/sdbcoretools.hxx b/dbaccess/source/core/inc/sdbcoretools.hxx index 41097c676f58..5b100dcf1783 100644 --- a/dbaccess/source/core/inc/sdbcoretools.hxx +++ b/dbaccess/source/core/inc/sdbcoretools.hxx @@ -17,8 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_DBACCESS_SOURCE_CORE_INC_SDBCORETOOLS_HXX -#define INCLUDED_DBACCESS_SOURCE_CORE_INC_SDBCORETOOLS_HXX +#pragma once #include <com/sun/star/embed/XStorage.hpp> #include <com/sun/star/uno/XComponentContext.hpp> @@ -53,6 +52,4 @@ namespace dbaccess } // namespace dbaccess -#endif // INCLUDED_DBACCESS_SOURCE_CORE_INC_SDBCORETOOLS_HXX - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/core/inc/statement.hxx b/dbaccess/source/core/inc/statement.hxx index 2024bb0de81e..f437040682fb 100644 --- a/dbaccess/source/core/inc/statement.hxx +++ b/dbaccess/source/core/inc/statement.hxx @@ -16,8 +16,7 @@ * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_DBACCESS_SOURCE_CORE_INC_STATEMENT_HXX -#define INCLUDED_DBACCESS_SOURCE_CORE_INC_STATEMENT_HXX +#pragma once #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/sdbc/XStatement.hpp> @@ -71,8 +70,8 @@ public: // css::uno::XInterface virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override; - virtual void SAL_CALL acquire() throw() override; - virtual void SAL_CALL release() throw() override; + virtual void SAL_CALL acquire() noexcept override; + virtual void SAL_CALL release() noexcept override; // OComponentHelper virtual void SAL_CALL disposing() override; @@ -177,6 +176,4 @@ private: bool impl_ensureComposer_nothrow() const; }; -#endif // INCLUDED_DBACCESS_SOURCE_CORE_INC_STATEMENT_HXX - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/core/inc/table.hxx b/dbaccess/source/core/inc/table.hxx index ec851f3b50d6..6c71e7447653 100644 --- a/dbaccess/source/core/inc/table.hxx +++ b/dbaccess/source/core/inc/table.hxx @@ -17,8 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_DBACCESS_SOURCE_CORE_INC_TABLE_HXX -#define INCLUDED_DBACCESS_SOURCE_CORE_INC_TABLE_HXX +#pragma once #include <com/sun/star/sdbc/XConnection.hpp> @@ -45,7 +44,6 @@ namespace dbaccess private: ::rtl::Reference< OContainerMediator > m_pColumnMediator; - protected: css::uno::Reference< css::container::XNameAccess > m_xColumnDefinitions; css::uno::Reference< css::container::XNameAccess > m_xDriverColumns; @@ -53,11 +51,12 @@ namespace dbaccess sal_Int32 m_nPrivileges; // </properties> + protected: virtual ::cppu::IPropertyArrayHelper* createArrayHelper( sal_Int32 _nId) const override; virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper() override; // IColumnFactory - virtual OColumn* createColumn(const OUString& _rName) const override; + virtual rtl::Reference<OColumn> createColumn(const OUString& _rName) const override; virtual css::uno::Reference< css::beans::XPropertySet > createColumnDescriptor() override; virtual void columnAppended( const css::uno::Reference< css::beans::XPropertySet >& _rxSourceDescriptor ) override; virtual void columnDropped(const OUString& _sName) override; @@ -115,7 +114,6 @@ namespace dbaccess //XTypeProvider virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override; virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override; - static css::uno::Sequence< sal_Int8 > getUnoTunnelId(); // css::lang::XServiceInfo DECLARE_SERVICE_INFO(); @@ -129,14 +127,10 @@ namespace dbaccess // css::sdbcx::XAlterTable, virtual void SAL_CALL alterColumnByName( const OUString& _rName, const css::uno::Reference< css::beans::XPropertySet >& _rxDescriptor ) override; - // css::lang::XUnoTunnel - virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override; - private: using OTable_Base::createArrayHelper; using OTable_Base::getFastPropertyValue; }; } -#endif // INCLUDED_DBACCESS_SOURCE_CORE_INC_TABLE_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/core/inc/tablecontainer.hxx b/dbaccess/source/core/inc/tablecontainer.hxx index bc5a38818104..44358e4e20e2 100644 --- a/dbaccess/source/core/inc/tablecontainer.hxx +++ b/dbaccess/source/core/inc/tablecontainer.hxx @@ -17,8 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_DBACCESS_SOURCE_CORE_INC_TABLECONTAINER_HXX -#define INCLUDED_DBACCESS_SOURCE_CORE_INC_TABLECONTAINER_HXX +#pragma once #include <sal/config.h> @@ -69,8 +68,8 @@ namespace dbaccess virtual void SAL_CALL elementReplaced( const css::container::ContainerEvent& Event ) override; public: - virtual void SAL_CALL acquire() throw() override { OFilteredContainer::acquire();} - virtual void SAL_CALL release() throw() override { OFilteredContainer::release();} + virtual void SAL_CALL acquire() noexcept override { OFilteredContainer::acquire();} + virtual void SAL_CALL release() noexcept override { OFilteredContainer::release();} /** ctor of the container. The parent has to support the <type scope="css::sdbc">XConnection</type> interface.<BR> @@ -93,6 +92,5 @@ namespace dbaccess virtual ~OTableContainer() override; }; } -#endif // INCLUDED_DBACCESS_SOURCE_CORE_INC_TABLECONTAINER_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/core/inc/veto.hxx b/dbaccess/source/core/inc/veto.hxx index 63a0748b24af..ec44172f70d4 100644 --- a/dbaccess/source/core/inc/veto.hxx +++ b/dbaccess/source/core/inc/veto.hxx @@ -17,8 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_DBACCESS_SOURCE_CORE_INC_VETO_HXX -#define INCLUDED_DBACCESS_SOURCE_CORE_INC_VETO_HXX +#pragma once #include <com/sun/star/util/XVeto.hpp> @@ -38,7 +37,7 @@ namespace dbaccess const css::uno::Any m_aDetails; public: - Veto( const css::uno::Any& _rDetails ); + Veto( css::uno::Any _aDetails ); virtual OUString SAL_CALL getReason() override; virtual css::uno::Any SAL_CALL getDetails() override; @@ -53,6 +52,4 @@ namespace dbaccess } // namespace dbaccess -#endif // INCLUDED_DBACCESS_SOURCE_CORE_INC_VETO_HXX - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/core/inc/viewcontainer.hxx b/dbaccess/source/core/inc/viewcontainer.hxx index 12d7f74805fb..2f7f48cec155 100644 --- a/dbaccess/source/core/inc/viewcontainer.hxx +++ b/dbaccess/source/core/inc/viewcontainer.hxx @@ -17,8 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_DBACCESS_SOURCE_CORE_INC_VIEWCONTAINER_HXX -#define INCLUDED_DBACCESS_SOURCE_CORE_INC_VIEWCONTAINER_HXX +#pragma once #include <sal/config.h> @@ -68,8 +67,8 @@ namespace dbaccess virtual OUString getTableTypeRestriction() const override; private: - virtual void SAL_CALL acquire() throw() override { OFilteredContainer::acquire();} - virtual void SAL_CALL release() throw() override { OFilteredContainer::release();} + virtual void SAL_CALL acquire() noexcept override { OFilteredContainer::acquire();} + virtual void SAL_CALL release() noexcept override { OFilteredContainer::release();} // css::lang::XServiceInfo DECLARE_SERVICE_INFO(); @@ -91,6 +90,5 @@ namespace dbaccess bool m_bInElementRemoved; }; } -#endif // INCLUDED_DBACCESS_SOURCE_CORE_INC_VIEWCONTAINER_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |