[Libreoffice-commits] core.git: include/sfx2 sfx2/inc sfx2/source

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Tue Aug 27 13:58:56 UTC 2019


 include/sfx2/app.hxx                          |    2 +-
 include/sfx2/brokenpackageint.hxx             |    2 +-
 include/sfx2/checkin.hxx                      |    4 ++--
 include/sfx2/childwin.hxx                     |    6 +++---
 include/sfx2/classificationhelper.hxx         |    8 ++++----
 include/sfx2/dinfdlg.hxx                      |    4 ++--
 include/sfx2/docfile.hxx                      |   10 +++++-----
 include/sfx2/emojicontrol.hxx                 |    2 +-
 include/sfx2/ipclient.hxx                     |    2 +-
 include/sfx2/notebookbar/SfxNotebookBar.hxx   |    2 +-
 include/sfx2/objsh.hxx                        |   18 +++++++++---------
 include/sfx2/opengrf.hxx                      |    2 +-
 include/sfx2/sfxbasecontroller.hxx            |    4 ++--
 include/sfx2/sfxbasemodel.hxx                 |    2 +-
 include/sfx2/sidebar/SidebarController.hxx    |    2 +-
 include/sfx2/sidebar/TitleBar.hxx             |    2 +-
 include/sfx2/tabdlg.hxx                       |    4 ++--
 include/sfx2/templatedlg.hxx                  |    2 +-
 include/sfx2/viewsh.hxx                       |    6 +++---
 sfx2/inc/SfxRedactionHelper.hxx               |   19 ++++++++++---------
 sfx2/inc/autoredactdialog.hxx                 |    2 +-
 sfx2/source/appl/app.cxx                      |    2 +-
 sfx2/source/appl/appuno.cxx                   |    6 +++---
 sfx2/source/appl/childwin.cxx                 |    4 ++--
 sfx2/source/appl/opengrf.cxx                  |    2 +-
 sfx2/source/appl/sfxpicklist.cxx              |    4 ++--
 sfx2/source/appl/workwin.cxx                  |    4 ++--
 sfx2/source/control/emojicontrol.cxx          |    2 +-
 sfx2/source/dialog/checkin.cxx                |    4 ++--
 sfx2/source/dialog/dinfdlg.cxx                |    4 ++--
 sfx2/source/dialog/tabdlg.cxx                 |    2 +-
 sfx2/source/dialog/templdlg.cxx               |    4 ++--
 sfx2/source/doc/SfxRedactionHelper.cxx        |   18 +++++++++---------
 sfx2/source/doc/autoredactdialog.cxx          |    4 ++--
 sfx2/source/doc/docfile.cxx                   |   12 ++++++------
 sfx2/source/doc/doctempl.cxx                  |    2 +-
 sfx2/source/doc/doctemplateslocal.cxx         |    2 +-
 sfx2/source/doc/doctemplateslocal.hxx         |    2 +-
 sfx2/source/doc/guisaveas.cxx                 |    4 ++--
 sfx2/source/doc/objcont.cxx                   |    4 ++--
 sfx2/source/doc/objmisc.cxx                   |   10 +++++-----
 sfx2/source/doc/objserv.cxx                   |    6 +++---
 sfx2/source/doc/objxtor.cxx                   |    2 +-
 sfx2/source/doc/sfxbasemodel.cxx              |    2 +-
 sfx2/source/doc/templatedlg.cxx               |    2 +-
 sfx2/source/inc/fltoptint.hxx                 |    2 +-
 sfx2/source/inc/workwin.hxx                   |    4 ++--
 sfx2/source/notebookbar/SfxNotebookBar.cxx    |    2 +-
 sfx2/source/view/classificationcontroller.cxx |    6 +++---
 sfx2/source/view/classificationhelper.cxx     |    8 ++++----
 sfx2/source/view/ipclient.cxx                 |    2 +-
 sfx2/source/view/sfxbasecontroller.cxx        |    4 ++--
 sfx2/source/view/viewsh.cxx                   |    6 +++---
 53 files changed, 124 insertions(+), 123 deletions(-)

New commits:
commit df905f41a33d0d7d2cde7fad80c5b3dc3c837c10
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Tue Aug 27 13:51:50 2019 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Tue Aug 27 15:57:17 2019 +0200

    loplugin:constmethod in sfx2
    
    Change-Id: Ic129a8e136dc3f3b0a36fdb83e7aa71027ada59a
    Reviewed-on: https://gerrit.libreoffice.org/78190
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/include/sfx2/app.hxx b/include/sfx2/app.hxx
index e3517d3d64db..1dbd14eaac99 100644
--- a/include/sfx2/app.hxx
+++ b/include/sfx2/app.hxx
@@ -146,7 +146,7 @@ public:
     // Basic/Scripting
     static bool                 IsXScriptURL( const OUString& rScriptURL );
     static OUString             ChooseScript(weld::Window *pParent);
-    static void                 MacroOrganizer(weld::Window* pParent, sal_Int16 nTabId);
+    static void                 MacroOrganizer(const weld::Window* pParent, sal_Int16 nTabId);
     static ErrCode              CallBasic( const OUString&, BasicManager*, SbxArray *pArgs, SbxValue *pRet );
     static ErrCode              CallAppBasic( const OUString& i_macroName )
                                 { return CallBasic( i_macroName, SfxApplication::GetBasicManager(), nullptr, nullptr ); }
diff --git a/include/sfx2/brokenpackageint.hxx b/include/sfx2/brokenpackageint.hxx
index 5d822cba0084..8f6b4a580340 100644
--- a/include/sfx2/brokenpackageint.hxx
+++ b/include/sfx2/brokenpackageint.hxx
@@ -37,7 +37,7 @@ public:
     ~RequestPackageReparation();
     RequestPackageReparation( const RequestPackageReparation&) = delete;
     RequestPackageReparation& operator=( const RequestPackageReparation&) = delete;
-    bool    isApproved();
+    bool    isApproved() const;
     css::uno::Reference < css::task::XInteractionRequest > GetRequest();
 };
 
diff --git a/include/sfx2/checkin.hxx b/include/sfx2/checkin.hxx
index 054c82cd7a7d..15840ade2550 100644
--- a/include/sfx2/checkin.hxx
+++ b/include/sfx2/checkin.hxx
@@ -24,8 +24,8 @@ public:
     SfxCheckinDialog(weld::Window* pParent);
     virtual ~SfxCheckinDialog() override;
 
-    OUString GetComment();
-    bool IsMajor();
+    OUString GetComment() const;
+    bool IsMajor() const;
 };
 
 #endif
diff --git a/include/sfx2/childwin.hxx b/include/sfx2/childwin.hxx
index 63abda89d932..60eb83261d49 100644
--- a/include/sfx2/childwin.hxx
+++ b/include/sfx2/childwin.hxx
@@ -171,8 +171,8 @@ public:
     void                SetAlignment(SfxChildAlignment eAlign);
     virtual void        Hide();
     virtual void        Show( ShowFlags nFlags );
-    sal_uInt16          GetPosition();
-    sal_uInt16          GetType()
+    sal_uInt16          GetPosition() const;
+    sal_uInt16          GetType() const
                         { return nType; }
 
     void                CreateContext( sal_uInt16 nContextId, SfxBindings& );
@@ -197,7 +197,7 @@ public:
     bool                WantsFocus() const;
 
     virtual bool        QueryClose();
-    const css::uno::Reference< css::frame::XFrame >&   GetFrame();
+    const css::uno::Reference< css::frame::XFrame >&   GetFrame() const;
     void                SetFrame( const css::uno::Reference< css::frame::XFrame > & );
 
     SAL_DLLPRIVATE static void InitializeChildWinFactory_Impl(sal_uInt16, SfxChildWinInfo&);
diff --git a/include/sfx2/classificationhelper.hxx b/include/sfx2/classificationhelper.hxx
index 3f8c2d0b997c..b372c8df20fd 100644
--- a/include/sfx2/classificationhelper.hxx
+++ b/include/sfx2/classificationhelper.hxx
@@ -56,7 +56,7 @@ public:
     SfxClassificationHelper(const css::uno::Reference<css::document::XDocumentProperties>& xDocumentProperties, bool bUseLocalizedPolicy = true);
     ~SfxClassificationHelper();
     /// Get the currently selected category for eType.
-    const OUString& GetBACName(SfxClassificationPolicyType eType);
+    const OUString& GetBACName(SfxClassificationPolicyType eType) const;
     /// Return all possible valid category names, based on the policy.
     std::vector<OUString> GetBACNames();
     /// Return all possible valid category identifiers, based on the policy.
@@ -85,9 +85,9 @@ public:
     bool HasDocumentFooter();
     void UpdateInfobar(SfxViewFrame& rViewFrame);
 
-    std::vector<OUString> const & GetMarkings();
-    std::vector<OUString> const & GetIntellectualPropertyParts();
-    std::vector<OUString> const & GetIntellectualPropertyPartNumbers();
+    std::vector<OUString> const & GetMarkings() const;
+    std::vector<OUString> const & GetIntellectualPropertyParts() const;
+    std::vector<OUString> const & GetIntellectualPropertyPartNumbers() const;
 
     /// Does a best-effort conversion of rType to SfxClassificationPolicyType.
     static SfxClassificationPolicyType stringToPolicyType(const OUString& rType);
diff --git a/include/sfx2/dinfdlg.hxx b/include/sfx2/dinfdlg.hxx
index 8d51697334e8..87f83f339416 100644
--- a/include/sfx2/dinfdlg.hxx
+++ b/include/sfx2/dinfdlg.hxx
@@ -340,7 +340,7 @@ struct CustomPropertyLine
     DECL_LINK(EditLoseFocusHdl, weld::Widget&, void);
     DECL_LINK(BoxLoseFocusHdl, weld::Widget&, void);
 
-    void DoTypeHdl(weld::ComboBox& rBox);
+    void DoTypeHdl(const weld::ComboBox& rBox);
 
     void Clear();
     void Hide();
@@ -401,7 +401,7 @@ public:
 
     void                BoxLoseFocus(CustomPropertyLine* pLine);
     void                EditLoseFocus(CustomPropertyLine* pLine);
-    void                Remove(CustomPropertyLine* pLine);
+    void                Remove(const CustomPropertyLine* pLine);
 };
 
 // class CustomPropertiesControl -----------------------------------------
diff --git a/include/sfx2/docfile.hxx b/include/sfx2/docfile.hxx
index c5fc22c511bb..cc984157e5c1 100644
--- a/include/sfx2/docfile.hxx
+++ b/include/sfx2/docfile.hxx
@@ -142,7 +142,7 @@ public:
     ErrCode             GetErrorCode() const;
     ErrCode             GetError() const
                         { return GetErrorCode().IgnoreWarning(); }
-    ErrCode const &     GetLastStorageCreationState();
+    ErrCode const &     GetLastStorageCreationState() const;
 
     void                SetError(ErrCode nError);
 
@@ -203,8 +203,8 @@ public:
 
     OUString            GetBaseURL( bool bForSaving=false );
     void                SetInCheckIn( bool bInCheckIn );
-    bool                IsInCheckIn( );
-    bool                IsSkipImages( );
+    bool                IsInCheckIn( ) const;
+    bool                IsSkipImages( ) const;
 
     SAL_DLLPRIVATE bool HasStorage_Impl() const;
 
@@ -238,7 +238,7 @@ public:
 
     SAL_DLLPRIVATE void SetLongName(const OUString &rName);
     SAL_DLLPRIVATE const OUString & GetLongName() const;
-    SAL_DLLPRIVATE bool IsPreview_Impl();
+    SAL_DLLPRIVATE bool IsPreview_Impl() const;
     SAL_DLLPRIVATE void ClearBackup_Impl();
     SAL_DLLPRIVATE void SetPhysicalName_Impl(const OUString& rName);
     SAL_DLLPRIVATE void CanDisposeStorage_Impl( bool bDisposeStorage );
@@ -279,7 +279,7 @@ public:
     // the following two methods must be used and make sense only during saving currently
     // TODO/LATER: in future the signature state should be controlled by the medium not by the document
     //             in this case the methods will be used generally, and might need to be renamed
-    SAL_DLLPRIVATE SignatureState GetCachedSignatureState_Impl();
+    SAL_DLLPRIVATE SignatureState GetCachedSignatureState_Impl() const;
     SAL_DLLPRIVATE void       SetCachedSignatureState_Impl( SignatureState nState );
 
     void SetHasEmbeddedObjects(bool bHasEmbeddedObjects);
diff --git a/include/sfx2/emojicontrol.hxx b/include/sfx2/emojicontrol.hxx
index 132fe247b774..1b5c956735d9 100644
--- a/include/sfx2/emojicontrol.hxx
+++ b/include/sfx2/emojicontrol.hxx
@@ -37,7 +37,7 @@ private:
     void ConvertLabelToUnicode(sal_uInt16 nPageId);
 
     /// Return filter according to the currently selected tab page.
-    FILTER_CATEGORY getCurrentFilter();
+    FILTER_CATEGORY getCurrentFilter() const;
 
     DECL_LINK(ActivatePageHdl, TabControl*, void);
     DECL_STATIC_LINK(SfxEmojiControl, InsertHdl, ThumbnailViewItem*, void);
diff --git a/include/sfx2/ipclient.hxx b/include/sfx2/ipclient.hxx
index eb4c2c825651..62c421c3c783 100644
--- a/include/sfx2/ipclient.hxx
+++ b/include/sfx2/ipclient.hxx
@@ -84,7 +84,7 @@ public:
     ErrCode             DoVerb( long nVerb );
     void                VisAreaChanged();
     void                ResetObject();
-    bool                IsUIActive();
+    bool                IsUIActive() const;
 
     virtual void        FormatChanged(); // object format was changed (used for StarMath formulas aligning)
 };
diff --git a/include/sfx2/notebookbar/SfxNotebookBar.hxx b/include/sfx2/notebookbar/SfxNotebookBar.hxx
index 2a30a126beaf..1a3babd53d9e 100644
--- a/include/sfx2/notebookbar/SfxNotebookBar.hxx
+++ b/include/sfx2/notebookbar/SfxNotebookBar.hxx
@@ -54,7 +54,7 @@ public:
     /** Show menu bar only in current frame */
     static void ShowMenubar(SfxViewFrame const * pViewFrame, bool bShow);
     static void ToggleMenubar();
-    static void ReloadNotebookBar(OUString& sUIPath);
+    static void ReloadNotebookBar(const OUString& sUIPath);
 
 private:
     static bool m_bLock;
diff --git a/include/sfx2/objsh.hxx b/include/sfx2/objsh.hxx
index 3cdf402cc188..a25d60aa2db1 100644
--- a/include/sfx2/objsh.hxx
+++ b/include/sfx2/objsh.hxx
@@ -248,7 +248,7 @@ public:
     virtual SfxObjectFactory&   GetFactory() const=0;
     SfxMedium *                 GetMedium() const { return pMedium; }
     css::uno::Reference< css::document::XDocumentProperties >
-                                getDocProperties();
+                                getDocProperties() const;
     void                        UpdateDocInfoForSave(  );
     void                        FlushDocInfo();
     bool                        HasName() const { return bHasName; }
@@ -338,7 +338,7 @@ public:
     bool CheckIsReadonly(bool bSignScriptingContent);
     void RecheckSignature(bool bAlsoRecheckScriptingSignature);
     void AfterSigning(bool bSignSuccess, bool bSignScriptingContent);
-    bool HasValidSignatures();
+    bool HasValidSignatures() const;
     SignatureState              GetDocumentSignatureState();
     void                        SignDocumentContent(weld::Window* pDialogParent);
     css::uno::Sequence<css::security::DocumentSignatureInformation> GetDocumentSignatureInformation(
@@ -427,7 +427,7 @@ public:
     bool                        IsSecurityOptOpenReadOnly() const;
     void                        SetSecurityOptOpenReadOnly( bool bOpenReadOnly );
 
-    Size                        GetFirstPageSize();
+    Size                        GetFirstPageSize() const;
     bool                        DoClose();
     std::shared_ptr<GDIMetaFile> GetPreviewMetaFile( bool bFullContent = false ) const;
     virtual void                CancelTransfers();
@@ -538,7 +538,7 @@ public:
 
     // Determine the position of the "Automatic" filter in the stylist
     void                        SetAutoStyleFilterIndex(sal_uInt16 nSet);
-    sal_uInt16                  GetAutoStyleFilterIndex();
+    sal_uInt16                  GetAutoStyleFilterIndex() const;
     bool                        HasBasic() const;
     BasicManager*               GetBasicManager() const;
     css::uno::Reference< css::script::XLibraryContainer >
@@ -569,8 +569,8 @@ public:
                                 CreateAndLoadComponent( const SfxItemSet& rSet );
     static SfxObjectShell*      GetShellFromComponent( const css::uno::Reference< css::lang::XComponent >& xComp );
     static OUString             GetServiceNameFromFactory( const OUString& rFact );
-    bool                        IsInPlaceActive();
-    bool                        IsUIActive();
+    bool                        IsInPlaceActive() const;
+    bool                        IsUIActive() const;
 
     static bool                 CopyStoragesOfUnknownMediaType(
                                     const css::uno::Reference< css::embed::XStorage >& xSource,
@@ -581,7 +581,7 @@ public:
     void            EnableSetModified( bool bEnable = true );
     bool            IsEnableSetModified() const;
     virtual void    SetModified( bool bModified = true );
-    bool            IsModified();
+    bool            IsModified() const;
 
     /**
      * @param bChart true if the file is a chart doc and FillClass should not be called
@@ -676,7 +676,7 @@ public:
                 const css::uno::Sequence< css::security::DocumentSignatureInformation >& aInfos );
     SAL_DLLPRIVATE void CheckEncryption_Impl( const css::uno::Reference< css::task::XInteractionHandler >& xHandler );
     SAL_DLLPRIVATE void SetModifyPasswordEntered( bool bEntered = true );
-    SAL_DLLPRIVATE bool IsModifyPasswordEntered();
+    SAL_DLLPRIVATE bool IsModifyPasswordEntered() const;
 
     SAL_DLLPRIVATE void InitBasicManager_Impl();
     SAL_DLLPRIVATE SfxObjectShell_Impl* Get_Impl() { return pImpl.get(); }
@@ -741,7 +741,7 @@ public:
     SAL_DLLPRIVATE void CheckOut( );
     SAL_DLLPRIVATE void CancelCheckOut( );
     SAL_DLLPRIVATE void CheckIn( );
-    SAL_DLLPRIVATE css::uno::Sequence< css::document::CmisVersion > GetCmisVersions();
+    SAL_DLLPRIVATE css::uno::Sequence< css::document::CmisVersion > GetCmisVersions() const;
 
     /** override this if you have a XmlIdRegistry. */
     virtual const sfx2::IXmlIdRegistry* GetXmlIdRegistry() const { return nullptr; }
diff --git a/include/sfx2/opengrf.hxx b/include/sfx2/opengrf.hxx
index ca70b955a017..d28f88c4f5a3 100644
--- a/include/sfx2/opengrf.hxx
+++ b/include/sfx2/opengrf.hxx
@@ -58,7 +58,7 @@ public:
     OUString const &        GetDetectedFilter() const;
     void                    SetDetectedFilter(const OUString&);
 
-    css::uno::Reference<css::ui::dialogs::XFilePickerControlAccess> const & GetFilePickerControlAccess();
+    css::uno::Reference<css::ui::dialogs::XFilePickerControlAccess> const & GetFilePickerControlAccess() const;
 
 private:
     SvxOpenGraphicDialog    (const SvxOpenGraphicDialog&) = delete;
diff --git a/include/sfx2/sfxbasecontroller.hxx b/include/sfx2/sfxbasecontroller.hxx
index e15d53e4ab53..4b7237fd4386 100644
--- a/include/sfx2/sfxbasecontroller.hxx
+++ b/include/sfx2/sfxbasecontroller.hxx
@@ -179,8 +179,8 @@ public:
     // either the _Impl name should vanish or there should be an "official" API
     SfxViewShell* GetViewShell_Impl() const;
     SAL_DLLPRIVATE bool HandleEvent_Impl( NotifyEvent const & rEvent );
-    SAL_DLLPRIVATE bool HasKeyListeners_Impl();
-    SAL_DLLPRIVATE bool HasMouseClickListeners_Impl();
+    SAL_DLLPRIVATE bool HasKeyListeners_Impl() const;
+    SAL_DLLPRIVATE bool HasMouseClickListeners_Impl() const;
     SAL_DLLPRIVATE void SetCreationArguments_Impl( const css::uno::Sequence< css::beans::PropertyValue >& i_rCreationArgs );
     SAL_DLLPRIVATE css::uno::Reference< css::frame::XTitle > impl_getTitleHelper ();
 private:
diff --git a/include/sfx2/sfxbasemodel.hxx b/include/sfx2/sfxbasemodel.hxx
index 92c69b5c3bc9..d625f7871029 100644
--- a/include/sfx2/sfxbasemodel.hxx
+++ b/include/sfx2/sfxbasemodel.hxx
@@ -715,7 +715,7 @@ private:
     css::uno::Reference< css::ui::XUIConfigurationManager2 > getUIConfigurationManager2();
     void impl_getPrintHelper();
     SAL_DLLPRIVATE void ListenForStorage_Impl( const css::uno::Reference< css::embed::XStorage >& xStorage );
-    SAL_DLLPRIVATE OUString GetMediumFilterName_Impl();
+    SAL_DLLPRIVATE OUString GetMediumFilterName_Impl() const;
 
     SAL_DLLPRIVATE void postEvent_Impl( const OUString& aName, const css::uno::Reference< css::frame::XController2 >& xController = css::uno::Reference< css::frame::XController2 >() );
 
diff --git a/include/sfx2/sidebar/SidebarController.hxx b/include/sfx2/sidebar/SidebarController.hxx
index 286036b6f141..fa051bf549be 100644
--- a/include/sfx2/sidebar/SidebarController.hxx
+++ b/include/sfx2/sidebar/SidebarController.hxx
@@ -164,7 +164,7 @@ public:
 
     css::uno::Reference<css::frame::XFrame> const & getXFrame() const {return mxFrame;}
 
-    sal_Int32 getMaximumWidth() { return mnMaximumSidebarWidth; }
+    sal_Int32 getMaximumWidth() const { return mnMaximumSidebarWidth; }
     void setMaximumWidth(sal_Int32 nMaximumWidth) { mnMaximumSidebarWidth = nMaximumWidth; }
 
 private:
diff --git a/include/sfx2/sidebar/TitleBar.hxx b/include/sfx2/sidebar/TitleBar.hxx
index 2d83637888ae..f69a7ef4e047 100644
--- a/include/sfx2/sidebar/TitleBar.hxx
+++ b/include/sfx2/sidebar/TitleBar.hxx
@@ -35,7 +35,7 @@ public:
     virtual void dispose() override;
 
     void SetTitle (const OUString& rsTitle);
-    const OUString& GetTitle() {return msTitle; }
+    const OUString& GetTitle() const {return msTitle; }
 
     void SetIcon (const Image& rIcon);
 
diff --git a/include/sfx2/tabdlg.hxx b/include/sfx2/tabdlg.hxx
index d98af8b09090..791887059189 100644
--- a/include/sfx2/tabdlg.hxx
+++ b/include/sfx2/tabdlg.hxx
@@ -212,7 +212,7 @@ public:
     virtual DeactivateRC    DeactivatePage( SfxItemSet* pSet );
     void                    SetUserData(const OUString& rString)
                               { aUserString = rString; }
-    const OUString&         GetUserData() { return aUserString; }
+    const OUString&         GetUserData() const { return aUserString; }
     virtual void            FillUserData();
     virtual bool            IsReadOnly() const;
     virtual void PageCreated (const SfxAllItemSet& aSet);
@@ -224,7 +224,7 @@ public:
     }
 
     void SetFrame(const css::uno::Reference< css::frame::XFrame >& xFrame);
-    css::uno::Reference< css::frame::XFrame > GetFrame();
+    css::uno::Reference< css::frame::XFrame > GetFrame() const;
 
     const SfxItemSet* GetDialogExampleSet() const;
 
diff --git a/include/sfx2/templatedlg.hxx b/include/sfx2/templatedlg.hxx
index dd821bdf3d05..0e0e78f12dd3 100644
--- a/include/sfx2/templatedlg.hxx
+++ b/include/sfx2/templatedlg.hxx
@@ -113,7 +113,7 @@ protected:
     void localSearchMoveTo (sal_uInt16 nMenuId);
 
     /// Return filter according to the currently selected application filter.
-    FILTER_APPLICATION getCurrentApplicationFilter();
+    FILTER_APPLICATION getCurrentApplicationFilter() const;
 
 protected:
     std::set<const ThumbnailViewItem*,selection_cmp_fn> maSelTemplates;
diff --git a/include/sfx2/viewsh.hxx b/include/sfx2/viewsh.hxx
index cc76aefd6a5c..9d3312b2fa60 100644
--- a/include/sfx2/viewsh.hxx
+++ b/include/sfx2/viewsh.hxx
@@ -285,7 +285,7 @@ public:
     const std::shared_ptr< vcl::PrinterController >& GetPrinterController() const;
 
     void                        AddRemoveClipboardListener( const css::uno::Reference < css::datatransfer::clipboard::XClipboardListener>&, bool );
-    css::uno::Reference< css::datatransfer::clipboard::XClipboardNotifier > GetClipboardNotifier();
+    css::uno::Reference< css::datatransfer::clipboard::XClipboardNotifier > GetClipboardNotifier() const;
 
     SAL_DLLPRIVATE SfxInPlaceClient* GetUIActiveIPClient_Impl() const;
     SAL_DLLPRIVATE void AddContextMenuInterceptor_Impl( const css::uno::Reference < css::ui::XContextMenuInterceptor >& xInterceptor );
@@ -299,8 +299,8 @@ public:
     SAL_DLLPRIVATE void SetPrinter_Impl( VclPtr<SfxPrinter>& pNewPrinter );
 
     SAL_DLLPRIVATE bool HandleNotifyEvent_Impl( NotifyEvent const & rEvent );
-    SAL_DLLPRIVATE bool HasKeyListeners_Impl();
-    SAL_DLLPRIVATE bool HasMouseClickListeners_Impl();
+    SAL_DLLPRIVATE bool HasKeyListeners_Impl() const;
+    SAL_DLLPRIVATE bool HasMouseClickListeners_Impl() const;
 
     SAL_DLLPRIVATE SfxBaseController*   GetBaseController_Impl() const;
 
diff --git a/sfx2/inc/SfxRedactionHelper.hxx b/sfx2/inc/SfxRedactionHelper.hxx
index 737357505e5d..65835d75f8eb 100644
--- a/sfx2/inc/SfxRedactionHelper.hxx
+++ b/sfx2/inc/SfxRedactionHelper.hxx
@@ -73,7 +73,7 @@ public:
      * and inserts the shapes into the newly created draw pages.
      * */
     static void
-    addPagesToDraw(uno::Reference<XComponent>& xComponent, sal_Int32 nPages,
+    addPagesToDraw(const uno::Reference<XComponent>& xComponent, sal_Int32 nPages,
                    const std::vector<GDIMetaFile>& aMetaFiles,
                    const std::vector<::Size>& aPageSizes, const PageMargins& aPageMargins,
                    const std::vector<std::pair<RedactionTarget*, OUString>>& r_aTableTargets,
@@ -83,29 +83,30 @@ public:
      * Meant to be called after converting a document to a Draw doc
      * for redaction purposes.
      * */
-    static void showRedactionToolbar(SfxViewFrame* pViewFrame);
+    static void showRedactionToolbar(const SfxViewFrame* pViewFrame);
 
     /*
      * Used to get the page margins from the original/source Writer document. Then we apply these values to the
      * pages inserted into Draw for redaction.
      * */
-    static PageMargins getPageMarginsForWriter(css::uno::Reference<css::frame::XModel>& xModel);
+    static PageMargins
+    getPageMarginsForWriter(const css::uno::Reference<css::frame::XModel>& xModel);
 
     /*
      * Used to get the page margins from the original/source Calc document. Then we apply these values to the
      * pages inserted into Draw for redaction.
      * */
-    static PageMargins getPageMarginsForCalc(css::uno::Reference<css::frame::XModel>& xModel);
+    static PageMargins getPageMarginsForCalc(const css::uno::Reference<css::frame::XModel>& xModel);
 
     static void searchInMetaFile(const RedactionTarget* pRedactionTarget, const GDIMetaFile& rMtf,
                                  std::vector<tools::Rectangle>& aRedactionRectangles,
-                                 uno::Reference<XComponent>& xComponent);
+                                 const uno::Reference<XComponent>& xComponent);
 
     /*
      * Draws a redaction rectangle on the draw page referenced with its page number (0-based)
      * */
-    static void addRedactionRectToPage(uno::Reference<XComponent>& xComponent,
-                                       uno::Reference<drawing::XDrawPage>& xPage,
+    static void addRedactionRectToPage(const uno::Reference<XComponent>& xComponent,
+                                       const uno::Reference<drawing::XDrawPage>& xPage,
                                        const std::vector<tools::Rectangle>& aNewRectangles);
 
     /*
@@ -114,8 +115,8 @@ public:
      * */
     static void autoRedactPage(const RedactionTarget* pRedactionTarget,
                                const GDIMetaFile& rGDIMetaFile,
-                               uno::Reference<drawing::XDrawPage>& xPage,
-                               uno::Reference<XComponent>& xComponent);
+                               const uno::Reference<drawing::XDrawPage>& xPage,
+                               const uno::Reference<XComponent>& xComponent);
 
     /// Fill the search options based on the given redaction target
     static void fillSearchOptions(i18nutil::SearchOptions2& rSearchOpt,
diff --git a/sfx2/inc/autoredactdialog.hxx b/sfx2/inc/autoredactdialog.hxx
index f7cdecc15cce..6b9f6e2e783e 100644
--- a/sfx2/inc/autoredactdialog.hxx
+++ b/sfx2/inc/autoredactdialog.hxx
@@ -70,7 +70,7 @@ public:
     void InsertTarget(RedactionTarget* pTarget);
     void SelectByName(const OUString& sName);
     RedactionTarget* GetTargetByName(const OUString& sName);
-    OUString GetNameProposal();
+    OUString GetNameProposal() const;
 
     void unselect_all() { m_xControl->unselect_all(); }
     bool has_focus() const { return m_xControl->has_focus(); }
diff --git a/sfx2/source/appl/app.cxx b/sfx2/source/appl/app.cxx
index 53d2aae37da0..9f05c9bf227b 100644
--- a/sfx2/source/appl/app.cxx
+++ b/sfx2/source/appl/app.cxx
@@ -520,7 +520,7 @@ SfxApplication::ChooseScript(weld::Window *pParent)
     return aScriptURL;
 }
 
-void SfxApplication::MacroOrganizer(weld::Window* pParent, sal_Int16 nTabId)
+void SfxApplication::MacroOrganizer(const weld::Window* pParent, sal_Int16 nTabId)
 {
 #if !HAVE_FEATURE_SCRIPTING
     (void) pParent;
diff --git a/sfx2/source/appl/appuno.cxx b/sfx2/source/appl/appuno.cxx
index 2954eb45a522..649c18952701 100644
--- a/sfx2/source/appl/appuno.cxx
+++ b/sfx2/source/appl/appuno.cxx
@@ -1667,7 +1667,7 @@ class RequestPackageReparation_Impl : public ::cppu::WeakImplHelper< task::XInte
 
 public:
     explicit RequestPackageReparation_Impl( const OUString& aName );
-    bool    isApproved();
+    bool    isApproved() const;
     virtual uno::Any SAL_CALL getRequest() override;
     virtual uno::Sequence< uno::Reference< task::XInteractionContinuation > > SAL_CALL getContinuations() override;
 };
@@ -1681,7 +1681,7 @@ RequestPackageReparation_Impl::RequestPackageReparation_Impl( const OUString& aN
     m_xDisapprove = new comphelper::OInteractionDisapprove;
 }
 
-bool RequestPackageReparation_Impl::isApproved()
+bool RequestPackageReparation_Impl::isApproved() const
 {
     return m_xApprove->wasSelected();
 }
@@ -1706,7 +1706,7 @@ RequestPackageReparation::~RequestPackageReparation()
 {
 }
 
-bool RequestPackageReparation::isApproved()
+bool RequestPackageReparation::isApproved() const
 {
     return mxImpl->isApproved();
 }
diff --git a/sfx2/source/appl/childwin.cxx b/sfx2/source/appl/childwin.cxx
index 62838f4ae240..a7013fa6c530 100644
--- a/sfx2/source/appl/childwin.cxx
+++ b/sfx2/source/appl/childwin.cxx
@@ -366,7 +366,7 @@ SfxChildWinInfo SfxChildWindow::GetInfo() const
     return aInfo;
 }
 
-sal_uInt16 SfxChildWindow::GetPosition()
+sal_uInt16 SfxChildWindow::GetPosition() const
 {
     return pImpl->pFact->nPos;
 }
@@ -696,7 +696,7 @@ bool SfxChildWindow::QueryClose()
     return bAllow;
 }
 
-const css::uno::Reference< css::frame::XFrame >&  SfxChildWindow::GetFrame()
+const css::uno::Reference< css::frame::XFrame >&  SfxChildWindow::GetFrame() const
 {
     return pImpl->xFrame;
 }
diff --git a/sfx2/source/appl/opengrf.cxx b/sfx2/source/appl/opengrf.cxx
index 1469b0b3fc97..00a31a4f3ca9 100644
--- a/sfx2/source/appl/opengrf.cxx
+++ b/sfx2/source/appl/opengrf.cxx
@@ -285,7 +285,7 @@ void SvxOpenGraphicDialog::SetDetectedFilter(const OUString& rStr)
     mpImpl->sDetectedFilter = rStr;
 }
 
-Reference<ui::dialogs::XFilePickerControlAccess> const & SvxOpenGraphicDialog::GetFilePickerControlAccess()
+Reference<ui::dialogs::XFilePickerControlAccess> const & SvxOpenGraphicDialog::GetFilePickerControlAccess() const
 {
     return mpImpl->xCtrlAcc;
 }
diff --git a/sfx2/source/appl/sfxpicklist.cxx b/sfx2/source/appl/sfxpicklist.cxx
index 769a53281ee0..8e8e210a2cf6 100644
--- a/sfx2/source/appl/sfxpicklist.cxx
+++ b/sfx2/source/appl/sfxpicklist.cxx
@@ -76,14 +76,14 @@ class SfxPickListImpl : public SfxListener
        certain requirements, e.g. being writable. Check implementation for requirement
        details.
      */
-    static void         AddDocumentToPickList( SfxObjectShell* pDocShell );
+    static void         AddDocumentToPickList( const SfxObjectShell* pDocShell );
 
 public:
     SfxPickListImpl(SfxApplication& rApp);
     virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
 };
 
-void SfxPickListImpl::AddDocumentToPickList( SfxObjectShell* pDocSh )
+void SfxPickListImpl::AddDocumentToPickList( const SfxObjectShell* pDocSh )
 {
     if (pDocSh->IsAvoidRecentDocs() || comphelper::LibreOfficeKit::isActive())
         return;
diff --git a/sfx2/source/appl/workwin.cxx b/sfx2/source/appl/workwin.cxx
index 0cb1deb7e945..4210098ff231 100644
--- a/sfx2/source/appl/workwin.cxx
+++ b/sfx2/source/appl/workwin.cxx
@@ -1492,7 +1492,7 @@ void SfxWorkWindow::MakeVisible_Impl( bool bVis )
         nUpdateMode = nOrigMode;
 }
 
-bool SfxWorkWindow::IsVisible_Impl()
+bool SfxWorkWindow::IsVisible_Impl() const
 {
     return nOrigMode != SfxVisibilityFlags::Invisible;
 }
@@ -2103,7 +2103,7 @@ void SfxWorkWindow::ResetChildWindows_Impl()
 // returns the size of the area (client area) of the
 // parent windows, in which the ChildWindow can be fitted.
 
-tools::Rectangle SfxWorkWindow::GetTopRect_Impl()
+tools::Rectangle SfxWorkWindow::GetTopRect_Impl() const
 {
     return pMasterFrame->GetTopOuterRectPixel_Impl();
 }
diff --git a/sfx2/source/control/emojicontrol.cxx b/sfx2/source/control/emojicontrol.cxx
index 775ee77b3a75..4ed5f48029e8 100644
--- a/sfx2/source/control/emojicontrol.cxx
+++ b/sfx2/source/control/emojicontrol.cxx
@@ -128,7 +128,7 @@ void SfxEmojiControl::ConvertLabelToUnicode(sal_uInt16 nPageId)
     mpTabControl->SetPageText(nPageId, sHexText.toString());
 }
 
-FILTER_CATEGORY SfxEmojiControl::getCurrentFilter()
+FILTER_CATEGORY SfxEmojiControl::getCurrentFilter() const
 {
     const sal_uInt16 nCurPageId = mpTabControl->GetCurPageId();
 
diff --git a/sfx2/source/dialog/checkin.cxx b/sfx2/source/dialog/checkin.cxx
index b4834eca5535..cd464d751525 100644
--- a/sfx2/source/dialog/checkin.cxx
+++ b/sfx2/source/dialog/checkin.cxx
@@ -22,12 +22,12 @@ SfxCheckinDialog::~SfxCheckinDialog()
 {
 }
 
-OUString SfxCheckinDialog::GetComment( )
+OUString SfxCheckinDialog::GetComment( ) const
 {
     return m_xCommentED->get_text();
 }
 
-bool SfxCheckinDialog::IsMajor( )
+bool SfxCheckinDialog::IsMajor( ) const
 {
     return m_xMajorCB->get_active();
 }
diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx
index 01d7b4228936..86d39b6cf4cf 100644
--- a/sfx2/source/dialog/dinfdlg.cxx
+++ b/sfx2/source/dialog/dinfdlg.cxx
@@ -1338,7 +1338,7 @@ CustomPropertiesWindow::~CustomPropertiesWindow()
     m_pCurrentLine = nullptr;
 }
 
-void CustomPropertyLine::DoTypeHdl(weld::ComboBox& rBox)
+void CustomPropertyLine::DoTypeHdl(const weld::ComboBox& rBox)
 {
     auto nType = rBox.get_active_id().toInt32();
     m_xValueEdit->set_visible( (CUSTOM_TYPE_TEXT == nType) || (CUSTOM_TYPE_NUMBER  == nType) );
@@ -1355,7 +1355,7 @@ IMPL_LINK(CustomPropertyLine, TypeHdl, weld::ComboBox&, rBox, void)
     DoTypeHdl(rBox);
 }
 
-void CustomPropertiesWindow::Remove(CustomPropertyLine* pLine)
+void CustomPropertiesWindow::Remove(const CustomPropertyLine* pLine)
 {
     StoreCustomProperties();
 
diff --git a/sfx2/source/dialog/tabdlg.cxx b/sfx2/source/dialog/tabdlg.cxx
index c341b751c84e..7b6ef90e80bb 100644
--- a/sfx2/source/dialog/tabdlg.cxx
+++ b/sfx2/source/dialog/tabdlg.cxx
@@ -131,7 +131,7 @@ void SfxTabPage::SetFrame(const css::uno::Reference< css::frame::XFrame >& xFram
         pImpl->mxFrame = xFrame;
 }
 
-css::uno::Reference< css::frame::XFrame > SfxTabPage::GetFrame()
+css::uno::Reference< css::frame::XFrame > SfxTabPage::GetFrame() const
 {
     if (pImpl)
         return pImpl->mxFrame;
diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx
index cf2de5311f0e..c8bafb10317f 100644
--- a/sfx2/source/dialog/templdlg.cxx
+++ b/sfx2/source/dialog/templdlg.cxx
@@ -521,8 +521,8 @@ public:
     StyleTree_Impl(const OUString &rName, const OUString &rParent):
         aName(rName), aParent(rParent), pChildren(0) {}
 
-    const OUString& getName() { return aName; }
-    const OUString& getParent() { return aParent; }
+    const OUString& getName() const { return aName; }
+    const OUString& getParent() const { return aParent; }
     StyleTreeArr_Impl& getChildren() { return pChildren; }
 };
 
diff --git a/sfx2/source/doc/SfxRedactionHelper.cxx b/sfx2/source/doc/SfxRedactionHelper.cxx
index a5182f25593f..cdbc91f450af 100644
--- a/sfx2/source/doc/SfxRedactionHelper.cxx
+++ b/sfx2/source/doc/SfxRedactionHelper.cxx
@@ -113,7 +113,7 @@ void fixMetaFile(GDIMetaFile& tmpMtf)
 /*
  * Sets page margins for a Draw page. Negative values are considered erroneous
  * */
-void setPageMargins(uno::Reference<beans::XPropertySet>& xPageProperySet,
+void setPageMargins(const uno::Reference<beans::XPropertySet>& xPageProperySet,
                     const PageMargins& aPageMargins)
 {
     if (aPageMargins.nTop < 0 || aPageMargins.nBottom < 0 || aPageMargins.nLeft < 0
@@ -218,7 +218,7 @@ void SfxRedactionHelper::getPageMetaFilesFromDoc(std::vector<GDIMetaFile>& aMeta
 }
 
 void SfxRedactionHelper::addPagesToDraw(
-    uno::Reference<XComponent>& xComponent, sal_Int32 nPages,
+    const uno::Reference<XComponent>& xComponent, sal_Int32 nPages,
     const std::vector<GDIMetaFile>& aMetaFiles, const std::vector<::Size>& aPageSizes,
     const PageMargins& aPageMargins,
     const std::vector<std::pair<RedactionTarget*, OUString>>& r_aTableTargets, bool bIsAutoRedact)
@@ -275,7 +275,7 @@ void SfxRedactionHelper::addPagesToDraw(
     xDrawPages->remove(xPage);
 }
 
-void SfxRedactionHelper::showRedactionToolbar(SfxViewFrame* pViewFrame)
+void SfxRedactionHelper::showRedactionToolbar(const SfxViewFrame* pViewFrame)
 {
     if (!pViewFrame)
         return;
@@ -305,7 +305,7 @@ void SfxRedactionHelper::showRedactionToolbar(SfxViewFrame* pViewFrame)
 }
 
 PageMargins
-SfxRedactionHelper::getPageMarginsForWriter(css::uno::Reference<css::frame::XModel>& xModel)
+SfxRedactionHelper::getPageMarginsForWriter(const css::uno::Reference<css::frame::XModel>& xModel)
 {
     PageMargins aPageMargins = { -1, -1, -1, -1 };
 
@@ -362,7 +362,7 @@ SfxRedactionHelper::getPageMarginsForWriter(css::uno::Reference<css::frame::XMod
 }
 
 PageMargins
-SfxRedactionHelper::getPageMarginsForCalc(css::uno::Reference<css::frame::XModel>& xModel)
+SfxRedactionHelper::getPageMarginsForCalc(const css::uno::Reference<css::frame::XModel>& xModel)
 {
     PageMargins aPageMargins = { -1, -1, -1, -1 };
     OUString sPageStyleName("Default");
@@ -421,7 +421,7 @@ SfxRedactionHelper::getPageMarginsForCalc(css::uno::Reference<css::frame::XModel
 void SfxRedactionHelper::searchInMetaFile(const RedactionTarget* pRedactionTarget,
                                           const GDIMetaFile& rMtf,
                                           std::vector<::tools::Rectangle>& aRedactionRectangles,
-                                          uno::Reference<XComponent>& xComponent)
+                                          const uno::Reference<XComponent>& xComponent)
 {
     // Initialize search
     i18nutil::SearchOptions2 aSearchOptions;
@@ -468,7 +468,7 @@ void SfxRedactionHelper::searchInMetaFile(const RedactionTarget* pRedactionTarge
 }
 
 void SfxRedactionHelper::addRedactionRectToPage(
-    uno::Reference<XComponent>& xComponent, uno::Reference<drawing::XDrawPage>& xPage,
+    const uno::Reference<XComponent>& xComponent, const uno::Reference<drawing::XDrawPage>& xPage,
     const std::vector<::tools::Rectangle>& aNewRectangles)
 {
     if (!xComponent.is() || !xPage.is())
@@ -502,8 +502,8 @@ void SfxRedactionHelper::addRedactionRectToPage(
 
 void SfxRedactionHelper::autoRedactPage(const RedactionTarget* pRedactionTarget,
                                         const GDIMetaFile& rGDIMetaFile,
-                                        uno::Reference<drawing::XDrawPage>& xPage,
-                                        uno::Reference<XComponent>& xComponent)
+                                        const uno::Reference<drawing::XDrawPage>& xPage,
+                                        const uno::Reference<XComponent>& xComponent)
 {
     if (pRedactionTarget == nullptr || pRedactionTarget->sContent.isEmpty())
         return;
diff --git a/sfx2/source/doc/autoredactdialog.cxx b/sfx2/source/doc/autoredactdialog.cxx
index a3bbb8ddda2c..dfb90caa73a0 100644
--- a/sfx2/source/doc/autoredactdialog.cxx
+++ b/sfx2/source/doc/autoredactdialog.cxx
@@ -167,7 +167,7 @@ RedactionTarget* TargetsTable::GetTargetByName(const OUString& sName)
     return reinterpret_cast<RedactionTarget*>(m_xControl->get_id(nEntry).toInt64());
 }
 
-OUString TargetsTable::GetNameProposal()
+OUString TargetsTable::GetNameProposal() const
 {
     OUString sDefaultTargetName(SfxResId(STR_REDACTION_TARGET));
     sal_Int32 nHighestTargetId = 0;
@@ -374,7 +374,7 @@ IMPL_LINK_NOARG(SfxAutoRedactDialog, DeleteHdl, weld::Button&, void)
 
 namespace
 {
-boost::property_tree::ptree redactionTargetToJSON(RedactionTarget* pTarget)
+boost::property_tree::ptree redactionTargetToJSON(const RedactionTarget* pTarget)
 {
     boost::property_tree::ptree aNode;
     aNode.put("sName", pTarget->sName.toUtf8().getStr());
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index 129f256cfbe1..cd88780180f0 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -333,7 +333,7 @@ public:
     SfxMedium_Impl(const SfxMedium_Impl&) = delete;
     SfxMedium_Impl& operator=(const SfxMedium_Impl&) = delete;
 
-    OUString getFilterMimeType()
+    OUString getFilterMimeType() const
         { return !m_pFilter ? OUString() : m_pFilter->GetMimeType(); }
 };
 
@@ -388,7 +388,7 @@ void SfxMedium::ResetError()
         pImpl->m_pOutStream->ResetError();
 }
 
-ErrCode const & SfxMedium::GetLastStorageCreationState()
+ErrCode const & SfxMedium::GetLastStorageCreationState() const
 {
     return pImpl->nLastStorageError;
 }
@@ -553,7 +553,7 @@ OUString SfxMedium::GetBaseURL( bool bForSaving )
     return aBaseURL;
 }
 
-bool SfxMedium::IsSkipImages()
+bool SfxMedium::IsSkipImages() const
 {
     const SfxStringItem* pSkipImagesItem = GetItemSet()->GetItem<SfxStringItem>(SID_FILE_FILTEROPTIONS);
     return pSkipImagesItem && pSkipImagesItem->GetValue() == "SkipImages";
@@ -784,7 +784,7 @@ bool SfxMedium::IsStorage()
 }
 
 
-bool SfxMedium::IsPreview_Impl()
+bool SfxMedium::IsPreview_Impl() const
 {
     bool bPreview = false;
     const SfxBoolItem* pPreview = SfxItemSet::GetItem<SfxBoolItem>(GetItemSet(), SID_PREVIEW, false);
@@ -4066,7 +4066,7 @@ bool SfxMedium::SignContents_Impl(weld::Window* pDialogParent,
 }
 
 
-SignatureState SfxMedium::GetCachedSignatureState_Impl()
+SignatureState SfxMedium::GetCachedSignatureState_Impl() const
 {
     return pImpl->m_nSignatureState;
 }
@@ -4292,7 +4292,7 @@ void SfxMedium::SetInCheckIn( bool bInCheckIn )
     pImpl->m_bInCheckIn = bInCheckIn;
 }
 
-bool SfxMedium::IsInCheckIn( )
+bool SfxMedium::IsInCheckIn( ) const
 {
     return pImpl->m_bInCheckIn;
 }
diff --git a/sfx2/source/doc/doctempl.cxx b/sfx2/source/doc/doctempl.cxx
index 7f2e71dd45d2..167caae41043 100644
--- a/sfx2/source/doc/doctempl.cxx
+++ b/sfx2/source/doc/doctempl.cxx
@@ -226,7 +226,7 @@ public:
     bool            InsertRegion( std::unique_ptr<RegionData_Impl> pData, size_t nPos );
     const OUString& GetRootURL() const { return maRootURL; }
 
-    const uno::Reference< XDocumentTemplates >& getDocTemplates() { return mxTemplates; }
+    const uno::Reference< XDocumentTemplates >& getDocTemplates() const { return mxTemplates; }
 };
 
 
diff --git a/sfx2/source/doc/doctemplateslocal.cxx b/sfx2/source/doc/doctemplateslocal.cxx
index 197047de7af6..9f03ab68d21a 100644
--- a/sfx2/source/doc/doctemplateslocal.cxx
+++ b/sfx2/source/doc/doctemplateslocal.cxx
@@ -122,7 +122,7 @@ DocTemplLocaleHelper::~DocTemplLocaleHelper()
 }
 
 
-std::vector< beans::StringPair > const & DocTemplLocaleHelper::GetParsingResult()
+std::vector< beans::StringPair > const & DocTemplLocaleHelper::GetParsingResult() const
 {
     if ( !m_aElementsSeq.empty() )
         throw uno::RuntimeException(); // the parsing has still not finished!
diff --git a/sfx2/source/doc/doctemplateslocal.hxx b/sfx2/source/doc/doctemplateslocal.hxx
index 7686d081f001..42770bcb3368 100644
--- a/sfx2/source/doc/doctemplateslocal.hxx
+++ b/sfx2/source/doc/doctemplateslocal.hxx
@@ -34,7 +34,7 @@ class DocTemplLocaleHelper : public cppu::WeakImplHelper < css::xml::sax::XDocum
     std::vector< OUString > m_aElementsSeq; // stack of elements being parsed
 
     DocTemplLocaleHelper();
-    std::vector< css::beans::StringPair > const & GetParsingResult();
+    std::vector< css::beans::StringPair > const & GetParsingResult() const;
 
     /// @throws css::uno::Exception
     static std::vector< css::beans::StringPair > ReadLocalizationSequence_Impl( const css::uno::Reference< css::io::XInputStream >& xInStream, const OUString& aStringID, const css::uno::Reference< css::uno::XComponentContext >& xContext );
diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx
index f875591e0a50..8d66dec30004 100644
--- a/sfx2/source/doc/guisaveas.cxx
+++ b/sfx2/source/doc/guisaveas.cxx
@@ -298,7 +298,7 @@ public:
 
     void FreeDocumentProps();
 
-    uno::Reference< frame::XModel > const & GetModel();
+    uno::Reference< frame::XModel > const & GetModel() const;
     uno::Reference< frame::XStorable > const & GetStorable();
     uno::Reference< frame::XStorable2 > const & GetStorable2();
 
@@ -376,7 +376,7 @@ void ModelData_Impl::FreeDocumentProps()
 }
 
 
-uno::Reference< frame::XModel > const & ModelData_Impl::GetModel()
+uno::Reference< frame::XModel > const & ModelData_Impl::GetModel() const
 {
     if ( !m_xModel.is() )
         throw uno::RuntimeException();
diff --git a/sfx2/source/doc/objcont.cxx b/sfx2/source/doc/objcont.cxx
index 382583dbb321..890fea99990f 100644
--- a/sfx2/source/doc/objcont.cxx
+++ b/sfx2/source/doc/objcont.cxx
@@ -149,7 +149,7 @@ SfxObjectShell::CreatePreviewMetaFile_Impl( bool bFullContent ) const
     else
     {
         nAspect = ASPECT_THUMBNAIL;
-        aTmpSize = const_cast<SfxObjectShell*>(this)->GetFirstPageSize();
+        aTmpSize = GetFirstPageSize();
     }
 
     xFile->SetPrefSize( aTmpSize );
@@ -667,7 +667,7 @@ void SfxObjectShell::SetModifyPasswordEntered( bool bEntered )
     pImpl->m_bModifyPasswordEntered = bEntered;
 }
 
-bool SfxObjectShell::IsModifyPasswordEntered()
+bool SfxObjectShell::IsModifyPasswordEntered() const
 {
     return pImpl->m_bModifyPasswordEntered;
 }
diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx
index adf3f5d4d5d4..5af5ddfdf2f0 100644
--- a/sfx2/source/doc/objmisc.cxx
+++ b/sfx2/source/doc/objmisc.cxx
@@ -169,7 +169,7 @@ bool SfxObjectShell::IsAbortingImport() const
 
 
 uno::Reference<document::XDocumentProperties>
-SfxObjectShell::getDocProperties()
+SfxObjectShell::getDocProperties() const
 {
     uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
         GetModel(), uno::UNO_QUERY_THROW);
@@ -244,7 +244,7 @@ bool SfxObjectShell::IsEnableSetModified() const
 }
 
 
-bool SfxObjectShell::IsModified()
+bool SfxObjectShell::IsModified() const
 {
     if ( pImpl->m_bIsModified )
         return true;
@@ -631,7 +631,7 @@ OUString SfxObjectShell::GetSharedFileURL() const
 #endif
 }
 
-Size SfxObjectShell::GetFirstPageSize()
+Size SfxObjectShell::GetFirstPageSize() const
 {
     return GetVisArea(ASPECT_THUMBNAIL).GetSize();
 }
@@ -1657,7 +1657,7 @@ void SfxObjectShell::SetCreateMode_Impl( SfxObjectCreateMode nMode )
     eCreateMode = nMode;
 }
 
-bool SfxObjectShell::IsInPlaceActive()
+bool SfxObjectShell::IsInPlaceActive() const
 {
     if ( eCreateMode != SfxObjectCreateMode::EMBEDDED )
         return false;
@@ -1666,7 +1666,7 @@ bool SfxObjectShell::IsInPlaceActive()
     return pFrame && pFrame->GetFrame().IsInPlace();
 }
 
-bool SfxObjectShell::IsUIActive()
+bool SfxObjectShell::IsUIActive() const
 {
     if ( eCreateMode != SfxObjectCreateMode::EMBEDDED )
         return false;
diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx
index 8cc196c015ce..5e04a0c09c34 100644
--- a/sfx2/source/doc/objserv.cxx
+++ b/sfx2/source/doc/objserv.cxx
@@ -158,7 +158,7 @@ class SfxClosePreventer_Impl : public ::cppu::WeakImplHelper< css::util::XCloseL
 public:
     SfxClosePreventer_Impl();
 
-    bool HasOwnership() { return m_bGotOwnership; }
+    bool HasOwnership() const { return m_bGotOwnership; }
 
     void SetPreventClose( bool bPrevent ) { m_bPreventClose = bPrevent; }
 
@@ -395,7 +395,7 @@ void SfxObjectShell::CheckIn( )
     }
 }
 
-uno::Sequence< document::CmisVersion > SfxObjectShell::GetCmisVersions( )
+uno::Sequence< document::CmisVersion > SfxObjectShell::GetCmisVersions( ) const
 {
     try
     {
@@ -1812,7 +1812,7 @@ bool SfxObjectShell::CheckIsReadonly(bool bSignScriptingContent)
     return false;
 }
 
-bool SfxObjectShell::HasValidSignatures()
+bool SfxObjectShell::HasValidSignatures() const
 {
     return pImpl->nDocumentSignatureState == SignatureState::OK
            || pImpl->nDocumentSignatureState == SignatureState::NOTVALIDATED
diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx
index 5e5cb854c775..3660e52fc547 100644
--- a/sfx2/source/doc/objxtor.cxx
+++ b/sfx2/source/doc/objxtor.cxx
@@ -873,7 +873,7 @@ void SfxObjectShell::SetAutoStyleFilterIndex(sal_uInt16 nSet)
     pImpl->nStyleFilter = nSet;
 }
 
-sal_uInt16 SfxObjectShell::GetAutoStyleFilterIndex()
+sal_uInt16 SfxObjectShell::GetAutoStyleFilterIndex() const
 {
     return pImpl->nStyleFilter;
 }
diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx
index 08c5f83ba54d..46d6be1a7840 100644
--- a/sfx2/source/doc/sfxbasemodel.cxx
+++ b/sfx2/source/doc/sfxbasemodel.cxx
@@ -2894,7 +2894,7 @@ bool SfxBaseModel::impl_isDisposed() const
 //  private impl.
 
 
-OUString SfxBaseModel::GetMediumFilterName_Impl()
+OUString SfxBaseModel::GetMediumFilterName_Impl() const
 {
     std::shared_ptr<const SfxFilter> pFilter;
     SfxMedium* pMedium = m_pData->m_pObjectShell->GetMedium();
diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx
index 6c9b479cb17a..f3c91a28c767 100644
--- a/sfx2/source/doc/templatedlg.cxx
+++ b/sfx2/source/doc/templatedlg.cxx
@@ -291,7 +291,7 @@ void SfxTemplateManagerDlg::setDocumentModel(const uno::Reference<frame::XModel>
     m_xModel = rModel;
 }
 
-FILTER_APPLICATION SfxTemplateManagerDlg::getCurrentApplicationFilter()
+FILTER_APPLICATION SfxTemplateManagerDlg::getCurrentApplicationFilter() const
 {
     const sal_Int16 nCurAppId = mxCBApp->get_active();
 
diff --git a/sfx2/source/inc/fltoptint.hxx b/sfx2/source/inc/fltoptint.hxx
index 7f26a1399c7e..624ecd073453 100644
--- a/sfx2/source/inc/fltoptint.hxx
+++ b/sfx2/source/inc/fltoptint.hxx
@@ -45,7 +45,7 @@ public:
     RequestFilterOptions( css::uno::Reference< css::frame::XModel > const & rModel,
                               const css::uno::Sequence< css::beans::PropertyValue >& rProperties );
 
-    bool    isAbort() { return m_xAbort->wasSelected(); }
+    bool    isAbort() const { return m_xAbort->wasSelected(); }
 
     css::uno::Sequence< css::beans::PropertyValue > getFilterOptions()
     {
diff --git a/sfx2/source/inc/workwin.hxx b/sfx2/source/inc/workwin.hxx
index 159e6ceb0c6c..1b2bfceb9be2 100644
--- a/sfx2/source/inc/workwin.hxx
+++ b/sfx2/source/inc/workwin.hxx
@@ -223,7 +223,7 @@ class SfxWorkWindow final
     void                    Sort_Impl();
     SfxChild_Impl*          FindChild_Impl( const vcl::Window& rWindow ) const;
     bool                    RequestTopToolSpacePixel_Impl( SvBorder aBorder );
-    tools::Rectangle               GetTopRect_Impl();
+    tools::Rectangle        GetTopRect_Impl() const;
     SvBorder                Arrange_Impl();
     void                    SaveStatus_Impl(SfxChildWindow*, const SfxChildWinInfo&);
     static bool             IsPluginMode( SfxObjectShell const * pObjShell );
@@ -272,7 +272,7 @@ public:
     void                    UpdateObjectBars_Impl2();
     void                    ResetObjectBars_Impl();
     void                    SetObjectBar_Impl(sal_uInt16 nPos, SfxVisibilityFlags nFlags, ToolbarId eId);
-    bool                    IsVisible_Impl();
+    bool                    IsVisible_Impl() const;
     void                    MakeVisible_Impl( bool );
     void                    Lock_Impl( bool );
 
diff --git a/sfx2/source/notebookbar/SfxNotebookBar.cxx b/sfx2/source/notebookbar/SfxNotebookBar.cxx
index 672c949531bb..0b47a818ef11 100644
--- a/sfx2/source/notebookbar/SfxNotebookBar.cxx
+++ b/sfx2/source/notebookbar/SfxNotebookBar.cxx
@@ -560,7 +560,7 @@ void SfxNotebookBar::ToggleMenubar()
     }
 }
 
-void SfxNotebookBar::ReloadNotebookBar(OUString& sUIPath)
+void SfxNotebookBar::ReloadNotebookBar(const OUString& sUIPath)
 {
     if (SfxNotebookBar::IsActive())
     {
diff --git a/sfx2/source/view/classificationcontroller.cxx b/sfx2/source/view/classificationcontroller.cxx
index 05a6c6b93b8e..d1737912b3ca 100644
--- a/sfx2/source/view/classificationcontroller.cxx
+++ b/sfx2/source/view/classificationcontroller.cxx
@@ -95,13 +95,13 @@ public:
     ~ClassificationControl() override;
     void dispose() override;
     void Resize() override;
-    const VclPtr<ListBox>& getCategory()
+    const VclPtr<ListBox>& getCategory() const
     {
         return m_pCategory;
     }
     static sfx::ClassificationCreationOrigin getExistingClassificationOrigin();
     void toggleInteractivityOnOrigin();
-    void setCategoryStateFromPolicy(SfxClassificationHelper & rHelper);
+    void setCategoryStateFromPolicy(const SfxClassificationHelper & rHelper);
 };
 
 namespace
@@ -351,7 +351,7 @@ void ClassificationControl::toggleInteractivityOnOrigin()
     }
 }
 
-void ClassificationControl::setCategoryStateFromPolicy(SfxClassificationHelper & rHelper)
+void ClassificationControl::setCategoryStateFromPolicy(const SfxClassificationHelper & rHelper)
 {
     const OUString& rCategoryName = rHelper.GetBACName(SfxClassificationHelper::getPolicyType());
     if (!rCategoryName.isEmpty())
diff --git a/sfx2/source/view/classificationhelper.cxx b/sfx2/source/view/classificationhelper.cxx
index 6102879c3d6d..23e737900614 100644
--- a/sfx2/source/view/classificationhelper.cxx
+++ b/sfx2/source/view/classificationhelper.cxx
@@ -596,22 +596,22 @@ SfxClassificationHelper::SfxClassificationHelper(const uno::Reference<document::
 
 SfxClassificationHelper::~SfxClassificationHelper() = default;
 
-std::vector<OUString> const & SfxClassificationHelper::GetMarkings()
+std::vector<OUString> const & SfxClassificationHelper::GetMarkings() const
 {
     return m_pImpl->m_aMarkings;
 }
 
-std::vector<OUString> const & SfxClassificationHelper::GetIntellectualPropertyParts()
+std::vector<OUString> const & SfxClassificationHelper::GetIntellectualPropertyParts() const
 {
     return m_pImpl->m_aIPParts;
 }
 
-std::vector<OUString> const & SfxClassificationHelper::GetIntellectualPropertyPartNumbers()
+std::vector<OUString> const & SfxClassificationHelper::GetIntellectualPropertyPartNumbers() const
 {
     return m_pImpl->m_aIPPartNumbers;
 }
 
-const OUString& SfxClassificationHelper::GetBACName(SfxClassificationPolicyType eType)
+const OUString& SfxClassificationHelper::GetBACName(SfxClassificationPolicyType eType) const
 {
     return m_pImpl->m_aCategory[eType].m_aName;
 }
diff --git a/sfx2/source/view/ipclient.cxx b/sfx2/source/view/ipclient.cxx
index 2e50126df545..5bc642d85be1 100644
--- a/sfx2/source/view/ipclient.cxx
+++ b/sfx2/source/view/ipclient.cxx
@@ -1096,7 +1096,7 @@ void SfxInPlaceClient::ResetObject()
     {}
 }
 
-bool SfxInPlaceClient::IsUIActive()
+bool SfxInPlaceClient::IsUIActive() const
 {
     return m_xImp->m_bUIActive;
 }
diff --git a/sfx2/source/view/sfxbasecontroller.cxx b/sfx2/source/view/sfxbasecontroller.cxx
index 956ce26fc4b4..7812b560de2a 100644
--- a/sfx2/source/view/sfxbasecontroller.cxx
+++ b/sfx2/source/view/sfxbasecontroller.cxx
@@ -1154,12 +1154,12 @@ bool SfxBaseController::HandleEvent_Impl( NotifyEvent const & rEvent )
     return m_pData->m_aUserInputInterception.handleNotifyEvent( rEvent );
 }
 
-bool SfxBaseController::HasKeyListeners_Impl()
+bool SfxBaseController::HasKeyListeners_Impl() const
 {
     return m_pData->m_aUserInputInterception.hasKeyHandlers();
 }
 
-bool SfxBaseController::HasMouseClickListeners_Impl()
+bool SfxBaseController::HasMouseClickListeners_Impl() const
 {
     return m_pData->m_aUserInputInterception.hasMouseClickListeners();
 }
diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx
index abbb7b7b0ac5..748d8eefe05b 100644
--- a/sfx2/source/view/viewsh.cxx
+++ b/sfx2/source/view/viewsh.cxx
@@ -1953,13 +1953,13 @@ bool SfxViewShell::HandleNotifyEvent_Impl( NotifyEvent const & rEvent )
     return false;
 }
 
-bool SfxViewShell::HasKeyListeners_Impl()
+bool SfxViewShell::HasKeyListeners_Impl() const
 {
     return (pImpl->m_pController.is())
         && pImpl->m_pController->HasKeyListeners_Impl();
 }
 
-bool SfxViewShell::HasMouseClickListeners_Impl()
+bool SfxViewShell::HasMouseClickListeners_Impl() const
 {
     return (pImpl->m_pController.is())
         && pImpl->m_pController->HasMouseClickListeners_Impl();
@@ -1988,7 +1988,7 @@ void SfxViewShell::notifyWindow(vcl::LOKWindowId nDialogId, const OUString& rAct
     SfxLokHelper::notifyWindow(this, nDialogId, rAction, rPayload);
 }
 
-uno::Reference< datatransfer::clipboard::XClipboardNotifier > SfxViewShell::GetClipboardNotifier()
+uno::Reference< datatransfer::clipboard::XClipboardNotifier > SfxViewShell::GetClipboardNotifier() const
 {
     uno::Reference< datatransfer::clipboard::XClipboardNotifier > xClipboardNotifier;
     if ( GetViewFrame() )


More information about the Libreoffice-commits mailing list