diff options
Diffstat (limited to 'basic/source/inc/namecont.hxx')
-rw-r--r-- | basic/source/inc/namecont.hxx | 62 |
1 files changed, 42 insertions, 20 deletions
diff --git a/basic/source/inc/namecont.hxx b/basic/source/inc/namecont.hxx index 5635c91144e0..4db38ac881a4 100644 --- a/basic/source/inc/namecont.hxx +++ b/basic/source/inc/namecont.hxx @@ -37,32 +37,34 @@ #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/frame/XModel.hpp> #include <com/sun/star/deployment/XPackage.hpp> +#include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/script/vba/XVBACompatibility.hpp> #include <com/sun/star/script/vba/XVBAScriptListener.hpp> #include <com/sun/star/util/XChangesNotifier.hpp> #include <osl/mutex.hxx> #include <unotools/eventlisteneradapter.hxx> +#include <comphelper/compbase.hxx> #include <cppuhelper/implbase.hxx> #include <cppuhelper/compbase.hxx> #include <cppuhelper/weakref.hxx> -#include <cppuhelper/component.hxx> #include <cppuhelper/basemutex.hxx> #include <rtl/ref.hxx> #include <comphelper/interfacecontainer3.hxx> +#include <comphelper/interfacecontainer4.hxx> #include <xmlscript/xmllib_imexp.hxx> class BasicManager; namespace basic { -typedef ::cppu::WeakImplHelper< +typedef ::comphelper::WeakImplHelper< css::container::XNameContainer, css::container::XContainer, css::util::XChangesNotifier > NameContainer_BASE; -class NameContainer final : public ::cppu::BaseMutex, public NameContainer_BASE +class NameContainer final : public NameContainer_BASE { typedef std::unordered_map < OUString, sal_Int32 > NameContainerNameMap; @@ -74,16 +76,14 @@ class NameContainer final : public ::cppu::BaseMutex, public NameContainer_BASE css::uno::Type mType; css::uno::XInterface* mpxEventSource; - ::comphelper::OInterfaceContainerHelper3<css::container::XContainerListener> maContainerListeners; - ::comphelper::OInterfaceContainerHelper3<css::util::XChangesListener> maChangesListeners; + ::comphelper::OInterfaceContainerHelper4<css::container::XContainerListener> maContainerListeners; + ::comphelper::OInterfaceContainerHelper4<css::util::XChangesListener> maChangesListeners; public: NameContainer( const css::uno::Type& rType ) : mnElementCount( 0 ) , mType( rType ) , mpxEventSource( nullptr ) - , maContainerListeners( m_aMutex ) - , maChangesListeners( m_aMutex ) {} void setEventSource( css::uno::XInterface* pxEventSource ) @@ -170,7 +170,8 @@ typedef ::cppu::WeakComponentImplHelper< css::container::XContainer, css::script::XLibraryQueryExecutable, css::script::vba::XVBACompatibility, - css::lang::XServiceInfo > SfxLibraryContainer_BASE; + css::lang::XServiceInfo, + css::beans::XPropertySet> SfxLibraryContainer_BASE; class SfxLibraryContainer : public ::cppu::BaseMutex @@ -181,6 +182,7 @@ class SfxLibraryContainer sal_Int32 mnRunningVBAScripts; bool mbVBACompat; OUString msProjectName; + rtl_TextEncoding meVBATextEncoding; protected: css::uno::Reference< css::uno::XComponentContext > mxContext; css::uno::Reference< css::ucb::XSimpleFileAccess3 > mxSFI; @@ -221,7 +223,7 @@ protected: void implStoreLibrary( SfxLibrary* pLib, std::u16string_view rName, const css::uno::Reference< css::embed::XStorage >& rStorage, - const OUString& rTargetURL, + std::u16string_view rTargetURL, const css::uno::Reference< css::ucb::XSimpleFileAccess3 >& rToUseSFI, const css::uno::Reference< css::task::XInteractionHandler >& rHandler ); @@ -231,7 +233,7 @@ protected: // New variant for library export void implStoreLibraryIndexFile( SfxLibrary* pLib, const ::xmlscript::LibDescriptor& rLib, const css::uno::Reference< css::embed::XStorage >& xStorage, - const OUString& aTargetURL, + std::u16string_view aTargetURL, const css::uno::Reference< css::ucb::XSimpleFileAccess3 >& rToUseSFI ); bool implLoadLibraryIndexFile( SfxLibrary* pLib, @@ -294,10 +296,10 @@ protected: void init( const OUString& rInitialDocumentURL, const css::uno::Reference< css::embed::XStorage >& _rxInitialStorage ); - virtual const char* getInfoFileName() const = 0; - virtual const char* getOldInfoFileName() const = 0; - virtual const char* getLibElementFileExtension() const = 0; - virtual const char* getLibrariesDir() const = 0; + virtual OUString getInfoFileName() const = 0; + virtual OUString getOldInfoFileName() const = 0; + virtual OUString getLibElementFileExtension() const = 0; + virtual OUString getLibrariesDir() const = 0; // Handle maLibInfoFileURL and maStorageURL correctly void checkStorageURL @@ -328,6 +330,7 @@ private: void init_Impl( const OUString& rInitialDocumentURL, const css::uno::Reference< css::embed::XStorage >& _rxInitialStorage ); void implScanExtensions(); + static constexpr OUString sVBATextEncodingPropName = u"VBATextEncoding"_ustr; public: SfxLibraryContainer(); @@ -423,6 +426,26 @@ public: virtual void SAL_CALL removeVBAScriptListener( const css::uno::Reference< css::script::vba::XVBAScriptListener >& Listener ) override; virtual void SAL_CALL broadcastVBAScriptEvent( sal_Int32 nIdentifier, const OUString& rModuleName ) override; + + // css::beans::XPropertySet + virtual css::uno::Reference<css::beans::XPropertySetInfo> + SAL_CALL getPropertySetInfo() override; + virtual void SAL_CALL setPropertyValue(const OUString& aPropertyName, + const css::uno::Any& aValue) override; + virtual css::uno::Any SAL_CALL getPropertyValue(const OUString& PropertyName) override; + virtual void SAL_CALL addPropertyChangeListener( + const OUString& aPropertyName, + const css::uno::Reference<css::beans::XPropertyChangeListener>& xListener) override; + virtual void SAL_CALL removePropertyChangeListener( + const OUString& aPropertyName, + const css::uno::Reference<css::beans::XPropertyChangeListener>& aListener) override; + virtual void SAL_CALL addVetoableChangeListener( + const OUString& PropertyName, + const css::uno::Reference<css::beans::XVetoableChangeListener>& aListener) override; + virtual void SAL_CALL removeVetoableChangeListener( + const OUString& PropertyName, + const css::uno::Reference<css::beans::XVetoableChangeListener>& aListener) override; + }; @@ -445,8 +468,7 @@ class SfxLibrary : public css::container::XNameContainer , public css::container::XContainer , public css::util::XChangesNotifier - , public ::cppu::BaseMutex - , public ::cppu::OComponentHelper + , public ::comphelper::WeakComponentImplHelper<> { friend class SfxLibraryContainer; friend class SfxDialogLibraryContainer; @@ -519,15 +541,15 @@ public: ModifiableHelper& _rModifiable, const css::uno::Type& aType, const css::uno::Reference< css::ucb::XSimpleFileAccess3 >& xSFI, - const OUString& aLibInfoFileURL, - const OUString& aStorageURL, + OUString aLibInfoFileURL, + OUString aStorageURL, bool ReadOnly ); // Methods XInterface virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& rType ) override; - virtual void SAL_CALL acquire() noexcept override { OComponentHelper::acquire(); } - virtual void SAL_CALL release() noexcept override { OComponentHelper::release(); } + virtual void SAL_CALL acquire() noexcept override { WeakComponentImplHelper::acquire(); } + virtual void SAL_CALL release() noexcept override { WeakComponentImplHelper::release(); } // Methods XElementAccess virtual css::uno::Type SAL_CALL getElementType( ) override; |