diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-07-26 16:01:25 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-07-27 14:32:52 +0200 |
commit | 48383d59f49d00dc27797d58472c90382c2244f7 (patch) | |
tree | 2a0ecba08c0cf68e164126a43911761dcee5c0a7 /include | |
parent | 71123e5749879ecf5cb7458df10be60c16255279 (diff) |
simplify SvtViewOptions
Change-Id: Ib1f42d7322d105337554848bc40726be00533843
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119548
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include')
-rw-r--r-- | include/unotools/itemholderbase.hxx | 5 | ||||
-rw-r--r-- | include/unotools/viewoptions.hxx | 56 |
2 files changed, 10 insertions, 51 deletions
diff --git a/include/unotools/itemholderbase.hxx b/include/unotools/itemholderbase.hxx index b7a8a7bbc825..0815a4c20c32 100644 --- a/include/unotools/itemholderbase.hxx +++ b/include/unotools/itemholderbase.hxx @@ -53,11 +53,6 @@ enum class EItem SysLocaleOptions , // 2 UserOptions , // 2 - - ViewOptionsDialog , - ViewOptionsTabDialog , - ViewOptionsTabPage , - ViewOptionsWindow }; struct TItemInfo diff --git a/include/unotools/viewoptions.hxx b/include/unotools/viewoptions.hxx index c4e6a38e5e79..46f3ea326860 100644 --- a/include/unotools/viewoptions.hxx +++ b/include/unotools/viewoptions.hxx @@ -26,9 +26,7 @@ #include <unotools/options.hxx> namespace com::sun::star::beans { struct NamedValue; } -namespace osl { class Mutex; } - -class SvtViewOptionsBase_Impl; +namespace com::sun::star::container { class XNameAccess; } /*-************************************************************************************************************ @descr Use these enum values to specify right list in configuration in which your view data are saved. @@ -94,7 +92,7 @@ enum class EViewType @devstatus ready to use *//*-*************************************************************************************************************/ -class SAL_WARN_UNUSED UNOTOOLS_DLLPUBLIC SvtViewOptions final : public utl::detail::Options +class SAL_WARN_UNUSED UNOTOOLS_DLLPUBLIC SvtViewOptions final { // public methods @@ -118,15 +116,6 @@ class SAL_WARN_UNUSED UNOTOOLS_DLLPUBLIC SvtViewOptions final : public utl::deta SvtViewOptions( EViewType eType , const OUString& sViewName ); - virtual ~SvtViewOptions() override; - - /*-**************************************************************************************************** - @short support preload of these config item - @descr Sometimes we need preloading of these configuration data without real using of it. - *//*-*****************************************************************************************************/ - - static void AcquireOptions(); - static void ReleaseOptions(); // interface @@ -174,7 +163,7 @@ class SAL_WARN_UNUSED UNOTOOLS_DLLPUBLIC SvtViewOptions final : public utl::deta *//*-*****************************************************************************************************/ OString GetPageID() const; - void SetPageID(const OString& rID); + void SetPageID(std::string_view rID); /*-**************************************************************************************************** @short use it to set/get the visual state of a window @@ -214,46 +203,21 @@ class SAL_WARN_UNUSED UNOTOOLS_DLLPUBLIC SvtViewOptions final : public utl::deta void SetUserItem( const OUString& sName , const css::uno::Any& aValue ); - // private methods - private: + enum State { STATE_NONE, STATE_FALSE, STATE_TRUE }; - /*-**************************************************************************************************** - @short return a reference to a static mutex - @descr These class is threadsafe. - We create a static mutex only for one time and use it to protect our refcount and container - member! - @return A reference to a static mutex member. - *//*-*****************************************************************************************************/ - - UNOTOOLS_DLLPRIVATE static ::osl::Mutex& GetOwnStaticMutex(); - - // private member - - private: + css::uno::Reference< css::uno::XInterface > impl_getSetNode( const OUString& sNode , + bool bCreateIfMissing) const; + State GetVisible() const; /// specify which list of views in configuration is used! This can't be a static value!!! /// ... because we need this value to work with right static data container. EViewType m_eViewType; OUString m_sViewName; - /*Attention - - Don't initialize these static members in these headers! - a) Double defined symbols will be detected ... - b) and unresolved externals exist at linking time. - Do it in your source only. - */ - - static SvtViewOptionsBase_Impl* m_pDataContainer_Dialogs; /// hold data for all dialogs - static sal_Int32 m_nRefCount_Dialogs; - static SvtViewOptionsBase_Impl* m_pDataContainer_TabDialogs; /// hold data for all tab-dialogs - static sal_Int32 m_nRefCount_TabDialogs; - static SvtViewOptionsBase_Impl* m_pDataContainer_TabPages; /// hold data for all tab-pages - static sal_Int32 m_nRefCount_TabPages; - static SvtViewOptionsBase_Impl* m_pDataContainer_Windows; /// hold data for all windows - static sal_Int32 m_nRefCount_Windows; - + OUString m_sListName; + css::uno::Reference< css::container::XNameAccess > m_xRoot; + css::uno::Reference< css::container::XNameAccess > m_xSet; }; // class SvtViewOptions #endif // INCLUDED_UNOTOOLS_VIEWOPTIONS_HXX |