[Libreoffice] [PATCH] produce smaller .res files with the resource compiler

Michael Meeks michael.meeks at novell.com
Mon Aug 1 10:10:10 PDT 2011


On Sun, 2011-07-24 at 08:48 -0500, Norbert Thiebaud wrote:
> Are you sure you actually saved that 'much' ? presumably this 2158
> bytes repeated 71 times should compress well enough when packaged

	Well - it is repeated umpteen times per language; and how well that
compresses is anyone's guess.

> > Please review it, I'm not sure if such low level hacks are acceptable. :)
> 
> Looks pretty ugly to me. That code seems neglected enough without
> adding another layer of WTF-factor for the poor soul that one day will
> want/have to maintain it.

	Quite - that was a nightmare of a patch ;-) Luckily a spent a few
minutes while running a backup to turn it into something nicer:

	I think this is more like what you want to be doing. We would
want to remove the code that dumps this table in tools/ - it seems
to be only enabled as DBG_UTIL - and (as you say) seems to be unused.

	Potentially, if we were a bit braver; we could (I guess)
experiment with shrinking nRT's size down to sal_uInt16 (at least in the
file format), and see if nId is really necessary in those headers - but
perhaps I'm missing something there. No doubt it would be worth doing
some fprintf goodness during an incremental re-build of all the resource
files to work out what the scopes are there.

	Anyhow - needs a bit more testing of course, but hopefully is
maintainable. It shrinks:

cd filter/
touch ./source/graphicfilter/eps/epsstr.src
build && hexdump -C ./unxlngi6.pro/bin/epsen-US.res

	quite touchingly :-) I'd like to see the RSC_VERSIONCONTROL record
completely expunged from the code (ideally) on both sides and the
headers, completely gone.

	ATB,

		Michael.



More information about the LibreOffice mailing list