summaryrefslogtreecommitdiff
path: root/extensions/source/bibliography
diff options
context:
space:
mode:
Diffstat (limited to 'extensions/source/bibliography')
-rw-r--r--extensions/source/bibliography/bib.hrc1
-rw-r--r--extensions/source/bibliography/datman.cxx70
-rw-r--r--extensions/source/bibliography/datman.hrc5
-rw-r--r--extensions/source/bibliography/datman.src47
4 files changed, 20 insertions, 103 deletions
diff --git a/extensions/source/bibliography/bib.hrc b/extensions/source/bibliography/bib.hrc
index a464de773161..7b2fd1016b60 100644
--- a/extensions/source/bibliography/bib.hrc
+++ b/extensions/source/bibliography/bib.hrc
@@ -29,7 +29,6 @@
#define RID_BIB_DIALOG (RID_BIB_START)
#define RID_TP_GENERAL (RID_BIB_DIALOG)
#define RID_DLG_MAPPING (RID_BIB_DIALOG + 1)
-#define RID_DLG_DBCHANGE (RID_BIB_DIALOG + 2)
//Controls(100)
#define RID_BIB_CONTROLS (RID_BIB_START + 100)
diff --git a/extensions/source/bibliography/datman.cxx b/extensions/source/bibliography/datman.cxx
index 0baaf88c536b..49f020190c38 100644
--- a/extensions/source/bibliography/datman.cxx
+++ b/extensions/source/bibliography/datman.cxx
@@ -528,14 +528,8 @@ IMPL_LINK_NOARG(MappingDialog_Impl, OkHdl)
class DBChangeDialog_Impl : public ModalDialog
{
- OKButton aOKBT;
- CancelButton aCancelBT;
- HelpButton aHelpBT;
- FixedLine aSelectionGB;
- SvTabListBox aSelectionLB;
- HeaderBar aSelectionHB;
+ ListBox* m_pSelectionLB;
DBChangeDialogConfig_Impl aConfig;
- OUString aEntryST;
BibDataManager* pDatMan;
@@ -547,51 +541,33 @@ public:
OUString GetCurrentURL()const;
};
-DBChangeDialog_Impl::DBChangeDialog_Impl(Window* pParent, BibDataManager* pMan ) :
- ModalDialog(pParent, BibResId(RID_DLG_DBCHANGE) ),
- aOKBT(this, BibResId( BT_OK )),
- aCancelBT(this, BibResId( BT_CANCEL )),
- aHelpBT(this, BibResId( BT_HELP )),
- aSelectionGB(this, BibResId( GB_SELECTION )),
- aSelectionLB(this, BibResId( LB_SELECTION )),
- aSelectionHB(this, BibResId( HB_SELECTION )),
- aEntryST(BIB_RESSTR(ST_ENTRY)),
+DBChangeDialog_Impl::DBChangeDialog_Impl(Window* pParent, BibDataManager* pMan )
+ : ModalDialog(pParent, "ChooseDataSourceDialog",
+ "modules/sbibliography/ui/choosedatasourcedialog.ui")
+ ,
pDatMan(pMan)
{
- FreeResource();
- aSelectionLB.SetDoubleClickHdl( LINK(this, DBChangeDialog_Impl, DoubleClickHdl));
- try
- {
- ::Size aSize = aSelectionHB.GetSizePixel();
- long nTabs[2];
- nTabs[0] = 1;// Number of Tabs
- nTabs[1] = aSize.Width() / 4;
-
- aSelectionHB.SetStyle(aSelectionHB.GetStyle()|WB_STDHEADERBAR);
- aSelectionHB.InsertItem( 1, aEntryST, aSize.Width());
- aSelectionHB.SetSizePixel(aSelectionHB.CalcWindowSizePixel());
- aSelectionHB.Show();
+ get(m_pSelectionLB, "treeview");
+ m_pSelectionLB->set_height_request(m_pSelectionLB->GetTextHeight() * 6);
- aSelectionLB.SetTabs( &nTabs[0], MAP_PIXEL );
- aSelectionLB.SetStyle(aSelectionLB.GetStyle()|WB_CLIPCHILDREN|WB_SORT);
- aSelectionLB.GetModel()->SetSortMode(SortAscending);
+ m_pSelectionLB->SetStyle(m_pSelectionLB->GetStyle() | WB_SORT);
+ m_pSelectionLB->SetDoubleClickHdl( LINK(this, DBChangeDialog_Impl, DoubleClickHdl));
+ try
+ {
OUString sActiveSource = pDatMan->getActiveDataSource();
const Sequence< OUString >& rSources = aConfig.GetDataSourceNames();
const OUString* pSourceNames = rSources.getConstArray();
- for(int i = 0; i < rSources.getLength(); i++)
- {
- SvTreeListEntry* pEntry = aSelectionLB.InsertEntry(pSourceNames[i]);
- if(pSourceNames[i] == sActiveSource)
- {
- aSelectionLB.Select(pEntry);
- }
- }
- aSelectionLB.GetModel()->Resort();
+ for (sal_Int32 i = 0; i < rSources.getLength(); ++i)
+ m_pSelectionLB->InsertEntry(pSourceNames[i]);
+
+ m_pSelectionLB->SelectEntry(sActiveSource);
}
- catch (const Exception&)
+ catch (const Exception& e)
{
- OSL_FAIL("Exception in BibDataManager::DBChangeDialog_Impl::DBChangeDialog_Impl");
+ SAL_WARN("extensions.biblio",
+ "Exception in BibDataManager::DBChangeDialog_Impl::DBChangeDialog_Impl "
+ << e.Message);
}
}
@@ -607,13 +583,7 @@ DBChangeDialog_Impl::~DBChangeDialog_Impl()
OUString DBChangeDialog_Impl::GetCurrentURL()const
{
- OUString sRet;
- SvTreeListEntry* pEntry = aSelectionLB.FirstSelected();
- if(pEntry)
- {
- sRet = aSelectionLB.GetEntryText(pEntry, 0);
- }
- return sRet;
+ return m_pSelectionLB->GetSelectEntry();
}
// XDispatchProvider
diff --git a/extensions/source/bibliography/datman.hrc b/extensions/source/bibliography/datman.hrc
index 42fb77aed33f..b7515baafca4 100644
--- a/extensions/source/bibliography/datman.hrc
+++ b/extensions/source/bibliography/datman.hrc
@@ -87,9 +87,4 @@
#define FT_CUSTOM5 66
#define LB_CUSTOM5 67
-#define GB_SELECTION 68
-#define ST_ENTRY 69
-#define LB_SELECTION 71
-#define HB_SELECTION 72
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/extensions/source/bibliography/datman.src b/extensions/source/bibliography/datman.src
index 555e1e8dd8c4..ef862d1919d1 100644
--- a/extensions/source/bibliography/datman.src
+++ b/extensions/source/bibliography/datman.src
@@ -425,52 +425,5 @@ ModalDialog RID_DLG_MAPPING
};
Text [ en-US ] = "Column Layout for Table %1";
};
-ModalDialog RID_DLG_DBCHANGE
-{
- HelpID = HID_DLG_DBCHANGE;
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 291 , 131 ) ;
- Moveable = TRUE ;
- Text [ en-US ] = "Choose Data Source";
- OKButton BT_OK
- {
- Pos = MAP_APPFONT ( 238 , 3 ) ;
- Size = MAP_APPFONT ( 50 , 12 ) ;
- };
- CancelButton BT_CANCEL
- {
- Pos = MAP_APPFONT ( 238 , 18 ) ;
- Size = MAP_APPFONT ( 50 , 12 ) ;
- };
- HelpButton BT_HELP
- {
- Pos = MAP_APPFONT ( 238 , 36 ) ;
- Size = MAP_APPFONT ( 50 , 12 ) ;
- };
- FixedLine GB_SELECTION
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 229 , 8 ) ;
- };
- String ST_ENTRY
- {
- Text [ en-US ] = "Entry";
- };
- Control LB_SELECTION
- {
- Pos = MAP_APPFONT ( 9 , 24 ) ;
- Size = MAP_APPFONT ( 223 , 100 ) ;
- Border = TRUE;
- TabStop = TRUE;
- HelpId = HID_SELECTION_TLB;
- };
- Window HB_SELECTION
- {
- Pos = MAP_APPFONT ( 9 , 12 ) ;
- Size = MAP_APPFONT ( 223 , 12 ) ;
- Border = TRUE;
- };
-};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */