openoffice-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pavel Janík <Pa...@Janik.cz>
Subject Re: define ACCESSIBLE_LAYOUT?
Date Fri, 29 Nov 2013 11:08:07 GMT
Hi Andre,

On Nov 29, 2013, at 12:03 PM, Andre Fischer wrote:

> On 29.11.2013 10:34, Pavel Janík wrote:
>> On Nov 27, 2013, at 12:19 PM, Pavel Janík wrote:
>> 
>>> where is this defined?
>>> 
>>> Occurences:
>>> 
>>> sw/source/core/crsr/crsrsh.cxx:#ifdef ACCESSIBLE_LAYOUT
>>> sw/source/core/crsr/crsrsh.cxx:#ifdef ACCESSIBLE_LAYOUT
>>> sw/source/core/crsr/crsrsh.cxx:#ifdef ACCESSIBLE_LAYOUT
>>> sw/source/ui/docvw/edtwin.cxx:#ifdef ACCESSIBLE_LAYOUT
>>> sw/source/ui/uiview/pview.cxx:#ifdef ACCESSIBLE_LAYOUT
>> It is not defined in the source and thus is a source of compiler warnings about unused
function arguments at the places mentined above.
> 
> I am confused.  The lines above test whether ACCESSIBLE_LAYOUT has been defined.   Why
would that lead to a warning if the definition does not exist.  This pattern is used in many
places in our source code.  One usage, that might apply in this case, is to temporarily activate
a debug feature by passing additional arguments to the compiler via environment variables.
  In my opinion that is a valid use of otherwise never defined variables.

the code looks like this:

void SwCrsrShell::FirePageChangeEvent(sal_uInt16 nOldPage, sal_uInt16 nNewPage)
{
#ifdef ACCESSIBLE_LAYOUT
	if( Imp()->IsAccessible() )
		Imp()->FirePageChangeEvent( nOldPage, nNewPage );
#endif
}

ACCESSIBLE_LAYOUT is not defined. Thus compiler has:

void SwCrsrShell::FirePageChangeEvent(sal_uInt16 nOldPage, sal_uInt16 nNewPage)
{
}

and thus warns about not used arguments nOldPage, nNewPage.

This warning is minor warning, the real question is why we have #ifdef'ed code on something
that is never ever mentioned/defined elsewhere...
-- 
Pavel Janík




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


Mime
View raw message