[Libreoffice] Dynamic arrays in chartitempool

Michael Meeks michael.meeks at novell.com
Sat Oct 16 13:17:59 PDT 2010


Hi Rene,

On Sat, 2010-10-16 at 19:10 +0200, René Kjellerup wrote:
> I removed some commented OSL_TRACE statements... but were they really
> needed still?

	Fine to loose them ;-)

	Sadly, I was wrong about SAL_N_ELEMENTs here; it is not safe. With a
generic array - ie. not one statically sized at compile time, we end up
with the wrong result:

	Foo *p = new Foo[128];

	SAL_N_ELEMENTS(p) will be sizeof(Foo *)/sizeof(Foo) - which not be what
we want; where:

	Baa p[128];
	SAL_N_ELEMENTS(p) is 128

	My mistake, should have highlighted that earlier, sorry.

	Anyhow - pushed the cleanups, translations etc.

	Thanks !

		Michael.

-- 
 michael.meeks at novell.com  <><, Pseudo Engineer, itinerant idiot




More information about the LibreOffice mailing list