Date: prev next · Thread: first prev next last
2012 Archives by date, by thread · List index


On Thu, 2012-11-01 at 02:51 -0700, julien2412 wrote:
Why shouldn't we uncomment case 3?
"nDisplay" could be equalled to "3" and "eDisplayToken"  is 
"XML_TOKEN_INVALID" by default

XMLTokenEnum eDisplayToken = XML_TOKEN_INVALID;
...
switch( (bVisible << 1) | bPrintable )
{
case 0: eDisplayToken = XML_NONE; break;
case 1: eDisplayToken = XML_PRINTER; break;
case 2: eDisplayToken = XML_SCREEN; break;
// case 3: eDisplayToken = XML_ALWAYS break; this is the default
}
...
if( eDisplayToken != XML_TOKEN_INVALID )
    mrExport.AddAttribute(XML_NAMESPACE_DRAW_EXT, XML_DISPLAY,
eDisplayToken );

The idea just seems to be that the default behaviour for that tag is
that if no xml-display attribute is set, then the importer is to act as
if xml-always was present. So its a little size optimization to not
export the attribute if it equals the default value.

For clarity, if you wanted, you could change the initial
XMLTokenEnum eDisplayToken = XML_TOKEN_INVALID;
to
XMLTokenEnum eDisplayToken = XML_ALWAYS;
and change
if( eDisplayToken != XML_TOKEN_INVALID )
to
if( eDisplayToken != XML_ALWAYS )

C.


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.