About MID_FIRST_LINE_REL_INDENT (svxitems.sdi)

Oliver Specht oliver.specht at cib.de
Sun Dec 6 23:58:03 PST 2015


On 05.12.2015 01:00, julien2412 wrote:
Hi,
> Hello,
>
> In svx/sdi/svxitems.sdi, I noticed that MID_FIRST_LINE_REL_INDENT was
> defined as INT32 (see
> http://opengrok.libreoffice.org/xref/core/svx/sdi/svxitems.sdi#437)
> whereas
> http://opengrok.libreoffice.org/search?q=MID_FIRST_LINE_REL_INDENT&project=core&defs=&refs=&path=&hist=
> shows 2 uses in editeng/source/items/frmitems.cxx:
>      468         case MID_FIRST_LINE_REL_INDENT:
>      469             rVal <<= (sal_Int16)(nPropFirstLineOfst);
>      470             break;
the service definitions only contain signed properties. Java has no 
unsigned.
>
>      526         case MID_FIRST_LINE_REL_INDENT:
>      527             SetPropTextFirstLineOfst ( (sal_uInt16)nVal );
>      528             break;
PutValue allows in general all integer types and casts as required. 
Otherwise the caller has to send the right type which is hard to do for 
languages that have no signed integers or those that do not know about 
the required types.
>
> Should it be defined INT16 or should the cast be removed?
> if it's correct and/or if we shouldn't change since there's no bug related
> indeed, a quick explanation would be appreciated :-)
>
> Remark: I noticed this because I wanted to understand the reason of this:
> warn:legacy.osl:9040:1:editeng/source/items/frmitems.cxx:478: unknown
> MemberId
> I noticed these kinds of things too (sfx2/source/control/unoctitm.cxx)
>      895                 sal_uInt16 nSubId( 0 );
>      896                 if ( eMapUnit == SFX_MAPUNIT_TWIP )
>      897                     nSubId |= CONVERT_TWIPS;
>      898                 pItem->QueryValue( aEvent.Result, (sal_uInt8)nSubId
> );
That is indeed a different story.

see https://bugs.documentfoundation.org/show_bug.cgi?id=95697


Regards,
Oliver


More information about the LibreOffice mailing list