summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2023-02-15 19:52:01 +0000
committerCaolán McNamara <caolanm@redhat.com>2023-02-16 09:24:57 +0000
commitdc214bcff335024f21c208e239cc36232d611145 (patch)
tree3bc0fe3cdb032a0f195469da70a75ddb444704a8 /sw
parent2f0b16a6a9bfff1646b14412e5918b6d483b9cdc (diff)
SfxViewShell never takes a null SfxViewFrame*
Change-Id: I36f3a5c77a7fb2d3cf267184e403e6cd24dbd70b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147112 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/inc/view.hxx2
-rw-r--r--sw/source/uibase/inc/pview.hxx2
-rw-r--r--sw/source/uibase/inc/srcview.hxx2
-rw-r--r--sw/source/uibase/inc/wview.hxx2
-rw-r--r--sw/source/uibase/uiview/pview.cxx10
-rw-r--r--sw/source/uibase/uiview/srcview.cxx6
-rw-r--r--sw/source/uibase/uiview/view.cxx8
-rw-r--r--sw/source/uibase/web/wview.cxx4
8 files changed, 18 insertions, 18 deletions
diff --git a/sw/inc/view.hxx b/sw/inc/view.hxx
index c3ed0f5808d7..ff0099ace634 100644
--- a/sw/inc/view.hxx
+++ b/sw/inc/view.hxx
@@ -618,7 +618,7 @@ public:
//apply Accessibility options
void ApplyAccessibilityOptions(SvtAccessibilityOptions const & rAccessibilityOptions);
- SwView(SfxViewFrame* pFrame, SfxViewShell*);
+ SwView(SfxViewFrame& rFrame, SfxViewShell*);
virtual ~SwView() override;
void NotifyDBChanged();
diff --git a/sw/source/uibase/inc/pview.hxx b/sw/source/uibase/inc/pview.hxx
index f37a55863bb8..af0f31d94788 100644
--- a/sw/source/uibase/inc/pview.hxx
+++ b/sw/source/uibase/inc/pview.hxx
@@ -293,7 +293,7 @@ public:
*/
void SetVScrollbarThumbPos( const sal_uInt16 _nNewThumbPos );
- SwPagePreview( SfxViewFrame* pFrame, SfxViewShell* );
+ SwPagePreview(SfxViewFrame& rFrame, SfxViewShell*);
virtual ~SwPagePreview() override;
};
diff --git a/sw/source/uibase/inc/srcview.hxx b/sw/source/uibase/inc/srcview.hxx
index caaecad67d6d..4b540aed2faa 100644
--- a/sw/source/uibase/inc/srcview.hxx
+++ b/sw/source/uibase/inc/srcview.hxx
@@ -56,7 +56,7 @@ private:
static void InitInterface_Impl();
public:
- SwSrcView(SfxViewFrame* pFrame, SfxViewShell*);
+ SwSrcView(SfxViewFrame& rFrame, SfxViewShell*);
virtual ~SwSrcView() override;
diff --git a/sw/source/uibase/inc/wview.hxx b/sw/source/uibase/inc/wview.hxx
index 1aa807b2ff21..90ce5af8940f 100644
--- a/sw/source/uibase/inc/wview.hxx
+++ b/sw/source/uibase/inc/wview.hxx
@@ -36,7 +36,7 @@ private:
static void InitInterface_Impl();
public:
- SwWebView(SfxViewFrame* pFrame, SfxViewShell*);
+ SwWebView(SfxViewFrame& rFrame, SfxViewShell*);
virtual ~SwWebView() override;
};
diff --git a/sw/source/uibase/uiview/pview.cxx b/sw/source/uibase/uiview/pview.cxx
index 84c1cf06680c..fd16c5b90725 100644
--- a/sw/source/uibase/uiview/pview.cxx
+++ b/sw/source/uibase/uiview/pview.cxx
@@ -1141,8 +1141,8 @@ void SwPagePreview::Init()
pESh->ResetModified();
}
-SwPagePreview::SwPagePreview(SfxViewFrame *pViewFrame, SfxViewShell* pOldSh):
- SfxViewShell( pViewFrame, SWVIEWFLAGS ),
+SwPagePreview::SwPagePreview(SfxViewFrame& rViewFrame, SfxViewShell* pOldSh):
+ SfxViewShell(rViewFrame, SWVIEWFLAGS),
m_pViewWin( VclPtr<SwPagePreviewWin>::Create(&GetViewFrame()->GetWindow(), *this ) ),
m_nNewPage(USHRT_MAX),
m_sPageStr(SwResId(STR_PAGE)),
@@ -1159,12 +1159,12 @@ SwPagePreview::SwPagePreview(SfxViewFrame *pViewFrame, SfxViewShell* pOldSh):
SfxShell::SetContextName(vcl::EnumContext::GetContextName(vcl::EnumContext::Context::Printpreview));
- SfxObjectShell* pObjShell = pViewFrame->GetObjectShell();
+ SfxObjectShell* pObjShell = rViewFrame.GetObjectShell();
if ( !pOldSh )
{
// Exists already a view on the document?
SfxViewFrame *pF = SfxViewFrame::GetFirst( pObjShell );
- if ( pF == pViewFrame )
+ if (pF == &rViewFrame)
pF = SfxViewFrame::GetNext( *pF, pObjShell );
if ( pF )
pOldSh = pF->GetViewShell();
@@ -1207,7 +1207,7 @@ SwPagePreview::SwPagePreview(SfxViewFrame *pViewFrame, SfxViewShell* pOldSh):
pNew = new SwViewShell( *pVS, m_pViewWin, nullptr, VSHELLFLAG_ISPREVIEW );
else
pNew = new SwViewShell(
- *static_cast<SwDocShell*>(pViewFrame->GetObjectShell())->GetDoc(),
+ *static_cast<SwDocShell*>(rViewFrame.GetObjectShell())->GetDoc(),
m_pViewWin, nullptr, nullptr, VSHELLFLAG_ISPREVIEW );
m_pViewWin->SetViewShell( pNew );
diff --git a/sw/source/uibase/uiview/srcview.cxx b/sw/source/uibase/uiview/srcview.cxx
index 2a4487f9251f..bce3f54f3314 100644
--- a/sw/source/uibase/uiview/srcview.cxx
+++ b/sw/source/uibase/uiview/srcview.cxx
@@ -187,9 +187,9 @@ static OUString lcl_ConvertTabsToSpaces( const OUString& sLine )
return aRet;
}
-SwSrcView::SwSrcView(SfxViewFrame* pViewFrame, SfxViewShell*) :
- SfxViewShell( pViewFrame, SWSRCVIEWFLAGS ),
- m_aEditWin( VclPtr<SwSrcEditWindow>::Create( &pViewFrame->GetWindow(), this ) ),
+SwSrcView::SwSrcView(SfxViewFrame& rViewFrame, SfxViewShell*) :
+ SfxViewShell( rViewFrame, SWSRCVIEWFLAGS ),
+ m_aEditWin( VclPtr<SwSrcEditWindow>::Create( &rViewFrame.GetWindow(), this ) ),
m_bSourceSaved(false),
m_eLoadEncoding(RTL_TEXTENCODING_DONTKNOW)
{
diff --git a/sw/source/uibase/uiview/view.cxx b/sw/source/uibase/uiview/view.cxx
index 0dad5e371de9..7d346e945e0d 100644
--- a/sw/source/uibase/uiview/view.cxx
+++ b/sw/source/uibase/uiview/view.cxx
@@ -746,13 +746,13 @@ void SwView::CheckReadonlySelection()
}
}
-SwView::SwView( SfxViewFrame *_pFrame, SfxViewShell* pOldSh )
- : SfxViewShell( _pFrame, SWVIEWFLAGS ),
+SwView::SwView(SfxViewFrame& _rFrame, SfxViewShell* pOldSh)
+ : SfxViewShell(_rFrame, SWVIEWFLAGS),
m_aTimer( "sw::SwView m_aTimer" ),
m_nNewPage(USHRT_MAX),
m_nOldPageNum(0),
m_pNumRuleNodeFromDoc(nullptr),
- m_pEditWin( VclPtr<SwEditWin>::Create( &_pFrame->GetWindow(), *this ) ),
+ m_pEditWin( VclPtr<SwEditWin>::Create( &_rFrame.GetWindow(), *this ) ),
m_pShell(nullptr),
m_pFormShell(nullptr),
m_pHScrollbar(nullptr),
@@ -821,7 +821,7 @@ SwView::SwView( SfxViewFrame *_pFrame, SfxViewShell* pOldSh )
m_aTimer.SetTimeout( 120 );
- SwDocShell& rDocSh = dynamic_cast<SwDocShell&>(*_pFrame->GetObjectShell());
+ SwDocShell& rDocSh = dynamic_cast<SwDocShell&>(*_rFrame.GetObjectShell());
bool bOldModifyFlag = rDocSh.IsEnableSetModified();
if (bOldModifyFlag)
rDocSh.EnableSetModified( false );
diff --git a/sw/source/uibase/web/wview.cxx b/sw/source/uibase/web/wview.cxx
index 2fa09630e65a..98be7a6508ea 100644
--- a/sw/source/uibase/web/wview.cxx
+++ b/sw/source/uibase/web/wview.cxx
@@ -81,8 +81,8 @@ void SwWebView::InitInterface_Impl()
}
-SwWebView::SwWebView(SfxViewFrame* _pFrame, SfxViewShell* _pShell) :
- SwView(_pFrame, _pShell)
+SwWebView::SwWebView(SfxViewFrame& _rFrame, SfxViewShell* _pShell) :
+ SwView(_rFrame, _pShell)
{
}