[Libreoffice-commits] core.git: include/editeng sc/source sd/source sw/source

Mike Kaganski (via logerrit) logerrit at kemper.freedesktop.org
Thu Jan 2 10:02:48 UTC 2020


 include/editeng/urlfieldhelper.hxx   |    4 ++++
 sc/source/ui/drawfunc/drtxtob.cxx    |    2 +-
 sd/source/ui/view/drviews2.cxx       |    4 +++-
 sd/source/ui/view/drviews7.cxx       |    3 +--
 sd/source/ui/view/drviewsf.cxx       |    2 +-
 sw/source/uibase/shells/drwtxtex.cxx |    2 +-
 6 files changed, 11 insertions(+), 6 deletions(-)

New commits:
commit e590d1ab4a3f605141d653b575d645453dba57c9
Author:     Mike Kaganski <mike.kaganski at collabora.com>
AuthorDate: Thu Jan 2 11:34:05 2020 +0300
Commit:     Mike Kaganski <mike.kaganski at collabora.com>
CommitDate: Thu Jan 2 11:02:18 2020 +0100

    tdf#129712: check if outliner view pointer is valid to avoid crash
    
    Regression after commit 64233bbaa0e91ddf14d59ae7547df6bbfa60adcc.
    
    editenglo.dll!std::unique_ptr<EditView,std::default_delete<EditView>>::operator*()
            at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.24.28314\include\memory(1886)
    editenglo.dll!OutlinerView::GetEditView()
            at C:\lo\src\core\include\editeng\outliner.hxx(208)
    sdlo.dll!sd::DrawViewShell::GetAttrState(SfxItemSet & rSet)
            at C:\lo\src\core\sd\source\ui\view\drviewsf.cxx(514)
    sdlo.dll!SfxStubGraphicViewShellGetAttrState(SfxShell * pShell, SfxItemSet & rSet)
            at C:\lo\src\core\workdir\SdiTarget\sd\sdi\sdgslots.hxx(1524)
    sfxlo.dll!SfxShell::CallState(void(*)(SfxShell *, SfxItemSet &) pFunc, SfxItemSet & rSet)
            at C:\lo\src\core\include\sfx2\shell.hxx(199)
    sfxlo.dll!SfxDispatcher::FillState_(const SfxSlotServer & rSvr, SfxItemSet & rState, const SfxSlot * pRealSlot)
            at C:\lo\src\core\sfx2\source\control\dispatch.cxx(1672)
    sfxlo.dll!SfxBindings::Update_Impl(SfxStateCache & rCache)
            at C:\lo\src\core\sfx2\source\control\bindings.cxx(270)
    sfxlo.dll!SfxBindings::NextJob_Impl(const Timer * pTimer)
            at C:\lo\src\core\sfx2\source\control\bindings.cxx(1285)
    sfxlo.dll!SfxBindings::NextJob(Timer * pTimer)
            at C:\lo\src\core\sfx2\source\control\bindings.cxx(1230)
    sfxlo.dll!SfxBindings::LinkStubNextJob(void * instance, Timer * data)
            at C:\lo\src\core\sfx2\source\control\bindings.cxx(1227)
    vcllo.dll!Link<Timer *,void>::Call(Timer * data)
            at C:\lo\src\core\include\tools\link.hxx(111)
    vcllo.dll!Timer::Invoke()
            at C:\lo\src\core\vcl\source\app\timer.cxx(76)
    vcllo.dll!Scheduler::ProcessTaskScheduling()
            at C:\lo\src\core\vcl\source\app\scheduler.cxx(478)
    vcllo.dll!Scheduler::CallbackTaskScheduling()
            at C:\lo\src\core\vcl\source\app\scheduler.cxx(288)
    vcllo.dll!SalTimer::CallCallback()
            at C:\lo\src\core\vcl\inc\saltimer.hxx(55)
    vclplug_winlo.dll!WinSalTimer::ImplHandleElapsedTimer()
            at C:\lo\src\core\vcl\win\app\saltimer.cxx(164)
    vclplug_winlo.dll!WinSalTimer::ImplHandleTimerEvent(unsigned __int64 aWPARAM)
            at C:\lo\src\core\vcl\win\app\saltimer.cxx(174)
    vclplug_winlo.dll!SalComWndProc(HWND__ * __formal, unsigned int nMsg, unsigned __int64 wParam, __int64 lParam, bool & rDef)
            at C:\lo\src\core\vcl\win\app\salinst.cxx(626)
    vclplug_winlo.dll!SalComWndProcW(HWND__ * hWnd, unsigned int nMsg, unsigned __int64 wParam, __int64 lParam)
            at C:\lo\src\core\vcl\win\app\salinst.cxx(658)
    user32.dll!UserCallWinProcCheckWow()
    user32.dll!DispatchMessageWorker()
    vclplug_winlo.dll!ImplSalDispatchMessage(const tagMSG * pMsg)
            at C:\lo\src\core\vcl\win\app\salinst.cxx(420)
    vclplug_winlo.dll!ImplSalYield(bool bWait, bool bHandleAllCurrentEvents)
            at C:\lo\src\core\vcl\win\app\salinst.cxx(493)
    vclplug_winlo.dll!WinSalInstance::DoYield(bool bWait, bool bHandleAllCurrentEvents)
            at C:\lo\src\core\vcl\win\app\salinst.cxx(522)
    vcllo.dll!ImplYield(bool i_bWait, bool i_bAllEvents)
            at C:\lo\src\core\vcl\source\app\svapp.cxx(446)
    vcllo.dll!Application::Yield()
            at C:\lo\src\core\vcl\source\app\svapp.cxx(511)
    vcllo.dll!Application::Execute()
            at C:\lo\src\core\vcl\source\app\svapp.cxx(427)
    sofficeapp.dll!desktop::Desktop::Main()
            at C:\lo\src\core\desktop\source\app\app.cxx(1609)
    vcllo.dll!ImplSVMain()
            at C:\lo\src\core\vcl\source\app\svmain.cxx(191)
    vcllo.dll!SVMain()
            at C:\lo\src\core\vcl\source\app\svmain.cxx(226)
    sofficeapp.dll!soffice_main()
            at C:\lo\src\core\desktop\source\app\sofficemain.cxx(171)
    soffice.bin!sal_main()
            at C:\lo\src\core\desktop\source\app\main.c(48)
    soffice.bin!main(int argc, char * * argv)
            at C:\lo\src\core\desktop\source\app\main.c(47)
    soffice.bin!invoke_main()
            at d:\agent\_work\5\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl(79)
    soffice.bin!__scrt_common_main_seh()
            at d:\agent\_work\5\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl(288)
    soffice.bin!__scrt_common_main()
            at d:\agent\_work\5\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl(331)
    soffice.bin!mainCRTStartup()
            at d:\agent\_work\5\s\src\vctools\crt\vcstartup\src\startup\exe_main.cpp(17)
    kernel32.dll!BaseThreadInitThunk()
    ntdll.dll!RtlUserThreadStart()
    
    Change-Id: Ia9ba183bc1be2f22082ac3833e57435dd8462adf
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86097
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>

diff --git a/include/editeng/urlfieldhelper.hxx b/include/editeng/urlfieldhelper.hxx
index e6c7c92935a4..9a1d53d15512 100644
--- a/include/editeng/urlfieldhelper.hxx
+++ b/include/editeng/urlfieldhelper.hxx
@@ -19,6 +19,10 @@ class EDITENG_DLLPUBLIC URLFieldHelper
 public:
     static void RemoveURLField(EditView& pEditView);
     static bool IsCursorAtURLField(const EditView& pEditView);
+    static bool IsCursorAtURLField(const OutlinerView* pOLV)
+    {
+        return pOLV && IsCursorAtURLField(pOLV->GetEditView());
+    }
 };
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
diff --git a/sc/source/ui/drawfunc/drtxtob.cxx b/sc/source/ui/drawfunc/drtxtob.cxx
index f3bd9f7cb9cf..592ab19aea31 100644
--- a/sc/source/ui/drawfunc/drtxtob.cxx
+++ b/sc/source/ui/drawfunc/drtxtob.cxx
@@ -411,7 +411,7 @@ void ScDrawTextObjectBar::GetState( SfxItemSet& rSet )
         || rSet.GetItemState(SID_REMOVE_HYPERLINK) != SfxItemState::UNKNOWN)
     {
         SdrView* pView = pViewData->GetScDrawView();
-        if( !URLFieldHelper::IsCursorAtURLField(pView->GetTextEditOutlinerView()->GetEditView()) )
+        if( !URLFieldHelper::IsCursorAtURLField(pView->GetTextEditOutlinerView()) )
         {
             rSet.DisableItem( SID_OPEN_HYPERLINK );
             rSet.DisableItem( SID_EDIT_HYPERLINK );
diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx
index 3097f9496542..6970fe0aeb28 100644
--- a/sd/source/ui/view/drviews2.cxx
+++ b/sd/source/ui/view/drviews2.cxx
@@ -1205,8 +1205,10 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
                 // First make sure the field is selected
                 OutlinerView* pOutView = mpDrawView->GetTextEditOutlinerView();
                 if (pOutView)
+                {
                     pOutView->SelectFieldAtCursor();
-                URLFieldHelper::RemoveURLField(pOutView->GetEditView());
+                    URLFieldHelper::RemoveURLField(pOutView->GetEditView());
+                }
             }
         }
         Cancel();
diff --git a/sd/source/ui/view/drviews7.cxx b/sd/source/ui/view/drviews7.cxx
index 0874a587a3a1..7fd0ce58368e 100644
--- a/sd/source/ui/view/drviews7.cxx
+++ b/sd/source/ui/view/drviews7.cxx
@@ -1449,8 +1449,7 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet )
     {
         if( mpDrawView->IsTextEdit() )
         {
-            OutlinerView* pOLV = mpDrawView->GetTextEditOutlinerView();
-            if (pOLV && URLFieldHelper::IsCursorAtURLField(pOLV->GetEditView()))
+            if (URLFieldHelper::IsCursorAtURLField(mpDrawView->GetTextEditOutlinerView()))
                 bDisableEditHyperlink = false;
         }
         else
diff --git a/sd/source/ui/view/drviewsf.cxx b/sd/source/ui/view/drviewsf.cxx
index 906f4b331e90..95ecd4a0d52a 100644
--- a/sd/source/ui/view/drviewsf.cxx
+++ b/sd/source/ui/view/drviewsf.cxx
@@ -511,7 +511,7 @@ void DrawViewShell::GetAttrState( SfxItemSet& rSet )
 
             case SID_REMOVE_HYPERLINK:
             {
-                if (!URLFieldHelper::IsCursorAtURLField(mpDrawView->GetTextEditOutlinerView()->GetEditView()))
+                if (!URLFieldHelper::IsCursorAtURLField(mpDrawView->GetTextEditOutlinerView()))
                     rSet.DisableItem(nWhich);
             }
             break;
diff --git a/sw/source/uibase/shells/drwtxtex.cxx b/sw/source/uibase/shells/drwtxtex.cxx
index 4f67f27449d9..c63f96eb563c 100644
--- a/sw/source/uibase/shells/drwtxtex.cxx
+++ b/sw/source/uibase/shells/drwtxtex.cxx
@@ -978,7 +978,7 @@ void SwDrawTextShell::GetState(SfxItemSet& rSet)
             case SID_OPEN_HYPERLINK:
             case SID_COPY_HYPERLINK_LOCATION:
             {
-                if (!URLFieldHelper::IsCursorAtURLField(pOLV->GetEditView()))
+                if (!URLFieldHelper::IsCursorAtURLField(pOLV))
                     rSet.DisableItem(nWhich);
             }
             break;


More information about the Libreoffice-commits mailing list