[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - 5 commits - include/svx sc/source sd/source svx/source sw/source

Stephan Bergmann sbergman at redhat.com
Fri Jul 10 01:14:14 PDT 2015


 include/svx/fmview.hxx                   |    2 +-
 include/svx/sdrpaintwindow.hxx           |    6 +++++-
 include/svx/svdedxv.hxx                  |    2 +-
 include/svx/svdpntv.hxx                  |    2 +-
 sc/source/ui/view/tabview5.cxx           |    4 ++--
 sd/source/ui/inc/OutlineView.hxx         |    2 +-
 sd/source/ui/slideshow/showwin.cxx       |    2 +-
 sd/source/ui/slideshow/slideshowimpl.cxx |    4 ++--
 sd/source/ui/view/outlview.cxx           |    4 ++--
 svx/source/form/fmview.cxx               |    4 ++--
 svx/source/svdraw/sdrpaintwindow.cxx     |    3 ++-
 svx/source/svdraw/svdedxv.cxx            |   15 ++++++++-------
 svx/source/svdraw/svdpntv.cxx            |    6 +++---
 sw/source/core/view/viewsh.cxx           |    4 ++--
 14 files changed, 33 insertions(+), 27 deletions(-)

New commits:
commit 80e06ad135d28380b5ba2b709e6fdcaefed35a46
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Fri Jul 10 09:37:13 2015 +0200

    loplugin:vclwidgets
    
    Change-Id: I4c6623b83f0c21b292aa0178c2ee6478e330eb64
    (cherry picked from commit 37a367a3589302893c237237e4eb98f1e4195f6d)

diff --git a/include/svx/sdrpaintwindow.hxx b/include/svx/sdrpaintwindow.hxx
index 18a3482..36176e5 100644
--- a/include/svx/sdrpaintwindow.hxx
+++ b/include/svx/sdrpaintwindow.hxx
@@ -69,7 +69,7 @@ private:
     OutputDevice&                                       mrOutputDevice;
 
     /// In case mrOutputDevice is a buffer for a vcl::Window, this is the window.
-    vcl::Window*                                        mpWindow;
+    VclPtr<vcl::Window>                                 mpWindow;
 
     // the SdrPaintView this window belongs to
     SdrPaintView&                                       mrPaintView;
commit 19f2ded51c7b85d9e87fc2f11ddeb5874ed5ae85
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Thu Jul 9 17:02:09 2015 +0200

    tdf#92645 svx rendercontext: fix missing paint on shape text editing
    
    Change-Id: Icb70805969ccf55bd85fb38c03cf70c1e0b16554
    (cherry picked from commit 40ade8d04380083e383d6a6e50e5c254fcde2b2f)

diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index 1455558..7d517e2 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -308,7 +308,12 @@ void SdrObjEditView::TextEditDrawing(SdrPaintWindow& rPaintWindow) const
                 {
                     OutlinerView* pOLV = pActiveOutliner->GetView(i);
 
-                    if(pOLV->GetWindow() == &rPaintWindow.GetOutputDevice() || GetModel()->isTiledRendering())
+                    // If rPaintWindow knows that the output device is a render
+                    // context and is aware of the underlying vcl::Window,
+                    // compare against that; that's how double-buffering can
+                    // still find the matching OutlinerView.
+                    OutputDevice* pOutputDevice = rPaintWindow.GetWindow() ? rPaintWindow.GetWindow() : &rPaintWindow.GetOutputDevice();
+                    if(pOLV->GetWindow() == pOutputDevice || GetModel()->isTiledRendering())
                     {
                         ImpPaintOutlinerView(*pOLV, aCheckRect, rPaintWindow.GetTargetOutputDevice());
                         return;
commit b0bf7b57f7a311541631295411e9b504d493bc58
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Thu Jul 9 15:24:42 2015 +0200

    SdrPaintView::AddWindowToPaintView: take a vcl::Window, too
    
    Change-Id: Iedb296732c0819a1d6cdc1c59b3f1718e2cd6d38
    (cherry picked from commit 9a11e59e5699c5eb0854355d3dd3848bc895545c)

diff --git a/include/svx/fmview.hxx b/include/svx/fmview.hxx
index 165f3c0..92328e1 100644
--- a/include/svx/fmview.hxx
+++ b/include/svx/fmview.hxx
@@ -83,7 +83,7 @@ public:
     SdrObject*   CreateXFormsControl( const svx::OXFormsDescriptor &_rDesc );
 
     virtual void MarkListHasChanged() SAL_OVERRIDE;
-    virtual void AddWindowToPaintView(OutputDevice* pNewWin) SAL_OVERRIDE;
+    virtual void AddWindowToPaintView(OutputDevice* pNewWin, vcl::Window* pWindow) SAL_OVERRIDE;
     virtual void DeleteWindowFromPaintView(OutputDevice* pOldWin) SAL_OVERRIDE;
 
     static void createControlLabelPair(
diff --git a/include/svx/svdedxv.hxx b/include/svx/svdedxv.hxx
index e422125..005000d 100644
--- a/include/svx/svdedxv.hxx
+++ b/include/svx/svdedxv.hxx
@@ -225,7 +225,7 @@ public:
     bool SetStyleSheet(SfxStyleSheet* pStyleSheet, bool bDontRemoveHardAttr);
 
     // Intern: at mounting new OutlinerView...
-    virtual void AddWindowToPaintView(OutputDevice* pNewWin) SAL_OVERRIDE;
+    virtual void AddWindowToPaintView(OutputDevice* pNewWin, vcl::Window* pWindow) SAL_OVERRIDE;
     virtual void DeleteWindowFromPaintView(OutputDevice* pOldWin) SAL_OVERRIDE;
 
     sal_uInt16 GetSelectionLevel() const;
diff --git a/include/svx/svdpntv.hxx b/include/svx/svdpntv.hxx
index 1b36032..a9c2c45 100644
--- a/include/svx/svdpntv.hxx
+++ b/include/svx/svdpntv.hxx
@@ -350,7 +350,7 @@ public:
 //  SdrPageView* GetPageViewByPosition(const Point& rPnt) const;
 
     // Eine SdrView kann auf mehreren Fenstern gleichzeitig abgebiltet sein:
-    virtual void AddWindowToPaintView(OutputDevice* pNewWin);
+    virtual void AddWindowToPaintView(OutputDevice* pNewWin, vcl::Window* pWindow);
     virtual void DeleteWindowFromPaintView(OutputDevice* pOldWin);
 
     void SetLayerVisible(const OUString& rName, bool bShow=true);
diff --git a/sc/source/ui/view/tabview5.cxx b/sc/source/ui/view/tabview5.cxx
index 7f45085..768c4b3 100644
--- a/sc/source/ui/view/tabview5.cxx
+++ b/sc/source/ui/view/tabview5.cxx
@@ -216,7 +216,7 @@ void ScTabView::MakeDrawView( TriState nForceDesignMode )
             if (pGridWin[i])
             {
                 if ( SC_SPLIT_BOTTOMLEFT != (ScSplitPos)i )
-                    pDrawView->AddWindowToPaintView(pGridWin[i]);
+                    pDrawView->AddWindowToPaintView(pGridWin[i], 0);
             }
         pDrawView->RecalcScale();
         for (i=0; i<4; i++)
@@ -251,7 +251,7 @@ void ScTabView::DoAddWin( ScGridWindow* pWin )
 {
     if (pDrawView)
     {
-        pDrawView->AddWindowToPaintView(pWin);
+        pDrawView->AddWindowToPaintView(pWin, 0);
 
         // #114409#
         pWin->DrawLayerCreated();
diff --git a/sd/source/ui/inc/OutlineView.hxx b/sd/source/ui/inc/OutlineView.hxx
index cf81a0a..6d2b1a0 100644
--- a/sd/source/ui/inc/OutlineView.hxx
+++ b/sd/source/ui/inc/OutlineView.hxx
@@ -77,7 +77,7 @@ public:
     static SdrTextObj*     CreateTitleTextObject(SdPage* pPage);
     static SdrTextObj*     CreateOutlineTextObject(SdPage* pPage);
 
-    virtual void AddWindowToPaintView(OutputDevice* pWin) SAL_OVERRIDE;
+    virtual void AddWindowToPaintView(OutputDevice* pWin, vcl::Window* pWindow) SAL_OVERRIDE;
     virtual void DeleteWindowFromPaintView(OutputDevice* pWin) SAL_OVERRIDE;
 
     OutlinerView*   GetViewByWindow(vcl::Window* pWin) const;
diff --git a/sd/source/ui/slideshow/showwin.cxx b/sd/source/ui/slideshow/showwin.cxx
index fbf685f..a0c3745 100644
--- a/sd/source/ui/slideshow/showwin.cxx
+++ b/sd/source/ui/slideshow/showwin.cxx
@@ -614,7 +614,7 @@ void ShowWindow::DeleteWindowFromPaintView()
 void ShowWindow::AddWindowToPaintView()
 {
     if( mpViewShell->GetView() )
-        mpViewShell->GetView()->AddWindowToPaintView( this );
+        mpViewShell->GetView()->AddWindowToPaintView( this, 0 );
 
     sal_uInt16 nChild = GetChildCount();
     while( nChild-- )
diff --git a/sd/source/ui/slideshow/slideshowimpl.cxx b/sd/source/ui/slideshow/slideshowimpl.cxx
index adce12b..bf61d37 100644
--- a/sd/source/ui/slideshow/slideshowimpl.cxx
+++ b/sd/source/ui/slideshow/slideshowimpl.cxx
@@ -812,7 +812,7 @@ bool SlideshowImpl::startPreview(
 
         if( mpView )
         {
-            mpView->AddWindowToPaintView( mpShowWindow );
+            mpView->AddWindowToPaintView( mpShowWindow, 0 );
             mpView->SetAnimationPause( true );
         }
 
@@ -1006,7 +1006,7 @@ bool SlideshowImpl::startShow( PresentationSettingsEx* pPresSettings )
 
             if( mpView )
             {
-                mpView->AddWindowToPaintView( mpShowWindow );
+                mpView->AddWindowToPaintView( mpShowWindow, 0 );
                 mpView->SetAnimationPause( true );
             }
 
diff --git a/sd/source/ui/view/outlview.cxx b/sd/source/ui/view/outlview.cxx
index 277d262..98d0af9 100644
--- a/sd/source/ui/view/outlview.cxx
+++ b/sd/source/ui/view/outlview.cxx
@@ -236,7 +236,7 @@ void OutlineView::Paint(const Rectangle& rRect, ::sd::Window* pWin)
     }
 }
 
-void OutlineView::AddWindowToPaintView(OutputDevice* pWin)
+void OutlineView::AddWindowToPaintView(OutputDevice* pWin, vcl::Window* pWindow)
 {
     bool bAdded = false;
     bool bValidArea = false;
@@ -270,7 +270,7 @@ void OutlineView::AddWindowToPaintView(OutputDevice* pWin)
     // white background in Outliner
     pWin->SetBackground( Wallpaper( aWhiteColor ) );
 
-    ::sd::View::AddWindowToPaintView(pWin);
+    ::sd::View::AddWindowToPaintView(pWin, pWindow);
 }
 
 void OutlineView::DeleteWindowFromPaintView(OutputDevice* pWin)
diff --git a/svx/source/form/fmview.cxx b/svx/source/form/fmview.cxx
index 9fd3a38..26a0c09 100644
--- a/svx/source/form/fmview.cxx
+++ b/svx/source/form/fmview.cxx
@@ -199,9 +199,9 @@ namespace
 }
 
 
-void FmFormView::AddWindowToPaintView(OutputDevice* pNewWin)
+void FmFormView::AddWindowToPaintView(OutputDevice* pNewWin, vcl::Window* pWindow)
 {
-    E3dView::AddWindowToPaintView(pNewWin);
+    E3dView::AddWindowToPaintView(pNewWin, pWindow);
 
     if ( !pNewWin )
         return;
diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index 8b51df0..1455558 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -1667,9 +1667,9 @@ bool SdrObjEditView::SetStyleSheet(SfxStyleSheet* pStyleSheet, bool bDontRemoveH
 
 
 
-void SdrObjEditView::AddWindowToPaintView(OutputDevice* pNewWin)
+void SdrObjEditView::AddWindowToPaintView(OutputDevice* pNewWin, vcl::Window *pWindow)
 {
-    SdrGlueEditView::AddWindowToPaintView(pNewWin);
+    SdrGlueEditView::AddWindowToPaintView(pNewWin, pWindow);
 
     if(mxTextEditObj.is() && !bTextEditOnlyOneView && pNewWin->GetOutDevType()==OUTDEV_WINDOW)
     {
diff --git a/svx/source/svdraw/svdpntv.cxx b/svx/source/svdraw/svdpntv.cxx
index 17e2b9d..e996c5c 100644
--- a/svx/source/svdraw/svdpntv.cxx
+++ b/svx/source/svdraw/svdpntv.cxx
@@ -216,7 +216,7 @@ SdrPaintView::SdrPaintView(SdrModel* pModel1, OutputDevice* pOut)
 
     if(pOut)
     {
-        AddWindowToPaintView(pOut);
+        AddWindowToPaintView(pOut, 0);
     }
 
     // flag to visualize groups
@@ -457,10 +457,10 @@ void SdrPaintView::HideSdrPage()
     }
 }
 
-void SdrPaintView::AddWindowToPaintView(OutputDevice* pNewWin)
+void SdrPaintView::AddWindowToPaintView(OutputDevice* pNewWin, vcl::Window *pWindow)
 {
     DBG_ASSERT(pNewWin, "SdrPaintView::AddWindowToPaintView: No OutputDevice(!)");
-    SdrPaintWindow* pNewPaintWindow = new SdrPaintWindow(*this, *pNewWin);
+    SdrPaintWindow* pNewPaintWindow = new SdrPaintWindow(*this, *pNewWin, pWindow);
     AppendPaintWindow(*pNewPaintWindow);
 
     if(mpPageView)
diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index a019fae..bde60ab 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -1261,7 +1261,7 @@ bool SwViewShell::SmoothScroll( long lXDiff, long lYDiff, const Rectangle *pRect
                 if(!HasDrawView())
                     MakeDrawView();
                 SdrView* pDrawView = GetDrawView();
-                pDrawView->AddWindowToPaintView(pVout);
+                pDrawView->AddWindowToPaintView(pVout, 0);
 
                 // clear mpWin during DLPrePaint2 to get paint preparation for mpOut, but set it again
                 // immediately afterwards. There are many decisions in SW which imply that Printing
@@ -1670,7 +1670,7 @@ public:
     {
         m_pRef = pValue;
         if (pValue != m_pShell->GetWin() && m_pShell->Imp()->GetDrawView())
-            m_pShell->Imp()->GetDrawView()->AddWindowToPaintView(pValue);
+            m_pShell->Imp()->GetDrawView()->AddWindowToPaintView(pValue, m_pShell->GetWin());
     }
 
     ~RenderContextGuard()
commit c73a4299e898acf89ff43057eb64afbe3ccc566e
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Thu Jul 9 14:26:45 2015 +0200

    SdrPaintWindow: optionally take a vcl::Window, too
    
    Change-Id: Ibf6c0cc2e6dc8fe6979632f6acb1b065984cd73f
    (cherry picked from commit 78c73f42c8079ed6d37784e68da5170c86a68616)

diff --git a/include/svx/sdrpaintwindow.hxx b/include/svx/sdrpaintwindow.hxx
index ba267e3..18a3482 100644
--- a/include/svx/sdrpaintwindow.hxx
+++ b/include/svx/sdrpaintwindow.hxx
@@ -68,6 +68,9 @@ private:
     // the OutputDevice this window represents
     OutputDevice&                                       mrOutputDevice;
 
+    /// In case mrOutputDevice is a buffer for a vcl::Window, this is the window.
+    vcl::Window*                                        mpWindow;
+
     // the SdrPaintView this window belongs to
     SdrPaintView&                                       mrPaintView;
 
@@ -95,12 +98,13 @@ private:
     void impCreateOverlayManager();
 
 public:
-    SdrPaintWindow(SdrPaintView& rNewPaintView, OutputDevice& rOut);
+    SdrPaintWindow(SdrPaintView& rNewPaintView, OutputDevice& rOut, vcl::Window* pWindow = 0);
     ~SdrPaintWindow();
 
     // data read accesses
     SdrPaintView& GetPaintView() const { return mrPaintView; }
     OutputDevice& GetOutputDevice() const { return mrOutputDevice; }
+    vcl::Window* GetWindow() const { return mpWindow; }
 
     // OVERLAYMANAGER
     rtl::Reference< sdr::overlay::OverlayManager > GetOverlayManager() const;
diff --git a/svx/source/svdraw/sdrpaintwindow.cxx b/svx/source/svdraw/sdrpaintwindow.cxx
index d8f0c03..8a2da86 100644
--- a/svx/source/svdraw/sdrpaintwindow.cxx
+++ b/svx/source/svdraw/sdrpaintwindow.cxx
@@ -245,8 +245,9 @@ void SdrPaintWindow::impCreateOverlayManager()
     }
 }
 
-SdrPaintWindow::SdrPaintWindow(SdrPaintView& rNewPaintView, OutputDevice& rOut)
+SdrPaintWindow::SdrPaintWindow(SdrPaintView& rNewPaintView, OutputDevice& rOut, vcl::Window* pWindow)
 :   mrOutputDevice(rOut),
+    mpWindow(pWindow),
     mrPaintView(rNewPaintView),
     mpPreRenderDevice(0L),
     mbTemporaryTarget(false), // #i72889#
commit 11cc73ec9e04b8624168a4c3f218f14c9129f917
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Thu Jul 9 11:00:58 2015 +0200

    Related: tdf#92645 svx rendercontext: avoid direct paint on ending text edit
    
    If the Paint() is ~immediate after Invalidate() (which is the case
    since the main loop has priorities), it makes no sense to
    perform any kind of direct paint right after an Invalidate().
    
    With this, we no longer hit the is_double_buffered_window() assert when
    returning to editing Writer text after editing draw shape text.
    
    Change-Id: I3b80ca08aa71d247fc0561133f907aef34de4001
    (cherry picked from commit b05ff2cc713601730393123f6daa95e41df3b6ea)

diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index e06571a..8b51df0 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -1022,10 +1022,6 @@ SdrEndTextEditKind SdrObjEditView::SdrEndTextEdit(bool bDontDeleteReally)
             InvalidateOneWin(*pWin,aRect);
             pWin->SetFillColor();
             pWin->SetLineColor(COL_BLACK);
-            pWin->DrawPixel(aRect.TopLeft());
-            pWin->DrawPixel(aRect.TopRight());
-            pWin->DrawPixel(aRect.BottomLeft());
-            pWin->DrawPixel(aRect.BottomRight());
         }
         // and now the Outliner itself
         if (!bTextEditDontDelete) delete pTEOutliner;


More information about the Libreoffice-commits mailing list