summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2023-02-16 10:42:06 +0000
committerCaolán McNamara <caolanm@redhat.com>2023-02-16 15:13:21 +0000
commit0908c7c1184ab7acb7b6f6740a82c2f12c296fae (patch)
tree7bfe09dce871f6f2bc59a81b689d7ab5a3a6f3ea /include
parente71080e19365aa074c56d1136dad2b09783949a2 (diff)
SfxViewShell::GetViewFrame never returns null, change to a reference
various null checks can be seen to be redundant and removed Change-Id: Icf49c1de4b0302795d2769a370af3abceaad0221 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147147 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/sfx2/lokhelper.hxx2
-rw-r--r--include/sfx2/viewsh.hxx39
2 files changed, 18 insertions, 23 deletions
diff --git a/include/sfx2/lokhelper.hxx b/include/sfx2/lokhelper.hxx
index 90ddd52d01a4..f7de18112c04 100644
--- a/include/sfx2/lokhelper.hxx
+++ b/include/sfx2/lokhelper.hxx
@@ -188,7 +188,7 @@ public:
static VclPtr<vcl::Window> getInPlaceDocWindow(SfxViewShell* pViewShell);
private:
- static int createView(SfxViewFrame* pViewFrame, ViewShellDocId docId);
+ static int createView(SfxViewFrame& rViewFrame, ViewShellDocId docId);
};
template<typename ViewShellType, typename FunctionType>
diff --git a/include/sfx2/viewsh.hxx b/include/sfx2/viewsh.hxx
index 1e70f8301bda..0465fd036d4b 100644
--- a/include/sfx2/viewsh.hxx
+++ b/include/sfx2/viewsh.hxx
@@ -163,7 +163,7 @@ friend class SfxBaseController;
friend class SfxPrinterController;
std::unique_ptr<struct SfxViewShell_Impl> pImpl;
- SfxViewFrame* pFrame;
+ SfxViewFrame& rFrame;
VclPtr<vcl::Window> pWindow;
bool bNoNewWindow;
bool mbPrinterSettingsModified;
@@ -262,7 +262,22 @@ public:
const SvBorder& GetBorderPixel() const;
void SetBorderPixel( const SvBorder &rBorder );
void InvalidateBorder();
- inline SfxViewFrame* GetViewFrame() const;
+
+ /* [Description]
+
+ This method returns a reference to the <SfxViewFrame> Instance in which
+ this SfxViewShell is displayed. This is the instance that was passed
+ on in the constructor. It is guaranteed that the returned reference
+ is a valid SfxViewFrame instance.
+
+ [Cross-reference]
+
+ <SfxShell::GetFrame()const>
+ */
+ SfxViewFrame& GetViewFrame() const
+ {
+ return rFrame;
+ }
// Printing Interface
virtual SfxPrinter* GetPrinter( bool bCreate = false );
@@ -442,26 +457,6 @@ public:
void SetStoringHelper(std::shared_ptr<SfxStoringHelper> xHelper) { m_xHelper = xHelper; }
};
-
-inline SfxViewFrame* SfxViewShell::GetViewFrame() const
-
-/* [Description]
-
- This method returns a pointer to the <SfxViewFrame> Instance in which
- this SfxViewShell is displayed. This is the instance that was passed
- on in the constructor. It is guaranteed that the returned pointer
- points on the valid SfxViewFrame instance.
-
- [Cross-reference]
-
- <SfxShell::GetFrame()const>
-*/
-
-{
- return pFrame;
-}
-
#endif // INCLUDED_SFX2_VIEWSH_HXX
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */