Make template names appear in the correct word order

This patch turns on sorting in many listboxes containing template or region names in Impress.
Contributed under license LGPLv3+/MPL.
This commit is contained in:
Peter Rabi 2011-08-11 11:18:45 +02:00 committed by Andras Timar
parent 598ea329b7
commit 50b7733fa4
4 changed files with 13 additions and 0 deletions

View file

@ -456,6 +456,7 @@ AssistentDlgImpl::AssistentDlgImpl( ::Window* pWindow, const Link& rFinishLink,
mpPage1RegionLB->SetSelectHdl(LINK(this,AssistentDlgImpl,SelectRegionHdl)); mpPage1RegionLB->SetSelectHdl(LINK(this,AssistentDlgImpl,SelectRegionHdl));
mpPage1RegionLB->SetDropDownLineCount( 6 ); mpPage1RegionLB->SetDropDownLineCount( 6 );
mpPage1TemplateLB->SetSelectHdl(LINK(this,AssistentDlgImpl,SelectTemplateHdl)); mpPage1TemplateLB->SetSelectHdl(LINK(this,AssistentDlgImpl,SelectTemplateHdl));
mpPage1TemplateLB->SetStyle(mpPage1TemplateLB->GetStyle() | WB_SORT);
mpPage1TemplateLB->InsertEntry(String(SdResId(STR_ISLOADING))); mpPage1TemplateLB->InsertEntry(String(SdResId(STR_ISLOADING)));
mpPage1EmptyRB->SetClickHdl(LINK(this,AssistentDlgImpl,StartTypeHdl)); mpPage1EmptyRB->SetClickHdl(LINK(this,AssistentDlgImpl,StartTypeHdl));
@ -494,6 +495,7 @@ AssistentDlgImpl::AssistentDlgImpl( ::Window* pWindow, const Link& rFinishLink,
mpPage2RegionLB->SetSelectHdl(LINK(this,AssistentDlgImpl,SelectRegionHdl)); mpPage2RegionLB->SetSelectHdl(LINK(this,AssistentDlgImpl,SelectRegionHdl));
mpPage2RegionLB->SetDropDownLineCount( 6 ); mpPage2RegionLB->SetDropDownLineCount( 6 );
mpPage2LayoutLB->SetSelectHdl(LINK(this,AssistentDlgImpl,SelectLayoutHdl)); mpPage2LayoutLB->SetSelectHdl(LINK(this,AssistentDlgImpl,SelectLayoutHdl));
mpPage2LayoutLB->SetStyle(mpPage2LayoutLB->GetStyle() | WB_SORT);
mpPage2LayoutLB->InsertEntry(String(SdResId(STR_ISLOADING))); mpPage2LayoutLB->InsertEntry(String(SdResId(STR_ISLOADING)));
// Seite 3 // Seite 3

View file

@ -75,6 +75,8 @@ SfxDocumentTemplateDlg::SfxDocumentTemplateDlg( Window * pParent, SfxDocumentTem
aNameEd.SetModifyHdl(LINK(this, SfxDocumentTemplateDlg, NameModify)); aNameEd.SetModifyHdl(LINK(this, SfxDocumentTemplateDlg, NameModify));
aOkBt.SetClickHdl(LINK(this, SfxDocumentTemplateDlg, OkHdl)); aOkBt.SetClickHdl(LINK(this, SfxDocumentTemplateDlg, OkHdl));
aEditBt.SetClickHdl(LINK(this, SfxDocumentTemplateDlg, EditHdl)); aEditBt.SetClickHdl(LINK(this, SfxDocumentTemplateDlg, EditHdl));
aRegionLb.SetStyle(aRegionLb.GetStyle() | WB_SORT);
aTemplateLb.SetStyle(aTemplateLb.GetStyle() | WB_SORT);
Init(); Init();
} }

View file

@ -219,6 +219,12 @@ SfxOrganizeDlg_Impl::SfxOrganizeDlg_Impl( SfxTemplateOrganizeDlg* pParent,
pFileDlg ( NULL ) pFileDlg ( NULL )
{ {
// Enable sorting in the listboxes
aLeftLb.GetModel()->SetSortMode( SortAscending );
aRightLb.GetModel()->SetSortMode( SortAscending );
aLeftLb.GetModel()->SetCompareHdl( LINK( &aLeftLb, SvTreeListBox, DefaultCompare ) );
aRightLb.GetModel()->SetCompareHdl( LINK( &aRightLb, SvTreeListBox, DefaultCompare ) );
// update the SfxDocumentTemplates the manager works with // update the SfxDocumentTemplates the manager works with
if ( aMgr.GetTemplates() ) // should never fail, but who knows .... if ( aMgr.GetTemplates() ) // should never fail, but who knows ....
{ {

View file

@ -613,6 +613,9 @@ SfxNewFileDialog_Impl::SfxNewFileDialog_Impl(
aTemplateLb.SetSelectHdl(LINK(this, SfxNewFileDialog_Impl, TemplateSelect)); aTemplateLb.SetSelectHdl(LINK(this, SfxNewFileDialog_Impl, TemplateSelect));
aTemplateLb.SetDoubleClickHdl(LINK(this, SfxNewFileDialog_Impl, DoubleClick)); aTemplateLb.SetDoubleClickHdl(LINK(this, SfxNewFileDialog_Impl, DoubleClick));
aTemplateLb.SetStyle(aTemplateLb.GetStyle() | WB_SORT);
aRegionLb.SetStyle(aRegionLb.GetStyle() | WB_SORT);
// update the template configuration if necessary // update the template configuration if necessary
{ {
WaitObject aWaitCursor( pAntiImplP->GetParent() ); WaitObject aWaitCursor( pAntiImplP->GetParent() );