Re: Dead code in escherex.cxx (filter module)

2014-04-23 Thread Miklos Vajna
Hi Julien,

On Tue, Apr 22, 2014 at 01:59:48PM -0700, julien2412 serval2...@yahoo.fr 
wrote:
 Taking a look to this part:
4442 if ( nErrCode == ERRCODE_NONE )
4443 {
 p_EscherBlibEntry-meBlibType = ( eGraphicType
 == GRAPHIC_BITMAP ) ? PNG : EMF;
4445 aStream.Seek( STREAM_SEEK_TO_END );
4446 p_EscherBlibEntry-mnSize = aStream.Tell();
4447 pGraphicAry = (sal_uInt8*)aStream.GetData();
4448 
4449 if ( p_EscherBlibEntry-meBlibType == WMF )

I think this should be EMF, before
0056fe28c7bd8e72cd5bdd335f098d00cd0d5d11, the code was like this:

// !EMF nErrCode = GraphicConverter::Export( aStream, aGraphic, ( 
eGraphicType == GRAPHIC_BITMAP ) ? CVT_PNG  : CVT_WMF );
nErrCode = GraphicConverter::Export( aStream, aGraphic, ( 
eGraphicType == GRAPHIC_BITMAP ) ? CVT_PNG  : CVT_EMF );

So WMF got changed to EMF, but then later the other WMF wasn't adopted.

 // the fileheader is not used
4450 {
4451 p_EscherBlibEntry-mnSize -= 22;
4452 pGraphicAry += 22;
4453 }
4454 }

However, if you change WMF to EMF here, then one wonders if you want to skip an
EMF header as well, and the answer is probably: not (and even if you want to do
that, the EMF header is not fixed size, so a constant 22 won't help there). So
I would just delete the dead code here.

Miklos


signature.asc
Description: Digital signature
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[SOLVED] Re: Dead code in escherex.cxx (filter module)

2014-04-23 Thread Julien Nabet

On 23/04/2014 10:02, Miklos Vajna wrote:

...

// the fileheader is not used
4450 {
4451 p_EscherBlibEntry-mnSize -= 22;
4452 pGraphicAry += 22;
4453 }
4454 }

However, if you change WMF to EMF here, then one wonders if you want to skip an
EMF header as well, and the answer is probably: not (and even if you want to do
that, the EMF header is not fixed size, so a constant 22 won't help there). So
I would just delete the dead code here.
Thank you Miklos for your feedback, I pushed the change on master 
sources (see 
http://cgit.freedesktop.org/libreoffice/core/commit/?id=b39ee2bc8f6df28f020ed13ddc7b39d208dfc7a5)


Julien

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Dead code in escherex.cxx (filter module)

2014-04-22 Thread julien2412
Hello,

Taking a look to this part:
   4442 if ( nErrCode == ERRCODE_NONE )
   4443 {
    p_EscherBlibEntry-meBlibType = ( eGraphicType
== GRAPHIC_BITMAP ) ? PNG : EMF;
   4445 aStream.Seek( STREAM_SEEK_TO_END );
   4446 p_EscherBlibEntry-mnSize = aStream.Tell();
   4447 pGraphicAry = (sal_uInt8*)aStream.GetData();
   4448 
   4449 if ( p_EscherBlibEntry-meBlibType == WMF )
// the fileheader is not used
   4450 {
   4451 p_EscherBlibEntry-mnSize -= 22;
   4452 pGraphicAry += 22;
   4453 }
   4454 }

I wonder if in line 4449 'WMF' should be changed to 'EMF' or the contrary on
line .
See
http://opengrok.libreoffice.org/xref/core/filter/source/msfilter/escherex.cxx#
A research in Opengrok didn't help:
http://opengrok.libreoffice.org/search?q=%22eGraphicType+%3D%3D+GRAPHIC_BITMAP%22project=coredefs=refs=path=hist=

Any idea?

Julien 



--
View this message in context: 
http://nabble.documentfoundation.org/Dead-code-in-escherex-cxx-filter-module-tp4106079.html
Sent from the Dev mailing list archive at Nabble.com.
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice