[Libreoffice-commits] .: Branch 'feature/cmclayouttrans' - 2 commits - cui/source sfx2/source sw/source vcl/inc vcl/source

Caolán McNamara caolan at kemper.freedesktop.org
Wed Aug 15 05:36:08 PDT 2012


 cui/source/tabpages/chardlg.cxx         |   30 ----
 sfx2/source/dialog/tabdlg.cxx           |   13 --
 sw/source/ui/chrdlg/chardlg.cxx         |    6 
 sw/source/ui/dialog/wordcountdialog.cxx |   86 +++----------
 vcl/inc/brdwin.hxx                      |    4 
 vcl/inc/vcl/builder.hxx                 |   17 ++
 vcl/inc/vcl/dialog.hxx                  |    1 
 vcl/inc/vcl/layout.hxx                  |    6 
 vcl/inc/vcl/vclenum.hxx                 |    6 
 vcl/inc/vcl/window.hxx                  |  123 +++++++++++++------
 vcl/inc/window.h                        |   10 +
 vcl/source/window/brdwin.cxx            |   16 --
 vcl/source/window/builder.cxx           |   74 ++++++++---
 vcl/source/window/dialog.cxx            |   12 +
 vcl/source/window/layout.cxx            |   48 +++----
 vcl/source/window/window.cxx            |   34 +----
 vcl/source/window/window2.cxx           |  204 +++++++++++++++++++++++++-------
 17 files changed, 400 insertions(+), 290 deletions(-)

New commits:
commit 9a4851dce44744ef1d11be23b851331666b8ff46
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Aug 15 13:19:58 2012 +0100

    get order of destruction right to keep vcl happy
    
    Change-Id: I7db392bdc7f3be02d47cde783f029cc98308b17d

diff --git a/vcl/inc/vcl/builder.hxx b/vcl/inc/vcl/builder.hxx
index f5a1006..7b9823f 100644
--- a/vcl/inc/vcl/builder.hxx
+++ b/vcl/inc/vcl/builder.hxx
@@ -165,7 +165,14 @@ private:
 
 //allows retro fitting existing dialogs/tabpages that load a resource
 //to load a .ui file instead
-
+//
+//vcl requires the Window Children of a Parent Window to be destroyed before
+//the Parent Window.  VclBuilderContainer owns the VclBuilder which owns the
+//Children Window. So the VclBuilderContainer dtor must be called before
+//the Parent Window dtor.
+//
+//i.e.  class Dialog : public SystemWindow, public VclBuilderContainer
+//not   class Dialog : public VclBuilderContainer, public SystemWindow
 class ResId;
 
 class VCL_DLLPUBLIC VclBuilderContainer
@@ -174,6 +181,7 @@ protected:
     VclBuilder *m_pUIBuilder;
 public:
     VclBuilderContainer();
+    virtual ~VclBuilderContainer();
     static VclBuilder* overrideResourceWithUIXML(Window *pWindow, const ResId& rResId);
     static bool replace_buildable(Window *pParent, sal_Int32 nID, Window &rReplacement);
 };
diff --git a/vcl/inc/vcl/dialog.hxx b/vcl/inc/vcl/dialog.hxx
index 2393a93..8b6dc0f 100644
--- a/vcl/inc/vcl/dialog.hxx
+++ b/vcl/inc/vcl/dialog.hxx
@@ -43,7 +43,6 @@
 // - Dialog -
 // ----------
 struct DialogImpl;
-class VclBuilder;
 class VclContainer;
 
 class VCL_DLLPUBLIC Dialog
diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx
index c88a063..0b97fdc 100644
--- a/vcl/source/window/dialog.cxx
+++ b/vcl/source/window/dialog.cxx
@@ -581,6 +581,7 @@ WinBits Dialog::init(Window *pParent, const ResId& rResId)
 
 Dialog::~Dialog()
 {
+    maLayoutTimer.Stop();
     delete mpDialogImpl;
     mpDialogImpl = NULL;
 }
@@ -1174,8 +1175,8 @@ void Dialog::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal
 
 bool Dialog::isLayoutEnabled() const
 {
-    //Single child is a container => we're layout enabled
-    const Window *pChild = GetWindow(WINDOW_FIRSTCHILD);
+    //pre dtor called, and single child is a container => we're layout enabled
+    const Window *pChild = mpDialogImpl ? GetWindow(WINDOW_FIRSTCHILD) : NULL;
     return pChild && pChild->GetType() == WINDOW_CONTAINER && !pChild->GetWindow(WINDOW_NEXT);
 }
 
@@ -1209,8 +1210,6 @@ void Dialog::setPosSizeOnContainee(Size aSize, VclContainer &rBox)
 
 IMPL_LINK( Dialog, ImplHandleLayoutTimerHdl, void*, EMPTYARG )
 {
-    fprintf(stderr, "ImplHandleLayoutTimerHdl\n");
-
     if (!isLayoutEnabled())
     {
         fprintf(stderr, "Dialog has become non-layout because extra children have been added directly to it!\n");
@@ -1248,6 +1247,11 @@ VclBuilderContainer::VclBuilderContainer()
 {
 }
 
+VclBuilderContainer::~VclBuilderContainer()
+{
+    delete m_pUIBuilder;
+}
+
 bool VclBuilderContainer::replace_buildable(Window *pParent, sal_Int32 nID, Window &rReplacement)
 {
     if (!pParent)
commit dadcf1f216cbd3c0d1816b37037217bc87f93a11
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Aug 15 11:19:06 2012 +0100

    ditch over complex property buckets
    
    A fairly small fixed number of properties are needed, so simplify
    
    Change-Id: Iedce02264816666dbac53d7ad3cfb64be8e1c8bb

diff --git a/cui/source/tabpages/chardlg.cxx b/cui/source/tabpages/chardlg.cxx
index b14bf3a..c5fc178 100644
--- a/cui/source/tabpages/chardlg.cxx
+++ b/cui/source/tabpages/chardlg.cxx
@@ -201,11 +201,7 @@ void SvxCharBasePage::makeWidgets(Window *pParent, const ResId& rResId,
     m_pFontTypeFT = new FixedInfo(pParent, ResId( nResIdFontTypeFT, *rResId.GetResMgr()));
     m_pPreviewWin = new SvxFontPrevWindow(pParent, ResId( nResIdPrewievWin, *rResId.GetResMgr()));
 
-    rtl::OString sFill(RTL_CONSTASCII_STRINGPARAM("fill"));
-    rtl::OString sExpand(RTL_CONSTASCII_STRINGPARAM("expand"));
-
-    m_pPreviewWin->setChildProperty(sFill, true);
-    m_pPreviewWin->setChildProperty(sExpand, true);
+    m_pPreviewWin->set_expand(true);
 }
 
 // -----------------------------------------------------------------------
@@ -297,11 +293,7 @@ SvxCharNamePage::SvxCharNamePage( Window* pParent, const SfxItemSet& rInSet )
     , m_aGrid(&m_aBox)
     , m_pImpl(new SvxCharNamePage_Impl)
 {
-    rtl::OString sFill(RTL_CONSTASCII_STRINGPARAM("fill"));
-    rtl::OString sExpand(RTL_CONSTASCII_STRINGPARAM("expand"));
-
-    m_aBox.setChildProperty(sFill, true);
-    m_aBox.setChildProperty(sExpand, true);
+    m_aBox.set_expand(true);
 
     m_pImpl->m_aNoStyleText = String( CUI_RES( STR_CHARNAME_NOSTYLE ) );
     m_pImpl->m_aTransparentText = String( CUI_RES( STR_CHARNAME_TRANSPARENT ) );
@@ -1536,11 +1528,7 @@ SvxCharEffectsPage::SvxCharEffectsPage( Window* pParent, const SfxItemSet& rInSe
     , m_aPositionLB(&m_aGrid, CUI_RES(LB_POSITION))
     , m_aTransparentColorName(CUI_RES(STR_CHARNAME_TRANSPARENT))
 {
-    rtl::OString sFill(RTL_CONSTASCII_STRINGPARAM("fill"));
-    rtl::OString sExpand(RTL_CONSTASCII_STRINGPARAM("expand"));
-
-    m_aBox.setChildProperty(sFill, true);
-    m_aBox.setChildProperty(sExpand, true);
+    m_aBox.set_expand(true);
 
     m_aGrid.set_column_spacing(7);
     m_aGrid.set_row_spacing(2);
@@ -2840,11 +2828,7 @@ SvxCharPositionPage::SvxCharPositionPage( Window* pParent, const SfxItemSet& rIn
     , m_nSuperProp((sal_uInt8)DFLT_ESC_PROP)
     , m_nSubProp((sal_uInt8)DFLT_ESC_PROP)
 {
-    rtl::OString sFill(RTL_CONSTASCII_STRINGPARAM("fill"));
-    rtl::OString sExpand(RTL_CONSTASCII_STRINGPARAM("expand"));
-
-    m_aBox.setChildProperty(sFill, true);
-    m_aBox.setChildProperty(sExpand, true);
+    m_aBox.set_expand(true);
 
     m_aPositionGrid.set_column_spacing(7);
     m_aPositionGrid.set_row_spacing(2);
@@ -3611,11 +3595,7 @@ SvxCharTwoLinesPage::SvxCharTwoLinesPage(Window* pParent, const SfxItemSet& rInS
     , m_nStartBracketPosition( 0 )
     , m_nEndBracketPosition( 0 )
 {
-    rtl::OString sFill(RTL_CONSTASCII_STRINGPARAM("fill"));
-    rtl::OString sExpand(RTL_CONSTASCII_STRINGPARAM("expand"));
-
-    m_aBox.setChildProperty(sFill, true);
-    m_aBox.setChildProperty(sExpand, true);
+    m_aBox.set_expand(true);
 
     m_aGrid.set_column_spacing(7);
     m_aGrid.set_row_spacing(2);
diff --git a/sfx2/source/dialog/tabdlg.cxx b/sfx2/source/dialog/tabdlg.cxx
index 65fdb25..4b3e06f 100644
--- a/sfx2/source/dialog/tabdlg.cxx
+++ b/sfx2/source/dialog/tabdlg.cxx
@@ -524,18 +524,13 @@ void SfxTabDialog::Init_Impl( sal_Bool bFmtFlag, const String* pUserButtonText,
 */
 
 {
-    rtl::OString sFill(RTL_CONSTASCII_STRINGPARAM("fill"));
-    rtl::OString sExpand(RTL_CONSTASCII_STRINGPARAM("expand"));
-    rtl::OString sPackType(RTL_CONSTASCII_STRINGPARAM("pack-type"));
-
     fprintf(stderr, "BUILDER is %p\n", m_pUIBuilder);
     m_pVBox = m_pUIBuilder ? static_cast<VclVBox*>(m_pUIBuilder->get_by_name("dialog-vbox1")) : NULL;
     m_bOwnsVBox = m_pVBox == NULL;
     if (m_bOwnsVBox)
     {
         m_pVBox = new VclVBox(this, false, 7);
-        m_pVBox->setChildProperty(sFill, true);
-        m_pVBox->setChildProperty(sExpand, true);
+        m_pVBox->set_expand(true);
     }
 
     m_pTabCtrl = m_pUIBuilder ? static_cast<TabControl*>(m_pUIBuilder->get_by_name(SAL_STRINGIFY(ID_TABCONTROL))) : NULL;
@@ -543,17 +538,13 @@ void SfxTabDialog::Init_Impl( sal_Bool bFmtFlag, const String* pUserButtonText,
     if (m_bOwnsTabCtrl)
     {
         m_pTabCtrl = new TabControl(m_pVBox, ResId(ID_TABCONTROL, *rResId.GetResMgr()));
-        m_pTabCtrl->setChildProperty(sFill, true);
-        m_pTabCtrl->setChildProperty(sExpand, true);
+        m_pTabCtrl->set_expand(true);
     }
 
     m_pActionArea = m_pUIBuilder ? static_cast<VclHButtonBox*>(m_pUIBuilder->get_by_name("dialog-action_area1")) : NULL;
     m_bOwnsActionArea = m_pActionArea == NULL;
     if (m_bOwnsActionArea)
-    {
         m_pActionArea = new VclHButtonBox(m_pVBox);
-        m_pActionArea->setChildProperty(sFill, true);
-    }
 
     m_pOKBtn = m_pUIBuilder ? static_cast<OKButton*>(m_pUIBuilder->get_by_name("ok")) : NULL;
     m_bOwnsOKBtn = m_pOKBtn == NULL;
diff --git a/sw/source/ui/chrdlg/chardlg.cxx b/sw/source/ui/chrdlg/chardlg.cxx
index 711ae76..883f341 100644
--- a/sw/source/ui/chrdlg/chardlg.cxx
+++ b/sw/source/ui/chrdlg/chardlg.cxx
@@ -179,11 +179,7 @@ SwCharURLPage::SwCharURLPage(Window* pParent, const SfxItemSet& rCoreSet)
 {
     FreeResource();
 
-    rtl::OString sFill(RTL_CONSTASCII_STRINGPARAM("fill"));
-    rtl::OString sExpand(RTL_CONSTASCII_STRINGPARAM("expand"));
-
-    m_aBox.setChildProperty(sFill, true);
-    m_aBox.setChildProperty(sExpand, true);
+    m_aBox.set_expand(true);
 
     m_aGrid.set_column_spacing(7);
     m_aGrid.set_row_spacing(2);
diff --git a/sw/source/ui/dialog/wordcountdialog.cxx b/sw/source/ui/dialog/wordcountdialog.cxx
index 8b8dcd8..b33f17e 100644
--- a/sw/source/ui/dialog/wordcountdialog.cxx
+++ b/sw/source/ui/dialog/wordcountdialog.cxx
@@ -85,82 +85,36 @@ SwWordCountDialog::SwWordCountDialog(Dialog* pParent)
     aDocCharacterFI.SetText(sForceInitialSize);
     aDocCharacterExcludingSpacesFI.SetText(sForceInitialSize);
 
-    rtl::OString sFill(RTL_CONSTASCII_STRINGPARAM("fill"));
-    rtl::OString sExpand(RTL_CONSTASCII_STRINGPARAM("expand"));
-    rtl::OString sPackType(RTL_CONSTASCII_STRINGPARAM("pack-type"));
+    content_area.set_expand(true);
 
-    vbox.setChildProperty(sFill, true);
+    aCurrentSelectionLine.set_expand(true);
 
-    action_area.setChildProperty(sFill, true);
+    aSelectionBox.set_border_width(7);
 
-    content_area.setChildProperty(sFill, true);
-    content_area.setChildProperty(sExpand, true);
+    aSelectionRow1.set_expand(true);
+    aCurrentWordFI.set_expand(true);
 
-    aCurrentSelection.setChildProperty(sFill, true);
-    aCurrentSelectionText.setChildProperty(sFill, true);
-    aCurrentSelectionLine.setChildProperty(sFill, true);
-    aCurrentSelectionLine.setChildProperty(sExpand, true);
+    aSelectionRow2.set_expand(true);
+    aCurrentCharacterFI.set_expand(true);
+    aSelectionRow3.set_expand(true);
+    aCurrentCharacterExcludingSpacesFI.set_expand(true);
 
-    aSelectionBox.setChildProperty(sFill, true);
-    aSelectionBox.set_border_width(7);
+    aDocLine.set_expand(true);
 
-    aSelectionRow1.setChildProperty(sFill, true);
-    aSelectionRow1.setChildProperty(sExpand, true);
-    aCurrentWordFT.setChildProperty(sFill, true);
-    aCurrentWordFI.setChildProperty(sFill, true);
-    aCurrentWordFI.setChildProperty(sExpand, true);
-
-    aSelectionRow2.setChildProperty(sFill, true);
-    aSelectionRow2.setChildProperty(sExpand, true);
-    aCurrentCharacterFT.setChildProperty(sFill, true);
-    aCurrentCharacterFI.setChildProperty(sFill, true);
-    aCurrentCharacterFI.setChildProperty(sExpand, true);
-    aSelectionRow3.setChildProperty(sFill, true);
-    aSelectionRow3.setChildProperty(sExpand, true);
-    aCurrentCharacterExcludingSpacesFT.setChildProperty(sFill, true);
-    aCurrentCharacterExcludingSpacesFI.setChildProperty(sFill, true);
-    aCurrentCharacterExcludingSpacesFI.setChildProperty(sExpand, true);
-
-    aDoc.setChildProperty(sFill, true);
-    aDocText.setChildProperty(sFill, true);
-    aDocLine.setChildProperty(sFill, true);
-    aDocLine.setChildProperty(sExpand, true);
-
-    aDocBox.setChildProperty(sFill, true);
     aDocBox.set_border_width(7);
 
-    aDocRow1.setChildProperty(sFill, true);
-    aDocRow1.setChildProperty(sExpand, true);
-    aDocWordFT.setChildProperty(sFill, true);
-    aDocWordFI.setChildProperty(sFill, true);
-    aDocWordFI.setChildProperty(sExpand, true);
-
-    aDocRow2.setChildProperty(sFill, true);
-    aDocRow2.setChildProperty(sExpand, true);
-    aDocCharacterFT.setChildProperty(sFill, true);
-    aDocCharacterFI.setChildProperty(sFill, true);
-    aDocCharacterFI.setChildProperty(sExpand, true);
-    aDocRow3.setChildProperty(sFill, true);
-    aDocRow3.setChildProperty(sExpand, true);
-    aDocCharacterExcludingSpacesFT.setChildProperty(sFill, true);
-    aDocCharacterExcludingSpacesFI.setChildProperty(sFill, true);
-    aDocCharacterExcludingSpacesFI.setChildProperty(sExpand, true);
-
-    aBottomFL.setChildProperty(sFill, true);
-    aBottomFL.setChildProperty(sFill, true);
-
-    aOK.setChildProperty<sal_Int32>(sPackType, VCL_PACK_END);
-    aHelp.setChildProperty<sal_Int32>(sPackType, VCL_PACK_END);
+    aDocRow1.set_expand(true);
+    aDocWordFT.set_expand(true);
 
-    aOK.SetClickHdl(LINK(this, SwWordCountDialog, OkHdl));
+    aDocRow2.set_expand(true);
+    aDocCharacterFI.set_expand(true);
+    aDocRow3.set_expand(true);
+    aDocCharacterExcludingSpacesFI.set_expand(true);
 
-    fprintf(stderr, "aOk is %p\n", &aOK);
-    fprintf(stderr, "aHelp is %p\n", &aHelp);
-    fprintf(stderr, "action_area is is %p\n", &action_area);
-    fprintf(stderr, "aCurrentSelectionLine is is %p\n", &aCurrentSelectionLine);
-    fprintf(stderr, "aCurrentSelectionText is is %p\n", &aCurrentSelectionText);
-    fprintf(stderr, "aCurrentSelection is is %p\n", &aCurrentSelection);
-    fprintf(stderr, "vbox is is %p\n", &vbox);
+    aOK.set_pack_type(VCL_PACK_END);
+    aHelp.set_pack_type(VCL_PACK_END);
+
+    aOK.SetClickHdl(LINK(this, SwWordCountDialog, OkHdl));
 
     pParent->SetMinOutputSizePixel(vbox.GetOptimalSize(WINDOWSIZE_PREFERRED));
 
diff --git a/vcl/inc/brdwin.hxx b/vcl/inc/brdwin.hxx
index d2dea40..af26438 100644
--- a/vcl/inc/brdwin.hxx
+++ b/vcl/inc/brdwin.hxx
@@ -188,10 +188,6 @@ public:
     Rectangle               GetMenuRect() const;
 
     virtual Size            GetOptimalSize(WindowSizeType eType) const;
-    virtual void            setChildAnyProperty(const rtl::OString &rString,
-                                                const ::com::sun::star::uno::Any &rValue);
-    virtual ::com::sun::star::uno::Any getWidgetAnyProperty(const rtl::OString &rString) const;
-
 };
 
 // =======================================================================
diff --git a/vcl/inc/vcl/builder.hxx b/vcl/inc/vcl/builder.hxx
index c9d0ee0..f5a1006 100644
--- a/vcl/inc/vcl/builder.hxx
+++ b/vcl/inc/vcl/builder.hxx
@@ -48,10 +48,12 @@ private:
     {
         rtl::OString m_sID;
         Window *m_pWindow;
+        sal_Int32 m_nPosition;
         bool m_bOwned;
         WinAndId(const rtl::OString &rId, Window *pWindow)
             : m_sID(rId)
             , m_pWindow(pWindow)
+            , m_nPosition(-1)
             , m_bOwned(true)
         {
         }
@@ -126,7 +128,7 @@ public:
     ~VclBuilder();
     Window *get_widget_root();
     Window *get_by_name(rtl::OString sID);
-    rtl::OString get_by_window(const Window *pWindow);
+    rtl::OString get_by_window(const Window *pWindow) const;
     //for the purposes of retrofitting this to the existing code
     //look up sID, clone its properties into replacement and
     //splice replacement into the tree instead of it, without
@@ -151,6 +153,9 @@ private:
     void handleAdjustment(const rtl::OString &rID, stringmap &rProperties);
     void handleTabChild(Window *pParent, xmlreader::XmlReader &reader);
 
+    sal_Int32 get_window_packing_position(const Window *pWindow) const;
+    void set_window_packing_position(const Window *pWindow, sal_Int32 nPosition);
+
     //Helpers to retrofit all the existing code the the builder
     static void swapGuts(Window &rOrig, Window &rReplacement);
     static sal_uInt16 getPositionWithinParent(Window &rWindow);
diff --git a/vcl/inc/vcl/layout.hxx b/vcl/inc/vcl/layout.hxx
index e9ed52e..aa78852 100644
--- a/vcl/inc/vcl/layout.hxx
+++ b/vcl/inc/vcl/layout.hxx
@@ -58,12 +58,6 @@ private:
     int m_nBorderWidth;
 };
 
-enum VclPackType
-{
-    VCL_PACK_START = 0,
-    VCL_PACK_END = 1
-};
-
 class VCL_DLLPUBLIC VclBox : public VclContainer
 {
 protected:
diff --git a/vcl/inc/vcl/vclenum.hxx b/vcl/inc/vcl/vclenum.hxx
index e497fc4..a655893 100644
--- a/vcl/inc/vcl/vclenum.hxx
+++ b/vcl/inc/vcl/vclenum.hxx
@@ -200,6 +200,12 @@ enum VclAlign
     VCL_ALIGN_CENTER
 };
 
+enum VclPackType
+{
+    VCL_PACK_START = 0,
+    VCL_PACK_END = 1
+};
+
 #endif  // _VCL_VCLENUM_HXX
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/vcl/window.hxx b/vcl/inc/vcl/window.hxx
index 5939dad..f08ad45 100644
--- a/vcl/inc/vcl/window.hxx
+++ b/vcl/inc/vcl/window.hxx
@@ -47,8 +47,6 @@
 #include <com/sun/star/uno/Reference.hxx>
 #include <boost/shared_ptr.hpp>
 
-#include <map>
-
 class VirtualDevice;
 struct ImplDelData;
 struct ImplWinData;
@@ -388,10 +386,6 @@ private:
     //
     WindowImpl* mpWindowImpl;
 
-    //^^^la la la, I can't hear you^^^
-    typedef std::map< ::rtl::OString, ::com::sun::star::uno::Any > ChildPropertyMap;
-    ChildPropertyMap m_aWidgetProperties;
-
     SAL_DLLPRIVATE void ImplInitWindowData( WindowType nType );
 
 #ifdef DBG_UTIL
@@ -1166,45 +1160,96 @@ public:
     void set_vexpand(bool bExpand);
 
     /*
+     * Gets whether the widget would like to use any available extra space.
+     */
+    bool get_expand() const;
+
+    /*
+     * Sets whether the widget would like to use any available extra space.
+     */
+    void set_expand(bool bExpand);
+
+    /*
+     * Gets whether the widget should receive extra space when the parent grows
+     */
+    bool get_fill() const;
+
+    /*
+     * Sets whether the widget should receive extra space when the parent grows
+     */
+    void set_fill(bool bFill);
+
+    /*
+     * Gets how the widget is packed with reference to the start or end of the parent
+     */
+    VclPackType get_pack_type() const;
+
+    /*
+     * Sets how the widget is packed with reference to the start or end of the parent
+     */
+    void set_pack_type(VclPackType ePackType);
+
+    /*
+     * Sets extra space to put between the widget and its neighbors
+     */
+    sal_Int32 get_padding() const;
+
+    /*
+     * Sets extra space to put between the widget and its neighbors
+     */
+    void set_padding(sal_Int32 nPadding);
+
+    /*
+     * Gets the number of columns that the widget spans
+     */
+    sal_Int32 get_grid_width() const;
+
+    /*
+     * Sets the number of columns that the widget spans
+     */
+    void set_grid_width(sal_Int32 nCols);
+
+    /*
+     * Gets the column number to attach the left side of the widget to
+     */
+    sal_Int32 get_grid_left_attach() const;
+
+    /*
+     * Sets the column number to attach the left side of the widget to
+     */
+    void set_grid_left_attach(sal_Int32 nAttach);
+
+    /*
+     * Gets the number of row that the widget spans
+     */
+    sal_Int32 get_grid_height() const;
+
+    /*
+     * Sets the number of row that the widget spans
+     */
+    void set_grid_height(sal_Int32 nRows);
+
+    /*
+     * Gets the row number to attach the top side of the widget to
+     */
+    sal_Int32 get_grid_top_attach() const;
+
+    /*
+     * Sets the row number to attach the top side of the widget to
+     */
+    void set_grid_top_attach(sal_Int32 nAttach);
+
+
+    /*
      * Sets a widget property
      *
      * @return false if property is unknown
      */
     virtual bool set_property(const rtl::OString &rKey, const rtl::OString &rValue);
 
-    virtual void setChildAnyProperty(const rtl::OString &rString, const ::com::sun::star::uno::Any &rValue);
-    virtual ::com::sun::star::uno::Any getWidgetAnyProperty(const rtl::OString &rString) const;
-
-    template <typename T> T getWidgetProperty(const rtl::OString &rString, const T &rDefaultValue = T()) const
-    {
-        T nValue = rDefaultValue;
-        ::com::sun::star::uno::Any aAny = getWidgetAnyProperty(rString);
-        if (aAny.hasValue())
-            aAny >>= nValue;
-        return nValue;
-    }
-    template <typename T> void setChildProperty(const rtl::OString &rString, const T &rValue)
-    {
-        ::com::sun::star::uno::Any aAny;
-        aAny <<= rValue;
-        setChildAnyProperty(rString, aAny);
-    }
-    void setChildProperty(const rtl::OString &rString, const bool &rValue)
-    {
-        setChildProperty<sal_Bool>(rString, rValue);
-    }
-    bool getWidgetProperty(const rtl::OString &rString, const bool &rValue = false) const
-    {
-        return getWidgetProperty<sal_Bool>(rString, rValue);
-    }
-
-    //does nothing yet
-    template <typename T> T getWidgetStyleProperty(const rtl::OString &, const T &rDefaultValue = T()) const
-    {
-        T nValue = rDefaultValue;
-        return nValue;
-    }
-
+    /*
+     * Move this widget to be the nNewPosition'd child of its parent
+     */
     void reorderWithinParent(sal_uInt16 nNewPosition);
 
     /*
diff --git a/vcl/inc/window.h b/vcl/inc/window.h
index af7443c..cf27c16 100644
--- a/vcl/inc/window.h
+++ b/vcl/inc/window.h
@@ -317,6 +317,12 @@ public:
     AlwaysInputMode     meAlwaysInputMode;
     VclAlign            meHalign;
     VclAlign            meValign;
+    VclPackType         mePackType;
+    sal_Int32           mnPadding;
+    sal_Int32           mnGridHeight;
+    sal_Int32           mnGridLeftAttach;
+    sal_Int32           mnGridTopAttach;
+    sal_Int32           mnGridWidth;
     sal_uInt8           mbFrame:1,
                         mbBorderWin:1,
                         mbOverlapWin:1,
@@ -392,7 +398,9 @@ public:
                         mbHelpTextDynamic:1,
                         mbFakeFocusSet:1,
                         mbHexpand:1,
-                        mbVexpand:1;
+                        mbVexpand:1,
+                        mbExpand:1,
+                        mbFill:1;
 
     ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > mxDNDListenerContainer;
 };
diff --git a/vcl/source/window/brdwin.cxx b/vcl/source/window/brdwin.cxx
index 827e996..d5df2af 100644
--- a/vcl/source/window/brdwin.cxx
+++ b/vcl/source/window/brdwin.cxx
@@ -2371,20 +2371,4 @@ Size ImplBorderWindow::GetOptimalSize(WindowSizeType eType) const
     return Size(0, 0);
 }
 
-void ImplBorderWindow::setChildAnyProperty(const rtl::OString &rString, const ::com::sun::star::uno::Any &rValue)
-{
-    Window* pClientWindow = ImplGetClientWindow();
-    if (pClientWindow)
-        pClientWindow->setChildAnyProperty(rString, rValue);
-}
-
-::com::sun::star::uno::Any ImplBorderWindow::getWidgetAnyProperty(const rtl::OString &rString) const
-{
-    ::com::sun::star::uno::Any aAny;
-    Window* pClientWindow = ImplGetClientWindow();
-    if (pClientWindow)
-        aAny = pClientWindow->getWidgetAnyProperty(rString);
-    return aAny;
-}
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index 43f4030..0176bfa 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -599,8 +599,8 @@ void VclBuilder::handleChild(Window *pParent, xmlreader::XmlReader &reader)
 
                         for (size_t i = 0; i < aChilds.size(); ++i)
                         {
-                            sal_uInt16 nPosition = aChilds[i]->getWidgetProperty<sal_uInt16>(sPosition, 0xFFFF);
-                            if (nPosition == 0xFFFF)
+                            sal_Int32 nPosition = get_window_packing_position(aChilds[i]);
+                            if (nPosition == -1)
                                 continue;
                             reorderWithinParent(*aChilds[i], nPosition);
                         }
@@ -832,29 +832,44 @@ void VclBuilder::applyPackingProperty(Window *pCurrent,
                 xmlreader::XmlReader::TEXT_NORMALIZED, &name, &nsId);
             rtl::OString sValue(name.begin, name.length);
 
-            if ( sKey.equalsL(RTL_CONSTASCII_STRINGPARAM("expand")) ||
-                 sKey.equalsL(RTL_CONSTASCII_STRINGPARAM("fill")) )
+            if (sKey.equalsL(RTL_CONSTASCII_STRINGPARAM("expand")))
             {
                 bool bTrue = (sValue[0] == 't' || sValue[0] == 'T' || sValue[0] == '1');
-                pCurrent->setChildProperty(sKey, bTrue);
+                pCurrent->set_expand(bTrue);
             }
-            else if (sKey.equalsL(RTL_CONSTASCII_STRINGPARAM("position")))
+            else if (sKey.equalsL(RTL_CONSTASCII_STRINGPARAM("fill")))
             {
-                pCurrent->setChildProperty(sKey, static_cast<sal_uInt16>(sValue.toInt32()));
+                bool bTrue = (sValue[0] == 't' || sValue[0] == 'T' || sValue[0] == '1');
+                pCurrent->set_fill(bTrue);
             }
             else if (sKey.equalsL(RTL_CONSTASCII_STRINGPARAM("pack-type")))
             {
-                sal_Int32 nPackType = (sValue[0] == 'e' || sValue[0] == 'e') ? VCL_PACK_END : VCL_PACK_START;
-                pCurrent->setChildProperty(sKey, nPackType);
+                VclPackType ePackType = (sValue[0] == 'e' || sValue[0] == 'e') ? VCL_PACK_END : VCL_PACK_START;
+                pCurrent->set_pack_type(ePackType);
+            }
+            else if (sKey.equalsL(RTL_CONSTASCII_STRINGPARAM("left-attach")))
+            {
+                pCurrent->set_grid_left_attach(sValue.toInt32());
+            }
+            else if (sKey.equalsL(RTL_CONSTASCII_STRINGPARAM("top-attach")))
+            {
+                pCurrent->set_grid_top_attach(sValue.toInt32());
             }
-            else if (
-                      sKey.equalsL(RTL_CONSTASCII_STRINGPARAM("left-attach")) ||
-                      sKey.equalsL(RTL_CONSTASCII_STRINGPARAM("top-attach")) ||
-                      sKey.equalsL(RTL_CONSTASCII_STRINGPARAM("width")) ||
-                      sKey.equalsL(RTL_CONSTASCII_STRINGPARAM("height"))
-                    )
+            else if (sKey.equalsL(RTL_CONSTASCII_STRINGPARAM("width")))
             {
-                pCurrent->setChildProperty(sKey, sValue.toInt32());
+                pCurrent->set_grid_width(sValue.toInt32());
+            }
+            else if (sKey.equalsL(RTL_CONSTASCII_STRINGPARAM("height")))
+            {
+                pCurrent->set_grid_height(sValue.toInt32());
+            }
+            else if (sKey.equalsL(RTL_CONSTASCII_STRINGPARAM("padding")))
+            {
+                pCurrent->set_padding(sValue.toInt32());
+            }
+            else if (sKey.equalsL(RTL_CONSTASCII_STRINGPARAM("position")))
+            {
+                set_window_packing_position(pCurrent, sValue.toInt32());
             }
             else
                 fprintf(stderr, "unknown packing %s\n", sKey.getStr());
@@ -934,9 +949,9 @@ Window *VclBuilder::get_by_name(rtl::OString sID)
     return NULL;
 }
 
-rtl::OString VclBuilder::get_by_window(const Window *pWindow)
+rtl::OString VclBuilder::get_by_window(const Window *pWindow) const
 {
-    for (std::vector<WinAndId>::iterator aI = m_aChildren.begin(),
+    for (std::vector<WinAndId>::const_iterator aI = m_aChildren.begin(),
          aEnd = m_aChildren.end(); aI != aEnd; ++aI)
     {
         if (aI->m_pWindow == pWindow)
@@ -946,6 +961,28 @@ rtl::OString VclBuilder::get_by_window(const Window *pWindow)
     return rtl::OString();
 }
 
+sal_Int32 VclBuilder::get_window_packing_position(const Window *pWindow) const
+{
+    for (std::vector<WinAndId>::const_iterator aI = m_aChildren.begin(),
+         aEnd = m_aChildren.end(); aI != aEnd; ++aI)
+    {
+        if (aI->m_pWindow == pWindow)
+            return aI->m_nPosition;
+    }
+
+    return -1;
+}
+
+void VclBuilder::set_window_packing_position(const Window *pWindow, sal_Int32 nPosition)
+{
+    for (std::vector<WinAndId>::iterator aI = m_aChildren.begin(),
+         aEnd = m_aChildren.end(); aI != aEnd; ++aI)
+    {
+        if (aI->m_pWindow == pWindow)
+            aI->m_nPosition = nPosition;
+    }
+}
+
 VclBuilder::ListStore *VclBuilder::get_model_by_name(rtl::OString sID)
 {
     for (std::vector<ModelAndId>::iterator aI = m_aModels.begin(),
@@ -994,7 +1031,6 @@ void VclBuilder::swapGuts(Window &rOrig, Window &rReplacement)
     Window *pOrigsNext = rOrig.mpWindowImpl->mpNext;
     Window *pOrigsPrev = rOrig.mpWindowImpl->mpPrev;
     std::swap(rOrig.mpWindowImpl, rReplacement.mpWindowImpl);
-    std::swap(rOrig.m_aWidgetProperties, rReplacement.m_aWidgetProperties);
     assert(rReplacement.mpWindowImpl->mpPrev == pOrigsPrev);
     assert(rReplacement.mpWindowImpl->mpNext == pOrigsNext);
     if (pOrigsNext)
diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx
index d3a8ab4..6c9305c 100644
--- a/vcl/source/window/layout.cxx
+++ b/vcl/source/window/layout.cxx
@@ -170,7 +170,7 @@ void VclBox::setAllocation(const Size &rAllocation)
         if (!pChild->IsVisible())
             continue;
         ++nVisibleChildren;
-        bool bExpand = pChild->getWidgetProperty<sal_Bool>(sExpand);
+        bool bExpand = pChild->get_expand();
         if (bExpand)
             ++nExpandChildren;
     }
@@ -210,12 +210,12 @@ void VclBox::setAllocation(const Size &rAllocation)
             if (!pChild->IsVisible())
                 continue;
 
-            sal_Int32 ePacking = pChild->getWidgetProperty<sal_Int32>(sPackType);
+            sal_Int32 ePacking = pChild->get_pack_type();
 
             if (ePacking != ePackType)
                 continue;
 
-            long nPadding = pChild->getWidgetProperty<sal_Int32>(sPadding);
+            long nPadding = pChild->get_padding();
 
             Size aBoxSize;
             if (m_bHomogeneous)
@@ -225,7 +225,7 @@ void VclBox::setAllocation(const Size &rAllocation)
                 aBoxSize = pChild->get_preferred_size();
                 long nPrimaryDimension = getPrimaryDimension(aBoxSize);
                 nPrimaryDimension += nPadding;
-                bool bExpand = pChild->getWidgetProperty<bool>(sExpand);
+                bool bExpand = pChild->get_expand();
                 if (bExpand)
                     setPrimaryDimension(aBoxSize, nPrimaryDimension + nExtraSpace);
             }
@@ -235,7 +235,7 @@ void VclBox::setAllocation(const Size &rAllocation)
             Size aChildSize(aBoxSize);
             long nPrimaryCoordinate = getPrimaryCoordinate(aPos);
 
-            bool bFill = pChild->getWidgetProperty<sal_Bool>(sFill, sal_True);
+            bool bFill = pChild->get_fill();
             if (bFill)
             {
                 setPrimaryDimension(aChildSize, std::max(static_cast<long>(1),
@@ -287,10 +287,8 @@ Size VclButtonBox::calculateRequisition() const
 {
     sal_uInt16 nVisibleChildren = 0;
 
-    rtl::OString sChildMinWidth(RTL_CONSTASCII_STRINGPARAM("child-min-width"));
-    sal_Int32 nChildMinWidth = getWidgetStyleProperty<sal_Int32>(sChildMinWidth, DEFAULT_CHILD_MIN_WIDTH);
-    rtl::OString sChildMinHeight(RTL_CONSTASCII_STRINGPARAM("child-min-height"));
-    sal_Int32 nChildMinHeight = getWidgetStyleProperty<sal_Int32>(sChildMinHeight, DEFAULT_CHILD_MIN_HEIGHT);
+    sal_Int32 nChildMinWidth = DEFAULT_CHILD_MIN_WIDTH; //to-do, pull from theme
+    sal_Int32 nChildMinHeight = DEFAULT_CHILD_MIN_HEIGHT; //to-do, pull from theme
     Size aSize(nChildMinWidth, nChildMinHeight);
 
     for (Window *pChild = GetWindow(WINDOW_FIRSTCHILD); pChild; pChild = pChild->GetWindow(WINDOW_NEXT))
@@ -413,12 +411,12 @@ VclGrid::array_type VclGrid::assembleGrid() const
         if (!pChild->IsVisible())
             continue;
 
-        sal_Int32 nLeftAttach = pChild->getWidgetProperty<sal_Int32>(sLeftAttach);
-        sal_Int32 nWidth = pChild->getWidgetProperty<sal_Int32>(sWidth, 1);
+        sal_Int32 nLeftAttach = pChild->get_grid_left_attach();
+        sal_Int32 nWidth = pChild->get_grid_width();
         sal_Int32 nMaxXPos = nLeftAttach+nWidth-1;
 
-        sal_Int32 nTopAttach = pChild->getWidgetProperty<sal_Int32>(sTopAttach);
-        sal_Int32 nHeight = pChild->getWidgetProperty<sal_Int32>(sHeight, 1);
+        sal_Int32 nTopAttach = pChild->get_grid_top_attach();
+        sal_Int32 nHeight = pChild->get_grid_height();
         sal_Int32 nMaxYPos = nTopAttach+nHeight-1;
 
         sal_Int32 nCurrentMaxXPos = A.shape()[0]-1;
@@ -448,11 +446,11 @@ VclGrid::array_type VclGrid::assembleGrid() const
             const Window *pChild = A[x][y];
             if (pChild)
             {
-                sal_Int32 nWidth = pChild->getWidgetProperty<sal_Int32>(sWidth, 1);
+                sal_Int32 nWidth = pChild->get_grid_width();
                 for (sal_Int32 nSpanX = 0; nSpanX < nWidth; ++nSpanX)
                     aNonEmptyCols[x+nSpanX] = true;
 
-                sal_Int32 nHeight = pChild->getWidgetProperty<sal_Int32>(sHeight, 1);
+                sal_Int32 nHeight = pChild->get_grid_height();
                 for (sal_Int32 nSpanY = 0; nSpanY < nHeight; ++nSpanY)
                     aNonEmptyRows[y+nSpanY] = true;
             }
@@ -514,11 +512,11 @@ void VclGrid::calcMaxs(const array_type &A, std::vector<long> &rWidths, std::vec
                 continue;
             Size aChildSize = pChild->get_preferred_size();
 
-            sal_Int32 nWidth = pChild->getWidgetProperty<sal_Int32>(sWidth, 1);
+            sal_Int32 nWidth = pChild->get_grid_width();
             for (sal_Int32 nSpanX = 0; nSpanX < nWidth; ++nSpanX)
                 rWidths[x+nSpanX] = std::max(rWidths[x+nSpanX], aChildSize.Width()/nWidth);
 
-            sal_Int32 nHeight = pChild->getWidgetProperty<sal_Int32>(sHeight, 1);
+            sal_Int32 nHeight = pChild->get_grid_height();
             for (sal_Int32 nSpanY = 0; nSpanY < nHeight; ++nSpanY)
                 rHeights[y+nSpanY] = std::max(rHeights[y+nSpanY], aChildSize.Height()/nHeight);
         }
@@ -619,12 +617,12 @@ void VclGrid::setAllocation(const Size& rAllocation)
             {
                 Size aChildAlloc(0, 0);
 
-                sal_Int32 nWidth = pChild->getWidgetProperty<sal_Int32>(sWidth, 1);
+                sal_Int32 nWidth = pChild->get_grid_width();
                 for (sal_Int32 nSpanX = 0; nSpanX < nWidth; ++nSpanX)
                     aChildAlloc.Width() += aWidths[x+nSpanX];
                 aChildAlloc.Width() += get_column_spacing()*(nWidth-1);
 
-                sal_Int32 nHeight = pChild->getWidgetProperty<sal_Int32>(sHeight, 1);
+                sal_Int32 nHeight = pChild->get_grid_height();
                 for (sal_Int32 nSpanY = 0; nSpanY < nHeight; ++nSpanY)
                     aChildAlloc.Height() += aHeights[y+nSpanY];
                 aChildAlloc.Height() += get_row_spacing()*(nHeight-1);
@@ -715,14 +713,10 @@ bool VclGrid::set_property(const rtl::OString &rKey, const rtl::OString &rValue)
 
 void setGridAttach(Window &rWidget, sal_Int32 nLeft, sal_Int32 nTop, sal_Int32 nWidth, sal_Int32 nHeight)
 {
-    rtl::OString sLeftAttach(RTL_CONSTASCII_STRINGPARAM("left-attach"));
-    rWidget.setChildProperty<sal_Int32>(sLeftAttach, nLeft);
-    rtl::OString sTopAttach(RTL_CONSTASCII_STRINGPARAM("top-attach"));
-    rWidget.setChildProperty<sal_Int32>(sTopAttach, nTop);
-    rtl::OString sWidth(RTL_CONSTASCII_STRINGPARAM("width"));
-    rWidget.setChildProperty<sal_Int32>(sWidth, nWidth);
-    rtl::OString sHeight(RTL_CONSTASCII_STRINGPARAM("height"));
-    rWidget.setChildProperty<sal_Int32>(sHeight, nHeight);
+    rWidget.set_grid_left_attach(nLeft);
+    rWidget.set_grid_top_attach(nTop);
+    rWidget.set_grid_width(nWidth);
+    rWidget.set_grid_height(nHeight);
 }
 
 const Window *VclBin::get_child() const
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index d969698..a024929 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -634,6 +634,14 @@ void Window::ImplInitWindowData( WindowType nType )
     mpWindowImpl->mnDlgCtrlFlags      = 0;            // DialogControl-Flags
     mpWindowImpl->mnLockCount         = 0;            // LockCount
     mpWindowImpl->meAlwaysInputMode   = AlwaysInputNone; // neither AlwaysEnableInput nor AlwaysDisableInput called
+    mpWindowImpl->meHalign            = VCL_ALIGN_FILL;
+    mpWindowImpl->meValign            = VCL_ALIGN_FILL;
+    mpWindowImpl->mePackType          = VCL_PACK_START;
+    mpWindowImpl->mnPadding           = 0;
+    mpWindowImpl->mnGridHeight        = 1;
+    mpWindowImpl->mnGridLeftAttach    = 0;
+    mpWindowImpl->mnGridTopAttach     = 0;
+    mpWindowImpl->mnGridWidth         = 1;
     mpWindowImpl->mbFrame             = sal_False;        // sal_True: Window is a frame window
     mpWindowImpl->mbBorderWin         = sal_False;        // sal_True: Window is a border window
     mpWindowImpl->mbOverlapWin        = sal_False;        // sal_True: Window is a overlap window
@@ -711,8 +719,8 @@ void Window::ImplInitWindowData( WindowType nType )
     mpWindowImpl->mbFakeFocusSet = sal_False; // sal_True: pretend as if the window has focus.
     mpWindowImpl->mbHexpand = false;
     mpWindowImpl->mbVexpand = false;
-    mpWindowImpl->meHalign = VCL_ALIGN_FILL;
-    mpWindowImpl->meValign = VCL_ALIGN_FILL;
+    mpWindowImpl->mbExpand = false;
+    mpWindowImpl->mbFill = true;
 
 
     mbEnableRTL         = Application::GetSettings().GetLayoutRTL();         // sal_True: this outdev will be mirrored if RTL window layout (UI mirroring) is globally active
@@ -5411,28 +5419,6 @@ void Window::SetStyle( WinBits nStyle )
     }
 }
 
-void Window::set_height_request(sal_Int32 nHeightRequest)
-{
-    DBG_CHKTHIS( Window, ImplDbgCheckWindow );
-
-    if ( mpWindowImpl->mnHeightRequest != nHeightRequest )
-    {
-        mpWindowImpl->mnHeightRequest = nHeightRequest;
-        queue_resize();
-    }
-}
-
-void Window::set_width_request(sal_Int32 nWidthRequest)
-{
-    DBG_CHKTHIS( Window, ImplDbgCheckWindow );
-
-    if ( mpWindowImpl->mnWidthRequest != nWidthRequest )
-    {
-        mpWindowImpl->mnWidthRequest = nWidthRequest;
-        queue_resize();
-    }
-}
-
 // -----------------------------------------------------------------------
 
 void Window::SetExtendedStyle( WinBits nExtendedStyle )
diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx
index 91c799e..bf68bbe 100644
--- a/vcl/source/window/window2.cxx
+++ b/vcl/source/window/window2.cxx
@@ -1761,34 +1761,6 @@ void Window::queue_resize()
         pParent->Resize();
 }
 
-void Window::setChildAnyProperty(const rtl::OString &rString, const uno::Any &rValue)
-{
-    m_aWidgetProperties[rString] <<= rValue;
-}
-
-uno::Any Window::getWidgetAnyProperty(const rtl::OString &rString) const
-{
-    uno::Any aAny;
-    ChildPropertyMap::const_iterator aI = m_aWidgetProperties.find(rString);
-    if (aI != m_aWidgetProperties.end())
-        aAny = aI->second;
-    return aAny;
-}
-
-Size Window::get_preferred_size() const
-{
-    Size aRet(mpWindowImpl->mnWidthRequest, mpWindowImpl->mnHeightRequest);
-    if (aRet.Width() == -1 || aRet.Height() == -1)
-    {
-        Size aOptimal = GetOptimalSize(WINDOWSIZE_PREFERRED);
-        if (aRet.Width() == -1)
-            aRet.Width() = aOptimal.Width();
-        if (aRet.Height() == -1)
-            aRet.Height() = aOptimal.Height();
-    }
-    return aRet;
-}
-
 void Window::take_properties(Window &rOther)
 {
     if (!mpWindowImpl)
@@ -1838,6 +1810,14 @@ void Window::take_properties(Window &rOther)
     mpWindowImpl->mnDlgCtrlFlags = pWindowImpl->mnDlgCtrlFlags;
     mpWindowImpl->mnLockCount = pWindowImpl->mnLockCount;
     mpWindowImpl->meAlwaysInputMode = pWindowImpl->meAlwaysInputMode;
+    mpWindowImpl->meHalign = pWindowImpl->meHalign;
+    mpWindowImpl->meValign = pWindowImpl->meValign;
+    mpWindowImpl->mePackType = pWindowImpl->mePackType;
+    mpWindowImpl->mnPadding = pWindowImpl->mnPadding;
+    mpWindowImpl->mnGridHeight = pWindowImpl->mnGridHeight;
+    mpWindowImpl->mnGridLeftAttach = pWindowImpl->mnGridLeftAttach;
+    mpWindowImpl->mnGridTopAttach = pWindowImpl->mnGridTopAttach;
+    mpWindowImpl->mnGridWidth = pWindowImpl->mnGridWidth;
     mpWindowImpl->mbFrame = pWindowImpl->mbFrame;
     mpWindowImpl->mbBorderWin = pWindowImpl->mbBorderWin;
     mpWindowImpl->mbOverlapWin = pWindowImpl->mbOverlapWin;
@@ -1914,10 +1894,8 @@ void Window::take_properties(Window &rOther)
     mpWindowImpl->mbFakeFocusSet = pWindowImpl->mbFakeFocusSet;
     mpWindowImpl->mbHexpand = pWindowImpl->mbHexpand;
     mpWindowImpl->mbVexpand = pWindowImpl->mbVexpand;
-    mpWindowImpl->meHalign = pWindowImpl->meHalign;
-    mpWindowImpl->meValign = pWindowImpl->meValign;
-
-    std::swap(m_aWidgetProperties, rOther.m_aWidgetProperties);
+    mpWindowImpl->mbExpand = pWindowImpl->mbExpand;
+    mpWindowImpl->mbFill = pWindowImpl->mbFill;
 
     bool bHasBorderWindow = mpWindowImpl->mpBorderWindow;
     bool bOtherHasBorderWindow = pWindowImpl->mpBorderWindow;
@@ -2018,44 +1996,190 @@ bool Window::set_property(const rtl::OString &rKey, const rtl::OString &rValue)
     return true;
 }
 
+void Window::set_height_request(sal_Int32 nHeightRequest)
+{
+    DBG_CHKTHIS( Window, ImplDbgCheckWindow );
+
+    WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl : mpWindowImpl;
+
+    if ( pWindowImpl->mnHeightRequest != nHeightRequest )
+    {
+        pWindowImpl->mnHeightRequest = nHeightRequest;
+        queue_resize();
+    }
+}
+
+void Window::set_width_request(sal_Int32 nWidthRequest)
+{
+    DBG_CHKTHIS( Window, ImplDbgCheckWindow );
+
+    WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl : mpWindowImpl;
+
+    if ( pWindowImpl->mnWidthRequest != nWidthRequest )
+    {
+        pWindowImpl->mnWidthRequest = nWidthRequest;
+        queue_resize();
+    }
+}
+
+Size Window::get_preferred_size() const
+{
+    WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl : mpWindowImpl;
+
+    Size aRet(pWindowImpl->mnWidthRequest, pWindowImpl->mnHeightRequest);
+    if (aRet.Width() == -1 || aRet.Height() == -1)
+    {
+        Size aOptimal = GetOptimalSize(WINDOWSIZE_PREFERRED);
+        if (aRet.Width() == -1)
+            aRet.Width() = aOptimal.Width();
+        if (aRet.Height() == -1)
+            aRet.Height() = aOptimal.Height();
+    }
+    return aRet;
+}
+
 VclAlign Window::get_halign() const
 {
-    return mpWindowImpl->meHalign;
+    WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl : mpWindowImpl;
+    return pWindowImpl->meHalign;
 }
 
 void Window::set_halign(VclAlign eAlign)
 {
-    mpWindowImpl->meHalign = eAlign;
+    WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl : mpWindowImpl;
+    pWindowImpl->meHalign = eAlign;
 }
 
 VclAlign Window::get_valign() const
 {
-    return mpWindowImpl->meValign;
+    WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl : mpWindowImpl;
+    return pWindowImpl->meValign;
 }
 
 void Window::set_valign(VclAlign eAlign)
 {
-    mpWindowImpl->meValign = eAlign;
+    WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl : mpWindowImpl;
+    pWindowImpl->meValign = eAlign;
 }
 
 bool Window::get_hexpand() const
 {
-    return mpWindowImpl->mbHexpand;
+    WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl : mpWindowImpl;
+    return pWindowImpl->mbHexpand;
 }
 
 void Window::set_hexpand(bool bExpand)
 {
-    mpWindowImpl->mbHexpand = bExpand;
+    WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl : mpWindowImpl;
+    pWindowImpl->mbHexpand = bExpand;
 }
 
 bool Window::get_vexpand() const
 {
-    return mpWindowImpl->mbVexpand;
+    WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl : mpWindowImpl;
+    return pWindowImpl->mbVexpand;
 }
 
 void Window::set_vexpand(bool bExpand)
 {
-    mpWindowImpl->mbVexpand = bExpand;
+    WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl : mpWindowImpl;
+    pWindowImpl->mbVexpand = bExpand;
+}
+
+bool Window::get_expand() const
+{
+    WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl : mpWindowImpl;
+    return pWindowImpl->mbExpand;
+}
+
+void Window::set_expand(bool bExpand)
+{
+    WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl : mpWindowImpl;
+    pWindowImpl->mbExpand = bExpand;
+}
+
+VclPackType Window::get_pack_type() const
+{
+    WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl : mpWindowImpl;
+    return pWindowImpl->mePackType;
+}
+
+void Window::set_pack_type(VclPackType ePackType)
+{
+    WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl : mpWindowImpl;
+    pWindowImpl->mePackType = ePackType;
+}
+
+sal_Int32 Window::get_padding() const
+{
+    WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl : mpWindowImpl;
+    return pWindowImpl->mnPadding;
+}
+
+void Window::set_padding(sal_Int32 nPadding)
+{
+    WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl : mpWindowImpl;
+    pWindowImpl->mnPadding = nPadding;
+}
+
+bool Window::get_fill() const
+{
+    WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl : mpWindowImpl;
+    return pWindowImpl->mbFill;
+}
+
+void Window::set_fill(bool bFill)
+{
+    WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl : mpWindowImpl;
+    pWindowImpl->mbFill = bFill;
+}
+
+sal_Int32 Window::get_grid_width() const
+{
+    WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl : mpWindowImpl;
+    return pWindowImpl->mnGridWidth;
+}
+
+void Window::set_grid_width(sal_Int32 nCols)
+{
+    WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl : mpWindowImpl;
+    pWindowImpl->mnGridWidth = nCols;
+}
+
+sal_Int32 Window::get_grid_left_attach() const
+{
+    WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl : mpWindowImpl;
+    return pWindowImpl->mnGridLeftAttach;
+}
+
+void Window::set_grid_left_attach(sal_Int32 nAttach)
+{
+    WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl : mpWindowImpl;
+    pWindowImpl->mnGridLeftAttach = nAttach;
+}
+
+sal_Int32 Window::get_grid_height() const
+{
+    WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl : mpWindowImpl;
+    return pWindowImpl->mnGridHeight;
+}
+
+void Window::set_grid_height(sal_Int32 nRows)
+{
+    WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl : mpWindowImpl;
+    pWindowImpl->mnGridHeight = nRows;
+}
+
+sal_Int32 Window::get_grid_top_attach() const
+{
+    WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl : mpWindowImpl;
+    return pWindowImpl->mnGridTopAttach;
+}
+
+void Window::set_grid_top_attach(sal_Int32 nAttach)
+{
+    WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl : mpWindowImpl;
+    pWindowImpl->mnGridTopAttach = nAttach;
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


More information about the Libreoffice-commits mailing list