[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - 27 commits - avmedia/source basctl/source chart2/source cui/source dbaccess/source desktop/source editeng/source extensions/source include/svtools include/svx include/vbahelper include/vcl reportdesign/source sc/source sd/source sfx2/source svtools/source svx/source sw/inc sw/source toolkit/source vbahelper/source vcl/inc vcl/osx vcl/qa vcl/source vcl/unx vcl/win

Tomaž Vajngerl tomaz.vajngerl at collabora.co.uk
Fri May 29 11:18:38 PDT 2015


 avmedia/source/viewer/mediawindow_impl.cxx                   |    8 
 basctl/source/basicide/baside2.hxx                           |    1 
 basctl/source/basicide/baside2b.cxx                          |   27 
 chart2/source/controller/main/ChartController_Window.cxx     |   56 
 chart2/source/controller/main/DragMethod_Base.cxx            |    4 
 cui/source/options/optgdlg.cxx                               |    8 
 cui/source/options/treeopt.cxx                               |    2 
 dbaccess/source/ui/app/AppDetailView.cxx                     |    6 
 dbaccess/source/ui/app/AppTitleWindow.cxx                    |   40 
 dbaccess/source/ui/app/AppTitleWindow.hxx                    |    2 
 dbaccess/source/ui/dlg/TextConnectionHelper.cxx              |    4 
 dbaccess/source/ui/dlg/adminpages.cxx                        |    2 
 dbaccess/source/ui/querydesign/JoinTableView.cxx             |    4 
 dbaccess/source/ui/querydesign/TableWindow.cxx               |    8 
 desktop/source/app/app.cxx                                   |   10 
 editeng/source/editeng/impedit.cxx                           |    2 
 editeng/source/editeng/impedit.hxx                           |   10 
 editeng/source/outliner/outlvw.cxx                           |    8 
 extensions/source/plugin/base/plctrl.cxx                     |    3 
 extensions/source/propctrlr/standardcontrol.cxx              |    4 
 include/svtools/apearcfg.hxx                                 |    7 
 include/svx/sidebar/PanelLayout.hxx                          |    2 
 include/vbahelper/vbahelper.hxx                              |    2 
 include/vcl/combobox.hxx                                     |    2 
 include/vcl/dockingarea.hxx                                  |    1 
 include/vcl/dockwin.hxx                                      |   10 
 include/vcl/fixed.hxx                                        |   13 
 include/vcl/layout.hxx                                       |    6 
 include/vcl/lstbox.hxx                                       |    3 
 include/vcl/outdev.hxx                                       |    1 
 include/vcl/pointr.hxx                                       |    2 
 include/vcl/ptrstyle.hxx                                     |  200 -
 include/vcl/settings.hxx                                     |  172 -
 include/vcl/syswin.hxx                                       |   15 
 include/vcl/window.hxx                                       |   75 
 reportdesign/source/ui/report/ScrollHelper.cxx               |    2 
 reportdesign/source/ui/report/dlgedfunc.cxx                  |    4 
 sc/source/ui/app/inputwin.cxx                                |    8 
 sc/source/ui/dbgui/csvruler.cxx                              |    6 
 sc/source/ui/dbgui/scuiasciiopt.cxx                          |    8 
 sc/source/ui/drawfunc/fuconarc.cxx                           |    8 
 sc/source/ui/drawfunc/fuconcustomshape.cxx                   |    2 
 sc/source/ui/drawfunc/fuconpol.cxx                           |    2 
 sc/source/ui/drawfunc/fuconrec.cxx                           |   10 
 sc/source/ui/drawfunc/fuconstr.cxx                           |    2 
 sc/source/ui/drawfunc/fuconuno.cxx                           |    2 
 sc/source/ui/drawfunc/fudraw.cxx                             |   14 
 sc/source/ui/drawfunc/futext.cxx                             |    2 
 sc/source/ui/formdlg/privsplt.cxx                            |    4 
 sc/source/ui/inc/csvruler.hxx                                |    2 
 sc/source/ui/inc/preview.hxx                                 |    4 
 sc/source/ui/miscdlgs/acredlin.cxx                           |   26 
 sc/source/ui/miscdlgs/anyrefdg.cxx                           |   14 
 sc/source/ui/miscdlgs/conflictsdlg.cxx                       |    8 
 sc/source/ui/miscdlgs/instbdlg.cxx                           |    2 
 sc/source/ui/miscdlgs/retypepassdlg.cxx                      |    4 
 sc/source/ui/navipi/navipi.cxx                               |    2 
 sc/source/ui/pagedlg/tphfedit.cxx                            |    2 
 sc/source/ui/vba/vbaapplication.cxx                          |   14 
 sc/source/ui/view/formatsh.cxx                               |    4 
 sc/source/ui/view/gridwin.cxx                                |   52 
 sc/source/ui/view/gridwin2.cxx                               |   12 
 sc/source/ui/view/gridwin3.cxx                               |    2 
 sc/source/ui/view/hdrcont.cxx                                |    8 
 sc/source/ui/view/preview.cxx                                |  102 
 sc/source/ui/view/tabsplit.cxx                               |    6 
 sc/source/ui/view/tabview5.cxx                               |    2 
 sd/source/ui/annotations/annotationtag.cxx                   |    2 
 sd/source/ui/annotations/annotationwindow.cxx                |    2 
 sd/source/ui/dlg/navigatr.cxx                                |    6 
 sd/source/ui/func/fuconuno.cxx                               |    2 
 sd/source/ui/func/fudraw.cxx                                 |   14 
 sd/source/ui/func/fudspord.cxx                               |    2 
 sd/source/ui/func/fuformatpaintbrush.cxx                     |    6 
 sd/source/ui/func/fuzoom.cxx                                 |    8 
 sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx |    2 
 sd/source/ui/view/viewoverlaymanager.cxx                     |    2 
 sfx2/source/appl/newhelp.cxx                                 |    4 
 sfx2/source/appl/sfxhelp.cxx                                 |    2 
 sfx2/source/control/recentdocsviewitem.cxx                   |    2 
 sfx2/source/control/thumbnailview.cxx                        |    2 
 sfx2/source/dialog/backingcomp.cxx                           |    2 
 sfx2/source/dialog/backingwindow.cxx                         |    4 
 sfx2/source/dialog/dialoghelper.cxx                          |    4 
 sfx2/source/doc/plugin.cxx                                   |    3 
 sfx2/source/sidebar/TitleBar.cxx                             |    4 
 sfx2/source/sidebar/TitleBar.hxx                             |    2 
 svtools/source/brwbox/brwbox2.cxx                            |    4 
 svtools/source/brwbox/datwin.cxx                             |    4 
 svtools/source/brwbox/editbrowsebox.cxx                      |    4 
 svtools/source/config/apearcfg.cxx                           |   24 
 svtools/source/config/miscopt.cxx                            |    4 
 svtools/source/contnr/imivctl1.cxx                           |   70 
 svtools/source/contnr/treelistbox.cxx                        |   12 
 svtools/source/control/calendar.cxx                          |    2 
 svtools/source/control/fmtfield.cxx                          |    8 
 svtools/source/control/headbar.cxx                           |    6 
 svtools/source/control/hyperlabel.cxx                        |    4 
 svtools/source/control/ruler.cxx                             |   26 
 svtools/source/control/tabbar.cxx                            |    2 
 svtools/source/control/valueset.cxx                          |    4 
 svtools/source/dialogs/wizardmachine.cxx                     |    4 
 svtools/source/dialogs/wizdlg.cxx                            |   10 
 svtools/source/hatchwindow/ipwin.cxx                         |   10 
 svtools/source/table/mousefunction.cxx                       |   10 
 svtools/source/toolpanel/toolpaneldrawer.cxx                 |    2 
 svx/source/dialog/contwnd.cxx                                |    2 
 svx/source/dialog/graphctl.cxx                               |    2 
 svx/source/engine3d/dragmt3d.cxx                             |    4 
 svx/source/fmcomp/gridcell.cxx                               |   25 
 svx/source/form/datanavi.cxx                                 |    4 
 svx/source/sidebar/PanelLayout.cxx                           |   10 
 svx/source/svdraw/sdrpaintwindow.cxx                         |    4 
 svx/source/svdraw/svdcrtv.cxx                                |    6 
 svx/source/svdraw/svddrgmt.cxx                               |   26 
 svx/source/svdraw/svdhdl.cxx                                 |   70 
 svx/source/svdraw/svdhlpln.cxx                               |    6 
 svx/source/svdraw/svdobj.cxx                                 |    4 
 svx/source/svdraw/svdocapt.cxx                               |    2 
 svx/source/svdraw/svdocirc.cxx                               |   10 
 svx/source/svdraw/svdoedge.cxx                               |    2 
 svx/source/svdraw/svdomeas.cxx                               |    2 
 svx/source/svdraw/svdopath.cxx                               |   24 
 svx/source/svdraw/svdorect.cxx                               |    4 
 svx/source/svdraw/svdotxdr.cxx                               |    4 
 svx/source/svdraw/svdsnpv.cxx                                |    8 
 svx/source/svdraw/svdview.cxx                                |   80 
 svx/source/table/svdotable.cxx                               |    2 
 svx/source/table/tablehandles.cxx                            |    6 
 sw/inc/crsrsh.hxx                                            |    2 
 sw/inc/viewsh.hxx                                            |    6 
 sw/source/core/crsr/crsrsh.cxx                               |    4 
 sw/source/core/draw/dflyobj.cxx                              |    2 
 sw/source/core/view/pagepreviewlayout.cxx                    |    6 
 sw/source/core/view/viewsh.cxx                               |   21 
 sw/source/core/view/vprint.cxx                               |    2 
 sw/source/ui/vba/vbasystem.cxx                               |   18 
 sw/source/uibase/docvw/SidebarWin.cxx                        |    2 
 sw/source/uibase/docvw/edtwin.cxx                            |   68 
 sw/source/uibase/docvw/edtwin2.cxx                           |    4 
 sw/source/uibase/docvw/srcedtw.cxx                           |    2 
 sw/source/uibase/ribbar/conform.cxx                          |    4 
 sw/source/uibase/uiview/viewdraw.cxx                         |    2 
 sw/source/uibase/utlui/navipi.cxx                            |    6 
 toolkit/source/awt/vclxaccessiblecomponent.cxx               |    6 
 toolkit/source/awt/vclxcontainer.cxx                         |    2 
 toolkit/source/awt/vclxwindow.cxx                            |   25 
 toolkit/source/awt/vclxwindows.cxx                           |   18 
 toolkit/source/helper/unowrapper.cxx                         |   18 
 vbahelper/source/msforms/vbacontrol.cxx                      |   36 
 vbahelper/source/vbahelper/vbahelper.cxx                     |    4 
 vcl/inc/brdwin.hxx                                           |    9 
 vcl/inc/ilstbox.hxx                                          |   10 
 vcl/inc/osx/saldata.hxx                                      |    3 
 vcl/inc/unx/gtk/gtkdata.hxx                                  |    3 
 vcl/inc/unx/saldisp.hxx                                      |    5 
 vcl/osx/saldata.cxx                                          |  205 -
 vcl/osx/salframe.cxx                                         |   44 
 vcl/qa/cppunit/lifecycle.cxx                                 |    4 
 vcl/source/app/dbggui.cxx                                    |   12 
 vcl/source/app/settings.cxx                                  |   90 
 vcl/source/control/button.cxx                                |   35 
 vcl/source/control/combobox.cxx                              |   24 
 vcl/source/control/ctrl.cxx                                  |   25 
 vcl/source/control/edit.cxx                                  |   28 
 vcl/source/control/fixed.cxx                                 |  254 -
 vcl/source/control/fixedhyper.cxx                            |    2 
 vcl/source/control/group.cxx                                 |    2 
 vcl/source/control/ilstbox.cxx                               |  157 -
 vcl/source/control/imgctrl.cxx                               |    6 
 vcl/source/control/lstbox.cxx                                |   32 
 vcl/source/control/scrbar.cxx                                |    6 
 vcl/source/control/spinfld.cxx                               |   18 
 vcl/source/control/tabctrl.cxx                               |   10 
 vcl/source/edit/textview.cxx                                 |    4 
 vcl/source/edit/vclmedit.cxx                                 |    4 
 vcl/source/outdev/font.cxx                                   |    2 
 vcl/source/outdev/text.cxx                                   |    6 
 vcl/source/window/accessibility.cxx                          |    8 
 vcl/source/window/brdwin.cxx                                 | 1504 +++++------
 vcl/source/window/builder.cxx                                |    6 
 vcl/source/window/decoview.cxx                               |   14 
 vcl/source/window/dialog.cxx                                 |   46 
 vcl/source/window/dlgctrl.cxx                                |    2 
 vcl/source/window/dockingarea.cxx                            |   86 
 vcl/source/window/dockmgr.cxx                                |   50 
 vcl/source/window/dockwin.cxx                                |   26 
 vcl/source/window/floatwin.cxx                               |    2 
 vcl/source/window/layout.cxx                                 |   40 
 vcl/source/window/menu.cxx                                   |    2 
 vcl/source/window/menubarwindow.cxx                          |   21 
 vcl/source/window/menufloatingwindow.cxx                     |    5 
 vcl/source/window/mouse.cxx                                  |    8 
 vcl/source/window/paint.cxx                                  |   58 
 vcl/source/window/scrwnd.cxx                                 |   48 
 vcl/source/window/split.cxx                                  |   26 
 vcl/source/window/splitwin.cxx                               |   14 
 vcl/source/window/stacking.cxx                               |   38 
 vcl/source/window/status.cxx                                 |    6 
 vcl/source/window/syswin.cxx                                 |   32 
 vcl/source/window/tabdlg.cxx                                 |   18 
 vcl/source/window/tabpage.cxx                                |   10 
 vcl/source/window/taskpanelist.cxx                           |    4 
 vcl/source/window/toolbox.cxx                                |   27 
 vcl/source/window/toolbox2.cxx                               |    6 
 vcl/source/window/window.cxx                                 |   46 
 vcl/source/window/window2.cxx                                |    8 
 vcl/source/window/window3.cxx                                |    4 
 vcl/source/window/winproc.cxx                                |   14 
 vcl/unx/generic/app/saldisp.cxx                              |  203 -
 vcl/unx/generic/window/salframe.cxx                          |    2 
 vcl/unx/gtk/a11y/atkwindow.cxx                               |    2 
 vcl/unx/gtk/app/gtkdata.cxx                                  |  221 -
 vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx                     |    2 
 vcl/unx/gtk/window/gtksalframe.cxx                           |    2 
 vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx                |    2 
 vcl/unx/kde/salnativewidgets-kde.cxx                         |    2 
 vcl/unx/kde4/KDESalFrame.cxx                                 |    2 
 vcl/win/source/window/salframe.cxx                           |   21 
 219 files changed, 2812 insertions(+), 2736 deletions(-)

New commits:
commit 9b1860465ee6d5d2ab91d013ee854ff8874fe9eb
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
Date:   Fri May 29 18:20:42 2015 +0900

    tdf#91484 fix macro editor - Invalidate in paint
    
    Change-Id: I787da9a665e54caea229def185076b29c00fd11e
    Signed-off-by: Jan Holesovsky <kendy at collabora.com>

diff --git a/basctl/source/basicide/baside2.hxx b/basctl/source/basicide/baside2.hxx
index f3bbe8b..06390f2 100644
--- a/basctl/source/basicide/baside2.hxx
+++ b/basctl/source/basicide/baside2.hxx
@@ -179,6 +179,7 @@ private:
 protected:
     virtual void    Paint(vcl::RenderContext& rRenderContext, const Rectangle&) SAL_OVERRIDE;
     BreakPoint*     FindBreakPoint( const Point& rMousePos );
+    void ShowMarker(vcl::RenderContext& rRenderContext);
     virtual void    MouseButtonDown( const MouseEvent& rMEvt ) SAL_OVERRIDE;
     virtual void    Command( const CommandEvent& rCEvt ) SAL_OVERRIDE;
 
diff --git a/basctl/source/basicide/baside2b.cxx b/basctl/source/basicide/baside2b.cxx
index 2c98fde..68592f4 100644
--- a/basctl/source/basicide/baside2b.cxx
+++ b/basctl/source/basicide/baside2b.cxx
@@ -1402,7 +1402,30 @@ void BreakPointWindow::Paint(vcl::RenderContext& rRenderContext, const Rectangle
         rRenderContext.DrawImage(Point(0, nY) + aBmpOff, aBrk[rBrk.bEnabled]);
     }
 
-    Invalidate();
+    ShowMarker(rRenderContext);
+}
+
+void BreakPointWindow::ShowMarker(vcl::RenderContext& rRenderContext)
+{
+    if (nMarkerPos == NoMarker)
+        return;
+
+    Size const aOutSz = GetOutputSize();
+    long const nLineHeight = GetTextHeight();
+
+    Image aMarker = GetImage(bErrorMarker ? IMGID_ERRORMARKER : IMGID_STEPMARKER);
+
+    Size aMarkerSz(aMarker.GetSizePixel());
+    aMarkerSz = rRenderContext.PixelToLogic(aMarkerSz);
+    Point aMarkerOff(0, 0);
+    aMarkerOff.X() = (aOutSz.Width() - aMarkerSz.Width()) / 2;
+    aMarkerOff.Y() = (nLineHeight - aMarkerSz.Height()) / 2;
+
+    sal_uLong nY = nMarkerPos * nLineHeight - nCurYOffset;
+    Point aPos(0, nY);
+    aPos += aMarkerOff;
+
+    rRenderContext.DrawImage(aPos, aMarker);
 }
 
 void BreakPointWindow::DoScroll( long nHorzScroll, long nVertScroll )
commit 6d0696980a39b5a0618221c0120ecead4846ff05
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
Date:   Fri May 29 16:54:48 2015 +0900

    tdf#91677 fix invidsible menu in Base
    
    Change-Id: Ie1a8d6125d4a9d67f06f7dc37aa4d5115ad1af28
    Signed-off-by: Jan Holesovsky <kendy at collabora.com>

diff --git a/svtools/source/contnr/imivctl1.cxx b/svtools/source/contnr/imivctl1.cxx
index a6cf457..7c790ff 100644
--- a/svtools/source/contnr/imivctl1.cxx
+++ b/svtools/source/contnr/imivctl1.cxx
@@ -663,10 +663,6 @@ void SvxIconChoiceCtrl_Impl::Paint(vcl::RenderContext& rRenderContext, const Rec
             pCursor = aEntries[ 0 ];
     }
 
-    // Show Focus at Init-Time
-    if (pView->HasFocus())
-        GetFocus();
-
     size_t nCount = pZOrderList->size();
     if (!nCount)
         return;
@@ -1650,20 +1646,20 @@ void SvxIconChoiceCtrl_Impl::PaintEntry(SvxIconChoiceCtrlEntry* pEntry, const Po
     bool bDropTarget = pEntry->IsDropTarget();
     bool bNoEmphasis = pEntry->IsBlockingEmphasis();
 
-    vcl::Font aTempFont(rRenderContext.GetFont());
+    rRenderContext.Push(PushFlags::FONT | PushFlags::TEXTCOLOR);
 
     OUString aEntryText(SvtIconChoiceCtrl::GetEntryText(pEntry, false));
     Rectangle aTextRect(CalcTextRect(pEntry, &rPos, false, &aEntryText));
     Rectangle aBmpRect(CalcBmpRect(pEntry, &rPos));
 
-    bool bShowSelection = (((bSelected && !bCursored) || bDropTarget) && !bNoEmphasis && (eSelectionMode != NO_SELECTION));
+    bool bShowSelection = ((bSelected && !bCursored) && !bNoEmphasis && (eSelectionMode != NO_SELECTION));
 
     bool bActiveSelection = (0 != (nWinBits & WB_NOHIDESELECTION)) || pView->HasFocus();
 
     if (bShowSelection)
     {
         const StyleSettings& rSettings = rRenderContext.GetSettings().GetStyleSettings();
-        vcl::Font aNewFont(aTempFont);
+        vcl::Font aNewFont(rRenderContext.GetFont());
 
         // font fill colors that are attributed "hard" need corresponding "hard"
         // attributed highlight colors
@@ -1718,7 +1714,7 @@ void SvxIconChoiceCtrl_Impl::PaintEntry(SvxIconChoiceCtrlEntry* pEntry, const Po
     if (pEntry == pCurHighlightFrame && !bNoEmphasis)
         DrawHighlightFrame(rRenderContext, CalcFocusRect(pEntry), false);
 
-    rRenderContext.SetFont(aTempFont);
+    rRenderContext.Pop();
     if (bResetClipRegion)
         rRenderContext.SetClipRegion();
 }
commit 22e168424d774fb29dd9a77664bc1d2d6833c40b
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
Date:   Thu May 28 18:43:55 2015 +0900

    fix highlight rendering for iconview with more effective clipping
    
    Change-Id: I9d8f2341477b9b9c0acd71a7d33cd5a9a55757d2
    Signed-off-by: Jan Holesovsky <kendy at collabora.com>

diff --git a/svtools/source/contnr/imivctl1.cxx b/svtools/source/contnr/imivctl1.cxx
index 51dc4bb..a6cf457 100644
--- a/svtools/source/contnr/imivctl1.cxx
+++ b/svtools/source/contnr/imivctl1.cxx
@@ -671,13 +671,8 @@ void SvxIconChoiceCtrl_Impl::Paint(vcl::RenderContext& rRenderContext, const Rec
     if (!nCount)
         return;
 
-    bool bResetClipRegion = false;
-    if (!rRenderContext.IsClipRegion())
-    {
-        vcl::Region const aOutputArea(GetOutputRect());
-        bResetClipRegion = true;
-        rRenderContext.SetClipRegion(aOutputArea);
-    }
+    rRenderContext.Push(PushFlags::CLIPREGION);
+    rRenderContext.SetClipRegion(vcl::Region(rRect));
 
     SvxIconChoiceCtrlEntryList_impl* pNewZOrderList = new SvxIconChoiceCtrlEntryList_impl();
     boost::scoped_ptr<SvxIconChoiceCtrlEntryList_impl> pPaintedEntries(new SvxIconChoiceCtrlEntryList_impl());
@@ -709,15 +704,27 @@ void SvxIconChoiceCtrl_Impl::Paint(vcl::RenderContext& rRenderContext, const Rec
     }
     pPaintedEntries.reset();
 
-    if (bResetClipRegion)
-        rRenderContext.SetClipRegion();
+    rRenderContext.Pop();
 }
 
-void SvxIconChoiceCtrl_Impl::RepaintEntries(SvxIconViewFlags /*nEntryFlagsMask*/)
+void SvxIconChoiceCtrl_Impl::RepaintEntries(SvxIconViewFlags nEntryFlagsMask)
 {
-    pView->Invalidate();
-}
+    const size_t nCount = pZOrderList->size();
+    if (!nCount)
+        return;
 
+    Rectangle aOutRect(GetOutputRect());
+    for (size_t nCur = 0; nCur < nCount; nCur++)
+    {
+        SvxIconChoiceCtrlEntry* pEntry = (*pZOrderList)[nCur];
+        if (pEntry->GetFlags() & nEntryFlagsMask)
+        {
+            const Rectangle& rBoundRect = GetEntryBoundRect(pEntry);
+            if (aOutRect.IsOver(rBoundRect))
+                pView->Invalidate(rBoundRect);
+        }
+    }
+}
 
 void SvxIconChoiceCtrl_Impl::InitScrollBarBox()
 {
@@ -1699,7 +1706,9 @@ void SvxIconChoiceCtrl_Impl::PaintEntry(SvxIconChoiceCtrlEntry* pEntry, const Po
         PaintEmphasis(aTextRect, aBmpRect, bSelected, bDropTarget, bCursored, rRenderContext, bIsBackgroundPainted);
 
     if ( bShowSelection )
-        pView->DrawSelectionBackground(CalcFocusRect(pEntry), bActiveSelection ? 1 : 2, false, true, false);
+        vcl::RenderTools::DrawSelectionBackground(rRenderContext, *pView.get(), CalcFocusRect(pEntry),
+                                                  bActiveSelection ? 1 : 2, false, true, false);
+
 
     PaintItem(aBmpRect, IcnViewFieldTypeImage, pEntry, nBmpPaintFlags, rRenderContext);
 
@@ -3583,12 +3592,20 @@ void SvxIconChoiceCtrl_Impl::SetEntryHighlightFrame( SvxIconChoiceCtrlEntry* pEn
     if( !bKeepHighlightFlags )
         bHighlightFramePressed = false;
 
-    HideEntryHighlightFrame();
+    if (pCurHighlightFrame)
+    {
+        Rectangle aInvalidationRect(GetEntryBoundRect(pCurHighlightFrame));
+        aInvalidationRect.expand(5);
+        pCurHighlightFrame = nullptr;
+        pView->Invalidate(aInvalidationRect);
+    }
+
     pCurHighlightFrame = pEntry;
-    if( pEntry )
+    if (pEntry)
     {
-        Rectangle aBmpRect(CalcFocusRect(pEntry));
-        pView->Invalidate(aBmpRect);
+        Rectangle aInvalidationRect(GetEntryBoundRect(pEntry));
+        aInvalidationRect.expand(5);
+        pView->Invalidate(aInvalidationRect);
     }
 }
 
@@ -3598,9 +3615,10 @@ void SvxIconChoiceCtrl_Impl::HideEntryHighlightFrame()
         return;
 
     SvxIconChoiceCtrlEntry* pEntry = pCurHighlightFrame;
-    pCurHighlightFrame = 0;
-    Rectangle aBmpRect(CalcFocusRect(pEntry));
-    pView->Invalidate(aBmpRect);
+    pCurHighlightFrame = nullptr;
+    Rectangle aInvalidationRect(GetEntryBoundRect(pEntry));
+    aInvalidationRect.expand(5);
+    pView->Invalidate(aInvalidationRect);
 }
 
 void SvxIconChoiceCtrl_Impl::CallSelectHandler( SvxIconChoiceCtrlEntry* )
commit 3581b4dd6c23ab5827f6a89730909ae0fd98573d
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
Date:   Thu May 28 18:42:39 2015 +0900

    fix drawing treelistbox with redefined background in dbaccess
    
    Change-Id: Ia55797e3e42309f9d37d5335088f7657d99954de
    Signed-off-by: Jan Holesovsky <kendy at collabora.com>

diff --git a/dbaccess/source/ui/app/AppDetailView.cxx b/dbaccess/source/ui/app/AppDetailView.cxx
index 0ae17bf..7329b0b 100644
--- a/dbaccess/source/ui/app/AppDetailView.cxx
+++ b/dbaccess/source/ui/app/AppDetailView.cxx
@@ -87,6 +87,8 @@ OCreationList::OCreationList( OTasksWindow& _rParent )
 
 void OCreationList::Paint(vcl::RenderContext& rRenderContext, const Rectangle& _rRect )
 {
+    SetBackground();
+
     if (m_pMouseDownEntry)
         m_aOriginalFont = rRenderContext.GetFont();
 
@@ -119,11 +121,13 @@ void OCreationList::PreparePaint(vcl::RenderContext& rRenderContext, SvTreeListE
 
             // and temporary set a transparent background, for all the other
             // paint operations the SvTreeListBox is going to do
-            aEntryBackground = Wallpaper(Color(COL_TRANSPARENT));
+            aEntryBackground = Wallpaper();
+            _pEntry->SetBackColor(Color(COL_TRANSPARENT));
         }
     }
 
     rRenderContext.SetBackground(aEntryBackground);
+    _pEntry->SetBackColor(aEntryBackground.GetColor());
 }
 
 void OCreationList::SelectSearchEntry( const void* _pEntry )
diff --git a/svtools/source/contnr/treelistbox.cxx b/svtools/source/contnr/treelistbox.cxx
index efb9b93..13cefab 100644
--- a/svtools/source/contnr/treelistbox.cxx
+++ b/svtools/source/contnr/treelistbox.cxx
@@ -3048,10 +3048,14 @@ long SvTreeListBox::PaintEntry1(SvTreeListEntry* pEntry, long nLine, vcl::Render
             // realize tab listboxes with lines.
             if (!(nCurTab == 0 && (nTreeFlags & SvTreeFlags::USESEL) && nFirstSelTab))
             {
-                rRenderContext.SetFillColor(aWallpaper.GetColor());
-                // this case may occur for smaller horizontal resizes
-                if (aRect.Left() < aRect.Right())
-                    rRenderContext.DrawRect(aRect);
+                Color aBackgroundColor = aWallpaper.GetColor();
+                if (aBackgroundColor != Color(COL_TRANSPARENT))
+                {
+                    rRenderContext.SetFillColor(aBackgroundColor);
+                    // this case may occur for smaller horizontal resizes
+                    if (aRect.Left() < aRect.Right())
+                        rRenderContext.DrawRect(aRect);
+                }
             }
             // draw item
             // center vertically
commit 1d7600a2467ef2100665e43eb51f47b656d7405d
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
Date:   Wed May 27 19:14:44 2015 +0900

    fix Base's titlewindow font, font color and background
    
    Change-Id: Ide9c30385d15d0b8303f25d1a9eef132a32ec7d2
    Signed-off-by: Jan Holesovsky <kendy at collabora.com>

diff --git a/dbaccess/source/ui/app/AppTitleWindow.cxx b/dbaccess/source/ui/app/AppTitleWindow.cxx
index 1a28fb7..19da267 100644
--- a/dbaccess/source/ui/app/AppTitleWindow.cxx
+++ b/dbaccess/source/ui/app/AppTitleWindow.cxx
@@ -40,9 +40,17 @@ OTitleWindow::OTitleWindow(vcl::Window* _pParent,sal_uInt16 _nTitleId,WinBits _n
     SetBorderStyle(WindowBorderStyle::MONO);
     ImplInitSettings( true, true, true );
 
-    vcl::Window* pWindows [] = { m_aSpace1.get(), m_aSpace2.get(), m_aTitle.get() };
+    const StyleSettings& rStyle = Application::GetSettings().GetStyleSettings();
+    vcl::Window* pWindows[] = { m_aSpace1.get(), m_aSpace2.get(), m_aTitle.get() };
     for (size_t i=0; i < sizeof(pWindows)/sizeof(pWindows[0]); ++i)
+    {
+        vcl::Font aFont = pWindows[i]->GetControlFont();
+        aFont.SetWeight(WEIGHT_BOLD);
+        pWindows[i]->SetControlFont(aFont);
+        pWindows[i]->SetControlForeground(rStyle.GetLightColor());
+        pWindows[i]->SetControlBackground(rStyle.GetShadowColor());
         pWindows[i]->Show();
+    }
 }
 
 OTitleWindow::~OTitleWindow()
@@ -158,18 +166,28 @@ void OTitleWindow::ImplInitSettings( bool bFont, bool bForeground, bool bBackgro
 
     if( bBackground )
         SetBackground( rStyleSettings.GetFieldColor() );
+}
 
-    vcl::Window* pWindows [] = { m_aSpace1.get(), m_aSpace2.get(), m_aTitle.get()};
-    for (size_t i=0; i < sizeof(pWindows)/sizeof(pWindows[0]); ++i)
-    {
-        vcl::Font aFont = pWindows[i]->GetFont();
-        aFont.SetWeight(WEIGHT_BOLD);
-        pWindows[i]->SetFont(aFont);
-        pWindows[i]->SetTextColor( aStyle.GetLightColor() );
-        pWindows[i]->SetBackground( Wallpaper( aStyle.GetShadowColor() ) );
-    }
+void OTitleWindow::ApplySettings(vcl::RenderContext& rRenderContext)
+{
+    // FIXME RenderContext
+    AllSettings aAllSettings = rRenderContext.GetSettings();
+    StyleSettings aStyle = aAllSettings.GetStyleSettings();
+    aStyle.SetMonoColor(aStyle.GetActiveBorderColor());//GetMenuBorderColor());
+    aAllSettings.SetStyleSettings(aStyle);
+    rRenderContext.SetSettings(aAllSettings);
+
+    const StyleSettings& rStyleSettings = rRenderContext.GetSettings().GetStyleSettings();
+    vcl::Font aFont;
+    aFont = rStyleSettings.GetFieldFont();
+    aFont.SetColor(rStyleSettings.GetWindowTextColor());
+    SetPointFont(*this, aFont);
+
+    rRenderContext.SetTextColor(rStyleSettings.GetFieldTextColor());
+    rRenderContext.SetTextFillColor();
+
+    rRenderContext.SetBackground(rStyleSettings.GetFieldColor());
 }
 
 } // namespace dbaui
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/dbaccess/source/ui/app/AppTitleWindow.hxx b/dbaccess/source/ui/app/AppTitleWindow.hxx
index 875f693..888ec32 100644
--- a/dbaccess/source/ui/app/AppTitleWindow.hxx
+++ b/dbaccess/source/ui/app/AppTitleWindow.hxx
@@ -42,6 +42,8 @@ namespace dbaui
         virtual void Resize() SAL_OVERRIDE;
         virtual void GetFocus() SAL_OVERRIDE;
 
+        virtual void ApplySettings(vcl::RenderContext& rRenderContext) SAL_OVERRIDE;
+
         /** sets the child window which should be displayed below the title. It will be destroyed at the end.
             @param  _pChild
                 The child window.
commit 6b0e066b587ad494b799901e299625291f88484f
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
Date:   Mon May 25 16:29:20 2015 +0900

    forward RenderCOntext to UserDraw, remove obsolete draw call
    
    Change-Id: I29dcc22a6840e7104bdf68d050b616c8e06226fa
    Signed-off-by: Jan Holesovsky <kendy at collabora.com>

diff --git a/vcl/source/window/status.cxx b/vcl/source/window/status.cxx
index a3273ec..b9669d7 100644
--- a/vcl/source/window/status.cxx
+++ b/vcl/source/window/status.cxx
@@ -462,7 +462,7 @@ void StatusBar::ImplDrawItem(vcl::RenderContext& rRenderContext, bool bOffScreen
         }
         else
         {
-            UserDrawEvent aODEvt(this, aTextRect, pItem->mnId);
+            UserDrawEvent aODEvt(&rRenderContext, aTextRect, pItem->mnId);
             UserDraw(aODEvt);
         }
     }
@@ -505,8 +505,7 @@ void StatusBar::ImplDrawItem(vcl::RenderContext& rRenderContext, bool bOffScreen
         }
     }
 
-    const OutputDevice* pOutDev = GetOutDev();
-    if (!pOutDev->ImplIsRecordLayout())
+    if (!rRenderContext.ImplIsRecordLayout())
         CallEventListeners(VCLEVENT_STATUSBAR_DRAWITEM, reinterpret_cast<void*>(pItem->mnId));
 }
 
@@ -1260,7 +1259,6 @@ void StatusBar::SetItemData( sal_uInt16 nItemId, void* pNewData )
             Update();
             Rectangle aRect = ImplGetItemRectPos(nPos);
             Invalidate(aRect);
-            ImplDrawItem(*this, true, nPos, false, false);
             Flush();
         }
     }
commit 248fb37ad51623c95e7d9df1f1c001e64a4b5bd1
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
Date:   Mon May 25 16:15:36 2015 +0900

    convert splitter to use RenderContext
    
    Change-Id: Ia010aa7daf14fcaeee5d46cc4e5b8ed21e00efcf
    Signed-off-by: Jan Holesovsky <kendy at collabora.com>

diff --git a/vcl/source/window/split.cxx b/vcl/source/window/split.cxx
index ff30617..002a0e0 100644
--- a/vcl/source/window/split.cxx
+++ b/vcl/source/window/split.cxx
@@ -697,15 +697,15 @@ void Splitter::DataChanged( const DataChangedEvent& rDCEvt )
     }
 }
 
-void Splitter::Paint( vcl::RenderContext& /*rRenderContext*/, const Rectangle& rPaintRect )
+void Splitter::Paint(vcl::RenderContext& rRenderContext, const Rectangle& rPaintRect)
 {
-    DrawRect( rPaintRect );
+    rRenderContext.DrawRect(rPaintRect);
 
-    Polygon aPoly( rPaintRect );
-    tools::PolyPolygon aPolyPoly( aPoly );
-    DrawTransparent( aPolyPoly, 85 );
+    Polygon aPoly(rPaintRect);
+    tools::PolyPolygon aPolyPoly(aPoly);
+    rRenderContext.DrawTransparent(aPolyPoly, 85);
 
-    if( mbKbdSplitting )
+    if (mbKbdSplitting)
     {
         LineInfo aInfo( LINE_DASH );
         //aInfo.SetDashLen( 2 );
@@ -714,11 +714,11 @@ void Splitter::Paint( vcl::RenderContext& /*rRenderContext*/, const Rectangle& r
         aInfo.SetDotLen( 2 );
         aInfo.SetDotCount( 3 );
 
-        DrawPolyLine( aPoly, aInfo );
+        rRenderContext.DrawPolyLine( aPoly, aInfo );
     }
     else
     {
-        DrawRect( rPaintRect );
+        rRenderContext.DrawRect(rPaintRect);
     }
 }
 
commit 8249185603786c8ba9cd8d584f9ce76f1d5186e2
Author: Jan Holesovsky <kendy at collabora.com>
Date:   Sun May 24 01:59:01 2015 +0200

    rendercontext: Improve comboboxes in the double-buffered toolbar.
    
    Change-Id: I91bfb4ea4672ff09482679f8fcf18a65e5a6ee3c

diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx
index 681f3c2..3c32778 100644
--- a/vcl/source/control/edit.cxx
+++ b/vcl/source/control/edit.cxx
@@ -606,7 +606,7 @@ void Edit::ImplRepaint(vcl::RenderContext& rRenderContext, bool bLayout)
         }
         // draw normal text
         Color aNormalTextColor = rRenderContext.GetTextColor();
-        SetClipRegion(aNormalClipRegion);
+        rRenderContext.SetClipRegion(aNormalClipRegion);
 
         if (IsPaintTransparent())
             rRenderContext.SetTextFillColor();
@@ -1027,6 +1027,10 @@ void Edit::ImplClearBackground(vcl::RenderContext& rRenderContext, long nXStart,
 
 void Edit::ImplPaintBorder(vcl::RenderContext& rRenderContext, long nXStart, long nXEnd)
 {
+    // this is not needed when double-buffering
+    if (SupportsDoubleBuffering())
+        return;
+
     Point aTmpPoint;
     Rectangle aRect(aTmpPoint, GetOutputSizePixel());
     aRect.Left() = nXStart;
commit 5988d7418065454737996e5021d3558df4498dfe
Author: Jan Holesovsky <kendy at collabora.com>
Date:   Sun May 24 01:04:07 2015 +0200

    rendercontext: Fix border window's painting to work well with rendercontext.
    
    This partially fixes rendering of comboboxes.
    
    Change-Id: I243f63a0cd83bb435876d3954a073df0acd54c58

diff --git a/vcl/source/window/brdwin.cxx b/vcl/source/window/brdwin.cxx
index f35998c..0d6ab4e 100644
--- a/vcl/source/window/brdwin.cxx
+++ b/vcl/source/window/brdwin.cxx
@@ -637,16 +637,11 @@ void ImplSmallBorderWindowView::DrawWindow(vcl::RenderContext& rRenderContext, s
     bool bNativeOK = false;
     // for native widget drawing we must find out what
     // control this border belongs to
-    // FIXME RenderContext - ultimately we'll need to get rid of the
-    // vcl::Window here to get native widgets here
-    vcl::Window* pWin = NULL;
-    vcl::Window* pCtrl = NULL;
-    if (rRenderContext.GetOutDevType() == OUTDEV_WINDOW)
-        pWin = static_cast<vcl::Window*>(&rRenderContext);
+    vcl::Window* pCtrl = mpBorderWindow->GetWindow(GetWindowType::Client);
 
     ControlType aCtrlType = 0;
     ControlPart aCtrlPart = PART_ENTIRE_CONTROL;
-    if (pWin && (pCtrl = mpBorderWindow->GetWindow(GetWindowType::Client)) != NULL)
+    if (pCtrl)
     {
         switch (pCtrl->GetType())
         {
@@ -714,9 +709,9 @@ void ImplSmallBorderWindowView::DrawWindow(vcl::RenderContext& rRenderContext, s
         ImplControlValue aControlValue;
         ControlState nState = ControlState::ENABLED;
 
-        if (!pWin->IsEnabled())
+        if (!mpBorderWindow->IsEnabled())
             nState &= ~ControlState::ENABLED;
-        if (pWin->HasFocus())
+        if (mpBorderWindow->HasFocus())
             nState |= ControlState::FOCUSED;
         else if(mbNWFBorder)
         {
@@ -782,7 +777,7 @@ void ImplSmallBorderWindowView::DrawWindow(vcl::RenderContext& rRenderContext, s
         if (nBorderStyle & WindowBorderStyle::MENU)
             nFlags |= DrawFrameFlags::Menu;
         // tell DrawFrame that we're drawing a window border of a frame window to avoid round corners
-        if (pWin && pWin == pWin->ImplGetFrameWindow())
+        if (mpBorderWindow == mpBorderWindow->ImplGetFrameWindow())
             nFlags |= DrawFrameFlags::WindowBorder;
 
         DecorationView aDecoView(&rRenderContext);
commit 2ded7898fe35aeff910075f7138e01ad82a82e9b
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Sat May 23 10:44:49 2015 +0100

    loplugin:staticmethods
    
    Change-Id: I20dac7fb627ec202558ed8be4e043bc01837b333
    Signed-off-by: Jan Holesovsky <kendy at collabora.com>

diff --git a/vcl/inc/brdwin.hxx b/vcl/inc/brdwin.hxx
index de911ff..d00ca1b 100644
--- a/vcl/inc/brdwin.hxx
+++ b/vcl/inc/brdwin.hxx
@@ -235,7 +235,6 @@ public:
     static sal_uInt16       ImplHitTest( ImplBorderFrameData* pData, const Point& rPos );
     static bool             ImplMouseMove( ImplBorderFrameData* pData, const MouseEvent& rMEvt );
     bool                    ImplMouseButtonDown( ImplBorderFrameData* pData, const MouseEvent& rMEvt );
-    bool                    ImplTracking( ImplBorderFrameData* pData, const TrackingEvent& rTEvt );
     static OUString         ImplRequestHelp( ImplBorderFrameData* pData, const Point& rPos, Rectangle& rHelpRect );
     static long             ImplCalcTitleWidth( const ImplBorderFrameData* pData );
 };
diff --git a/vcl/source/window/brdwin.cxx b/vcl/source/window/brdwin.cxx
index a282c5a..f35998c 100644
--- a/vcl/source/window/brdwin.cxx
+++ b/vcl/source/window/brdwin.cxx
@@ -327,611 +327,58 @@ bool ImplBorderWindowView::ImplMouseMove( ImplBorderFrameData* pData, const Mous
     return true;
 }
 
-bool ImplBorderWindowView::ImplMouseButtonDown( ImplBorderFrameData* pData, const MouseEvent& rMEvt )
-{
-    ImplBorderWindow* pBorderWindow = pData->mpBorderWindow;
-
-    if ( rMEvt.IsLeft() || rMEvt.IsRight() )
-    {
-        pData->maMouseOff = rMEvt.GetPosPixel();
-        pData->mnHitTest = ImplHitTest( pData, pData->maMouseOff );
-        if ( pData->mnHitTest )
-        {
-            DragFullOptions nDragFullTest = DragFullOptions::NONE;
-            bool bTracking = true;
-            bool bHitTest = true;
-
-            if ( pData->mnHitTest & BORDERWINDOW_HITTEST_CLOSE )
-            {
-                pData->mnCloseState |= DrawButtonFlags::Pressed;
-                pBorderWindow->InvalidateBorder();
-            }
-            else if ( pData->mnHitTest & BORDERWINDOW_HITTEST_ROLL )
-            {
-                pData->mnRollState |= DrawButtonFlags::Pressed;
-                pBorderWindow->InvalidateBorder();
-            }
-            else if ( pData->mnHitTest & BORDERWINDOW_HITTEST_DOCK )
-            {
-                pData->mnDockState |= DrawButtonFlags::Pressed;
-                pBorderWindow->InvalidateBorder();
-            }
-            else if ( pData->mnHitTest & BORDERWINDOW_HITTEST_MENU )
-            {
-                pData->mnMenuState |= DrawButtonFlags::Pressed;
-                pBorderWindow->InvalidateBorder();
-
-                // call handler already on mouse down
-                if ( pBorderWindow->ImplGetClientWindow()->IsSystemWindow() )
-                {
-                    SystemWindow* pClientWindow = static_cast<SystemWindow*>(pBorderWindow->ImplGetClientWindow());
-                    pClientWindow->TitleButtonClick( TitleButton::Menu );
-                }
-            }
-            else if ( pData->mnHitTest & BORDERWINDOW_HITTEST_HIDE )
-            {
-                pData->mnHideState |= DrawButtonFlags::Pressed;
-                pBorderWindow->InvalidateBorder();
-            }
-            else if ( pData->mnHitTest & BORDERWINDOW_HITTEST_HELP )
-            {
-                pData->mnHelpState |= DrawButtonFlags::Pressed;
-                pBorderWindow->InvalidateBorder();
-            }
-            else if ( pData->mnHitTest & BORDERWINDOW_HITTEST_PIN )
-            {
-                pData->mnPinState |= DrawButtonFlags::Pressed;
-                pBorderWindow->InvalidateBorder();
-            }
-            else
-            {
-                if ( rMEvt.GetClicks() == 1 )
-                {
-                    if ( bTracking )
-                    {
-                        Point   aPos         = pBorderWindow->GetPosPixel();
-                        Size    aSize        = pBorderWindow->GetOutputSizePixel();
-                        pData->mnTrackX      = aPos.X();
-                        pData->mnTrackY      = aPos.Y();
-                        pData->mnTrackWidth  = aSize.Width();
-                        pData->mnTrackHeight = aSize.Height();
-
-                        if ( pData->mnHitTest & BORDERWINDOW_HITTEST_TITLE )
-                            nDragFullTest = DragFullOptions::WindowMove;
-                        else
-                            nDragFullTest = DragFullOptions::WindowSize;
-                    }
-                }
-                else
-                {
-                    bTracking = false;
-
-                    if ( (pData->mnHitTest & BORDERWINDOW_DRAW_TITLE) &&
-                         ((rMEvt.GetClicks() % 2) == 0) )
-                    {
-                        pData->mnHitTest = 0;
-                        bHitTest = false;
-
-                        if ( pBorderWindow->ImplGetClientWindow()->IsSystemWindow() )
-                        {
-                            SystemWindow* pClientWindow = static_cast<SystemWindow*>(pBorderWindow->ImplGetClientWindow());
-                            if ( true /*pBorderWindow->mbDockBtn*/ )   // always perform docking on double click, no button required
-                                pClientWindow->TitleButtonClick( TitleButton::Docking );
-                            else if ( pBorderWindow->GetStyle() & WB_ROLLABLE )
-                            {
-                                if ( pClientWindow->IsRollUp() )
-                                    pClientWindow->RollDown();
-                                else
-                                    pClientWindow->RollUp();
-                                pClientWindow->Roll();
-                            }
-                        }
-                    }
-                }
-            }
-
-            if ( bTracking )
-            {
-                pData->mbDragFull = false;
-                if ( nDragFullTest != DragFullOptions::NONE )
-                    pData->mbDragFull = true;   // always fulldrag for proper docking, ignore system settings
-                pBorderWindow->StartTracking();
-            }
-            else if ( bHitTest )
-                pData->mnHitTest = 0;
-        }
-    }
-
-    return true;
-}
-
-bool ImplBorderWindowView::ImplTracking( ImplBorderFrameData* pData, const TrackingEvent& rTEvt )
+OUString ImplBorderWindowView::ImplRequestHelp( ImplBorderFrameData* pData,
+                                              const Point& rPos,
+                                              Rectangle& rHelpRect )
 {
-    ImplBorderWindow* pBorderWindow = pData->mpBorderWindow;
-
-    if ( rTEvt.IsTrackingEnded() )
+    sal_uInt16 nHelpId = 0;
+    OUString aHelpStr;
+    sal_uInt16 nHitTest = ImplHitTest( pData, rPos );
+    if ( nHitTest )
     {
-        sal_uInt16 nHitTest = pData->mnHitTest;
-        pData->mnHitTest = 0;
-
         if ( nHitTest & BORDERWINDOW_HITTEST_CLOSE )
         {
-            if ( pData->mnCloseState & DrawButtonFlags::Pressed )
-            {
-                pData->mnCloseState &= ~DrawButtonFlags::Pressed;
-                pBorderWindow->InvalidateBorder();
-
-                // do not call a Click-Handler when aborting
-                if ( !rTEvt.IsTrackingCanceled() )
-                {
-                    // dispatch to correct window type (why is Close() not virtual ??? )
-                    // TODO: make Close() virtual
-                    vcl::Window *pWin = pBorderWindow->ImplGetClientWindow()->ImplGetWindow();
-                    SystemWindow  *pSysWin  = dynamic_cast<SystemWindow* >(pWin);
-                    DockingWindow *pDockWin = dynamic_cast<DockingWindow*>(pWin);
-                    if ( pSysWin )
-                        pSysWin->Close();
-                    else if ( pDockWin )
-                        pDockWin->Close();
-                }
-            }
+            nHelpId     = SV_HELPTEXT_CLOSE;
+            rHelpRect   = pData->maCloseRect;
         }
         else if ( nHitTest & BORDERWINDOW_HITTEST_ROLL )
         {
-            if ( pData->mnRollState & DrawButtonFlags::Pressed )
-            {
-                pData->mnRollState &= ~DrawButtonFlags::Pressed;
-                pBorderWindow->InvalidateBorder();
-
-                // do not call a Click-Handler when aborting
-                if ( !rTEvt.IsTrackingCanceled() )
-                {
-                    if ( pBorderWindow->ImplGetClientWindow()->IsSystemWindow() )
-                    {
-                        SystemWindow* pClientWindow = static_cast<SystemWindow*>(pBorderWindow->ImplGetClientWindow());
-                        if ( pClientWindow->IsRollUp() )
-                            pClientWindow->RollDown();
-                        else
-                            pClientWindow->RollUp();
-                        pClientWindow->Roll();
-                    }
-                }
-            }
+            if ( pData->mpBorderWindow->mbRollUp )
+                nHelpId = SV_HELPTEXT_ROLLDOWN;
+            else
+                nHelpId = SV_HELPTEXT_ROLLUP;
+            rHelpRect   = pData->maRollRect;
         }
         else if ( nHitTest & BORDERWINDOW_HITTEST_DOCK )
         {
-            if ( pData->mnDockState & DrawButtonFlags::Pressed )
-            {
-                pData->mnDockState &= ~DrawButtonFlags::Pressed;
-                pBorderWindow->InvalidateBorder();
-
-                // do not call a Click-Handler when aborting
-                if ( !rTEvt.IsTrackingCanceled() )
-                {
-                    if ( pBorderWindow->ImplGetClientWindow()->IsSystemWindow() )
-                    {
-                        SystemWindow* pClientWindow = static_cast<SystemWindow*>(pBorderWindow->ImplGetClientWindow());
-                        pClientWindow->TitleButtonClick( TitleButton::Docking );
-                    }
-                }
-            }
-        }
-        else if ( nHitTest & BORDERWINDOW_HITTEST_MENU )
-        {
-            if ( pData->mnMenuState & DrawButtonFlags::Pressed )
-            {
-                pData->mnMenuState &= ~DrawButtonFlags::Pressed;
-                pBorderWindow->InvalidateBorder();
-
-                // handler already called on mouse down
-            }
+            nHelpId     = SV_HELPTEXT_MAXIMIZE;
+            rHelpRect   = pData->maDockRect;
         }
         else if ( nHitTest & BORDERWINDOW_HITTEST_HIDE )
         {
-            if ( pData->mnHideState & DrawButtonFlags::Pressed )
-            {
-                pData->mnHideState &= ~DrawButtonFlags::Pressed;
-                pBorderWindow->InvalidateBorder();
-
-                // do not call a Click-Handler when aborting
-                if ( !rTEvt.IsTrackingCanceled() )
-                {
-                    if ( pBorderWindow->ImplGetClientWindow()->IsSystemWindow() )
-                    {
-                        SystemWindow* pClientWindow = static_cast<SystemWindow*>(pBorderWindow->ImplGetClientWindow());
-                        pClientWindow->TitleButtonClick( TitleButton::Hide );
-                    }
-                }
-            }
+            nHelpId     = SV_HELPTEXT_MINIMIZE;
+            rHelpRect   = pData->maHideRect;
         }
         else if ( nHitTest & BORDERWINDOW_HITTEST_HELP )
         {
-            if ( pData->mnHelpState & DrawButtonFlags::Pressed )
-            {
-                pData->mnHelpState &= ~DrawButtonFlags::Pressed;
-                pBorderWindow->InvalidateBorder();
-
-                // do not call a Click-Handler when aborting
-                if ( !rTEvt.IsTrackingCanceled() )
-                {
-                }
-            }
+            nHelpId     = SV_HELPTEXT_HELP;
+            rHelpRect   = pData->maHelpRect;
         }
         else if ( nHitTest & BORDERWINDOW_HITTEST_PIN )
         {
-            if ( pData->mnPinState & DrawButtonFlags::Pressed )
-            {
-                pData->mnPinState &= ~DrawButtonFlags::Pressed;
-                pBorderWindow->InvalidateBorder();
-
-                // do not call a Click-Handler when aborting
-                if ( !rTEvt.IsTrackingCanceled() )
-                {
-                    if ( pBorderWindow->ImplGetClientWindow()->IsSystemWindow() )
-                    {
-                        SystemWindow* pClientWindow = static_cast<SystemWindow*>(pBorderWindow->ImplGetClientWindow());
-                        pClientWindow->SetPin( !pClientWindow->IsPinned() );
-                        pClientWindow->Pin();
-                    }
-                }
-            }
+            nHelpId     = SV_HELPTEXT_ALWAYSVISIBLE;
+            rHelpRect   = pData->maPinRect;
         }
-        else
+        else if ( nHitTest & BORDERWINDOW_HITTEST_TITLE )
         {
-            if ( pData->mbDragFull )
-            {
-                // restore old state when aborting
-                if ( rTEvt.IsTrackingCanceled() )
-                    pBorderWindow->SetPosSizePixel( Point( pData->mnTrackX, pData->mnTrackY ), Size( pData->mnTrackWidth, pData->mnTrackHeight ) );
-            }
-            else
-            {
-                pBorderWindow->HideTracking();
-                if ( !rTEvt.IsTrackingCanceled() )
-                    pBorderWindow->SetPosSizePixel( Point( pData->mnTrackX, pData->mnTrackY ), Size( pData->mnTrackWidth, pData->mnTrackHeight ) );
-            }
-
-            if ( !rTEvt.IsTrackingCanceled() )
+            if( !pData->maTitleRect.IsEmpty() )
             {
-                if ( pBorderWindow->ImplGetClientWindow()->ImplIsFloatingWindow() )
+                // tooltip only if title truncated
+                if( pData->mbTitleClipped )
                 {
-                    if ( static_cast<FloatingWindow*>(pBorderWindow->ImplGetClientWindow())->IsInPopupMode() )
-                        static_cast<FloatingWindow*>(pBorderWindow->ImplGetClientWindow())->EndPopupMode( FloatWinPopupEndFlags::TearOff );
-                }
-            }
-        }
-    }
-    else if ( !rTEvt.GetMouseEvent().IsSynthetic() )
-    {
-        Point aMousePos = rTEvt.GetMouseEvent().GetPosPixel();
-
-        if ( pData->mnHitTest & BORDERWINDOW_HITTEST_CLOSE )
-        {
-            if ( pData->maCloseRect.IsInside( aMousePos ) )
-            {
-                if ( !(pData->mnCloseState & DrawButtonFlags::Pressed) )
-                {
-                    pData->mnCloseState |= DrawButtonFlags::Pressed;
-                    pBorderWindow->InvalidateBorder();
-                }
-            }
-            else
-            {
-                if ( pData->mnCloseState & DrawButtonFlags::Pressed )
-                {
-                    pData->mnCloseState &= ~DrawButtonFlags::Pressed;
-                    pBorderWindow->InvalidateBorder();
-                }
-            }
-        }
-        else if ( pData->mnHitTest & BORDERWINDOW_HITTEST_ROLL )
-        {
-            if ( pData->maRollRect.IsInside( aMousePos ) )
-            {
-                if ( !(pData->mnRollState & DrawButtonFlags::Pressed) )
-                {
-                    pData->mnRollState |= DrawButtonFlags::Pressed;
-                    pBorderWindow->InvalidateBorder();
-                }
-            }
-            else
-            {
-                if ( pData->mnRollState & DrawButtonFlags::Pressed )
-                {
-                    pData->mnRollState &= ~DrawButtonFlags::Pressed;
-                    pBorderWindow->InvalidateBorder();
-                }
-            }
-        }
-        else if ( pData->mnHitTest & BORDERWINDOW_HITTEST_DOCK )
-        {
-            if ( pData->maDockRect.IsInside( aMousePos ) )
-            {
-                if ( !(pData->mnDockState & DrawButtonFlags::Pressed) )
-                {
-                    pData->mnDockState |= DrawButtonFlags::Pressed;
-                    pBorderWindow->InvalidateBorder();
-                }
-            }
-            else
-            {
-                if ( pData->mnDockState & DrawButtonFlags::Pressed )
-                {
-                    pData->mnDockState &= ~DrawButtonFlags::Pressed;
-                    pBorderWindow->InvalidateBorder();
-                }
-            }
-        }
-        else if ( pData->mnHitTest & BORDERWINDOW_HITTEST_MENU )
-        {
-            if ( pData->maMenuRect.IsInside( aMousePos ) )
-            {
-                if ( !(pData->mnMenuState & DrawButtonFlags::Pressed) )
-                {
-                    pData->mnMenuState |= DrawButtonFlags::Pressed;
-                    pBorderWindow->InvalidateBorder();
-                }
-            }
-            else
-            {
-                if ( pData->mnMenuState & DrawButtonFlags::Pressed )
-                {
-                    pData->mnMenuState &= ~DrawButtonFlags::Pressed;
-                    pBorderWindow->InvalidateBorder();
-                }
-            }
-        }
-        else if ( pData->mnHitTest & BORDERWINDOW_HITTEST_HIDE )
-        {
-            if ( pData->maHideRect.IsInside( aMousePos ) )
-            {
-                if ( !(pData->mnHideState & DrawButtonFlags::Pressed) )
-                {
-                    pData->mnHideState |= DrawButtonFlags::Pressed;
-                    pBorderWindow->InvalidateBorder();
-                }
-            }
-            else
-            {
-                if ( pData->mnHideState & DrawButtonFlags::Pressed )
-                {
-                    pData->mnHideState &= ~DrawButtonFlags::Pressed;
-                    pBorderWindow->InvalidateBorder();
-                }
-            }
-        }
-        else if ( pData->mnHitTest & BORDERWINDOW_HITTEST_HELP )
-        {
-            if ( pData->maHelpRect.IsInside( aMousePos ) )
-            {
-                if ( !(pData->mnHelpState & DrawButtonFlags::Pressed) )
-                {
-                    pData->mnHelpState |= DrawButtonFlags::Pressed;
-                    pBorderWindow->InvalidateBorder();
-                }
-            }
-            else
-            {
-                if ( pData->mnHelpState & DrawButtonFlags::Pressed )
-                {
-                    pData->mnHelpState &= ~DrawButtonFlags::Pressed;
-                    pBorderWindow->InvalidateBorder();
-                }
-            }
-        }
-        else if ( pData->mnHitTest & BORDERWINDOW_HITTEST_PIN )
-        {
-            if ( pData->maPinRect.IsInside( aMousePos ) )
-            {
-                if ( !(pData->mnPinState & DrawButtonFlags::Pressed) )
-                {
-                    pData->mnPinState |= DrawButtonFlags::Pressed;
-                    pBorderWindow->InvalidateBorder();
-                }
-            }
-            else
-            {
-                if ( pData->mnPinState & DrawButtonFlags::Pressed )
-                {
-                    pData->mnPinState &= ~DrawButtonFlags::Pressed;
-                    pBorderWindow->InvalidateBorder();
-                }
-            }
-        }
-        else
-        {
-            aMousePos.X()    -= pData->maMouseOff.X();
-            aMousePos.Y()    -= pData->maMouseOff.Y();
-
-            if ( pData->mnHitTest & BORDERWINDOW_HITTEST_TITLE )
-            {
-                pData->mpBorderWindow->SetPointer( Pointer( PointerStyle::Move ) );
-
-                Point aPos = pBorderWindow->GetPosPixel();
-                aPos.X() += aMousePos.X();
-                aPos.Y() += aMousePos.Y();
-                if ( pData->mbDragFull )
-                {
-                    pBorderWindow->SetPosPixel( aPos );
-                    pBorderWindow->ImplUpdateAll();
-                    pBorderWindow->ImplGetFrameWindow()->ImplUpdateAll();
-                }
-                else
-                {
-                    pData->mnTrackX = aPos.X();
-                    pData->mnTrackY = aPos.Y();
-                    pBorderWindow->ShowTracking( Rectangle( pBorderWindow->ScreenToOutputPixel( aPos ), pBorderWindow->GetOutputSizePixel() ), SHOWTRACK_BIG );
-                }
-            }
-            else
-            {
-                Point       aOldPos         = pBorderWindow->GetPosPixel();
-                Size        aSize           = pBorderWindow->GetSizePixel();
-                Rectangle   aNewRect( aOldPos, aSize );
-                long        nOldWidth       = aSize.Width();
-                long        nOldHeight      = aSize.Height();
-                long        nBorderWidth    = pData->mnLeftBorder+pData->mnRightBorder;
-                long        nBorderHeight   = pData->mnTopBorder+pData->mnBottomBorder;
-                long        nMinWidth       = pBorderWindow->mnMinWidth+nBorderWidth;
-                long        nMinHeight      = pBorderWindow->mnMinHeight+nBorderHeight;
-                long        nMinWidth2      = nBorderWidth;
-                long        nMaxWidth       = pBorderWindow->mnMaxWidth+nBorderWidth;
-                long        nMaxHeight      = pBorderWindow->mnMaxHeight+nBorderHeight;
-
-                if ( pData->mnTitleHeight )
-                {
-                    nMinWidth2 += 4;
-
-                    if ( pBorderWindow->GetStyle() & WB_CLOSEABLE )
-                        nMinWidth2 += pData->maCloseRect.GetWidth();
-                }
-                if ( nMinWidth2 > nMinWidth )
-                    nMinWidth = nMinWidth2;
-                if ( pData->mnHitTest & (BORDERWINDOW_HITTEST_LEFT | BORDERWINDOW_HITTEST_TOPLEFT | BORDERWINDOW_HITTEST_BOTTOMLEFT) )
-                {
-                    aNewRect.Left() += aMousePos.X();
-                    if ( aNewRect.GetWidth() < nMinWidth )
-                        aNewRect.Left() = aNewRect.Right()-nMinWidth+1;
-                    else if ( aNewRect.GetWidth() > nMaxWidth )
-                        aNewRect.Left() = aNewRect.Right()-nMaxWidth+1;
-                }
-                else if ( pData->mnHitTest & (BORDERWINDOW_HITTEST_RIGHT | BORDERWINDOW_HITTEST_TOPRIGHT | BORDERWINDOW_HITTEST_BOTTOMRIGHT) )
-                {
-                    aNewRect.Right() += aMousePos.X();
-                    if ( aNewRect.GetWidth() < nMinWidth )
-                        aNewRect.Right() = aNewRect.Left()+nMinWidth+1;
-                    else if ( aNewRect.GetWidth() > nMaxWidth )
-                        aNewRect.Right() = aNewRect.Left()+nMaxWidth+1;
-                }
-                if ( pData->mnHitTest & (BORDERWINDOW_HITTEST_TOP | BORDERWINDOW_HITTEST_TOPLEFT | BORDERWINDOW_HITTEST_TOPRIGHT) )
-                {
-                    aNewRect.Top() += aMousePos.Y();
-                    if ( aNewRect.GetHeight() < nMinHeight )
-                        aNewRect.Top() = aNewRect.Bottom()-nMinHeight+1;
-                    else if ( aNewRect.GetHeight() > nMaxHeight )
-                        aNewRect.Top() = aNewRect.Bottom()-nMaxHeight+1;
-                }
-                else if ( pData->mnHitTest & (BORDERWINDOW_HITTEST_BOTTOM | BORDERWINDOW_HITTEST_BOTTOMLEFT | BORDERWINDOW_HITTEST_BOTTOMRIGHT) )
-                {
-                    aNewRect.Bottom() += aMousePos.Y();
-                    if ( aNewRect.GetHeight() < nMinHeight )
-                        aNewRect.Bottom() = aNewRect.Top()+nMinHeight+1;
-                    else if ( aNewRect.GetHeight() > nMaxHeight )
-                        aNewRect.Bottom() = aNewRect.Top()+nMaxHeight+1;
-                }
-
-                // call Resizing-Handler for SystemWindows
-                if ( pBorderWindow->ImplGetClientWindow()->IsSystemWindow() )
-                {
-                    // adjust size for Resizing-call
-                    aSize = aNewRect.GetSize();
-                    aSize.Width()   -= nBorderWidth;
-                    aSize.Height()  -= nBorderHeight;
-                    static_cast<SystemWindow*>(pBorderWindow->ImplGetClientWindow())->Resizing( aSize );
-                    aSize.Width()   += nBorderWidth;
-                    aSize.Height()  += nBorderHeight;
-                    if ( aSize.Width() < nMinWidth )
-                        aSize.Width() = nMinWidth;
-                    if ( aSize.Height() < nMinHeight )
-                        aSize.Height() = nMinHeight;
-                    if ( aSize.Width() > nMaxWidth )
-                        aSize.Width() = nMaxWidth;
-                    if ( aSize.Height() > nMaxHeight )
-                        aSize.Height() = nMaxHeight;
-                    if ( pData->mnHitTest & (BORDERWINDOW_HITTEST_LEFT | BORDERWINDOW_HITTEST_TOPLEFT | BORDERWINDOW_HITTEST_BOTTOMLEFT) )
-                        aNewRect.Left() = aNewRect.Right()-aSize.Width()+1;
-                    else
-                        aNewRect.Right() = aNewRect.Left()+aSize.Width()-1;
-                    if ( pData->mnHitTest & (BORDERWINDOW_HITTEST_TOP | BORDERWINDOW_HITTEST_TOPLEFT | BORDERWINDOW_HITTEST_TOPRIGHT) )
-                        aNewRect.Top() = aNewRect.Bottom()-aSize.Height()+1;
-                    else
-                        aNewRect.Bottom() = aNewRect.Top()+aSize.Height()-1;
-                }
-
-                if ( pData->mbDragFull )
-                {
-                    // no move (only resize) if position did not change
-                    if( aOldPos != aNewRect.TopLeft() )
-                        pBorderWindow->setPosSizePixel( aNewRect.Left(), aNewRect.Top(),
-                                                    aNewRect.GetWidth(), aNewRect.GetHeight(), PosSizeFlags::PosSize );
-                    else
-                        pBorderWindow->setPosSizePixel( aNewRect.Left(), aNewRect.Top(),
-                                                    aNewRect.GetWidth(), aNewRect.GetHeight(), PosSizeFlags::Size );
-
-                    pBorderWindow->ImplUpdateAll();
-                    pBorderWindow->ImplGetFrameWindow()->ImplUpdateAll();
-                    if ( pData->mnHitTest & (BORDERWINDOW_HITTEST_RIGHT | BORDERWINDOW_HITTEST_TOPRIGHT | BORDERWINDOW_HITTEST_BOTTOMRIGHT) )
-                        pData->maMouseOff.X() += aNewRect.GetWidth()-nOldWidth;
-                    if ( pData->mnHitTest & (BORDERWINDOW_HITTEST_BOTTOM | BORDERWINDOW_HITTEST_BOTTOMLEFT | BORDERWINDOW_HITTEST_BOTTOMRIGHT) )
-                        pData->maMouseOff.Y() += aNewRect.GetHeight()-nOldHeight;
-                }
-                else
-                {
-                    pData->mnTrackX        = aNewRect.Left();
-                    pData->mnTrackY        = aNewRect.Top();
-                    pData->mnTrackWidth    = aNewRect.GetWidth();
-                    pData->mnTrackHeight   = aNewRect.GetHeight();
-                    pBorderWindow->ShowTracking( Rectangle( pBorderWindow->ScreenToOutputPixel( aNewRect.TopLeft() ), aNewRect.GetSize() ), SHOWTRACK_BIG );
-                }
-            }
-        }
-    }
-
-    return true;
-}
-
-OUString ImplBorderWindowView::ImplRequestHelp( ImplBorderFrameData* pData,
-                                              const Point& rPos,
-                                              Rectangle& rHelpRect )
-{
-    sal_uInt16 nHelpId = 0;
-    OUString aHelpStr;
-    sal_uInt16 nHitTest = ImplHitTest( pData, rPos );
-    if ( nHitTest )
-    {
-        if ( nHitTest & BORDERWINDOW_HITTEST_CLOSE )
-        {
-            nHelpId     = SV_HELPTEXT_CLOSE;
-            rHelpRect   = pData->maCloseRect;
-        }
-        else if ( nHitTest & BORDERWINDOW_HITTEST_ROLL )
-        {
-            if ( pData->mpBorderWindow->mbRollUp )
-                nHelpId = SV_HELPTEXT_ROLLDOWN;
-            else
-                nHelpId = SV_HELPTEXT_ROLLUP;
-            rHelpRect   = pData->maRollRect;
-        }
-        else if ( nHitTest & BORDERWINDOW_HITTEST_DOCK )
-        {
-            nHelpId     = SV_HELPTEXT_MAXIMIZE;
-            rHelpRect   = pData->maDockRect;
-        }
-        else if ( nHitTest & BORDERWINDOW_HITTEST_HIDE )
-        {
-            nHelpId     = SV_HELPTEXT_MINIMIZE;
-            rHelpRect   = pData->maHideRect;
-        }
-        else if ( nHitTest & BORDERWINDOW_HITTEST_HELP )
-        {
-            nHelpId     = SV_HELPTEXT_HELP;
-            rHelpRect   = pData->maHelpRect;
-        }
-        else if ( nHitTest & BORDERWINDOW_HITTEST_PIN )
-        {
-            nHelpId     = SV_HELPTEXT_ALWAYSVISIBLE;
-            rHelpRect   = pData->maPinRect;
-        }
-        else if ( nHitTest & BORDERWINDOW_HITTEST_TITLE )
-        {
-            if( !pData->maTitleRect.IsEmpty() )
-            {
-                // tooltip only if title truncated
-                if( pData->mbTitleClipped )
-                {
-                    rHelpRect   = pData->maTitleRect;
-                    // no help id, use window title as help string
-                    aHelpStr    = pData->mpBorderWindow->GetText();
+                    rHelpRect   = pData->maTitleRect;
+                    // no help id, use window title as help string
+                    aHelpStr    = pData->mpBorderWindow->GetText();
                 }
             }
         }
@@ -1378,12 +825,555 @@ bool ImplStdBorderWindowView::MouseMove( const MouseEvent& rMEvt )
 
 bool ImplStdBorderWindowView::MouseButtonDown( const MouseEvent& rMEvt )
 {
-    return ImplMouseButtonDown( &maFrameData, rMEvt );
-}
+    ImplBorderWindow* pBorderWindow = maFrameData.mpBorderWindow;
 
-bool ImplStdBorderWindowView::Tracking( const TrackingEvent& rTEvt )
-{
-    return ImplTracking( &maFrameData, rTEvt );
+    if ( rMEvt.IsLeft() || rMEvt.IsRight() )
+    {
+        maFrameData.maMouseOff = rMEvt.GetPosPixel();
+        maFrameData.mnHitTest = ImplHitTest( &maFrameData, maFrameData.maMouseOff );
+        if ( maFrameData.mnHitTest )
+        {
+            DragFullOptions nDragFullTest = DragFullOptions::NONE;
+            bool bTracking = true;
+            bool bHitTest = true;
+
+            if ( maFrameData.mnHitTest & BORDERWINDOW_HITTEST_CLOSE )
+            {
+                maFrameData.mnCloseState |= DrawButtonFlags::Pressed;
+                pBorderWindow->InvalidateBorder();
+            }
+            else if ( maFrameData.mnHitTest & BORDERWINDOW_HITTEST_ROLL )
+            {
+                maFrameData.mnRollState |= DrawButtonFlags::Pressed;
+                pBorderWindow->InvalidateBorder();
+            }
+            else if ( maFrameData.mnHitTest & BORDERWINDOW_HITTEST_DOCK )
+            {
+                maFrameData.mnDockState |= DrawButtonFlags::Pressed;
+                pBorderWindow->InvalidateBorder();
+            }
+            else if ( maFrameData.mnHitTest & BORDERWINDOW_HITTEST_MENU )
+            {
+                maFrameData.mnMenuState |= DrawButtonFlags::Pressed;
+                pBorderWindow->InvalidateBorder();
+
+                // call handler already on mouse down
+                if ( pBorderWindow->ImplGetClientWindow()->IsSystemWindow() )
+                {
+                    SystemWindow* pClientWindow = static_cast<SystemWindow*>(pBorderWindow->ImplGetClientWindow());
+                    pClientWindow->TitleButtonClick( TitleButton::Menu );
+                }
+            }
+            else if ( maFrameData.mnHitTest & BORDERWINDOW_HITTEST_HIDE )
+            {
+                maFrameData.mnHideState |= DrawButtonFlags::Pressed;
+                pBorderWindow->InvalidateBorder();
+            }
+            else if ( maFrameData.mnHitTest & BORDERWINDOW_HITTEST_HELP )
+            {
+                maFrameData.mnHelpState |= DrawButtonFlags::Pressed;
+                pBorderWindow->InvalidateBorder();
+            }
+            else if ( maFrameData.mnHitTest & BORDERWINDOW_HITTEST_PIN )
+            {
+                maFrameData.mnPinState |= DrawButtonFlags::Pressed;
+                pBorderWindow->InvalidateBorder();
+            }
+            else
+            {
+                if ( rMEvt.GetClicks() == 1 )
+                {
+                    if ( bTracking )
+                    {
+                        Point   aPos         = pBorderWindow->GetPosPixel();
+                        Size    aSize        = pBorderWindow->GetOutputSizePixel();
+                        maFrameData.mnTrackX      = aPos.X();
+                        maFrameData.mnTrackY      = aPos.Y();
+                        maFrameData.mnTrackWidth  = aSize.Width();
+                        maFrameData.mnTrackHeight = aSize.Height();
+
+                        if ( maFrameData.mnHitTest & BORDERWINDOW_HITTEST_TITLE )
+                            nDragFullTest = DragFullOptions::WindowMove;
+                        else
+                            nDragFullTest = DragFullOptions::WindowSize;
+                    }
+                }
+                else
+                {
+                    bTracking = false;
+
+                    if ( (maFrameData.mnHitTest & BORDERWINDOW_DRAW_TITLE) &&
+                         ((rMEvt.GetClicks() % 2) == 0) )
+                    {
+                        maFrameData.mnHitTest = 0;
+                        bHitTest = false;
+
+                        if ( pBorderWindow->ImplGetClientWindow()->IsSystemWindow() )
+                        {
+                            SystemWindow* pClientWindow = static_cast<SystemWindow*>(pBorderWindow->ImplGetClientWindow());
+                            if ( true /*pBorderWindow->mbDockBtn*/ )   // always perform docking on double click, no button required
+                                pClientWindow->TitleButtonClick( TitleButton::Docking );
+                            else if ( pBorderWindow->GetStyle() & WB_ROLLABLE )
+                            {
+                                if ( pClientWindow->IsRollUp() )
+                                    pClientWindow->RollDown();
+                                else
+                                    pClientWindow->RollUp();
+                                pClientWindow->Roll();
+                            }
+                        }
+                    }
+                }
+            }
+
+            if ( bTracking )
+            {
+                maFrameData.mbDragFull = false;
+                if ( nDragFullTest != DragFullOptions::NONE )
+                    maFrameData.mbDragFull = true;   // always fulldrag for proper docking, ignore system settings
+                pBorderWindow->StartTracking();
+            }
+            else if ( bHitTest )
+                maFrameData.mnHitTest = 0;
+        }
+    }
+
+    return true;
+}
+
+bool ImplStdBorderWindowView::Tracking( const TrackingEvent& rTEvt )
+{
+    ImplBorderWindow* pBorderWindow = maFrameData.mpBorderWindow;
+
+    if ( rTEvt.IsTrackingEnded() )
+    {
+        sal_uInt16 nHitTest = maFrameData.mnHitTest;
+        maFrameData.mnHitTest = 0;
+
+        if ( nHitTest & BORDERWINDOW_HITTEST_CLOSE )
+        {
+            if ( maFrameData.mnCloseState & DrawButtonFlags::Pressed )
+            {
+                maFrameData.mnCloseState &= ~DrawButtonFlags::Pressed;
+                pBorderWindow->InvalidateBorder();
+
+                // do not call a Click-Handler when aborting
+                if ( !rTEvt.IsTrackingCanceled() )
+                {
+                    // dispatch to correct window type (why is Close() not virtual ??? )
+                    // TODO: make Close() virtual
+                    vcl::Window *pWin = pBorderWindow->ImplGetClientWindow()->ImplGetWindow();
+                    SystemWindow  *pSysWin  = dynamic_cast<SystemWindow* >(pWin);
+                    DockingWindow *pDockWin = dynamic_cast<DockingWindow*>(pWin);
+                    if ( pSysWin )
+                        pSysWin->Close();
+                    else if ( pDockWin )
+                        pDockWin->Close();
+                }
+            }
+        }
+        else if ( nHitTest & BORDERWINDOW_HITTEST_ROLL )
+        {
+            if ( maFrameData.mnRollState & DrawButtonFlags::Pressed )
+            {
+                maFrameData.mnRollState &= ~DrawButtonFlags::Pressed;
+                pBorderWindow->InvalidateBorder();
+
+                // do not call a Click-Handler when aborting
+                if ( !rTEvt.IsTrackingCanceled() )
+                {
+                    if ( pBorderWindow->ImplGetClientWindow()->IsSystemWindow() )
+                    {
+                        SystemWindow* pClientWindow = static_cast<SystemWindow*>(pBorderWindow->ImplGetClientWindow());
+                        if ( pClientWindow->IsRollUp() )
+                            pClientWindow->RollDown();
+                        else
+                            pClientWindow->RollUp();
+                        pClientWindow->Roll();
+                    }
+                }
+            }
+        }
+        else if ( nHitTest & BORDERWINDOW_HITTEST_DOCK )
+        {
+            if ( maFrameData.mnDockState & DrawButtonFlags::Pressed )
+            {
+                maFrameData.mnDockState &= ~DrawButtonFlags::Pressed;
+                pBorderWindow->InvalidateBorder();
+
+                // do not call a Click-Handler when aborting
+                if ( !rTEvt.IsTrackingCanceled() )
+                {
+                    if ( pBorderWindow->ImplGetClientWindow()->IsSystemWindow() )
+                    {
+                        SystemWindow* pClientWindow = static_cast<SystemWindow*>(pBorderWindow->ImplGetClientWindow());
+                        pClientWindow->TitleButtonClick( TitleButton::Docking );
+                    }
+                }
+            }
+        }
+        else if ( nHitTest & BORDERWINDOW_HITTEST_MENU )
+        {
+            if ( maFrameData.mnMenuState & DrawButtonFlags::Pressed )
+            {
+                maFrameData.mnMenuState &= ~DrawButtonFlags::Pressed;
+                pBorderWindow->InvalidateBorder();
+
+                // handler already called on mouse down
+            }
+        }
+        else if ( nHitTest & BORDERWINDOW_HITTEST_HIDE )
+        {
+            if ( maFrameData.mnHideState & DrawButtonFlags::Pressed )
+            {
+                maFrameData.mnHideState &= ~DrawButtonFlags::Pressed;
+                pBorderWindow->InvalidateBorder();
+
+                // do not call a Click-Handler when aborting
+                if ( !rTEvt.IsTrackingCanceled() )
+                {
+                    if ( pBorderWindow->ImplGetClientWindow()->IsSystemWindow() )
+                    {
+                        SystemWindow* pClientWindow = static_cast<SystemWindow*>(pBorderWindow->ImplGetClientWindow());
+                        pClientWindow->TitleButtonClick( TitleButton::Hide );
+                    }
+                }
+            }
+        }
+        else if ( nHitTest & BORDERWINDOW_HITTEST_HELP )
+        {
+            if ( maFrameData.mnHelpState & DrawButtonFlags::Pressed )
+            {
+                maFrameData.mnHelpState &= ~DrawButtonFlags::Pressed;
+                pBorderWindow->InvalidateBorder();
+
+                // do not call a Click-Handler when aborting
+                if ( !rTEvt.IsTrackingCanceled() )
+                {
+                }
+            }
+        }
+        else if ( nHitTest & BORDERWINDOW_HITTEST_PIN )
+        {
+            if ( maFrameData.mnPinState & DrawButtonFlags::Pressed )
+            {
+                maFrameData.mnPinState &= ~DrawButtonFlags::Pressed;
+                pBorderWindow->InvalidateBorder();
+
+                // do not call a Click-Handler when aborting
+                if ( !rTEvt.IsTrackingCanceled() )
+                {
+                    if ( pBorderWindow->ImplGetClientWindow()->IsSystemWindow() )
+                    {
+                        SystemWindow* pClientWindow = static_cast<SystemWindow*>(pBorderWindow->ImplGetClientWindow());
+                        pClientWindow->SetPin( !pClientWindow->IsPinned() );
+                        pClientWindow->Pin();
+                    }
+                }
+            }
+        }
+        else
+        {
+            if ( maFrameData.mbDragFull )
+            {
+                // restore old state when aborting
+                if ( rTEvt.IsTrackingCanceled() )
+                    pBorderWindow->SetPosSizePixel( Point( maFrameData.mnTrackX, maFrameData.mnTrackY ), Size( maFrameData.mnTrackWidth, maFrameData.mnTrackHeight ) );
+            }
+            else
+            {
+                pBorderWindow->HideTracking();
+                if ( !rTEvt.IsTrackingCanceled() )
+                    pBorderWindow->SetPosSizePixel( Point( maFrameData.mnTrackX, maFrameData.mnTrackY ), Size( maFrameData.mnTrackWidth, maFrameData.mnTrackHeight ) );
+            }
+
+            if ( !rTEvt.IsTrackingCanceled() )
+            {
+                if ( pBorderWindow->ImplGetClientWindow()->ImplIsFloatingWindow() )
+                {
+                    if ( static_cast<FloatingWindow*>(pBorderWindow->ImplGetClientWindow())->IsInPopupMode() )
+                        static_cast<FloatingWindow*>(pBorderWindow->ImplGetClientWindow())->EndPopupMode( FloatWinPopupEndFlags::TearOff );
+                }
+            }
+        }
+    }
+    else if ( !rTEvt.GetMouseEvent().IsSynthetic() )
+    {
+        Point aMousePos = rTEvt.GetMouseEvent().GetPosPixel();
+
+        if ( maFrameData.mnHitTest & BORDERWINDOW_HITTEST_CLOSE )
+        {
+            if ( maFrameData.maCloseRect.IsInside( aMousePos ) )
+            {
+                if ( !(maFrameData.mnCloseState & DrawButtonFlags::Pressed) )
+                {
+                    maFrameData.mnCloseState |= DrawButtonFlags::Pressed;
+                    pBorderWindow->InvalidateBorder();
+                }
+            }
+            else
+            {
+                if ( maFrameData.mnCloseState & DrawButtonFlags::Pressed )
+                {
+                    maFrameData.mnCloseState &= ~DrawButtonFlags::Pressed;
+                    pBorderWindow->InvalidateBorder();
+                }
+            }
+        }
+        else if ( maFrameData.mnHitTest & BORDERWINDOW_HITTEST_ROLL )
+        {
+            if ( maFrameData.maRollRect.IsInside( aMousePos ) )
+            {
+                if ( !(maFrameData.mnRollState & DrawButtonFlags::Pressed) )
+                {
+                    maFrameData.mnRollState |= DrawButtonFlags::Pressed;
+                    pBorderWindow->InvalidateBorder();
+                }
+            }
+            else
+            {
+                if ( maFrameData.mnRollState & DrawButtonFlags::Pressed )
+                {
+                    maFrameData.mnRollState &= ~DrawButtonFlags::Pressed;
+                    pBorderWindow->InvalidateBorder();
+                }
+            }
+        }
+        else if ( maFrameData.mnHitTest & BORDERWINDOW_HITTEST_DOCK )
+        {
+            if ( maFrameData.maDockRect.IsInside( aMousePos ) )
+            {
+                if ( !(maFrameData.mnDockState & DrawButtonFlags::Pressed) )
+                {
+                    maFrameData.mnDockState |= DrawButtonFlags::Pressed;
+                    pBorderWindow->InvalidateBorder();
+                }
+            }
+            else
+            {
+                if ( maFrameData.mnDockState & DrawButtonFlags::Pressed )
+                {
+                    maFrameData.mnDockState &= ~DrawButtonFlags::Pressed;
+                    pBorderWindow->InvalidateBorder();
+                }
+            }
+        }
+        else if ( maFrameData.mnHitTest & BORDERWINDOW_HITTEST_MENU )
+        {
+            if ( maFrameData.maMenuRect.IsInside( aMousePos ) )
+            {
+                if ( !(maFrameData.mnMenuState & DrawButtonFlags::Pressed) )
+                {
+                    maFrameData.mnMenuState |= DrawButtonFlags::Pressed;
+                    pBorderWindow->InvalidateBorder();
+                }
+            }
+            else
+            {
+                if ( maFrameData.mnMenuState & DrawButtonFlags::Pressed )
+                {
+                    maFrameData.mnMenuState &= ~DrawButtonFlags::Pressed;
+                    pBorderWindow->InvalidateBorder();
+                }
+            }
+        }
+        else if ( maFrameData.mnHitTest & BORDERWINDOW_HITTEST_HIDE )
+        {
+            if ( maFrameData.maHideRect.IsInside( aMousePos ) )
+            {
+                if ( !(maFrameData.mnHideState & DrawButtonFlags::Pressed) )
+                {
+                    maFrameData.mnHideState |= DrawButtonFlags::Pressed;
+                    pBorderWindow->InvalidateBorder();
+                }
+            }
+            else
+            {
+                if ( maFrameData.mnHideState & DrawButtonFlags::Pressed )
+                {
+                    maFrameData.mnHideState &= ~DrawButtonFlags::Pressed;
+                    pBorderWindow->InvalidateBorder();
+                }
+            }
+        }
+        else if ( maFrameData.mnHitTest & BORDERWINDOW_HITTEST_HELP )
+        {
+            if ( maFrameData.maHelpRect.IsInside( aMousePos ) )
+            {
+                if ( !(maFrameData.mnHelpState & DrawButtonFlags::Pressed) )
+                {
+                    maFrameData.mnHelpState |= DrawButtonFlags::Pressed;
+                    pBorderWindow->InvalidateBorder();
+                }
+            }
+            else
+            {
+                if ( maFrameData.mnHelpState & DrawButtonFlags::Pressed )
+                {
+                    maFrameData.mnHelpState &= ~DrawButtonFlags::Pressed;
+                    pBorderWindow->InvalidateBorder();
+                }
+            }
+        }
+        else if ( maFrameData.mnHitTest & BORDERWINDOW_HITTEST_PIN )
+        {
+            if ( maFrameData.maPinRect.IsInside( aMousePos ) )
+            {
+                if ( !(maFrameData.mnPinState & DrawButtonFlags::Pressed) )
+                {
+                    maFrameData.mnPinState |= DrawButtonFlags::Pressed;
+                    pBorderWindow->InvalidateBorder();
+                }
+            }
+            else
+            {
+                if ( maFrameData.mnPinState & DrawButtonFlags::Pressed )
+                {
+                    maFrameData.mnPinState &= ~DrawButtonFlags::Pressed;
+                    pBorderWindow->InvalidateBorder();
+                }
+            }
+        }
+        else
+        {
+            aMousePos.X()    -= maFrameData.maMouseOff.X();
+            aMousePos.Y()    -= maFrameData.maMouseOff.Y();
+
+            if ( maFrameData.mnHitTest & BORDERWINDOW_HITTEST_TITLE )
+            {
+                maFrameData.mpBorderWindow->SetPointer( Pointer( PointerStyle::Move ) );
+
+                Point aPos = pBorderWindow->GetPosPixel();
+                aPos.X() += aMousePos.X();
+                aPos.Y() += aMousePos.Y();
+                if ( maFrameData.mbDragFull )
+                {
+                    pBorderWindow->SetPosPixel( aPos );
+                    pBorderWindow->ImplUpdateAll();
+                    pBorderWindow->ImplGetFrameWindow()->ImplUpdateAll();
+                }
+                else
+                {
+                    maFrameData.mnTrackX = aPos.X();
+                    maFrameData.mnTrackY = aPos.Y();
+                    pBorderWindow->ShowTracking( Rectangle( pBorderWindow->ScreenToOutputPixel( aPos ), pBorderWindow->GetOutputSizePixel() ), SHOWTRACK_BIG );
+                }
+            }
+            else
+            {
+                Point       aOldPos         = pBorderWindow->GetPosPixel();
+                Size        aSize           = pBorderWindow->GetSizePixel();
+                Rectangle   aNewRect( aOldPos, aSize );
+                long        nOldWidth       = aSize.Width();
+                long        nOldHeight      = aSize.Height();
+                long        nBorderWidth    = maFrameData.mnLeftBorder+maFrameData.mnRightBorder;
+                long        nBorderHeight   = maFrameData.mnTopBorder+maFrameData.mnBottomBorder;
+                long        nMinWidth       = pBorderWindow->mnMinWidth+nBorderWidth;
+                long        nMinHeight      = pBorderWindow->mnMinHeight+nBorderHeight;
+                long        nMinWidth2      = nBorderWidth;
+                long        nMaxWidth       = pBorderWindow->mnMaxWidth+nBorderWidth;
+                long        nMaxHeight      = pBorderWindow->mnMaxHeight+nBorderHeight;
+
+                if ( maFrameData.mnTitleHeight )
+                {
+                    nMinWidth2 += 4;
+
+                    if ( pBorderWindow->GetStyle() & WB_CLOSEABLE )
+                        nMinWidth2 += maFrameData.maCloseRect.GetWidth();
+                }
+                if ( nMinWidth2 > nMinWidth )
+                    nMinWidth = nMinWidth2;
+                if ( maFrameData.mnHitTest & (BORDERWINDOW_HITTEST_LEFT | BORDERWINDOW_HITTEST_TOPLEFT | BORDERWINDOW_HITTEST_BOTTOMLEFT) )
+                {
+                    aNewRect.Left() += aMousePos.X();
+                    if ( aNewRect.GetWidth() < nMinWidth )
+                        aNewRect.Left() = aNewRect.Right()-nMinWidth+1;
+                    else if ( aNewRect.GetWidth() > nMaxWidth )
+                        aNewRect.Left() = aNewRect.Right()-nMaxWidth+1;
+                }
+                else if ( maFrameData.mnHitTest & (BORDERWINDOW_HITTEST_RIGHT | BORDERWINDOW_HITTEST_TOPRIGHT | BORDERWINDOW_HITTEST_BOTTOMRIGHT) )
+                {
+                    aNewRect.Right() += aMousePos.X();
+                    if ( aNewRect.GetWidth() < nMinWidth )
+                        aNewRect.Right() = aNewRect.Left()+nMinWidth+1;
+                    else if ( aNewRect.GetWidth() > nMaxWidth )
+                        aNewRect.Right() = aNewRect.Left()+nMaxWidth+1;
+                }
+                if ( maFrameData.mnHitTest & (BORDERWINDOW_HITTEST_TOP | BORDERWINDOW_HITTEST_TOPLEFT | BORDERWINDOW_HITTEST_TOPRIGHT) )
+                {
+                    aNewRect.Top() += aMousePos.Y();
+                    if ( aNewRect.GetHeight() < nMinHeight )
+                        aNewRect.Top() = aNewRect.Bottom()-nMinHeight+1;
+                    else if ( aNewRect.GetHeight() > nMaxHeight )
+                        aNewRect.Top() = aNewRect.Bottom()-nMaxHeight+1;
+                }
+                else if ( maFrameData.mnHitTest & (BORDERWINDOW_HITTEST_BOTTOM | BORDERWINDOW_HITTEST_BOTTOMLEFT | BORDERWINDOW_HITTEST_BOTTOMRIGHT) )
+                {
+                    aNewRect.Bottom() += aMousePos.Y();
+                    if ( aNewRect.GetHeight() < nMinHeight )
+                        aNewRect.Bottom() = aNewRect.Top()+nMinHeight+1;
+                    else if ( aNewRect.GetHeight() > nMaxHeight )
+                        aNewRect.Bottom() = aNewRect.Top()+nMaxHeight+1;
+                }
+
+                // call Resizing-Handler for SystemWindows
+                if ( pBorderWindow->ImplGetClientWindow()->IsSystemWindow() )
+                {
+                    // adjust size for Resizing-call
+                    aSize = aNewRect.GetSize();
+                    aSize.Width()   -= nBorderWidth;
+                    aSize.Height()  -= nBorderHeight;
+                    static_cast<SystemWindow*>(pBorderWindow->ImplGetClientWindow())->Resizing( aSize );
+                    aSize.Width()   += nBorderWidth;
+                    aSize.Height()  += nBorderHeight;
+                    if ( aSize.Width() < nMinWidth )
+                        aSize.Width() = nMinWidth;
+                    if ( aSize.Height() < nMinHeight )
+                        aSize.Height() = nMinHeight;
+                    if ( aSize.Width() > nMaxWidth )
+                        aSize.Width() = nMaxWidth;
+                    if ( aSize.Height() > nMaxHeight )
+                        aSize.Height() = nMaxHeight;
+                    if ( maFrameData.mnHitTest & (BORDERWINDOW_HITTEST_LEFT | BORDERWINDOW_HITTEST_TOPLEFT | BORDERWINDOW_HITTEST_BOTTOMLEFT) )
+                        aNewRect.Left() = aNewRect.Right()-aSize.Width()+1;
+                    else
+                        aNewRect.Right() = aNewRect.Left()+aSize.Width()-1;
+                    if ( maFrameData.mnHitTest & (BORDERWINDOW_HITTEST_TOP | BORDERWINDOW_HITTEST_TOPLEFT | BORDERWINDOW_HITTEST_TOPRIGHT) )
+                        aNewRect.Top() = aNewRect.Bottom()-aSize.Height()+1;
+                    else
+                        aNewRect.Bottom() = aNewRect.Top()+aSize.Height()-1;
+                }
+
+                if ( maFrameData.mbDragFull )
+                {
+                    // no move (only resize) if position did not change
+                    if( aOldPos != aNewRect.TopLeft() )
+                        pBorderWindow->setPosSizePixel( aNewRect.Left(), aNewRect.Top(),
+                                                    aNewRect.GetWidth(), aNewRect.GetHeight(), PosSizeFlags::PosSize );
+                    else
+                        pBorderWindow->setPosSizePixel( aNewRect.Left(), aNewRect.Top(),
+                                                    aNewRect.GetWidth(), aNewRect.GetHeight(), PosSizeFlags::Size );
+
+                    pBorderWindow->ImplUpdateAll();
+                    pBorderWindow->ImplGetFrameWindow()->ImplUpdateAll();
+                    if ( maFrameData.mnHitTest & (BORDERWINDOW_HITTEST_RIGHT | BORDERWINDOW_HITTEST_TOPRIGHT | BORDERWINDOW_HITTEST_BOTTOMRIGHT) )
+                        maFrameData.maMouseOff.X() += aNewRect.GetWidth()-nOldWidth;
+                    if ( maFrameData.mnHitTest & (BORDERWINDOW_HITTEST_BOTTOM | BORDERWINDOW_HITTEST_BOTTOMLEFT | BORDERWINDOW_HITTEST_BOTTOMRIGHT) )
+                        maFrameData.maMouseOff.Y() += aNewRect.GetHeight()-nOldHeight;
+                }
+                else
+                {
+                    maFrameData.mnTrackX        = aNewRect.Left();
+                    maFrameData.mnTrackY        = aNewRect.Top();
+                    maFrameData.mnTrackWidth    = aNewRect.GetWidth();
+                    maFrameData.mnTrackHeight   = aNewRect.GetHeight();
+                    pBorderWindow->ShowTracking( Rectangle( pBorderWindow->ScreenToOutputPixel( aNewRect.TopLeft() ), aNewRect.GetSize() ), SHOWTRACK_BIG );
+                }
+            }
+        }
+    }
+
+    return true;
 }
 
 OUString ImplStdBorderWindowView::RequestHelp( const Point& rPos, Rectangle& rHelpRect )
commit 35e13c7ec530a46cc0c92cf986231acece3afd2a
Author: Noel Grandin <noel at peralex.com>
Date:   Fri May 22 10:37:31 2015 +0200

    convert WINDOW_POSSIZE constants to scoped enum
    
    Change-Id: Id85137ffc7309a66b04132d588d289db136117b9
    Signed-off-by: Jan Holesovsky <kendy at collabora.com>

diff --git a/chart2/source/controller/main/ChartController_Window.cxx b/chart2/source/controller/main/ChartController_Window.cxx
index 8332a2e..5ee1025 100644
--- a/chart2/source/controller/main/ChartController_Window.cxx
+++ b/chart2/source/controller/main/ChartController_Window.cxx
@@ -248,7 +248,7 @@ void SAL_CALL ChartController::setPosSize(
                     Fraction(nScaleXNumerator, nScaleXDenominator),
                     Fraction(nScaleYNumerator, nScaleYDenominator) );
         m_pChartWindow->SetMapMode(aNewMapMode);
-        m_pChartWindow->setPosSizePixel( X, Y, Width, Height, Flags );
+        m_pChartWindow->setPosSizePixel( X, Y, Width, Height, static_cast<PosSizeFlags>(Flags) );
 
         //#i75867# poor quality of ole's alternative view with 3D scenes and zoomfactors besides 100%
         uno::Reference< beans::XPropertySet > xProp( m_xChartView, uno::UNO_QUERY );
diff --git a/dbaccess/source/ui/dlg/adminpages.cxx b/dbaccess/source/ui/dlg/adminpages.cxx
index 5848b5b..7282b7f 100644
--- a/dbaccess/source/ui/dlg/adminpages.cxx
+++ b/dbaccess/source/ui/dlg/adminpages.cxx
@@ -277,7 +277,7 @@ namespace dbaui
                 0,
                 aMinSize.Width(),
                 0,
-                WINDOW_POSSIZE_X | WINDOW_POSSIZE_WIDTH
+                PosSizeFlags::X | PosSizeFlags::Width
             );
         }
     }
diff --git a/extensions/source/plugin/base/plctrl.cxx b/extensions/source/plugin/base/plctrl.cxx
index 4276ba9..917809d 100644
--- a/extensions/source/plugin/base/plctrl.cxx
+++ b/extensions/source/plugin/base/plctrl.cxx
@@ -32,6 +32,7 @@
 #include <com/sun/star/awt/XSpinListener.hpp>
 #include <com/sun/star/awt/XItemListener.hpp>
 #include <com/sun/star/awt/XVclContainerListener.hpp>
+#include <com/sun/star/awt/PosSize.hpp>
 
 #include <plugin/plctrl.hxx>
 #include <vcl/syschild.hxx>
@@ -43,7 +44,7 @@ PluginControl_Impl::PluginControl_Impl()
     , _nY( 0 )
     , _nWidth( 100 )
     , _nHeight( 100 )
-    , _nFlags( WINDOW_POSSIZE_ALL )
+    , _nFlags( css::awt::PosSize::POSSIZE )
     , _bVisible(false)
     , _bInDesignMode(false)
     , _bEnable(true)
diff --git a/include/svx/sidebar/PanelLayout.hxx b/include/svx/sidebar/PanelLayout.hxx
index 9c58248..09386a6 100644
--- a/include/svx/sidebar/PanelLayout.hxx
+++ b/include/svx/sidebar/PanelLayout.hxx
@@ -38,7 +38,7 @@ public:
     virtual void dispose() SAL_OVERRIDE;
 
     virtual Size GetOptimalSize() const SAL_OVERRIDE;
-    virtual void setPosSizePixel(long nX, long nY, long nWidth, long nHeight, sal_uInt16 nFlags = WINDOW_POSSIZE_ALL) SAL_OVERRIDE;
+    virtual void setPosSizePixel(long nX, long nY, long nWidth, long nHeight, PosSizeFlags nFlags = PosSizeFlags::All) SAL_OVERRIDE;
     virtual void queue_resize(StateChangedType eReason = StateChangedType::Layout) SAL_OVERRIDE;
 
 };
diff --git a/include/vcl/combobox.hxx b/include/vcl/combobox.hxx
index 83e4a18..50058fd 100644
--- a/include/vcl/combobox.hxx
+++ b/include/vcl/combobox.hxx
@@ -109,7 +109,7 @@ public:
 
     virtual const Wallpaper& GetDisplayBackground() const SAL_OVERRIDE;
 
-    virtual void    setPosSizePixel( long nX, long nY, long nWidth, long nHeight, sal_uInt16 nFlags = WINDOW_POSSIZE_ALL ) SAL_OVERRIDE;
+    virtual void    setPosSizePixel( long nX, long nY, long nWidth, long nHeight, PosSizeFlags nFlags = PosSizeFlags::All ) SAL_OVERRIDE;
     void            SetPosSizePixel( const Point& rNewPos, const Size& rNewSize ) SAL_OVERRIDE
                         { Edit::SetPosSizePixel( rNewPos, rNewSize ); }
 
diff --git a/include/vcl/dockwin.hxx b/include/vcl/dockwin.hxx
index 605441e..156d0a0 100644
--- a/include/vcl/dockwin.hxx
+++ b/include/vcl/dockwin.hxx
@@ -171,7 +171,7 @@ public:
 
     void            setPosSizePixel( long nX, long nY,
                                      long nWidth, long nHeight,
-                                     sal_uInt16 nFlags = WINDOW_POSSIZE_ALL );
+                                     PosSizeFlags nFlags = PosSizeFlags::All );
     void            SetPosSizePixel( const Point& rNewPos,
                                      const Size& rNewSize )
                         { mpDockingWindow->SetPosSizePixel( rNewPos, rNewSize ); }
@@ -211,7 +211,7 @@ public:
     // be availbale from the toolkit
     void        SetPosSizePixel( vcl::Window *pWin, long nX, long nY,
                                 long nWidth, long nHeight,
-                                sal_uInt16 nFlags = WINDOW_POSSIZE_ALL );
+                                PosSizeFlags nFlags = PosSizeFlags::All );
     Rectangle   GetPosSizePixel( const vcl::Window *pWin );
 };
 
@@ -347,7 +347,7 @@ public:
 
     virtual void    setPosSizePixel( long nX, long nY,
                                      long nWidth, long nHeight,
-                                     sal_uInt16 nFlags = WINDOW_POSSIZE_ALL ) SAL_OVERRIDE;
+                                     PosSizeFlags nFlags = PosSizeFlags::All ) SAL_OVERRIDE;
     void            SetPosSizePixel( const Point& rNewPos,
                                      const Size& rNewSize ) SAL_OVERRIDE
                         { Window::SetPosSizePixel( rNewPos, rNewSize ); }
diff --git a/include/vcl/lstbox.hxx b/include/vcl/lstbox.hxx
index 1687dc7..8a5efc5 100644
--- a/include/vcl/lstbox.hxx
+++ b/include/vcl/lstbox.hxx
@@ -102,7 +102,7 @@ public:
     virtual const Wallpaper& GetDisplayBackground() const SAL_OVERRIDE;
 
     virtual void        setPosSizePixel( long nX, long nY,
-                                         long nWidth, long nHeight, sal_uInt16 nFlags = WINDOW_POSSIZE_ALL ) SAL_OVERRIDE;
+                                         long nWidth, long nHeight, PosSizeFlags nFlags = PosSizeFlags::All ) SAL_OVERRIDE;
     void                SetPosSizePixel( const Point& rNewPos, const Size& rNewSize ) SAL_OVERRIDE
                         { Control::SetPosSizePixel( rNewPos, rNewSize ); }
 
diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx
index 3078b42..f1d7a92 100644
--- a/include/vcl/window.hxx
+++ b/include/vcl/window.hxx
@@ -116,7 +116,6 @@ enum class TrackingEventFlags
     End            = 0x1000,
     DontCallHdl    = 0x8000,
 };
-
 namespace o3tl
 {
     template<> struct typed_flags<TrackingEventFlags> : is_typed_flags<TrackingEventFlags, 0x9107> {};
@@ -149,15 +148,24 @@ enum class GetWindowType
 };
 
 // Flags for setPosSizePixel()
-#define WINDOW_POSSIZE_X                ((sal_uInt16)0x0001)
-#define WINDOW_POSSIZE_Y                ((sal_uInt16)0x0002)
-#define WINDOW_POSSIZE_WIDTH            ((sal_uInt16)0x0004)
-#define WINDOW_POSSIZE_HEIGHT           ((sal_uInt16)0x0008)
-#define WINDOW_POSSIZE_POS              (WINDOW_POSSIZE_X | WINDOW_POSSIZE_Y)
-#define WINDOW_POSSIZE_SIZE             (WINDOW_POSSIZE_WIDTH | WINDOW_POSSIZE_HEIGHT)
-#define WINDOW_POSSIZE_POSSIZE          (WINDOW_POSSIZE_POS | WINDOW_POSSIZE_SIZE)
-#define WINDOW_POSSIZE_ALL              (WINDOW_POSSIZE_POSSIZE)
-#define WINDOW_POSSIZE_DROPDOWN         ((sal_uInt16)0x0010)
+// These must match the definitions in css::awt::PosSize
+enum class PosSizeFlags
+{
+    NONE             = 0x0000,
+    X                = 0x0001,
+    Y                = 0x0002,
+    Width            = 0x0004,
+    Height           = 0x0008,
+    Pos              = X | Y,
+    Size             = Width | Height,
+    PosSize          = Pos | Size,
+    All              = PosSize,
+    Dropdown         = 0x0010,
+};
+namespace o3tl
+{
+    template<> struct typed_flags<PosSizeFlags> : is_typed_flags<PosSizeFlags, 0x001f> {};
+}
 
 // Flags for Show()
 #define SHOW_NOPARENTUPDATE             ((sal_uInt16)0x0001)
@@ -498,7 +506,7 @@ public:
 
     SAL_DLLPRIVATE void                 ImplMirrorFramePos( Point &pt ) const;
 
-    SAL_DLLPRIVATE void                 ImplPosSizeWindow( long nX, long nY, long nWidth, long nHeight, sal_uInt16 nFlags );
+    SAL_DLLPRIVATE void                 ImplPosSizeWindow( long nX, long nY, long nWidth, long nHeight, PosSizeFlags nFlags );
 
     SAL_DLLPRIVATE void                 ImplAddDel( ImplDelData* pDel );
     SAL_DLLPRIVATE void                 ImplRemoveDel( ImplDelData* pDel );
@@ -1000,7 +1008,7 @@ public:
 
     virtual void                        setPosSizePixel( long nX, long nY,
                                                          long nWidth, long nHeight,
-                                                         sal_uInt16 nFlags = WINDOW_POSSIZE_ALL );
+                                                         PosSizeFlags nFlags = PosSizeFlags::All );
     virtual void                        SetPosPixel( const Point& rNewPos );
     virtual Point                       GetPosPixel() const;
     virtual void                        SetSizePixel( const Size& rNewSize );
diff --git a/sc/source/ui/dbgui/csvruler.cxx b/sc/source/ui/dbgui/csvruler.cxx
index fb13963..aab46e9 100644
--- a/sc/source/ui/dbgui/csvruler.cxx
+++ b/sc/source/ui/dbgui/csvruler.cxx
@@ -113,9 +113,9 @@ void ScCsvRuler::dispose()
 // common ruler handling ------------------------------------------------------
 
 void ScCsvRuler::setPosSizePixel(
-        long nX, long nY, long nWidth, long nHeight, sal_uInt16 nFlags )
+        long nX, long nY, long nWidth, long nHeight, PosSizeFlags nFlags )
 {
-    if( nFlags & WINDOW_POSSIZE_HEIGHT )
+    if( nFlags & PosSizeFlags::Height )
         nHeight = GetTextHeight() + mnSplitSize + 2;
     ScCsvControl::setPosSizePixel( nX, nY, nWidth, nHeight, nFlags );
 }
diff --git a/sc/source/ui/inc/csvruler.hxx b/sc/source/ui/inc/csvruler.hxx
index 6fc719d..44f8a76 100644
--- a/sc/source/ui/inc/csvruler.hxx
+++ b/sc/source/ui/inc/csvruler.hxx
@@ -63,7 +63,7 @@ public:
     virtual void                setPosSizePixel(
                                     long nX, long nY,
                                     long nWidth, long nHeight,
-                                    sal_uInt16 nFlags = WINDOW_POSSIZE_ALL ) SAL_OVERRIDE;
+                                    PosSizeFlags nFlags = PosSizeFlags::All ) SAL_OVERRIDE;
 
     /** Apply current layout data to the ruler. */
     void                        ApplyLayout( const ScCsvLayoutData& rOldData );
diff --git a/sc/source/ui/navipi/navipi.cxx b/sc/source/ui/navipi/navipi.cxx
index 77bf5a4..04ec62b 100644
--- a/sc/source/ui/navipi/navipi.cxx
+++ b/sc/source/ui/navipi/navipi.cxx
@@ -600,7 +600,7 @@ ScNavigatorDlg::ScNavigatorDlg( SfxBindings* pB, SfxChildWindowContext* pCW, vcl
             (aTbxCmd->GetPosPixel().Y() + aTbxCmd->GetSizePixel().Height()),
             (aEdRow->GetPosPixel().Y() + aEdRow->GetSizePixel().Height()) )
         + 4;
-    aLbEntries->setPosSizePixel( 0, nListboxYPos, 0, 0, WINDOW_POSSIZE_Y);
+    aLbEntries->setPosSizePixel( 0, nListboxYPos, 0, 0, PosSizeFlags::Y);
 
     nBorderOffset = aLbEntries->GetPosPixel().X();
 
diff --git a/sd/source/ui/dlg/navigatr.cxx b/sd/source/ui/dlg/navigatr.cxx
index 016f9a1..52e1833 100644
--- a/sd/source/ui/dlg/navigatr.cxx
+++ b/sd/source/ui/dlg/navigatr.cxx
@@ -102,7 +102,7 @@ SdNavigatorWin::SdNavigatorWin(
     // TreeListBox
     // set position below toolbox
     long nListboxYPos = maToolbox->GetPosPixel().Y() + maToolbox->GetSizePixel().Height() + 4;
-    maTlbObjects->setPosSizePixel( 0, nListboxYPos, 0, 0, WINDOW_POSSIZE_Y );
+    maTlbObjects->setPosSizePixel( 0, nListboxYPos, 0, 0, PosSizeFlags::Y );
     maTlbObjects->SetDoubleClickHdl( LINK( this, SdNavigatorWin, ClickObjectHdl ) );
     maTlbObjects->SetSelectionMode( SINGLE_SELECTION );
     // set focus to listbox, otherwise it is in the toolbox which is only useful
@@ -114,14 +114,14 @@ SdNavigatorWin::SdNavigatorWin(
     maLbDocs->SetSelectHdl( LINK( this, SdNavigatorWin, SelectDocumentHdl ) );
     // set position below treelistbox
     nListboxYPos = maTlbObjects->GetPosPixel().Y() + maTlbObjects->GetSizePixel().Height() + 4;
-    maLbDocs->setPosSizePixel( 0, nListboxYPos, 0, 0, WINDOW_POSSIZE_Y );
+    maLbDocs->setPosSizePixel( 0, nListboxYPos, 0, 0, PosSizeFlags::Y );
 
     // assure that tool box is at least as wide as the tree list box
     {
         const Size aTlbSize( maTlbObjects->GetOutputSizePixel() );
         if ( aTlbSize.Width() > aTbxSize.Width() )
         {
-            maToolbox->setPosSizePixel( 0, 0, aTlbSize.Width(), 0, WINDOW_POSSIZE_WIDTH );
+            maToolbox->setPosSizePixel( 0, 0, aTlbSize.Width(), 0, PosSizeFlags::Width );
             aTbxSize = maToolbox->GetOutputSizePixel();
         }
     }
diff --git a/sfx2/source/control/thumbnailview.cxx b/sfx2/source/control/thumbnailview.cxx
index ba6f706..4bcdf56 100644
--- a/sfx2/source/control/thumbnailview.cxx
+++ b/sfx2/source/control/thumbnailview.cxx
@@ -240,7 +240,7 @@ void ThumbnailView::ImplInitScrollBar()
         {
             // adapt the width because of the changed settings
             long nScrBarWidth = GetSettings().GetStyleSettings().GetScrollBarSize();
-            mpScrBar->setPosSizePixel( 0, 0, nScrBarWidth, 0, WINDOW_POSSIZE_WIDTH );
+            mpScrBar->setPosSizePixel( 0, 0, nScrBarWidth, 0, PosSizeFlags::Width );
         }
     }
 }
diff --git a/sfx2/source/doc/plugin.cxx b/sfx2/source/doc/plugin.cxx
index 7c5d715..987e953 100644
--- a/sfx2/source/doc/plugin.cxx
+++ b/sfx2/source/doc/plugin.cxx
@@ -24,6 +24,7 @@
 #include <com/sun/star/plugin/XPluginManager.hpp>
 #include <com/sun/star/plugin/PluginMode.hpp>
 #include <com/sun/star/awt/XControl.hpp>
+#include <com/sun/star/awt/PosSize.hpp>
 #include <com/sun/star/beans/XPropertySet.hpp>
 #include <com/sun/star/frame/XSynchronousFrameLoader.hpp>
 #include <com/sun/star/lang/XEventListener.hpp>
@@ -60,7 +61,7 @@ void PluginWindow_Impl::Resize()
 {
     Size aSize( GetOutputSizePixel() );
     if ( xWindow.is() )
-        xWindow->setPosSize( 0, 0, aSize.Width(), aSize.Height(), WINDOW_POSSIZE_SIZE );
+        xWindow->setPosSize( 0, 0, aSize.Width(), aSize.Height(), css::awt::PosSize::SIZE );
 }
 
 #define PROPERTY_UNBOUND 0
diff --git a/sfx2/source/sidebar/TitleBar.cxx b/sfx2/source/sidebar/TitleBar.cxx
index fd3c1a9..239cf04 100644
--- a/sfx2/source/sidebar/TitleBar.cxx
+++ b/sfx2/source/sidebar/TitleBar.cxx
@@ -94,13 +94,13 @@ void TitleBar::DataChanged (const DataChangedEvent& /*rEvent*/)
     Invalidate();
 }
 
-void TitleBar::setPosSizePixel (long nX, long nY, long nWidth, long nHeight, sal_uInt16 nFlags)
+void TitleBar::setPosSizePixel (long nX, long nY, long nWidth, long nHeight, PosSizeFlags nFlags)
 {
     Window::setPosSizePixel(nX, nY, nWidth, nHeight, nFlags);
 
     // Place the toolbox.
     const sal_Int32 nToolBoxWidth (maToolBox->GetItemPosRect(0).GetWidth());
-    maToolBox->setPosSizePixel(nWidth - nToolBoxWidth,0, nToolBoxWidth, nHeight, WINDOW_POSSIZE_POSSIZE);
+    maToolBox->setPosSizePixel(nWidth - nToolBoxWidth,0, nToolBoxWidth, nHeight, PosSizeFlags::PosSize);
     maToolBox->Show();
 }
 
diff --git a/sfx2/source/sidebar/TitleBar.hxx b/sfx2/source/sidebar/TitleBar.hxx
index 3372385..b0bc5d8 100644
--- a/sfx2/source/sidebar/TitleBar.hxx
+++ b/sfx2/source/sidebar/TitleBar.hxx
@@ -41,7 +41,7 @@ public:
     virtual void ApplySettings(vcl::RenderContext& rRenderContext) SAL_OVERRIDE;
     virtual void Paint(vcl::RenderContext& rRenderContext, const Rectangle& rUpdateArea) SAL_OVERRIDE;
     virtual void DataChanged (const DataChangedEvent& rEvent) SAL_OVERRIDE;
-    virtual void setPosSizePixel (long nX, long nY, long nWidth, long nHeight, sal_uInt16 nFlags = WINDOW_POSSIZE_ALL) SAL_OVERRIDE;
+    virtual void setPosSizePixel (long nX, long nY, long nWidth, long nHeight, PosSizeFlags nFlags = PosSizeFlags::All) SAL_OVERRIDE;
 
     ToolBox& GetToolBox()
     {
diff --git a/svtools/source/control/calendar.cxx b/svtools/source/control/calendar.cxx
index ffd68d6..e560bcd 100644
--- a/svtools/source/control/calendar.cxx
+++ b/svtools/source/control/calendar.cxx
@@ -2222,7 +2222,7 @@ void ImplCFieldFloatWin::ArrangeButtons()
         }
         long nLineWidth = aOutSize.Width()-(CALFIELD_BORDERLINE_X*2);
         mpFixedLine->setPosSizePixel( (aOutSize.Width()-nLineWidth)/2, aOutSize.Height()+((CALFIELD_BORDER_YTOP-2)/2),
-                                      nLineWidth, 2, WINDOW_POSSIZE_POSSIZE );
+                                      nLineWidth, 2, PosSizeFlags::PosSize );
         aOutSize.Height() += nBtnHeight + (CALFIELD_BORDER_Y*2) + CALFIELD_BORDER_YTOP;
         SetOutputSizePixel( aOutSize );
     }
diff --git a/svtools/source/control/valueset.cxx b/svtools/source/control/valueset.cxx
index 49e784a..2180346 100644
--- a/svtools/source/control/valueset.cxx
+++ b/svtools/source/control/valueset.cxx
@@ -219,7 +219,7 @@ void ValueSet::ImplInitScrollBar()
         {
             // adapt the width because of the changed settings
             long nScrBarWidth = Application::GetSettings().GetStyleSettings().GetScrollBarSize();
-            mxScrollBar->setPosSizePixel(0, 0, nScrBarWidth, 0, WINDOW_POSSIZE_WIDTH);
+            mxScrollBar->setPosSizePixel(0, 0, nScrBarWidth, 0, PosSizeFlags::Width);
         }
     }
 }
diff --git a/svtools/source/dialogs/wizdlg.cxx b/svtools/source/dialogs/wizdlg.cxx
index 2855ada..39d6390 100644
--- a/svtools/source/dialogs/wizdlg.cxx
+++ b/svtools/source/dialogs/wizdlg.cxx
@@ -195,13 +195,13 @@ void WizardDialog::ImplPosCtrls()
         long    nViewWidth = 0;
         long    nViewHeight = 0;
         long    nDlgHeight = nOffY;
-        sal_uInt16  nViewPosFlags = WINDOW_POSSIZE_POS;
+        PosSizeFlags nViewPosFlags = PosSizeFlags::Pos;
         if ( meViewAlign == WINDOWALIGN_TOP )
         {
             nViewOffX       = WIZARDDIALOG_VIEW_DLGOFFSET_X;
             nViewOffY       = WIZARDDIALOG_VIEW_DLGOFFSET_Y;
             nViewWidth      = aDlgSize.Width()-(WIZARDDIALOG_VIEW_DLGOFFSET_X*2);
-            nViewPosFlags  |= WINDOW_POSSIZE_WIDTH;
+            nViewPosFlags  |= PosSizeFlags::Width;
         }
         else if ( meViewAlign == WINDOWALIGN_LEFT )
         {
@@ -217,21 +217,21 @@ void WizardDialog::ImplPosCtrls()
                 nViewOffY       = WIZARDDIALOG_VIEW_DLGOFFSET_Y;
                 nViewHeight     = nDlgHeight-(WIZARDDIALOG_VIEW_DLGOFFSET_Y*2);
             }
-            nViewPosFlags  |= WINDOW_POSSIZE_HEIGHT;
+            nViewPosFlags  |= PosSizeFlags::Height;
         }
         else if ( meViewAlign == WINDOWALIGN_BOTTOM )
         {
             nViewOffX       = WIZARDDIALOG_VIEW_DLGOFFSET_X;
             nViewOffY       = nDlgHeight-mpViewWindow->GetSizePixel().Height()-WIZARDDIALOG_VIEW_DLGOFFSET_Y;
             nViewWidth      = aDlgSize.Width()-(WIZARDDIALOG_VIEW_DLGOFFSET_X*2);
-            nViewPosFlags  |= WINDOW_POSSIZE_WIDTH;
+            nViewPosFlags  |= PosSizeFlags::Width;
         }
         else if ( meViewAlign == WINDOWALIGN_RIGHT )
         {
             nViewOffX       = aDlgSize.Width()-mpViewWindow->GetSizePixel().Width()-WIZARDDIALOG_VIEW_DLGOFFSET_X;
             nViewOffY       = WIZARDDIALOG_VIEW_DLGOFFSET_Y;
             nViewHeight     = nDlgHeight-(WIZARDDIALOG_VIEW_DLGOFFSET_Y*2);
-            nViewPosFlags  |= WINDOW_POSSIZE_HEIGHT;
+            nViewPosFlags  |= PosSizeFlags::Height;
         }
         mpViewWindow->setPosSizePixel( nViewOffX, nViewOffY,
                                        nViewWidth, nViewHeight,
diff --git a/svx/source/sidebar/PanelLayout.cxx b/svx/source/sidebar/PanelLayout.cxx
index 1b5173d..591dfe3 100644
--- a/svx/source/sidebar/PanelLayout.cxx
+++ b/svx/source/sidebar/PanelLayout.cxx
@@ -69,7 +69,7 @@ IMPL_LINK_NOARG_TYPED( PanelLayout, ImplHandlePanelLayoutTimerHdl, Idle*, void )
     VclContainer::setLayoutAllocation(*pChild, Point(0, 0), GetSizePixel());
 }
 
-void PanelLayout::setPosSizePixel(long nX, long nY, long nWidth, long nHeight, sal_uInt16 nFlags)
+void PanelLayout::setPosSizePixel(long nX, long nY, long nWidth, long nHeight, PosSizeFlags nFlags)
 {
     bool bCanHandleSmallerWidth = false;
     bool bCanHandleSmallerHeight = false;
@@ -94,7 +94,7 @@ void PanelLayout::setPosSizePixel(long nX, long nY, long nWidth, long nHeight, s
 
     Control::setPosSizePixel(nX, nY, nWidth, nHeight, nFlags);
 
-    if (bIsLayoutEnabled && (nFlags & WINDOW_POSSIZE_SIZE))
+    if (bIsLayoutEnabled && (nFlags & PosSizeFlags::Size))
         VclContainer::setLayoutAllocation(*pChild, Point(0, 0), Size(nWidth, nHeight));
 }
 
diff --git a/sw/source/uibase/utlui/navipi.cxx b/sw/source/uibase/utlui/navipi.cxx
index 1141bef..c3abce9 100644
--- a/sw/source/uibase/utlui/navipi.cxx
+++ b/sw/source/uibase/utlui/navipi.cxx
@@ -632,7 +632,7 @@ void SwNavigationPI::Resize()
         aGlobalTree->SetSizePixel(aNewSize);
         aDocListBox->setPosSizePixel( aLBPos.X(), aLBPos.Y(),
             aDocLBSz.Width(), aDocLBSz.Height(),
-            WINDOW_POSSIZE_X|WINDOW_POSSIZE_Y|WINDOW_POSSIZE_WIDTH);
+            PosSizeFlags::X|PosSizeFlags::Y|PosSizeFlags::Width);
     }
 }
 
@@ -754,7 +754,7 @@ SwNavigationPI::SwNavigationPI( SfxBindings* _pBindings,
         }
     }
 
-    aContentTree->setPosSizePixel( 0, nListboxYPos, 0, 0, WINDOW_POSSIZE_Y );
+    aContentTree->setPosSizePixel( 0, nListboxYPos, 0, 0, PosSizeFlags::Y );
     aContentTree->SetStyle( aContentTree->GetStyle()|WB_HASBUTTONS|WB_HASBUTTONSATROOT|
                             WB_CLIPCHILDREN|WB_HSCROLL|WB_FORCE_MAKEVISIBLE );
     aContentTree->SetSpaceBetweenEntries(3);
@@ -767,7 +767,7 @@ SwNavigationPI::SwNavigationPI( SfxBindings* _pBindings,
     aContentToolBox->CheckItem(FN_SHOW_CONTENT_BOX, true);
 
 //  TreeListBox for global document
-    aGlobalTree->setPosSizePixel( 0, nListboxYPos, 0, 0, WINDOW_POSSIZE_Y );
+    aGlobalTree->setPosSizePixel( 0, nListboxYPos, 0, 0, PosSizeFlags::Y );
     aGlobalTree->SetSelectionMode( MULTIPLE_SELECTION );
     aGlobalTree->SetStyle( aGlobalTree->GetStyle()|WB_HASBUTTONS|WB_HASBUTTONSATROOT|
                                 WB_CLIPCHILDREN|WB_HSCROLL );
diff --git a/toolkit/source/awt/vclxwindow.cxx b/toolkit/source/awt/vclxwindow.cxx
index e2439fc..f315f99 100644
--- a/toolkit/source/awt/vclxwindow.cxx
+++ b/toolkit/source/awt/vclxwindow.cxx
@@ -970,9 +970,9 @@ void VCLXWindow::setPosSize( sal_Int32 X, sal_Int32 Y, sal_Int32 Width, sal_Int3
     if ( GetWindow() )
     {
         if( vcl::Window::GetDockingManager()->IsDockable( GetWindow() ) )
-            vcl::Window::GetDockingManager()->SetPosSizePixel( GetWindow() , X, Y, Width, Height, Flags );
+            vcl::Window::GetDockingManager()->SetPosSizePixel( GetWindow() , X, Y, Width, Height, static_cast<PosSizeFlags>(Flags) );
         else
-            GetWindow()->setPosSizePixel( X, Y, Width, Height, Flags );
+            GetWindow()->setPosSizePixel( X, Y, Width, Height, static_cast<PosSizeFlags>(Flags) );
     }
 }
 
diff --git a/vcl/inc/ilstbox.hxx b/vcl/inc/ilstbox.hxx
index 3c5aa4a..363483e 100644
--- a/vcl/inc/ilstbox.hxx
+++ b/vcl/inc/ilstbox.hxx
@@ -536,7 +536,7 @@ public:
     void            StartFloat( bool bStartTracking );
 
     virtual void    setPosSizePixel( long nX, long nY,
-                                     long nWidth, long nHeight, sal_uInt16 nFlags = WINDOW_POSSIZE_ALL ) SAL_OVERRIDE;
+                                     long nWidth, long nHeight, PosSizeFlags nFlags = PosSizeFlags::All ) SAL_OVERRIDE;
     void            SetPosSizePixel( const Point& rNewPos, const Size& rNewSize ) SAL_OVERRIDE
                         { FloatingWindow::SetPosSizePixel( rNewPos, rNewSize ); }
 
diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx
index 863ef18..e8ab9c9 100644

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list