openoffice-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andre Fischer <awf....@gmail.com>
Subject Re: Need help to understand code "moVert.get( XML_horz ) != XML_horz"
Date Fri, 25 Apr 2014 06:58:32 GMT
On 24.04.2014 18:36, Regina Henschel wrote:
> Hi all,
>
> in file trunk\main\oox\source\drawingml\textbodyproperties.cxx
> there is the part
>
> void TextBodyProperties::pushToPropMap( PropertyMap& rPropMap ) const
> {
>     rPropMap.insert( maPropertyMap.begin(), maPropertyMap.end() );
>
>     // #160799# fake different vertical text modes by top-bottom 
> writing mode
>     if( moVert.get( XML_horz ) != XML_horz )
>         rPropMap[ PROP_TextWritingMode ] <<= 
> ::com::sun::star::text::WritingMode_TB_RL;
> }
>
> moVert is a member in
> struct TextBodyProperties
> {
>     PropertyMap         maPropertyMap;
>     OptValue< sal_Int32 > moRotation;
>     OptValue< sal_Int32 > moVert;
>
>     explicit            TextBodyProperties();
>
>     void                pushToPropMap( PropertyMap& rPropMap ) const;
> };
> in file trunk\main\oox\inc\oox\drawingml\textbodyproperties.hxx
>
> Why is it not simple
> if (moVert != XML_horz)
>

moVert is defined as

OptValue< sal_Int32 > moVert;

The oox::OptValue template class, defined in 
oox/inc/oox/helper/helper.hxx, does not provide direct access to its 
value.  You have to call the get() method to read the 
value<http://aoodev1:8080/source/xref/current/main/oox/inc/oox/helper/helper.hxx>.

Looking at the code you pasted, I am asking myself if there should not 
be a call to OptValue::has() before the get() method is called.

> Kind regards
> Regina
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@openoffice.apache.org
> For additional commands, e-mail: dev-help@openoffice.apache.org
>


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message