[Libreoffice-commits] core.git: 5 commits - include/vcl vcl/source

Chris Sherlock chris.sherlock79 at gmail.com
Thu Apr 24 11:00:34 PDT 2014


 include/vcl/outdev.hxx         |   14 +-
 vcl/source/outdev/clipping.cxx |  204 ++++++++++++++++++++---------------------
 vcl/source/outdev/outdev.cxx   |    4 
 vcl/source/window/menu.cxx     |   12 +-
 vcl/source/window/window.cxx   |    6 -
 vcl/source/window/window2.cxx  |    4 
 6 files changed, 123 insertions(+), 121 deletions(-)

New commits:
commit f403784c1352cdc66a9cfdc569b6c62d8a3b19e1
Author: Chris Sherlock <chris.sherlock79 at gmail.com>
Date:   Fri Apr 25 03:49:45 2014 +1000

    Change ImplInitClipRegion to InitClipRegion in menu.(c|h)xx
    
    Change-Id: If9d3d92c4ceb11a3a49cb8d59e9e40bbebf737f5

diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx
index cd174a7..143a95e 100644
--- a/vcl/source/window/menu.cxx
+++ b/vcl/source/window/menu.cxx
@@ -509,7 +509,7 @@ private:
     virtual void    DataChanged( const DataChangedEvent& rDCEvt ) SAL_OVERRIDE;
 protected:
     Region          ImplCalcClipRegion( bool bIncludeLogo = true ) const;
-    virtual void    ImplInitClipRegion() SAL_OVERRIDE;
+    virtual void    InitClipRegion() SAL_OVERRIDE;
     void            ImplDrawScroller( bool bUp );
     using Window::ImplScroll;
     void            ImplScroll( const Point& rMousePos );
@@ -4000,7 +4000,7 @@ MenuFloatingWindow::~MenuFloatingWindow()
 
 void MenuFloatingWindow::Resize()
 {
-    ImplInitClipRegion();
+    InitClipRegion();
 }
 
 long MenuFloatingWindow::ImplGetStartY() const
@@ -4032,7 +4032,7 @@ Region MenuFloatingWindow::ImplCalcClipRegion( bool bIncludeLogo ) const
     return aRegion;
 }
 
-void MenuFloatingWindow::ImplInitClipRegion()
+void MenuFloatingWindow::InitClipRegion()
 {
     if ( IsScrollMenu() )
     {
@@ -4268,7 +4268,7 @@ void MenuFloatingWindow::EnableScrollMenu( bool b )
     bScrollMenu = b;
     nScrollerHeight = b ? (sal_uInt16) GetSettings().GetStyleSettings().GetScrollBarSize() /2 : 0;
     bScrollDown = true;
-    ImplInitClipRegion();
+    InitClipRegion();
 }
 
 void MenuFloatingWindow::Execute()
@@ -5018,7 +5018,7 @@ void MenuFloatingWindow::Paint( const Rectangle& )
                            CTRL_STATE_ENABLED,
                            aVal,
                            OUString() );
-        ImplInitClipRegion();
+        InitClipRegion();
     }
     if ( IsScrollMenu() )
     {
@@ -5052,7 +5052,7 @@ void MenuFloatingWindow::ImplDrawScroller( bool bUp )
 
     aDecoView.DrawSymbol( aRect, eSymbol, GetSettings().GetStyleSettings().GetButtonTextColor(), nStyle );
 
-    ImplInitClipRegion();
+    InitClipRegion();
 }
 
 void MenuFloatingWindow::RequestHelp( const HelpEvent& rHEvt )
commit 5e748857dacfb41af04f021f9c74feadbf4be747
Author: Chris Sherlock <chris.sherlock79 at gmail.com>
Date:   Fri Apr 25 03:48:27 2014 +1000

    VCL: remove comment tags not recognized by doxygen
    
    Change-Id: If3ce6dd8ad25f5ba36ff144f0787c4be6f42c557

diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx
index 5f0de9d..fbf0402 100644
--- a/include/vcl/outdev.hxx
+++ b/include/vcl/outdev.hxx
@@ -476,10 +476,10 @@ private:
 
     ///@}
 
-public:
     /** @name Text and font functions
      */
     ///@{
+public:
     SAL_DLLPRIVATE bool         ImplNewFont() const;
     SAL_DLLPRIVATE void         ImplInitTextColor();
     static
@@ -618,10 +618,9 @@ public:
 
     OutDevType                  GetOutDevType() const { return meOutDevType; }
 
-    /** query an <code>OutputDevice</code> to see whether it supports a specific operation
+    /** Query an OutputDevice to see whether it supports a specific operation
 
-    @return
-    true if operation supported, else false
+    @return true if operation supported, else false
     */
     bool                        supportsOperation( OutDevSupportType ) const;
 
commit 7b4c2f7f5a5b801bd3264000c19821b8dea1e14f
Author: Chris Sherlock <chris.sherlock79 at gmail.com>
Date:   Fri Apr 25 03:42:13 2014 +1000

    Rearrange function locations in outdev.hxx and outdev/clipping.cxx
    
    Change-Id: Idb1faf5632da8ea3fec674f9fb2d042c7ff14fa7

diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx
index 31630c2..5f0de9d 100644
--- a/include/vcl/outdev.hxx
+++ b/include/vcl/outdev.hxx
@@ -469,6 +469,7 @@ public:
 protected:
     virtual void                InitClipRegion();
     virtual Region              GetActiveClipRegion() const;
+    virtual void                ClipToPaintRegion    ( Rectangle& rDstRect );
 
 private:
     SAL_DLLPRIVATE void         SetDeviceClipRegion( const Region* pRegion );
@@ -551,7 +552,6 @@ public:
 
     SAL_DLLPRIVATE void         ImplDrawOutDevDirect ( const OutputDevice* pSrcDev, SalTwoRect& rPosAry );
 
-    virtual void                ClipToPaintRegion    ( Rectangle& rDstRect );
     SAL_DLLPRIVATE void         ImplPrintTransparent ( const Bitmap& rBmp, const Bitmap& rMask,
                                                        const Point& rDestPt, const Size& rDestSize,
                                                        const Point& rSrcPtPixel, const Size& rSrcSizePixel );
diff --git a/vcl/source/outdev/clipping.cxx b/vcl/source/outdev/clipping.cxx
index a7d2ea7..f19a084 100644
--- a/vcl/source/outdev/clipping.cxx
+++ b/vcl/source/outdev/clipping.cxx
@@ -31,100 +31,10 @@
 
 #include <numeric>
 
-void OutputDevice::InitClipRegion()
-{
-    DBG_TESTSOLARMUTEX();
-
-    if ( mbClipRegion )
-    {
-        if ( maRegion.IsEmpty() )
-            mbOutputClipped = true;
-        else
-        {
-            mbOutputClipped = false;
-
-            // #102532# Respect output offset also for clip region
-            Region aRegion( ImplPixelToDevicePixel( maRegion ) );
-            const bool bClipDeviceBounds( ! GetPDFWriter()
-                                          && GetOutDevType() != OUTDEV_PRINTER );
-            if( bClipDeviceBounds )
-            {
-                // Perform actual rect clip against outdev
-                // dimensions, to generate empty clips whenever one of the
-                // values is completely off the device.
-                Rectangle aDeviceBounds( mnOutOffX, mnOutOffY,
-                                         mnOutOffX+GetOutputWidthPixel()-1,
-                                         mnOutOffY+GetOutputHeightPixel()-1 );
-                aRegion.Intersect( aDeviceBounds );
-            }
-
-            if ( aRegion.IsEmpty() )
-            {
-                mbOutputClipped = true;
-            }
-            else
-            {
-                mbOutputClipped = false;
-                SelectClipRegion( aRegion );
-            }
-        }
-
-        mbClipRegionSet = true;
-    }
-    else
-    {
-        if ( mbClipRegionSet )
-        {
-            mpGraphics->ResetClipRegion();
-            mbClipRegionSet = false;
-        }
-
-        mbOutputClipped = false;
-    }
-
-    mbInitClipRegion = false;
-}
-
-void OutputDevice::ClipToPaintRegion(Rectangle& /*rDstRect*/)
-{
-}
-
-bool OutputDevice::SelectClipRegion( const Region& rRegion, SalGraphics* pGraphics )
-{
-    DBG_TESTSOLARMUTEX();
-
-    if( !pGraphics )
-    {
-        if( !mpGraphics )
-            if( !AcquireGraphics() )
-                return false;
-        pGraphics = mpGraphics;
-    }
-
-    bool bClipRegion = pGraphics->SetClipRegion( rRegion, this );
-    OSL_ENSURE( bClipRegion, "OutputDevice::SelectClipRegion() - can't create region" );
-    return bClipRegion;
-}
-
-void OutputDevice::SetDeviceClipRegion( const Region* pRegion )
+Region OutputDevice::GetClipRegion() const
 {
-    DBG_TESTSOLARMUTEX();
 
-    if ( !pRegion )
-    {
-        if ( mbClipRegion )
-        {
-            maRegion            = Region(true);
-            mbClipRegion        = false;
-            mbInitClipRegion    = true;
-        }
-    }
-    else
-    {
-        maRegion            = *pRegion;
-        mbClipRegion        = true;
-        mbInitClipRegion    = true;
-    }
+    return PixelToLogic( maRegion );
 }
 
 void OutputDevice::SetClipRegion()
@@ -159,15 +69,21 @@ void OutputDevice::SetClipRegion( const Region& rRegion )
         mpAlphaVDev->SetClipRegion( rRegion );
 }
 
-Region OutputDevice::GetClipRegion() const
+bool OutputDevice::SelectClipRegion( const Region& rRegion, SalGraphics* pGraphics )
 {
+    DBG_TESTSOLARMUTEX();
 
-    return PixelToLogic( maRegion );
-}
+    if( !pGraphics )
+    {
+        if( !mpGraphics )
+            if( !AcquireGraphics() )
+                return false;
+        pGraphics = mpGraphics;
+    }
 
-Region OutputDevice::GetActiveClipRegion() const
-{
-    return GetClipRegion();
+    bool bClipRegion = pGraphics->SetClipRegion( rRegion, this );
+    OSL_ENSURE( bClipRegion, "OutputDevice::SelectClipRegion() - can't create region" );
+    return bClipRegion;
 }
 
 void OutputDevice::MoveClipRegion( long nHorzMove, long nVertMove )
@@ -220,4 +136,90 @@ void OutputDevice::IntersectClipRegion( const Region& rRegion )
         mpAlphaVDev->IntersectClipRegion( rRegion );
 }
 
+void OutputDevice::InitClipRegion()
+{
+    DBG_TESTSOLARMUTEX();
+
+    if ( mbClipRegion )
+    {
+        if ( maRegion.IsEmpty() )
+            mbOutputClipped = true;
+        else
+        {
+            mbOutputClipped = false;
+
+            // #102532# Respect output offset also for clip region
+            Region aRegion( ImplPixelToDevicePixel( maRegion ) );
+            const bool bClipDeviceBounds( ! GetPDFWriter()
+                                          && GetOutDevType() != OUTDEV_PRINTER );
+            if( bClipDeviceBounds )
+            {
+                // Perform actual rect clip against outdev
+                // dimensions, to generate empty clips whenever one of the
+                // values is completely off the device.
+                Rectangle aDeviceBounds( mnOutOffX, mnOutOffY,
+                                         mnOutOffX+GetOutputWidthPixel()-1,
+                                         mnOutOffY+GetOutputHeightPixel()-1 );
+                aRegion.Intersect( aDeviceBounds );
+            }
+
+            if ( aRegion.IsEmpty() )
+            {
+                mbOutputClipped = true;
+            }
+            else
+            {
+                mbOutputClipped = false;
+                SelectClipRegion( aRegion );
+            }
+        }
+
+        mbClipRegionSet = true;
+    }
+    else
+    {
+        if ( mbClipRegionSet )
+        {
+            mpGraphics->ResetClipRegion();
+            mbClipRegionSet = false;
+        }
+
+        mbOutputClipped = false;
+    }
+
+    mbInitClipRegion = false;
+}
+
+Region OutputDevice::GetActiveClipRegion() const
+{
+    return GetClipRegion();
+}
+
+void OutputDevice::ClipToPaintRegion(Rectangle& /*rDstRect*/)
+{
+    // this is only used in Window, but we still need it as it's called
+    // on in other clipping functions
+}
+
+void OutputDevice::SetDeviceClipRegion( const Region* pRegion )
+{
+    DBG_TESTSOLARMUTEX();
+
+    if ( !pRegion )
+    {
+        if ( mbClipRegion )
+        {
+            maRegion            = Region(true);
+            mbClipRegion        = false;
+            mbInitClipRegion    = true;
+        }
+    }
+    else
+    {
+        maRegion            = *pRegion;
+        mbClipRegion        = true;
+        mbInitClipRegion    = true;
+    }
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit b3b0331711a1cab740d6c2220ef766f611a117b8
Author: Chris Sherlock <chris.sherlock79 at gmail.com>
Date:   Fri Apr 25 03:31:39 2014 +1000

    VCL: Rename OutputDevice::ImplSelectClipRegion to SelectClipRegion
    
    Change-Id: I8c683588d8bdb6dd287e60fc1e249bd5633a4ee2

diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx
index a6e7034..31630c2 100644
--- a/include/vcl/outdev.hxx
+++ b/include/vcl/outdev.hxx
@@ -458,6 +458,8 @@ public:
     Region                      GetClipRegion() const;
     void                        SetClipRegion();
     void                        SetClipRegion( const Region& rRegion );
+    bool                        SelectClipRegion( const Region&, SalGraphics* pGraphics = NULL );
+
     bool                        IsClipRegion() const { return mbClipRegion; }
 
     void                        MoveClipRegion( long nHorzMove, long nVertMove );
@@ -470,7 +472,6 @@ protected:
 
 private:
     SAL_DLLPRIVATE void         SetDeviceClipRegion( const Region* pRegion );
-    SAL_DLLPRIVATE bool         ImplSelectClipRegion( const Region&, SalGraphics* pGraphics = NULL );
 
     ///@}
 
diff --git a/vcl/source/outdev/clipping.cxx b/vcl/source/outdev/clipping.cxx
index f95b45c..a7d2ea7 100644
--- a/vcl/source/outdev/clipping.cxx
+++ b/vcl/source/outdev/clipping.cxx
@@ -65,7 +65,7 @@ void OutputDevice::InitClipRegion()
             else
             {
                 mbOutputClipped = false;
-                ImplSelectClipRegion( aRegion );
+                SelectClipRegion( aRegion );
             }
         }
 
@@ -89,7 +89,7 @@ void OutputDevice::ClipToPaintRegion(Rectangle& /*rDstRect*/)
 {
 }
 
-bool OutputDevice::ImplSelectClipRegion( const Region& rRegion, SalGraphics* pGraphics )
+bool OutputDevice::SelectClipRegion( const Region& rRegion, SalGraphics* pGraphics )
 {
     DBG_TESTSOLARMUTEX();
 
@@ -102,7 +102,7 @@ bool OutputDevice::ImplSelectClipRegion( const Region& rRegion, SalGraphics* pGr
     }
 
     bool bClipRegion = pGraphics->SetClipRegion( rRegion, this );
-    OSL_ENSURE( bClipRegion, "OutputDevice::ImplSelectClipRegion() - can't create region" );
+    OSL_ENSURE( bClipRegion, "OutputDevice::SelectClipRegion() - can't create region" );
     return bClipRegion;
 }
 
diff --git a/vcl/source/outdev/outdev.cxx b/vcl/source/outdev/outdev.cxx
index ea18957..cc13332 100644
--- a/vcl/source/outdev/outdev.cxx
+++ b/vcl/source/outdev/outdev.cxx
@@ -761,7 +761,7 @@ void OutputDevice::ImplDrawFrameDev( const Point& rPt, const Point& rDevPt, cons
     if ( rRegion.IsNull() )
         mpGraphics->ResetClipRegion();
     else
-        ImplSelectClipRegion( rRegion );
+        SelectClipRegion( rRegion );
 
     SalTwoRect aPosAry;
     aPosAry.mnSrcX       = rDevPt.X();
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index a4fe203..f8f4bda 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -432,7 +432,7 @@ void Window::InitClipRegion()
     else
     {
         mbOutputClipped = false;
-        ImplSelectClipRegion( aRegion );
+        SelectClipRegion( aRegion );
     }
     mbClipRegionSet = true;
 
@@ -3150,7 +3150,7 @@ void Window::ImplScroll( const Rectangle& rRect,
                 pOutDev->ReMirror( aRegion );
             }
 
-            pOutDev->ImplSelectClipRegion( aRegion, pGraphics );
+            pOutDev->SelectClipRegion( aRegion, pGraphics );
             pGraphics->CopyArea( rRect.Left()+nHorzScroll, rRect.Top()+nVertScroll,
                                  rRect.Left(), rRect.Top(),
                                  rRect.GetWidth(), rRect.GetHeight(),
@@ -3578,7 +3578,7 @@ void Window::ImplPosSizeWindow( long nX, long nY,
                             {
 
                                 OutputDevice *pOutDev = GetOutDev();
-                                const bool bSelectClipRegion = pOutDev->ImplSelectClipRegion( aRegion, pGraphics );
+                                const bool bSelectClipRegion = pOutDev->SelectClipRegion( aRegion, pGraphics );
                                 if ( bSelectClipRegion )
                                 {
                                     pGraphics->CopyArea( mnOutOffX, mnOutOffY,
diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx
index 3795f5c..8c9b44f 100644
--- a/vcl/source/window/window2.cxx
+++ b/vcl/source/window/window2.cxx
@@ -503,7 +503,7 @@ void Window::InvertTracking( const Rectangle& rRect, sal_uInt16 nFlags )
             Region aRegion( Rectangle( aPoint,
                                        Size( mnOutWidth, mnOutHeight ) ) );
             ImplClipBoundaries( aRegion, false, false );
-            pOutDev->ImplSelectClipRegion( aRegion, pGraphics );
+            pOutDev->SelectClipRegion( aRegion, pGraphics );
         }
     }
 
@@ -567,7 +567,7 @@ void Window::InvertTracking( const Polygon& rPoly, sal_uInt16 nFlags )
             Region aRegion( Rectangle( aPoint,
                                        Size( mnOutWidth, mnOutHeight ) ) );
             ImplClipBoundaries( aRegion, false, false );
-            pOutDev->ImplSelectClipRegion( aRegion, pGraphics );
+            pOutDev->SelectClipRegion( aRegion, pGraphics );
         }
     }
 
commit c97159359ab6324798e16414d72d540e6c1112d5
Author: Chris Sherlock <chris.sherlock79 at gmail.com>
Date:   Fri Apr 25 03:28:04 2014 +1000

    VCL Change OutputDevice::ImplSetClipRegion to SetDeviceClipRegion
    
    Change-Id: Ia2db9d640af6bdc35f3e38b5b85355721d5b8331

diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx
index b39cb37..a6e7034 100644
--- a/include/vcl/outdev.hxx
+++ b/include/vcl/outdev.hxx
@@ -469,7 +469,7 @@ protected:
     virtual Region              GetActiveClipRegion() const;
 
 private:
-    SAL_DLLPRIVATE void         ImplSetClipRegion( const Region* pRegion );
+    SAL_DLLPRIVATE void         SetDeviceClipRegion( const Region* pRegion );
     SAL_DLLPRIVATE bool         ImplSelectClipRegion( const Region&, SalGraphics* pGraphics = NULL );
 
     ///@}
diff --git a/vcl/source/outdev/clipping.cxx b/vcl/source/outdev/clipping.cxx
index 299c272..f95b45c 100644
--- a/vcl/source/outdev/clipping.cxx
+++ b/vcl/source/outdev/clipping.cxx
@@ -106,7 +106,7 @@ bool OutputDevice::ImplSelectClipRegion( const Region& rRegion, SalGraphics* pGr
     return bClipRegion;
 }
 
-void OutputDevice::ImplSetClipRegion( const Region* pRegion )
+void OutputDevice::SetDeviceClipRegion( const Region* pRegion )
 {
     DBG_TESTSOLARMUTEX();
 
@@ -133,7 +133,7 @@ void OutputDevice::SetClipRegion()
     if ( mpMetaFile )
         mpMetaFile->AddAction( new MetaClipRegionAction( Region(), false ) );
 
-    ImplSetClipRegion( NULL );
+    SetDeviceClipRegion( NULL );
 
     if( mpAlphaVDev )
         mpAlphaVDev->SetClipRegion();
@@ -147,12 +147,12 @@ void OutputDevice::SetClipRegion( const Region& rRegion )
 
     if ( rRegion.IsNull() )
     {
-        ImplSetClipRegion( NULL );
+        SetDeviceClipRegion( NULL );
     }
     else
     {
         Region aRegion = LogicToPixel( rRegion );
-        ImplSetClipRegion( &aRegion );
+        SetDeviceClipRegion( &aRegion );
     }
 
     if( mpAlphaVDev )
diff --git a/vcl/source/outdev/outdev.cxx b/vcl/source/outdev/outdev.cxx
index 135ab33..ea18957 100644
--- a/vcl/source/outdev/outdev.cxx
+++ b/vcl/source/outdev/outdev.cxx
@@ -1189,7 +1189,7 @@ void OutputDevice::Pop()
         mbMap = pData->mbMapActive;
     }
     if ( pData->mnFlags & PUSH_CLIPREGION )
-        ImplSetClipRegion( pData->mpClipRegion );
+        SetDeviceClipRegion( pData->mpClipRegion );
     if ( pData->mnFlags & PUSH_REFPOINT )
     {
         if ( pData->mpRefPoint )


More information about the Libreoffice-commits mailing list