[Libreoffice-commits] core.git: 6 commits - cui/source officecfg/registry sc/source vcl/source

Tomaž Vajngerl tomaz.vajngerl at collabora.co.uk
Sun Jan 4 03:42:39 PST 2015


 cui/source/dialogs/zoom.cxx                              |   35 ---
 officecfg/registry/schema/org/openoffice/Office/Calc.xcs |    7 
 sc/source/ui/inc/tabview.hxx                             |    1 
 sc/source/ui/view/tabview.cxx                            |  136 ++++++++++-----
 sc/source/ui/view/tabview5.cxx                           |    9 
 vcl/source/control/scrbar.cxx                            |   16 +
 6 files changed, 135 insertions(+), 69 deletions(-)

New commits:
commit edc4fd31c9d2c57454e756d70a8fc5922fab703b
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
Date:   Sun Jan 4 20:41:31 2015 +0900

    Fix indent
    
    Change-Id: Ia39df03be4f4a2470ec16dc55855916ddd758a8b

diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx
index 0d52d8a..efc7758 100644
--- a/sc/source/ui/view/tabview.cxx
+++ b/sc/source/ui/view/tabview.cxx
@@ -433,15 +433,17 @@ void ScTabView::DoResize( const Point& rOffset, const Size& rSize, bool bInner )
                      {
                         if (nTabSize > nSizeLt-SC_SCROLLBAR_MIN)
                             nTabSize = nSizeLt-SC_SCROLLBAR_MIN;
-                        if (nTabSize < SC_TABBAR_MIN) nTabSize = SC_TABBAR_MIN;
-                            nSizeLt -= nTabSize;
-                        }
+                        if (nTabSize < SC_TABBAR_MIN)
+                            nTabSize = SC_TABBAR_MIN;
+                        nSizeLt -= nTabSize;
+                    }
                     else // right Scrollbar
                     {
                         if (nTabSize > nSizeRt-SC_SCROLLBAR_MIN)
                             nTabSize = nSizeRt-SC_SCROLLBAR_MIN;
-                        if (nTabSize < SC_TABBAR_MIN) nTabSize = SC_TABBAR_MIN;
-                            nSizeRt -= nTabSize;
+                        if (nTabSize < SC_TABBAR_MIN)
+                            nTabSize = SC_TABBAR_MIN;
+                        nSizeRt -= nTabSize;
                     }
                 }
             }
commit 63a7a64ba9aaa29fdd40065f2bf3b06c74fd2e3b
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
Date:   Sun Jan 4 20:39:24 2015 +0900

    Remove nOverlap as it is constantly set to 0 now.
    
    Change-Id: I31bfa39777d2cfe8c7fddc62f74273a8ba1a9bba

diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx
index 06367a6..0d52d8a 100644
--- a/sc/source/ui/view/tabview.cxx
+++ b/sc/source/ui/view/tabview.cxx
@@ -339,8 +339,6 @@ void ScTabView::DoResize( const Point& rOffset, const Size& rSize, bool bInner )
     if ( aViewData.GetVSplitMode() == SC_SPLIT_FIX )
         nSplitSizeY = 1;
 
-    const long nOverlap = 0;    // ScrollBar::GetWindowOverlapPixel();
-
     aBorderPos = rOffset;
     aFrameSize = rSize;
 
@@ -377,7 +375,7 @@ void ScTabView::DoResize( const Point& rOffset, const Size& rSize, bool bInner )
         if (bVScroll)
         {
             nBarX = nScrollBarSize;
-            nSizeX -= nBarX - nOverlap;
+            nSizeX -= nBarX;
         }
         if (bHScroll)
         {
@@ -386,14 +384,14 @@ void ScTabView::DoResize( const Point& rOffset, const Size& rSize, bool bInner )
             if (!mbInlineWithScrollbar)
                 nBarY += nScrollBarSize;
 
-            nSizeY -= nBarY - nOverlap;
+            nSizeY -= nBarY;
         }
 
         //  window at the bottom right
         lcl_SetPosSize( aScrollBarBox, Point( nPosX+nSizeX, nPosY+nSizeY ), Size( nBarX, nBarY ),
                         nTotalWidth, bLayoutRTL );
 
-        if (bHScroll)                               // Scrollbars horizontal
+        if (bHScroll) // Scrollbars horizontal
         {
             long nSizeLt = 0;       // left scroll bar
             long nSizeRt = 0;       // right scroll bar
@@ -403,7 +401,7 @@ void ScTabView::DoResize( const Point& rOffset, const Size& rSize, bool bInner )
             {
                 case SC_SPLIT_NONE:
                     nSizeSp = nSplitSizeX;
-                    nSizeLt = nSizeX - nSizeSp + nOverlap;          // Ecke ueberdecken
+                    nSizeLt = nSizeX - nSizeSp; // Covert the corner
                     break;
                 case SC_SPLIT_NORMAL:
                     nSizeSp = nSplitSizeX;
@@ -429,7 +427,7 @@ void ScTabView::DoResize( const Point& rOffset, const Size& rSize, bool bInner )
 
                 if (mbInlineWithScrollbar)
                 {
-                    nTabSize = pTabControl->GetSizePixel().Width() - nOverlap;
+                    nTabSize = pTabControl->GetSizePixel().Width();
 
                      if ( aViewData.GetHSplitMode() != SC_SPLIT_FIX ) // left Scrollbar
                      {
@@ -450,42 +448,41 @@ void ScTabView::DoResize( const Point& rOffset, const Size& rSize, bool bInner )
 
             if (mbInlineWithScrollbar)
             {
-                Point aTabPoint(nPosX - nOverlap, nPosY + nSizeY);
-                Size aTabSize(nTabSize + nOverlap, nBarY);
+                Point aTabPoint(nPosX, nPosY + nSizeY);
+                Size aTabSize(nTabSize, nBarY);
                 lcl_SetPosSize(*pTabControl, aTabPoint, aTabSize, nTotalWidth, bLayoutRTL);
                 pTabControl->SetSheetLayoutRTL(bLayoutRTL);
 
-                Point aHScrollLeftPoint(nPosX + nTabSize - nOverlap, nPosY + nSizeY);
-                Size aHScrollLeftSize(nSizeLt + 2 * nOverlap, nBarY);
-                lcl_SetPosSize( aHScrollLeft, aHScrollLeftPoint, aHScrollLeftSize, nTotalWidth, bLayoutRTL);
+                Point aHScrollLeftPoint(nPosX + nTabSize, nPosY + nSizeY);
+                Size aHScrollLeftSize(nSizeLt, nBarY);
+                lcl_SetPosSize(aHScrollLeft, aHScrollLeftPoint, aHScrollLeftSize, nTotalWidth, bLayoutRTL);
 
                 Point aHSplitterPoint(nPosX + nTabSize + nSizeLt, nPosY + nSizeY);
                 Size aHSplitterSize(nSizeSp, nBarY);
                 lcl_SetPosSize(*pHSplitter, aHSplitterPoint, aHSplitterSize, nTotalWidth, bLayoutRTL);
 
-                Point aHScrollRightPoint(nPosX + nTabSize + nSizeLt + nSizeSp - nOverlap, nPosY + nSizeY);
-                Size aHScrollRightSize(nSizeRt + 2 * nOverlap, nBarY);
+                Point aHScrollRightPoint(nPosX + nTabSize + nSizeLt + nSizeSp, nPosY + nSizeY);
+                Size aHScrollRightSize(nSizeRt, nBarY);
                 lcl_SetPosSize(aHScrollRight, aHScrollRightPoint, aHScrollRightSize, nTotalWidth, bLayoutRTL);
             }
             else
             {
-                Point aTabPoint(nPosX - nOverlap, nPosY + nSizeY + nScrollBarSize);
+                Point aTabPoint(nPosX, nPosY + nSizeY + nScrollBarSize);
                 Size aTabSize(nSizeX, nTabWidth);
-                lcl_SetPosSize( *pTabControl, aTabPoint, aTabSize, nTotalWidth, bLayoutRTL );
-                pTabControl->SetSheetLayoutRTL( bLayoutRTL );
+                lcl_SetPosSize(*pTabControl, aTabPoint, aTabSize, nTotalWidth, bLayoutRTL);
+                pTabControl->SetSheetLayoutRTL(bLayoutRTL);
 
-                Point aHScrollLeftPoint(nPosX - nOverlap, nPosY + nSizeY);
-                Size aHScrollLeftSize(nSizeLt + 2 * nOverlap, nScrollBarSize);
-                lcl_SetPosSize( aHScrollLeft, aHScrollLeftPoint, aHScrollLeftSize, nTotalWidth, bLayoutRTL );
+                Point aHScrollLeftPoint(nPosX, nPosY + nSizeY);
+                Size aHScrollLeftSize(nSizeLt, nScrollBarSize);
+                lcl_SetPosSize(aHScrollLeft, aHScrollLeftPoint, aHScrollLeftSize, nTotalWidth, bLayoutRTL);
 
                 Point aHSplitterPoint(nPosX + nSizeLt, nPosY + nSizeY);
                 Size aHSplitterSize(nSizeSp, nScrollBarSize);
-                lcl_SetPosSize( *pHSplitter, aHSplitterPoint, aHSplitterSize, nTotalWidth, bLayoutRTL );
-
-                Point aHScrollRightPoint(nPosX + nSizeLt + nSizeSp - nOverlap, nPosY + nSizeY);
-                Size aHScrollRightSize(nSizeRt + 2 * nOverlap, nScrollBarSize);
+                lcl_SetPosSize(*pHSplitter, aHSplitterPoint, aHSplitterSize, nTotalWidth, bLayoutRTL);
 
-                lcl_SetPosSize( aHScrollRight, aHScrollRightPoint, aHScrollRightSize, nTotalWidth, bLayoutRTL );
+                Point aHScrollRightPoint(nPosX + nSizeLt + nSizeSp, nPosY + nSizeY);
+                Size aHScrollRightSize(nSizeRt, nScrollBarSize);
+                lcl_SetPosSize(aHScrollRight, aHScrollRightPoint, aHScrollRightSize, nTotalWidth, bLayoutRTL);
             }
             //  SetDragRectPixel is done below
         }
@@ -513,13 +510,13 @@ void ScTabView::DoResize( const Point& rOffset, const Size& rSize, bool bInner )
             }
             nSizeDn = nSizeY - nSizeUp - nSizeSp;
 
-            lcl_SetPosSize( aVScrollTop, Point(nPosX+nSizeX, nPosY-nOverlap),
-                                            Size(nBarX,nSizeUp+2*nOverlap), nTotalWidth, bLayoutRTL );
-            lcl_SetPosSize( *pVSplitter, Point( nPosX+nSizeX, nPosY+nSizeUp ),
+            lcl_SetPosSize( aVScrollTop, Point(nPosX + nSizeX, nPosY),
+                                            Size(nBarX, nSizeUp), nTotalWidth, bLayoutRTL );
+            lcl_SetPosSize( *pVSplitter, Point( nPosX + nSizeX, nPosY+nSizeUp ),
                                             Size( nBarX, nSizeSp ), nTotalWidth, bLayoutRTL );
-            lcl_SetPosSize( aVScrollBottom, Point(nPosX+nSizeX,
-                                                nPosY+nSizeUp+nSizeSp-nOverlap),
-                                            Size(nBarX, nSizeDn+2*nOverlap), nTotalWidth, bLayoutRTL );
+            lcl_SetPosSize( aVScrollBottom, Point(nPosX + nSizeX,
+                                                nPosY + nSizeUp + nSizeSp),
+                                            Size(nBarX, nSizeDn), nTotalWidth, bLayoutRTL );
 
             //  SetDragRectPixel is done below
         }
@@ -538,14 +535,14 @@ void ScTabView::DoResize( const Point& rOffset, const Size& rSize, bool bInner )
         nBarY = aHScrollLeft.GetSizePixel().Height();
         nBarX = aVScrollBottom.GetSizePixel().Width();
 
-        long nSize1 = nSizeX + nOverlap;
+        long nSize1 = nSizeX;
 
         long nTabSize = nSize1;
         if (nTabSize < 0) nTabSize = 0;
 
-        lcl_SetPosSize( *pTabControl, Point(nPosX-nOverlap, nPosY+nSizeY-nBarY),
-                                        Size(nTabSize+nOverlap, nBarY), nTotalWidth, bLayoutRTL );
-        nSizeY -= nBarY - nOverlap;
+        lcl_SetPosSize( *pTabControl, Point(nPosX, nPosY+nSizeY-nBarY),
+                                        Size(nTabSize, nBarY), nTotalWidth, bLayoutRTL );
+        nSizeY -= nBarY;
         lcl_SetPosSize( aScrollBarBox, Point( nPosX+nSizeX, nPosY+nSizeY ), Size( nBarX, nBarY ),
                                         nTotalWidth, bLayoutRTL );
 
commit 12d37f92507ab66fd519a68a2479e1cd7136cf74
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
Date:   Sun Jan 4 18:42:14 2015 +0900

    fdo#87684 option to make tabbar inline with scrollbar again
    
    This adds an option to move the tabbar back to be inline with
    scrollbar. The option is only available in Expert Configuration
    under key: /org.openoffice.Office.Calc/Layout/Other property
    TabbarInlineWithScrollbar
    
    Change-Id: I95491072ad1cc195f2d8b8d0fadbd5ef045767e7

diff --git a/officecfg/registry/schema/org/openoffice/Office/Calc.xcs b/officecfg/registry/schema/org/openoffice/Office/Calc.xcs
index 141d91a..832c795 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Calc.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Calc.xcs
@@ -442,6 +442,13 @@
           </constraints>
           <value>9</value>
         </prop>
+        <prop oor:name="TabbarInlineWithScrollbar" oor:type="xs:boolean" oor:nillable="false">
+          <info>
+            <desc>Specifies if the tabbar should be shown inline with the scrollbar.</desc>
+            <label>Inline tabbar with scrollbar</label>
+          </info>
+          <value>false</value>
+        </prop>
         <group oor:name="TabStop">
           <!-- OldPath: Calc/Layout -->
           <!-- OldLocation: Soffice.cfg -->
diff --git a/sc/source/ui/inc/tabview.hxx b/sc/source/ui/inc/tabview.hxx
index 2aba44d..63573ba 100644
--- a/sc/source/ui/inc/tabview.hxx
+++ b/sc/source/ui/inc/tabview.hxx
@@ -165,6 +165,7 @@ private:
     bool                bBlockNeg:1;              // is no longer highlighted?
     bool                bBlockCols:1;             // are whole columns selected?
     bool                bBlockRows:1;             // are whole rows selected?
+    bool                mbInlineWithScrollbar:1;  // should inline with scrollbar?
 
     void            Init();
 
diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx
index e734401..06367a6 100644
--- a/sc/source/ui/view/tabview.cxx
+++ b/sc/source/ui/view/tabview.cxx
@@ -59,6 +59,9 @@
 
 #define SC_ICONSIZE     36
 
+#define SC_SCROLLBAR_MIN 30
+#define SC_TABBAR_MIN 6
+
 using namespace ::com::sun::star;
 
 //  Corner-Button
@@ -228,7 +231,8 @@ ScTabView::ScTabView( vcl::Window* pParent, ScDocShell& rDocSh, ScTabViewShell*
     bDragging( false ),
     bBlockNeg( false ),
     bBlockCols( false ),
-    bBlockRows( false )
+    bBlockRows( false ),
+    mbInlineWithScrollbar( false )
 {
     Init();
 }
@@ -377,7 +381,11 @@ void ScTabView::DoResize( const Point& rOffset, const Size& rSize, bool bInner )
         }
         if (bHScroll)
         {
-            nBarY = nScrollBarSize + nTabWidth;
+            nBarY = nTabWidth;
+
+            if (!mbInlineWithScrollbar)
+                nBarY += nScrollBarSize;
+
             nSizeY -= nBarY - nOverlap;
         }
 
@@ -408,6 +416,8 @@ void ScTabView::DoResize( const Point& rOffset, const Size& rSize, bool bInner )
             }
             nSizeRt = nSizeX - nSizeLt - nSizeSp;
 
+            long nTabSize = 0;
+
             if (bTabControl)
             {
                 // pending relative tab bar width from extended document options
@@ -416,26 +426,67 @@ void ScTabView::DoResize( const Point& rOffset, const Size& rSize, bool bInner )
                     SetRelTabBarWidth( mfPendingTabBarWidth );
                     mfPendingTabBarWidth = -1.0;
                 }
-            }
 
-            Point aTabPoint(nPosX - nOverlap, nPosY + nSizeY + nScrollBarSize);
-            Size aTabSize(nSizeX, nBarY - nScrollBarSize);
-            lcl_SetPosSize( *pTabControl, aTabPoint, aTabSize, nTotalWidth, bLayoutRTL );
-            pTabControl->SetSheetLayoutRTL( bLayoutRTL );
+                if (mbInlineWithScrollbar)
+                {
+                    nTabSize = pTabControl->GetSizePixel().Width() - nOverlap;
+
+                     if ( aViewData.GetHSplitMode() != SC_SPLIT_FIX ) // left Scrollbar
+                     {
+                        if (nTabSize > nSizeLt-SC_SCROLLBAR_MIN)
+                            nTabSize = nSizeLt-SC_SCROLLBAR_MIN;
+                        if (nTabSize < SC_TABBAR_MIN) nTabSize = SC_TABBAR_MIN;
+                            nSizeLt -= nTabSize;
+                        }
+                    else // right Scrollbar
+                    {
+                        if (nTabSize > nSizeRt-SC_SCROLLBAR_MIN)
+                            nTabSize = nSizeRt-SC_SCROLLBAR_MIN;
+                        if (nTabSize < SC_TABBAR_MIN) nTabSize = SC_TABBAR_MIN;
+                            nSizeRt -= nTabSize;
+                    }
+                }
+            }
 
-            Point aHScrollLeftPoint(nPosX - nOverlap, nPosY + nSizeY);
-            Size aHScrollLeftSize(nSizeLt + 2 * nOverlap, nScrollBarSize);
-            lcl_SetPosSize( aHScrollLeft, aHScrollLeftPoint, aHScrollLeftSize, nTotalWidth, bLayoutRTL );
+            if (mbInlineWithScrollbar)
+            {
+                Point aTabPoint(nPosX - nOverlap, nPosY + nSizeY);
+                Size aTabSize(nTabSize + nOverlap, nBarY);
+                lcl_SetPosSize(*pTabControl, aTabPoint, aTabSize, nTotalWidth, bLayoutRTL);
+                pTabControl->SetSheetLayoutRTL(bLayoutRTL);
+
+                Point aHScrollLeftPoint(nPosX + nTabSize - nOverlap, nPosY + nSizeY);
+                Size aHScrollLeftSize(nSizeLt + 2 * nOverlap, nBarY);
+                lcl_SetPosSize( aHScrollLeft, aHScrollLeftPoint, aHScrollLeftSize, nTotalWidth, bLayoutRTL);
+
+                Point aHSplitterPoint(nPosX + nTabSize + nSizeLt, nPosY + nSizeY);
+                Size aHSplitterSize(nSizeSp, nBarY);
+                lcl_SetPosSize(*pHSplitter, aHSplitterPoint, aHSplitterSize, nTotalWidth, bLayoutRTL);
+
+                Point aHScrollRightPoint(nPosX + nTabSize + nSizeLt + nSizeSp - nOverlap, nPosY + nSizeY);
+                Size aHScrollRightSize(nSizeRt + 2 * nOverlap, nBarY);
+                lcl_SetPosSize(aHScrollRight, aHScrollRightPoint, aHScrollRightSize, nTotalWidth, bLayoutRTL);
+            }
+            else
+            {
+                Point aTabPoint(nPosX - nOverlap, nPosY + nSizeY + nScrollBarSize);
+                Size aTabSize(nSizeX, nTabWidth);
+                lcl_SetPosSize( *pTabControl, aTabPoint, aTabSize, nTotalWidth, bLayoutRTL );
+                pTabControl->SetSheetLayoutRTL( bLayoutRTL );
 
-            Point aHSplitterPoint(nPosX + nSizeLt, nPosY + nSizeY);
-            Size aHSplitterSize(nSizeSp, nScrollBarSize);
-            lcl_SetPosSize( *pHSplitter, aHSplitterPoint, aHSplitterSize, nTotalWidth, bLayoutRTL );
+                Point aHScrollLeftPoint(nPosX - nOverlap, nPosY + nSizeY);
+                Size aHScrollLeftSize(nSizeLt + 2 * nOverlap, nScrollBarSize);
+                lcl_SetPosSize( aHScrollLeft, aHScrollLeftPoint, aHScrollLeftSize, nTotalWidth, bLayoutRTL );
 
-            Point aHScrollRightPoint(nPosX + nSizeLt + nSizeSp - nOverlap, nPosY + nSizeY);
-            Size aHScrollRightSize(nSizeRt + 2 * nOverlap, nScrollBarSize);
+                Point aHSplitterPoint(nPosX + nSizeLt, nPosY + nSizeY);
+                Size aHSplitterSize(nSizeSp, nScrollBarSize);
+                lcl_SetPosSize( *pHSplitter, aHSplitterPoint, aHSplitterSize, nTotalWidth, bLayoutRTL );
 
-            lcl_SetPosSize( aHScrollRight, aHScrollRightPoint, aHScrollRightSize, nTotalWidth, bLayoutRTL );
+                Point aHScrollRightPoint(nPosX + nSizeLt + nSizeSp - nOverlap, nPosY + nSizeY);
+                Size aHScrollRightSize(nSizeRt + 2 * nOverlap, nScrollBarSize);
 
+                lcl_SetPosSize( aHScrollRight, aHScrollRightPoint, aHScrollRightSize, nTotalWidth, bLayoutRTL );
+            }
             //  SetDragRectPixel is done below
         }
 
diff --git a/sc/source/ui/view/tabview5.cxx b/sc/source/ui/view/tabview5.cxx
index 424e9bc..66ec1a8 100644
--- a/sc/source/ui/view/tabview5.cxx
+++ b/sc/source/ui/view/tabview5.cxx
@@ -51,6 +51,8 @@
 #include <vcl/svapp.hxx>
 #include <vcl/settings.hxx>
 
+#include <officecfg/Office/Calc.hxx>
+
 using namespace com::sun::star;
 
 // STATIC DATA -----------------------------------------------------------
@@ -65,6 +67,8 @@ void ScTabView::Init()
 
     sal_uInt16 i;
 
+    mbInlineWithScrollbar = officecfg::Office::Calc::Layout::Other::TabbarInlineWithScrollbar::get();
+
     aScrollTimer.SetTimeout(10);
     aScrollTimer.SetTimeoutHdl( LINK( this, ScTabView, TimerHdl ) );
 
@@ -94,7 +98,10 @@ void ScTabView::Init()
     pHSplitter->SetKeyboardStepSize( 1 );
     pVSplitter->SetKeyboardStepSize( 1 );
 
-    pTabControl = new ScTabControl( pFrameWin, &aViewData );
+    pTabControl = new ScTabControl(pFrameWin, &aViewData);
+    if (mbInlineWithScrollbar)
+        pTabControl->SetStyle(pTabControl->GetStyle() | WB_SIZEABLE);
+
     /*  #i97900# The tab control has to remain in RTL mode if GUI is RTL, this
         is needed to draw the 3D effect correctly. The base TabBar implementes
         mirroring independent from the GUI direction. Have to set RTL mode
commit d91926de43d2192759029f7124e4e515efc96ba7
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
Date:   Sun Jan 4 17:38:11 2015 +0900

    tabview - put locals into anonymous namespace
    
    Change-Id: I8af78740ce3c0533eeb5277f8065f3fd84cb8834

diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx
index fe56acd..e734401 100644
--- a/sc/source/ui/view/tabview.cxx
+++ b/sc/source/ui/view/tabview.cxx
@@ -1302,7 +1302,10 @@ void ScTabView::ScrollLines( long nDeltaX, long nDeltaY )
         ScrollY(nDeltaY,WhichV(eWhich));
 }
 
-static SCROW lcl_LastVisible( ScViewData& rViewData )
+namespace
+{
+
+SCROW lcl_LastVisible( ScViewData& rViewData )
 {
     //  wenn am Dokumentende viele Zeilen ausgeblendet sind (welcher Trottel macht sowas?),
     //  soll dadurch nicht auf breite Zeilenkoepfe geschaltet werden
@@ -1317,6 +1320,8 @@ static SCROW lcl_LastVisible( ScViewData& rViewData )
     return nVis;
 }
 
+} // anonymous namespace
+
 void ScTabView::UpdateHeaderWidth( const ScVSplitPos* pWhich, const SCROW* pPosY )
 {
     if ( !pRowBar[SC_SPLIT_BOTTOM] || MAXROW < 10000 )
@@ -1884,7 +1889,10 @@ Point ScTabView::GetMousePosPixel()
     return aPos;
 }
 
-static bool lcl_MouseIsOverWin( const Point& rScreenPosPixel, vcl::Window* pWin )
+namespace
+{
+
+bool lcl_MouseIsOverWin( const Point& rScreenPosPixel, vcl::Window* pWin )
 {
     if (pWin)
     {
@@ -1900,6 +1908,8 @@ static bool lcl_MouseIsOverWin( const Point& rScreenPosPixel, vcl::Window* pWin
     return false;
 }
 
+} // anonymous namespace
+
 void ScTabView::SnapSplitPos( Point& rScreenPosPixel )
 {
     bool bOverWin = false;
commit 7431bc263aa8411eb2934c8aefd2c222d5f83b28
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
Date:   Wed Dec 31 17:25:05 2014 +0900

    Draw a rect in the uncovered region of the native scrollbar
    
    When the requested region is larger than the native scrollbar the
    uncovered regions need to be drawn with a background color to
    avoid artifacts.
    
    This situation can happen when the TabBar is inline with scrollbar
    when the width of the TabBar is greater than the width of the
    scrollbar. Inline TabBar support is added in a later commit.
    
    Change-Id: I70cb2e5bfd8d79401f77bbe55abe596adc160194

diff --git a/vcl/source/control/scrbar.cxx b/vcl/source/control/scrbar.cxx
index 06920fe..e5a601f 100644
--- a/vcl/source/control/scrbar.cxx
+++ b/vcl/source/control/scrbar.cxx
@@ -502,6 +502,20 @@ bool ScrollBar::ImplDrawNative( sal_uInt16 nDrawFlags )
         aCtrlRegion.Union( maPage1Rect );
         aCtrlRegion.Union( maPage2Rect );
         aCtrlRegion.Union( maThumbRect );
+
+        Rectangle aRequestedRegion(Point(0,0), GetOutputSizePixel());
+        // if the actual native control region is smaller then the region that
+        // we requested the control to draw in, then draw a background rectangle
+        // to avoid drawing artifacts in the uncovered region
+        if (aCtrlRegion.GetWidth() < aRequestedRegion.GetWidth() ||
+            aCtrlRegion.GetHeight() < aRequestedRegion.GetHeight())
+        {
+            Color aFaceColor = GetSettings().GetStyleSettings().GetFaceColor();
+            SetFillColor(aFaceColor);
+            SetLineColor(aFaceColor);
+            DrawRect(aRequestedRegion);
+        }
+
         bNativeOK = DrawNativeControl( CTRL_SCROLLBAR, (bHorz ? PART_DRAW_BACKGROUND_HORZ : PART_DRAW_BACKGROUND_VERT),
                         aCtrlRegion, nState, scrValue, OUString() );
     }
@@ -613,7 +627,7 @@ void ScrollBar::ImplDraw( sal_uInt16 nDrawFlags, OutputDevice* pOutDev )
 {
     DecorationView          aDecoView( pOutDev );
     Rectangle               aTempRect;
-    sal_uInt16                  nStyle;
+    sal_uInt16              nStyle;
     const StyleSettings&    rStyleSettings = pOutDev->GetSettings().GetStyleSettings();
     SymbolType              eSymbolType;
     bool                    bEnabled = IsEnabled();
commit 8c639609984ffb7977934ce0575bbc1a1df7dee4
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
Date:   Wed Dec 31 15:39:00 2014 +0900

    Cleanup source of zoom dialog, translate german error message
    
    Change-Id: Iccd140f06b9504606850de780262a23004a803b4

diff --git a/cui/source/dialogs/zoom.cxx b/cui/source/dialogs/zoom.cxx
index 1c57ad6..6fee5a5 100644
--- a/cui/source/dialogs/zoom.cxx
+++ b/cui/source/dialogs/zoom.cxx
@@ -47,8 +47,6 @@ sal_uInt16 SvxZoomDialog::GetFactor() const
         return SPECIAL_FACTOR;
 }
 
-
-
 void SvxZoomDialog::SetFactor( sal_uInt16 nNewFactor, sal_uInt16 nBtnId )
 {
     m_pUserEdit->Disable();
@@ -90,8 +88,6 @@ void SvxZoomDialog::SetFactor( sal_uInt16 nNewFactor, sal_uInt16 nBtnId )
     }
 }
 
-
-
 void SvxZoomDialog::HideButton( sal_uInt16 nBtnId )
 {
     switch ( nBtnId )
@@ -109,12 +105,10 @@ void SvxZoomDialog::HideButton( sal_uInt16 nBtnId )
             break;
 
         default:
-            OSL_FAIL( "Falsche Button-Nummer!!!" );
+            OSL_FAIL("Wrong button number!" );
     }
 }
 
-
-
 void SvxZoomDialog::SetLimits( sal_uInt16 nMin, sal_uInt16 nMax )
 {
     DBG_ASSERT( nMin < nMax, "invalid limits" );
@@ -124,8 +118,6 @@ void SvxZoomDialog::SetLimits( sal_uInt16 nMin, sal_uInt16 nMax )
     m_pUserEdit->SetLast( nMax );
 }
 
-
-
 SvxZoomDialog::SvxZoomDialog( vcl::Window* pParent, const SfxItemSet& rCoreSet )
     : SfxModalDialog(pParent, "ZoomDialog", "cui/ui/zoomdialog.ui")
     , rSet(rCoreSet)
@@ -284,16 +276,12 @@ SvxZoomDialog::SvxZoomDialog( vcl::Window* pParent, const SfxItemSet& rCoreSet )
     }
 }
 
-
-
 SvxZoomDialog::~SvxZoomDialog()
 {
     delete pOutSet;
     pOutSet = 0;
 }
 
-
-
 IMPL_LINK( SvxZoomDialog, UserHdl, RadioButton *, pBtn )
 {
     bModified = true;
@@ -308,8 +296,6 @@ IMPL_LINK( SvxZoomDialog, UserHdl, RadioButton *, pBtn )
     return 0;
 }
 
-
-
 IMPL_LINK_NOARG(SvxZoomDialog, SpinHdl)
 {
     if ( !m_pUserBtn->IsChecked() )
@@ -318,8 +304,6 @@ IMPL_LINK_NOARG(SvxZoomDialog, SpinHdl)
     return 0;
 }
 
-
-
 IMPL_LINK( SvxZoomDialog, ViewLayoutUserHdl, RadioButton *, pBtn )
 {
     bModified = true;
@@ -343,15 +327,13 @@ IMPL_LINK( SvxZoomDialog, ViewLayoutUserHdl, RadioButton *, pBtn )
     }
     else
     {
-        OSL_FAIL( "Wrong Button" );
+        OSL_FAIL("Wrong Button");
         return 0;
     }
 
     return 0;
 }
 
-
-
 IMPL_LINK( SvxZoomDialog, ViewLayoutSpinHdl, NumericField *, pEdt )
 {
     if ( pEdt == m_pColumnsEdit && !m_pColumnsBtn->IsChecked() )
@@ -370,8 +352,6 @@ IMPL_LINK( SvxZoomDialog, ViewLayoutSpinHdl, NumericField *, pEdt )
     return 0;
 }
 
-
-
 IMPL_LINK( SvxZoomDialog, ViewLayoutCheckHdl, CheckBox *, pChk )
 {
     if (pChk == m_pBookModeChk && !m_pColumnsBtn->IsChecked())
@@ -382,8 +362,6 @@ IMPL_LINK( SvxZoomDialog, ViewLayoutCheckHdl, CheckBox *, pChk )
     return 0;
 }
 
-
-
 IMPL_LINK( SvxZoomDialog, OKHdl, Button *, pBtn )
 {
     if ( bModified || m_pOKBtn != pBtn )
@@ -425,7 +403,7 @@ IMPL_LINK( SvxZoomDialog, OKHdl, Button *, pBtn )
         }
         else
         {
-            OSL_FAIL( "Wrong Button" );
+            OSL_FAIL("Wrong Button");
             return 0;
         }
         pOutSet = new SfxItemSet( rSet );
@@ -436,10 +414,10 @@ IMPL_LINK( SvxZoomDialog, OKHdl, Button *, pBtn )
             pOutSet->Put(aViewLayoutItem);
 
         // memorize value from the UserEdit beyond the dialog
-        SfxObjectShell* pSh = SfxObjectShell::Current();
+        SfxObjectShell* pShell = SfxObjectShell::Current();
 
-        if ( pSh )
-            pSh->PutItem( SfxUInt16Item( SID_ATTR_ZOOM_USER,
+        if ( pShell )
+            pShell->PutItem( SfxUInt16Item( SID_ATTR_ZOOM_USER,
                                          (sal_uInt16)m_pUserEdit->GetValue() ) );
         EndDialog( RET_OK );
     }
@@ -448,5 +426,4 @@ IMPL_LINK( SvxZoomDialog, OKHdl, Button *, pBtn )
     return 0;
 }
 
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


More information about the Libreoffice-commits mailing list