[Libreoffice-commits] .: sw/AllLangResTarget_sw.mk sw/inc sw/source sw/uiconfig sw/UI_swriter.mk

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Jan 9 08:54:35 PST 2013


 sw/AllLangResTarget_sw.mk                   |    1 
 sw/UI_swriter.mk                            |    1 
 sw/inc/fldui.hrc                            |    1 
 sw/inc/swabstdlg.hxx                        |    2 
 sw/source/ui/dbui/dbtree.cxx                |   26 +++
 sw/source/ui/dialog/swdlgfact.cxx           |   19 --
 sw/source/ui/dialog/swdlgfact.hxx           |    2 
 sw/source/ui/fldui/changedb.cxx             |  112 ++++++--------
 sw/source/ui/fldui/changedb.hrc             |   48 ------
 sw/source/ui/fldui/changedb.src             |  119 --------------
 sw/source/ui/inc/changedb.hxx               |   17 --
 sw/source/ui/inc/dbtree.hxx                 |    4 
 sw/source/ui/inc/titlepage.hxx              |    4 
 sw/source/ui/misc/titlepage.cxx             |    4 
 sw/source/ui/shells/basesh.cxx              |    2 
 sw/uiconfig/swriter/ui/exchangedatabases.ui |  224 ++++++++++++----------------
 16 files changed, 201 insertions(+), 385 deletions(-)

New commits:
commit f5a8fa8b54e0a4a70d7439a054868d5bbdfd593b
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Jan 9 16:06:30 2013 +0000

    adapt code to Exchange Databases dialog
    
    Change-Id: Ife2d92131f7cd758628ae686cde734dab56e4499

diff --git a/sw/AllLangResTarget_sw.mk b/sw/AllLangResTarget_sw.mk
index 033d7c8..7ba3c46 100644
--- a/sw/AllLangResTarget_sw.mk
+++ b/sw/AllLangResTarget_sw.mk
@@ -118,7 +118,6 @@ $(eval $(call gb_SrsTarget_add_files,sw/res,\
     sw/source/ui/envelp/labprt.src \
     sw/source/ui/envelp/mailmrge.src \
     sw/source/ui/fldui/DropDownFieldDialog.src \
-    sw/source/ui/fldui/changedb.src \
     sw/source/ui/fldui/flddb.src \
     sw/source/ui/fldui/flddinf.src \
     sw/source/ui/fldui/flddok.src \
diff --git a/sw/UI_swriter.mk b/sw/UI_swriter.mk
index d24053c..2caf62f 100644
--- a/sw/UI_swriter.mk
+++ b/sw/UI_swriter.mk
@@ -22,6 +22,7 @@ $(eval $(call gb_UI_add_uifiles,modules/swriter,\
 	sw/uiconfig/swriter/ui/converttexttable \
 	sw/uiconfig/swriter/ui/endnotepage \
 	sw/uiconfig/swriter/ui/editcategories \
+	sw/uiconfig/swriter/ui/exchangedatabases \
 	sw/uiconfig/swriter/ui/footnotepage \
 	sw/uiconfig/swriter/ui/indexentry \
 	sw/uiconfig/swriter/ui/insertbookmark \
diff --git a/sw/inc/fldui.hrc b/sw/inc/fldui.hrc
index c500a1d..1a7b078 100644
--- a/sw/inc/fldui.hrc
+++ b/sw/inc/fldui.hrc
@@ -21,7 +21,6 @@
 #include "rcid.hrc"
 
 #define DLG_FLD_INPUT       (RC_FLDDLG_BEGIN + 5)
-#define DLG_CHANGE_DB       (RC_FLDDLG_BEGIN + 9)
 
 #define DLG_FLD_INSERT      (RC_FLDDLG_BEGIN + 11)
 #define DLG_FLD_DROPDOWN    (RC_FLDDLG_BEGIN + 12)
diff --git a/sw/inc/swabstdlg.hxx b/sw/inc/swabstdlg.hxx
index a6f8ab5..553dcc0 100644
--- a/sw/inc/swabstdlg.hxx
+++ b/sw/inc/swabstdlg.hxx
@@ -354,7 +354,7 @@ public:
     virtual VclAbstractDialog * CreateSwInsertBookmarkDlg( Window *pParent, SwWrtShell &rSh, SfxRequest& rReq, int nResId ) = 0;// add for SwInsertBookmarkDlg
 
     virtual AbstractSwBreakDlg * CreateSwBreakDlg(Window *pParent, SwWrtShell &rSh) = 0; // add for SwBreakDlg
-    virtual VclAbstractDialog   * CreateSwChangeDBDlg( SwView& rVw, int nResId ) = 0; //add for SwChangeDBDlg
+    virtual VclAbstractDialog   * CreateSwChangeDBDlg(SwView& rVw) = 0; //add for SwChangeDBDlg
     virtual SfxAbstractTabDialog *  CreateSwCharDlg( Window* pParent, SwView& pVw, const SfxItemSet& rCoreSet, int nResId, // add for SwCharDlg
                                                 const String* pFmtStr = 0, sal_Bool bIsDrwTxtDlg = sal_False) = 0;
     virtual AbstractSwConvertTableDlg* CreateSwConvertTableDlg(SwView& rView, bool bToTable) = 0; //add for SwConvertTableDlg
diff --git a/sw/source/ui/dbui/dbtree.cxx b/sw/source/ui/dbui/dbtree.cxx
index 34803ac..fe695aa 100644
--- a/sw/source/ui/dbui/dbtree.cxx
+++ b/sw/source/ui/dbui/dbtree.cxx
@@ -42,6 +42,7 @@
 #include <wrtsh.hxx>
 #include <dbtree.hxx>
 #include <osl/mutex.hxx>
+#include <vcl/builder.hxx>
 #include <vcl/svapp.hxx>
 #include "svtools/treelistentry.hxx"
 
@@ -189,6 +190,31 @@ SwDBTreeList::SwDBTreeList(Window *pParent, const ResId& rResId,
         InitTreeList();
 }
 
+SwDBTreeList::SwDBTreeList(Window *pParent)
+    : SvTreeListBox(pParent, WB_TABSTOP)
+    , aImageList(SW_RES(ILIST_DB_DLG))
+    , bInitialized(false)
+    , bShowColumns(false)
+    , pImpl(new SwDBTreeList_Impl(NULL))
+{
+    SetHelpId(HID_DB_SELECTION_TLB);
+
+    if (IsVisible())
+        InitTreeList();
+}
+
+extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeSwDBTreeList(Window *pParent, VclBuilder::stringmap &)
+{
+    return new SwDBTreeList(pParent);
+}
+
+Size SwDBTreeList::GetOptimalSize(WindowSizeType eType) const
+{
+    if (eType == WINDOWSIZE_PREFERRED)
+        return LogicToPixel(Size(100, 62), MapMode(MAP_APPFONT));
+    return SvTreeListBox::GetOptimalSize(eType);
+}
+
 SwDBTreeList::~SwDBTreeList()
 {
     delete pImpl;
diff --git a/sw/source/ui/dialog/swdlgfact.cxx b/sw/source/ui/dialog/swdlgfact.cxx
index 437c2bb..5f833a3 100644
--- a/sw/source/ui/dialog/swdlgfact.cxx
+++ b/sw/source/ui/dialog/swdlgfact.cxx
@@ -697,25 +697,12 @@ AbstractSwBreakDlg * SwAbstractDialogFactory_Impl::CreateSwBreakDlg(Window *pPar
     return new AbstractSwBreakDlg_Impl(pDlg);
 }
 
-VclAbstractDialog   * SwAbstractDialogFactory_Impl::CreateSwChangeDBDlg( SwView& rVw, int nResId  )
+VclAbstractDialog   * SwAbstractDialogFactory_Impl::CreateSwChangeDBDlg(SwView& rVw)
 {
-    Dialog* pDlg=NULL;
-    switch ( nResId )
-    {
-        case DLG_CHANGE_DB :
-            pDlg = new SwChangeDBDlg( rVw );
-            break;
-
-        default:
-            break;
-    }
-
-    if ( pDlg )
-        return new VclAbstractDialog_Impl( pDlg );
-    return 0;
+    Dialog* pDlg = new SwChangeDBDlg(rVw);
+    return new VclAbstractDialog_Impl(pDlg);
 }
 
-
 SfxAbstractTabDialog *  SwAbstractDialogFactory_Impl::CreateSwCharDlg(Window* pParent, SwView& pVw, const SfxItemSet& rCoreSet, int nResId, // add for SwCharDlg
                                                 const String* pFmtStr , sal_Bool bIsDrwTxtDlg )
 {
diff --git a/sw/source/ui/dialog/swdlgfact.hxx b/sw/source/ui/dialog/swdlgfact.hxx
index 6da4756..cf4f469 100644
--- a/sw/source/ui/dialog/swdlgfact.hxx
+++ b/sw/source/ui/dialog/swdlgfact.hxx
@@ -439,7 +439,7 @@ public:
                                                                 SvStream* pStream, int nResId ); //add for SwAsciiFilterDlg
     virtual VclAbstractDialog * CreateSwInsertBookmarkDlg( Window *pParent, SwWrtShell &rSh, SfxRequest& rReq, int nResId );//add for SwInsertBookmarkDlg
     virtual AbstractSwBreakDlg * CreateSwBreakDlg(Window *pParent, SwWrtShell &rSh); // add for SwBreakDlg
-    virtual VclAbstractDialog   * CreateSwChangeDBDlg( SwView& rVw, int nResId  ); //add for SwChangeDBDlg
+    virtual VclAbstractDialog   * CreateSwChangeDBDlg(SwView& rVw); //add for SwChangeDBDlg
     virtual SfxAbstractTabDialog *  CreateSwCharDlg( Window* pParent, SwView& pVw, const SfxItemSet& rCoreSet, int nResId, // add for SwCharDlg
                                                 const String* pFmtStr = 0, sal_Bool bIsDrwTxtDlg = sal_False);
     virtual AbstractSwConvertTableDlg* CreateSwConvertTableDlg(SwView& rView, bool bToTable); //add for SwConvertTableDlg
diff --git a/sw/source/ui/fldui/changedb.cxx b/sw/source/ui/fldui/changedb.cxx
index 805713b..1e6bf39 100644
--- a/sw/source/ui/fldui/changedb.cxx
+++ b/sw/source/ui/fldui/changedb.cxx
@@ -39,8 +39,8 @@
 #include <changedb.hxx>
 
 #include <fldui.hrc>
+#include <globals.hrc>
 #include <utlui.hrc>
-#include <changedb.hrc>
 
 #include <unomid.h>
 
@@ -53,45 +53,36 @@ using namespace ::com::sun::star::uno;
 /*--------------------------------------------------------------------
     Description: edit insert-field
  --------------------------------------------------------------------*/
-SwChangeDBDlg::SwChangeDBDlg(SwView& rVw) :
-    SvxStandardDialog(&rVw.GetViewFrame()->GetWindow(), SW_RES(DLG_CHANGE_DB)),
-
-    aDBListFL   (this, SW_RES(FL_DBLIST     )),
-    aUsedDBFT   (this, SW_RES(FT_USEDDB     )),
-    aAvailDBFT  (this, SW_RES(FT_AVAILDB    )),
-    aUsedDBTLB  (this, SW_RES(TLB_USEDDB    )),
-    aAvailDBTLB (this, SW_RES(TLB_AVAILDB   ), 0),
-    aAddDBPB    (this, SW_RES(PB_ADDDB)),
-    aDescFT     (this, SW_RES(FT_DESC       )),
-    aDocDBTextFT(this, SW_RES(FT_DOCDBTEXT  )),
-    aDocDBNameFT(this, SW_RES(FT_DOCDBNAME  )),
-    aOKBT       (this, SW_RES(BT_OK         )),
-    aCancelBT   (this, SW_RES(BT_CANCEL     )),
-    aHelpBT     (this, SW_RES(BT_HELP       )),
-    aImageList      (SW_RES(ILIST_DB_DLG    )),
-    pSh(rVw.GetWrtShellPtr()),
-    pMgr( new SwFldMgr() )
+SwChangeDBDlg::SwChangeDBDlg(SwView& rVw)
+    : SvxStandardDialog(&rVw.GetViewFrame()->GetWindow(), "ExchangeDatabasesDialog",
+        "modules/swriter/ui/exchangedatabases.ui")
+    , aImageList(SW_RES(ILIST_DB_DLG))
+    , pSh(rVw.GetWrtShellPtr())
+    , pMgr( new SwFldMgr() )
 {
-    aAvailDBTLB.SetWrtShell(*pSh);
+    get(m_pUsedDBTLB, "inuselb");
+    get(m_pAvailDBTLB, "availablelb");
+    get(m_pAddDBPB, "browse");
+    get(m_pDocDBNameFT, "dbnameft");
+    get(m_pDefineBT, "define");
+    m_pAvailDBTLB->SetWrtShell(*pSh);
     FillDBPopup();
 
-    FreeResource();
-
     ShowDBName(pSh->GetDBData());
-    aOKBT.SetClickHdl(LINK(this, SwChangeDBDlg, ButtonHdl));
-    aAddDBPB.SetClickHdl(LINK(this, SwChangeDBDlg, AddDBHdl));
+    m_pDefineBT->SetClickHdl(LINK(this, SwChangeDBDlg, ButtonHdl));
+    m_pAddDBPB->SetClickHdl(LINK(this, SwChangeDBDlg, AddDBHdl));
 
-    aUsedDBTLB.SetSelectionMode(MULTIPLE_SELECTION);
-    aUsedDBTLB.SetStyle(aUsedDBTLB.GetStyle()|WB_HASLINES|WB_CLIPCHILDREN|WB_SORT|WB_HASBUTTONS|WB_HASBUTTONSATROOT|WB_HSCROLL);
-    aUsedDBTLB.SetSpaceBetweenEntries(0);
-    aUsedDBTLB.SetNodeBitmaps( aImageList.GetImage(IMG_COLLAPSE), aImageList.GetImage(IMG_EXPAND));
+    m_pUsedDBTLB->SetSelectionMode(MULTIPLE_SELECTION);
+    m_pUsedDBTLB->SetStyle(m_pUsedDBTLB->GetStyle()|WB_HASLINES|WB_CLIPCHILDREN|WB_SORT|WB_HASBUTTONS|WB_HASBUTTONSATROOT|WB_HSCROLL);
+    m_pUsedDBTLB->SetSpaceBetweenEntries(0);
+    m_pUsedDBTLB->SetNodeBitmaps( aImageList.GetImage(IMG_COLLAPSE), aImageList.GetImage(IMG_EXPAND));
 
     Link aLink = LINK(this, SwChangeDBDlg, TreeSelectHdl);
 
-    aUsedDBTLB.SetSelectHdl(aLink);
-    aUsedDBTLB.SetDeselectHdl(aLink);
-    aAvailDBTLB.SetSelectHdl(aLink);
-    aAvailDBTLB.SetDeselectHdl(aLink);
+    m_pUsedDBTLB->SetSelectHdl(aLink);
+    m_pUsedDBTLB->SetDeselectHdl(aLink);
+    m_pAvailDBTLB->SetSelectHdl(aLink);
+    m_pAvailDBTLB->SetSelectHdl(aLink);
     TreeSelectHdl();
 }
 
@@ -106,7 +97,7 @@ void SwChangeDBDlg::FillDBPopup()
     const SwDBData& rDBData = pSh->GetDBData();
     String sDBName(rDBData.sDataSource);
     String sTableName(rDBData.sCommand);
-    aAvailDBTLB.Select(sDBName, sTableName, aEmptyStr);
+    m_pAvailDBTLB->Select(sDBName, sTableName, aEmptyStr);
 
     std::vector<String> aAllDBNames;
 
@@ -122,7 +113,7 @@ void SwChangeDBDlg::FillDBPopup()
     pSh->GetAllUsedDB( aDBNameList, &aAllDBNames );
 
     size_t nCount = aDBNameList.size();
-    aUsedDBTLB.Clear();
+    m_pUsedDBTLB->Clear();
     SvTreeListEntry *pFirst = 0;
     SvTreeListEntry *pLast = 0;
 
@@ -137,8 +128,8 @@ void SwChangeDBDlg::FillDBPopup()
 
     if (pFirst)
     {
-        aUsedDBTLB.MakeVisible(pFirst);
-        aUsedDBTLB.Select(pFirst);
+        m_pUsedDBTLB->MakeVisible(pFirst);
+        m_pUsedDBTLB->Select(pFirst);
     }
 
 }
@@ -158,23 +149,23 @@ SvTreeListEntry* SwChangeDBDlg::Insert(const String& rDBName)
     Image aDBImg = aImageList.GetImage(IMG_DB);
     Image aQueryImg = aImageList.GetImage(IMG_DBQUERY);
     Image& rToInsert = nCommandType ? aQueryImg : aTableImg;
-    while ((pParent = aUsedDBTLB.GetEntry(nParent++)) != NULL)
+    while ((pParent = m_pUsedDBTLB->GetEntry(nParent++)) != NULL)
     {
-        if (sDBName == aUsedDBTLB.GetEntryText(pParent))
+        if (sDBName == m_pUsedDBTLB->GetEntryText(pParent))
         {
-            while ((pChild = aUsedDBTLB.GetEntry(pParent, nChild++)) != NULL)
+            while ((pChild = m_pUsedDBTLB->GetEntry(pParent, nChild++)) != NULL)
             {
-                if (sTableName == aUsedDBTLB.GetEntryText(pChild))
+                if (sTableName == m_pUsedDBTLB->GetEntryText(pChild))
                     return pChild;
             }
-            SvTreeListEntry* pRet = aUsedDBTLB.InsertEntry(sTableName, rToInsert, rToInsert, pParent);
+            SvTreeListEntry* pRet = m_pUsedDBTLB->InsertEntry(sTableName, rToInsert, rToInsert, pParent);
             pRet->SetUserData((void*)nCommandType);
             return pRet;
         }
     }
-    pParent = aUsedDBTLB.InsertEntry(sDBName, aDBImg, aDBImg);
+    pParent = m_pUsedDBTLB->InsertEntry(sDBName, aDBImg, aDBImg);
 
-    SvTreeListEntry* pRet = aUsedDBTLB.InsertEntry(sTableName, rToInsert, rToInsert, pParent);
+    SvTreeListEntry* pRet = m_pUsedDBTLB->InsertEntry(sTableName, rToInsert, rToInsert, pParent);
     pRet->SetUserData((void*)nCommandType);
     return pRet;
 }
@@ -198,29 +189,29 @@ void SwChangeDBDlg::Apply()
 void SwChangeDBDlg::UpdateFlds()
 {
     std::vector<String> aDBNames;
-    aDBNames.reserve(aUsedDBTLB.GetSelectionCount());
-    SvTreeListEntry* pEntry = aUsedDBTLB.FirstSelected();
+    aDBNames.reserve(m_pUsedDBTLB->GetSelectionCount());
+    SvTreeListEntry* pEntry = m_pUsedDBTLB->FirstSelected();
 
     while( pEntry )
     {
-        if( aUsedDBTLB.GetParent( pEntry ))
+        if( m_pUsedDBTLB->GetParent( pEntry ))
         {
-            String* pTmp = new String( aUsedDBTLB.GetEntryText(
-                                            aUsedDBTLB.GetParent( pEntry )));
+            String* pTmp = new String( m_pUsedDBTLB->GetEntryText(
+                                            m_pUsedDBTLB->GetParent( pEntry )));
             *pTmp += DB_DELIM;
-            *pTmp += aUsedDBTLB.GetEntryText( pEntry );
+            *pTmp += m_pUsedDBTLB->GetEntryText( pEntry );
             *pTmp += DB_DELIM;
             int nCommandType = (int)(sal_uLong)pEntry->GetUserData();
             *pTmp += String::CreateFromInt32(nCommandType);
             aDBNames.push_back(*pTmp);
         }
-        pEntry = aUsedDBTLB.NextSelected(pEntry);
+        pEntry = m_pUsedDBTLB->NextSelected(pEntry);
     }
 
     pSh->StartAllAction();
     String sTableName, sColumnName;
     sal_Bool bIsTable = sal_False;
-    String sTemp(aAvailDBTLB.GetDBName(sTableName, sColumnName, &bIsTable));
+    String sTemp(m_pAvailDBTLB->GetDBName(sTableName, sColumnName, &bIsTable));
     sTemp += DB_DELIM;
     sTemp += sTableName;
     sTemp += DB_DELIM;
@@ -234,7 +225,7 @@ IMPL_LINK_NOARG(SwChangeDBDlg, ButtonHdl)
     String sTableName, sColumnName;
     SwDBData aData;
     sal_Bool bIsTable = sal_False;
-    aData.sDataSource = aAvailDBTLB.GetDBName(sTableName, sColumnName, &bIsTable);
+    aData.sDataSource = m_pAvailDBTLB->GetDBName(sTableName, sColumnName, &bIsTable);
     aData.sCommand = sTableName;
     aData.nCommandType = bIsTable ? 0 : 1;
     pSh->ChgDBData(aData);
@@ -248,13 +239,13 @@ IMPL_LINK_NOARG(SwChangeDBDlg, TreeSelectHdl)
 {
     sal_Bool bEnable = sal_False;
 
-    SvTreeListEntry* pEntry = aAvailDBTLB.GetCurEntry();
+    SvTreeListEntry* pEntry = m_pAvailDBTLB->GetCurEntry();
 
     if (pEntry)
     {
-        if (aAvailDBTLB.GetParent(pEntry))
+        if (m_pAvailDBTLB->GetParent(pEntry))
             bEnable = sal_True;
-        aOKBT.Enable( bEnable );
+        m_pDefineBT->Enable( bEnable );
     }
     return 0;
 }
@@ -276,14 +267,17 @@ void SwChangeDBDlg::ShowDBName(const SwDBData& rDBData)
             sName += '~';
     }
 
-    aDocDBNameFT.SetText(sName);
+    if (sName.EqualsAscii(".")) //empty
+        sName = SW_RESSTR(SW_STR_NONE);
+
+    m_pDocDBNameFT->SetText(sName);
 }
 
 IMPL_LINK_NOARG(SwChangeDBDlg, AddDBHdl)
 {
-    String sNewDB = SwNewDBMgr::LoadAndRegisterDataSource();
-    if(sNewDB.Len())
-        aAvailDBTLB.AddDataSource(sNewDB);
+    OUString sNewDB = SwNewDBMgr::LoadAndRegisterDataSource();
+    if (!sNewDB.isEmpty())
+        m_pAvailDBTLB->AddDataSource(sNewDB);
     return 0;
 }
 
diff --git a/sw/source/ui/fldui/changedb.hrc b/sw/source/ui/fldui/changedb.hrc
deleted file mode 100644
index a8b2e2d..0000000
--- a/sw/source/ui/fldui/changedb.hrc
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#ifndef _CHANGEDB_HRC
-#define _CHANGEDB_HRC
-
-// elements -----------------------------------------------------------------
-
-#define FT_DESC         1
-#define FT_DOCDBTEXT    2
-#define FT_DOCDBNAME    3
-#define FT_USEDDB       5
-#define FT_AVAILDB      6
-#define TLB_USEDDB      7
-#define TLB_AVAILDB     8
-#define FL_DBLIST               9
-#define BT_OK          10
-#define BT_CANCEL      11
-#define BT_HELP        12
-#define PB_ADDDB       13
-
-
-/*--------------------------------------------------------------------
-    Description: Bitmaps
- --------------------------------------------------------------------*/
-
-#define IMG_COLLAPSE        18002  /*RID_SVXIMG_COLLAPSEDNODE*/
-#define IMG_EXPAND          18003  /*RID_SVXIMG_EXPANDEDNODE*/
-#define IMG_DB                  1
-#define IMG_DBTABLE             2
-#define IMG_DBQUERY             3
-
-#endif
diff --git a/sw/source/ui/fldui/changedb.src b/sw/source/ui/fldui/changedb.src
deleted file mode 100644
index 87e9893..0000000
--- a/sw/source/ui/fldui/changedb.src
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#include "changedb.hrc"
-#include "fldui.hrc"
-
-
-ModalDialog DLG_CHANGE_DB
-{
-    HelpID = "sw:ModalDialog:DLG_CHANGE_DB";
-    OutputSize = TRUE ;
-    SVLook = TRUE ;
-    Size = MAP_APPFONT ( 286 , 175 ) ;
-
-    Text [ en-US ] = "Exchange Databases" ;
-    Moveable = TRUE ;
-    FixedLine FL_DBLIST
-    {
-        Pos = MAP_APPFONT ( 6 , 3 ) ;
-        Size = MAP_APPFONT ( 218 , 8 ) ;
-
-        Text [ en-US ] = "Exchange databases" ;
-    };
-    FixedText FT_USEDDB
-    {
-        Pos = MAP_APPFONT ( 12 , 14 ) ;
-        Size = MAP_APPFONT ( 90 , 8 ) ;
-        Left = TRUE ;
-        Text [ en-US ] = "Databases in Use" ;
-    };
-    FixedText FT_AVAILDB
-    {
-        Pos = MAP_APPFONT ( 118 , 14 ) ;
-        Size = MAP_APPFONT ( 90 ,  8 ) ;
-        Left = TRUE ;
-        Text [ en-US ] = "Available Databases" ;
-    };
-    Control TLB_USEDDB
-    {
-        Border = TRUE ;
-        Pos = MAP_APPFONT ( 12 , 25 ) ;
-        Size = MAP_APPFONT ( 100 , 62 ) ;
-        TabStop = TRUE ;
-    };
-    Control TLB_AVAILDB
-    {
-        Border = TRUE ;
-        Pos = MAP_APPFONT ( 118 , 25 ) ;
-        Size = MAP_APPFONT ( 100 , 62 ) ;
-        TabStop = TRUE ;
-    };
-    PushButton PB_ADDDB
-    {
-        HelpID = "sw:PushButton:DLG_CHANGE_DB:PB_ADDDB";
-        Pos = MAP_APPFONT ( 118 ,  90  ) ;
-        Size = MAP_APPFONT ( 50 , 14 ) ;
-        Text [ en-US ] = "Browse..." ;
-    };
-    FixedText FT_DESC
-    {
-        Pos = MAP_APPFONT ( 12 , 110 ) ;
-        Size = MAP_APPFONT ( 210 , 45 ) ;
-        WordBreak = TRUE ;
-        Left = TRUE ;
-        Text [ en-US ] = "Use this dialog to replace the databases you access in your document via database fields, with other databases. You can only make one change at a time. Multiple selection is possible in the list on the left.\nUse the browse button to select a database file." ;
-    };
-    FixedText FT_DOCDBTEXT
-    {
-        Pos = MAP_APPFONT ( 6 , 161 ) ;
-        Size = MAP_APPFONT ( 100 , 8 ) ;
-        Left = TRUE ;
-        Text [ en-US ] = "Database applied to document:" ;
-    };
-    FixedText FT_DOCDBNAME
-    {
-        Pos = MAP_APPFONT ( 109 , 161 ) ;
-        Size = MAP_APPFONT ( 114 , 8 ) ;
-        Left = TRUE ;
-        Text [ en-US ] = "Addresses.Addresses" ;
-    };
-    OKButton BT_OK
-    {
-        Pos = MAP_APPFONT ( 230 , 6 ) ;
-        Size = MAP_APPFONT ( 50 , 14 ) ;
-        TabStop = TRUE ;
-        DefButton = TRUE ;
-        Disable = TRUE ;
-        TabStop = TRUE ;
-        Text [ en-US ] = "Define" ;
-    };
-    CancelButton BT_CANCEL
-    {
-        Pos = MAP_APPFONT ( 230 , 23 ) ;
-        Size = MAP_APPFONT ( 50 , 14 ) ;
-        TabStop = TRUE ;
-        Text [ en-US ] = "~Close" ;
-    };
-    HelpButton BT_HELP
-    {
-        Pos = MAP_APPFONT ( 230 , 43 ) ;
-        Size = MAP_APPFONT ( 50 , 14 ) ;
-        TabStop = TRUE ;
-    };
-};
diff --git a/sw/source/ui/inc/changedb.hxx b/sw/source/ui/inc/changedb.hxx
index d7e4e0a..baf68a7 100644
--- a/sw/source/ui/inc/changedb.hxx
+++ b/sw/source/ui/inc/changedb.hxx
@@ -38,18 +38,11 @@ struct SwDBData;
  --------------------------------------------------------------------*/
 class SwChangeDBDlg: public SvxStandardDialog
 {
-    FixedLine       aDBListFL;
-    FixedText       aUsedDBFT;
-    FixedText       aAvailDBFT;
-    SvTreeListBox   aUsedDBTLB;
-    SwDBTreeList    aAvailDBTLB;
-    PushButton      aAddDBPB;
-    FixedInfo       aDescFT;
-    FixedText       aDocDBTextFT;
-    FixedText       aDocDBNameFT;
-    OKButton        aOKBT;
-    CancelButton    aCancelBT;
-    HelpButton      aHelpBT;
+    SvTreeListBox*  m_pUsedDBTLB;
+    SwDBTreeList*   m_pAvailDBTLB;
+    PushButton*     m_pAddDBPB;
+    FixedText*      m_pDocDBNameFT;
+    PushButton*     m_pDefineBT;
 
     ImageList       aImageList;
 
diff --git a/sw/source/ui/inc/dbtree.hxx b/sw/source/ui/inc/dbtree.hxx
index 3412560..fc27c48 100644
--- a/sw/source/ui/inc/dbtree.hxx
+++ b/sw/source/ui/inc/dbtree.hxx
@@ -52,11 +52,13 @@ class SW_DLLPUBLIC SwDBTreeList : public SvTreeListBox
     using SvTreeListBox::Select;
 
 public:
-     SwDBTreeList( Window* pParent, const ResId& rResId,
+    SwDBTreeList( Window* pParent, const ResId& rResId,
                     SwWrtShell* pSh,
                     const String& rDefDBName = aEmptyStr,
                     const sal_Bool bShowCol = sal_False );
+    SwDBTreeList(Window* pParent);
     virtual ~SwDBTreeList();
+    virtual Size GetOptimalSize(WindowSizeType eType) const;
 
     String  GetDBName( String& rTableName, String& rColumnName, sal_Bool* pbIsTable = 0);
 
diff --git a/sw/source/ui/inc/titlepage.hxx b/sw/source/ui/inc/titlepage.hxx
index 0c4a653..e4bf2ca 100644
--- a/sw/source/ui/inc/titlepage.hxx
+++ b/sw/source/ui/inc/titlepage.hxx
@@ -73,8 +73,8 @@ private:
 
     sal_uInt16 GetInsertPosition() const;
 
-    DECL_LINK( OKHdl, Button * );
-    DECL_LINK( EditHdl, Button * );
+    DECL_LINK(OKHdl, void *);
+    DECL_LINK(EditHdl, void *);
     DECL_LINK(RestartNumberingHdl, void *);
     DECL_LINK(SetPageNumberHdl, void *);
     DECL_LINK(UpHdl, void *);
diff --git a/sw/source/ui/misc/titlepage.cxx b/sw/source/ui/misc/titlepage.cxx
index 90c6b5b..402ace4 100644
--- a/sw/source/ui/misc/titlepage.cxx
+++ b/sw/source/ui/misc/titlepage.cxx
@@ -269,7 +269,7 @@ SwTitlePageDlg::~SwTitlePageDlg()
     delete mpPageFmtDesc;
 }
 
-IMPL_LINK( SwTitlePageDlg, EditHdl, Button *, /*pBtn*/ )
+IMPL_LINK_NOARG(SwTitlePageDlg, EditHdl)
 {
     SwView& rView = mpSh->GetView();
     rView.GetDocShell()->FormatPage(m_pPagePropertiesLB->GetSelectEntry(), false, mpSh);
@@ -278,7 +278,7 @@ IMPL_LINK( SwTitlePageDlg, EditHdl, Button *, /*pBtn*/ )
     return 0;
 }
 
-IMPL_LINK( SwTitlePageDlg, OKHdl, Button *, /*pBtn*/ )
+IMPL_LINK_NOARG(SwTitlePageDlg, OKHdl)
 {
     lcl_PushCursor(mpSh);
 
diff --git a/sw/source/ui/shells/basesh.cxx b/sw/source/ui/shells/basesh.cxx
index b24b34a..a443ea8 100644
--- a/sw/source/ui/shells/basesh.cxx
+++ b/sw/source/ui/shells/basesh.cxx
@@ -2815,7 +2815,7 @@ void SwBaseShell::ExecField( SfxRequest& rReq )
             SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
             OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
 
-            VclAbstractDialog* pDlg = pFact->CreateSwChangeDBDlg(GetView(), DLG_CHANGE_DB );
+            VclAbstractDialog* pDlg = pFact->CreateSwChangeDBDlg(GetView());
             OSL_ENSURE(pDlg, "Dialogdiet fail!");
             pDlg->Execute();
             delete pDlg;
diff --git a/sw/uiconfig/swriter/ui/exchangedatabases.ui b/sw/uiconfig/swriter/ui/exchangedatabases.ui
index 0337480..eb76a9f 100644
--- a/sw/uiconfig/swriter/ui/exchangedatabases.ui
+++ b/sw/uiconfig/swriter/ui/exchangedatabases.ui
@@ -1,8 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <interface>
   <!-- interface-requires gtk+ 3.0 -->
-  <object class="GtkAction" id="action1"/>
-  <object class="GtkDialog" id="Exchange Databases">
+  <object class="GtkDialog" id="ExchangeDatabasesDialog">
     <property name="can_focus">False</property>
     <property name="border_width">5</property>
     <property name="title" translatable="yes">Exchange Databases</property>
@@ -17,12 +16,12 @@
             <property name="orientation">vertical</property>
             <property name="layout_style">start</property>
             <child>
-              <object class="GtkButton" id="button1">
+              <object class="GtkButton" id="define">
                 <property name="label" translatable="yes">Define</property>
-                <property name="use_action_appearance">False</property>
-                <property name="related_action">action1</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>
               </object>
               <packing>
@@ -34,8 +33,6 @@
             <child>
               <object class="GtkButton" id="close">
                 <property name="label">gtk-close</property>
-                <property name="use_action_appearance">False</property>
-                <property name="related_action">action1</property>
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="receives_default">True</property>
@@ -50,8 +47,6 @@
             <child>
               <object class="GtkButton" id="help">
                 <property name="label">gtk-help</property>
-                <property name="use_action_appearance">False</property>
-                <property name="related_action">action1</property>
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="receives_default">True</property>
@@ -76,130 +71,128 @@
             <property name="visible">True</property>
             <property name="can_focus">False</property>
             <property name="orientation">vertical</property>
-            <property name="spacing">6</property>
+            <property name="spacing">12</property>
             <child>
               <object class="GtkFrame" id="frame1">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
+                <property name="hexpand">True</property>
+                <property name="vexpand">True</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="hexpand">True</property>
+                    <property name="vexpand">True</property>
+                    <property name="top_padding">6</property>
                     <property name="left_padding">12</property>
                     <child>
-                      <object class="GtkBox" id="box3">
+                      <object class="GtkGrid" id="grid1">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
-                        <property name="orientation">vertical</property>
-                        <property name="spacing">6</property>
+                        <property name="hexpand">True</property>
+                        <property name="vexpand">True</property>
+                        <property name="row_spacing">6</property>
+                        <property name="column_spacing">12</property>
+                        <property name="column_homogeneous">True</property>
                         <child>
-                          <object class="GtkGrid" id="grid1">
+                          <object class="GtkLabel" id="label5">
                             <property name="visible">True</property>
                             <property name="can_focus">False</property>
-                            <property name="row_spacing">6</property>
-                            <property name="column_spacing">6</property>
-                            <property name="column_homogeneous">True</property>
-                            <child>
-                              <object class="GtkLabel" id="label5">
-                                <property name="visible">True</property>
-                                <property name="can_focus">False</property>
-                                <property name="label" translatable="yes">Databases in Use</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="GtkLabel" id="label6">
-                                <property name="visible">True</property>
-                                <property name="can_focus">False</property>
-                                <property name="label" translatable="yes">_Availabe Databases</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>
-                            <child>
-                              <object class="GtkScrolledWindow" id="scrolledwindow1">
-                                <property name="visible">True</property>
-                                <property name="can_focus">True</property>
-                                <property name="shadow_type">in</property>
-                                <child>
-                                  <placeholder/>
-                                </child>
-                              </object>
-                              <packing>
-                                <property name="left_attach">0</property>
-                                <property name="top_attach">1</property>
-                                <property name="width">1</property>
-                                <property name="height">1</property>
-                              </packing>
-                            </child>
-                            <child>
-                              <object class="GtkScrolledWindow" id="scrolledwindow2">
-                                <property name="visible">True</property>
-                                <property name="can_focus">True</property>
-                                <property name="shadow_type">in</property>
-                                <child>
-                                  <placeholder/>
-                                </child>
-                              </object>
-                              <packing>
-                                <property name="left_attach">1</property>
-                                <property name="top_attach">1</property>
-                                <property name="width">1</property>
-                                <property name="height">1</property>
-                              </packing>
-                            </child>
-                            <child>
-                              <object class="GtkButton" id="button4">
-                                <property name="label" translatable="yes">_Browse...</property>
-                                <property name="use_action_appearance">False</property>
-                                <property name="related_action">action1</property>
-                                <property name="visible">True</property>
-                                <property name="can_focus">True</property>
-                                <property name="receives_default">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>
-                              <placeholder/>
-                            </child>
+                            <property name="xalign">0</property>
+                            <property name="label" translatable="yes">Databases in Use</property>
+                            <property name="use_underline">True</property>
                           </object>
                           <packing>
-                            <property name="expand">False</property>
-                            <property name="fill">True</property>
-                            <property name="position">0</property>
+                            <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="GtkLabel" id="label6">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="xalign">0</property>
+                            <property name="label" translatable="yes">_Available Databases</property>
+                            <property name="use_underline">True</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>
+                        <child>
+                          <object class="GtkButton" id="browse">
+                            <property name="label" translatable="yes">Browse...</property>
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="receives_default">True</property>
+                            <property name="halign">start</property>
+                            <property name="use_underline">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="GtkLabel" id="label7">
                             <property name="visible">True</property>
                             <property name="can_focus">False</property>
-                            <property name="label" translatable="yes">Use this dialog to replace the databases you access in your document via.
-database fields, with other databases. You can only make one change at a time.
-Multiple selection is possible in the list on the left.
+                            <property name="margin_top">12</property>
+                            <property name="margin_bottom">12</property>
+                            <property name="xalign">0</property>
+                            <property name="label" translatable="yes">Use this dialog to replace the databases you access in your document via database fields, with other databases. You can only make one change at a time. Multiple selection is possible in the list on the left.
 Use the browse button to select a database file.</property>
+                            <property name="wrap">True</property>
+                            <property name="max_width_chars">72</property>
+                          </object>
+                          <packing>
+                            <property name="left_attach">0</property>
+                            <property name="top_attach">3</property>
+                            <property name="width">2</property>
+                            <property name="height">1</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="svtlo:SvTreeListBox" id="inuselb">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="hexpand">True</property>
+                            <property name="vexpand">True</property>
                           </object>
                           <packing>
-                            <property name="expand">False</property>
-                            <property name="fill">True</property>
-                            <property name="position">1</property>
+                            <property name="left_attach">0</property>
+                            <property name="top_attach">1</property>
+                            <property name="width">1</property>
+                            <property name="height">1</property>
                           </packing>
                         </child>
+                        <child>
+                          <object class="swuilo:SwDBTreeList" id="availablelb">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="hexpand">True</property>
+                            <property name="vexpand">True</property>
+                          </object>
+                          <packing>
+                            <property name="left_attach">1</property>
+                            <property name="top_attach">1</property>
+                            <property name="width">1</property>
+                            <property name="height">1</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <placeholder/>
+                        </child>
                       </object>
                     </child>
                   </object>
@@ -208,7 +201,7 @@ Use the browse button to select a database file.</property>
                   <object class="GtkLabel" id="label1">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
-                    <property name="label" translatable="yes">Exchange Database</property>
+                    <property name="label" translatable="yes">Exchange databases</property>
                     <attributes>
                       <attribute name="weight" value="bold"/>
                     </attributes>
@@ -216,7 +209,7 @@ Use the browse button to select a database file.</property>
                 </child>
               </object>
               <packing>
-                <property name="expand">False</property>
+                <property name="expand">True</property>
                 <property name="fill">True</property>
                 <property name="position">0</property>
               </packing>
@@ -225,7 +218,7 @@ Use the browse button to select a database file.</property>
               <object class="GtkBox" id="box2">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
-                <property name="spacing">20</property>
+                <property name="spacing">12</property>
                 <child>
                   <object class="GtkLabel" id="label2">
                     <property name="visible">True</property>
@@ -239,9 +232,10 @@ Use the browse button to select a database file.</property>
                   </packing>
                 </child>
                 <child>
-                  <object class="GtkLabel" id="label3">
+                  <object class="GtkLabel" id="dbnameft">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
+                    <property name="label">DataSource.Command</property>
                   </object>
                   <packing>
                     <property name="expand">False</property>
@@ -249,18 +243,6 @@ Use the browse button to select a database file.</property>
                     <property name="position">1</property>
                   </packing>
                 </child>
-                <child>
-                  <object class="GtkLabel" id="label4">
-                    <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <property name="label" translatable="yes">.</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>
@@ -270,7 +252,7 @@ Use the browse button to select a database file.</property>
             </child>
           </object>
           <packing>
-            <property name="expand">False</property>
+            <property name="expand">True</property>
             <property name="fill">True</property>
             <property name="position">1</property>
           </packing>
@@ -278,7 +260,7 @@ Use the browse button to select a database file.</property>
       </object>
     </child>
     <action-widgets>
-      <action-widget response="0">button1</action-widget>
+      <action-widget response="0">define</action-widget>
       <action-widget response="0">close</action-widget>
       <action-widget response="0">help</action-widget>
     </action-widgets>


More information about the Libreoffice-commits mailing list