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

Vincent Kang <[email protected]>
Newsgroups gmane.editors.abiword.devel
Message-ID <CAKhPGzm2GwsBnAw6u37QoeT=1zyFJgOx-xbB6tDmGA7kP9RLFA@mail.gmail.com>
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 <[email protected]>:
>
> On 26/06/12 09:09 AM, [email protected] 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
>
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.