[Libreoffice-commits] core.git: 4 commits - include/sfx2 sfx2/source sw/inc sw/source sw/uiconfig sw/UIConfig_swriter.mk

Caolán McNamara caolanm at redhat.com
Wed Aug 21 12:11:32 PDT 2013


 include/sfx2/basedlgs.hxx                 |   10 +-
 include/sfx2/tabdlg.hxx                   |    4 
 sfx2/source/dialog/basedlgs.cxx           |   12 ++
 sfx2/source/dialog/tabdlg.cxx             |    8 +
 sw/UIConfig_swriter.mk                    |    1 
 sw/inc/fldui.hrc                          |    9 -
 sw/inc/helpid.h                           |    9 -
 sw/source/ui/dbui/dbtree.cxx              |   19 ---
 sw/source/ui/fldui/fldedt.cxx             |   77 ++++-----------
 sw/source/ui/fldui/fldpage.cxx            |    4 
 sw/source/ui/fldui/fldui.src              |   32 ------
 sw/source/ui/inc/dbtree.hxx               |    4 
 sw/source/ui/inc/fldedt.hxx               |   10 +-
 sw/uiconfig/swriter/ui/editfielddialog.ui |  147 ++++++++++++++++++++++++++++++
 14 files changed, 206 insertions(+), 140 deletions(-)

New commits:
commit 962c5052eec48774255f3115f88170c3ebb246b0
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Aug 21 15:05:46 2013 +0100

    convert edit fields singletab dialog to layout .ui
    
    Change-Id: I3d58d93ac2686ea16fde4118b7133176d3713af7

diff --git a/include/sfx2/basedlgs.hxx b/include/sfx2/basedlgs.hxx
index 609d639..11854d2 100644
--- a/include/sfx2/basedlgs.hxx
+++ b/include/sfx2/basedlgs.hxx
@@ -181,9 +181,11 @@ typedef sal_uInt16* (*GetTabPageRanges)(); // liefert internationale Which-Werte
 class SFX2_DLLPUBLIC SfxSingleTabDialogBase : public SfxModalDialog
 {
 public:
-    //layout ctor
+    //layout ctors
     SfxSingleTabDialogBase(Window *pParent, const SfxItemSet& rOptionsSet,
         const OString& rID, const OUString& rUIXMLDescription);
+    SfxSingleTabDialogBase(Window *pParent, const SfxItemSet* pInSet,
+        const OString& rID, const OUString& rUIXMLDescription);
 
     //non-layout ctors
     SfxSingleTabDialogBase( Window* pParent, const SfxItemSet& rOptionsSet, sal_uInt16 nUniqueId );
@@ -217,6 +219,12 @@ public:
         : SfxSingleTabDialogBase(pParent, rOptionsSet, rID, rUIXMLDescription)
     {
     }
+    SfxSingleTabDialog(Window *pParent, const SfxItemSet* pInSet = 0,
+        const OString& rID = OString("SingleTabDialog"),
+        const OUString& rUIXMLDescription = OUString("sfx/ui/singletabdialog.ui"))
+        : SfxSingleTabDialogBase(pParent, pInSet, rID, rUIXMLDescription)
+    {
+    }
     void setTabPage(SfxTabPage* pTabPage, GetTabPageRanges pRangesFunc = 0, sal_uInt32 nSettingsId = 0);
 };
 
diff --git a/sfx2/source/dialog/basedlgs.cxx b/sfx2/source/dialog/basedlgs.cxx
index 24cfb9e..4f52052 100644
--- a/sfx2/source/dialog/basedlgs.cxx
+++ b/sfx2/source/dialog/basedlgs.cxx
@@ -761,6 +761,18 @@ SfxSingleTabDialogBase::SfxSingleTabDialogBase(Window *pParent, const SfxItemSet
     SetInputSet( &rSet );
 }
 
+SfxSingleTabDialogBase::SfxSingleTabDialogBase(Window* pParent, const SfxItemSet* pInSet,
+    const OString& rID, const OUString& rUIXMLDescription)
+    : SfxModalDialog(pParent, rID, rUIXMLDescription)
+    , pImpl(new SingleTabDlgImpl)
+{
+    get(pOKBtn, "ok");
+    pOKBtn->SetClickHdl( LINK( this, SfxSingleTabDialogBase, OKHdl_Impl ) );
+    get(pCancelBtn, "cancel");
+    get(pHelpBtn, "help");
+    SetInputSet( pInSet );
+}
+
 // -----------------------------------------------------------------------
 
 SfxSingleTabDialogBase::~SfxSingleTabDialogBase()
diff --git a/sw/UIConfig_swriter.mk b/sw/UIConfig_swriter.mk
index b81d8f8..dbc3b7f 100644
--- a/sw/UIConfig_swriter.mk
+++ b/sw/UIConfig_swriter.mk
@@ -83,6 +83,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/swriter,\
 	sw/uiconfig/swriter/ui/dropcapspage \
 	sw/uiconfig/swriter/ui/dropdownfielddialog \
 	sw/uiconfig/swriter/ui/editcategories \
+	sw/uiconfig/swriter/ui/editfielddialog \
 	sw/uiconfig/swriter/ui/editsectiondialog \
 	sw/uiconfig/swriter/ui/endnotepage \
 	sw/uiconfig/swriter/ui/envaddresspage \
diff --git a/sw/inc/fldui.hrc b/sw/inc/fldui.hrc
index 655bf2e..b5ff6f3 100644
--- a/sw/inc/fldui.hrc
+++ b/sw/inc/fldui.hrc
@@ -240,14 +240,6 @@
 #define STR_EXTRA               (STR_FLDUI + 2)
 
 /*--------------------------------------------------------------------
-    Buttons for Field-Edit-Dlg
- --------------------------------------------------------------------*/
-
-#define BTN_FLDEDT_PREV         STR_EXTRA
-#define BTN_FLDEDT_NEXT         (STR_EXTRA  + 1)
-#define PB_FLDEDT_ADDRESS       (STR_EXTRA  + 2)
-
-/*--------------------------------------------------------------------
     Additional Strings
  --------------------------------------------------------------------*/
 
@@ -265,7 +257,6 @@
 #define STR_URLPROMPT           (STR_EXTRA  + 11)
 #define STR_FORMULA             (STR_EXTRA  + 12)
 #define STR_ALL_DATABASE        (STR_EXTRA  + 13)
-#define STR_FLD_EDIT_DLG        (STR_EXTRA  + 14)
 
 
 
diff --git a/sw/inc/helpid.h b/sw/inc/helpid.h
index d400483..431a8c9 100644
--- a/sw/inc/helpid.h
+++ b/sw/inc/helpid.h
@@ -112,7 +112,6 @@
 #define HID_NAVI_CONTENT                                        "SW_HID_NAVI_CONTENT"
 #define HID_NAVI_GLOBAL                                         "SW_HID_NAVI_GLOBAL"
 #define HID_LTEMPL_NUMBERING                                    "SW_HID_LTEMPL_NUMBERING"
-#define HID_FLDEDT_ADDRESS                                      "SW_HID_FLDEDT_ADDRESS"
 #define HID_SORT_ACTION                                         "SW_HID_SORT_ACTION"
 #define HID_SORT_AUTHOR                                         "SW_HID_SORT_AUTHOR"
 #define HID_SORT_DATE                                           "SW_HID_SORT_DATE"
@@ -141,12 +140,6 @@
 #define HID_GRF_EXT                                             "SW_HID_GRF_EXT"
 #define HID_COND_COLL                                           "SW_HID_COND_COLL"
 
-#define HID_EDIT_FLD_DB                                         "SW_HID_EDIT_FLD_DB"
-#define HID_EDIT_FLD_DOKINF                                     "SW_HID_EDIT_FLD_DOKINF"
-#define HID_EDIT_FLD_VAR                                        "SW_HID_EDIT_FLD_VAR"
-#define HID_EDIT_FLD_DOK                                        "SW_HID_EDIT_FLD_DOK"
-#define HID_EDIT_FLD_FUNC                                       "SW_HID_EDIT_FLD_FUNC"
-#define HID_EDIT_FLD_REF                                        "SW_HID_EDIT_FLD_REF"
 #define HID_REDLINE_CTRL                                        "SW_HID_REDLINE_CTRL"
 #define HID_OPTCAPTION_PAGE                                     "SW_HID_OPTCAPTION_PAGE"
 #define HID_TP_TOX_SELECT                                       "SW_HID_TP_TOX_SELECT"
diff --git a/sw/source/ui/fldui/fldedt.cxx b/sw/source/ui/fldui/fldedt.cxx
index b376360..a9b907a 100644
--- a/sw/source/ui/fldui/fldedt.cxx
+++ b/sw/source/ui/fldui/fldedt.cxx
@@ -52,13 +52,15 @@ namespace swui
     SwAbstractDialogFactory * GetFactory();
 }
 
-SwFldEditDlg::SwFldEditDlg(SwView& rVw) :
-    SfxNoLayoutSingleTabDialog(&rVw.GetViewFrame()->GetWindow(), 0, 0),
-    pSh         (rVw.GetWrtShellPtr()),
-    aPrevBT     (this, SW_RES(BTN_FLDEDT_PREV)),
-    aNextBT     (this, SW_RES(BTN_FLDEDT_NEXT)),
-    aAddressBT  (this, SW_RES(PB_FLDEDT_ADDRESS))
+SwFldEditDlg::SwFldEditDlg(SwView& rVw)
+    : SfxSingleTabDialog(&rVw.GetViewFrame()->GetWindow(), 0,
+        "EditFieldDialog", "modules/swriter/ui/editfielddialog.ui")
+    , pSh(rVw.GetWrtShellPtr())
 {
+    get(m_pPrevBT, "prev");
+    get(m_pNextBT, "next");
+    get(m_pAddressBT, "edit");
+
     SwFldMgr aMgr(pSh);
 
     SwField *pCurFld = aMgr.GetCurFld();
@@ -70,38 +72,20 @@ SwFldEditDlg::SwFldEditDlg(SwView& rVw) :
     /* #108536# Only create selection if there is none
         already. Normalize PaM instead of swapping. */
     if ( ! pSh->HasSelection() )
-        pSh->Right(CRSR_SKIP_CHARS, sal_True, 1, sal_False );
+        pSh->Right(CRSR_SKIP_CHARS, true, 1, false);
 
     pSh->NormalizePam();
 
-    sal_uInt16 nGroup = aMgr.GetGroup(sal_False, pCurFld->GetTypeId(), pCurFld->GetSubType());
+    sal_uInt16 nGroup = aMgr.GetGroup(false, pCurFld->GetTypeId(), pCurFld->GetSubType());
 
     CreatePage(nGroup);
 
     GetOKButton()->SetClickHdl(LINK(this, SwFldEditDlg, OKHdl));
 
-    // position buttons ourselves because otherwise when font sizes are
-    // varying, they are in the woods, and because PB uses fixed pixel sizes
-    // for its buttons and dialog width in SingleTabDlg.
-    aPrevBT.SetPosPixel(Point(GetOKButton()->GetPosPixel().X(), aPrevBT.GetPosPixel().Y()));
-    sal_uInt16 nWidth = static_cast< sal_uInt16 >(GetOKButton()->GetOutputSize().Width() / 2 - 3);
-    Size aNewSize(LogicToPixel(Size(nWidth, GetOKButton()->GetOutputSize().Height())));
-    aPrevBT.SetSizePixel(aNewSize);
-
-    aNextBT.SetSizePixel(aPrevBT.GetSizePixel());
-
-    long nXPos = GetOKButton()->GetPosPixel().X() + GetOKButton()->GetSizePixel().Width()
-                    - aNextBT.GetSizePixel().Width() - 1;
-    aNextBT.SetPosPixel(Point(nXPos, aNextBT.GetPosPixel().Y()));
+    m_pPrevBT->SetClickHdl(LINK(this, SwFldEditDlg, NextPrevHdl));
+    m_pNextBT->SetClickHdl(LINK(this, SwFldEditDlg, NextPrevHdl));
 
-    aAddressBT.SetPosPixel(Point(GetOKButton()->GetPosPixel().X(), aAddressBT.GetPosPixel().Y()));
-    aAddressBT.SetSizePixel(GetOKButton()->GetSizePixel());
-
-    aPrevBT.SetClickHdl(LINK(this, SwFldEditDlg, NextPrevHdl));
-    aNextBT.SetClickHdl(LINK(this, SwFldEditDlg, NextPrevHdl));
-
-    aAddressBT.SetClickHdl(LINK(this, SwFldEditDlg, AddressHdl));
-    aAddressBT.SetHelpId(HID_FLDEDT_ADDRESS);
+    m_pAddressBT->SetClickHdl(LINK(this, SwFldEditDlg, AddressHdl));
 
     Init();
 }
@@ -129,14 +113,14 @@ void SwFldEditDlg::Init()
         sal_Bool bMove = rMgr.GoNext();
         if( bMove )
             rMgr.GoPrev();
-        aNextBT.Enable(bMove);
+        m_pNextBT->Enable(bMove);
 
         if( 0 != ( bMove = rMgr.GoPrev() ) )
             rMgr.GoNext();
-        aPrevBT.Enable( bMove );
+        m_pPrevBT->Enable( bMove );
 
         if (pCurFld->GetTypeId() == TYP_EXTUSERFLD)
-            aAddressBT.Show();
+            m_pAddressBT->Show();
 
         pSh->DestroyCrsr();
         pSh->EndAction();
@@ -150,21 +134,17 @@ SfxTabPage* SwFldEditDlg::CreatePage(sal_uInt16 nGroup)
 {
     // create TabPage
     SfxTabPage* pTabPage = 0;
-    const char* pHelpId = 0;
 
     switch (nGroup)
     {
         case GRP_DOC:
-            pTabPage = SwFldDokPage::Create(this, *(SfxItemSet*)0);
-            pHelpId = HID_EDIT_FLD_DOK;
+            pTabPage = SwFldDokPage::Create(get_content_area(), *(SfxItemSet*)0);
             break;
         case GRP_FKT:
-            pTabPage = SwFldFuncPage::Create(this, *(SfxItemSet*)0);
-            pHelpId = HID_EDIT_FLD_FUNC;
+            pTabPage = SwFldFuncPage::Create(get_content_area(), *(SfxItemSet*)0);
             break;
         case GRP_REF:
-            pTabPage = SwFldRefPage::Create(this, *(SfxItemSet*)0);
-            pHelpId = HID_EDIT_FLD_REF;
+            pTabPage = SwFldRefPage::Create(get_content_area(), *(SfxItemSet*)0);
             break;
         case GRP_REG:
             {
@@ -179,31 +159,22 @@ SfxTabPage* SwFldEditDlg::CreatePage(sal_uInt16 nGroup)
                     xDocProps->getUserDefinedProperties(),
                     uno::UNO_QUERY_THROW);
                 pSet->Put( SfxUnoAnyItem( SID_DOCINFO, uno::makeAny(xUDProps) ) );
-                pTabPage = SwFldDokInfPage::Create(this, *pSet);
-                pHelpId = HID_EDIT_FLD_DOKINF;
+                pTabPage = SwFldDokInfPage::Create(get_content_area(), *pSet);
                 break;
             }
         case GRP_DB:
-            pTabPage = SwFldDBPage::Create(this, *(SfxItemSet*)0);
+            pTabPage = SwFldDBPage::Create(get_content_area(), *(SfxItemSet*)0);
             static_cast<SwFldDBPage*>(pTabPage)->SetWrtShell(*pSh);
-            pHelpId = HID_EDIT_FLD_DB;
             break;
         case GRP_VAR:
-            pTabPage = SwFldVarPage::Create(this, *(SfxItemSet*)0);
-            pHelpId = HID_EDIT_FLD_VAR;
+            pTabPage = SwFldVarPage::Create(get_content_area(), *(SfxItemSet*)0);
             break;
 
     }
 
-    pTabPage->SetHelpId(pHelpId);
     static_cast<SwFldPage*>(pTabPage)->SetWrtShell(pSh);
 
-    SetTabPage(pTabPage);
-
-    String sTitle(GetText());
-    sTitle.Insert(OUString(": "), 0);
-    sTitle.Insert(SW_RESSTR(STR_FLD_EDIT_DLG), 0);
-    SetText(sTitle);
+    setTabPage(pTabPage);
 
     return pTabPage;
 }
@@ -256,7 +227,7 @@ short SwFldEditDlg::Execute()
  --------------------------------------------------------------------*/
 IMPL_LINK( SwFldEditDlg, NextPrevHdl, Button *, pButton )
 {
-    sal_Bool bNext = pButton == &aNextBT;
+    bool bNext = pButton == m_pNextBT;
 
     pSh->EnterStdMode();
 
diff --git a/sw/source/ui/fldui/fldpage.cxx b/sw/source/ui/fldui/fldpage.cxx
index d36c309..0096bc5 100644
--- a/sw/source/ui/fldui/fldpage.cxx
+++ b/sw/source/ui/fldui/fldpage.cxx
@@ -351,7 +351,7 @@ IMPL_LINK( SwFldPage, InsertHdl, Button *, pBtn )
     }
     else
     {
-        SwFldEditDlg *pEditDlg = (SwFldEditDlg *)GetParent();
+        SwFldEditDlg *pEditDlg = (SwFldEditDlg *)GetParentDialog();
         pEditDlg->InsertHdl();
     }
 
@@ -373,7 +373,7 @@ void SwFldPage::EnableInsert(sal_Bool bEnable)
     }
     else
     {
-        SwFldEditDlg *pEditDlg = (SwFldEditDlg *)GetParent();
+        SwFldEditDlg *pEditDlg = (SwFldEditDlg *)GetParentDialog();
         pEditDlg->EnableInsert(bEnable);
     }
 
diff --git a/sw/source/ui/fldui/fldui.src b/sw/source/ui/fldui/fldui.src
index 8b13971..788a018 100644
--- a/sw/source/ui/fldui/fldui.src
+++ b/sw/source/ui/fldui/fldui.src
@@ -24,13 +24,6 @@
 /*--------------------------------------------------------------------
     Description: strings for the types
  --------------------------------------------------------------------*/
-String STR_FLD_EDIT_DLG
-{
-    Text [ en-US ] = "Edit Fields" ;
-};
-/*--------------------------------------------------------------------
-    Description: strings for the types
- --------------------------------------------------------------------*/
  //
  // range document
  //
@@ -638,31 +631,6 @@ String STR_ALL_DATABASE
 {
     Text [ en-US ] = "<All>" ;
 };
-ImageButton BTN_FLDEDT_PREV
-{
-    Pos = MAP_APPFONT ( 263 , 115 ) ;
-    Size = MAP_APPFONT ( 24 , 14 ) ;
-    TabStop = TRUE ;
-    SYMBOL = IMAGEBUTTON_PREV ;
-    Helpid = HID_DLG_FLDEDT_PREV ;
-};
-ImageButton BTN_FLDEDT_NEXT
-{
-    Pos = MAP_APPFONT ( 294 , 115 ) ;
-    Size = MAP_APPFONT ( 24 , 14 ) ;
-    TabStop = TRUE ;
-    SYMBOL = IMAGEBUTTON_NEXT ;
-    Helpid = HID_DLG_FLDEDT_NEXT ;
-};
-PushButton PB_FLDEDT_ADDRESS
-{
-    Pos = MAP_APPFONT ( 294 , 100 ) ;
-    Size = MAP_APPFONT ( 24 , 14 ) ;
-    TabStop = TRUE ;
-    Hide = TRUE ;
-    Text [ en-US ] = "Edit" ;
-    Helpid = HID_DLG_FLDEDT_ADDRESS ;
-};
 String STR_CUSTOM
 {
     Text [ en-US ] = "Custom" ;
diff --git a/sw/source/ui/inc/fldedt.hxx b/sw/source/ui/inc/fldedt.hxx
index c547c68..f512af9 100644
--- a/sw/source/ui/inc/fldedt.hxx
+++ b/sw/source/ui/inc/fldedt.hxx
@@ -24,15 +24,15 @@
 class SwView;
 class SwWrtShell;
 
-class SwFldEditDlg : public SfxNoLayoutSingleTabDialog
+class SwFldEditDlg : public SfxSingleTabDialog
 {
     SwWrtShell* pSh;
-    ImageButton aPrevBT;
-    ImageButton aNextBT;
-    PushButton  aAddressBT;
+    PushButton* m_pPrevBT;
+    PushButton* m_pNextBT;
+    PushButton* m_pAddressBT;
 
     DECL_LINK(AddressHdl, void *);
-    DECL_LINK( NextPrevHdl, Button *pBt = 0 );
+    DECL_LINK(NextPrevHdl, Button *pBt = 0);
 
     void            Init();
     SfxTabPage*     CreatePage(sal_uInt16 nGroup);
diff --git a/sw/uiconfig/swriter/ui/editfielddialog.ui b/sw/uiconfig/swriter/ui/editfielddialog.ui
new file mode 100644
index 0000000..ca6a041
--- /dev/null
+++ b/sw/uiconfig/swriter/ui/editfielddialog.ui
@@ -0,0 +1,147 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+  <!-- interface-requires gtk+ 3.0 -->
+  <object class="GtkImage" id="image3">
+    <property name="visible">True</property>
+    <property name="can_focus">False</property>
+    <property name="stock">gtk-media-previous</property>
+  </object>
+  <object class="GtkImage" id="image4">
+    <property name="visible">True</property>
+    <property name="can_focus">False</property>
+    <property name="stock">gtk-media-next</property>
+  </object>
+  <object class="GtkDialog" id="EditFieldDialog">
+    <property name="can_focus">False</property>
+    <property name="border_width">6</property>
+    <property name="title" translatable="yes">Edit Fields</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">12</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="GtkGrid" id="grid2">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <child>
+                  <object class="GtkButton" id="prev">
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="receives_default">True</property>
+                    <property name="image">image3</property>
+                  </object>
+                  <packing>
+                    <property name="left_attach">0</property>
+                    <property name="top_attach">0</property>
+                    <property name="width">1</property>
+                    <property name="height">1</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkButton" id="next">
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="receives_default">True</property>
+                    <property name="image">image4</property>
+                  </object>
+                  <packing>
+                    <property name="left_attach">1</property>
+                    <property name="top_attach">0</property>
+                    <property name="width">1</property>
+                    <property name="height">1</property>
+                  </packing>
+                </child>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">0</property>
+                <property name="secondary">True</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="ok">
+                <property name="label">gtk-ok</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="can_default">True</property>
+                <property name="has_default">True</property>
+                <property name="receives_default">True</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="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_stock">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">2</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="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_stock">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">3</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="edit">
+                <property name="label" translatable="yes">_Edit</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="no_show_all">True</property>
+                <property name="use_underline">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">4</property>
+                <property name="secondary">True</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>
+          <placeholder/>
+        </child>
+      </object>
+    </child>
+    <action-widgets>
+      <action-widget response="0">ok</action-widget>
+      <action-widget response="0">cancel</action-widget>
+      <action-widget response="0">help</action-widget>
+      <action-widget response="0">edit</action-widget>
+    </action-widgets>
+  </object>
+</interface>
commit c5639cd7d6e8b8966a19b83b68313db8f3ecd037
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Aug 21 17:12:37 2013 +0100

    make SfxTabPage::GetTabDialog always work
    
    Change-Id: Ibdcfeed1ff340649cae0b868a1ee79450adc88f3

diff --git a/include/sfx2/tabdlg.hxx b/include/sfx2/tabdlg.hxx
index 1474ad9..b132528 100644
--- a/include/sfx2/tabdlg.hxx
+++ b/include/sfx2/tabdlg.hxx
@@ -249,10 +249,8 @@ private:
     const SfxItemSet*   pSet;
     String              aUserString;
     sal_Bool                bHasExchangeSupport;
-    SfxTabDialog*       pTabDlg;
     TabPageImpl*        pImpl;
 
-    SAL_DLLPRIVATE void SetTabDialog( SfxTabDialog* pNew ) { pTabDlg = pNew; }
     SAL_DLLPRIVATE void SetInputSet( const SfxItemSet* pNew ) { pSet = pNew; }
 
 protected:
@@ -264,7 +262,7 @@ protected:
     sal_uInt16              GetWhich( sal_uInt16 nSlot, sal_Bool bDeep = sal_True ) const
                             { return pSet->GetPool()->GetWhich( nSlot, bDeep ); }
     const SfxPoolItem*  GetOldItem( const SfxItemSet& rSet, sal_uInt16 nSlot, sal_Bool bDeep = sal_True );
-    SfxTabDialog*       GetTabDialog() const { return pTabDlg; }
+    SfxTabDialog*       GetTabDialog() const;
 
     void                AddItemConnection( sfx::ItemConnectionBase* pConnection );
 
diff --git a/sfx2/source/dialog/tabdlg.cxx b/sfx2/source/dialog/tabdlg.cxx
index f37335df..3e38dc4 100644
--- a/sfx2/source/dialog/tabdlg.cxx
+++ b/sfx2/source/dialog/tabdlg.cxx
@@ -225,7 +225,6 @@ SfxTabPage::SfxTabPage( Window *pParent,
 
     pSet                ( &rAttrSet ),
     bHasExchangeSupport ( sal_False ),
-    pTabDlg             ( NULL ),
     pImpl               ( new TabPageImpl )
 
 {
@@ -236,7 +235,6 @@ SfxTabPage::SfxTabPage(Window *pParent, const OString& rID, const OUString& rUIX
     : TabPage(pParent, rID, rUIXMLDescription)
     , pSet                ( &rAttrSet )
     , bHasExchangeSupport ( sal_False )
-    , pTabDlg             ( NULL )
     , pImpl               ( new TabPageImpl )
 {
 }
@@ -385,6 +383,11 @@ void SfxTabPage::AddItemConnection( sfx::ItemConnectionBase* pConnection )
     pImpl->maItemConn.AddConnection( pConnection );
 }
 
+SfxTabDialog* SfxTabPage::GetTabDialog() const
+{
+    return dynamic_cast<SfxTabDialog*>(GetParentDialog());
+}
+
 #define INI_LIST(ItemSetPtr) \
       pSet(ItemSetPtr) \
     , pOutSet(0) \
@@ -1332,7 +1335,6 @@ IMPL_LINK( SfxTabDialog, ActivatePageHdl, TabControl *, pTabCtrl )
         DBG_ASSERT( NULL == pDataObject->pTabPage, "create TabPage more than once" );
         pDataObject->pTabPage = pTabPage;
 
-        pDataObject->pTabPage->SetTabDialog( this );
         SvtViewOptions aPageOpt( E_TABPAGE, OUString::number( pDataObject->nId ) );
         String sUserData;
         Any aUserItem = aPageOpt.GetUserItem( USERITEM_NAME );
commit efb3509855a9b3d6a9ee4f74f7c4b4320213b536
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Aug 21 14:54:00 2013 +0100

    SwDBTreeList ResID ctor is unused now post .ui conversion
    
    Change-Id: Ied3d1c4f87e41061a9656abc0b70fd105c92d59c

diff --git a/sw/source/ui/dbui/dbtree.cxx b/sw/source/ui/dbui/dbtree.cxx
index 2a9dd62..720ecf6 100644
--- a/sw/source/ui/dbui/dbtree.cxx
+++ b/sw/source/ui/dbui/dbtree.cxx
@@ -170,21 +170,6 @@ Reference<XConnection>  SwDBTreeList_Impl::GetConnection(const OUString& rSource
     return xRet;
 }
 
-SwDBTreeList::SwDBTreeList(Window *pParent, const ResId& rResId,
-                        SwWrtShell* pSh,
-                        const String& rDefDBName, const sal_Bool bShowCol):
-
-    SvTreeListBox   (pParent, rResId),
-    aImageList      (SW_RES(ILIST_DB_DLG    )),
-    sDefDBName      (rDefDBName),
-    bInitialized    (false),
-    bShowColumns    (bShowCol),
-    pImpl(new SwDBTreeList_Impl(pSh))
-{
-    if (IsVisible())
-        InitTreeList();
-}
-
 SwDBTreeList::SwDBTreeList(Window *pParent, WinBits nStyle)
     : SvTreeListBox(pParent, nStyle)
     , aImageList(SW_RES(ILIST_DB_DLG))
diff --git a/sw/source/ui/inc/dbtree.hxx b/sw/source/ui/inc/dbtree.hxx
index b48981c..ad744e4 100644
--- a/sw/source/ui/inc/dbtree.hxx
+++ b/sw/source/ui/inc/dbtree.hxx
@@ -52,10 +52,6 @@ class SW_DLLPUBLIC SwDBTreeList : public SvTreeListBox
     using SvTreeListBox::Select;
 
 public:
-    SwDBTreeList( Window* pParent, const ResId& rResId,
-                    SwWrtShell* pSh,
-                    const String& rDefDBName = aEmptyStr,
-                    const sal_Bool bShowCol = sal_False );
     SwDBTreeList(Window* pParent, WinBits nStyle);
     virtual ~SwDBTreeList();
     virtual Size GetOptimalSize() const;
commit 60acc758dcd31375a55680726f384c57500262b5
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Aug 21 14:52:26 2013 +0100

    drop unhelpful help id
    
    Change-Id: I384afcb76485d5b78a588c63b8a9f1580e96fc51

diff --git a/sw/inc/helpid.h b/sw/inc/helpid.h
index 5c90545..d400483 100644
--- a/sw/inc/helpid.h
+++ b/sw/inc/helpid.h
@@ -321,8 +321,6 @@
 
 #define HID_COND_COLL_TABLIST                                   "SW_HID_COND_COLL_TABLIST"
 
-#define HID_DB_SELECTION_TLB                                    "SW_HID_DB_SELECTION_TLB"
-
 #define HID_SELECT_TEMPLATE                                     "SW_HID_SELECT_TEMPLATE"
 
 #define HID_AP_INSERT_DB_SEL                                    "SW_HID_AP_INSERT_DB_SEL"
diff --git a/sw/source/ui/dbui/dbtree.cxx b/sw/source/ui/dbui/dbtree.cxx
index c8b8342..2a9dd62 100644
--- a/sw/source/ui/dbui/dbtree.cxx
+++ b/sw/source/ui/dbui/dbtree.cxx
@@ -181,8 +181,6 @@ SwDBTreeList::SwDBTreeList(Window *pParent, const ResId& rResId,
     bShowColumns    (bShowCol),
     pImpl(new SwDBTreeList_Impl(pSh))
 {
-    SetHelpId(HID_DB_SELECTION_TLB);
-
     if (IsVisible())
         InitTreeList();
 }
@@ -194,8 +192,6 @@ SwDBTreeList::SwDBTreeList(Window *pParent, WinBits nStyle)
     , bShowColumns(false)
     , pImpl(new SwDBTreeList_Impl(NULL))
 {
-    SetHelpId(HID_DB_SELECTION_TLB);
-
     if (IsVisible())
         InitTreeList();
 }


More information about the Libreoffice-commits mailing list