OpenOffice trunc Assertion Error

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

OpenOffice trunc Assertion Error

Peter Kovacs-2
Hello all,

I have build OpenOffice from trunc with debug options. When started I
get an Assertion Error.
Error: assertion failed!
 From File /home/legine/AOO/main/vcl/unx/gtk/a11y/atkwrapper.cxx at Line
874
Abort ? (Yes=abort / No=ignore / Cancel=core dump)

Code in Question is:
/* gail_focus_tracker remembers the focused object at the first
              * parent in the hierarchy that is a Gtk+ widget, but at the
time the
              * event gets processed (at idle), it may be too late to
create the
              * hierarchy, so doing it now ..
              */
             uno::Reference< accessibility::XAccessible > xParent(
xContext->getAccessibleParent() );

             /* The top-level objects should never be of this class */
             OSL_ASSERT( xParent.is() );


The Wrapper is not an object right? Only a collection of functions or do
I read this wrong?

Thx for some help.

All the Best
Peter

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: OpenOffice trunc Assertion Error

Peter Kovacs-3
Hello again,

hope I do not annoy anyone, with my questions.
I have looked deeper in the issue using OpenGrok.

Now the Issue seems pretty clear.
We have only the function signatures:

file: atkwrapper.hxx
85  AtkObject *            atk_object_wrapper_new(
86      const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& rxAccessible,
87      AtkObject* parent = NULL );

And we have the call for the Function just above this one (file:atkwrapper.cxx):
AtkObject *
atk_object_wrapper_ref( const uno::Reference< accessibility::XAccessible > &rxAccessible, bool create )
{
    g_return_val_if_fail( rxAccessible.get() != NULL, NULL );

    AtkObject *obj = ooo_wrapper_registry_get(rxAccessible);
    if( obj )
    {
        g_object_ref( obj );
        return obj;
    }

    if( create )
        return atk_object_wrapper_new( rxAccessible );

    return NULL;
}

So this is a bit confusing.

Anyone objects if I refactor the above code so we have only one return statement at the end of the function? I think it is annoying and you quickly miss the exitpoints of the function.

All the Best
Peter

On 2020/01/07 21:27:44, Peter Kovacs <[hidden email]> wrote:

> Hello all,
>
> I have build OpenOffice from trunc with debug options. When started I
> get an Assertion Error.
> Error: assertion failed!
>  From File /home/legine/AOO/main/vcl/unx/gtk/a11y/atkwrapper.cxx at Line
> 874
> Abort ? (Yes=abort / No=ignore / Cancel=core dump)
>
> Code in Question is:
> /* gail_focus_tracker remembers the focused object at the first
>               * parent in the hierarchy that is a Gtk+ widget, but at the
> time the
>               * event gets processed (at idle), it may be too late to
> create the
>               * hierarchy, so doing it now ..
>               */
>              uno::Reference< accessibility::XAccessible > xParent(
> xContext->getAccessibleParent() );
>
>              /* The top-level objects should never be of this class */
>              OSL_ASSERT( xParent.is() );
>
>
> The Wrapper is not an object right? Only a collection of functions or do
> I read this wrong?
>
> Thx for some help.
>
> All the Best
> Peter
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: OpenOffice trunc Assertion Error

Dave Fisher-3
Hi -

See inline

Sent from my iPhone

> On Jan 8, 2020, at 3:44 PM, Peter Kovacs <[hidden email]> wrote:
>
> Hello again,
>
> hope I do not annoy anyone, with my questions.
> I have looked deeper in the issue using OpenGrok.
>
> Now the Issue seems pretty clear.
> We have only the function signatures:
>
> file: atkwrapper.hxx
> 85  AtkObject *            atk_object_wrapper_new(
> 86      const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& rxAccessible,
> 87      AtkObject* parent = NULL );
>
> And we have the call for the Function just above this one (file:atkwrapper.cxx):
> AtkObject *
> atk_object_wrapper_ref( const uno::Reference< accessibility::XAccessible > &rxAccessible, bool create )
> {
>    g_return_val_if_fail( rxAccessible.get() != NULL, NULL );
>
>    AtkObject *obj = ooo_wrapper_registry_get(rxAccessible);
>    if( obj )
>    {
>        g_object_ref( obj );
>        return obj;
>    }
>
>    if( create )
>        return atk_object_wrapper_new( rxAccessible );
>
>    return NULL;
> }
>
> So this is a bit confusing.
>
> Anyone objects if I refactor the above code so we have only one return statement at the end of the function? I think it is annoying and you quickly miss the exitpoints of the function.

You are doing this to make a code quality tool quiet?

You will need to carefully understand how to add else clauses to the code. If the functions is long it will be tedious. Bad clauses will create very subtle bugs. I would want to build often ....

Such changes may also make these functions slightly slower.

If you do this then I think you’ll want someone to review the diff.

Apologies if I’m being negative or discouraging.

Best Regards,
Dave

>
> All the Best
> Peter
>
>> On 2020/01/07 21:27:44, Peter Kovacs <[hidden email]> wrote:
>> Hello all,
>>
>> I have build OpenOffice from trunc with debug options. When started I
>> get an Assertion Error.
>> Error: assertion failed!
>> From File /home/legine/AOO/main/vcl/unx/gtk/a11y/atkwrapper.cxx at Line
>> 874
>> Abort ? (Yes=abort / No=ignore / Cancel=core dump)
>>
>> Code in Question is:
>> /* gail_focus_tracker remembers the focused object at the first
>>              * parent in the hierarchy that is a Gtk+ widget, but at the
>> time the
>>              * event gets processed (at idle), it may be too late to
>> create the
>>              * hierarchy, so doing it now ..
>>              */
>>             uno::Reference< accessibility::XAccessible > xParent(
>> xContext->getAccessibleParent() );
>>
>>             /* The top-level objects should never be of this class */
>>             OSL_ASSERT( xParent.is() );
>>
>>
>> The Wrapper is not an object right? Only a collection of functions or do
>> I read this wrong?
>>
>> Thx for some help.
>>
>> All the Best
>> Peter
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: OpenOffice trunc Assertion Error

Patricia Shanahan
On 1/8/2020 5:55 PM, Dave Fisher wrote:

> Hi -
>
> See inline
>
> Sent from my iPhone
>
>> On Jan 8, 2020, at 3:44 PM, Peter Kovacs <[hidden email]> wrote:
>>
>> Hello again,
>>
>> hope I do not annoy anyone, with my questions.
>> I have looked deeper in the issue using OpenGrok.
>>
>> Now the Issue seems pretty clear.
>> We have only the function signatures:
>>
>> file: atkwrapper.hxx
>> 85  AtkObject *            atk_object_wrapper_new(
>> 86      const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& rxAccessible,
>> 87      AtkObject* parent = NULL );
>>
>> And we have the call for the Function just above this one (file:atkwrapper.cxx):
>> AtkObject *
>> atk_object_wrapper_ref( const uno::Reference< accessibility::XAccessible > &rxAccessible, bool create )
>> {
>>     g_return_val_if_fail( rxAccessible.get() != NULL, NULL );
>>
>>     AtkObject *obj = ooo_wrapper_registry_get(rxAccessible);
>>     if( obj )
>>     {
>>         g_object_ref( obj );
>>         return obj;
>>     }
>>
>>     if( create )
>>         return atk_object_wrapper_new( rxAccessible );
>>
>>     return NULL;
>> }
>>
>> So this is a bit confusing.
>>
>> Anyone objects if I refactor the above code so we have only one return statement at the end of the function? I think it is annoying and you quickly miss the exitpoints of the function.
>
> You are doing this to make a code quality tool quiet?
>
> You will need to carefully understand how to add else clauses to the code. If the functions is long it will be tedious. Bad clauses will create very subtle bugs. I would want to build often ....
>
> Such changes may also make these functions slightly slower.
>
> If you do this then I think you’ll want someone to review the diff.

For some functions, single return is natural and clear. For others, the
code is simpler, more readable, and clearer with multiple returns. I
think this may be a case where I would prefer multiple returns, but I
would be interested in seeing what it looks like if refactored, and open
to the possibility that it might be clearer.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: OpenOffice trunc Assertion Error

Peter Kovacs-3
In reply to this post by Dave Fisher-3
Hi,

To be clear the Assert is a different issue and needs more research.
The Assert claims a different object is to be used for top level objects. Since the issue pops up on top-level object, right at start, I assume something is not as it should be designed. The answers on the list suggest that the knowledge is not present. So I need to do digging first before I can say what to do. I think it may be worth open an issue and collect all informations there.

Thanks pat for the review support I appreciate it.


All the best
Peter

Am 9. Januar 2020 02:55:04 MEZ schrieb Dave Fisher <[hidden email]>:

>Hi -
>
>See inline
>
>Sent from my iPhone
>
>> On Jan 8, 2020, at 3:44 PM, Peter Kovacs <[hidden email]> wrote:
>>
>> Hello again,
>>
>> hope I do not annoy anyone, with my questions.
>> I have looked deeper in the issue using OpenGrok.
>>
>> Now the Issue seems pretty clear.
>> We have only the function signatures:
>>
>> file: atkwrapper.hxx
>> 85  AtkObject *            atk_object_wrapper_new(
>> 86      const ::com::sun::star::uno::Reference<
>::com::sun::star::accessibility::XAccessible >& rxAccessible,
>> 87      AtkObject* parent = NULL );
>>
>> And we have the call for the Function just above this one
>(file:atkwrapper.cxx):
>> AtkObject *
>> atk_object_wrapper_ref( const uno::Reference<
>accessibility::XAccessible > &rxAccessible, bool create )
>> {
>>    g_return_val_if_fail( rxAccessible.get() != NULL, NULL );
>>
>>    AtkObject *obj = ooo_wrapper_registry_get(rxAccessible);
>>    if( obj )
>>    {
>>        g_object_ref( obj );
>>        return obj;
>>    }
>>
>>    if( create )
>>        return atk_object_wrapper_new( rxAccessible );
>>
>>    return NULL;
>> }
>>
>> So this is a bit confusing.
>>
>> Anyone objects if I refactor the above code so we have only one
>return statement at the end of the function? I think it is annoying and
>you quickly miss the exitpoints of the function.
>
>You are doing this to make a code quality tool quiet?
>
>You will need to carefully understand how to add else clauses to the
>code. If the functions is long it will be tedious. Bad clauses will
>create very subtle bugs. I would want to build often ....
>
>Such changes may also make these functions slightly slower.
>
>If you do this then I think you’ll want someone to review the diff.
>
>Apologies if I’m being negative or discouraging.
>
>Best Regards,
>Dave
>
>>
>> All the Best
>> Peter
>>
>>> On 2020/01/07 21:27:44, Peter Kovacs <[hidden email]> wrote:
>
>>> Hello all,
>>>
>>> I have build OpenOffice from trunc with debug options. When started
>I
>>> get an Assertion Error.
>>> Error: assertion failed!
>>> From File /home/legine/AOO/main/vcl/unx/gtk/a11y/atkwrapper.cxx at
>Line
>>> 874
>>> Abort ? (Yes=abort / No=ignore / Cancel=core dump)
>>>
>>> Code in Question is:
>>> /* gail_focus_tracker remembers the focused object at the first
>>>              * parent in the hierarchy that is a Gtk+ widget, but at
>the
>>> time the
>>>              * event gets processed (at idle), it may be too late to
>
>>> create the
>>>              * hierarchy, so doing it now ..
>>>              */
>>>             uno::Reference< accessibility::XAccessible > xParent(
>>> xContext->getAccessibleParent() );
>>>
>>>             /* The top-level objects should never be of this class
>*/
>>>             OSL_ASSERT( xParent.is() );
>>>
>>>
>>> The Wrapper is not an object right? Only a collection of functions
>or do
>>> I read this wrong?
>>>
>>> Thx for some help.
>>>
>>> All the Best
>>> Peter
>>>
>>>
>---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [hidden email]
>>> For additional commands, e-mail: [hidden email]
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [hidden email]
>For additional commands, e-mail: [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: OpenOffice trunc Assertion Error

Patricia Shanahan
What happens if you ignore the assertion and carry on?

I had to do that for several assertions when debugging some security
problems - the problems I was working were higher priority.

On 1/9/2020 1:35 AM, Peter Kovacs wrote:

> Hi,
>
> To be clear the Assert is a different issue and needs more research.
> The Assert claims a different object is to be used for top level objects. Since the issue pops up on top-level object, right at start, I assume something is not as it should be designed. The answers on the list suggest that the knowledge is not present. So I need to do digging first before I can say what to do. I think it may be worth open an issue and collect all informations there.
>
> Thanks pat for the review support I appreciate it.
>
>
> All the best
> Peter
>
> Am 9. Januar 2020 02:55:04 MEZ schrieb Dave Fisher <[hidden email]>:
>> Hi -
>>
>> See inline
>>
>> Sent from my iPhone
>>
>>> On Jan 8, 2020, at 3:44 PM, Peter Kovacs <[hidden email]> wrote:
>>>
>>> Hello again,
>>>
>>> hope I do not annoy anyone, with my questions.
>>> I have looked deeper in the issue using OpenGrok.
>>>
>>> Now the Issue seems pretty clear.
>>> We have only the function signatures:
>>>
>>> file: atkwrapper.hxx
>>> 85  AtkObject *            atk_object_wrapper_new(
>>> 86      const ::com::sun::star::uno::Reference<
>> ::com::sun::star::accessibility::XAccessible >& rxAccessible,
>>> 87      AtkObject* parent = NULL );
>>>
>>> And we have the call for the Function just above this one
>> (file:atkwrapper.cxx):
>>> AtkObject *
>>> atk_object_wrapper_ref( const uno::Reference<
>> accessibility::XAccessible > &rxAccessible, bool create )
>>> {
>>>     g_return_val_if_fail( rxAccessible.get() != NULL, NULL );
>>>
>>>     AtkObject *obj = ooo_wrapper_registry_get(rxAccessible);
>>>     if( obj )
>>>     {
>>>         g_object_ref( obj );
>>>         return obj;
>>>     }
>>>
>>>     if( create )
>>>         return atk_object_wrapper_new( rxAccessible );
>>>
>>>     return NULL;
>>> }
>>>
>>> So this is a bit confusing.
>>>
>>> Anyone objects if I refactor the above code so we have only one
>> return statement at the end of the function? I think it is annoying and
>> you quickly miss the exitpoints of the function.
>>
>> You are doing this to make a code quality tool quiet?
>>
>> You will need to carefully understand how to add else clauses to the
>> code. If the functions is long it will be tedious. Bad clauses will
>> create very subtle bugs. I would want to build often ....
>>
>> Such changes may also make these functions slightly slower.
>>
>> If you do this then I think you’ll want someone to review the diff.
>>
>> Apologies if I’m being negative or discouraging.
>>
>> Best Regards,
>> Dave
>>
>>>
>>> All the Best
>>> Peter
>>>
>>>> On 2020/01/07 21:27:44, Peter Kovacs <[hidden email]> wrote:
>>
>>>> Hello all,
>>>>
>>>> I have build OpenOffice from trunc with debug options. When started
>> I
>>>> get an Assertion Error.
>>>> Error: assertion failed!
>>>>  From File /home/legine/AOO/main/vcl/unx/gtk/a11y/atkwrapper.cxx at
>> Line
>>>> 874
>>>> Abort ? (Yes=abort / No=ignore / Cancel=core dump)
>>>>
>>>> Code in Question is:
>>>> /* gail_focus_tracker remembers the focused object at the first
>>>>               * parent in the hierarchy that is a Gtk+ widget, but at
>> the
>>>> time the
>>>>               * event gets processed (at idle), it may be too late to
>>
>>>> create the
>>>>               * hierarchy, so doing it now ..
>>>>               */
>>>>              uno::Reference< accessibility::XAccessible > xParent(
>>>> xContext->getAccessibleParent() );
>>>>
>>>>              /* The top-level objects should never be of this class
>> */
>>>>              OSL_ASSERT( xParent.is() );
>>>>
>>>>
>>>> The Wrapper is not an object right? Only a collection of functions
>> or do
>>>> I read this wrong?
>>>>
>>>> Thx for some help.
>>>>
>>>> All the Best
>>>> Peter
>>>>
>>>>
>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: [hidden email]
>>>> For additional commands, e-mail: [hidden email]
>>>>
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [hidden email]
>>> For additional commands, e-mail: [hidden email]
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: OpenOffice trunc Assertion Error

Peter Kovacs-3
At least checking bz and documenting the findings should be done.
And the refactoring I want to do. I already know how the code should look like.


Am 9. Januar 2020 10:57:46 MEZ schrieb Patricia Shanahan <[hidden email]>:

>What happens if you ignore the assertion and carry on?
>
>I had to do that for several assertions when debugging some security
>problems - the problems I was working were higher priority.
>
>On 1/9/2020 1:35 AM, Peter Kovacs wrote:
>> Hi,
>>
>> To be clear the Assert is a different issue and needs more research.
>> The Assert claims a different object is to be used for top level
>objects. Since the issue pops up on top-level object, right at start, I
>assume something is not as it should be designed. The answers on the
>list suggest that the knowledge is not present. So I need to do digging
>first before I can say what to do. I think it may be worth open an
>issue and collect all informations there.
>>
>> Thanks pat for the review support I appreciate it.
>>
>>
>> All the best
>> Peter
>>
>> Am 9. Januar 2020 02:55:04 MEZ schrieb Dave Fisher
><[hidden email]>:
>>> Hi -
>>>
>>> See inline
>>>
>>> Sent from my iPhone
>>>
>>>> On Jan 8, 2020, at 3:44 PM, Peter Kovacs <[hidden email]> wrote:
>>>>
>>>> Hello again,
>>>>
>>>> hope I do not annoy anyone, with my questions.
>>>> I have looked deeper in the issue using OpenGrok.
>>>>
>>>> Now the Issue seems pretty clear.
>>>> We have only the function signatures:
>>>>
>>>> file: atkwrapper.hxx
>>>> 85  AtkObject *            atk_object_wrapper_new(
>>>> 86      const ::com::sun::star::uno::Reference<
>>> ::com::sun::star::accessibility::XAccessible >& rxAccessible,
>>>> 87      AtkObject* parent = NULL );
>>>>
>>>> And we have the call for the Function just above this one
>>> (file:atkwrapper.cxx):
>>>> AtkObject *
>>>> atk_object_wrapper_ref( const uno::Reference<
>>> accessibility::XAccessible > &rxAccessible, bool create )
>>>> {
>>>>     g_return_val_if_fail( rxAccessible.get() != NULL, NULL );
>>>>
>>>>     AtkObject *obj = ooo_wrapper_registry_get(rxAccessible);
>>>>     if( obj )
>>>>     {
>>>>         g_object_ref( obj );
>>>>         return obj;
>>>>     }
>>>>
>>>>     if( create )
>>>>         return atk_object_wrapper_new( rxAccessible );
>>>>
>>>>     return NULL;
>>>> }
>>>>
>>>> So this is a bit confusing.
>>>>
>>>> Anyone objects if I refactor the above code so we have only one
>>> return statement at the end of the function? I think it is annoying
>and
>>> you quickly miss the exitpoints of the function.
>>>
>>> You are doing this to make a code quality tool quiet?
>>>
>>> You will need to carefully understand how to add else clauses to the
>>> code. If the functions is long it will be tedious. Bad clauses will
>>> create very subtle bugs. I would want to build often ....
>>>
>>> Such changes may also make these functions slightly slower.
>>>
>>> If you do this then I think you’ll want someone to review the diff.
>>>
>>> Apologies if I’m being negative or discouraging.
>>>
>>> Best Regards,
>>> Dave
>>>
>>>>
>>>> All the Best
>>>> Peter
>>>>
>>>>> On 2020/01/07 21:27:44, Peter Kovacs <[hidden email]>
>wrote:
>>>
>>>>> Hello all,
>>>>>
>>>>> I have build OpenOffice from trunc with debug options. When
>started
>>> I
>>>>> get an Assertion Error.
>>>>> Error: assertion failed!
>>>>>  From File /home/legine/AOO/main/vcl/unx/gtk/a11y/atkwrapper.cxx
>at
>>> Line
>>>>> 874
>>>>> Abort ? (Yes=abort / No=ignore / Cancel=core dump)
>>>>>
>>>>> Code in Question is:
>>>>> /* gail_focus_tracker remembers the focused object at the first
>>>>>               * parent in the hierarchy that is a Gtk+ widget, but
>at
>>> the
>>>>> time the
>>>>>               * event gets processed (at idle), it may be too late
>to
>>>
>>>>> create the
>>>>>               * hierarchy, so doing it now ..
>>>>>               */
>>>>>              uno::Reference< accessibility::XAccessible > xParent(
>>>>> xContext->getAccessibleParent() );
>>>>>
>>>>>              /* The top-level objects should never be of this
>class
>>> */
>>>>>              OSL_ASSERT( xParent.is() );
>>>>>
>>>>>
>>>>> The Wrapper is not an object right? Only a collection of functions
>>> or do
>>>>> I read this wrong?
>>>>>
>>>>> Thx for some help.
>>>>>
>>>>> All the Best
>>>>> Peter
>>>>>
>>>>>
>>>
>---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: [hidden email]
>>>>> For additional commands, e-mail: [hidden email]
>>>>>
>>>>>
>>>>
>>>>
>---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: [hidden email]
>>>> For additional commands, e-mail: [hidden email]
>>>>
>>>
>>>
>>>
>---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [hidden email]
>>> For additional commands, e-mail: [hidden email]
>>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [hidden email]
>For additional commands, e-mail: [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: OpenOffice trunc Assertion Error

Jim Jagielski
In reply to this post by Patricia Shanahan
+1

> On Jan 8, 2020, at 9:02 PM, Patricia Shanahan <[hidden email]> wrote:
>
> On 1/8/2020 5:55 PM, Dave Fisher wrote:
>> Hi -
>> See inline
>> Sent from my iPhone
>>> On Jan 8, 2020, at 3:44 PM, Peter Kovacs <[hidden email]> wrote:
>>>
>>> Hello again,
>>>
>>> hope I do not annoy anyone, with my questions.
>>> I have looked deeper in the issue using OpenGrok.
>>>
>>> Now the Issue seems pretty clear.
>>> We have only the function signatures:
>>>
>>> file: atkwrapper.hxx
>>> 85  AtkObject *            atk_object_wrapper_new(
>>> 86      const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& rxAccessible,
>>> 87      AtkObject* parent = NULL );
>>>
>>> And we have the call for the Function just above this one (file:atkwrapper.cxx):
>>> AtkObject *
>>> atk_object_wrapper_ref( const uno::Reference< accessibility::XAccessible > &rxAccessible, bool create )
>>> {
>>>    g_return_val_if_fail( rxAccessible.get() != NULL, NULL );
>>>
>>>    AtkObject *obj = ooo_wrapper_registry_get(rxAccessible);
>>>    if( obj )
>>>    {
>>>        g_object_ref( obj );
>>>        return obj;
>>>    }
>>>
>>>    if( create )
>>>        return atk_object_wrapper_new( rxAccessible );
>>>
>>>    return NULL;
>>> }
>>>
>>> So this is a bit confusing.
>>>
>>> Anyone objects if I refactor the above code so we have only one return statement at the end of the function? I think it is annoying and you quickly miss the exitpoints of the function.
>> You are doing this to make a code quality tool quiet?
>> You will need to carefully understand how to add else clauses to the code. If the functions is long it will be tedious. Bad clauses will create very subtle bugs. I would want to build often ....
>> Such changes may also make these functions slightly slower.
>> If you do this then I think you’ll want someone to review the diff.
>
> For some functions, single return is natural and clear. For others, the code is simpler, more readable, and clearer with multiple returns. I think this may be a case where I would prefer multiple returns, but I would be interested in seeing what it looks like if refactored, and open to the possibility that it might be clearer.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email] <mailto:[hidden email]>
> For additional commands, e-mail: [hidden email] <mailto:[hidden email]>