diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-11-02 12:03:28 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-11-03 06:30:11 +0000 |
commit | 2b3de550ef1e28cd4231352c91634f67aa6d642f (patch) | |
tree | 6177171ab6f12306f93e66f7b43429dcd81fa9fd /sw/source | |
parent | 063593972e556f8f0e65881ccd77d5ea64175e8b (diff) |
remove pParentFrame from SfxFrame
Found by the singlevalfields loplugin.
Dead as least as far back as
commit 93a7b558588be1f12e137329548b706daccc07df
Author: Frank Schoenheit [fs] <frank.schoenheit@sun.com>
Date: Fri Nov 27 21:16:24 2009 +0100
[CWS autorecovery] merged SfxTopFrame into SfxFrame
SfxTopFrame was the only class deriving from the abstract class SfxFrame, so both
can effectively be treated as one class.
Arguably when that commit was done, SfxFrame should also have been renamed
to SfxTopFrame, since that it was it now seems to be.
Expanding the nullptr value off that field means that:
SfxFrame::GetTopFrame
always return this
SfxFrame::IsParent
always returns false
SfxViewFrame::GetTopFrame
is now the same as SfxViewFrame::GetFrame
SfxViewFrame::GetParentViewFrame
now returns null
Change-Id: Iac088fa485c3d7299d1553845ced2f5ced3c85f2
Reviewed-on: https://gerrit.libreoffice.org/30485
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source')
-rw-r--r-- | sw/source/ui/chrdlg/chardlg.cxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/docvw/romenu.cxx | 6 | ||||
-rw-r--r-- | sw/source/uibase/shells/basesh.cxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/shells/frmsh.cxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/shells/grfsh.cxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/uiview/pview.cxx | 3 | ||||
-rw-r--r-- | sw/source/uibase/uiview/view.cxx | 7 |
7 files changed, 8 insertions, 16 deletions
diff --git a/sw/source/ui/chrdlg/chardlg.cxx b/sw/source/ui/chrdlg/chardlg.cxx index 3d37b43c8248..1211e6efb5f7 100644 --- a/sw/source/ui/chrdlg/chardlg.cxx +++ b/sw/source/ui/chrdlg/chardlg.cxx @@ -169,7 +169,7 @@ SwCharURLPage::SwCharURLPage(vcl::Window* pParent, const SfxItemSet& rCoreSet) ::FillCharStyleListBox(*m_pNotVisitedLB, pView->GetDocShell()); TargetList* pList = new TargetList; - const SfxFrame& rFrame = pView->GetViewFrame()->GetTopFrame(); + const SfxFrame& rFrame = pView->GetViewFrame()->GetFrame(); rFrame.GetTargetList(*pList); if ( !pList->empty() ) { diff --git a/sw/source/uibase/docvw/romenu.cxx b/sw/source/uibase/docvw/romenu.cxx index d8ebac8b8540..11a4e301e8ae 100644 --- a/sw/source/uibase/docvw/romenu.cxx +++ b/sw/source/uibase/docvw/romenu.cxx @@ -186,10 +186,8 @@ SwReadOnlyPopup::SwReadOnlyPopup( const Point &rDPos, SwView &rV ) : else EnableItem( MN_READONLY_LOADGRAPHIC, false ); - bool bReloadFrame = nullptr != rSh.GetView().GetViewFrame()->GetFrame().GetParentFrame(); - EnableItem( MN_READONLY_RELOAD_FRAME, - bReloadFrame ); - EnableItem( MN_READONLY_RELOAD, !bReloadFrame); + EnableItem( MN_READONLY_RELOAD_FRAME, false ); + EnableItem( MN_READONLY_RELOAD); Check( MN_READONLY_EDITDOC, SID_EDITDOC, rDis ); Check( MN_READONLY_SELECTION_MODE, FN_READONLY_SELECTION_MODE, rDis ); diff --git a/sw/source/uibase/shells/basesh.cxx b/sw/source/uibase/shells/basesh.cxx index 7eb5f48de822..f7daef9602c6 100644 --- a/sw/source/uibase/shells/basesh.cxx +++ b/sw/source/uibase/shells/basesh.cxx @@ -170,7 +170,7 @@ static void lcl_UpdateIMapDlg( SwWrtShell& rSh ) void* pEditObj = GraphicType::NONE != nGrfType && GraphicType::Default != nGrfType ? rSh.GetIMapInventor() : nullptr; std::unique_ptr<TargetList> pList(new TargetList); - rSh.GetView().GetViewFrame()->GetTopFrame().GetTargetList(*pList); + rSh.GetView().GetViewFrame()->GetFrame().GetTargetList(*pList); SfxItemSet aSet( rSh.GetAttrPool(), RES_URL, RES_URL ); rSh.GetFlyFrameAttr( aSet ); diff --git a/sw/source/uibase/shells/frmsh.cxx b/sw/source/uibase/shells/frmsh.cxx index d1eb5f0b56dc..764d0049e35e 100644 --- a/sw/source/uibase/shells/frmsh.cxx +++ b/sw/source/uibase/shells/frmsh.cxx @@ -464,7 +464,7 @@ void SwFrameShell::Execute(SfxRequest &rReq) if(pArgs && pArgs->GetItemState(FN_FORMAT_FRAME_DLG, false, &pItem) == SfxItemState::SET) sDefPage = OUStringToOString(static_cast<const SfxStringItem *>(pItem)->GetValue(), RTL_TEXTENCODING_UTF8); - aSet.Put(SfxFrameItem( SID_DOCFRAME, &GetView().GetViewFrame()->GetTopFrame())); + aSet.Put(SfxFrameItem( SID_DOCFRAME, &GetView().GetViewFrame()->GetFrame())); FieldUnit eMetric = ::GetDfltMetric(dynamic_cast<SwWebView*>( &GetView()) != nullptr ); SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast< sal_uInt16 >(eMetric) )); SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); diff --git a/sw/source/uibase/shells/grfsh.cxx b/sw/source/uibase/shells/grfsh.cxx index 91307fbcf658..8553c3ed8f38 100644 --- a/sw/source/uibase/shells/grfsh.cxx +++ b/sw/source/uibase/shells/grfsh.cxx @@ -337,7 +337,7 @@ void SwGrfShell::Execute(SfxRequest &rReq) aSet.Put(SfxBoolItem(FN_KEEP_ASPECT_RATIO, aUsrPref.IsKeepRatio())); aSet.Put(SfxBoolItem( SID_ATTR_GRAF_KEEP_ZOOM, aUsrPref.IsGrfKeepZoom())); - aSet.Put(SfxFrameItem( SID_DOCFRAME, &GetView().GetViewFrame()->GetTopFrame())); + aSet.Put(SfxFrameItem( SID_DOCFRAME, &GetView().GetViewFrame()->GetFrame())); SfxObjectShell * sh = rSh.GetDoc()->GetPersist(); if (sh != nullptr && sh->HasName()) diff --git a/sw/source/uibase/uiview/pview.cxx b/sw/source/uibase/uiview/pview.cxx index a30321c93651..9b89c3965000 100644 --- a/sw/source/uibase/uiview/pview.cxx +++ b/sw/source/uibase/uiview/pview.cxx @@ -1185,8 +1185,7 @@ SwPagePreview::SwPagePreview(SfxViewFrame *pViewFrame, SfxViewShell* pOldSh): m_sPageStr(SW_RES(STR_PAGE)), m_pHScrollbar(nullptr), m_pVScrollbar(nullptr), - m_pScrollFill(VclPtr<ScrollBarBox>::Create( &pViewFrame->GetWindow(), - pViewFrame->GetFrame().GetParentFrame() ? 0 : WB_SIZEABLE )), + m_pScrollFill(VclPtr<ScrollBarBox>::Create( &pViewFrame->GetWindow(), WB_SIZEABLE )), mnPageCount( 0 ), mbResetFormDesignMode( false ), mbFormDesignModeToReset( false ) diff --git a/sw/source/uibase/uiview/view.cxx b/sw/source/uibase/uiview/view.cxx index b5a0d53b7b42..b0dba6ee354f 100644 --- a/sw/source/uibase/uiview/view.cxx +++ b/sw/source/uibase/uiview/view.cxx @@ -691,7 +691,7 @@ SwView::SwView( SfxViewFrame *_pFrame, SfxViewShell* pOldSh ) m_pFormShell(nullptr), m_pHScrollbar(nullptr), m_pVScrollbar(nullptr), - m_pScrollFill(VclPtr<ScrollBarBox>::Create( &_pFrame->GetWindow(), _pFrame->GetFrame().GetParentFrame() ? 0 : WB_SIZEABLE )), + m_pScrollFill(VclPtr<ScrollBarBox>::Create( &_pFrame->GetWindow(), WB_SIZEABLE )), m_pVRuler(VclPtr<SvxRuler>::Create(&GetViewFrame()->GetWindow(), m_pEditWin, SvxRulerSupportFlags::TABS | SvxRulerSupportFlags::PARAGRAPH_MARGINS_VERTICAL| SvxRulerSupportFlags::BORDERS | SvxRulerSupportFlags::REDUCED_METRIC, @@ -874,11 +874,6 @@ SwView::SwView( SfxViewFrame *_pFrame, SfxViewShell* pOldSh ) m_pVRuler->SetActive(); SfxViewFrame* pViewFrame = GetViewFrame(); - if( pViewFrame->GetFrame().GetParentFrame()) - { - aUsrPref.SetViewHRuler(false); - aUsrPref.SetViewVRuler(false); - } StartListening(*pViewFrame, true); StartListening(rDocSh, true); |