sfx2/source/view/viewfrm.cxx | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-)
New commits: commit 67070d583871ec77400b434b4f976c63768ad5b3 Author: Caolán McNamara <caol...@redhat.com> Date: Tue Feb 28 10:35:50 2017 +0000 don't have to create SfxApplication if none exists Change-Id: I312f00e8b2956470eaa496abfa2687c296f256ae Reviewed-on: https://gerrit.libreoffice.org/34717 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Caolán McNamara <caol...@redhat.com> Tested-by: Caolán McNamara <caol...@redhat.com> diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index 5848f6b..12fc132 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -1433,10 +1433,13 @@ SfxViewFrame::~SfxViewFrame() GetFrame().SetCurrentViewFrame_Impl( nullptr ); // Unregister from the Frame List. - SfxApplication *pSfxApp = SfxGetpApp(); - SfxViewFrameArr_Impl &rFrames = pSfxApp->GetViewFrames_Impl(); - SfxViewFrameArr_Impl::iterator it = std::find( rFrames.begin(), rFrames.end(), this ); - rFrames.erase( it ); + SfxApplication *pSfxApp = SfxApplication::Get(); + if (pSfxApp) + { + SfxViewFrameArr_Impl &rFrames = pSfxApp->GetViewFrames_Impl(); + SfxViewFrameArr_Impl::iterator it = std::find( rFrames.begin(), rFrames.end(), this ); + rFrames.erase( it ); + } // Delete Member KillDispatcher_Impl(); @@ -1472,7 +1475,10 @@ SfxViewFrame* SfxViewFrame::GetFirst bool bOnlyIfVisible ) { - SfxApplication *pSfxApp = SfxGetpApp(); + SfxApplication *pSfxApp = SfxApplication::Get(); + if (!pSfxApp) + return nullptr; + SfxViewFrameArr_Impl &rFrames = pSfxApp->GetViewFrames_Impl(); // search for a SfxDocument of the specified type @@ -1495,7 +1501,10 @@ SfxViewFrame* SfxViewFrame::GetNext bool bOnlyIfVisible ) { - SfxApplication *pSfxApp = SfxGetpApp(); + SfxApplication *pSfxApp = SfxApplication::Get(); + if (!pSfxApp) + return nullptr; + SfxViewFrameArr_Impl &rFrames = pSfxApp->GetViewFrames_Impl(); // refind the specified predecessor
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits