Kaydet (Commit) f5a8fa8b authored tarafından Caolán McNamara's avatar Caolán McNamara

adapt code to Exchange Databases dialog

Change-Id: Ife2d92131f7cd758628ae686cde734dab56e4499
üst b6fbc864
...@@ -118,7 +118,6 @@ $(eval $(call gb_SrsTarget_add_files,sw/res,\ ...@@ -118,7 +118,6 @@ $(eval $(call gb_SrsTarget_add_files,sw/res,\
sw/source/ui/envelp/labprt.src \ sw/source/ui/envelp/labprt.src \
sw/source/ui/envelp/mailmrge.src \ sw/source/ui/envelp/mailmrge.src \
sw/source/ui/fldui/DropDownFieldDialog.src \ sw/source/ui/fldui/DropDownFieldDialog.src \
sw/source/ui/fldui/changedb.src \
sw/source/ui/fldui/flddb.src \ sw/source/ui/fldui/flddb.src \
sw/source/ui/fldui/flddinf.src \ sw/source/ui/fldui/flddinf.src \
sw/source/ui/fldui/flddok.src \ sw/source/ui/fldui/flddok.src \
......
...@@ -22,6 +22,7 @@ $(eval $(call gb_UI_add_uifiles,modules/swriter,\ ...@@ -22,6 +22,7 @@ $(eval $(call gb_UI_add_uifiles,modules/swriter,\
sw/uiconfig/swriter/ui/converttexttable \ sw/uiconfig/swriter/ui/converttexttable \
sw/uiconfig/swriter/ui/endnotepage \ sw/uiconfig/swriter/ui/endnotepage \
sw/uiconfig/swriter/ui/editcategories \ sw/uiconfig/swriter/ui/editcategories \
sw/uiconfig/swriter/ui/exchangedatabases \
sw/uiconfig/swriter/ui/footnotepage \ sw/uiconfig/swriter/ui/footnotepage \
sw/uiconfig/swriter/ui/indexentry \ sw/uiconfig/swriter/ui/indexentry \
sw/uiconfig/swriter/ui/insertbookmark \ sw/uiconfig/swriter/ui/insertbookmark \
......
...@@ -21,7 +21,6 @@ ...@@ -21,7 +21,6 @@
#include "rcid.hrc" #include "rcid.hrc"
#define DLG_FLD_INPUT (RC_FLDDLG_BEGIN + 5) #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_INSERT (RC_FLDDLG_BEGIN + 11)
#define DLG_FLD_DROPDOWN (RC_FLDDLG_BEGIN + 12) #define DLG_FLD_DROPDOWN (RC_FLDDLG_BEGIN + 12)
......
...@@ -354,7 +354,7 @@ public: ...@@ -354,7 +354,7 @@ public:
virtual VclAbstractDialog * CreateSwInsertBookmarkDlg( Window *pParent, SwWrtShell &rSh, SfxRequest& rReq, int nResId ) = 0;// add for SwInsertBookmarkDlg 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 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 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; const String* pFmtStr = 0, sal_Bool bIsDrwTxtDlg = sal_False) = 0;
virtual AbstractSwConvertTableDlg* CreateSwConvertTableDlg(SwView& rView, bool bToTable) = 0; //add for SwConvertTableDlg virtual AbstractSwConvertTableDlg* CreateSwConvertTableDlg(SwView& rView, bool bToTable) = 0; //add for SwConvertTableDlg
......
...@@ -42,6 +42,7 @@ ...@@ -42,6 +42,7 @@
#include <wrtsh.hxx> #include <wrtsh.hxx>
#include <dbtree.hxx> #include <dbtree.hxx>
#include <osl/mutex.hxx> #include <osl/mutex.hxx>
#include <vcl/builder.hxx>
#include <vcl/svapp.hxx> #include <vcl/svapp.hxx>
#include "svtools/treelistentry.hxx" #include "svtools/treelistentry.hxx"
...@@ -189,6 +190,31 @@ SwDBTreeList::SwDBTreeList(Window *pParent, const ResId& rResId, ...@@ -189,6 +190,31 @@ SwDBTreeList::SwDBTreeList(Window *pParent, const ResId& rResId,
InitTreeList(); 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() SwDBTreeList::~SwDBTreeList()
{ {
delete pImpl; delete pImpl;
......
...@@ -697,25 +697,12 @@ AbstractSwBreakDlg * SwAbstractDialogFactory_Impl::CreateSwBreakDlg(Window *pPar ...@@ -697,25 +697,12 @@ AbstractSwBreakDlg * SwAbstractDialogFactory_Impl::CreateSwBreakDlg(Window *pPar
return new AbstractSwBreakDlg_Impl(pDlg); return new AbstractSwBreakDlg_Impl(pDlg);
} }
VclAbstractDialog * SwAbstractDialogFactory_Impl::CreateSwChangeDBDlg( SwView& rVw, int nResId ) VclAbstractDialog * SwAbstractDialogFactory_Impl::CreateSwChangeDBDlg(SwView& rVw)
{ {
Dialog* pDlg=NULL; Dialog* pDlg = new SwChangeDBDlg(rVw);
switch ( nResId ) return new VclAbstractDialog_Impl(pDlg);
{
case DLG_CHANGE_DB :
pDlg = new SwChangeDBDlg( rVw );
break;
default:
break;
}
if ( pDlg )
return new VclAbstractDialog_Impl( pDlg );
return 0;
} }
SfxAbstractTabDialog * SwAbstractDialogFactory_Impl::CreateSwCharDlg(Window* pParent, SwView& pVw, const SfxItemSet& rCoreSet, int nResId, // add for SwCharDlg SfxAbstractTabDialog * SwAbstractDialogFactory_Impl::CreateSwCharDlg(Window* pParent, SwView& pVw, const SfxItemSet& rCoreSet, int nResId, // add for SwCharDlg
const String* pFmtStr , sal_Bool bIsDrwTxtDlg ) const String* pFmtStr , sal_Bool bIsDrwTxtDlg )
{ {
......
...@@ -439,7 +439,7 @@ public: ...@@ -439,7 +439,7 @@ public:
SvStream* pStream, int nResId ); //add for SwAsciiFilterDlg SvStream* pStream, int nResId ); //add for SwAsciiFilterDlg
virtual VclAbstractDialog * CreateSwInsertBookmarkDlg( Window *pParent, SwWrtShell &rSh, SfxRequest& rReq, int nResId );//add for SwInsertBookmarkDlg 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 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 virtual SfxAbstractTabDialog * CreateSwCharDlg( Window* pParent, SwView& pVw, const SfxItemSet& rCoreSet, int nResId, // add for SwCharDlg
const String* pFmtStr = 0, sal_Bool bIsDrwTxtDlg = sal_False); const String* pFmtStr = 0, sal_Bool bIsDrwTxtDlg = sal_False);
virtual AbstractSwConvertTableDlg* CreateSwConvertTableDlg(SwView& rView, bool bToTable); //add for SwConvertTableDlg virtual AbstractSwConvertTableDlg* CreateSwConvertTableDlg(SwView& rView, bool bToTable); //add for SwConvertTableDlg
......
...@@ -39,8 +39,8 @@ ...@@ -39,8 +39,8 @@
#include <changedb.hxx> #include <changedb.hxx>
#include <fldui.hrc> #include <fldui.hrc>
#include <globals.hrc>
#include <utlui.hrc> #include <utlui.hrc>
#include <changedb.hrc>
#include <unomid.h> #include <unomid.h>
...@@ -53,45 +53,36 @@ using namespace ::com::sun::star::uno; ...@@ -53,45 +53,36 @@ using namespace ::com::sun::star::uno;
/*-------------------------------------------------------------------- /*--------------------------------------------------------------------
Description: edit insert-field Description: edit insert-field
--------------------------------------------------------------------*/ --------------------------------------------------------------------*/
SwChangeDBDlg::SwChangeDBDlg(SwView& rVw) : SwChangeDBDlg::SwChangeDBDlg(SwView& rVw)
SvxStandardDialog(&rVw.GetViewFrame()->GetWindow(), SW_RES(DLG_CHANGE_DB)), : SvxStandardDialog(&rVw.GetViewFrame()->GetWindow(), "ExchangeDatabasesDialog",
"modules/swriter/ui/exchangedatabases.ui")
aDBListFL (this, SW_RES(FL_DBLIST )), , aImageList(SW_RES(ILIST_DB_DLG))
aUsedDBFT (this, SW_RES(FT_USEDDB )), , pSh(rVw.GetWrtShellPtr())
aAvailDBFT (this, SW_RES(FT_AVAILDB )), , pMgr( new SwFldMgr() )
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() )
{ {
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(); FillDBPopup();
FreeResource();
ShowDBName(pSh->GetDBData()); ShowDBName(pSh->GetDBData());
aOKBT.SetClickHdl(LINK(this, SwChangeDBDlg, ButtonHdl)); m_pDefineBT->SetClickHdl(LINK(this, SwChangeDBDlg, ButtonHdl));
aAddDBPB.SetClickHdl(LINK(this, SwChangeDBDlg, AddDBHdl)); m_pAddDBPB->SetClickHdl(LINK(this, SwChangeDBDlg, AddDBHdl));
aUsedDBTLB.SetSelectionMode(MULTIPLE_SELECTION); m_pUsedDBTLB->SetSelectionMode(MULTIPLE_SELECTION);
aUsedDBTLB.SetStyle(aUsedDBTLB.GetStyle()|WB_HASLINES|WB_CLIPCHILDREN|WB_SORT|WB_HASBUTTONS|WB_HASBUTTONSATROOT|WB_HSCROLL); m_pUsedDBTLB->SetStyle(m_pUsedDBTLB->GetStyle()|WB_HASLINES|WB_CLIPCHILDREN|WB_SORT|WB_HASBUTTONS|WB_HASBUTTONSATROOT|WB_HSCROLL);
aUsedDBTLB.SetSpaceBetweenEntries(0); m_pUsedDBTLB->SetSpaceBetweenEntries(0);
aUsedDBTLB.SetNodeBitmaps( aImageList.GetImage(IMG_COLLAPSE), aImageList.GetImage(IMG_EXPAND)); m_pUsedDBTLB->SetNodeBitmaps( aImageList.GetImage(IMG_COLLAPSE), aImageList.GetImage(IMG_EXPAND));
Link aLink = LINK(this, SwChangeDBDlg, TreeSelectHdl); Link aLink = LINK(this, SwChangeDBDlg, TreeSelectHdl);
aUsedDBTLB.SetSelectHdl(aLink); m_pUsedDBTLB->SetSelectHdl(aLink);
aUsedDBTLB.SetDeselectHdl(aLink); m_pUsedDBTLB->SetDeselectHdl(aLink);
aAvailDBTLB.SetSelectHdl(aLink); m_pAvailDBTLB->SetSelectHdl(aLink);
aAvailDBTLB.SetDeselectHdl(aLink); m_pAvailDBTLB->SetSelectHdl(aLink);
TreeSelectHdl(); TreeSelectHdl();
} }
...@@ -106,7 +97,7 @@ void SwChangeDBDlg::FillDBPopup() ...@@ -106,7 +97,7 @@ void SwChangeDBDlg::FillDBPopup()
const SwDBData& rDBData = pSh->GetDBData(); const SwDBData& rDBData = pSh->GetDBData();
String sDBName(rDBData.sDataSource); String sDBName(rDBData.sDataSource);
String sTableName(rDBData.sCommand); String sTableName(rDBData.sCommand);
aAvailDBTLB.Select(sDBName, sTableName, aEmptyStr); m_pAvailDBTLB->Select(sDBName, sTableName, aEmptyStr);
std::vector<String> aAllDBNames; std::vector<String> aAllDBNames;
...@@ -122,7 +113,7 @@ void SwChangeDBDlg::FillDBPopup() ...@@ -122,7 +113,7 @@ void SwChangeDBDlg::FillDBPopup()
pSh->GetAllUsedDB( aDBNameList, &aAllDBNames ); pSh->GetAllUsedDB( aDBNameList, &aAllDBNames );
size_t nCount = aDBNameList.size(); size_t nCount = aDBNameList.size();
aUsedDBTLB.Clear(); m_pUsedDBTLB->Clear();
SvTreeListEntry *pFirst = 0; SvTreeListEntry *pFirst = 0;
SvTreeListEntry *pLast = 0; SvTreeListEntry *pLast = 0;
...@@ -137,8 +128,8 @@ void SwChangeDBDlg::FillDBPopup() ...@@ -137,8 +128,8 @@ void SwChangeDBDlg::FillDBPopup()
if (pFirst) if (pFirst)
{ {
aUsedDBTLB.MakeVisible(pFirst); m_pUsedDBTLB->MakeVisible(pFirst);
aUsedDBTLB.Select(pFirst); m_pUsedDBTLB->Select(pFirst);
} }
} }
...@@ -158,23 +149,23 @@ SvTreeListEntry* SwChangeDBDlg::Insert(const String& rDBName) ...@@ -158,23 +149,23 @@ SvTreeListEntry* SwChangeDBDlg::Insert(const String& rDBName)
Image aDBImg = aImageList.GetImage(IMG_DB); Image aDBImg = aImageList.GetImage(IMG_DB);
Image aQueryImg = aImageList.GetImage(IMG_DBQUERY); Image aQueryImg = aImageList.GetImage(IMG_DBQUERY);
Image& rToInsert = nCommandType ? aQueryImg : aTableImg; 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; return pChild;
} }
SvTreeListEntry* pRet = aUsedDBTLB.InsertEntry(sTableName, rToInsert, rToInsert, pParent); SvTreeListEntry* pRet = m_pUsedDBTLB->InsertEntry(sTableName, rToInsert, rToInsert, pParent);
pRet->SetUserData((void*)nCommandType); pRet->SetUserData((void*)nCommandType);
return pRet; 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); pRet->SetUserData((void*)nCommandType);
return pRet; return pRet;
} }
...@@ -198,29 +189,29 @@ void SwChangeDBDlg::Apply() ...@@ -198,29 +189,29 @@ void SwChangeDBDlg::Apply()
void SwChangeDBDlg::UpdateFlds() void SwChangeDBDlg::UpdateFlds()
{ {
std::vector<String> aDBNames; std::vector<String> aDBNames;
aDBNames.reserve(aUsedDBTLB.GetSelectionCount()); aDBNames.reserve(m_pUsedDBTLB->GetSelectionCount());
SvTreeListEntry* pEntry = aUsedDBTLB.FirstSelected(); SvTreeListEntry* pEntry = m_pUsedDBTLB->FirstSelected();
while( pEntry ) while( pEntry )
{ {
if( aUsedDBTLB.GetParent( pEntry )) if( m_pUsedDBTLB->GetParent( pEntry ))
{ {
String* pTmp = new String( aUsedDBTLB.GetEntryText( String* pTmp = new String( m_pUsedDBTLB->GetEntryText(
aUsedDBTLB.GetParent( pEntry ))); m_pUsedDBTLB->GetParent( pEntry )));
*pTmp += DB_DELIM; *pTmp += DB_DELIM;
*pTmp += aUsedDBTLB.GetEntryText( pEntry ); *pTmp += m_pUsedDBTLB->GetEntryText( pEntry );
*pTmp += DB_DELIM; *pTmp += DB_DELIM;
int nCommandType = (int)(sal_uLong)pEntry->GetUserData(); int nCommandType = (int)(sal_uLong)pEntry->GetUserData();
*pTmp += String::CreateFromInt32(nCommandType); *pTmp += String::CreateFromInt32(nCommandType);
aDBNames.push_back(*pTmp); aDBNames.push_back(*pTmp);
} }
pEntry = aUsedDBTLB.NextSelected(pEntry); pEntry = m_pUsedDBTLB->NextSelected(pEntry);
} }
pSh->StartAllAction(); pSh->StartAllAction();
String sTableName, sColumnName; String sTableName, sColumnName;
sal_Bool bIsTable = sal_False; sal_Bool bIsTable = sal_False;
String sTemp(aAvailDBTLB.GetDBName(sTableName, sColumnName, &bIsTable)); String sTemp(m_pAvailDBTLB->GetDBName(sTableName, sColumnName, &bIsTable));
sTemp += DB_DELIM; sTemp += DB_DELIM;
sTemp += sTableName; sTemp += sTableName;
sTemp += DB_DELIM; sTemp += DB_DELIM;
...@@ -234,7 +225,7 @@ IMPL_LINK_NOARG(SwChangeDBDlg, ButtonHdl) ...@@ -234,7 +225,7 @@ IMPL_LINK_NOARG(SwChangeDBDlg, ButtonHdl)
String sTableName, sColumnName; String sTableName, sColumnName;
SwDBData aData; SwDBData aData;
sal_Bool bIsTable = sal_False; sal_Bool bIsTable = sal_False;
aData.sDataSource = aAvailDBTLB.GetDBName(sTableName, sColumnName, &bIsTable); aData.sDataSource = m_pAvailDBTLB->GetDBName(sTableName, sColumnName, &bIsTable);
aData.sCommand = sTableName; aData.sCommand = sTableName;
aData.nCommandType = bIsTable ? 0 : 1; aData.nCommandType = bIsTable ? 0 : 1;
pSh->ChgDBData(aData); pSh->ChgDBData(aData);
...@@ -248,13 +239,13 @@ IMPL_LINK_NOARG(SwChangeDBDlg, TreeSelectHdl) ...@@ -248,13 +239,13 @@ IMPL_LINK_NOARG(SwChangeDBDlg, TreeSelectHdl)
{ {
sal_Bool bEnable = sal_False; sal_Bool bEnable = sal_False;
SvTreeListEntry* pEntry = aAvailDBTLB.GetCurEntry(); SvTreeListEntry* pEntry = m_pAvailDBTLB->GetCurEntry();
if (pEntry) if (pEntry)
{ {
if (aAvailDBTLB.GetParent(pEntry)) if (m_pAvailDBTLB->GetParent(pEntry))
bEnable = sal_True; bEnable = sal_True;
aOKBT.Enable( bEnable ); m_pDefineBT->Enable( bEnable );
} }
return 0; return 0;
} }
...@@ -276,14 +267,17 @@ void SwChangeDBDlg::ShowDBName(const SwDBData& rDBData) ...@@ -276,14 +267,17 @@ void SwChangeDBDlg::ShowDBName(const SwDBData& rDBData)
sName += '~'; sName += '~';
} }
aDocDBNameFT.SetText(sName); if (sName.EqualsAscii(".")) //empty
sName = SW_RESSTR(SW_STR_NONE);
m_pDocDBNameFT->SetText(sName);
} }
IMPL_LINK_NOARG(SwChangeDBDlg, AddDBHdl) IMPL_LINK_NOARG(SwChangeDBDlg, AddDBHdl)
{ {
String sNewDB = SwNewDBMgr::LoadAndRegisterDataSource(); OUString sNewDB = SwNewDBMgr::LoadAndRegisterDataSource();
if(sNewDB.Len()) if (!sNewDB.isEmpty())
aAvailDBTLB.AddDataSource(sNewDB); m_pAvailDBTLB->AddDataSource(sNewDB);
return 0; return 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
/*
* 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 ;
};
};
...@@ -38,18 +38,11 @@ struct SwDBData; ...@@ -38,18 +38,11 @@ struct SwDBData;
--------------------------------------------------------------------*/ --------------------------------------------------------------------*/
class SwChangeDBDlg: public SvxStandardDialog class SwChangeDBDlg: public SvxStandardDialog
{ {
FixedLine aDBListFL; SvTreeListBox* m_pUsedDBTLB;
FixedText aUsedDBFT; SwDBTreeList* m_pAvailDBTLB;
FixedText aAvailDBFT; PushButton* m_pAddDBPB;
SvTreeListBox aUsedDBTLB; FixedText* m_pDocDBNameFT;
SwDBTreeList aAvailDBTLB; PushButton* m_pDefineBT;
PushButton aAddDBPB;
FixedInfo aDescFT;
FixedText aDocDBTextFT;
FixedText aDocDBNameFT;
OKButton aOKBT;
CancelButton aCancelBT;
HelpButton aHelpBT;
ImageList aImageList; ImageList aImageList;
......
...@@ -52,11 +52,13 @@ class SW_DLLPUBLIC SwDBTreeList : public SvTreeListBox ...@@ -52,11 +52,13 @@ class SW_DLLPUBLIC SwDBTreeList : public SvTreeListBox
using SvTreeListBox::Select; using SvTreeListBox::Select;
public: public:
SwDBTreeList( Window* pParent, const ResId& rResId, SwDBTreeList( Window* pParent, const ResId& rResId,
SwWrtShell* pSh, SwWrtShell* pSh,
const String& rDefDBName = aEmptyStr, const String& rDefDBName = aEmptyStr,
const sal_Bool bShowCol = sal_False ); const sal_Bool bShowCol = sal_False );
SwDBTreeList(Window* pParent);
virtual ~SwDBTreeList(); virtual ~SwDBTreeList();
virtual Size GetOptimalSize(WindowSizeType eType) const;
String GetDBName( String& rTableName, String& rColumnName, sal_Bool* pbIsTable = 0); String GetDBName( String& rTableName, String& rColumnName, sal_Bool* pbIsTable = 0);
......
...@@ -73,8 +73,8 @@ private: ...@@ -73,8 +73,8 @@ private:
sal_uInt16 GetInsertPosition() const; sal_uInt16 GetInsertPosition() const;
DECL_LINK( OKHdl, Button * ); DECL_LINK(OKHdl, void *);
DECL_LINK( EditHdl, Button * ); DECL_LINK(EditHdl, void *);
DECL_LINK(RestartNumberingHdl, void *); DECL_LINK(RestartNumberingHdl, void *);
DECL_LINK(SetPageNumberHdl, void *); DECL_LINK(SetPageNumberHdl, void *);
DECL_LINK(UpHdl, void *); DECL_LINK(UpHdl, void *);
......
...@@ -269,7 +269,7 @@ SwTitlePageDlg::~SwTitlePageDlg() ...@@ -269,7 +269,7 @@ SwTitlePageDlg::~SwTitlePageDlg()
delete mpPageFmtDesc; delete mpPageFmtDesc;
} }
IMPL_LINK( SwTitlePageDlg, EditHdl, Button *, /*pBtn*/ ) IMPL_LINK_NOARG(SwTitlePageDlg, EditHdl)
{ {
SwView& rView = mpSh->GetView(); SwView& rView = mpSh->GetView();
rView.GetDocShell()->FormatPage(m_pPagePropertiesLB->GetSelectEntry(), false, mpSh); rView.GetDocShell()->FormatPage(m_pPagePropertiesLB->GetSelectEntry(), false, mpSh);
...@@ -278,7 +278,7 @@ IMPL_LINK( SwTitlePageDlg, EditHdl, Button *, /*pBtn*/ ) ...@@ -278,7 +278,7 @@ IMPL_LINK( SwTitlePageDlg, EditHdl, Button *, /*pBtn*/ )
return 0; return 0;
} }
IMPL_LINK( SwTitlePageDlg, OKHdl, Button *, /*pBtn*/ ) IMPL_LINK_NOARG(SwTitlePageDlg, OKHdl)
{ {
lcl_PushCursor(mpSh); lcl_PushCursor(mpSh);
......
...@@ -2815,7 +2815,7 @@ void SwBaseShell::ExecField( SfxRequest& rReq ) ...@@ -2815,7 +2815,7 @@ void SwBaseShell::ExecField( SfxRequest& rReq )
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
VclAbstractDialog* pDlg = pFact->CreateSwChangeDBDlg(GetView(), DLG_CHANGE_DB ); VclAbstractDialog* pDlg = pFact->CreateSwChangeDBDlg(GetView());
OSL_ENSURE(pDlg, "Dialogdiet fail!"); OSL_ENSURE(pDlg, "Dialogdiet fail!");
pDlg->Execute(); pDlg->Execute();
delete pDlg; delete pDlg;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment