You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openoffice.apache.org by Pavel Janík <Pa...@Janik.cz> on 2013/11/27 12:19:16 UTC
define ACCESSIBLE_LAYOUT?
Hi,
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
--
Pavel Janík
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@openoffice.apache.org
For additional commands, e-mail: dev-help@openoffice.apache.org
Re: define ACCESSIBLE_LAYOUT?
Posted by Andre Fischer <aw...@gmail.com>.
On 29.11.2013 12:08, Pavel Janík wrote:
> 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.
OK, that explains the warning.
>
> This warning is minor warning, the real question is why we have #ifdef'ed code on something that is never ever mentioned/defined elsewhere...
I assume this to be debug code or experimental code.
I would only remove it if it were old.
-Andre
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@openoffice.apache.org
For additional commands, e-mail: dev-help@openoffice.apache.org
Re: define ACCESSIBLE_LAYOUT?
Posted by Pavel Janík <Pa...@Janik.cz>.
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
Re: define ACCESSIBLE_LAYOUT?
Posted by Andre Fischer <aw...@gmail.com>.
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.
-Andre
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@openoffice.apache.org
For additional commands, e-mail: dev-help@openoffice.apache.org
Re: define ACCESSIBLE_LAYOUT?
Posted by Pavel Janík <Pa...@Janik.cz>.
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 plan to delete this...
--
Pavel Janík
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@openoffice.apache.org
For additional commands, e-mail: dev-help@openoffice.apache.org