Question about function SwAttrSet::GetPresentation (sw/source/ui/utlui/attrdesc.cxx)
julien2412
serval2412 at yahoo.fr
Tue Jun 19 23:16:41 PDT 2012
Hello,
By looking in the last fix commits, I sometimes "opengrok" to see if the
same kind of initial problem solved by the fix could be found.
Then I read this code :
71 // query the attribute descriptions
72 void SwAttrSet::GetPresentation(
73 SfxItemPresentation ePres,
74 SfxMapUnit eCoreMetric,
75 SfxMapUnit ePresMetric,
76 String &rText ) const
77 {
78 static sal_Char const sKomma[] = ", ";
79
80 rText.Erase();
81 String aStr;
82 if( Count() )
83 {
84 SfxItemIter aIter( *this );
85 const IntlWrapper rInt(
::comphelper::getProcessServiceFactory(),
86 GetAppLanguage() );
87 while( sal_True )
88 {
89 aIter.GetCurItem()->GetPresentation( ePres, eCoreMetric,
90 ePresMetric, aStr,
91 &rInt );
92 if( rText.Len() && aStr.Len() )
93 rText += String::CreateFromAscii(sKomma);
94 rText += aStr;
95 if( aIter.IsAtEnd() )
96 break;
97 aIter.NextItem();
98 }
99 }
100 }
if "rText" variable is completely cleared at the beginning (line 80), what's
the use of "rText.Len() &&..." (line 92) (and therefore line 93 and 78) ?
Julien
--
View this message in context: http://nabble.documentfoundation.org/Question-about-function-SwAttrSet-GetPresentation-sw-source-ui-utlui-attrdesc-cxx-tp3991205.html
Sent from the Dev mailing list archive at Nabble.com.
More information about the LibreOffice
mailing list