summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Benisch <tbe@openoffice.org>2001-06-18 07:05:05 +0000
committerThomas Benisch <tbe@openoffice.org>2001-06-18 07:05:05 +0000
commit7f4a3038d35632a84dd92c7c4d6df961b393a2dd (patch)
tree150d9936a75f0d89d197beaae755281ffc9c4217
parent256f950dc3b9dfc04fcb69f26ec68fe280959f00 (diff)
added sorting of dialogs by name
-rw-r--r--basctl/source/basicide/bastype2.cxx17
-rw-r--r--basctl/source/basicide/bastype2.hxx7
2 files changed, 18 insertions, 6 deletions
diff --git a/basctl/source/basicide/bastype2.cxx b/basctl/source/basicide/bastype2.cxx
index 49a20be8f756..f33c6eef0ff9 100644
--- a/basctl/source/basicide/bastype2.cxx
+++ b/basctl/source/basicide/bastype2.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: bastype2.cxx,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: tbe $ $Date: 2001-06-15 08:45:17 $
+ * last change: $Author: tbe $ $Date: 2001-06-18 08:04:58 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -59,6 +59,8 @@
*
************************************************************************/
+#include <vector>
+#include <algorithm>
#include <ide_pch.hxx>
@@ -232,9 +234,16 @@ void BasicTreeListBox::ImpCreateLibSubEntries( SvLBoxEntry* pLibRootEntry, StarB
Sequence< rtl::OUString > aNames = xLib->getElementNames();
sal_Int32 nNameCount = aNames.getLength();
const rtl::OUString* pNames = aNames.getConstArray();
- for( sal_Int32 i = 0 ; i < nNameCount ; i++ )
+
+ // sort dialog names
+ ::std::vector<String> aNameList(nNameCount);
+ for ( sal_Int32 i = 0 ; i < nNameCount ; i++ )
+ aNameList[ i ] = pNames[ i ];
+ ::std::sort( aNameList.begin() , aNameList.end() , StringCompareLessThan );
+
+ for ( i = 0 ; i < nNameCount ; i++ )
{
- String aDlgName = pNames[ i ];
+ String aDlgName = aNameList[ i ];
SvLBoxEntry* pEntry = FindEntry( pLibRootEntry, aDlgName, OBJTYPE_OBJECT );
if ( !pEntry )
{
diff --git a/basctl/source/basicide/bastype2.hxx b/basctl/source/basicide/bastype2.hxx
index 8c29cc0acd92..dd42ccedafeb 100644
--- a/basctl/source/basicide/bastype2.hxx
+++ b/basctl/source/basicide/bastype2.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: bastype2.hxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: tbe $ $Date: 2001-06-15 08:45:17 $
+ * last change: $Author: tbe $ $Date: 2001-06-18 08:05:05 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -143,6 +143,9 @@ public:
// new dialogs
SbxItem GetSbxItem( SvLBoxEntry* pEntry );
+
+ static BOOL StringCompareLessThan( const String& rStr1, const String& rStr2 )
+ { return (rStr1.CompareIgnoreCaseToAscii( rStr2 ) == COMPARE_LESS); }
};
/****************************************