--- /dev/null	2006-06-02 15:58:10.000000000 +0100
+++ solenv/bin/image-sort	2006-06-22 16:02:39.000000000 +0100
@@ -0,0 +1,149 @@
+#!/usr/bin/perl -w
+
+my @global_list = ();
+my %global_hash = ();
+my $base_path;
+
+sub read_icons($)
+{
+    my $fname = shift;
+    my $fileh;
+    my @images;
+    open ($fileh, "$base_path/$fname") || die "Can't open $base_path/$fname: $!";
+    while (<$fileh>) {
+	m/xlink:href=\"\.uno:(\S+)\"\s+/ || next;
+	push @images, lc($1);
+    }
+    close ($fileh);
+
+    return @images;
+}
+
+# filter out already seen icons & do prefixing
+sub read_new_icons($$)
+{
+    my $fname = shift;
+    my $prefix = shift;
+    my @images = read_icons ($fname);
+    my @new_icons;
+    my %new_icons;
+    for my $icon (@images) {
+	my $iname = "res/commandimagelist/" . $prefix . $icon . ".png";
+	if (!defined $global_hash{$iname} &&
+	    !defined $new_icons{$iname}) {
+	    push @new_icons, $iname;
+	    $new_icons{$iname} = 1;
+	}
+    }
+    return @new_icons;
+}
+
+sub process_group($@)
+{
+    my $prefix = shift;
+    my @uiconfigs = @_;
+    my %group;
+    my $cur_max = 1.0;
+
+# a very noddy sorting algorithm
+    for my $uiconfig (@uiconfigs) {
+	my @images = read_new_icons ($uiconfig, $prefix);
+	my $prev = '';
+	for my $icon (@images) {
+	    if (!defined $group{$icon}) {
+		if (!defined $group{$prev}) {
+		    $group{$icon} = $cur_max;
+		    $cur_max += 1.0;
+		} else {
+		    $group{$icon} = $group{$prev} + (1.0 - 0.5 / $cur_max);
+		}
+	    } # else a duplicate
+	}
+    }
+    for my $icon (sort { $group{$a} <=> $group{$b} } keys %group) {
+	push @global_list, $icon;
+	$global_hash{$icon} = 1;
+    }
+}
+
+sub process_file($$)
+{
+    my @images = read_new_icons (shift, shift);
+
+    for my $icon (@images) {
+	push @global_list, $icon;
+	$global_hash{$icon} = 1;
+    }
+}
+
+sub chew_controlfile($)
+{
+    my $fname = shift;
+    my $fileh;
+    my @list;
+    open ($fileh, $fname) || die "Can't open $fname: $!";
+    while (<$fileh>) {
+	/^\#/ && next;
+	s/[\r\n]*$//;
+	/^\s*$/ && next;
+
+	my $line = $_;
+	if ($line =~ s/^-- (\S+)\s*//) {
+	    # control code
+	    my $code = $1;
+	    my $small = (lc ($line) eq 'small');
+	    if (lc($code) eq 'group') {
+		if (!$small) { process_group ("lc_", @list); }
+		process_group ("sc_", @list);
+	    } elsif (lc ($code) eq 'ordered') {
+		if (!$small) {
+		    for my $file (@list) { process_file ($file, "lc_"); }
+		}
+		for my $file (@list) { process_file ($file, "sc_"); }
+	    } elsif (lc ($code) eq 'literal') {
+		for my $file (@list) {
+		    if (!defined $global_hash{$file}) {
+			push @global_list, $file;
+			$global_hash{$file} = 1;
+		    }
+		}
+	    } else {
+		die ("Unknown code '$code'");
+	    }
+	    @list = ();
+	} else { 
+	    push @list, $line;
+	}
+    }
+    close ($fileh);
+}
+
+if (!@ARGV) {
+    print "image-sort <image-sort.lst> /path/to/OOOo/source/root\n";
+    exit 1;
+}
+
+# where the control file lives
+my $control = shift @ARGV;
+# where the uiconfigs live
+$base_path = shift @ARGV;
+# output
+if (@ARGV) {
+    my $outf = shift @ARGV;
+    open ($output, ">$outf") || die "Can't open $outf: $!";
+    $stdout_out = 0;
+} else {
+    $output = STDOUT;
+    $stdout_out = 1;
+}
+
+chew_controlfile ($control);
+
+for my $icon (@global_list) {
+    print $output $icon . "\n" if (!($icon =~ /^sc_/));
+}
+for my $icon (@global_list) {
+    print $output $icon . "\n" if ($icon =~ /^sc_/);
+}
+
+close $output if (!$stdout_out);
--- /dev/null	2006-06-02 15:58:10.000000000 +0100
+++ instsetoo_native/packimages/image-sort.lst	2006-06-22 16:02:42.000000000 +0100
@@ -0,0 +1,340 @@
+#
+# This file exists to help improve the ordering of
+# icons inside the OO.o theme / images.zip file.
+#
+# Sections are processed together, and are delimited
+# by '-- <tag> [small]' a 'group' tage denotes equal
+# importance: icons must be interleaved, 'ordered'
+# denotes a simple best-fit order. 'literal' denotes
+# a list of explicit image loads
+#
+
+res/mainapp_16.png
+res/mainapp_32.png
+sw/res/punkt.png
+sw/res/punkt_h.png
+res/sx03251.png
+res/lx03251.png
+
+-- literal
+
+# 'standard' toolbars
+sw/uiconfig/swriter/toolbar/standardbar.xml
+sc/uiconfig/scalc/toolbar/standardbar.xml
+sd/uiconfig/simpress/toolbar/standardbar.xml
+sd/uiconfig/sdraw/toolbar/standardbar.xml
+-- group
+
+# default / startup toolbars
+sw/uiconfig/swriter/toolbar/textobjectbar.xml
+sc/uiconfig/scalc/toolbar/formatobjectbar.xml
+-- group
+
+sd/uiconfig/simpress/toolbar/drawingobjectbar.xml
+sd/uiconfig/sdraw/toolbar/drawingobjectbar.xml
+-- group
+
+sd/uiconfig/simpress/toolbar/toolbar.xml
+sd/uiconfig/sdraw/toolbar/toolbar.xml
+-- group
+
+sd/uiconfig/simpress/toolbar/commontaskbar.xml
+-- ordered
+
+svtools/res/prnfont.png
+svtools/res/bmpfont.png
+svtools/res/scalfont.png
+svx/res/signet_11x16.png
+svx/res/caution_11x16.png
+svx/res/notcertificate_16.png
+res/sc10223.png
+res/sc10224.png
+res/sx03250.png
+res/sx03249.png
+res/sx03246.png
+res/sx03245.png
+res/sx03139.png
+res/sx03248.png
+res/sx03247.png
+res/sx03255.png
+res/sx03242.png
+-- literal
+
+# default / startup menus:
+sw/uiconfig/swriter/menubar/menubar.xml
+sc/uiconfig/scalc/menubar/menubar.xml
+sd/uiconfig/simpress/menubar/menubar.xml
+sd/uiconfig/sdraw/menubar/menubar.xml
+-- group small
+
+#
+# complete list of other toolbars / menus
+# FIXME: should auto-generate this.
+#
+basctl/uiconfig/basicide/toolbar/fullscreenbar.xml
+basctl/uiconfig/basicide/toolbar/insertcontrolsbar.xml
+basctl/uiconfig/basicide/toolbar/macrobar.xml
+basctl/uiconfig/basicide/toolbar/standardbar.xml
+dbaccess/uiconfig/dbapp/toolbar/formobjectbar.xml
+dbaccess/uiconfig/dbapp/toolbar/queryobjectbar.xml
+dbaccess/uiconfig/dbapp/toolbar/reportobjectbar.xml
+dbaccess/uiconfig/dbapp/toolbar/tableobjectbar.xml
+dbaccess/uiconfig/dbapp/toolbar/toolbar.xml
+dbaccess/uiconfig/dbbrowser/toolbar/browserobjectbar.xml
+dbaccess/uiconfig/dbbrowser/toolbar/copyobjectbar.xml
+dbaccess/uiconfig/dbbrowser/toolbar/toolbar.xml
+dbaccess/uiconfig/dbquery/toolbar/designobjectbar.xml
+dbaccess/uiconfig/dbquery/toolbar/sqlobjectbar.xml
+dbaccess/uiconfig/dbquery/toolbar/toolbar.xml
+dbaccess/uiconfig/dbrelation/toolbar/toolbar.xml
+dbaccess/uiconfig/dbtable/toolbar/toolbar.xml
+framework/uiconfig/startmodule/toolbar/standardbar.xml
+sch/uiconfig/schart/toolbar/standardbar.xml
+sch/uiconfig/schart/toolbar/toolbar.xml
+sc/uiconfig/scalc/toolbar/alignmentbar.xml
+sc/uiconfig/scalc/toolbar/arrowshapes.xml
+sc/uiconfig/scalc/toolbar/basicshapes.xml
+sc/uiconfig/scalc/toolbar/calloutshapes.xml
+sc/uiconfig/scalc/toolbar/colorbar.xml
+sc/uiconfig/scalc/toolbar/drawbar.xml
+sc/uiconfig/scalc/toolbar/drawobjectbar.xml
+sc/uiconfig/scalc/toolbar/extrusionobjectbar.xml
+sc/uiconfig/scalc/toolbar/flowchartshapes.xml
+sc/uiconfig/scalc/toolbar/fontworkobjectbar.xml
+sc/uiconfig/scalc/toolbar/fontworkshapetype.xml
+sc/uiconfig/scalc/toolbar/formatobjectbar.xml
+sc/uiconfig/scalc/toolbar/formcontrols.xml
+sc/uiconfig/scalc/toolbar/formdesign.xml
+sc/uiconfig/scalc/toolbar/formsfilterbar.xml
+sc/uiconfig/scalc/toolbar/formsnavigationbar.xml
+sc/uiconfig/scalc/toolbar/formsobjectbar.xml
+sc/uiconfig/scalc/toolbar/formtextobjectbar.xml
+sc/uiconfig/scalc/toolbar/fullscreenbar.xml
+sc/uiconfig/scalc/toolbar/graffilterbar.xml
+sc/uiconfig/scalc/toolbar/graphicobjectbar.xml
+sc/uiconfig/scalc/toolbar/insertbar.xml
+sc/uiconfig/scalc/toolbar/insertcellsbar.xml
+sc/uiconfig/scalc/toolbar/insertobjectbar.xml
+sc/uiconfig/scalc/toolbar/mediaobjectbar.xml
+sc/uiconfig/scalc/toolbar/moreformcontrols.xml
+sc/uiconfig/scalc/toolbar/previewbar.xml
+sc/uiconfig/scalc/toolbar/standardbar.xml
+sc/uiconfig/scalc/toolbar/starshapes.xml
+sc/uiconfig/scalc/toolbar/symbolshapes.xml
+sc/uiconfig/scalc/toolbar/textobjectbar.xml
+sc/uiconfig/scalc/toolbar/toolbar.xml
+sc/uiconfig/scalc/toolbar/viewerbar.xml
+sd/uiconfig/sdraw/toolbar/3dobjectsbar.xml
+sd/uiconfig/sdraw/toolbar/alignmentbar.xml
+sd/uiconfig/sdraw/toolbar/arrowsbar.xml
+sd/uiconfig/sdraw/toolbar/arrowshapes.xml
+sd/uiconfig/sdraw/toolbar/basicshapes.xml
+sd/uiconfig/sdraw/toolbar/bezierobjectbar.xml
+sd/uiconfig/sdraw/toolbar/calloutshapes.xml
+sd/uiconfig/sdraw/toolbar/choosemodebar.xml
+sd/uiconfig/sdraw/toolbar/colorbar.xml
+sd/uiconfig/sdraw/toolbar/connectorsbar.xml
+sd/uiconfig/sdraw/toolbar/drawingobjectbar.xml
+sd/uiconfig/sdraw/toolbar/ellipsesbar.xml
+sd/uiconfig/sdraw/toolbar/extrusionobjectbar.xml
+sd/uiconfig/sdraw/toolbar/flowchartshapes.xml
+sd/uiconfig/sdraw/toolbar/fontworkobjectbar.xml
+sd/uiconfig/sdraw/toolbar/fontworkshapetype.xml
+sd/uiconfig/sdraw/toolbar/formcontrols.xml
+sd/uiconfig/sdraw/toolbar/formdesign.xml
+sd/uiconfig/sdraw/toolbar/formsfilterbar.xml
+sd/uiconfig/sdraw/toolbar/formsnavigationbar.xml
+sd/uiconfig/sdraw/toolbar/formtextobjectbar.xml
+sd/uiconfig/sdraw/toolbar/fullscreenbar.xml
+sd/uiconfig/sdraw/toolbar/gluepointsobjectbar.xml
+sd/uiconfig/sdraw/toolbar/graffilterbar.xml
+sd/uiconfig/sdraw/toolbar/graphicobjectbar.xml
+sd/uiconfig/sdraw/toolbar/insertbar.xml
+sd/uiconfig/sdraw/toolbar/linesbar.xml
+sd/uiconfig/sdraw/toolbar/masterviewtoolbar.xml
+sd/uiconfig/sdraw/toolbar/mediaobjectbar.xml
+sd/uiconfig/sdraw/toolbar/moreformcontrols.xml
+sd/uiconfig/sdraw/toolbar/optionsbar.xml
+sd/uiconfig/sdraw/toolbar/positionbar.xml
+sd/uiconfig/sdraw/toolbar/standardbar.xml
+sd/uiconfig/sdraw/toolbar/starshapes.xml
+sd/uiconfig/sdraw/toolbar/symbolshapes.xml
+sd/uiconfig/sdraw/toolbar/textbar.xml
+sd/uiconfig/sdraw/toolbar/textobjectbar.xml
+sd/uiconfig/sdraw/toolbar/toolbar.xml
+sd/uiconfig/sdraw/toolbar/viewerbar.xml
+sd/uiconfig/sdraw/toolbar/zoombar.xml
+sd/uiconfig/simpress/toolbar/3dobjectsbar.xml
+sd/uiconfig/simpress/toolbar/alignmentbar.xml
+sd/uiconfig/simpress/toolbar/arrowsbar.xml
+sd/uiconfig/simpress/toolbar/arrowshapes.xml
+sd/uiconfig/simpress/toolbar/basicshapes.xml
+sd/uiconfig/simpress/toolbar/bezierobjectbar.xml
+sd/uiconfig/simpress/toolbar/calloutshapes.xml
+sd/uiconfig/simpress/toolbar/choosemodebar.xml
+sd/uiconfig/simpress/toolbar/colorbar.xml
+sd/uiconfig/simpress/toolbar/commontaskbar.xml
+sd/uiconfig/simpress/toolbar/connectorsbar.xml
+sd/uiconfig/simpress/toolbar/drawingobjectbar.xml
+sd/uiconfig/simpress/toolbar/ellipsesbar.xml
+sd/uiconfig/simpress/toolbar/extrusionobjectbar.xml
+sd/uiconfig/simpress/toolbar/flowchartshapes.xml
+sd/uiconfig/simpress/toolbar/fontworkobjectbar.xml
+sd/uiconfig/simpress/toolbar/fontworkshapetype.xml
+sd/uiconfig/simpress/toolbar/formcontrols.xml
+sd/uiconfig/simpress/toolbar/formdesign.xml
+sd/uiconfig/simpress/toolbar/formsfilterbar.xml
+sd/uiconfig/simpress/toolbar/formsnavigationbar.xml
+sd/uiconfig/simpress/toolbar/formtextobjectbar.xml
+sd/uiconfig/simpress/toolbar/fullscreenbar.xml
+sd/uiconfig/simpress/toolbar/gluepointsobjectbar.xml
+sd/uiconfig/simpress/toolbar/graffilterbar.xml
+sd/uiconfig/simpress/toolbar/graphicobjectbar.xml
+sd/uiconfig/simpress/toolbar/insertbar.xml
+sd/uiconfig/simpress/toolbar/linesbar.xml
+sd/uiconfig/simpress/toolbar/masterviewtoolbar.xml
+sd/uiconfig/simpress/toolbar/mediaobjectbar.xml
+sd/uiconfig/simpress/toolbar/moreformcontrols.xml
+sd/uiconfig/simpress/toolbar/optionsbar.xml
+sd/uiconfig/simpress/toolbar/outlinetoolbar.xml
+sd/uiconfig/simpress/toolbar/positionbar.xml
+sd/uiconfig/simpress/toolbar/slideviewobjectbar.xml
+sd/uiconfig/simpress/toolbar/slideviewtoolbar.xml
+sd/uiconfig/simpress/toolbar/standardbar.xml
+sd/uiconfig/simpress/toolbar/starshapes.xml
+sd/uiconfig/simpress/toolbar/symbolshapes.xml
+sd/uiconfig/simpress/toolbar/textbar.xml
+sd/uiconfig/simpress/toolbar/textobjectbar.xml
+sd/uiconfig/simpress/toolbar/toolbar.xml
+sd/uiconfig/simpress/toolbar/viewerbar.xml
+sd/uiconfig/simpress/toolbar/zoombar.xml
+starmath/uiconfig/smath/toolbar/fullscreenbar.xml
+starmath/uiconfig/smath/toolbar/standardbar.xml
+starmath/uiconfig/smath/toolbar/toolbar.xml
+sw/uiconfig/sglobal/toolbar/alignmentbar.xml
+sw/uiconfig/sglobal/toolbar/arrowshapes.xml
+sw/uiconfig/sglobal/toolbar/basicshapes.xml
+sw/uiconfig/sglobal/toolbar/bezierobjectbar.xml
+sw/uiconfig/sglobal/toolbar/calloutshapes.xml
+sw/uiconfig/sglobal/toolbar/colorbar.xml
+sw/uiconfig/sglobal/toolbar/drawbar.xml
+sw/uiconfig/sglobal/toolbar/drawingobjectbar.xml
+sw/uiconfig/sglobal/toolbar/drawtextobjectbar.xml
+sw/uiconfig/sglobal/toolbar/extrusionobjectbar.xml
+sw/uiconfig/sglobal/toolbar/flowchartshapes.xml
+sw/uiconfig/sglobal/toolbar/fontworkobjectbar.xml
+sw/uiconfig/sglobal/toolbar/fontworkshapetype.xml
+sw/uiconfig/sglobal/toolbar/formcontrols.xml
+sw/uiconfig/sglobal/toolbar/formdesign.xml
+sw/uiconfig/sglobal/toolbar/formsfilterbar.xml
+sw/uiconfig/sglobal/toolbar/formsnavigationbar.xml
+sw/uiconfig/sglobal/toolbar/formtextobjectbar.xml
+sw/uiconfig/sglobal/toolbar/frameobjectbar.xml
+sw/uiconfig/sglobal/toolbar/fullscreenbar.xml
+sw/uiconfig/sglobal/toolbar/graffilterbar.xml
+sw/uiconfig/sglobal/toolbar/graphicobjectbar.xml
+sw/uiconfig/sglobal/toolbar/insertbar.xml
+sw/uiconfig/sglobal/toolbar/insertobjectbar.xml
+sw/uiconfig/sglobal/toolbar/mediaobjectbar.xml
+sw/uiconfig/sglobal/toolbar/moreformcontrols.xml
+sw/uiconfig/sglobal/toolbar/numobjectbar.xml
+sw/uiconfig/sglobal/toolbar/oleobjectbar.xml
+sw/uiconfig/sglobal/toolbar/optimizetablebar.xml
+sw/uiconfig/sglobal/toolbar/previewobjectbar.xml
+sw/uiconfig/sglobal/toolbar/standardbar.xml
+sw/uiconfig/sglobal/toolbar/starshapes.xml
+sw/uiconfig/sglobal/toolbar/symbolshapes.xml
+sw/uiconfig/sglobal/toolbar/tableobjectbar.xml
+sw/uiconfig/sglobal/toolbar/textobjectbar.xml
+sw/uiconfig/sglobal/toolbar/toolbar.xml
+sw/uiconfig/sglobal/toolbar/viewerbar.xml
+sw/uiconfig/sweb/toolbar/arrowshapes.xml
+sw/uiconfig/sweb/toolbar/basicshapes.xml
+sw/uiconfig/sweb/toolbar/bezierobjectbar.xml
+sw/uiconfig/sweb/toolbar/calloutshapes.xml
+sw/uiconfig/sweb/toolbar/colorbar.xml
+sw/uiconfig/sweb/toolbar/drawingobjectbar.xml
+sw/uiconfig/sweb/toolbar/drawtextobjectbar.xml
+sw/uiconfig/sweb/toolbar/extrusionobjectbar.xml
+sw/uiconfig/sweb/toolbar/flowchartshapes.xml
+sw/uiconfig/sweb/toolbar/fontworkobjectbar.xml
+sw/uiconfig/sweb/toolbar/fontworkshapetype.xml
+sw/uiconfig/sweb/toolbar/formcontrols.xml
+sw/uiconfig/sweb/toolbar/formdesign.xml
+sw/uiconfig/sweb/toolbar/formsfilterbar.xml
+sw/uiconfig/sweb/toolbar/formsnavigationbar.xml
+sw/uiconfig/sweb/toolbar/formtextobjectbar.xml
+sw/uiconfig/sweb/toolbar/frameobjectbar.xml
+sw/uiconfig/sweb/toolbar/fullscreenbar.xml
+sw/uiconfig/sweb/toolbar/graffilterbar.xml
+sw/uiconfig/sweb/toolbar/graphicobjectbar.xml
+sw/uiconfig/sweb/toolbar/insertbar.xml
+sw/uiconfig/sweb/toolbar/mediaobjectbar.xml
+sw/uiconfig/sweb/toolbar/numobjectbar.xml
+sw/uiconfig/sweb/toolbar/oleobjectbar.xml
+sw/uiconfig/sweb/toolbar/optimizetablebar.xml
+sw/uiconfig/sweb/toolbar/previewobjectbar.xml
+sw/uiconfig/sweb/toolbar/standardbar.xml
+sw/uiconfig/sweb/toolbar/starshapes.xml
+sw/uiconfig/sweb/toolbar/symbolshapes.xml
+sw/uiconfig/sweb/toolbar/tableobjectbar.xml
+sw/uiconfig/sweb/toolbar/textobjectbar.xml
+sw/uiconfig/sweb/toolbar/toolbar.xml
+sw/uiconfig/sweb/toolbar/viewerbar.xml
+sw/uiconfig/swriter/toolbar/alignmentbar.xml
+sw/uiconfig/swriter/toolbar/arrowshapes.xml
+sw/uiconfig/swriter/toolbar/basicshapes.xml
+sw/uiconfig/swriter/toolbar/bezierobjectbar.xml
+sw/uiconfig/swriter/toolbar/calloutshapes.xml
+sw/uiconfig/swriter/toolbar/colorbar.xml
+sw/uiconfig/swriter/toolbar/drawbar.xml
+sw/uiconfig/swriter/toolbar/drawingobjectbar.xml
+sw/uiconfig/swriter/toolbar/drawtextobjectbar.xml
+sw/uiconfig/swriter/toolbar/extrusionobjectbar.xml
+sw/uiconfig/swriter/toolbar/flowchartshapes.xml
+sw/uiconfig/swriter/toolbar/fontworkobjectbar.xml
+sw/uiconfig/swriter/toolbar/fontworkshapetype.xml
+sw/uiconfig/swriter/toolbar/formcontrols.xml
+sw/uiconfig/swriter/toolbar/formdesign.xml
+sw/uiconfig/swriter/toolbar/formsfilterbar.xml
+sw/uiconfig/swriter/toolbar/formsnavigationbar.xml
+sw/uiconfig/swriter/toolbar/formtextobjectbar.xml
+sw/uiconfig/swriter/toolbar/frameobjectbar.xml
+sw/uiconfig/swriter/toolbar/fullscreenbar.xml
+sw/uiconfig/swriter/toolbar/graffilterbar.xml
+sw/uiconfig/swriter/toolbar/graphicobjectbar.xml
+sw/uiconfig/swriter/toolbar/insertbar.xml
+sw/uiconfig/swriter/toolbar/insertobjectbar.xml
+sw/uiconfig/swriter/toolbar/mediaobjectbar.xml
+sw/uiconfig/swriter/toolbar/moreformcontrols.xml
+sw/uiconfig/swriter/toolbar/numobjectbar.xml
+sw/uiconfig/swriter/toolbar/oleobjectbar.xml
+sw/uiconfig/swriter/toolbar/optimizetablebar.xml
+sw/uiconfig/swriter/toolbar/previewobjectbar.xml
+sw/uiconfig/swriter/toolbar/standardbar.xml
+sw/uiconfig/swriter/toolbar/starshapes.xml
+sw/uiconfig/swriter/toolbar/symbolshapes.xml
+sw/uiconfig/swriter/toolbar/tableobjectbar.xml
+sw/uiconfig/swriter/toolbar/textobjectbar.xml
+sw/uiconfig/swriter/toolbar/toolbar.xml
+sw/uiconfig/swriter/toolbar/viewerbar.xml
+
+-- ordered
+
+basctl/uiconfig/basicide/menubar/menubar.xml
+dbaccess/uiconfig/dbapp/menubar/menubar.xml
+dbaccess/uiconfig/dbbrowser/menubar/menubar.xml
+dbaccess/uiconfig/dbquery/menubar/menubar.xml
+dbaccess/uiconfig/dbrelation/menubar/menubar.xml
+dbaccess/uiconfig/dbtable/menubar/menubar.xml
+framework/uiconfig/startmodule/menubar/menubar.xml
+sch/uiconfig/schart/menubar/menubar.xml
+sc/uiconfig/scalc/menubar/menubar.xml
+sd/uiconfig/sdraw/menubar/menubar.xml
+sd/uiconfig/simpress/menubar/menubar.xml
+starmath/uiconfig/smath/menubar/menubar.xml
+sw/uiconfig/sglobal/menubar/menubar.xml
+sw/uiconfig/sweb/menubar/menubar.xml
+sw/uiconfig/swriter/menubar/menubar.xml
+
+-- ordered small
Index: instsetoo_native/packimages/makefile.mk
===================================================================
RCS file: /cvs/installation/instsetoo_native/packimages/makefile.mk,v
retrieving revision 1.12.8.4
diff -u -p -u -r1.12.8.4 makefile.mk
--- instsetoo_native/packimages/makefile.mk	23 Feb 2006 16:54:55 -0000	1.12.8.4
+++ instsetoo_native/packimages/makefile.mk	22 Jun 2006 16:33:17 -0000
@@ -43,6 +43,7 @@ RSCCUSTOMIMG*=$(PRJ)$/util
 .INCLUDE: target.mk
 
 IMAGES := $(COMMONBIN)$/images.zip
+SORTED_LIST=$(RES)$/img$/sorted.lst
 # Custom sets, at 24x24 & 16x16 fall-back to industrial preferentially
 CUSTOM_PREFERRED_FALLBACK=$(SOLARSRC)$/ooo_custom_images$/industrial
 CUSTOM_IMAGES=$(foreach,i,$(CUSTOM_IMAGE_SETS) images_$i)
@@ -51,6 +52,10 @@ CRYSTAL_TARBALL=$(SOLARSRC)$/external_im
 
 ALLTAR : $(IMAGES) $(CUSTOM_IMAGES)
 
+$(SORTED_LIST) : image-sort.lst
+    +-$(MKDIR) $(RES)$/img
+    +$(PERL) $(SOLARENV)$/bin$/image-sort image-sort.lst $(PRJ)/.. $@
+
 $(RES)$/img$/commandimagelist.ilst .PHONY :
     +-$(MKDIR) $(RES)$/img
 #+-$(RM) $@ $@.$(INPATH)
@@ -61,11 +66,11 @@ $(RES)$/img$/commandimagelist.ilst .PHON
 .ENDIF			# "$(use_shell)"!="4nt"
 	+$(PERL) $(SOLARENV)$/bin$/diffmv.pl $@.$(INPATH) $@
 
-$(COMMONBIN)$/images.zip .PHONY: $(RES)$/img$/commandimagelist.ilst
-    +$(PERL) $(SOLARENV)$/bin$/packimages.pl -g $(SOLARSRC)$/$(RSCDEFIMG) -m $(SOLARSRC)$/$(RSCDEFIMG) -c $(RSCCUSTOMIMG) -l $(SOLARCOMMONRESDIR)$/img -l $(RES)$/img -o $@
+$(COMMONBIN)$/images.zip .PHONY: $(RES)$/img$/commandimagelist.ilst $(SORTED_LIST)
+    +$(PERL) $(SOLARENV)$/bin$/packimages.pl -g $(SOLARSRC)$/$(RSCDEFIMG) -m $(SOLARSRC)$/$(RSCDEFIMG) -c $(RSCCUSTOMIMG) -l $(SOLARCOMMONRESDIR)$/img -l $(RES)$/img -s $(SORTED_LIST) -o $@
 
-images_% : $(RES)$/img$/commandimagelist.ilst
-    +$(PERL) $(SOLARENV)$/bin$/packimages.pl -g $(SOLARSRC)$/$(RSCDEFIMG) -m $(SOLARSRC)$/$(RSCDEFIMG) -c $(RSCCUSTOMIMG) -c $(SOLARSRC)$/ooo_custom_images$/$(@:s/images_//) -c $(MISC)$/$(@:s/images_//) -c $(CUSTOM_PREFERRED_FALLBACK) -l $(SOLARCOMMONRESDIR)$/img -l $(RES)$/img -o $(COMMONBIN)$/$@.zip
+images_% : $(RES)$/img$/commandimagelist.ilst $(SORTED_LIST)
+    +$(PERL) $(SOLARENV)$/bin$/packimages.pl -g $(SOLARSRC)$/$(RSCDEFIMG) -m $(SOLARSRC)$/$(RSCDEFIMG) -c $(RSCCUSTOMIMG) -c $(SOLARSRC)$/ooo_custom_images$/$(@:s/images_//) -c $(MISC)$/$(@:s/images_//) -c $(CUSTOM_PREFERRED_FALLBACK) -l $(SOLARCOMMONRESDIR)$/img -l $(RES)$/img -s $(SORTED_LIST) -o $(COMMONBIN)$/$@.zip
 
 # generate the HiContrast icon set
 $(MISC)$/hicontrast.flag : $(RES)$/img$/commandimagelist.ilst
Index: solenv/bin/packimages.pl
===================================================================
RCS file: /cvs/tools/solenv/bin/packimages.pl,v
retrieving revision 1.12.222.2
diff -u -p -u -r1.12.222.2 packimages.pl
--- solenv/bin/packimages.pl	23 Feb 2006 16:54:24 -0000	1.12.222.2
+++ solenv/bin/packimages.pl	23 Jun 2006 08:14:08 -0000
@@ -55,6 +55,7 @@ my $out_file;                # path to o
 my $tmp_out_file;            # path to temporary output file
 my $global_path;             # path to global images directory
 my $module_path;             # path to module images directory
+my $sort_file;               # path to file containing sorting data
 my @custom_path;             # path to custom images directory
 my @imagelist_path;          # pathes to directories containing the image lists 
 my $verbose;                 # be verbose
@@ -108,6 +109,7 @@ sub parse_options
                              '-h' => \$opt_help, 
                              '-o=s' => \$out_file,
                              '-g=s' => \$global_path,
+			     '-s=s' => \$sort_file,
                              '-m=s' => \$module_path,
                              '-c=s' => \@custom_path_list,
                              '-l=s' => \@imagelist_path,
@@ -116,7 +118,7 @@ sub parse_options
                             );
 
     if ( $opt_help || !$success || !$out_file || !$global_path 
-        || !$module_path || !@custom_path_list || !@imagelist_path ) 
+        || !$module_path || !@custom_path_list || !@imagelist_path )
     {
         usage();
         exit(1);
@@ -312,6 +314,43 @@ sub is_file_newer 
     return 0;
 }
 
+sub optimize_zip_layout($)
+{
+    my $zip_hash_ref = shift;
+
+    if (!defined $sort_file) {
+	print_message("no sort file - sorting alphabetically ...") if $verbose;
+	return sort keys %{$zip_hash_ref};
+    }
+    print_message("sorting from $sort_file ...") if $verbose;
+
+    my $orderh;
+    my %included;
+    my @sorted;
+    open ($orderh, $sort_file) || die "Can't open $sort_file: $!";
+    while (<$orderh>) {
+	/^\#.*/ && next; # comments
+	s/[\r\n]*$//;
+	/^\s*$/ && next;
+	my $file = $_;
+	if (!defined $zip_hash_ref->{$file}) {
+	    print "unknown file '$file'\n" if ($extra_verbose);
+	} else {
+	    push @sorted, $file;
+	    $included{$file} = 1;
+	}
+    }
+    close ($orderh);
+
+    for my $img (sort keys %{$zip_hash_ref}) {
+	push @sorted, $img if (!$included{$img});
+    }
+
+    print_message("done sort ...") if $verbose;
+
+    return @sorted;
+}
+
 sub create_zip_archive
 {
     my $zip_hash_ref = shift;
@@ -319,10 +358,13 @@ sub create_zip_archive
     print_message("creating image archive ...") if $verbose;
     my $zip = Archive::Zip->new();
 
-    foreach ( sort keys %{$zip_hash_ref} ) {
+# FIXME: test - $member = addfile ... $member->desiredCompressionMethod( COMPRESSION_STORED );
+# any measurable performance win/loss ?
+    foreach ( optimize_zip_layout($zip_hash_ref) ) {
         my $path = $zip_hash_ref->{$_} . "/$_";
         print_message("zipping '$path' ...") if $extra_verbose;
-        if ( !$zip->addFile($path, $_) ) {
+        my $member = $zip->addFile($path, $_);
+        if ( !$member ) {
             print_error("can't add file '$path' to image zip archive: $!", 5);
         }
     }
@@ -362,6 +404,7 @@ sub usage
     print STDERR "    -g g_path          path to global images directory\n";
     print STDERR "    -m m_path          path to module images directory\n";
     print STDERR "    -c c_path          path to custom images directory\n";
+    print STDERR "    -s sort_file       path to image sort order file\n";
     print STDERR "    -l imagelist_path  path to directory containing image lists (may appear mutiple times)\n";
     print STDERR "    -v                 verbose\n";
     print STDERR "    -vv                very verbose\n";
