Re: vincent - r31425 - abiword/branches/gsoc2012dialogs/src/wp/ap/xp

From: Vincent Kang <vincent.abiword_at_gmail.com>
Date: Wed Jun 27 2012 - 05:02:31 CEST

Hi,

In fact, I don't use that return value. All variable setting are in
function 'setWidth(thickness);' passing to member variable. ( are
all in the function setWidth)

setWidth(thickness):
       setting m_iHeight & m_sHeight
       'in' and 'pt' conversion

I notice the compiler warning too, I will fix it.

Thanks for your advices,

Vincent

2012/6/27 Hubert Figuière <hfiguiere@teaser.fr>:
>
> On 26/06/12 09:09 AM, cvs@abisource.com wrote:
>
>>
>> +const UT_UTF8String &   AP_Dialog_FormatFrame::getFrameWidth_Str()
>> +{
>> +     UT_UTF8String thickness;
>> +     const gchar * pszStyle = 0;
>> +     m_vecProps.getProp("frame-width", pszStyle);
>> +     if (pszStyle) {
>> +             thickness = pszStyle;
>> +             setWidth(thickness);
>> +     }
>> +     return thickness;
>
> I'll skip the use of UT_UTF8String and focus on the fact that the
> compiler should have told you that you are returning a reference to a
> temporary object. In short you are just gonna crash when using the
> returned value.
>
> Also it is a "get" method therefor it should be const - the orignal one
> was. I see elsewhere you call it ignoring the result, I believe it is
> because it does not do what it says it does.
>
>> +}
>> +
>> +const UT_UTF8String &   AP_Dialog_FormatFrame::getFrameHeight_Str()
>> +{
>
> Same
>
> Hub
>
>
Received on Wed Jun 27 05:02:43 2012

This archive was generated by hypermail 2.1.8 : Wed Jun 27 2012 - 05:02:43 CEST