From koffice-devel Mon Mar 29 21:10:47 2010 From: Jaroslaw S Date: Mon, 29 Mar 2010 21:10:47 +0000 To: koffice-devel Subject: Re: Unsure about kspread/Style.cpp Message-Id: <56a746381003291410j62996ad2g54a1d8688633784 () mail ! gmail ! com> X-MARC-Message: https://marc.info/?l=koffice-devel&m=126989710207388 On 29 March 2010 23:05, Marijn Kruisselbrink wrote: > On Monday 29 March 2010 22:46:53 Jaroslaw Staniek wrote: >> Hi, >> While porting to the new KoGenStyle(s) API, I have found three >> occurences of "style.type() == 0" in kspread/Style.cpp: >> >> QString Style::saveOdf(KoGenStyle& style, KoGenStyles& mainStyles, >>                        const StyleManager* manager) const >> >> >> Is that correct that we check for KoGenStyle::StylePageLayout >> (style:page-layout as in odf 14.3 Page Layout) here? > I think what the intention of that code is is to check if the KoGenStyle that > is passed has already been initialized, or if it is still "empty", only a > KoGenStyle apparently can't be empty/invalid so that kind of fails. (back > when that code was written the type value was purely something to be > interpreted by the application, although still using 0 as value for "invalid" > seems like it was a bit of a hack/incorrect always...) the original code even > had a comment "if the type is undefined, [do something]", so no, it is not > intended to be StylePageLayout, but a Type value indicating that it is > undefined... Thanks for the detailed info, Marijn. Do you think that changing to "style.isEmpty()" would be the correct fix? -- regards / pozdrawiam, Jaroslaw Staniek http://www.linkedin.com/in/jstaniek Kexi & KOffice (http://www.kexi-project.org, http://www.koffice.org) KDE Software Development Platform on MS Windows (http://windows.kde.org) _______________________________________________ koffice-devel mailing list koffice-devel@kde.org https://mail.kde.org/mailman/listinfo/koffice-devel