[Libreoffice-commits] core.git: Branch 'feature/kde4' - 31 commits - avmedia/source codemaker/Executable_cppumaker.mk codemaker/Executable_javamaker.mk connectivity/Module_connectivity.mk i18npool/Executable_gencoll_rule.mk i18npool/Library_i18npool.mk idlc/Executable_idlc.mk include/avmedia include/sfx2 include/vcl registry/Executable_regmerge.mk registry/Executable_regview.mk RepositoryExternal.mk rsc/Executable_rsc.mk rsc/source sal/Module_sal.mk setup_native/source sfx2/source solenv/gbuild svx/source sw/source unoidl/Executable_unoidl-check.mk unoidl/Executable_unoidl-read.mk unoidl/Executable_unoidl-write.mk vcl/inc vcl/osx vcl/source vcl/unx vcl/win writerfilter/source

Jan-Marek Glogowski glogow at fbihome.de
Tue Dec 20 11:24:33 UTC 2016


Rebased ref, commits from common ancestor:
commit 71eba3d06996e99152e658b95648f6dae3577933
Author: Jan-Marek Glogowski <glogow at fbihome.de>
Date:   Sun Oct 30 10:10:49 2016 +0100

    Move ImplFrameData initialization into constructor
    
    Change-Id: Id918ae46ed521fca5675845b2eb9cd26a8c7ebbb

diff --git a/vcl/inc/window.h b/vcl/inc/window.h
index cb5d7e6..8abe5d1 100644
--- a/vcl/inc/window.h
+++ b/vcl/inc/window.h
@@ -157,6 +157,8 @@ struct ImplFrameData
     VclPtr<VirtualDevice> mpBuffer; ///< Buffer for the double-buffering
     bool mbInBufferedPaint; ///< PaintHelper is in the process of painting into this buffer.
     Rectangle maBufferedRect; ///< Rectangle in the buffer that has to be painted to the screen.
+
+    ImplFrameData( vcl::Window *pWindow );
 };
 
 struct ImplAccessibleInfos
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index 9d576db..dc2b81f 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -775,6 +775,54 @@ ImplWinData::~ImplWinData()
     delete mpTrackRect;
 }
 
+ImplFrameData::ImplFrameData( vcl::Window *pWindow )
+{
+    ImplSVData* pSVData = ImplGetSVData();
+    assert (pSVData->maWinData.mpFirstFrame.get() != pWindow);
+    mpNextFrame        = pSVData->maWinData.mpFirstFrame;
+    pSVData->maWinData.mpFirstFrame = pWindow;
+    mpFirstOverlap     = nullptr;
+    mpFocusWin         = nullptr;
+    mpMouseMoveWin     = nullptr;
+    mpMouseDownWin     = nullptr;
+    mpFontCollection   = pSVData->maGDIData.mpScreenFontList;
+    mpFontCache        = pSVData->maGDIData.mpScreenFontCache;
+    mnFocusId          = nullptr;
+    mnMouseMoveId      = nullptr;
+    mnLastMouseX       = -1;
+    mnLastMouseY       = -1;
+    mnBeforeLastMouseX = -1;
+    mnBeforeLastMouseY = -1;
+    mnFirstMouseX      = -1;
+    mnFirstMouseY      = -1;
+    mnLastMouseWinX    = -1;
+    mnLastMouseWinY    = -1;
+    mnModalMode        = 0;
+    mnMouseDownTime    = 0;
+    mnClickCount       = 0;
+    mnFirstMouseCode   = 0;
+    mnMouseCode        = 0;
+    mnMouseMode        = MouseEventModifiers::NONE;
+    meMapUnit          = MapUnit::MapPixel;
+    mbHasFocus         = false;
+    mbInMouseMove      = false;
+    mbMouseIn          = false;
+    mbStartDragCalled  = false;
+    mbNeedSysWindow    = false;
+    mbMinimized        = false;
+    mbStartFocusState  = false;
+    mbInSysObjFocusHdl = false;
+    mbInSysObjToTopHdl = false;
+    mbSysObjFocus      = false;
+    maPaintIdle.SetPriority( SchedulerPriority::REPAINT );
+    maPaintIdle.SetIdleHdl( LINK( pWindow, vcl::Window, ImplHandlePaintHdl ) );
+    maPaintIdle.SetDebugName( "vcl::Window maPaintIdle" );
+    maResizeIdle.SetPriority( SchedulerPriority::RESIZE );
+    maResizeIdle.SetIdleHdl( LINK( pWindow, vcl::Window, ImplHandleResizeTimerHdl ) );
+    maResizeIdle.SetDebugName( "vcl::Window maResizeIdle" );
+    mbInternalDragGestureRecognizer = false;
+    mbInBufferedPaint = false;
+}
 
 namespace vcl {
 
@@ -1020,58 +1068,13 @@ void Window::ImplInit( vcl::Window* pParent, WinBits nStyle, SystemParentData* p
         pFrame->SetCallback( this, ImplWindowFrameProc );
 
         // set window frame data
-        mpWindowImpl->mpFrameData     = new ImplFrameData;
+        mpWindowImpl->mpFrameData     = new ImplFrameData( this );
         mpWindowImpl->mpFrame         = pFrame;
         mpWindowImpl->mpFrameWindow   = this;
         mpWindowImpl->mpOverlapWindow = this;
 
-        // set frame data
-        assert (pSVData->maWinData.mpFirstFrame.get() != this);
-        mpWindowImpl->mpFrameData->mpNextFrame        = pSVData->maWinData.mpFirstFrame;
-        pSVData->maWinData.mpFirstFrame = this;
-        mpWindowImpl->mpFrameData->mpFirstOverlap     = nullptr;
-        mpWindowImpl->mpFrameData->mpFocusWin         = nullptr;
-        mpWindowImpl->mpFrameData->mpMouseMoveWin     = nullptr;
-        mpWindowImpl->mpFrameData->mpMouseDownWin     = nullptr;
-        mpWindowImpl->mpFrameData->mpFontCollection   = pSVData->maGDIData.mpScreenFontList;
-        mpWindowImpl->mpFrameData->mpFontCache        = pSVData->maGDIData.mpScreenFontCache;
-        mpWindowImpl->mpFrameData->mnFocusId          = nullptr;
-        mpWindowImpl->mpFrameData->mnMouseMoveId      = nullptr;
-        mpWindowImpl->mpFrameData->mnLastMouseX       = -1;
-        mpWindowImpl->mpFrameData->mnLastMouseY       = -1;
-        mpWindowImpl->mpFrameData->mnBeforeLastMouseX = -1;
-        mpWindowImpl->mpFrameData->mnBeforeLastMouseY = -1;
-        mpWindowImpl->mpFrameData->mnFirstMouseX      = -1;
-        mpWindowImpl->mpFrameData->mnFirstMouseY      = -1;
-        mpWindowImpl->mpFrameData->mnLastMouseWinX    = -1;
-        mpWindowImpl->mpFrameData->mnLastMouseWinY    = -1;
-        mpWindowImpl->mpFrameData->mnModalMode        = 0;
-        mpWindowImpl->mpFrameData->mnMouseDownTime    = 0;
-        mpWindowImpl->mpFrameData->mnClickCount       = 0;
-        mpWindowImpl->mpFrameData->mnFirstMouseCode   = 0;
-        mpWindowImpl->mpFrameData->mnMouseCode        = 0;
-        mpWindowImpl->mpFrameData->mnMouseMode        = MouseEventModifiers::NONE;
-        mpWindowImpl->mpFrameData->meMapUnit          = MapUnit::MapPixel;
-        mpWindowImpl->mpFrameData->mbHasFocus         = false;
-        mpWindowImpl->mpFrameData->mbInMouseMove      = false;
-        mpWindowImpl->mpFrameData->mbMouseIn          = false;
-        mpWindowImpl->mpFrameData->mbStartDragCalled  = false;
-        mpWindowImpl->mpFrameData->mbNeedSysWindow    = false;
-        mpWindowImpl->mpFrameData->mbMinimized        = false;
-        mpWindowImpl->mpFrameData->mbStartFocusState  = false;
-        mpWindowImpl->mpFrameData->mbInSysObjFocusHdl = false;
-        mpWindowImpl->mpFrameData->mbInSysObjToTopHdl = false;
-        mpWindowImpl->mpFrameData->mbSysObjFocus      = false;
-        mpWindowImpl->mpFrameData->maPaintIdle.SetPriority( SchedulerPriority::REPAINT );
-        mpWindowImpl->mpFrameData->maPaintIdle.SetIdleHdl( LINK( this, Window, ImplHandlePaintHdl ) );
-        mpWindowImpl->mpFrameData->maPaintIdle.SetDebugName( "vcl::Window maPaintIdle" );
-        mpWindowImpl->mpFrameData->maResizeIdle.SetPriority( SchedulerPriority::RESIZE );
-        mpWindowImpl->mpFrameData->maResizeIdle.SetIdleHdl( LINK( this, Window, ImplHandleResizeTimerHdl ) );
-        mpWindowImpl->mpFrameData->maResizeIdle.SetDebugName( "vcl::Window maResizeIdle" );
-        mpWindowImpl->mpFrameData->mbInternalDragGestureRecognizer = false;
         if (!(nStyle & WB_DEFAULTWIN) && mpWindowImpl->mbDoubleBufferingRequested)
             RequestDoubleBuffering(true);
-        mpWindowImpl->mpFrameData->mbInBufferedPaint = false;
 
         if ( pRealParent && IsTopWindow() )
         {
commit d19839cc398f67def811e6a64c1f9fbbcfe11d9b
Author: Jan-Marek Glogowski <glogow at fbihome.de>
Date:   Wed Oct 12 19:44:08 2016 +0200

    Drop ListBox include from ComboBox header
    
    ComboBox just uses ListBox internally
    
    Change-Id: Ieed279160db1c9918bd9f3e37102b59ea62f0581

diff --git a/avmedia/source/framework/MediaControlBase.cxx b/avmedia/source/framework/MediaControlBase.cxx
index ff6eaeb..522479d 100644
--- a/avmedia/source/framework/MediaControlBase.cxx
+++ b/avmedia/source/framework/MediaControlBase.cxx
@@ -25,7 +25,7 @@
 #include <avmedia/mediaitem.hxx>
 #include <svtools/miscopt.hxx>
 #include <tools/time.hxx>
-#include <vcl/toolbox.hxx>
+#include <vcl/lstbox.hxx>
 #include "mediacontrol.hrc"
 #include "helpids.hrc"
 #include "mediamisc.hxx"
@@ -270,4 +270,6 @@ Image MediaControlBase::GetImage( sal_Int32 nImageId) const
     return maImageList.GetImage( static_cast< sal_uInt16 >( nImageId ) );
 }
 
-}
\ No newline at end of file
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/avmedia/MediaControlBase.hxx b/include/avmedia/MediaControlBase.hxx
index d1afa6a..2a34f90 100644
--- a/include/avmedia/MediaControlBase.hxx
+++ b/include/avmedia/MediaControlBase.hxx
@@ -22,6 +22,7 @@
 #include <svx/svxdllapi.h>
 #include <vcl/edit.hxx>
 #include <vcl/toolbox.hxx>
+#include <vcl/lstbox.hxx>
 #include <vcl/slider.hxx>
 #include <avmedia/mediaitem.hxx>
 #include <avmedia/mediawindow.hxx>
@@ -81,4 +82,6 @@ private:
 };
 
 }
-#endif
\ No newline at end of file
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/combobox.hxx b/include/vcl/combobox.hxx
index 6796975..afe4d61 100644
--- a/include/vcl/combobox.hxx
+++ b/include/vcl/combobox.hxx
@@ -22,16 +22,12 @@
 
 #include <vcl/dllapi.h>
 #include <vcl/edit.hxx>
-#include <vcl/lstbox.hxx>
 
 #define COMBOBOX_APPEND             (SAL_MAX_INT32)
 #define COMBOBOX_ENTRY_NOTFOUND     (SAL_MAX_INT32)
 #define COMBOBOX_MAX_ENTRIES        (SAL_MAX_INT32 - 1)
 
 class UserDrawEvent;
-class ImplListBoxFloatingWindow;
-class ImplListBox;
-class ImplBtn;
 
 class VCL_DLLPUBLIC ComboBox : public Edit
 {
diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx
index 04e150d..cdee3a4 100644
--- a/vcl/source/window/printdlg.cxx
+++ b/vcl/source/window/printdlg.cxx
@@ -34,6 +34,7 @@
 #include <vcl/unohelp.hxx>
 #include <vcl/settings.hxx>
 #include <vcl/builderfactory.hxx>
+#include <vcl/lstbox.hxx>
 #include "jobset.h"
 
 #include "unotools/localedatawrapper.hxx"
commit c66a2c047ff97fd7440a198186202547c750c749
Author: Jan-Marek Glogowski <glogow at fbihome.de>
Date:   Sun Oct 9 17:14:54 2016 +0000

    KDE4 fix wrong fallthrough
    
    Was found and marked in 03f440c379a03500a40cc34097c68a150d7a226d,
    but is definitly wrong.
    
    Change-Id: I6d04814fb8f25a92dfaf96d8face855315cc0208

diff --git a/vcl/unx/kde4/KDESalGraphics.cxx b/vcl/unx/kde4/KDESalGraphics.cxx
index 565eadf..a1bf4b8 100644
--- a/vcl/unx/kde4/KDESalGraphics.cxx
+++ b/vcl/unx/kde4/KDESalGraphics.cxx
@@ -734,10 +734,8 @@ bool KDESalGraphics::getNativeControlRegion( ControlType type, ControlPart part,
                 boundingRect = contentRect;
 
                 retVal = true;
-
-                break;
             }
-            SAL_FALLTHROUGH;
+            break;
         case ControlType::Combobox:
         case ControlType::Listbox:
         {
commit 7630f22a0bbfd380af1c0251ea1886401b9c3719
Author: Jan-Marek Glogowski <glogow at fbihome.de>
Date:   Sun Oct 9 16:32:04 2016 +0000

    Assume pWin exists while drawing
    
    Change-Id: Id392b7c42d6470230a4d9f627704286e532dce3e

diff --git a/vcl/source/control/imp_listbox.cxx b/vcl/source/control/imp_listbox.cxx
index 2dd277a..6f6a3ed 100644
--- a/vcl/source/control/imp_listbox.cxx
+++ b/vcl/source/control/imp_listbox.cxx
@@ -2647,13 +2647,9 @@ void ImplWin::ImplDraw(vcl::RenderContext& rRenderContext, bool bLayout)
             Rectangle aCtrlRegion( aPoint - GetPosPixel(), pWin->GetSizePixel() );
 
             bool bMouseOver = false;
-            if( GetParent() )
-            {
-                vcl::Window *pChild = GetParent()->GetWindow( GetWindowType::FirstChild );
-                while( pChild && !(bMouseOver = pChild->IsMouseOver()) )
-                    pChild = pChild->GetWindow( GetWindowType::Next );
-            }
-
+            vcl::Window *pChild = pWin->GetWindow( GetWindowType::FirstChild );
+            while( pChild && !(bMouseOver = pChild->IsMouseOver()) )
+                pChild = pChild->GetWindow( GetWindowType::Next );
             if( bMouseOver )
                 nState |= ControlState::ROLLOVER;
 
commit 9cd7db0fa2f30f3a40c3e6b983467a5a27d00b28
Author: Jan-Marek Glogowski <glogow at fbihome.de>
Date:   Sun Oct 9 16:35:57 2016 +0000

    Fix focus and rollover for vcl::ListBox
    
    Change-Id: I4fffd086a38b54c673a199ea0603d25ca54aacd1

diff --git a/vcl/source/control/imp_listbox.cxx b/vcl/source/control/imp_listbox.cxx
index a09bdb9..2dd277a 100644
--- a/vcl/source/control/imp_listbox.cxx
+++ b/vcl/source/control/imp_listbox.cxx
@@ -2618,6 +2618,8 @@ void ImplWin::ImplDraw(vcl::RenderContext& rRenderContext, bool bLayout)
     if (!bLayout)
     {
         bool bNativeOK = false;
+        bool bHasFocus = HasFocus();
+        bool bIsEnabled = IsEnabled();
 
         ControlState nState = ControlState::ENABLED;
         if (rRenderContext.IsNativeControlSupported(ControlType::Listbox, ControlPart::Entire)
@@ -2629,9 +2631,11 @@ void ImplWin::ImplDraw(vcl::RenderContext& rRenderContext, bool bLayout)
             vcl::Window *pWin = GetParent();
 
             ImplControlValue aControlValue;
-            if ( !pWin->IsEnabled() )
+            bIsEnabled &= pWin->IsEnabled();
+            if ( !bIsEnabled )
                 nState &= ~ControlState::ENABLED;
-            if ( pWin->HasFocus() )
+            bHasFocus |= pWin->HasFocus();
+            if ( bHasFocus )
                 nState |= ControlState::FOCUSED;
 
             // The listbox is painted over the entire control including the
@@ -2667,12 +2671,23 @@ void ImplWin::ImplDraw(vcl::RenderContext& rRenderContext, bool bLayout)
                                                          nState, aControlValue, OUString());
         }
 
-        if (IsEnabled())
+        if (bIsEnabled)
         {
-            if (HasFocus() && !ImplGetSVData()->maNWFData.mbDDListBoxNoTextArea)
+            if (bHasFocus && !ImplGetSVData()->maNWFData.mbDDListBoxNoTextArea)
             {
-                rRenderContext.SetTextColor( rStyleSettings.GetHighlightTextColor() );
-                rRenderContext.SetFillColor( rStyleSettings.GetHighlightColor() );
+                if ( !ImplGetSVData()->maNWFData.mbNoFocusRects )
+                    rRenderContext.SetFillColor( rStyleSettings.GetHighlightColor() );
+                else
+                {
+                    rRenderContext.SetLineColor();
+                    rRenderContext.SetFillColor();
+                }
+                Color aColor;
+                if( bNativeOK && (nState & ControlState::ROLLOVER) )
+                    aColor = rStyleSettings.GetFieldRolloverTextColor();
+                else
+                    aColor = rStyleSettings.GetHighlightTextColor();
+                rRenderContext.SetTextColor( aColor );
                 rRenderContext.DrawRect( maFocusRect );
             }
             else
commit e833a7163ef64c87facf12b42306c7c81cc9c29a
Author: Jan-Marek Glogowski <glogow at fbihome.de>
Date:   Sun Oct 9 16:34:54 2016 +0000

    KDE4 use correct ComboBox frame pixel metric
    
    Change-Id: I03fa5489ffc5cd5bb386bb321519c61058db4fda

diff --git a/vcl/unx/kde4/KDESalGraphics.cxx b/vcl/unx/kde4/KDESalGraphics.cxx
index 0659e14..565eadf 100644
--- a/vcl/unx/kde4/KDESalGraphics.cxx
+++ b/vcl/unx/kde4/KDESalGraphics.cxx
@@ -142,16 +142,18 @@ namespace
         QApplication::style()->drawComplexControl(element, option, &painter);
     }
 
-    void lcl_drawFrame(QStyle::PrimitiveElement element, QImage* image, QStyle::State const & state)
+    void lcl_drawFrame( QStyle::PrimitiveElement element, QImage* image, QStyle::State const & state,
+                        QStyle::PixelMetric eLineMetric = QStyle::PM_DefaultFrameWidth )
     {
     #if ( QT_VERSION >= QT_VERSION_CHECK( 4, 5, 0 ) )
         QStyleOptionFrameV3 option;
         option.frameShape = QFrame::StyledPanel;
         option.state = QStyle::State_Sunken;
+        option.lineWidth = QApplication::style()->pixelMetric( eLineMetric );
     #else
         QStyleOptionFrame option;
 
-        QFrame aFrame( NULL );
+        QFrame aFrame( nullptr );
         aFrame.setFrameRect( QRect(0, 0, image->width(), image->height()) );
         aFrame.setFrameStyle( QFrame::StyledPanel | QFrame::Sunken );
         aFrame.ensurePolished();
@@ -160,7 +162,6 @@ namespace
         option.lineWidth = aFrame.lineWidth();
         option.midLineWidth = aFrame.midLineWidth();
     #endif
-
         draw(element, &option, image, state);
     }
 }
@@ -422,10 +423,12 @@ bool KDESalGraphics::drawNativeControl( ControlType type, ControlPart part,
     else if (type == ControlType::Listbox)
     {
         QStyleOptionComboBox option;
+        option.editable = false;
         switch (part) {
             case ControlPart::ListboxWindow:
                 lcl_drawFrame( QStyle::PE_Frame, m_image.get(),
-                               vclStateValue2StateFlag(nControlState, value) );
+                               vclStateValue2StateFlag(nControlState, value),
+                               QStyle::PM_ComboBoxFrameWidth );
                 break;
             case ControlPart::SubEdit:
                 draw( QStyle::CE_ComboBoxLabel, &option, m_image.get(),
@@ -773,9 +776,6 @@ bool KDESalGraphics::getNativeControlRegion( ControlType type, ControlPart part,
                     retVal = true;
                     break;
                 }
-                case ControlPart::ListboxWindow:
-                    retVal = true;
-                    break;
                 default:
                     break;
             }
commit 9904ac1cdbb4ed3c6f352b12981e5c25eef16764
Author: Jan-Marek Glogowski <glogow at fbihome.de>
Date:   Sun Oct 9 17:54:22 2016 +0200

    KDE4 rely on style()->pixelMetric for frame width
    
    Change-Id: I7a1e89c0c058bab0b6665e2b96b22251dcb51f4f

diff --git a/vcl/unx/kde4/KDESalGraphics.cxx b/vcl/unx/kde4/KDESalGraphics.cxx
index ce26a7e..0659e14 100644
--- a/vcl/unx/kde4/KDESalGraphics.cxx
+++ b/vcl/unx/kde4/KDESalGraphics.cxx
@@ -543,9 +543,8 @@ bool KDESalGraphics::drawNativeControl( ControlType type, ControlPart part,
     {
         lcl_drawFrame( QStyle::PE_Frame, m_image.get(),
                        vclStateValue2StateFlag(nControlState, value) );
-
         // draw just the border, see http://qa.openoffice.org/issues/show_bug.cgi?id=107945
-        int fw = static_cast< KDESalInstance* >(GetSalData()->m_pInstance)->getFrameWidth();
+        int fw = QApplication::style()->pixelMetric(QStyle::PM_DefaultFrameWidth);
         localClipRegion = new QRegion(QRegion(widgetRect).subtracted(widgetRect.adjusted(fw, fw, -fw, -fw)));
     }
     else if (type == ControlType::WindowBackground)
@@ -858,14 +857,11 @@ bool KDESalGraphics::getNativeControlRegion( ControlType type, ControlPart part,
         {
             if( part == ControlPart::Border )
             {
-                int nFrameWidth = static_cast< KDESalInstance* >(GetSalData()->m_pInstance)->getFrameWidth();
                 auto nStyle = static_cast<DrawFrameFlags>(
                     val.getNumericVal() & 0xFFF0);
                 if( nStyle & DrawFrameFlags::NoDraw )
                 {
-                    // in this case the question is: how thick would a frame be
-                    // see brdwin.cxx, decoview.cxx
-                    // most probably the behavior in decoview.cxx is wrong.
+                    int nFrameWidth = QApplication::style()->pixelMetric(QStyle::PM_DefaultFrameWidth);
                     contentRect.adjust(nFrameWidth, nFrameWidth, -nFrameWidth, -nFrameWidth);
                 }
                 retVal = true;
diff --git a/vcl/unx/kde4/KDESalInstance.cxx b/vcl/unx/kde4/KDESalInstance.cxx
index f8bf400..dfe02cd 100644
--- a/vcl/unx/kde4/KDESalInstance.cxx
+++ b/vcl/unx/kde4/KDESalInstance.cxx
@@ -53,11 +53,6 @@ uno::Reference< ui::dialogs::XFilePicker2 > KDESalInstance::createFilePicker(
         return X11SalInstance::createFilePicker( xMSF );
 }
 
-int KDESalInstance::getFrameWidth()
-{
-    return static_cast<KDEXLib*>( mpXLib )->getFrameWidth();
-}
-
 SalX11Display* KDESalInstance::CreateDisplay() const
 {
     return new SalKDEDisplay( QX11Info::display() );
diff --git a/vcl/unx/kde4/KDESalInstance.hxx b/vcl/unx/kde4/KDESalInstance.hxx
index 2220816..9807b17 100644
--- a/vcl/unx/kde4/KDESalInstance.hxx
+++ b/vcl/unx/kde4/KDESalInstance.hxx
@@ -39,7 +39,6 @@ class KDESalInstance : public X11SalInstance
         virtual css::uno::Reference< css::ui::dialogs::XFilePicker2 >
             createFilePicker( const css::uno::Reference<
                                   css::uno::XComponentContext >& ) override;
-        int getFrameWidth();
 };
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/kde4/KDEXLib.cxx b/vcl/unx/kde4/KDEXLib.cxx
index cdf1489..06340be 100644
--- a/vcl/unx/kde4/KDEXLib.cxx
+++ b/vcl/unx/kde4/KDEXLib.cxx
@@ -50,7 +50,7 @@
 KDEXLib::KDEXLib() :
     SalXLib(),  m_bStartupDone(false),
     m_pFreeCmdLineArgs(nullptr), m_pAppCmdLineArgs(nullptr), m_nFakeCmdLineArgs( 0 ),
-    m_frameWidth( -1 ), m_isGlibEventLoopType(false),
+    m_isGlibEventLoopType(false),
     m_allowKdeDialogs(false), m_blockIdleTimeout(false)
 {
     // the timers created here means they belong to the main thread.
@@ -76,9 +76,6 @@ KDEXLib::KDEXLib() :
     connect( this, SIGNAL( createFilePickerSignal( const css::uno::Reference< css::uno::XComponentContext >&) ),
              this, SLOT( createFilePicker( const css::uno::Reference< css::uno::XComponentContext >&) ),
              Qt::BlockingQueuedConnection );
-
-    connect( this, SIGNAL( getFrameWidthSignal() ),
-             this, SLOT( getFrameWidth() ), Qt::BlockingQueuedConnection );
 }
 
 KDEXLib::~KDEXLib()
@@ -423,23 +420,6 @@ uno::Reference< ui::dialogs::XFilePicker2 > KDEXLib::createFilePicker(
 #endif
 }
 
-int KDEXLib::getFrameWidth()
-{
-    if( m_frameWidth >= 0 )
-        return m_frameWidth;
-    if( qApp->thread() != QThread::currentThread()) {
-        SalYieldMutexReleaser aReleaser;
-        return Q_EMIT getFrameWidthSignal();
-    }
-
-    // fill in a default
-    QFrame aFrame( nullptr );
-    aFrame.setFrameStyle( QFrame::StyledPanel | QFrame::Sunken );
-    aFrame.ensurePolished();
-    m_frameWidth = aFrame.frameWidth();
-    return m_frameWidth;
-}
-
 #include "KDEXLib.moc"
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/kde4/KDEXLib.hxx b/vcl/unx/kde4/KDEXLib.hxx
index 3383ce8..4b482cc 100644
--- a/vcl/unx/kde4/KDEXLib.hxx
+++ b/vcl/unx/kde4/KDEXLib.hxx
@@ -53,7 +53,6 @@ class KDEXLib : public QObject, public SalXLib
         QHash< int, SocketData > socketData; // key is fd
         QTimer timeoutTimer;
         QTimer userEventTimer;
-        int m_frameWidth;
         bool m_isGlibEventLoopType;
         bool m_allowKdeDialogs;
         bool m_blockIdleTimeout;
@@ -74,7 +73,6 @@ class KDEXLib : public QObject, public SalXLib
         void processYieldSignal( bool bWait, bool bHandleAllCurrentEvents );
         css::uno::Reference< css::ui::dialogs::XFilePicker2 >
             createFilePickerSignal( const css::uno::Reference< css::uno::XComponentContext >& );
-        int getFrameWidthSignal();
 
     public:
         KDEXLib();
@@ -95,7 +93,6 @@ class KDEXLib : public QObject, public SalXLib
     public Q_SLOTS:
         css::uno::Reference< css::ui::dialogs::XFilePicker2 >
             createFilePicker( const css::uno::Reference< css::uno::XComponentContext >& );
-        int getFrameWidth();
 };
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit ff62a5ded0aed14c92739a83533be2629f66d4b2
Author: Jan-Marek Glogowski <glogow at fbihome.de>
Date:   Sun Oct 9 10:50:44 2016 +0000

    Update duplicated / outdated NWS documentation
    
    Removes the old, copied NWS documentation blocks from all native
    implementations and update the parent SalGraphics documentation.
    
    Change-Id: I0eff8ea0987c5c841e1b023340b1c3787c09e2ca

diff --git a/vcl/inc/salgdi.hxx b/vcl/inc/salgdi.hxx
index 9ca2433..90f75b1b 100644
--- a/vcl/inc/salgdi.hxx
+++ b/vcl/inc/salgdi.hxx
@@ -337,10 +337,22 @@ public:
 
     //  native widget rendering functions
 
-    // Query the platform layer for control support
-    virtual bool                IsNativeControlSupported( ControlType nType, ControlPart nPart );
+    /**
+     * Query the platform layer for native control support.
+     *
+     * @param [in] eType The widget type.
+     * @param [in] ePart The part of the widget.
+     * @return true if the platform supports native drawing of the widget type defined by part.
+     */
+    virtual bool                IsNativeControlSupported(
+                                    ControlType eType, ControlPart ePart );
+
 
-    // Query the native control to determine if it was acted upon
+    /**
+     * Query the native control to determine if it was acted upon
+     *
+     * @see hitTestNativeControl
+     */
     bool                        HitTestNativeScrollbar(
                                     ControlPart nPart,
                                     const Rectangle& rControlRegion,
@@ -348,7 +360,11 @@ public:
                                     bool& rIsInside,
                                     const OutputDevice *pOutDev );
 
-    // Request rendering of a particular control and/or part
+    /**
+     * Request rendering of a particular control and/or part
+     *
+     * @see drawNativeControl
+     */
     bool                        DrawNativeControl(
                                     ControlType nType,
                                     ControlPart nPart,
@@ -358,7 +374,11 @@ public:
                                     const OUString& aCaption,
                                     const OutputDevice *pOutDev );
 
-    // Query the native control's actual drawing region (including adornment)
+    /**
+     * Query the native control's actual drawing region (including adornment)
+     *
+     * @see getNativeControlRegion
+     */
     bool                        GetNativeControlRegion(
                                     ControlType nType,
                                     ControlPart nPart,
@@ -462,7 +482,6 @@ protected:
                                     const SalPoint* const* pPtAry,
                                     const PolyFlags* const* pFlgAry ) = 0;
 
-
     virtual bool                drawGradient(
                                     const tools::PolyPolygon& rPolyPoly,
                                     const Gradient& rGradient ) = 0;
@@ -508,24 +527,66 @@ protected:
                                     void* pPtr,
                                     sal_uLong nSize ) = 0;
 
-    // native widget rendering methods that require mirroring
+    /**
+     * Query if a position is inside the native widget part.
+     *
+     * Mainly used for scrollbars.
+     *
+     * @param [in] eType The widget type.
+     * @param [in] ePart The part of the widget.
+     * @param [in] rBoundingControlRegion The bounding Rectangle of
+                   the complete control in VCL frame coordinates.
+     * @param [in] aPos The position to check the hit.
+     * @param [out] rIsInside true, if \a aPos was inside the native widget.
+     * @return true, if the query was successful.
+     */
     virtual bool                hitTestNativeControl(
-                                    ControlType nType, ControlPart nPart,
-                                    const Rectangle& rControlRegion,
-                                    const Point& aPos,
-                                    bool& rIsInside );
-
+                                    ControlType eType, ControlPart ePart,
+                                    const Rectangle& rBoundingControlRegion,
+                                    const Point& aPos, bool& rIsInside );
+
+    /**
+     * Draw the requested control.
+     *
+     * @param [in] eType The widget type.
+     * @param [in] ePart The part of the widget.
+     * @param [in] rBoundingControlRegion The bounding rectangle of
+     *             the complete control in VCL frame coordinates.
+     * @param [in] eState The general state of the control (enabled, focused, etc.).
+     * @param [in] aValue Addition control specific information.
+     * @param [in] aCaption  A caption or title string (like button text etc.).
+     * @return true, if the control could be drawn.
+     */
     virtual bool                drawNativeControl(
-                                    ControlType nType, ControlPart nPart,
-                                    const Rectangle& rControlRegion,
-                                    ControlState nState,
+                                    ControlType eType, ControlPart ePart,
+                                    const Rectangle& rBoundingControlRegion,
+                                    ControlState eState,
                                     const ImplControlValue& aValue,
                                     const OUString& aCaption );
 
+    /**
+     * Get the native control regions for the control part.
+     *
+     * If the return value is true, \a rNativeBoundingRegion contains
+     * the true bounding region covered by the control including any
+     * adornment, while \a rNativeContentRegion contains the area
+     * within the control that can be safely drawn into without drawing over
+     * the borders of the control.
+     *
+     * @param [in] eType Type of the widget.
+     * @param [in] ePart Specification of the widget's part if it consists of more than one.
+     * @param [in] rBoundingControlRegion The bounding region of the control in VCL frame coordinates.
+     * @param [in] eState The general state of the control (enabled, focused, etc.).
+     * @param [in] aValue Addition control specific information.
+     * @param [in] aCaption A caption or title string (like button text etc.).
+     * @param [out] rNativeBoundingRegion The region covered by the control including any adornment.
+     * @param [out] rNativeContentRegion The region within the control that can be safely drawn into.
+     * @return true, if the regions are filled.
+     */
     virtual bool                getNativeControlRegion(
-                                    ControlType nType, ControlPart nPart,
-                                    const Rectangle& rControlRegion,
-                                    ControlState nState,
+                                    ControlType eType, ControlPart ePart,
+                                    const Rectangle& rBoundingControlRegion,
+                                    ControlState eState,
                                     const ImplControlValue& aValue,
                                     const OUString& aCaption,
                                     Rectangle &rNativeBoundingRegion,
@@ -569,19 +630,14 @@ protected:
                                     const SalBitmap* pAlphaBitmap) = 0;
 
     /** Render solid rectangle with given transparency
-
-      @param nX             Top left coordinate of rectangle
-
-      @param nY             Bottom right coordinate of rectangle
-
-      @param nWidth         Width of rectangle
-
-      @param nHeight        Height of rectangle
-
-      @param nTransparency  Transparency value (0-255) to use. 0 blits and opaque, 255 a
-                            fully transparent rectangle
-
-      @returns true if successfully drawn, false if not able to draw rectangle
+     *
+     * @param nX             Top left coordinate of rectangle
+     * @param nY             Bottom right coordinate of rectangle
+     * @param nWidth         Width of rectangle
+     * @param nHeight        Height of rectangle
+     * @param nTransparency  Transparency value (0-255) to use. 0 blits and opaque, 255 a
+     *                       fully transparent rectangle
+     * @returns true if successfully drawn, false if not able to draw rectangle
      */
     virtual bool                drawAlphaRect(
                                     long nX, long nY,
diff --git a/vcl/osx/salnativewidgets.cxx b/vcl/osx/salnativewidgets.cxx
index a9d263f..36e8bf3 100644
--- a/vcl/osx/salnativewidgets.cxx
+++ b/vcl/osx/salnativewidgets.cxx
@@ -157,13 +157,6 @@ static bool AquaGetScrollRect( /* TODO: int nScreen, */  ControlPart nPart,
     return bRetVal;
 }
 
-/*
- * IsNativeControlSupported()
- * --------------------------
- * Returns true if the platform supports native
- * drawing of the control defined by nPart.
- *
- */
 bool AquaSalGraphics::IsNativeControlSupported( ControlType nType, ControlPart nPart )
 {
     bool bOk = false;
@@ -292,13 +285,6 @@ bool AquaSalGraphics::IsNativeControlSupported( ControlType nType, ControlPart n
     return bOk;
 }
 
-/*
- * HitTestNativeScrollbar()
- *
- *  If the return value is true, bIsInside contains information whether
- *  aPos was or was not inside the native widget specified by the
- *  nType/nPart combination.
- */
 bool AquaSalGraphics::hitTestNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
                         const Point& rPos, bool& rIsInside )
 {
@@ -346,15 +332,6 @@ UInt32 AquaSalGraphics::getTrackState( ControlState nState )
     return kThemeTrackActive;
 }
 
-/*
- * DrawNativeControl()
- *
- *  Draws the requested control described by nPart/nState.
- *
- *  rControlRegion: The bounding region of the complete control in VCL frame coordinates.
- *  aValue:     An optional value (tristate/numerical/string)
- *  aCaption:   A caption or title string (like button text etc)
- */
 bool AquaSalGraphics::drawNativeControl(ControlType nType,
                     ControlPart nPart,
                     const Rectangle& rControlRegion,
@@ -1068,19 +1045,6 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType,
     return bOK;
 }
 
-/*
- * GetNativeControlRegion()
- *
- *  If the return value is true, rNativeBoundingRegion
- *  contains the true bounding region covered by the control
- *  including any adornment, while rNativeContentRegion contains the area
- *  within the control that can be safely drawn into without drawing over
- *  the borders of the control.
- *
- *  rControlRegion: The bounding region of the control in VCL frame coordinates.
- *  aValue:     An optional value (tristate/numerical/string)
- *  aCaption:       A caption or title string (like button text etc)
- */
 bool AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion, ControlState /*nState*/,
                                                const ImplControlValue& aValue, const OUString&,
                                                 Rectangle &rNativeBoundingRegion, Rectangle &rNativeContentRegion )
diff --git a/vcl/source/gdi/salnativewidgets-none.cxx b/vcl/source/gdi/salnativewidgets-none.cxx
index 99e8882..afe6c2e 100644
--- a/vcl/source/gdi/salnativewidgets-none.cxx
+++ b/vcl/source/gdi/salnativewidgets-none.cxx
@@ -23,73 +23,28 @@
  *  Placeholder for no native widgets
  ***************************************************************/
 
-/*
- * IsNativeControlSupported()
- *
- *  Returns true if the platform supports native
- *  drawing of the control defined by nPart
- */
 bool SalGraphics::IsNativeControlSupported( ControlType, ControlPart )
 {
     return false;
 }
 
-/*
- * HitTestNativeScrollbar()
- *
- *  If the return value is true, bIsInside contains information whether
- *  aPos was or was not inside the native widget specified by the
- *  nType/nPart combination.
- */
-bool SalGraphics::hitTestNativeControl( ControlType,
-                              ControlPart,
-                              const Rectangle&,
-                              const Point&,
-                              bool& )
+bool SalGraphics::hitTestNativeControl( ControlType, ControlPart,
+                                        const Rectangle&, const Point&, bool& )
 {
     return false;
 }
 
-/*
- * DrawNativeControl()
- *
- *  Draws the requested control described by nPart/nState.
- *
- *  rControlRegion: The bounding region of the complete control in VCL frame coordinates.
- *  aValue:         An optional value (tristate/numerical/string)
- *  aCaption:   A caption or title string (like button text etc)
- */
-bool SalGraphics::drawNativeControl(    ControlType,
-                            ControlPart,
-                            const Rectangle&,
-                            ControlState,
-                            const ImplControlValue&,
-                            const OUString& )
+bool SalGraphics::drawNativeControl( ControlType, ControlPart,
+                                     const Rectangle&, ControlState,
+                                     const ImplControlValue&, const OUString& )
 {
     return false;
 }
 
-/*
- * GetNativeControlRegion()
- *
- *  If the return value is true, rNativeBoundingRegion
- *  contains the true bounding region covered by the control
- *  including any adornment, while rNativeContentRegion contains the area
- *  within the control that can be safely drawn into without drawing over
- *  the borders of the control.
- *
- *  rControlRegion: The bounding region of the control in VCL frame coordinates.
- *  aValue:     An optional value (tristate/numerical/string)
- *  aCaption:       A caption or title string (like button text etc)
- */
-bool SalGraphics::getNativeControlRegion(  ControlType,
-                                ControlPart,
-                                const Rectangle&,
-                                ControlState,
-                                const ImplControlValue&,
-                                const OUString&,
-                                Rectangle &,
-                                Rectangle & )
+bool SalGraphics::getNativeControlRegion( ControlType, ControlPart,
+                                          const Rectangle&, ControlState,
+                                          const ImplControlValue&,
+                                          const OUString&, Rectangle&, Rectangle& )
 {
     return false;
 }
diff --git a/vcl/unx/gtk/salnativewidgets-gtk.cxx b/vcl/unx/gtk/salnativewidgets-gtk.cxx
index a3eea16..8d0c96c 100644
--- a/vcl/unx/gtk/salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk/salnativewidgets-gtk.cxx
@@ -632,12 +632,6 @@ void GtkSalGraphics::copyBits( const SalTwoRect& rPosAry,
     X11SalGraphics::copyBits( rPosAry, pSrcGraphics );
 }
 
-/*
- * IsNativeControlSupported()
- *
- *  Returns true if the platform supports native
- *  drawing of the control defined by nPart
- */
 bool GtkSalGraphics::IsNativeControlSupported( ControlType nType, ControlPart nPart )
 {
     switch(nType)
@@ -741,15 +735,6 @@ bool GtkSalGraphics::IsNativeControlSupported( ControlType nType, ControlPart nP
     return false;
 }
 
-/*
- * HitTestNativeScrollbar()
- *
- *  bIsInside is set to true if aPos is contained within the
- *  given part of the control, whose bounding region is
- *  given by rControlRegion (in VCL frame coordinates).
- *
- *  returns whether bIsInside was really set.
- */
 bool GtkSalGraphics::hitTestNativeControl( ControlType        nType,
                                 ControlPart        nPart,
                                 const Rectangle&        rControlRegion,
@@ -852,15 +837,6 @@ bool GtkSalGraphics::hitTestNativeControl( ControlType        nType,
     }
 }
 
-/*
- * DrawNativeControl()
- *
- *  Draws the requested control described by nPart/nState.
- *
- *  rControlRegion:    The bounding region of the complete control in VCL frame coordinates.
- *  aValue:          An optional value (tristate/numerical/string)
- *  rCaption:      A caption or title string (like button text etc)
- */
 bool GtkSalGraphics::drawNativeControl(ControlType nType, ControlPart nPart,
         const Rectangle& rControlRegion, ControlState nState,
         const ImplControlValue& aValue, const OUString& rCaption)
@@ -1098,19 +1074,6 @@ bool GtkSalGraphics::DoDrawNativeControl(
     return false;
 }
 
-/*
- * GetNativeControlRegion()
- *
- *  If the return value is true, rNativeBoundingRegion
- *  contains the true bounding region covered by the control
- *  including any adornment, while rNativeContentRegion contains the area
- *  within the control that can be safely drawn into without drawing over
- *  the borders of the control.
- *
- *  rControlRegion:    The bounding region of the control in VCL frame coordinates.
- *  aValue:        An optional value (tristate/numerical/string)
- *  rCaption:        A caption or title string (like button text etc)
- */
 bool GtkSalGraphics::getNativeControlRegion(  ControlType nType,
                                 ControlPart nPart,
                                 const Rectangle& rControlRegion,
diff --git a/vcl/unx/kde/salnativewidgets-kde.cxx b/vcl/unx/kde/salnativewidgets-kde.cxx
index de55f1b..dc3cd61 100644
--- a/vcl/unx/kde/salnativewidgets-kde.cxx
+++ b/vcl/unx/kde/salnativewidgets-kde.cxx
@@ -1254,17 +1254,6 @@ class KDESalGraphics : public X11SalGraphics
                                          Rectangle &rNativeBoundingRegion, Rectangle &rNativeContentRegion ) override;
 };
 
-/** What widgets can be drawn the native way.
-
-    @param nType
-    Type of the widget.
-
-    @param nPart
-    Specification of the widget's part if it consists of more than one.
-
-    @return true if the platform supports native drawing of the widget nType
-    defined by nPart.
-*/
 bool KDESalGraphics::IsNativeControlSupported( ControlType nType, ControlPart nPart )
 {
     return
@@ -1292,12 +1281,6 @@ bool KDESalGraphics::IsNativeControlSupported( ControlType nType, ControlPart nP
         ;
 }
 
-/** Test whether the position is in the native widget.
-
-    If the return value is true, bIsInside contains information whether
-    aPos was or was not inside the native widget specified by the
-    nType/nPart combination.
-*/
 bool KDESalGraphics::hitTestNativeControl( ControlType nType, ControlPart nPart,
                                            const Rectangle& rControlRegion, const Point& rPos,
                                            bool& rIsInside )
@@ -1393,17 +1376,6 @@ bool KDESalGraphics::hitTestNativeControl( ControlType nType, ControlPart nPart,
     return false;
 }
 
-/** Draw the requested control described by nPart/nState.
-
-    @param rControlRegion
-    The bounding region of the complete control in VCL frame coordinates.
-
-    @param aValue
-    An optional value (tristate/numerical/string).
-
-    @param aCaption
-    A caption or title string (like button text etc.)
-*/
 bool KDESalGraphics::drawNativeControl( ControlType nType, ControlPart nPart,
                                         const Rectangle& rControlRegion, ControlState nState,
                                         const ImplControlValue& aValue,
@@ -1511,23 +1483,6 @@ bool KDESalGraphics::drawNativeControl( ControlType nType, ControlPart nPart,
     return bReturn;
 }
 
-/** Check if the bounding regions match.
-
-    If the return value is true, rNativeBoundingRegion
-    contains the true bounding region covered by the control
-    including any adornment, while rNativeContentRegion contains the area
-    within the control that can be safely drawn into without drawing over
-    the borders of the control.
-
-    @param rControlRegion
-    The bounding region of the control in VCL frame coordinates.
-
-    @param aValue
-    An optional value (tristate/numerical/string)
-
-    @param aCaption
-    A caption or title string (like button text etc.)
-*/
 bool KDESalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPart,
                                              const Rectangle& rControlRegion, ControlState nState,
                                              const ImplControlValue&,
diff --git a/vcl/unx/kde4/KDESalGraphics.hxx b/vcl/unx/kde4/KDESalGraphics.hxx
index 38dd169..501fbe3 100644
--- a/vcl/unx/kde4/KDESalGraphics.hxx
+++ b/vcl/unx/kde4/KDESalGraphics.hxx
@@ -27,67 +27,27 @@
 
 #include <QtGui/QImage>
 
-/** handles graphics drawings requests and performs the needed drawing operations */
+/**
+ * Handles native graphics requests and performs the needed drawing operations.
+ */
 class KDESalGraphics : public X11SalGraphics
 {
-    std::unique_ptr<QImage> m_image;
-    QRect lastPopupRect;
-
-    public:
-        /**
-            What widgets can be drawn the native way.
-            @param type Type of the widget.
-            @param part Specification of the widget's part if it consists of more than one.
-            @return true if the platform supports native drawing of the widget type defined by part.
-        */
-        virtual bool IsNativeControlSupported( ControlType type, ControlPart part ) override;
-
-        /** Test whether the position is in the native widget.
-            If the return value is TRUE, bIsInside contains information whether
-            aPos was or was not inside the native widget specified by the
-            type/part combination.
-        */
-        virtual bool hitTestNativeControl( ControlType type, ControlPart part,
-                                        const Rectangle& rControlRegion, const Point& aPos,
-                                        bool& rIsInside ) override;
-        /** Draw the requested control described by part/nControlState.
-
-            @param rControlRegion
-            The bounding Rectangle of the complete control in VCL frame coordinates.
+public:
+    virtual bool IsNativeControlSupported( ControlType, ControlPart ) override;
 
-            @param aValue
-            An optional value (tristate/numerical/string).
+    virtual bool hitTestNativeControl( ControlType, ControlPart,
+                                       const Rectangle&, const Point&, bool& ) override;
 
-            @param aCaption
-            A caption or title string (like button text etc.)
-        */
-        virtual bool drawNativeControl( ControlType type, ControlPart part,
-                                        const Rectangle& rControlRegion, ControlState nControlState,
-                                        const ImplControlValue& aValue,
-                                        const OUString& aCaption ) override;
+    virtual bool drawNativeControl( ControlType, ControlPart, const Rectangle&,
+                                    ControlState, const ImplControlValue&, const OUString& ) override;
 
-        /** Check if the bounding regions match.
+    virtual bool getNativeControlRegion( ControlType, ControlPart, const Rectangle&,
+                                         ControlState, const ImplControlValue&,
+                                         const OUString&, Rectangle&, Rectangle& ) override;
 
-            If the return value is TRUE, rNativeBoundingRegion
-            contains the true bounding region covered by the control
-            including any adornment, while rNativeContentRegion contains the area
-            within the control that can be safely drawn into without drawing over
-            the borders of the control.
-
-            @param rControlRegion
-            The bounding region of the control in VCL frame coordinates.
-
-            @param aValue
-            An optional value (tristate/numerical/string)
-
-            @param aCaption
-            A caption or title string (like button text etc.)
-        */
-        virtual bool getNativeControlRegion( ControlType type, ControlPart part,
-                                            const Rectangle& rControlRegion, ControlState nControlState,
-                                            const ImplControlValue& aValue,
-                                            const OUString& aCaption,
-                                            Rectangle &rNativeBoundingRegion, Rectangle &rNativeContentRegion ) override;
+private:
+    std::unique_ptr<QImage> m_image;
+    QRect lastPopupRect;
 };
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/win/gdi/salnativewidgets-luna.cxx b/vcl/win/gdi/salnativewidgets-luna.cxx
index 23fa61a..07586b4 100644
--- a/vcl/win/gdi/salnativewidgets-luna.cxx
+++ b/vcl/win/gdi/salnativewidgets-luna.cxx
@@ -226,12 +226,6 @@ static HTHEME getThemeHandle( HWND hWnd, LPCWSTR name )
     return hTheme;
 }
 
-/*
- * IsNativeControlSupported()
- *
- *  Returns TRUE if the platform supports native
- *  drawing of the control defined by nPart
- */
 bool WinSalGraphics::IsNativeControlSupported( ControlType nType, ControlPart nPart )
 {
     HTHEME hTheme = nullptr;
@@ -339,13 +333,6 @@ bool WinSalGraphics::IsNativeControlSupported( ControlType nType, ControlPart nP
     return (hTheme != nullptr);
 }
 
-/*
- * HitTestNativeScrollbar()
- *
- *  If the return value is TRUE, bIsInside contains information whether
- *  aPos was or was not inside the native widget specified by the
- *  nType/nPart combination.
- */
 bool WinSalGraphics::hitTestNativeControl( ControlType,
                               ControlPart,
                               const Rectangle&,
@@ -1147,15 +1134,6 @@ bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc,
     return false;
 }
 
-/*
- * DrawNativeControl()
- *
- *  Draws the requested control described by nPart/nState.
- *
- *  rControlRegion: The bounding region of the complete control in VCL frame coordinates.
- *  aValue:         An optional value (tristate/numerical/string)
- *  aCaption:   A caption or title string (like button text etc)
- */
 bool WinSalGraphics::drawNativeControl( ControlType nType,
                                         ControlPart nPart,
                                         const Rectangle& rControlRegion,
@@ -1316,19 +1294,6 @@ bool WinSalGraphics::drawNativeControl( ControlType nType,
     return bOk;
 }
 
-/*
- * GetNativeControlRegion()
- *
- *  If the return value is TRUE, rNativeBoundingRegion
- *  contains the true bounding region covered by the control
- *  including any adornment, while rNativeContentRegion contains the area
- *  within the control that can be safely drawn into without drawing over
- *  the borders of the control.
- *
- *  rControlRegion: The bounding region of the control in VCL frame coordinates.
- *  aValue:     An optional value (tristate/numerical/string)
- *  aCaption:       A caption or title string (like button text etc)
- */
 bool WinSalGraphics::getNativeControlRegion(  ControlType nType,
                                 ControlPart nPart,
                                 const Rectangle& rControlRegion,
commit 52074313bb924591b2409b0d12a16562f76e0b75
Author: Jan-Marek Glogowski <glogow at fbihome.de>
Date:   Sat Oct 8 14:51:32 2016 +0000

    Fix metric spinbox tool item size
    
    Instead of guessing, use the CalcMinimumSize(), which also knows
    about theming.
    
    Change-Id: I747571b48c81166d11d03f99ab564b1a25165ef3

diff --git a/svx/source/tbxctrls/itemwin.cxx b/svx/source/tbxctrls/itemwin.cxx
index de7c5bb..72c4169 100644
--- a/svx/source/tbxctrls/itemwin.cxx
+++ b/svx/source/tbxctrls/itemwin.cxx
@@ -248,9 +248,7 @@ SvxMetricField::SvxMetricField(
     , ePoolUnit(MapUnit::MapCM)
     , mxFrame(rFrame)
 {
-    Size aSize(GetTextWidth( "99,99mm" ),GetTextHeight());
-    aSize.Width() += 20;
-    aSize.Height() += 6;
+    Size aSize( CalcMinimumSize() );
     SetSizePixel( aSize );
     aLogicalSize = PixelToLogic(aSize, MapUnit::MapAppFont);
     SetUnit( FUNIT_MM );
commit 6f0eb3db9413d75f5f52a4e018f12e4848cd7ccc
Author: Jan-Marek Glogowski <glogow at fbihome.de>
Date:   Sat Oct 8 07:03:28 2016 +0200

    tdf#78924 KDE4 drop special Combobox code
    
    At least not needed with breeze KDE4 theme.
    
    Change-Id: I71a05c395d04a6f19c3bcd681450318831b0c29f

diff --git a/vcl/unx/kde4/KDESalGraphics.cxx b/vcl/unx/kde4/KDESalGraphics.cxx
index 512d2f2..ce26a7e 100644
--- a/vcl/unx/kde4/KDESalGraphics.cxx
+++ b/vcl/unx/kde4/KDESalGraphics.cxx
@@ -757,45 +757,20 @@ bool KDESalGraphics::getNativeControlRegion( ControlType type, ControlPart part,
                     if( aMinSize.height() > contentRect.height() )
                         contentRect.adjust( 0, 0, 0, aMinSize.height() - contentRect.height() );
                     boundingRect = contentRect;
-                    // FIXME: why this difference between comboboxes and listboxes ?
-                    // because a combobox has a sub edit and that is positioned
-                    // inside the outer bordered control ?
-                    if( type == ControlType::Combobox ) {
-                        int size = QApplication::style()->pixelMetric(QStyle::PM_ComboBoxFrameWidth) - 2;
-                        contentRect.adjust(-size,-size,size,size);
-                    }
-                    else {
-                        int hmargin = QApplication::style()->pixelMetric(
-                                QStyle::PM_FocusFrameHMargin, &styleOption);
-                        int vmargin = QApplication::style()->pixelMetric(
-                                QStyle::PM_FocusFrameVMargin, &styleOption);
-                        boundingRect.translate( -hmargin, -vmargin );
-                        boundingRect.adjust( -hmargin, -vmargin, 2 * hmargin, 2 * vmargin );
-                    }
                     retVal = true;
                     break;
                 }
                 case ControlPart::ButtonDown:
                     contentRect = QApplication::style()->subControlRect(
                         QStyle::CC_ComboBox, &cbo, QStyle::SC_ComboBoxArrow );
-
                     contentRect.translate( boundingRect.left(), boundingRect.top() );
-
                     retVal = true;
                     break;
                 case ControlPart::SubEdit:
                 {
                     contentRect = QApplication::style()->subControlRect(
                         QStyle::CC_ComboBox, &cbo, QStyle::SC_ComboBoxEditField );
-
-                    int hmargin = QApplication::style()->pixelMetric(
-                            QStyle::PM_FocusFrameHMargin, &styleOption);
-                    int vmargin = QApplication::style()->pixelMetric(
-                            QStyle::PM_FocusFrameVMargin, &styleOption);
-
-                    contentRect.translate( boundingRect.left() + hmargin, boundingRect.top() + vmargin );
-                    contentRect.adjust( 0, 0, -2 * hmargin, -2 * vmargin );
-
+                    contentRect.translate( boundingRect.left(), boundingRect.top() );
                     retVal = true;
                     break;
                 }
commit 4d0f32cd64c5b98bf634bea0d5b529c448e37fc8
Author: Jan-Marek Glogowski <glogow at fbihome.de>
Date:   Sat Oct 8 07:01:13 2016 +0200

    KDE4 add frame to Spinbox and enable buttons...
    
    ... and don't claim to support all parts per default.
    
    Change-Id: I7a8e0774b4573bf755737bc1adebe19a774736c9

diff --git a/vcl/unx/kde4/KDESalGraphics.cxx b/vcl/unx/kde4/KDESalGraphics.cxx
index 51e5193..512d2f2 100644
--- a/vcl/unx/kde4/KDESalGraphics.cxx
+++ b/vcl/unx/kde4/KDESalGraphics.cxx
@@ -504,6 +504,7 @@ bool KDESalGraphics::drawNativeControl( ControlType type, ControlPart part,
     else if (type == ControlType::Spinbox)
     {
         QStyleOptionSpinBox option;
+        option.frame = true;
 
         // determine active control
         if( value.getType() == ControlType::SpinButtons )
@@ -513,6 +514,14 @@ bool KDESalGraphics::drawNativeControl( ControlType type, ControlPart part,
                 option.activeSubControls |= QStyle::SC_SpinBoxUp;
             if( (pSpinVal->mnLowerState & ControlState::PRESSED) )
                 option.activeSubControls |= QStyle::SC_SpinBoxDown;
+            if( (pSpinVal->mnUpperState & ControlState::ENABLED) )
+                option.stepEnabled |= QAbstractSpinBox::StepUpEnabled;
+            if( (pSpinVal->mnLowerState & ControlState::ENABLED) )
+                option.stepEnabled |= QAbstractSpinBox::StepDownEnabled;
+            if( (pSpinVal->mnUpperState & ControlState::ROLLOVER) )
+                option.state = QStyle::State_MouseOver;
+            if( (pSpinVal->mnLowerState & ControlState::ROLLOVER) )
+                option.state = QStyle::State_MouseOver;
         }
 
         draw( QStyle::CC_SpinBox, &option, m_image.get(),
@@ -801,12 +810,25 @@ bool KDESalGraphics::getNativeControlRegion( ControlType type, ControlPart part,
         case ControlType::Spinbox:
         {
             QStyleOptionSpinBox sbo;
+            sbo.frame = true;
 
             sbo.rect = QRect(0, 0, contentRect.width(), contentRect.height());
             sbo.state = vclStateValue2StateFlag(controlState, val);
 
             switch ( part )
             {
+                case ControlPart::Entire:
+                {
+                    int nHeight = QApplication::fontMetrics().height();
+                    QSize aContentSize( contentRect.width(), nHeight );
+                    QSize aMinSize = QApplication::style()->
+                        sizeFromContents( QStyle::CT_SpinBox, &sbo, aContentSize );
+                    if( aMinSize.height() > contentRect.height() )
+                        contentRect.adjust( 0, 0, 0, aMinSize.height() - contentRect.height() );
+                    boundingRect = contentRect;
+                    retVal = true;
+                    break;
+                }
                 case ControlPart::ButtonUp:
                     contentRect = QApplication::style()->subControlRect(
                         QStyle::CC_SpinBox, &sbo, QStyle::SC_SpinBoxUp );
@@ -830,7 +852,7 @@ bool KDESalGraphics::getNativeControlRegion( ControlType type, ControlPart part,
                     contentRect.translate( boundingRect.left(), boundingRect.top() );
                     break;
                 default:
-                    retVal = true;
+                    break;
             }
             break;
         }
commit 4dc0025634457e214a1e80c31f2c8819c7ba8852
Author: Jan-Marek Glogowski <glogow at fbihome.de>
Date:   Sat Oct 8 06:56:07 2016 +0200

    KDE4 fix edit box borders
    
    When recalculating the native window frame borders, calculate
    using already existing window borders. Otherwise the KDE edit
    box results in an unlimited recursion for increasing the
    bounding rects, if the control doesn't fit.
    
    Change-Id: I45e51e4796b06097ca537c656f004133dfacd033

diff --git a/vcl/source/window/brdwin.cxx b/vcl/source/window/brdwin.cxx
index b62eb6a..f66664a 100644
--- a/vcl/source/window/brdwin.cxx
+++ b/vcl/source/window/brdwin.cxx
@@ -530,9 +530,11 @@ void ImplSmallBorderWindowView::Init( OutputDevice* pDev, long nWidth, long nHei
             if( mbNWFBorder )
             {
                 ImplControlValue aControlValue;
-                Rectangle aCtrlRegion( (const Point&)Point(), Size( mnWidth < 10 ? 10 : mnWidth, mnHeight < 10 ? 10 : mnHeight ) );
-                Rectangle aBounds( aCtrlRegion );
-                Rectangle aContent( aCtrlRegion );
+                Size aMinSize( mnWidth - mnLeftBorder - mnRightBorder, mnHeight - mnTopBorder - mnBottomBorder );
+                if( aMinSize.Width() < 10 ) aMinSize.setWidth( 10 );
+                if( aMinSize.Height() < 10 ) aMinSize.setHeight( 10 );
+                Rectangle aCtrlRegion( Point(mnLeftBorder, mnTopBorder), aMinSize );
+                Rectangle aBounds, aContent;
                 if( pWin->GetNativeControlRegion( aCtrlType, ControlPart::Entire, aCtrlRegion,
                                                   ControlState::ENABLED, aControlValue, OUString(),
                                                   aBounds, aContent ) )
diff --git a/vcl/unx/kde4/KDEData.cxx b/vcl/unx/kde4/KDEData.cxx
index 1caf6e8..d9e9545 100644
--- a/vcl/unx/kde4/KDEData.cxx
+++ b/vcl/unx/kde4/KDEData.cxx
@@ -49,6 +49,8 @@ void KDEData::initNWF()
     // Qt theme engines may support a rollover menubar
     pSVData->maNWFData.mbRolloverMenubar = true;
 
+    pSVData->maNWFData.mbNoFocusRects = true;
+
     // Styled menus need additional space
     QStyle *style = QApplication::style();
     pSVData->maNWFData.mnMenuFormatBorderX =
diff --git a/vcl/unx/kde4/KDESalGraphics.cxx b/vcl/unx/kde4/KDESalGraphics.cxx
index bb46862..51e5193 100644
--- a/vcl/unx/kde4/KDESalGraphics.cxx
+++ b/vcl/unx/kde4/KDESalGraphics.cxx
@@ -87,6 +87,7 @@ bool KDESalGraphics::IsNativeControlSupported( ControlType type, ControlPart par
         case ControlType::Menubar:
         case ControlType::MenuPopup:
         case ControlType::Editbox:
+        case ControlType::MultilineEditbox:
         case ControlType::Combobox:
         case ControlType::Toolbar:
         case ControlType::Frame:
@@ -406,20 +407,15 @@ bool KDESalGraphics::drawNativeControl( ControlType type, ControlPart part,
         draw( QStyle::PE_IndicatorToolBarHandle, &option, m_image.get(),
               vclStateValue2StateFlag(nControlState, value), rect );
     }
-    else if (type == ControlType::Editbox)
+    else if (type == ControlType::Editbox || type == ControlType::MultilineEditbox)
     {
-        QStyleOptionFrameV2 option;
-        draw( QStyle::PE_PanelLineEdit, &option, m_image.get(),
-              vclStateValue2StateFlag(nControlState, value), m_image->rect().adjusted( 2, 2, -2, -2 ));
-
-        draw( QStyle::PE_FrameLineEdit, &option, m_image.get(),
-              vclStateValue2StateFlag(nControlState, value));
+        lcl_drawFrame( QStyle::PE_FrameLineEdit, m_image.get(),
+                       vclStateValue2StateFlag(nControlState, value));
     }
     else if (type == ControlType::Combobox)
     {
         QStyleOptionComboBox option;
         option.editable = true;
-
         draw( QStyle::CC_ComboBox, &option, m_image.get(),
               vclStateValue2StateFlag(nControlState, value) );
     }
@@ -678,32 +674,33 @@ bool KDESalGraphics::getNativeControlRegion( ControlType type, ControlPart part,
                 {
                     int size = QApplication::style()->pixelMetric(
                         QStyle::PM_ButtonDefaultIndicator, &styleOption );
-
                     boundingRect.adjust( -size, -size, size, size );
-
                     retVal = true;
                 }
             }
             break;
         case ControlType::Editbox:
+        case ControlType::MultilineEditbox:
         {
-            int nFontHeight    = QApplication::fontMetrics().height();
-            //int nFrameSize     = QApplication::style()->pixelMetric(QStyle::PM_DefaultFrameWidth);
-            int nLayoutTop     = QApplication::style()->pixelMetric(QStyle::PM_LayoutTopMargin);
-            int nLayoutBottom  = QApplication::style()->pixelMetric(QStyle::PM_LayoutBottomMargin);
-            int nLayoutLeft    = QApplication::style()->pixelMetric(QStyle::PM_LayoutLeftMargin);
-            int nLayoutRight   = QApplication::style()->pixelMetric(QStyle::PM_LayoutRightMargin);
-
-            int nMinHeight = (nFontHeight + nLayoutTop + nLayoutBottom);
-            if( boundingRect.height() < nMinHeight )
+            QStyleOptionFrameV3 fo;
+            fo.frameShape = QFrame::StyledPanel;
+            fo.state = QStyle::State_Sunken;
+            fo.lineWidth = QApplication::style()->pixelMetric(QStyle::PM_DefaultFrameWidth);
+            QSize aMinSize = QApplication::style()->
+                sizeFromContents( QStyle::CT_LineEdit, &fo, contentRect.size() );
+            if( aMinSize.height() > boundingRect.height() )
             {
-                int delta = nMinHeight - boundingRect.height();
-                boundingRect.adjust( 0, 0, 0, delta );
+                int nHeight = (aMinSize.height() - boundingRect.height()) / 2;
+                assert( 0 == (aMinSize.height() - boundingRect.height()) % 2 );
+                boundingRect.adjust( 0, -nHeight, 0, nHeight );
+            }
+            if( aMinSize.width() > boundingRect.width() )
+            {
+                int nWidth = (aMinSize.width() - boundingRect.width()) / 2;
+                assert( 0 == (aMinSize.width() - boundingRect.width()) % 2 );
+                boundingRect.adjust( -nWidth, 0, nWidth, 0 );
             }
-            contentRect = boundingRect;
-            contentRect.adjust( -nLayoutLeft+1, -nLayoutTop+1, nLayoutRight-1, nLayoutBottom-1 );
             retVal = true;
-
             break;
         }
         case ControlType::Checkbox:
commit a7c11a868d6ae51da839496eb17e66e6336a7734
Author: Jan-Marek Glogowski <glogow at fbihome.de>
Date:   Fri Oct 7 17:49:18 2016 +0000

    KDE4 set shadow colors
    
    These are used to paint Writers ruler text and marks.
    Makes both readable with disabled and inactive text colors.
    
    Change-Id: I39766d623164230a7379623c16e0463cbaaf0af8

diff --git a/vcl/unx/kde4/KDESalFrame.cxx b/vcl/unx/kde4/KDESalFrame.cxx
index 06a0abd..43dcb35 100644
--- a/vcl/unx/kde4/KDESalFrame.cxx
+++ b/vcl/unx/kde4/KDESalFrame.cxx
@@ -334,6 +334,10 @@ void KDESalFrame::UpdateSettings( AllSettings& rSettings )
     style.SetScrollBarSize( QApplication::style()->pixelMetric( QStyle::PM_ScrollBarExtent ) );
     style.SetMinThumbSize( QApplication::style()->pixelMetric( QStyle::PM_ScrollBarSliderMin ));
 
+    // These colors are used for the ruler text and marks
+    style.SetShadowColor(toColor(pal.color(QPalette::Disabled, QPalette::WindowText)));
+    style.SetDarkShadowColor(toColor(pal.color(QPalette::Inactive, QPalette::WindowText)));
+
     rSettings.SetStyleSettings( style );
 }
 
commit 57374f2e41594d6b69fd708552c52afd9f48229b
Author: Jan-Marek Glogowski <glogow at fbihome.de>
Date:   Fri Sep 30 23:19:48 2016 +0200

    Fix variable scope and better code readability
    
    Change-Id: Icce8bc0c1031ad0d1b53fa7389e1a75f16e62972

diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx
index 3dedc78..b1238d2 100644
--- a/vcl/source/window/toolbox.cxx
+++ b/vcl/source/window/toolbox.cxx
@@ -533,12 +533,12 @@ void ToolBox::ImplDrawBackground(vcl::RenderContext& rRenderContext, const Recta
         bool bNativeOk = false;
         if( ImplIsFloatingMode() && rRenderContext.IsNativeControlSupported( ControlType::Toolbar, ControlPart::Entire) )
             bNativeOk = ImplDrawNativeBackground(rRenderContext, aPaintRegion);
-        const StyleSettings rSetting = Application::GetSettings().GetStyleSettings();
         if (!bNativeOk)
         {
+            const StyleSettings rSetting = Application::GetSettings().GetStyleSettings();
+            const bool isHeader = GetAlign() == WindowAlign::Top && !rSetting.GetPersonaHeader().IsEmpty();
             const bool isFooter = GetAlign() == WindowAlign::Bottom && !rSetting.GetPersonaFooter().IsEmpty();
-            if (!IsBackground() ||
-                ((GetAlign() == WindowAlign::Top && !rSetting.GetPersonaHeader().IsEmpty() ) || isFooter))
+            if (!IsBackground() || isHeader || isFooter)
             {
                 if (!IsInPaint())
                     ImplDrawTransparentBackground(rRenderContext, aPaintRegion);
commit a4aee13aa3dde9b694fcbdd4cda5ad373eeac423
Author: Jan-Marek Glogowski <glogow at fbihome.de>
Date:   Fri Sep 30 23:18:30 2016 +0200

    KDE4 implement native drag handlers
    
    Change-Id: I3d6a1696b8278066b005c1983d226cc67381ba95

diff --git a/vcl/unx/kde4/KDESalGraphics.cxx b/vcl/unx/kde4/KDESalGraphics.cxx
index b9f85f8..bb46862 100644
--- a/vcl/unx/kde4/KDESalGraphics.cxx
+++ b/vcl/unx/kde4/KDESalGraphics.cxx
@@ -384,14 +384,24 @@ bool KDESalGraphics::drawNativeControl( ControlType type, ControlPart part,
         draw( QStyle::CE_ToolBar, &option, m_image.get(),
               vclStateValue2StateFlag(nControlState, value) );
     }
-    else if ( (type == ControlType::Toolbar) && (part == ControlPart::ThumbVert) )
+    else if ( (type == ControlType::Toolbar)
+            && (part == ControlPart::ThumbVert || part == ControlPart::ThumbHorz) )
     {   // reduce paint area only to the handle area
-        const int width = QApplication::style()->pixelMetric(QStyle::PM_ToolBarHandleExtent);
-        QRect rect( 0, 0, width, widgetRect.height());
-        localClipRegion = new QRegion(widgetRect.x(), widgetRect.y(), width, widgetRect.height());
-
+        const int handleExtend = QApplication::style()->pixelMetric(QStyle::PM_ToolBarHandleExtent);
+        QRect rect;
         QStyleOption option;
-        option.state = QStyle::State_Horizontal;
+
+        if (part == ControlPart::ThumbVert)
+        {
+            rect = QRect( 0, 0, handleExtend, widgetRect.height());
+            localClipRegion = new QRegion(widgetRect.x(), widgetRect.y(), handleExtend, widgetRect.height());
+            option.state = QStyle::State_Horizontal;
+        }
+        else
+        {
+            rect = QRect( 0, 0, widgetRect.width(), handleExtend);
+            localClipRegion = new QRegion(widgetRect.x(), widgetRect.y(), widgetRect.width(), handleExtend);
+        }
 
         draw( QStyle::PE_IndicatorToolBarHandle, &option, m_image.get(),
               vclStateValue2StateFlag(nControlState, value), rect );
@@ -435,6 +445,7 @@ bool KDESalGraphics::drawNativeControl( ControlType type, ControlPart part,
                       vclStateValue2StateFlag(nControlState, value) );
                 break;
             default:
+                returnVal = false;
                 break;
         }
     }
@@ -901,6 +912,23 @@ bool KDESalGraphics::getNativeControlRegion( ControlType type, ControlPart part,
             }
             break;
         }
+        case ControlType::Toolbar:
+        {
+            const int nWorH = QApplication::style()->pixelMetric(QStyle::PM_ToolBarHandleExtent);
+            if( part == ControlPart::ThumbHorz )
+            {
+                contentRect = QRect(boundingRect.left(), boundingRect.top(), boundingRect.width(), nWorH );
+                boundingRect = contentRect;
+                retVal = true;
+            }
+            else if( part == ControlPart::ThumbVert )
+            {
+                contentRect = QRect(boundingRect.left(), boundingRect.top(), nWorH, boundingRect.height() );
+                boundingRect = contentRect;
+                retVal = true;
+            }
+            break;
+        }
         case ControlType::Scrollbar:
         {
             // core can't handle 3-button scrollbars well, so we fix that in hitTestNativeControl(),
commit 69d78bae65577485db7a5b0347f99b9365cc52f6
Author: Jan-Marek Glogowski <glogow at fbihome.de>
Date:   Fri Sep 30 23:15:26 2016 +0200

    tdf#102477 Drop toolbar popup window background
    
    Just rely on the default window backround.
    
    Change-Id: I8aa7a2b05ac2521b872290d508c0ce5fdaf83bae

diff --git a/vcl/source/window/dockmgr.cxx b/vcl/source/window/dockmgr.cxx
index a508927..65010f3 100644
--- a/vcl/source/window/dockmgr.cxx
+++ b/vcl/source/window/dockmgr.cxx
@@ -576,8 +576,6 @@ void ImplPopupFloatWin::DrawGrip(vcl::RenderContext& rRenderContext)
 
 void ImplPopupFloatWin::Paint(vcl::RenderContext& rRenderContext, const Rectangle&)
 {
-    Rectangle aRect(Point(), GetOutputSizePixel());
-    rRenderContext.DrawWallpaper(aRect, Wallpaper(rRenderContext.GetSettings().GetStyleSettings().GetFaceGradientColor()));
     DrawBorder(rRenderContext);
     if (hasGrip())
         DrawGrip(rRenderContext);
commit 882e5f56f2f43ce26dab4c73a295583487a375c4
Author: Jan-Marek Glogowski <glogow at fbihome.de>
Date:   Fri Sep 30 23:09:05 2016 +0200

    Unify drag handles for toolboxes
    
    The custom shape popup toolbars used their own drawing code for
    the drag handle. This was dropped in favour of the default toolbox
    drag handle code.
    
    This also drops the drag highlighting in favour of a move mouse
    cursor as the drag indicator. The drag handle is currently always
    drawn on the top, like a window title.
    
    Change-Id: I08cbf715f1e240c2eb6d9a61fad2b705f9bd8014

diff --git a/include/vcl/toolbox.hxx b/include/vcl/toolbox.hxx
index f2881b8..3edb3b8 100644
--- a/include/vcl/toolbox.hxx
+++ b/include/vcl/toolbox.hxx
@@ -223,9 +223,14 @@ public:
     SAL_DLLPRIVATE void            ImplDisableFlatButtons();
 
     static SAL_DLLPRIVATE int ImplGetDragWidth( ToolBox* pThis );
+    static SAL_DLLPRIVATE int ImplGetDragWidth( const vcl::RenderContext& rRenderContext,
+                                                bool bHorz );
     static SAL_DLLPRIVATE void ImplUpdateDragArea( ToolBox *pThis );
     static SAL_DLLPRIVATE void ImplCalcBorder( WindowAlign eAlign, long& rLeft, long& rTop,
                                                long& rRight, long& rBottom, const ToolBox *pThis );
+    static SAL_DLLPRIVATE void ImplDrawGrip(vcl::RenderContext& rRenderContext,
+                                            const Rectangle &aDragArea, int nDragWidth,
+                                            WindowAlign eAlign, bool bHorz);
 
     SAL_DLLPRIVATE void ImplDrawGrip(vcl::RenderContext& rRenderContext);
     SAL_DLLPRIVATE void ImplDrawGradientBackground(vcl::RenderContext& rRenderContext, ImplDockingWindowWrapper *pWrapper);
diff --git a/vcl/source/window/dockmgr.cxx b/vcl/source/window/dockmgr.cxx
index 7f32e74..a508927 100644
--- a/vcl/source/window/dockmgr.cxx
+++ b/vcl/source/window/dockmgr.cxx
@@ -424,29 +424,10 @@ Rectangle DockingManager::GetPosSizePixel( const vcl::Window *pWindow )
     return aRect;
 }
 
-// special floating window for popup mode
-// main purpose: provides tear-off area for undocking
-
-// if TEAROFF_DASHED defined a single dashed line is used
-// otherwise multiple smaller lines will be painted
-//#define TEAROFF_DASHED
-
-// size of the drag area
-#ifdef TEAROFF_DASHED
-#define POPUP_DRAGBORDER    2
-#define POPUP_DRAGGRIP      5
-#else
-#define POPUP_DRAGBORDER    3
-#define POPUP_DRAGGRIP      5
-#endif
-#define POPUP_DRAGHEIGHT    (POPUP_DRAGGRIP+POPUP_DRAGBORDER+POPUP_DRAGBORDER)
-#define POPUP_DRAGWIDTH     20
-
 class ImplPopupFloatWin : public FloatingWindow
 {
 private:
     ImplDockingWindowWrapper*   mpDockingWin;
-    bool                        mbHighlight;
     bool                        mbMoving;
     bool                        mbTrackingEnabled;
     Point                       maDelta;
@@ -454,7 +435,8 @@ private:
     void                        ImplSetBorder();
 
 public:
-    ImplPopupFloatWin( vcl::Window* pParent, ImplDockingWindowWrapper* pDockingWin, bool bHasGrip );
+    ImplPopupFloatWin( vcl::Window* pParent, ImplDockingWindowWrapper* pDockingWin,
+                       bool bHasGrip, bool bUsePopupWin );
     virtual ~ImplPopupFloatWin() override;
     virtual void dispose() override;
 
@@ -467,22 +449,23 @@ public:
     virtual void        Resize() override;
 
     Rectangle           GetDragRect() const;
+    Point               GetToolboxPosition() const;
     void                DrawGrip(vcl::RenderContext& rRenderContext);
     void                DrawBorder(vcl::RenderContext& rRenderContext);
 
     bool                hasGrip() const { return mbHasGrip; }
 };
 
-ImplPopupFloatWin::ImplPopupFloatWin( vcl::Window* pParent, ImplDockingWindowWrapper* pDockingWin, bool bHasGrip ) :
-    FloatingWindow( pParent, WB_NOBORDER | WB_SYSTEMWINDOW | WB_NOSHADOW)
+ImplPopupFloatWin::ImplPopupFloatWin( vcl::Window* pParent, ImplDockingWindowWrapper* pDockingWin,
+        bool bHasGrip, bool bUsePopupWin ) :
+    FloatingWindow( pParent, bUsePopupWin ? WB_STDPOPUP : WB_NOBORDER | WB_SYSTEMWINDOW | WB_NOSHADOW)
 {
     mpWindowImpl->mbToolbarFloatingWindow = true;   // indicate window type, required for accessibility
                                                     // which should not see this window as a toplevel window
     mpDockingWin = pDockingWin;
-    mbHighlight = false;
     mbMoving = false;
     mbTrackingEnabled = false;
-    mbHasGrip = bHasGrip;
+    mbHasGrip = !bUsePopupWin && bHasGrip;
 
     ImplSetBorder();
 }
@@ -517,7 +500,7 @@ void ImplPopupFloatWin::ImplSetBorder()
     //  be used to set the proper window size
     mpWindowImpl->mnTopBorder     = 1;
     if( hasGrip() )
-        mpWindowImpl->mnTopBorder += POPUP_DRAGHEIGHT+2;
+        mpWindowImpl->mnTopBorder += 2 + ToolBox::ImplGetDragWidth( *this, false );
     mpWindowImpl->mnBottomBorder  = 1;
     mpWindowImpl->mnLeftBorder    = 1;
     mpWindowImpl->mnRightBorder   = 1;
@@ -533,9 +516,14 @@ Rectangle ImplPopupFloatWin::GetDragRect() const
 {
     if( !hasGrip() )
         return Rectangle();
+    return Rectangle( 1, 1, GetOutputSizePixel().Width() - 1,
+                      2 + ToolBox::ImplGetDragWidth( *this, false ) );
+}
 
-    return Rectangle( 1, GetOutputSizePixel().Height() - 3 - POPUP_DRAGHEIGHT,
-                      GetOutputSizePixel().Width() - 1, GetOutputSizePixel().Height() - 1 );
+Point ImplPopupFloatWin::GetToolboxPosition() const
+{
+    // return inner position where a toolbox could be placed
+    return Point( 1, 1 + GetDragRect().getHeight() );    // grip + border
 }
 
 void ImplPopupFloatWin::DrawBorder(vcl::RenderContext& rRenderContext)
@@ -570,76 +558,10 @@ void ImplPopupFloatWin::DrawGrip(vcl::RenderContext& rRenderContext)
     bool bFillcolor     = rRenderContext.IsFillColor();
     Color aFillcolor    = rRenderContext.GetFillColor();
 
-    // draw background
-    Rectangle aRect(GetDragRect());
-    aRect.Top() += POPUP_DRAGBORDER;
-    aRect.Bottom() -= POPUP_DRAGBORDER;
-    aRect.Left() += 3;
-    aRect.Right() -= 3;
-
-    if (mbHighlight)
-    {
-        rRenderContext.Erase(aRect);
-        vcl::RenderTools::DrawSelectionBackground(rRenderContext, *this, aRect, 2, false, true, false);
-    }
-    else
-    {
-        rRenderContext.SetFillColor(rRenderContext.GetSettings().GetStyleSettings().GetFaceColor());
-        rRenderContext.SetLineColor();
-        rRenderContext.DrawRect(aRect);
-    }
-
     if (!ToolBox::AlwaysLocked())  // no grip if toolboxes are locked
     {
-#ifdef TEAROFF_DASHED
-        // draw single dashed line
-        LineInfo aLineInfo(LineStyle::Dash);
-        aLineInfo.SetDistance(4);
-        aLineInfo.SetDashLen(12);
-        aLineInfo.SetDashCount(1);
-
-        aRect.Left() += 2;
-        aRect.Right()-= 2;
-
-        aRect.Top()   += 2;
-        aRect.Bottom() = aRect.Top();
-        rRenderContext.SetLineColor(rRenderContext.GetSettings().GetStyleSettings().GetDarkShadowColor());
-        rRenderContext.DrawLine(aRect.TopLeft(), aRect.TopRight(), aLineInfo);
-
-        if (!mbHighlight)
-        {
-            ++aRect.Top();
-            ++aRect.Bottom();
-            rRenderContext.SetLineColor(rRenderContext.GetSettings().GetStyleSettings().GetLightColor());
-            rRenderContext.DrawLine(aRect.TopLeft(), aRect.TopRight(), aLineInfo);
-        }
-
-#else
-        // draw several grip lines
-        rRenderContext.SetFillColor(rRenderContext.GetSettings().GetStyleSettings().GetShadowColor());
-        aRect.Top()++;
-        aRect.Bottom() = aRect.Top();
-
-        int width = POPUP_DRAGWIDTH;
-        while(width >= aRect.getWidth())
-        {
-            width -= 4;
-        }
-        if (width <= 0)
-            width = aRect.getWidth();
-        //aRect.nLeft = aRect.nLeft + (aRect.getWidth() - width) / 2;
-        aRect.Left() = (aRect.Left() + aRect.Right() - width) / 2;
-        aRect.Right() = aRect.Left() + width;
-
-        int i = 0;
-        while (i < POPUP_DRAGGRIP)
-        {
-            rRenderContext.DrawRect(aRect);
-            aRect.Top() += 2;
-            aRect.Bottom() += 2;
-            i += 2;
-        }
-#endif
+        ToolBox::ImplDrawGrip(rRenderContext, GetDragRect(),
+                              ToolBox::ImplGetDragWidth( *this, false ), WindowAlign::Left, false );
     }
 
     if (bLinecolor)
@@ -674,15 +596,15 @@ void ImplPopupFloatWin::MouseMove( const MouseEvent& rMEvt )
             StartTracking( StartTrackingFlags::NoKeyCancel );
             return;
         }
-        if( !mbHighlight && GetDragRect().IsInside( aMousePos ) )
+        if( GetDragRect().IsInside( aMousePos ) )
         {
-            mbHighlight = true;
-            Invalidate();
+            if( GetPointer().GetStyle() != PointerStyle::Move )
+                SetPointer( Pointer( PointerStyle::Move ) );
         }
-        if (mbHighlight && ( rMEvt.IsLeaveWindow() || !GetDragRect().IsInside( aMousePos ) ) )
+        if( rMEvt.IsLeaveWindow() || !GetDragRect().IsInside( aMousePos ) )
         {
-            mbHighlight = false;
-            Invalidate();
+            if( GetPointer().GetStyle() != PointerStyle::Arrow )
+                SetPointer( Pointer( PointerStyle::Arrow ) );
         }
     }
 }
@@ -1053,12 +975,8 @@ void ImplDockingWindowWrapper::StartPopupMode( ToolBox *pParentToolBox, FloatWin
     bool bIsToolBox = GetWindow()->GetType() == WINDOW_TOOLBOX;
 
     // the new parent for popup mode
-    VclPtr<FloatingWindow> pWin;
-    if ( bAllowTearOff && !bIsToolBox )
-        pWin = VclPtr<FloatingWindow>::Create( mpParent, WB_STDPOPUP );
-    else
-        pWin = VclPtr<ImplPopupFloatWin>::Create( mpParent, this, bAllowTearOff );
-
+    VclPtrInstance<ImplPopupFloatWin> pWin( mpParent, this, bAllowTearOff,
+        bAllowTearOff && !bIsToolBox );
     pWin->SetPopupModeEndHdl( LINK( this, ImplDockingWindowWrapper, PopupModeEnd ) );
     pWin->SetText( GetWindow()->GetText() );
 
@@ -1070,8 +988,8 @@ void ImplDockingWindowWrapper::StartPopupMode( ToolBox *pParentToolBox, FloatWin
     GetWindow()->mpWindowImpl->mnRightBorder   = 0;
     GetWindow()->mpWindowImpl->mnBottomBorder  = 0;
 
-    // position toolbox above DragRect
-    GetWindow()->SetPosPixel( Point( 1, 1 ) );
+    // position toolbox below the drag grip
+    GetWindow()->SetPosPixel( pWin->GetToolboxPosition() );
 
     // reparent borderwindow and window
     if ( mpOldBorderWin )
diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx
index 5095ef2..3dedc78 100644
--- a/vcl/source/window/toolbox.cxx
+++ b/vcl/source/window/toolbox.cxx
@@ -148,30 +148,36 @@ static ImplTBDragMgr* ImplGetTBDragMgr()
     return pSVData->maCtrlData.mpTBDragMgr;
 }
 
-int ToolBox::ImplGetDragWidth( ToolBox* pThis )
+int ToolBox::ImplGetDragWidth( const vcl::RenderContext& rRenderContext, bool bHorz )
 {
     int nWidth = TB_DRAGWIDTH;
-    if( pThis->IsNativeControlSupported( ControlType::Toolbar, ControlPart::Entire ) )
+    if( rRenderContext.IsNativeControlSupported( ControlType::Toolbar, ControlPart::Entire ) )
     {
 
         ImplControlValue aControlValue;
         Point aPoint;
         Rectangle aContent, aBound;
-        Rectangle aArea( aPoint, pThis->GetOutputSizePixel() );
+        Rectangle aArea( aPoint, rRenderContext.GetOutputSizePixel() );
 
-        if ( pThis->GetNativeControlRegion(ControlType::Toolbar, pThis->mbHorz ? ControlPart::ThumbVert : ControlPart::ThumbHorz,
+        if ( rRenderContext.GetNativeControlRegion(ControlType::Toolbar,
+                bHorz ? ControlPart::ThumbVert : ControlPart::ThumbHorz,
                 aArea, ControlState::NONE, aControlValue, OUString(), aBound, aContent) )
         {
-            nWidth = pThis->mbHorz ? aContent.GetWidth() : aContent.GetHeight();
+            nWidth = bHorz ? aContent.GetWidth() : aContent.GetHeight();
         }
     }
 
     // increase the hit area of the drag handle according to DPI scale factor
-    nWidth *= pThis->GetDPIScaleFactor();
+    nWidth *= rRenderContext.GetDPIScaleFactor();
 
     return nWidth;
 }
 
+int ToolBox::ImplGetDragWidth( ToolBox* pThis )
+{
+    return ToolBox::ImplGetDragWidth( *pThis, pThis->mbHorz );
+}
+
 ButtonType determineButtonType( ImplToolItem* pItem, ButtonType defaultType )
 {
     ButtonType tmpButtonType = defaultType;
@@ -263,65 +269,72 @@ static void ImplCheckUpdate(ToolBox* pThis)
         pThis->Update();
 }
 
-void ToolBox::ImplDrawGrip(vcl::RenderContext& rRenderContext)
+void ToolBox::ImplDrawGrip(vcl::RenderContext& rRenderContext,
+        const Rectangle &aDragArea, int nDragWidth, WindowAlign eAlign, bool bHorz)
 {
-    ImplDockingWindowWrapper *pWrapper = ImplGetDockingManager()->GetDockingWindowWrapper(this);
-    if( pWrapper && !pWrapper->GetDragArea().IsEmpty() )
+    bool bNativeOk = false;
+    const ControlPart ePart = bHorz ? ControlPart::ThumbVert : ControlPart::ThumbHorz;
+    const Size aSz( rRenderContext.GetOutputSizePixel() );
+    if (rRenderContext.IsNativeControlSupported(ControlType::Toolbar, ePart))
     {
-        // execute pending paint requests
-        ImplCheckUpdate(this);
+        ToolbarValue aToolbarValue;
+        aToolbarValue.maGripRect = aDragArea;
 
-        bool bNativeOk = false;
-        if (rRenderContext.IsNativeControlSupported(ControlType::Toolbar, mbHorz ? ControlPart::ThumbHorz : ControlPart::ThumbVert))
-        {
-            ToolbarValue aToolbarValue;
-            aToolbarValue.maGripRect = pWrapper->GetDragArea();
+        Point aPt;
+        Rectangle aCtrlRegion(aPt, aSz);
+        ControlState nState = ControlState::ENABLED;
 
-            Point aPt;
-            Rectangle aCtrlRegion(aPt, GetOutputSizePixel());
-            ControlState nState = ControlState::ENABLED;
-
-            bNativeOk = rRenderContext.DrawNativeControl( ControlType::Toolbar, mbHorz ? ControlPart::ThumbVert : ControlPart::ThumbHorz,
-                                            aCtrlRegion, nState, aToolbarValue, OUString() );
-        }
+        bNativeOk = rRenderContext.DrawNativeControl( ControlType::Toolbar, ePart,
+                                        aCtrlRegion, nState, aToolbarValue, OUString() );
+    }
 
-        if( bNativeOk )
-            return;
+    if( bNativeOk )
+        return;
 
-        const StyleSettings& rStyleSettings = rRenderContext.GetSettings().GetStyleSettings();
-        rRenderContext.SetLineColor(rStyleSettings.GetShadowColor());
-        rRenderContext.SetFillColor(rStyleSettings.GetShadowColor());
+    const StyleSettings& rStyleSettings = rRenderContext.GetSettings().GetStyleSettings();
+    rRenderContext.SetLineColor(rStyleSettings.GetShadowColor());
+    rRenderContext.SetFillColor(rStyleSettings.GetShadowColor());
 
-        Size aSz(GetOutputSizePixel());
-        float fScaleFactor = rRenderContext.GetDPIScaleFactor();
+    float fScaleFactor = rRenderContext.GetDPIScaleFactor();
 
-        if (meAlign == WindowAlign::Top || meAlign == WindowAlign::Bottom)
+    if (eAlign == WindowAlign::Top || eAlign == WindowAlign::Bottom)
+    {
+        int height = (int) (0.6 * aSz.Height() + 0.5);
+        int i = (aSz.Height() - height) / 2;
+        height += i;
+        while (i <= height)
         {
-            int height = (int) (0.6 * aSz.Height() + 0.5);
-            int i = (aSz.Height() - height) / 2;
-            height += i;
-            while (i <= height)
-            {
-                int x = ImplGetDragWidth(this) / 2;
-                rRenderContext.DrawEllipse(Rectangle(Point(x, i), Size(2 * fScaleFactor, 2 * fScaleFactor)));
-                i += 4 * fScaleFactor;
-            }
+            int x = nDragWidth / 2;
+            rRenderContext.DrawEllipse(Rectangle(Point(x, i), Size(2 * fScaleFactor, 2 * fScaleFactor)));
+            i += 4 * fScaleFactor;
         }
-        else
+    }
+    else
+    {
+        int width = (int) (0.6 * aSz.Width() + 0.5);
+        int i = (aSz.Width() - width) / 2;
+        width += i;
+        while (i <= width)
         {
-            int width = (int) (0.6 * aSz.Width() + 0.5);
-            int i = (aSz.Width() - width) / 2;
-            width += i;
-            while (i <= width)
-            {
-                int y = ImplGetDragWidth(this) / 2;
-                rRenderContext.DrawEllipse(Rectangle(Point(i, y), Size(2 * fScaleFactor, 2 * fScaleFactor)));
-                i += 4 * fScaleFactor;
-            }
+            int y = nDragWidth / 2;
+            rRenderContext.DrawEllipse(Rectangle(Point(i, y), Size(2 * fScaleFactor, 2 * fScaleFactor)));
+            i += 4 * fScaleFactor;
         }
     }
 }
 
+void ToolBox::ImplDrawGrip(vcl::RenderContext& rRenderContext)
+{
+    ImplDockingWindowWrapper *pWrapper = ImplGetDockingManager()->GetDockingWindowWrapper(this);
+    if( pWrapper && !pWrapper->GetDragArea().IsEmpty() )
+    {
+        // execute pending paint requests
+        ImplCheckUpdate(this);
+        ImplDrawGrip( rRenderContext, pWrapper->GetDragArea(),
+                      ImplGetDragWidth(this), meAlign, mbHorz );
+    }
+}
+
 void ToolBox::ImplDrawGradientBackground(vcl::RenderContext& rRenderContext, ImplDockingWindowWrapper*)
 {
     // draw a nice gradient
commit 8d2fd128afa73642b5b97204946ce73523653c64
Author: Jan-Marek Glogowski <glogow at fbihome.de>
Date:   Sun May 1 10:47:04 2016 +0000

    rscpp: make previous FILE_LOCAL functions static
    
    This just move the declaration from the shared header to the
    corresponding cpp files to make them static.
    
    Change-Id: I4aed6e23a90d42114d815205db2b741080739ac1

diff --git a/rsc/source/rscpp/cpp.h b/rsc/source/rscpp/cpp.h
index 0114c29..98ba207 100644
--- a/rsc/source/rscpp/cpp.h
+++ b/rsc/source/rscpp/cpp.h
@@ -278,11 +278,7 @@ int outputEval( int c );
 
 /* cpp2.c */
 int control( int counter );
-void doinclude( void );
 void dodefine( void );
-void doif( int hash );
-int openinclude( char*, int );
-int hasdirectory( char*, char*, int );
 int openfile( char* );
 
 /* cpp3.c */
@@ -296,8 +292,6 @@ int readoptions( char* filename, char*** pfargv );
 
 /* cpp4.c */
 void checkparm( int c, DEFBUF* dp );
-int expcollect( void );
-void expstuff( DEFBUF* dp );
 
 void stparmscan( int delim );
 #if OSL_DEBUG_LEVEL > 1
@@ -311,12 +305,6 @@ void expand( DEFBUF* tokenp );
 
 /* cpp5.c */
 int eval( void );
-int evallex( int );
-int *evaleval( int*, int, int );
-int evalchar( int );
-int dosizeof( void );
-int evalnum( int c );
-int bittest( int );
 
 /* cpp6.c */
 
diff --git a/rsc/source/rscpp/cpp2.c b/rsc/source/rscpp/cpp2.c
index 833e687..c181bef 100644
--- a/rsc/source/rscpp/cpp2.c
+++ b/rsc/source/rscpp/cpp2.c
@@ -22,6 +22,11 @@
 #include "cppdef.h"
 #include "cpp.h"
 
+static void doinclude( void );
+static void doif( int hash );
+static int openinclude( char*, int );
+static int hasdirectory( char*, char*, int );
+
 /*
  * Generate (by hand-inspection) a set of unique values for each control
  * operator.  Note that this is not guaranteed to work for non-Ascii
@@ -305,7 +310,7 @@ int control(int counter)
  * is always suppressed, so we don't need to evaluate anything.  This
  * suppresses unnecessary warnings.
  */
-void doif(int hash)
+static void doif(int hash)
 {
     int c;
     int found;
@@ -358,7 +363,7 @@ void doif(int hash)
  * Note: the November 12 draft forbids '>' in the #include <file> format.
  * This restriction is unnecessary and not implemented.
  */
-void doinclude()
+static void doinclude()
 {
     int c;
     int delim;
@@ -406,7 +411,7 @@ void doinclude()
  * active files.  Returns TRUE if the file was opened, FALSE
  * if openinclude() fails.  No error message is printed.
  */
-int openinclude(char* filename, int searchlocal)
+static int openinclude(char* filename, int searchlocal)
 {
     char** incptr;
     char tmpname[NFWORK]; /* Filename work area   */
@@ -500,7 +505,7 @@ int openinclude(char* filename, int searchlocal)
  * node/device/directory part of the string is copied to result and
  * hasdirectory returns TRUE.  Else, nothing is copied and it returns FALSE.
  */
-int hasdirectory(char* source, char* result, int max)
+static int hasdirectory(char* source, char* result, int max)
 {
 #if HOST == SYS_UNIX
     char* tp;
diff --git a/rsc/source/rscpp/cpp3.c b/rsc/source/rscpp/cpp3.c
index 71c40fe..a24812e 100644
--- a/rsc/source/rscpp/cpp3.c
+++ b/rsc/source/rscpp/cpp3.c
@@ -369,7 +369,7 @@ int readoptions(char* filename, char*** pfargv)
  * This routine forces the -D and -U arguments to uppercase.
  * It is called only on cpp startup by dooptions().
  */
-void zap_uc(char* ap)
+static void zap_uc(char* ap)
 {
     while (*ap != EOS)
     {
diff --git a/rsc/source/rscpp/cpp4.c b/rsc/source/rscpp/cpp4.c
index 6071076..d8e0345 100644
--- a/rsc/source/rscpp/cpp4.c
+++ b/rsc/source/rscpp/cpp4.c
@@ -22,6 +22,7 @@
 #include <ctype.h>
 #include "cppdef.h"
 #include "cpp.h"
+
 /*
  * parm[], parmp, and parlist[] are used to store #define() argument
  * lists.  nargs contains the actual number of parameters stored.
@@ -31,6 +32,9 @@ static char* parmp;                 /* Free space in parm           */
 static char* parlist[LASTPARM];     /* -> start of each parameter   */
 static int nargs;                   /* Parameters for this macro    */
 
+static int expcollect( void );
+static void expstuff( DEFBUF* dp );
+
 void InitCpp4()
 {
     int i;
@@ -465,7 +469,7 @@ void expand(DEFBUF* tokenp)
 /*
  * Collect the actual parameters for this macro.  TRUE if ok.
  */
-int expcollect()
+static int expcollect()
 {
     int c;
     int paren;                  /* For embedded ()'s    */
@@ -533,7 +537,7 @@ int expcollect()
 /*
  * Stuff the macro body, replacing formal parameters by actual parameters.
  */
-void expstuff(DEFBUF* tokenp)
+static void expstuff(DEFBUF* tokenp)
 {
     int c;                      /* Current character    */
     char* inp;                  /* -> repl string       */
diff --git a/rsc/source/rscpp/cpp5.c b/rsc/source/rscpp/cpp5.c
index 950830f..b938fcc 100644
--- a/rsc/source/rscpp/cpp5.c
+++ b/rsc/source/rscpp/cpp5.c
@@ -22,6 +22,13 @@
 #include "cppdef.h"
 #include "cpp.h"
 
+static int evallex(int skip);
+static int dosizeof(void);
+static int bittest(int value);
+static int evalnum(int c);
+static int evalchar(int skip);
+static int *evaleval(int* valp, int op, int skip);
+
 /*
  * Evaluate an #if expression.
  */
@@ -370,7 +377,7 @@ again:
  * evalchar called to evaluate 'x'
  * evalnum  called to evaluate numbers.
  */
-int evallex(int skip)
+static int evallex(int skip)
 {
     int c;
     int c1;
@@ -505,7 +512,7 @@ again:
  *  DIG     success
  *  OP_FAIL     bad parse or something.
  */
-int dosizeof()
+static int dosizeof(void)
 {
     int c;
     TYPES* tp;
@@ -621,7 +628,7 @@ int dosizeof()
 /*
  * TRUE if value is zero or exactly one bit is set in value.
  */
-int bittest(int value)
+static int bittest(int value)
 {
 /* whoaa!! really worried about non 2's complement machines...
  * but not at all about cross-compiling ?
@@ -640,7 +647,7 @@ int bittest(int value)
  * Expand number for #if lexical analysis.  Note: evalnum recognizes
  * the unsigned suffix, but only returns a signed int value.
  */
-int evalnum(int c)
+static int evalnum(int c)
 {
     int value;
     int base;
@@ -679,7 +686,7 @@ int evalnum(int c)
 /*
  * Get a character constant
  */
-int evalchar(int skip)
+static int evalchar(int skip)
 {
     int c;
     int value;
@@ -785,7 +792,7 @@ int evalchar(int skip)
  *
  * evaleval() returns the new pointer to the top of the value stack.
  */
-int * evaleval(int* valp, int op, int skip)
+static int * evaleval(int* valp, int op, int skip)
 {
     int v1;
     int v2 = 0;
commit 081267ebaacb38c564b36bb3e2576bf22d52b3e5
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Mon Dec 19 22:37:24 2016 +0100

    try to avoid the annoying focus stealing on windows
    
    Change-Id: Ic6d3492a4707f24b616a7dee34a111ba0af4f281
    Reviewed-on: https://gerrit.libreoffice.org/32207
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>

diff --git a/vcl/win/window/salframe.cxx b/vcl/win/window/salframe.cxx
index 424e588..689a69c 100644
--- a/vcl/win/window/salframe.cxx
+++ b/vcl/win/window/salframe.cxx
@@ -827,6 +827,17 @@ static void ImplSalFrameFullScreenPos( WinSalFrame* pFrame, bool bAlways = FALSE
     }
 }
 
+namespace {
+
+void SetForegroundWindow_Impl(HWND hwnd)
+{
+    static bool bUseForegroundWindow = !std::getenv("VCL_HIDE_WINDOWS");
+    if (bUseForegroundWindow)
+        SetForegroundWindow(hwnd);
+}
+
+}
+
 WinSalFrame::WinSalFrame()
 {
     SalData* pSalData = GetSalData();
@@ -1179,8 +1190,8 @@ static void ImplSalShow( HWND hWnd, bool bVisible, bool bNoActivate )
         {
             HWND hWndParent = ::GetParent( hWnd );
             if ( hWndParent )
-                SetForegroundWindow( hWndParent );
-            SetForegroundWindow( hWnd );
+                SetForegroundWindow_Impl( hWndParent );
+            SetForegroundWindow_Impl( hWnd );
         }
 
         pFrame->mbInShow = FALSE;
@@ -1977,7 +1988,7 @@ static void ImplSalToTop( HWND hWnd, SalFrameToTop nFlags )
         DWORD  myThreadID   = GetCurrentThreadId();
         DWORD  currThreadID = GetWindowThreadProcessId(hCurrWnd,nullptr);
         AttachThreadInput(myThreadID, currThreadID,TRUE);
-        SetForegroundWindow(hWnd);
+        SetForegroundWindow_Impl(hWnd);
         AttachThreadInput(myThreadID,currThreadID,FALSE);
     }
 
@@ -2011,7 +2022,7 @@ static void ImplSalToTop( HWND hWnd, SalFrameToTop nFlags )
         // Windows sometimes incorrectly reports to have the focus;
         // thus make sure to really get the focus
         if ( ::GetFocus() == hWnd )
-            SetForegroundWindow( hWnd );
+            SetForegroundWindow_Impl( hWnd );
     }
 }
 
commit 9a017238082f73ca2015f571804f35928db1f38c
Author: Adolfo Jayme Barrientos <fitojb at ubuntu.com>
Date:   Tue Dec 20 04:47:09 2016 -0600

    Fix an annoying comma splice
    
    Change-Id: I9b93b981105339b1db176d6031ccf46149a6d27a

diff --git a/setup_native/source/mac/macinstall.ulf b/setup_native/source/mac/macinstall.ulf
index 2d92e8c..2c540a1 100644
--- a/setup_native/source/mac/macinstall.ulf
+++ b/setup_native/source/mac/macinstall.ulf
@@ -44,7 +44,7 @@ en-US = "Click Install to start the installation"
 en-US = "Installation might take a minute..."
 
 [IdentifyQText]
-en-US = "Installation failed, most likely your account does not have the necessary privileges."
+en-US = "Installation failed; most likely your account does not have the necessary privileges."
 
 [IdentifyQText2]
 en-US = "Do you want to identify as administrator and try again?"
commit 3ead3aef028a317a36498f20eb9fa27045df38a8
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Dec 20 11:47:30 2016 +0100

    SfxFrameStatusListener::m_xFrame can apparently be const
    
    Change-Id: I6c7b508eae23cf6046ba07fb00ae5e63d5efc57f

diff --git a/include/sfx2/tbxctrl.hxx b/include/sfx2/tbxctrl.hxx
index dfb4021..6de923d 100644
--- a/include/sfx2/tbxctrl.hxx
+++ b/include/sfx2/tbxctrl.hxx
@@ -72,7 +72,7 @@ friend class SfxFrameStatusListener;
     bool                                                                             m_bCascading;
     Link<SfxPopupWindow*,void>                                                       m_aDeleteLink;
     sal_uInt16                                                                       m_nId;
-    css::uno::Reference< css::frame::XFrame >              m_xFrame;
+    css::uno::Reference< css::frame::XFrame > const        m_xFrame;
     SfxFrameStatusListener*                                                          m_pStatusListener;
     css::uno::Reference< css::lang::XComponent >           m_xStatusListener;
 
commit 1b616752eaa389ebefd7caef437368052aecbfa5
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Dec 20 11:44:27 2016 +0100

    Result of css::ui::ContextChangeEventMultiplexer::get cannot be null
    
    Change-Id: I00fba6c2a79404c824feaa5bb302d37c4158f9a3

diff --git a/sfx2/source/notebookbar/SfxNotebookBar.cxx b/sfx2/source/notebookbar/SfxNotebookBar.cxx
index c3821b6..c34b666 100644
--- a/sfx2/source/notebookbar/SfxNotebookBar.cxx
+++ b/sfx2/source/notebookbar/SfxNotebookBar.cxx
@@ -299,7 +299,7 @@ bool SfxNotebookBar::StateMethod(SystemWindow* pSysWindow,
                             = ContextChangeEventMultiplexer::get(
                                     ::comphelper::getProcessComponentContext());
 
-                if(xFrame.is() && xMultiplexer.is())
+                if(xFrame.is())
                 {
                     xMultiplexer->addContextChangeEventListener(
                                         pNotebookBar->getContextChangeEventListener(),
@@ -326,7 +326,7 @@ void SfxNotebookBar::RemoveListeners(SystemWindow* pSysWindow)
                         = ContextChangeEventMultiplexer::get(
                                 ::comphelper::getProcessComponentContext());
 
-    if (pSysWindow->GetNotebookBar() && xMultiplexer.is())
+    if (pSysWindow->GetNotebookBar())
     {
         xMultiplexer->removeAllContextChangeEventListeners(
                            pSysWindow->GetNotebookBar()->getContextChangeEventListener());

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list