diff options
author | Xisco Fauli <anistenis@gmail.com> | 2011-06-21 17:56:03 +0200 |
---|---|---|
committer | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2011-08-18 02:13:21 +0200 |
commit | 6ac14d3752a315013bfd048a2b7f624d36d4eb3c (patch) | |
tree | cef950776232756b588e686e64c316ddfdc05071 /wizards | |
parent | bd1be4c1ec599f9c992ca11e93e8b3a2e4c0ae03 (diff) |
Sort listboxes properly
Diffstat (limited to 'wizards')
-rw-r--r-- | wizards/com/sun/star/wizards/common/FileAccess.py | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/wizards/com/sun/star/wizards/common/FileAccess.py b/wizards/com/sun/star/wizards/common/FileAccess.py index 74eef467c6e7..c23be6865989 100644 --- a/wizards/com/sun/star/wizards/common/FileAccess.py +++ b/wizards/com/sun/star/wizards/common/FileAccess.py @@ -3,7 +3,6 @@ from NoValidPathException import * from com.sun.star.ucb import CommandAbortedException from com.sun.star.awt.VclWindowPeerAttribute import OK, YES_NO import types -from os import path as osPath ''' This class delivers static convenience methods @@ -406,15 +405,34 @@ class FileAccess(object): NameVectorAppend(i) TitleVectorAppend(xDocInterface.Title) - LocLayoutFiles[1] = sorted(NameVector) - LocLayoutFiles[0] = sorted(TitleVector) + LocLayoutFiles[1] = NameVector + LocLayoutFiles[0] = TitleVector except Exception, exception: traceback.print_exc() - return LocLayoutFiles + return self.__bubblesortList(LocLayoutFiles) ''' + This function bubble sorts an array of with 2 dimensions. + The default sorting order is the first dimension + Only if sort2ndValue is True the second dimension is + the relevant for the sorting order + ''' + + @classmethod + def __bubblesortList(self, SortList): + SortCount = len(SortList[0]) + DimCount = len(SortList) + for i in xrange(SortCount): + for t in xrange(SortCount - i - 1): + if SortList[0][t] > SortList[0][t + 1]: + for k in xrange(DimCount): + DisplayDummy = SortList[k][t]; + SortList[k][t] = SortList[k][t + 1]; + SortList[k][t + 1] = DisplayDummy + return SortList + ''' We search in all given path for a given file @param _sPath @param _sPath2 |