[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    Re: branches/KDE/3.5/kdegraphics/kpdf/xpdf/xpdf
From:       Mario Teijeiro Otero <emeteo () escomposlinux ! org>
Date:       2006-06-11 10:48:39
Message-ID: 200606111348.20854.emeteo () escomposlinux ! org
[Download RAW message or body]


On Sun June 11 2006 00:23, Albert Astals Cid wrote:
>   {
>      length = str.getLength();
>      s = (Unicode *)gmallocn(length, sizeof(Unicode));
> +   bool anyNonEncoded = false;
>      for (int j = 0; j < length; ++j) {
>         s[j] = pdfDocEncoding[str.getChar(j) & 0xff];
> +      if (!s[j]) anyNonEncoded = true;
>      }
> +   if ( anyNonEncoded )
> +   {
> +      for (int j = 0; j < length; ++j) {
> +         s[j] = str.getChar(j);
> +      }
> +   }
>   }

Could it be 

"for ( int j = 0; j < length && !anyNonEncoded ; ++j)"

in the first curl ? This way it does't execute the curl twice, except on the 
worst case.

Regards

-- 
Keep away software patents from Europe.
GPG Fingerprint: 7788 5526 6B2A 47BE 9618  8F48 30AB 1CF9 7799 71DC
http://cernicalo.escomposlinux.org

[Attachment #3 (application/pgp-signature)]

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic