classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cp-patches] RFC: GdkGraphics fix


From: Lillian Angel
Subject: Re: [cp-patches] RFC: GdkGraphics fix
Date: Mon, 21 Nov 2005 15:54:36 -0500

On Mon, 2005-11-21 at 15:46 -0500, Thomas Fitzsimmons wrote:
> On Mon, 2005-11-21 at 14:33 -0500, Lillian Angel wrote:
> > This fixes bug # 24937
> > I spoke in detail to Roman about this. 
> > drawString(String...) was changed to call
> > drawString(AttributedCharacterIterator...) because they both need to
> > ignore the newline characters. 
> > 
> > drawString(AttributedCharacterIterator...) iterates through the
> > characters and stores the non-newline chars in an array. Here Roman
> > suggested that I make some changes and pass the char[] to the native
> > drawString function because allocating a new String is not ideal.
> > 
> > I tried doing this, but that native function calls getStringUTFChars
> > (which requires a jstring). Removing the call to getStringUTFChars
> > obviously does not work... 
> > 
> > The best way to do this right now (since
> > drawString(AttributedCharacterIterator...) is not fully implemented), is
> > creating a new String, like I have done in this patch, or call
> > replaceAll("\n", "") on the String. replaceAll does a lot of unnecessary
> > things, so I avoided using it.
> 
> Why bring the AttributedCharacterIterator drawString into this? 

In this function, we need to filter out those characters as well. Roman
thought it was best I do it like this. If its not good, I can always
change it around.


>  Why not
> just create a new string in "drawString (String str, int x, int y)"
> using something like String.replaceAll?

replaceAll does alot of stuff, it would be more inefficent to use it.

> 
> Also, is it enough to check for '\n'?  Are there other Unicode
> formatting characters we should filter out?

Good point. I will look into this.

Lillian





reply via email to

[Prev in Thread] Current Thread [Next in Thread]