[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/inc sw/source

Miklos Vajna vmiklos at collabora.co.uk
Tue Jul 28 02:42:08 PDT 2015


 sw/inc/pagepreviewlayout.hxx              |    2 +-
 sw/source/core/view/pagepreviewlayout.cxx |   10 +++++-----
 2 files changed, 6 insertions(+), 6 deletions(-)

New commits:
commit b2c40908c05d0d526bfaee523895399ab88087f7
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Fri Jul 24 15:42:08 2015 +0200

    tdf#92914 SwPagePreviewLayout::_PaintSelectMarkAtPage: handle rendercontext
    
    With this, the print preview window does not paint the selection
    rectangle on opening directly anymore.
    
    (cherry picked from commit 0c114151343cbe6853dd46833c42368d738afd8a)
    
    Change-Id: Ie4d24dfc4d64c74b22dcd1476778f4eac6f4cd13
    Reviewed-on: https://gerrit.libreoffice.org/17363
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Jan Holesovsky <kendy at collabora.com>

diff --git a/sw/inc/pagepreviewlayout.hxx b/sw/inc/pagepreviewlayout.hxx
index b6e8196..b81afd7 100644
--- a/sw/inc/pagepreviewlayout.hxx
+++ b/sw/inc/pagepreviewlayout.hxx
@@ -215,7 +215,7 @@ private:
 
         @author OD
     */
-    void _PaintSelectMarkAtPage( const PreviewPage* _aSelectedPreviewPage ) const;
+    void _PaintSelectMarkAtPage(vcl::RenderContext& rRenderContext, const PreviewPage* _aSelectedPreviewPage) const;
 
 public:
     /** constructor of <SwPagePreviewLayout>
diff --git a/sw/source/core/view/pagepreviewlayout.cxx b/sw/source/core/view/pagepreviewlayout.cxx
index 2450450..da9f1f1 100644
--- a/sw/source/core/view/pagepreviewlayout.cxx
+++ b/sw/source/core/view/pagepreviewlayout.cxx
@@ -1120,7 +1120,7 @@ bool SwPagePreviewLayout::Paint(vcl::RenderContext& rRenderContext, const Rectan
 
             if ( (*aPageIter)->pPage->GetPhyPageNum() == mnSelectedPageNum )
             {
-                _PaintSelectMarkAtPage( (*aPageIter) );
+                _PaintSelectMarkAtPage(rRenderContext, *aPageIter);
             }
 
         }
@@ -1201,10 +1201,10 @@ void SwPagePreviewLayout::Repaint( const Rectangle& rInvalidCoreRect ) const
 
     OD 17.12.2002 #103492#
 */
-void SwPagePreviewLayout::_PaintSelectMarkAtPage(
+void SwPagePreviewLayout::_PaintSelectMarkAtPage(vcl::RenderContext& rRenderContext,
                                     const PreviewPage* _aSelectedPreviewPage ) const
 {
-    OutputDevice* pOutputDev = mrParentViewShell.GetOut();
+    OutputDevice* pOutputDev = &rRenderContext;
     MapMode aMapMode( pOutputDev->GetMapMode() );
     // save mapping mode of output device
     MapMode aSavedMapMode = aMapMode;
@@ -1268,12 +1268,12 @@ void SwPagePreviewLayout::MarkNewSelectedPage( const sal_uInt16 _nSelectedPage )
 
     // re-paint for current selected page in order to umark it.
     const PreviewPage* pOldSelectedPreviewPage = _GetPreviewPageByPageNum( nOldSelectedPageNum );
+    OutputDevice* pOutputDev = mrParentViewShell.GetOut();
     if ( pOldSelectedPreviewPage && pOldSelectedPreviewPage->bVisible )
     {
         // OD 20.02.2003 #107369# - invalidate only areas of selection mark.
         SwRect aPageRect( pOldSelectedPreviewPage->aPreviewWinPos,
                               pOldSelectedPreviewPage->aPageSize );
-        OutputDevice* pOutputDev = mrParentViewShell.GetOut();
         ::SwAlignRect( aPageRect, &mrParentViewShell, pOutputDev );
         Rectangle aPxPageRect = pOutputDev->LogicToPixel( aPageRect.SVRect() );
         // invalidate top mark line
@@ -1297,7 +1297,7 @@ void SwPagePreviewLayout::MarkNewSelectedPage( const sal_uInt16 _nSelectedPage )
     // re-paint for new selected page in order to mark it.
     const PreviewPage* pNewSelectedPreviewPage = _GetPreviewPageByPageNum( _nSelectedPage );
     if ( pNewSelectedPreviewPage && pNewSelectedPreviewPage->bVisible )
-        _PaintSelectMarkAtPage( pNewSelectedPreviewPage );
+        _PaintSelectMarkAtPage( *pOutputDev, pNewSelectedPreviewPage );
 }
 
 // helper methods


More information about the Libreoffice-commits mailing list