Re: vincent - r31425 - abiword/branches/gsoc2012dialogs/src/wp/ap/xp
Hubert Figuière <[email protected]>
| Newsgroups | gmane.editors.abiword.devel |
|---|---|
| Message-ID | <[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