summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorPeter Rabi <prabi@caesar.elte.hu>2011-08-11 11:18:45 +0200
committerAndras Timar <atimar@suse.com>2011-08-22 16:36:29 +0200
commit50b7733fa41879a62d35cab64da59b109e1a8502 (patch)
treef53825e29e478225873e0a4d9dd6bf6cae36f473 /sfx2
parent598ea329b703fcf165690dac51202ee11754790f (diff)
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.
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/doc/doctdlg.cxx2
-rw-r--r--sfx2/source/doc/docvor.cxx6
-rw-r--r--sfx2/source/doc/new.cxx3
3 files changed, 11 insertions, 0 deletions
diff --git a/sfx2/source/doc/doctdlg.cxx b/sfx2/source/doc/doctdlg.cxx
index 360b1fec8a72..36cd638a39a2 100644
--- a/sfx2/source/doc/doctdlg.cxx
+++ b/sfx2/source/doc/doctdlg.cxx
@@ -75,6 +75,8 @@ SfxDocumentTemplateDlg::SfxDocumentTemplateDlg( Window * pParent, SfxDocumentTem
aNameEd.SetModifyHdl(LINK(this, SfxDocumentTemplateDlg, NameModify));
aOkBt.SetClickHdl(LINK(this, SfxDocumentTemplateDlg, OkHdl));
aEditBt.SetClickHdl(LINK(this, SfxDocumentTemplateDlg, EditHdl));
+ aRegionLb.SetStyle(aRegionLb.GetStyle() | WB_SORT);
+ aTemplateLb.SetStyle(aTemplateLb.GetStyle() | WB_SORT);
Init();
}
diff --git a/sfx2/source/doc/docvor.cxx b/sfx2/source/doc/docvor.cxx
index 4a81f92e2c4c..7f2268d3e3fe 100644
--- a/sfx2/source/doc/docvor.cxx
+++ b/sfx2/source/doc/docvor.cxx
@@ -219,6 +219,12 @@ SfxOrganizeDlg_Impl::SfxOrganizeDlg_Impl( SfxTemplateOrganizeDlg* pParent,
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
if ( aMgr.GetTemplates() ) // should never fail, but who knows ....
{
diff --git a/sfx2/source/doc/new.cxx b/sfx2/source/doc/new.cxx
index 7f05f5483931..b54b292f20d7 100644
--- a/sfx2/source/doc/new.cxx
+++ b/sfx2/source/doc/new.cxx
@@ -613,6 +613,9 @@ SfxNewFileDialog_Impl::SfxNewFileDialog_Impl(
aTemplateLb.SetSelectHdl(LINK(this, SfxNewFileDialog_Impl, TemplateSelect));
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
{
WaitObject aWaitCursor( pAntiImplP->GetParent() );