[Libreoffice-commits] core.git: 8 commits - include/vcl sd/source svtools/source svx/source vcl/inc vcl/source

Caolán McNamara caolanm at redhat.com
Mon Oct 19 07:44:11 PDT 2015


 include/vcl/svapp.hxx                               |    4 ++
 sd/source/ui/annotations/annotationmanager.cxx      |    4 ++
 sd/source/ui/annotations/annotationwindow.cxx       |    4 --
 sd/source/ui/annotations/annotationwindow.hxx       |    2 -
 sd/source/ui/dlg/sdtreelb.cxx                       |    2 +
 svtools/source/control/valueset.cxx                 |    2 -
 svx/source/sidebar/possize/PosSizePropertyPanel.cxx |    7 +++--
 svx/source/svdraw/svdmrkv.cxx                       |    4 ++
 vcl/inc/svdata.hxx                                  |    1 
 vcl/source/app/svapp.cxx                            |   28 +++++++++++++++-----
 10 files changed, 41 insertions(+), 17 deletions(-)

New commits:
commit 7fb1b147507ad991de974c7c331816225dc5c088
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Oct 19 15:41:03 2015 +0100

    add Application::EndAllPopups
    
    Change-Id: Id4548aa2e32f736f4cd332ba824137d88fe963fc

diff --git a/include/vcl/svapp.hxx b/include/vcl/svapp.hxx
index 1755b50..429cf08 100644
--- a/include/vcl/svapp.hxx
+++ b/include/vcl/svapp.hxx
@@ -1485,6 +1485,10 @@ public:
     */
     static void                 EndAllDialogs();
 
+    /** Cancel all open popups
+    */
+    static void                 EndAllPopups();
+
     ///@}
 
     // For vclbootstrapprotector:
diff --git a/vcl/inc/svdata.hxx b/vcl/inc/svdata.hxx
index 0c850c03..48749ea 100644
--- a/vcl/inc/svdata.hxx
+++ b/vcl/inc/svdata.hxx
@@ -163,6 +163,7 @@ struct ImplSVAppData
 
     DECL_STATIC_LINK_TYPED(ImplSVAppData, ImplQuitMsg, void*, void);
     DECL_STATIC_LINK_TYPED(ImplSVAppData, ImplEndAllDialogsMsg, void*, void);
+    DECL_STATIC_LINK_TYPED(ImplSVAppData, ImplEndAllPopupsMsg, void*, void);
     DECL_STATIC_LINK_TYPED(ImplSVAppData, ImplVclEventTestingHdl, void*, void);
     DECL_LINK_TYPED(VclEventTestingHdl, Idle*, void);
 };
diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx
index 16467e8..7a474de 100644
--- a/vcl/source/app/svapp.cxx
+++ b/vcl/source/app/svapp.cxx
@@ -37,6 +37,7 @@
 #include <unotools/syslocaleoptions.hxx>
 
 #include "vcl/dialog.hxx"
+#include "vcl/floatwin.hxx"
 #include "vcl/settings.hxx"
 #include "vcl/keycod.hxx"
 #include "vcl/event.hxx"
@@ -328,6 +329,13 @@ const vcl::KeyCode* Application::GetReservedKeyCode( sal_uLong i )
         return &ImplReservedKeys::get()->first[i].mKeyCode;
 }
 
+IMPL_STATIC_LINK_NOARG_TYPED( ImplSVAppData, ImplEndAllPopupsMsg, void*, void )
+{
+    ImplSVData* pSVData = ImplGetSVData();
+    while (pSVData->maWinData.mpFirstFloat)
+        pSVData->maWinData.mpFirstFloat->EndPopupMode(FloatWinPopupEndFlags::Cancel);
+}
+
 IMPL_STATIC_LINK_NOARG_TYPED( ImplSVAppData, ImplEndAllDialogsMsg, void*, void )
 {
     vcl::Window* pAppWindow = Application::GetFirstTopLevelWindow();
@@ -343,6 +351,12 @@ void Application::EndAllDialogs()
     Application::PostUserEvent( LINK( NULL, ImplSVAppData, ImplEndAllDialogsMsg ) );
 }
 
+void Application::EndAllPopups()
+{
+    Application::PostUserEvent( LINK( NULL, ImplSVAppData, ImplEndAllPopupsMsg ) );
+}
+
+
 namespace
 {
     bool InjectKeyEvent(SvStream& rStream)
@@ -382,6 +396,7 @@ namespace
 
     void CloseDialogsAndQuit()
     {
+        Application::EndAllPopups();
         Application::EndAllDialogs();
         Application::Quit();
     }
commit 6c39f7bba64fd55488f840675fa83c3ba241bc74
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Oct 19 15:33:43 2015 +0100

    afl-eventtesting: pCursor is null
    
    Change-Id: I24d29ffc3cfcb00e513a5267619e143b028355ce

diff --git a/sd/source/ui/dlg/sdtreelb.cxx b/sd/source/ui/dlg/sdtreelb.cxx
index fafaafe..7993f5d 100644
--- a/sd/source/ui/dlg/sdtreelb.cxx
+++ b/sd/source/ui/dlg/sdtreelb.cxx
@@ -1083,6 +1083,8 @@ void SdPageObjsTLB::KeyInput( const KeyEvent& rKEvt )
     {
         // commented code from svtools/source/contnr/svimpbox.cxx
         SvTreeListEntry* pCursor = GetCurEntry();
+        if (!pCursor)
+            return;
         if( pCursor->HasChildren() || pCursor->HasChildrenOnDemand() )
         {
             if( IsExpanded( pCursor ) )
commit 4ec44fc1a8cf7cdfb6ddceacdaf7354551064971
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Oct 19 15:24:02 2015 +0100

    afl-eventtesting: view is null
    
    but docshell isn't and we're using the view apparently
    to get the shell we already have
    
    Change-Id: Ibc2021245191a75f65ec655a2d1929601a2611b5

diff --git a/sd/source/ui/annotations/annotationwindow.cxx b/sd/source/ui/annotations/annotationwindow.cxx
index 693f84e..e8ea2e9 100644
--- a/sd/source/ui/annotations/annotationwindow.cxx
+++ b/sd/source/ui/annotations/annotationwindow.cxx
@@ -204,7 +204,6 @@ void AnnotationTextWindow::MouseButtonDown( const MouseEvent& rMEvt )
     GrabFocus();
     if ( mpOutlinerView )
         mpOutlinerView->MouseButtonDown( rMEvt );
-    // todo mpOutlinerView->DocView()->GetViewFrame()->GetBindings().InvalidateAll(sal_False);
 }
 
 void AnnotationTextWindow::MouseButtonUp( const MouseEvent& rMEvt )
@@ -276,7 +275,6 @@ AnnotationWindow::AnnotationWindow( AnnotationManagerImpl& rManager, DrawDocShel
 : FloatingWindow(pParent, WB_SYSTEMWINDOW|WB_BORDER|WB_NEEDSFOCUS)
 , mrManager( rManager )
 , mpDocShell( pDocShell )
-, mpView( pDocShell->GetViewShell()->GetView() )
 , mpDoc( pDocShell->GetDoc() )
 , mpOutlinerView(0)
 , mpOutliner(0)
@@ -638,7 +636,7 @@ void AnnotationWindow::Deactivate()
                 if( mpDoc->IsUndoEnabled() )
                     mpDoc->EndUndo();
 
-                DocView()->GetDocSh()->SetModified();
+                mpDocShell->SetModified();
             }
 
         }
diff --git a/sd/source/ui/annotations/annotationwindow.hxx b/sd/source/ui/annotations/annotationwindow.hxx
index 0dc405c..9e25f44 100644
--- a/sd/source/ui/annotations/annotationwindow.hxx
+++ b/sd/source/ui/annotations/annotationwindow.hxx
@@ -79,7 +79,6 @@ class AnnotationWindow : public FloatingWindow
     private:
         AnnotationManagerImpl&  mrManager;
         DrawDocShell*           mpDocShell;
-        View*                   mpView;
         SdDrawDocument*         mpDoc;
 
         OutlinerView*           mpOutlinerView;
@@ -114,7 +113,6 @@ class AnnotationWindow : public FloatingWindow
 
         DrawDocShell*           DocShell()      { return mpDocShell; }
         OutlinerView*           getView()       { return mpOutlinerView; }
-        sd::View*               DocView()       { return mpView; }
         Outliner*               Engine()        { return mpOutliner; }
         SdDrawDocument*         Doc()           { return mpDoc; }
 
commit cfcf0254afe0ce9f4fd80606527bd1f14777f7e1
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Oct 19 15:11:59 2015 +0100

    afl-eventtesting: div by zero
    
    Change-Id: If070da723858b5e1221bda86e69225ee57ec9d02

diff --git a/svtools/source/control/valueset.cxx b/svtools/source/control/valueset.cxx
index c88042d..5f780ca 100644
--- a/svtools/source/control/valueset.cxx
+++ b/svtools/source/control/valueset.cxx
@@ -1326,7 +1326,7 @@ void ValueSet::KeyInput( const KeyEvent& rKeyEvent )
             {
                 if (nCurPos == nLastItem)
                 {
-                    const size_t nCol = nLastItem % mnCols;
+                    const size_t nCol = mnCols ? nLastItem % mnCols : 0;
                     if (nCol < mnCurCol)
                     {
                         // Move to previous row/page, keeping the old column
commit cbe2b9cb69a685ab89384f98a9e62b2623afcd9b
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Oct 19 14:56:32 2015 +0100

    afl-eventtesting: deref of null GetMainViewShell
    
    Change-Id: Ie6863f446aa688bc1bb3f725ee31e9984dadc7a4

diff --git a/sd/source/ui/annotations/annotationmanager.cxx b/sd/source/ui/annotations/annotationmanager.cxx
index 166b8c1..79c8997 100644
--- a/sd/source/ui/annotations/annotationmanager.cxx
+++ b/sd/source/ui/annotations/annotationmanager.cxx
@@ -1140,7 +1140,9 @@ SdPage* AnnotationManagerImpl::GetLastPage()
 
 SdPage* AnnotationManagerImpl::GetCurrentPage()
 {
-    return mrBase.GetMainViewShell()->getCurrentPage();
+    if (rBase.GetMainViewShell().get())
+        mrBase.GetMainViewShell()->getCurrentPage();
+    return nullptr;
 }
 
 AnnotationManager::AnnotationManager( ViewShellBase& rViewShellBase )
commit 27ccddf5034ec9e80a5adf93c630247bb5807676
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Oct 19 14:16:50 2015 +0100

    afl-eventtesting: deref of null GetSdrPageView
    
    Change-Id: Iec3266746c78e58e3c3a094e6511d79dadc4e4c6

diff --git a/svx/source/sidebar/possize/PosSizePropertyPanel.cxx b/svx/source/sidebar/possize/PosSizePropertyPanel.cxx
index 5bb2310..3b1e764 100644
--- a/svx/source/sidebar/possize/PosSizePropertyPanel.cxx
+++ b/svx/source/sidebar/possize/PosSizePropertyPanel.cxx
@@ -1152,12 +1152,15 @@ void PosSizePropertyPanel::DisableControls()
 
 void PosSizePropertyPanel::SetPosXYMinMax()
 {
+    SdrPageView* pPV = mpView->GetSdrPageView();
+    if (!pPV)
+        return;
     Rectangle aTmpRect(mpView->GetAllMarkedRect());
-    mpView->GetSdrPageView()->LogicToPagePos(aTmpRect);
+    pPV->LogicToPagePos(aTmpRect);
     maRect = basegfx::B2DRange(aTmpRect.Left(), aTmpRect.Top(), aTmpRect.Right(), aTmpRect.Bottom());
 
     Rectangle aTmpRect2(mpView->GetWorkArea());
-    mpView->GetSdrPageView()->LogicToPagePos(aTmpRect2);
+    pPV->LogicToPagePos(aTmpRect2);
     maWorkArea = basegfx::B2DRange(aTmpRect2.Left(), aTmpRect2.Top(), aTmpRect2.Right(), aTmpRect2.Bottom());
 
     const Fraction aUIScale(mpView->GetModel()->GetUIScale());
commit c21db7b9a5502bf849ac890c20fac10d3ba32fcb
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Oct 19 11:21:36 2015 +0100

    afl-eventtesting: fix deadlock
    
    Change-Id: Ifa75a0344c444f589c165562262a8d843cd12ef7

diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx
index fe4fb71..16467e8 100644
--- a/vcl/source/app/svapp.cxx
+++ b/vcl/source/app/svapp.cxx
@@ -368,16 +368,15 @@ namespace
             return false;
         }
 
-        SalKeyEvent aKeyEvent;
-        aKeyEvent.mnTime = 0;
-        rStream.ReadUInt16(aKeyEvent.mnCode);
-        rStream.ReadUInt16(aKeyEvent.mnCharCode);
-        aKeyEvent.mnRepeat = 0;
+        sal_uInt16 nCode, nCharCode;
+        rStream.ReadUInt16(nCode);
+        rStream.ReadUInt16(nCharCode);
         if (!rStream.good())
             return false;
 
-        ImplWindowFrameProc(xWin.get(), NULL, SALEVENT_KEYINPUT, &aKeyEvent);
-        ImplWindowFrameProc(xWin.get(), NULL, SALEVENT_KEYUP, &aKeyEvent);
+        KeyEvent aVCLKeyEvt(nCharCode, nCode);
+        Application::PostKeyEvent(VCLEVENT_WINDOW_KEYINPUT, xWin.get(), &aVCLKeyEvt);
+        Application::PostKeyEvent(VCLEVENT_WINDOW_KEYUP, xWin.get(), &aVCLKeyEvt);
         return true;
     }
 
commit e63c6fe93ebd702c8c62378830d69343003b91bc
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Oct 19 10:00:11 2015 +0100

    afl-eventtesting: deref of null MarkedSdrObj
    
    Change-Id: I0fe9cb55de114c7e2ad45cd946e94f9c0e93b85c

diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx
index 5d4f77b..06494c6 100644
--- a/svx/source/svdraw/svdmrkv.cxx
+++ b/svx/source/svdraw/svdmrkv.cxx
@@ -2006,7 +2006,9 @@ const Rectangle& SdrMarkView::GetMarkedObjRect() const
         Rectangle aRect2;
         for (size_t nm=0; nm<GetMarkedObjectCount(); ++nm) {
             SdrMark* pM=GetSdrMarkByIndex(nm);
-            SdrObject* pO=pM->GetMarkedSdrObj();
+            SdrObject* pO = pM->GetMarkedSdrObj();
+            if (!pO)
+                continue;
             Rectangle aR1(pO->GetSnapRect());
             // apply calc offset to marked object rect
             // ( necessary for handles to be displayed in


More information about the Libreoffice-commits mailing list