[Libreoffice] [PUSHED, partial][PATCH] Refactoring for WMF Loading

Caolán McNamara caolanm at redhat.com
Tue Sep 27 05:55:06 PDT 2011


On Fri, 2011-09-23 at 16:36 +0530, Marc-André Laverdière wrote:
> Hello everybody.
> 
> Here is a patch from the "I have no idea what I'm doing" department.

0001 looks good to me anyway, pushed now, sorry for the delay.

0002 looks a bit more dubious, broad stroke fine, but isn't it the case
that....

+template <class T, class Drawer>
+void EnhWMFReader::ReadAndDrawPolygon(Drawer drawer, const sal_Bool
skipFirst)
+{
+    sal_uInt16 nPoints ...

i.e. new code here has a 16bit value read from disk, while the old code
appears to be a 32bit value. I know it gets casted to 16bits, but it
would affect how much gets read from the stream.

...

EnhWMFReader::ReadEnhWMF

...  sal_uInt32 nPoints ...

   case EMR_POLYBEZIER :
-  {
-      pWMF->SeekRel( 16 );
-      *pWMF >> nPoints;

> P.S. I am not sure how to really test this... I just ran make -sr :)

yeah, that'll run the basic sanity wmf loader tests anyway. If you grab
some .wmf's and just open them in draw that's another test-scenario,
e.g. libwmf might have a selection if we don't have any already.

C.



More information about the LibreOffice mailing list