[Libreoffice-commits] .: Branch 'feature/cmclayout' - 7 commits - postprocess/checkxml postprocess/packconfig sfx2/inc sfx2/source sw/Package_uiconfig.mk sw/source sw/uiconfig vcl/inc vcl/source

Caolán McNamara caolan at kemper.freedesktop.org
Wed Apr 25 03:45:17 PDT 2012


 postprocess/checkxml/checkxml.pl     |    4 
 postprocess/packconfig/packconfig.pl |    2 
 sfx2/inc/sfx2/basedlgs.hxx           |    6 
 sfx2/source/dialog/basedlgs.cxx      |   44 +++
 sw/Package_uiconfig.mk               |    4 
 sw/source/ui/inc/titlepage.hxx       |   44 +--
 sw/source/ui/misc/titlepage.cxx      |  130 +++------
 sw/uiconfig/swriter/ui/titlepage.ui  |  491 +++++++++++++++++++++++++++++++++++
 vcl/inc/vcl/builder.hxx              |   21 +
 vcl/inc/vcl/button.hxx               |    4 
 vcl/source/control/button.cxx        |   18 +
 vcl/source/window/builder.cxx        |   69 +++-
 vcl/source/window/window.cxx         |   10 
 13 files changed, 720 insertions(+), 127 deletions(-)

New commits:
commit 7d358b1fe5c976b179ecc9d33877a3f3603d5ff6
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Apr 25 11:35:17 2012 +0100

    implement active property for checkboxes and radiobuttons

diff --git a/vcl/inc/vcl/button.hxx b/vcl/inc/vcl/button.hxx
index 89d4d8e..c5bc274 100644
--- a/vcl/inc/vcl/button.hxx
+++ b/vcl/inc/vcl/button.hxx
@@ -393,6 +393,8 @@ public:
     defines whether <code>this</code> is contained in the returned list
     */
     void            GetRadioButtonGroup( std::vector<RadioButton*>& io_rGroup, bool bIncludeThis ) const;
+
+    virtual bool set_property(const rtl::OString &rKey, const rtl::OString &rValue);
 };
 
 // ------------
@@ -480,6 +482,8 @@ public:
 
     void            SetToggleHdl( const Link& rLink ) { maToggleHdl = rLink; }
     const Link&     GetToggleHdl() const { return maToggleHdl; }
+
+    virtual bool set_property(const rtl::OString &rKey, const rtl::OString &rValue);
 };
 
 inline void CheckBox::Check( sal_Bool bCheck )
diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx
index 054fd50..5060bd1 100644
--- a/vcl/source/control/button.cxx
+++ b/vcl/source/control/button.cxx
@@ -2813,6 +2813,15 @@ void RadioButton::SetState( sal_Bool bCheck )
     }
 }
 
+bool RadioButton::set_property(const rtl::OString &rKey, const rtl::OString &rValue)
+{
+    if (rKey.equalsL(RTL_CONSTASCII_STRINGPARAM("active")))
+        SetState(toBool(rValue));
+    else
+        return Window::set_property(rKey, rValue);
+    return true;
+}
+
 // -----------------------------------------------------------------------
 
 void RadioButton::Check( sal_Bool bCheck )
@@ -3757,6 +3766,15 @@ void CheckBox::SetState( TriState eState )
     }
 }
 
+bool CheckBox::set_property(const rtl::OString &rKey, const rtl::OString &rValue)
+{
+    if (rKey.equalsL(RTL_CONSTASCII_STRINGPARAM("active")))
+        SetState(toBool(rValue) ? STATE_CHECK : STATE_NOCHECK);
+    else
+        return Window::set_property(rKey, rValue);
+    return true;
+}
+
 // -----------------------------------------------------------------------
 
 void CheckBox::EnableTriState( sal_Bool bTriState )
commit c89b96402908d0d0751778909ab422a21788bb29
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Apr 25 11:22:15 2012 +0100

    support sensitive property

diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index 3f3e4ef..9c0b8c9 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -9678,6 +9678,8 @@ bool Window::set_property(const rtl::OString &rKey, const rtl::OString &rValue)
         SetText(rtl::OStringToOUString(rValue, RTL_TEXTENCODING_UTF8));
     else if (rKey.equalsL(RTL_CONSTASCII_STRINGPARAM("visible")))
         Show(toBool(rValue));
+    else if (rKey.equalsL(RTL_CONSTASCII_STRINGPARAM("sensitive")))
+        Enable(toBool(rValue));
     else if (rKey.equalsL(RTL_CONSTASCII_STRINGPARAM("resizable")))
     {
         WinBits nBits = GetStyle();
commit c7c9d5a81d344698d21f3cbb0a595e3d773c43ea
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Apr 25 11:15:33 2012 +0100

    first pass at a manual conversion to .ui format of a dialog

diff --git a/sw/Package_uiconfig.mk b/sw/Package_uiconfig.mk
index 57e7f0b..c4cf186 100644
--- a/sw/Package_uiconfig.mk
+++ b/sw/Package_uiconfig.mk
@@ -27,6 +27,9 @@
 #*************************************************************************
 
 $(eval $(call gb_Package_Package,sw_uiconfig,$(SRCDIR)/sw/uiconfig))
+
+$(eval $(call gb_Package_add_file,sw_uiconfig,xml/uiconfig/modules/swriter/ui/titlepage.ui,swriter/ui/titlepage.ui))
+
 $(eval $(call gb_Package_add_file,sw_uiconfig,xml/uiconfig/modules/sglobal/menubar/menubar.xml,sglobal/menubar/menubar.xml))
 $(eval $(call gb_Package_add_file,sw_uiconfig,xml/uiconfig/modules/sglobal/statusbar/statusbar.xml,sglobal/statusbar/statusbar.xml))
 $(eval $(call gb_Package_add_file,sw_uiconfig,xml/uiconfig/modules/sglobal/toolbar/alignmentbar.xml,sglobal/toolbar/alignmentbar.xml))
@@ -193,7 +196,6 @@ $(eval $(call gb_Package_add_file,sw_uiconfig,xml/uiconfig/modules/swriter/toolb
 $(eval $(call gb_Package_add_file,sw_uiconfig,xml/uiconfig/modules/swriter/toolbar/drawingobjectbar.xml,swriter/toolbar/drawingobjectbar.xml))
 $(eval $(call gb_Package_add_file,sw_uiconfig,xml/uiconfig/modules/swriter/toolbar/drawtextobjectbar.xml,swriter/toolbar/drawtextobjectbar.xml))
 $(eval $(call gb_Package_add_file,sw_uiconfig,xml/uiconfig/modules/swriter/toolbar/extrusionobjectbar.xml,swriter/toolbar/extrusionobjectbar.xml))
-$(eval $(call gb_Package_add_file,sw_uiconfig,xml/uiconfig/modules/swriter/toolbar/findbar.xml,swriter/toolbar/findbar.xml))
 $(eval $(call gb_Package_add_file,sw_uiconfig,xml/uiconfig/modules/swriter/toolbar/flowchartshapes.xml,swriter/toolbar/flowchartshapes.xml))
 $(eval $(call gb_Package_add_file,sw_uiconfig,xml/uiconfig/modules/swriter/toolbar/fontworkobjectbar.xml,swriter/toolbar/fontworkobjectbar.xml))
 $(eval $(call gb_Package_add_file,sw_uiconfig,xml/uiconfig/modules/swriter/toolbar/fontworkshapetype.xml,swriter/toolbar/fontworkshapetype.xml))
diff --git a/sw/source/ui/inc/titlepage.hxx b/sw/source/ui/inc/titlepage.hxx
index 60bcd62..a66a169 100644
--- a/sw/source/ui/inc/titlepage.hxx
+++ b/sw/source/ui/inc/titlepage.hxx
@@ -46,34 +46,22 @@ class SwPageDesc;
 class SwTitlePageDlg : public SfxModalDialog
 {
 private:
-    FixedLine   aMakeInsertFL;
-    RadioButton aUseExistingPagesRB;
-    RadioButton aInsertNewPagesRB;
-    FixedText   aPageCountFT;
-    NumericField    aPageCountNF;
-    FixedText   aPagePagesFT;
-
-    FixedText   aPageStartFT;
-    RadioButton aDocumentStartRB;
-    RadioButton aPageStartRB;
-    NumericField    aPageStartNF;
-
-    FixedLine   aNumberingFL;
-    CheckBox    aRestartNumberingCB;
-    FixedText   aRestartNumberingFT;
-    NumericField    aRestartNumberingNF;
-    CheckBox    aSetPageNumberCB;
-    FixedText   aSetPageNumberFT;
-    NumericField    aSetPageNumberNF;
-
-    FixedLine   aPagePropertiesFL;
-    ListBox     aPagePropertiesLB;
-    PushButton  aPagePropertiesPB;
-
-    FixedLine   aBottomFL;
-    OKButton    aOkPB;
-    CancelButton    aCancelPB;
-    HelpButton  aHelpPB;
+    RadioButton* m_pUseExistingPagesRB;
+    NumericField* m_pPageCountNF;
+
+    RadioButton* m_pDocumentStartRB;
+    RadioButton* m_pPageStartRB;
+    NumericField* m_pPageStartNF;
+
+    CheckBox* m_pRestartNumberingCB;
+    NumericField* m_pRestartNumberingNF;
+    CheckBox* m_pSetPageNumberCB;
+    NumericField* m_pSetPageNumberNF;
+
+    ListBox* m_pPagePropertiesLB;
+    PushButton* m_pPagePropertiesPB;
+
+    OKButton* m_pOkPB;
 
     SwWrtShell *mpSh;
 
diff --git a/sw/source/ui/misc/titlepage.cxx b/sw/source/ui/misc/titlepage.cxx
index b8fc50d..bad9f4f 100644
--- a/sw/source/ui/misc/titlepage.cxx
+++ b/sw/source/ui/misc/titlepage.cxx
@@ -132,64 +132,46 @@ namespace
  */
 void SwTitlePageDlg::FillList()
 {
-    sal_uInt16 nTitlePages = aPageCountNF.GetValue();
-    aPagePropertiesLB.Clear();
+    sal_uInt16 nTitlePages = m_pPageCountNF->GetValue();
+    m_pPagePropertiesLB->Clear();
     if (mpTitleDesc)
-        aPagePropertiesLB.InsertEntry(mpTitleDesc->GetName());
+        m_pPagePropertiesLB->InsertEntry(mpTitleDesc->GetName());
     if (nTitlePages > 1 && mpIndexDesc)
-        aPagePropertiesLB.InsertEntry(mpIndexDesc->GetName());
+        m_pPagePropertiesLB->InsertEntry(mpIndexDesc->GetName());
     if (mpNormalDesc)
-        aPagePropertiesLB.InsertEntry(mpNormalDesc->GetName());
-    aPagePropertiesLB.SelectEntryPos(0);
+        m_pPagePropertiesLB->InsertEntry(mpNormalDesc->GetName());
+    m_pPagePropertiesLB->SelectEntryPos(0);
 }
 
 sal_uInt16 SwTitlePageDlg::GetInsertPosition() const
 {
     sal_uInt16 nPage = 1;
-    if (aPageStartNF.IsEnabled())
-        nPage = aPageStartNF.GetValue();
+    if (m_pPageStartNF->IsEnabled())
+        nPage = m_pPageStartNF->GetValue();
     return nPage;
 }
 
 SwTitlePageDlg::SwTitlePageDlg( Window *pParent ) :
-    SfxModalDialog( pParent, SW_RES(DLG_TITLEPAGE) ),
-#ifdef MSC
-#pragma warning (disable : 4355)
-#endif
-    aMakeInsertFL       ( this, SW_RES( FL_MAKEINSERT )),
-    aUseExistingPagesRB ( this, SW_RES( RB_USE_EXISTING_PAGES )),
-    aInsertNewPagesRB   ( this, SW_RES( RB_INSERT_NEW_PAGES )),
-    aPageCountFT        ( this, SW_RES( FT_PAGE_COUNT )),
-    aPageCountNF        ( this, SW_RES( NF_PAGE_COUNT )),
-    aPagePagesFT        ( this, SW_RES( FT_PAGE_PAGES )),
-    aPageStartFT        ( this, SW_RES( FT_PAGE_START )),
-    aDocumentStartRB    ( this, SW_RES( RB_DOCUMENT_START )),
-    aPageStartRB        ( this, SW_RES( RB_PAGE_START )),
-    aPageStartNF        ( this, SW_RES( NF_PAGE_START )),
-    aNumberingFL        ( this, SW_RES( FL_NUMBERING )),
-    aRestartNumberingCB ( this, SW_RES( CB_RESTART_NUMBERING )),
-    aRestartNumberingFT ( this, SW_RES( FT_RESTART_NUMBERING )),
-    aRestartNumberingNF ( this, SW_RES( NF_RESTART_NUMBERING )),
-    aSetPageNumberCB    ( this, SW_RES( CB_SET_PAGE_NUMBER )),
-    aSetPageNumberFT    ( this, SW_RES( FT_SET_PAGE_NUMBER )),
-    aSetPageNumberNF    ( this, SW_RES( NF_SET_PAGE_NUMBER )),
-    aPagePropertiesFL   ( this, SW_RES( FL_PAGE_PROPERTIES )),
-    aPagePropertiesLB   ( this, SW_RES( LB_PAGE_PROPERTIES )),
-    aPagePropertiesPB   ( this, SW_RES( PB_PAGE_PROPERTIES )),
-    aBottomFL           ( this, SW_RES( FL_BOTTOM )),
-    aOkPB               ( this, SW_RES( PB_OK )),
-    aCancelPB           ( this, SW_RES( PB_CANCEL )),
-    aHelpPB             ( this, SW_RES( PB_HELP )),
-    mpPageFmtDesc       (0)
-#ifdef MSC
-#pragma warning (default : 4355)
-#endif
+    SfxModalDialog( pParent, rtl::OString("DLG_TITLEPAGE"),
+        rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("modules/swriter/ui/titlepage.ui")) ),
+    mpPageFmtDesc(0)
 {
-    FreeResource();
-
-    aOkPB.SetClickHdl(LINK(this, SwTitlePageDlg, OKHdl));
-    aRestartNumberingCB.SetClickHdl(LINK(this, SwTitlePageDlg, RestartNumberingHdl));
-    aSetPageNumberCB.SetClickHdl(LINK(this, SwTitlePageDlg, SetPageNumberHdl));
+    m_pUseExistingPagesRB = static_cast<RadioButton*>(m_pUIBuilder->get_by_name("RB_USE_EXISTING_PAGES"));
+    m_pPageCountNF = static_cast<NumericField*>(m_pUIBuilder->get_by_name("NF_PAGE_COUNT"));
+    m_pDocumentStartRB =  static_cast<RadioButton*>(m_pUIBuilder->get_by_name("RB_DOCUMENT_START"));
+    m_pPageStartRB =  static_cast<RadioButton*>(m_pUIBuilder->get_by_name("RB_PAGE_START"));
+    m_pPageStartNF = static_cast<NumericField*>(m_pUIBuilder->get_by_name("NF_PAGE_START"));
+    m_pRestartNumberingCB = static_cast<CheckBox*>(m_pUIBuilder->get_by_name("CB_RESTART_NUMBERING"));
+    m_pRestartNumberingNF = static_cast<NumericField*>(m_pUIBuilder->get_by_name("NF_RESTART_NUMBERING"));
+    m_pSetPageNumberCB = static_cast<CheckBox*>(m_pUIBuilder->get_by_name("CB_SET_PAGE_NUMBER"));
+    m_pSetPageNumberNF = static_cast<NumericField*>(m_pUIBuilder->get_by_name("NF_SET_PAGE_NUMBER"));
+    m_pPagePropertiesLB = static_cast<ListBox*>(m_pUIBuilder->get_by_name("LB_PAGE_PROPERTIES"));
+    m_pPagePropertiesPB = static_cast<PushButton*>(m_pUIBuilder->get_by_name("PB_PAGE_PROPERTIES"));
+    m_pOkPB = static_cast<OKButton*>(m_pUIBuilder->get_by_name("PB_OK"));
+
+    m_pOkPB->SetClickHdl(LINK(this, SwTitlePageDlg, OKHdl));
+    m_pRestartNumberingCB->SetClickHdl(LINK(this, SwTitlePageDlg, RestartNumberingHdl));
+    m_pSetPageNumberCB->SetClickHdl(LINK(this, SwTitlePageDlg, SetPageNumberHdl));
 
     sal_uInt16 nSetPage = 1;
     sal_uInt16 nResetPage = 1;
@@ -228,63 +210,63 @@ SwTitlePageDlg::SwTitlePageDlg( Window *pParent ) :
     }
     lcl_PopCursor(mpSh);
 
-    aUseExistingPagesRB.Check();
-    aPageCountNF.SetValue(nTitlePages);
-    aPageCountNF.SetUpHdl(LINK(this, SwTitlePageDlg, UpHdl));
-    aPageCountNF.SetDownHdl(LINK(this, SwTitlePageDlg, DownHdl));
+    m_pUseExistingPagesRB->Check();
+    m_pPageCountNF->SetValue(nTitlePages);
+    m_pPageCountNF->SetUpHdl(LINK(this, SwTitlePageDlg, UpHdl));
+    m_pPageCountNF->SetDownHdl(LINK(this, SwTitlePageDlg, DownHdl));
 
-    aDocumentStartRB.Check();
-    aPageStartNF.Enable(false);
-    aPageStartNF.SetValue(lcl_GetCurrentPage(mpSh));
+    m_pDocumentStartRB->Check();
+    m_pPageStartNF->Enable(false);
+    m_pPageStartNF->SetValue(lcl_GetCurrentPage(mpSh));
     Link aStartPageHdl = LINK(this, SwTitlePageDlg, StartPageHdl);
-    aDocumentStartRB.SetClickHdl(aStartPageHdl);
-    aPageStartRB.SetClickHdl(aStartPageHdl);
+    m_pDocumentStartRB->SetClickHdl(aStartPageHdl);
+    m_pPageStartRB->SetClickHdl(aStartPageHdl);
 
     if (bMaybeResetNumbering && nResetPage > 0)
     {
-        aRestartNumberingCB.Check();
-        aRestartNumberingNF.SetValue(nResetPage);
+        m_pRestartNumberingCB->Check();
+        m_pRestartNumberingNF->SetValue(nResetPage);
     }
-    aRestartNumberingNF.Enable(aRestartNumberingCB.IsChecked());
+    m_pRestartNumberingNF->Enable(m_pRestartNumberingCB->IsChecked());
 
-    aSetPageNumberNF.SetValue(nSetPage);
+    m_pSetPageNumberNF->SetValue(nSetPage);
     if (nSetPage > 1)
-        aSetPageNumberCB.Check();
-    aSetPageNumberNF.Enable(aSetPageNumberCB.IsChecked());
+        m_pSetPageNumberCB->Check();
+    m_pSetPageNumberNF->Enable(m_pSetPageNumberCB->IsChecked());
 
     FillList();
-    aPagePropertiesPB.SetClickHdl(LINK(this, SwTitlePageDlg, EditHdl));
+    m_pPagePropertiesPB->SetClickHdl(LINK(this, SwTitlePageDlg, EditHdl));
 }
 
 IMPL_LINK_NOARG(SwTitlePageDlg, UpHdl)
 {
-    if (aPageCountNF.GetValue() == 2)
+    if (m_pPageCountNF->GetValue() == 2)
         FillList();
     return 0;
 }
 
 IMPL_LINK_NOARG(SwTitlePageDlg, DownHdl)
 {
-    if (aPageCountNF.GetValue() == 1)
+    if (m_pPageCountNF->GetValue() == 1)
         FillList();
     return 0;
 }
 
 IMPL_LINK_NOARG(SwTitlePageDlg, RestartNumberingHdl)
 {
-    aRestartNumberingNF.Enable(aRestartNumberingCB.IsChecked());
+    m_pRestartNumberingNF->Enable(m_pRestartNumberingCB->IsChecked());
     return 0;
 }
 
 IMPL_LINK_NOARG(SwTitlePageDlg, SetPageNumberHdl)
 {
-    aSetPageNumberNF.Enable(aSetPageNumberCB.IsChecked());
+    m_pSetPageNumberNF->Enable(m_pSetPageNumberCB->IsChecked());
     return 0;
 }
 
 IMPL_LINK_NOARG(SwTitlePageDlg, StartPageHdl)
 {
-    aPageStartNF.Enable(aPageStartRB.IsChecked());
+    m_pPageStartNF->Enable(m_pPageStartRB->IsChecked());
     return 0;
 }
 
@@ -296,7 +278,7 @@ SwTitlePageDlg::~SwTitlePageDlg()
 IMPL_LINK( SwTitlePageDlg, EditHdl, Button *, /*pBtn*/ )
 {
     SwView& rView = mpSh->GetView();
-    rView.GetDocShell()->FormatPage(aPagePropertiesLB.GetSelectEntry(), false, mpSh);
+    rView.GetDocShell()->FormatPage(m_pPagePropertiesLB->GetSelectEntry(), false, mpSh);
     rView.InvalidateRulerPos();
 
     return 0;
@@ -310,13 +292,13 @@ IMPL_LINK( SwTitlePageDlg, OKHdl, Button *, /*pBtn*/ )
 
     SwFmtPageDesc aTitleDesc(mpTitleDesc);
 
-    if (aSetPageNumberCB.IsChecked())
-        aTitleDesc.SetNumOffset(aSetPageNumberNF.GetValue());
+    if (m_pSetPageNumberCB->IsChecked())
+        aTitleDesc.SetNumOffset(m_pSetPageNumberNF->GetValue());
     else if (mpPageFmtDesc)
         aTitleDesc.SetNumOffset(mpPageFmtDesc->GetNumOffset());
 
-    sal_uInt16 nNoPages = aPageCountNF.GetValue();
-    if (!aUseExistingPagesRB.IsChecked())
+    sal_uInt16 nNoPages = m_pPageCountNF->GetValue();
+    if (!m_pUseExistingPagesRB->IsChecked())
     {
         mpSh->GotoPage(GetInsertPosition(), false);
         for (sal_uInt16 nI=0; nI < nNoPages; ++nI)
@@ -339,9 +321,9 @@ IMPL_LINK( SwTitlePageDlg, OKHdl, Button *, /*pBtn*/ )
         mpSh->SetAttr(aPageFmtDesc);
     }
 
-    if (aRestartNumberingCB.IsChecked() || nNoPages > 1)
+    if (m_pRestartNumberingCB->IsChecked() || nNoPages > 1)
     {
-        sal_uInt16 nPgNo = aRestartNumberingCB.IsChecked() ? aRestartNumberingNF.GetValue() : 0;
+        sal_uInt16 nPgNo = m_pRestartNumberingCB->IsChecked() ? m_pRestartNumberingNF->GetValue() : 0;
         const SwPageDesc *pNewDesc = nNoPages > 1 ? mpNormalDesc : 0;
         mpSh->GotoPage(GetInsertPosition() + nNoPages, false);
         lcl_ChangePage(mpSh, nPgNo, pNewDesc);
@@ -349,7 +331,7 @@ IMPL_LINK( SwTitlePageDlg, OKHdl, Button *, /*pBtn*/ )
 
     mpSh->EndUndo();
     lcl_PopCursor(mpSh);
-    if (!aUseExistingPagesRB.IsChecked())
+    if (!m_pUseExistingPagesRB->IsChecked())
         mpSh->GotoPage(GetInsertPosition(), false);
     EndDialog( RET_OK );
     return 0;
diff --git a/sw/uiconfig/swriter/ui/titlepage.ui b/sw/uiconfig/swriter/ui/titlepage.ui
new file mode 100644
index 0000000..dd8e44f
--- /dev/null
+++ b/sw/uiconfig/swriter/ui/titlepage.ui
@@ -0,0 +1,491 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+  <!-- interface-requires gtk+ 3.0 -->
+  <object class="GtkDialog" id="DLG_TITLEPAGE">
+    <property name="can_focus">False</property>
+    <property name="border_width">5</property>
+    <property name="type_hint">dialog</property>
+    <child internal-child="vbox">
+      <object class="GtkBox" id="dialog-vbox1">
+        <property name="can_focus">False</property>
+        <property name="orientation">vertical</property>
+        <property name="spacing">2</property>
+        <child internal-child="action_area">
+          <object class="GtkButtonBox" id="dialog-action_area1">
+            <property name="can_focus">False</property>
+            <property name="layout_style">end</property>
+            <child>
+              <object class="GtkButton" id="PB_OK">
+                <property name="label">gtk-ok</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="use_action_appearance">False</property>
+                <property name="use_stock">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="PB_CANCEL">
+                <property name="label">gtk-cancel</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="use_action_appearance">False</property>
+                <property name="use_stock">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="PB_HELP">
+                <property name="label">gtk-help</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="use_action_appearance">False</property>
+                <property name="use_stock">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">2</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="pack_type">end</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkBox" id="box1">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="orientation">vertical</property>
+            <property name="spacing">10</property>
+            <child>
+              <object class="GtkFrame" id="frame1">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="label_xalign">0</property>
+                <property name="shadow_type">none</property>
+                <child>
+                  <object class="GtkAlignment" id="alignment1">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="left_padding">12</property>
+                    <child>
+                      <object class="GtkGrid" id="grid1">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="row_homogeneous">True</property>
+                        <property name="n_rows">5</property>
+                        <child>
+                          <object class="GtkLabel" id="label6">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="xalign">0</property>
+                            <property name="label" translatable="yes">Number of title pages</property>
+                          </object>
+                          <packing>
+                            <property name="left_attach">0</property>
+                            <property name="top_attach">2</property>
+                            <property name="width">1</property>
+                            <property name="height">1</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkLabel" id="label7">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="xalign">0</property>
+                            <property name="label" translatable="yes">Place title pages at</property>
+                          </object>
+                          <packing>
+                            <property name="left_attach">0</property>
+                            <property name="top_attach">3</property>
+                            <property name="width">1</property>
+                            <property name="height">1</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkLabel" id="label8">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="label" translatable="yes">pages</property>
+                          </object>
+                          <packing>
+                            <property name="left_attach">2</property>
+                            <property name="top_attach">2</property>
+                            <property name="width">1</property>
+                            <property name="height">1</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkSpinButton" id="NF_PAGE_COUNT">
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="invisible_char">●</property>
+                            <property name="adjustment">adjustment1</property>
+                            <property name="numeric">True</property>
+                          </object>
+                          <packing>
+                            <property name="left_attach">1</property>
+                            <property name="top_attach">2</property>
+                            <property name="width">1</property>
+                            <property name="height">1</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkSpinButton" id="NF_PAGE_START">
+                            <property name="visible">True</property>
+                            <property name="sensitive">False</property>
+                            <property name="can_focus">True</property>
+                            <property name="invisible_char">●</property>
+                            <property name="progress_fraction">0.040000000000000001</property>
+                            <property name="progress_pulse_step">1</property>
+                            <property name="adjustment">adjustment1</property>
+                            <property name="climb_rate">1</property>
+                            <property name="numeric">True</property>
+                          </object>
+                          <packing>
+                            <property name="left_attach">2</property>
+                            <property name="top_attach">4</property>
+                            <property name="width">1</property>
+                            <property name="height">1</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkRadioButton" id="RB_USE_EXISTING_PAGES">
+                            <property name="label" translatable="yes">Converting existing pages to title pages</property>
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="receives_default">False</property>
+                            <property name="use_action_appearance">False</property>
+                            <property name="xalign">0</property>
+                            <property name="active">True</property>
+                            <property name="draw_indicator">True</property>
+                            <property name="group">RB_INSERT_NEW_PAGES</property>
+                          </object>
+                          <packing>
+                            <property name="left_attach">0</property>
+                            <property name="top_attach">0</property>
+                            <property name="width">3</property>
+                            <property name="height">1</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkRadioButton" id="RB_INSERT_NEW_PAGES">
+                            <property name="label" translatable="yes">Insert new title pages</property>
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="receives_default">False</property>
+                            <property name="use_action_appearance">False</property>
+                            <property name="xalign">0</property>
+                            <property name="active">True</property>
+                            <property name="draw_indicator">True</property>
+                            <property name="group">RB_USE_EXISTING_PAGES</property>
+                          </object>
+                          <packing>
+                            <property name="left_attach">0</property>
+                            <property name="top_attach">1</property>
+                            <property name="width">3</property>
+                            <property name="height">1</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkRadioButton" id="RB_DOCUMENT_START">
+                            <property name="label" translatable="yes">Document Start</property>
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="receives_default">False</property>
+                            <property name="use_action_appearance">False</property>
+                            <property name="xalign">0</property>
+                            <property name="active">True</property>
+                            <property name="draw_indicator">True</property>
+                            <property name="group">RB_PAGE_START</property>
+                          </object>
+                          <packing>
+                            <property name="left_attach">1</property>
+                            <property name="top_attach">3</property>
+                            <property name="width">3</property>
+                            <property name="height">1</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <placeholder/>
+                        </child>
+                        <child>
+                          <object class="GtkRadioButton" id="RB_PAGE_START">
+                            <property name="label" translatable="yes">Page</property>
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="receives_default">False</property>
+                            <property name="use_action_appearance">False</property>
+                            <property name="xalign">0</property>
+                            <property name="active">True</property>
+                            <property name="draw_indicator">True</property>
+                            <property name="group">RB_DOCUMENT_START</property>
+                          </object>
+                          <packing>
+                            <property name="left_attach">1</property>
+                            <property name="top_attach">4</property>
+                            <property name="width">1</property>
+                            <property name="height">1</property>
+                          </packing>
+                        </child>
+                      </object>
+                    </child>
+                  </object>
+                </child>
+                <child type="label">
+                  <object class="GtkLabel" id="label1">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="label" translatable="yes">Make Title Pages</property>
+                    <property name="use_markup">True</property>
+                  </object>
+                </child>
+              </object>
+              <packing>
+                <property name="expand">True</property>
+                <property name="fill">True</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkFrame" id="frame2">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="label_xalign">0</property>
+                <property name="shadow_type">none</property>
+                <child>
+                  <object class="GtkAlignment" id="alignment2">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="left_padding">12</property>
+                    <child>
+                      <object class="GtkBox" id="box3">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="orientation">vertical</property>
+                        <property name="homogeneous">True</property>
+                        <child>
+                          <object class="GtkCheckButton" id="CB_RESTART_NUMBERING">
+                            <property name="label" translatable="yes">Reset Page Numbering after title pages</property>
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="receives_default">False</property>
+                            <property name="use_action_appearance">False</property>
+                            <property name="xalign">0</property>
+                            <property name="draw_indicator">True</property>
+                          </object>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">True</property>
+                            <property name="position">0</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkBox" id="box4">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <child>
+                              <object class="GtkLabel" id="FT_PAGE_COUNT">
+                                <property name="visible">True</property>
+                                <property name="can_focus">False</property>
+                                <property name="label" translatable="yes">Page number</property>
+                              </object>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="fill">True</property>
+                                <property name="position">0</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <object class="GtkSpinButton" id="NF_RESTART_NUMBERING">
+                                <property name="visible">True</property>
+                                <property name="sensitive">False</property>
+                                <property name="can_focus">True</property>
+                                <property name="invisible_char">●</property>
+                                <property name="adjustment">adjustment1</property>
+                                <property name="numeric">True</property>
+                              </object>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="fill">True</property>
+                                <property name="position">1</property>
+                              </packing>
+                            </child>
+                          </object>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">True</property>
+                            <property name="position">1</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkCheckButton" id="CB_SET_PAGE_NUMBER">
+                            <property name="label" translatable="yes">Set Page Number for first title page</property>
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="receives_default">False</property>
+                            <property name="use_action_appearance">False</property>
+                            <property name="xalign">0</property>
+                            <property name="draw_indicator">True</property>
+                          </object>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">True</property>
+                            <property name="position">2</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkBox" id="box5">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <child>
+                              <object class="GtkLabel" id="FT_PAGE_PAGES">
+                                <property name="visible">True</property>
+                                <property name="can_focus">False</property>
+                                <property name="label" translatable="yes">Page number</property>
+                              </object>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="fill">True</property>
+                                <property name="position">0</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <object class="GtkSpinButton" id="NF_SET_PAGE_NUMBER">
+                                <property name="visible">True</property>
+                                <property name="sensitive">False</property>
+                                <property name="can_focus">True</property>
+                                <property name="invisible_char">●</property>
+                                <property name="adjustment">adjustment1</property>
+                                <property name="numeric">True</property>
+                              </object>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="fill">True</property>
+                                <property name="position">1</property>
+                              </packing>
+                            </child>
+                          </object>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">True</property>
+                            <property name="position">3</property>
+                          </packing>
+                        </child>
+                      </object>
+                    </child>
+                  </object>
+                </child>
+                <child type="label">
+                  <object class="GtkLabel" id="label2">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="label" translatable="yes">Page Numbering</property>
+                    <property name="use_markup">True</property>
+                  </object>
+                </child>
+              </object>
+              <packing>
+                <property name="expand">True</property>
+                <property name="fill">True</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkFrame" id="frame3">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="label_xalign">0</property>
+                <property name="shadow_type">none</property>
+                <child>
+                  <object class="GtkAlignment" id="alignment3">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="left_padding">12</property>
+                    <child>
+                      <object class="GtkBox" id="box2">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <child>
+                          <object class="GtkComboBox" id="LB_PAGE_PROPERTIES">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                          </object>
+                          <packing>
+                            <property name="expand">True</property>
+                            <property name="fill">True</property>
+                            <property name="position">0</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkButton" id="PB_PAGE_PROPERTIES">
+                            <property name="label" translatable="yes">Edit...</property>
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="receives_default">True</property>
+                            <property name="use_action_appearance">False</property>
+                          </object>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">True</property>
+                            <property name="position">1</property>
+                          </packing>
+                        </child>
+                      </object>
+                    </child>
+                  </object>
+                </child>
+                <child type="label">
+                  <object class="GtkLabel" id="label3">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="label" translatable="yes">Edit Page Properties</property>
+                    <property name="use_markup">True</property>
+                  </object>
+                </child>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">2</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">True</property>
+            <property name="fill">True</property>
+            <property name="position">1</property>
+          </packing>
+        </child>
+      </object>
+    </child>
+    <action-widgets>
+      <action-widget response="0">PB_OK</action-widget>
+      <action-widget response="0">PB_CANCEL</action-widget>
+      <action-widget response="0">PB_HELP</action-widget>
+    </action-widgets>
+  </object>
+  <object class="GtkAdjustment" id="adjustment1">
+    <property name="lower">1</property>
+    <property name="upper">65535</property>
+    <property name="value">1</property>
+    <property name="step_increment">1</property>
+    <property name="page_increment">10</property>
+  </object>
+</interface>
commit 03e3f7932a2a8f10dd167c0ea2e04dc4deee4d10
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Apr 25 11:14:38 2012 +0100

    park VclBuilder integration into SfxModalDialog for the moment

diff --git a/sfx2/inc/sfx2/basedlgs.hxx b/sfx2/inc/sfx2/basedlgs.hxx
index 503b209..d1dc5b7 100644
--- a/sfx2/inc/sfx2/basedlgs.hxx
+++ b/sfx2/inc/sfx2/basedlgs.hxx
@@ -31,9 +31,10 @@
 #include "sal/config.h"
 #include "sfx2/dllapi.h"
 #include "sal/types.h"
+#include <vcl/builder.hxx>
+#include <vcl/dialog.hxx>
 #include <vcl/floatwin.hxx>
 #include <vcl/timer.hxx>
-#include <vcl/dialog.hxx>
 
 class TabPage;
 class SfxTabPage;
@@ -78,7 +79,10 @@ private:
     SAL_DLLPRIVATE void init();
 
 protected:
+    VclBuilder              *m_pUIBuilder;
+
     SfxModalDialog(Window *pParent, const ResId& );
+    SfxModalDialog(Window *pParent, const rtl::OString& rID, const rtl::OUString& rUIXMLDescription );
     SfxModalDialog(Window* pParent, sal_uInt32 nUniqueId, WinBits nWinStyle = WB_STDMODAL );
 
     String&             GetExtraData()      { return aExtraData; }
diff --git a/sfx2/source/dialog/basedlgs.cxx b/sfx2/source/dialog/basedlgs.cxx
index 8cb8a07..9b9d510 100644
--- a/sfx2/source/dialog/basedlgs.cxx
+++ b/sfx2/source/dialog/basedlgs.cxx
@@ -30,6 +30,7 @@
 // include ---------------------------------------------------------------
 
 #include <stdlib.h>
+#include <comphelper/processfactory.hxx>
 #include <vcl/fixed.hxx>
 #include <vcl/help.hxx>
 #include <vcl/msgbox.hxx>
@@ -174,8 +175,47 @@ SfxModalDialog::SfxModalDialog(Window* pParent, const ResId &rResId )
 :   ModalDialog(pParent, rResId),
     nUniqId(rResId.GetId()),
     pInputSet(0),
+    pOutputSet(0),
+    m_pUIBuilder(0)
+{
+    init();
+}
+
+#define BASEPATH_SHARE_LAYER rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("UIConfig"))
+#define RELPATH_SHARE_LAYER rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("soffice.cfg"))
+#define SERVICENAME_PATHSETTINGS rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.util.PathSettings"))
+
+SfxModalDialog::SfxModalDialog(Window *pParent, const rtl::OString& rID, const rtl::OUString& rUIXMLDescription )
+:   ModalDialog(pParent, 0), //todo
+    nUniqId(0), //todo
+    pInputSet(0),
     pOutputSet(0)
 {
+    namespace css = ::com::sun::star;
+
+    /*to-do, check if user config has an override before using shared one, etc*/
+    css::uno::Reference< css::beans::XPropertySet > xPathSettings(
+        ::comphelper::getProcessServiceFactory()->createInstance(SERVICENAME_PATHSETTINGS),
+                css::uno::UNO_QUERY_THROW);
+
+    ::rtl::OUString sShareLayer;
+    xPathSettings->getPropertyValue(BASEPATH_SHARE_LAYER) >>= sShareLayer;
+
+    // "UIConfig" is a "multi path" ... use first part only here!
+    sal_Int32 nPos = sShareLayer.indexOf(';');
+    if (nPos > 0)
+        sShareLayer = sShareLayer.copy(0, nPos);
+
+    // Note: May be an user uses URLs without a final slash! Check it ...
+    nPos = sShareLayer.lastIndexOf('/');
+    if (nPos != sShareLayer.getLength()-1)
+        sShareLayer += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/"));
+
+    sShareLayer += RELPATH_SHARE_LAYER; // folder
+    sShareLayer += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/"));
+    /*to-do, can we merge all this foo with existing soffice.cfg finding code, etc*/
+
+    m_pUIBuilder = new VclBuilder(this, sShareLayer + rUIXMLDescription, rID);
     init();
 }
 
@@ -194,7 +234,8 @@ SfxModalDialog::SfxModalDialog(Window* pParent,
     ModalDialog(pParent, nWinStyle),
     nUniqId(nUniqueId),
     pInputSet(0),
-    pOutputSet(0)
+    pOutputSet(0),
+    m_pUIBuilder(0)
 {
     init();
 }
@@ -211,6 +252,7 @@ SfxModalDialog::~SfxModalDialog()
 {
     SetDialogData_Impl();
     delete pOutputSet;
+    delete m_pUIBuilder;
 }
 
 void SfxModalDialog::CreateOutputItemSet( SfxItemPool& rPool )
commit 17d0b28341742001167019118599e5bcd37760ea
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Apr 25 11:13:36 2012 +0100

    validate and pack .ui files as well as .xml files

diff --git a/postprocess/checkxml/checkxml.pl b/postprocess/checkxml/checkxml.pl
index 385784a..350a922 100644
--- a/postprocess/checkxml/checkxml.pl
+++ b/postprocess/checkxml/checkxml.pl
@@ -29,7 +29,7 @@ eval 'exec perl -wS $0 ${1+"$@"}'
 #*************************************************************************
 #
 #
-# check_xml.pl - check xml,xcs,xcu files size, NULL character
+# check_xml.pl - check ui,xml,xcs,xcu files size, NULL character
 #
 
 my
@@ -82,7 +82,7 @@ sub check       #04.02.2005 13:40
     my $path = shift;
     my $file = shift;
     print "$path$file\n" if ((-e "$path$file") && $is_debug);
-    return if ( $file !~ /.+\.(xcu|xml|xcs)/ ); #check xml and xcu files only
+    return if ( $file !~ /.+\.(ui|xcu|xml|xcs)/ ); #check ui, xml and xcu files only
     if ( -z "$path$file" ) {
         print "Error: $path$file 0 Bytes!\n";
         $err++;
diff --git a/postprocess/packconfig/packconfig.pl b/postprocess/packconfig/packconfig.pl
index 5dcb48f..0f29599 100755
--- a/postprocess/packconfig/packconfig.pl
+++ b/postprocess/packconfig/packconfig.pl
@@ -140,7 +140,7 @@ sub wanted
 {
     my $file = $_;
 
-    if ( $file =~ /.*\.xml$/ && -f $file ) {
+    if ( $file =~ /.*\.(ui|xml)$/ && -f $file ) {
         push @main::file_list, $File::Find::name;
     }
 }
commit f62f3eb1999046f945e1829d06cba2d5cd338878
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Apr 25 11:12:55 2012 +0100

    implement a get_by_name for VclBuilder

diff --git a/vcl/inc/vcl/builder.hxx b/vcl/inc/vcl/builder.hxx
index d96bafa..ffb2e54 100644
--- a/vcl/inc/vcl/builder.hxx
+++ b/vcl/inc/vcl/builder.hxx
@@ -37,14 +37,29 @@
 class VCL_DLLPUBLIC VclBuilder
 {
 private:
-    std::vector<Window*> m_aChildren;
+    //todo merge into Windows UniqueID/HelpID ?
+    struct WinAndId
+    {
+        rtl::OString m_sID;
+        Window *m_pWindow;
+        WinAndId(const rtl::OString &rId, Window *pWindow)
+            : m_sID(rId)
+            , m_pWindow(pWindow)
+        {
+        }
+    };
+    std::vector<WinAndId> m_aChildren;
+    rtl::OString m_sID;
+    Window *m_pParent;
 public:
-    VclBuilder(Window *pParent, rtl::OUString sUIFile);
+    VclBuilder(Window *pParent, rtl::OUString sUIFile, rtl::OString sID = rtl::OString());
     ~VclBuilder();
     Window *get_widget_root();
+    Window *get_by_name(rtl::OString sID);
+
     typedef std::map<rtl::OString, rtl::OString> stringmap;
 private:
-    Window *insertObject(Window *pParent, const rtl::OString &rClass, stringmap &rVec);
+    Window *insertObject(Window *pParent, const rtl::OString &rClass, const rtl::OString &rID, stringmap &rVec);
     Window *makeObject(Window *pParent, const rtl::OString &rClass, stringmap &rVec);
 
     void handleChild(Window *pParent, xmlreader::XmlReader &reader);
diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index 5434d96..2a1edca 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -35,16 +35,19 @@
 #include <vcl/layout.hxx>
 #include <vcl/lstbox.hxx>
 
-VclBuilder::VclBuilder(Window *pParent, rtl::OUString sUri)
+VclBuilder::VclBuilder(Window *pParent, rtl::OUString sUri, rtl::OString sID)
+    : m_sID(sID)
+    , m_pParent(pParent)
 {
+    fprintf(stderr, "now trying %s\n", rtl::OUStringToOString(sUri, RTL_TEXTENCODING_UTF8).getStr());
     xmlreader::XmlReader reader(sUri);
 
     handleChild(pParent, reader);
 
-    for (std::vector<Window*>::iterator aI = m_aChildren.begin(),
+    for (std::vector<WinAndId>::iterator aI = m_aChildren.begin(),
          aEnd = m_aChildren.end(); aI != aEnd; ++aI)
     {
-        Window *pWindow = *aI;
+        Window *pWindow = aI->m_pWindow;
         if (pWindow)
         {
             pWindow->Show();
@@ -54,10 +57,10 @@ VclBuilder::VclBuilder(Window *pParent, rtl::OUString sUri)
 
 VclBuilder::~VclBuilder()
 {
-    for (std::vector<Window*>::reverse_iterator aI = m_aChildren.rbegin(),
+    for (std::vector<WinAndId>::reverse_iterator aI = m_aChildren.rbegin(),
          aEnd = m_aChildren.rend(); aI != aEnd; ++aI)
     {
-        Window *pWindow = *aI;
+        Window *pWindow = aI->m_pWindow;
         delete pWindow;
     }
 }
@@ -161,16 +164,32 @@ Window *VclBuilder::makeObject(Window *pParent, const rtl::OString &name, string
     return pWindow;
 }
 
-Window *VclBuilder::insertObject(Window *pParent, const rtl::OString &rClass, stringmap &rMap)
+Window *VclBuilder::insertObject(Window *pParent, const rtl::OString &rClass, const rtl::OString &rID, stringmap &rMap)
 {
-    Window *pCurrentChild = makeObject(pParent, rClass, rMap);
-    if (!pCurrentChild)
-        fprintf(stderr, "missing object!\n");
+    Window *pCurrentChild = NULL;
 
-    if (pCurrentChild)
+    if (!m_sID.isEmpty() && rID.equals(m_sID))
     {
-        m_aChildren.push_back(pCurrentChild);
+        pCurrentChild = m_pParent;
+        fprintf(stderr, "inserting into parent dialog\n");
+        //toplevels default to resizable
+        if (pCurrentChild->IsDialog())
+        {
+            fprintf(stderr, "forcing resizable\n");
+            pCurrentChild->SetStyle(pCurrentChild->GetStyle() | WB_SIZEMOVE);
+        }
+    }
+    else
+    {
+        pCurrentChild = makeObject(pParent, rClass, rMap);
+        if (!pCurrentChild)
+            fprintf(stderr, "missing object!\n");
+        else
+            m_aChildren.push_back(WinAndId(rID, pCurrentChild));
+    }
 
+    if (pCurrentChild)
+    {
         for (stringmap::iterator aI = rMap.begin(), aEnd = rMap.end(); aI != aEnd; ++aI)
         {
             const rtl::OString &rKey = aI->first;
@@ -184,7 +203,7 @@ Window *VclBuilder::insertObject(Window *pParent, const rtl::OString &rClass, st
     if (!pCurrentChild)
     {
         fprintf(stderr, "missing object!\n");
-        pCurrentChild = m_aChildren.empty() ? pParent : m_aChildren.back();
+        pCurrentChild = m_aChildren.empty() ? pParent : m_aChildren.back().m_pWindow;
     }
     return pCurrentChild;
 }
@@ -249,6 +268,7 @@ void VclBuilder::handleChild(Window *pParent, xmlreader::XmlReader &reader)
 Window* VclBuilder::handleObject(Window *pParent, xmlreader::XmlReader &reader)
 {
     rtl::OString sClass;
+    rtl::OString sID;
 
     xmlreader::Span name;
     int nsId;
@@ -260,6 +280,12 @@ Window* VclBuilder::handleObject(Window *pParent, xmlreader::XmlReader &reader)
             name = reader.getAttributeValue(false);
             sClass = rtl::OString(name.begin, name.length);
         }
+        else if (name.equals(RTL_CONSTASCII_STRINGPARAM("id")))
+        {
+            name = reader.getAttributeValue(false);
+            sID = rtl::OString(name.begin, name.length);
+        }
+
     }
 
     int nLevel = 1;
@@ -280,7 +306,7 @@ Window* VclBuilder::handleObject(Window *pParent, xmlreader::XmlReader &reader)
             if (name.equals(RTL_CONSTASCII_STRINGPARAM("child")))
             {
                 if (!pCurrentChild)
-                    pCurrentChild = insertObject(pParent, sClass, aProperties);
+                    pCurrentChild = insertObject(pParent, sClass, sID, aProperties);
                 handleChild(pCurrentChild, reader);
             }
             else
@@ -301,7 +327,7 @@ Window* VclBuilder::handleObject(Window *pParent, xmlreader::XmlReader &reader)
     }
 
     if (!pCurrentChild)
-        pCurrentChild = insertObject(pParent, sClass, aProperties);
+        pCurrentChild = insertObject(pParent, sClass, sID, aProperties);
 
     return pCurrentChild;
 }
@@ -408,10 +434,21 @@ void VclBuilder::collectProperty(xmlreader::XmlReader &reader, stringmap &rMap)
     }
 }
 
-
 Window *VclBuilder::get_widget_root()
 {
-    return m_aChildren.empty() ? NULL : m_aChildren[0];
+    return m_aChildren.empty() ? NULL : m_aChildren[0].m_pWindow;
+}
+
+Window *VclBuilder::get_by_name(rtl::OString sID)
+{
+    for (std::vector<WinAndId>::iterator aI = m_aChildren.begin(),
+         aEnd = m_aChildren.end(); aI != aEnd; ++aI)
+    {
+        if (aI->m_sID.equals(sID))
+            return aI->m_pWindow;
+    }
+
+    return NULL;
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 59e9c882a42c8b8c5714a37c1836b3d7d14bdbd9
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Apr 25 09:02:52 2012 +0100

    add resizable bits

diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index d4e4e5d..3f3e4ef 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -9678,6 +9678,14 @@ bool Window::set_property(const rtl::OString &rKey, const rtl::OString &rValue)
         SetText(rtl::OStringToOUString(rValue, RTL_TEXTENCODING_UTF8));
     else if (rKey.equalsL(RTL_CONSTASCII_STRINGPARAM("visible")))
         Show(toBool(rValue));
+    else if (rKey.equalsL(RTL_CONSTASCII_STRINGPARAM("resizable")))
+    {
+        WinBits nBits = GetStyle();
+        nBits &= ~(WB_SIZEMOVE);
+        if (toBool(rValue))
+            nBits |= WB_SIZEMOVE;
+        SetStyle(nBits);
+    }
     else if (rKey.equalsL(RTL_CONSTASCII_STRINGPARAM("xalign")))
     {
         WinBits nBits = GetStyle();


More information about the Libreoffice-commits mailing list