[Libreoffice-commits] core.git: sw/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Tue Nov 6 11:51:28 UTC 2018


 sw/source/uibase/docvw/frmsidebarwincontainer.cxx |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

New commits:
commit e581cc2e5eb943f2cbab43b026cad42a340c8ace
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Tue Nov 6 10:32:00 2018 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Tue Nov 6 12:50:13 2018 +0100

    tdf#121179 FILEOPEN: Crash opening a certain file (gtk/gtk3)
    
    regression from
        commit 16b2b4f27acb83fc651b8484dead53ebd0e269e1
        Simplify containers iterations in sw/source/ui*
    
    Change-Id: Id77c41acf1cb891ffa23ca1300633031e367d0d1
    Reviewed-on: https://gerrit.libreoffice.org/62935
    Reviewed-by: Arkadiy Illarionov <qarkai at gmail.com>
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/sw/source/uibase/docvw/frmsidebarwincontainer.cxx b/sw/source/uibase/docvw/frmsidebarwincontainer.cxx
index 5769386a2b56..f8abc3aa1329 100644
--- a/sw/source/uibase/docvw/frmsidebarwincontainer.cxx
+++ b/sw/source/uibase/docvw/frmsidebarwincontainer.cxx
@@ -140,11 +140,13 @@ sw::annotation::SwAnnotationWin* SwFrameSidebarWinContainer::get( const SwFrame&
     if ( aFrameIter != mpFrameSidebarWinContainer->end() && nIndex >= 0 )
     {
         SidebarWinContainer& rSidebarWinContainer = (*aFrameIter).second;
-        auto aIter = rSidebarWinContainer.begin();
-        std::advance(aIter, nIndex);
-        pRet = (*aIter).second;
+        if (nIndex < sal_Int32(rSidebarWinContainer.size()))
+        {
+            auto aIter = rSidebarWinContainer.begin();
+            std::advance(aIter, nIndex);
+            pRet = (*aIter).second;
+        }
     }
-
     return pRet;
 }
 


More information about the Libreoffice-commits mailing list