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

From: Hubert Figuière <hfiguiere_at_teaser.fr>
Date: Wed Jun 27 2012 - 04:47:41 CEST

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 04:47:49 2012

This archive was generated by hypermail 2.1.8 : Wed Jun 27 2012 - 04:47:49 CEST