After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 470089 - Rich text attributes off-by-one when single quote gets removed
Rich text attributes off-by-one when single quote gets removed
Status: RESOLVED FIXED
Product: Gnumeric
Classification: Applications
Component: GUI
git master
Other All
: Normal normal
: ---
Assigned To: Morten Welinder
Jody Goldberg
Depends on:
Blocks:
 
 
Reported: 2007-08-25 02:06 UTC by Valek Filippov
Modified: 2007-12-04 17:31 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch (13.84 KB, patch)
2007-12-01 02:20 UTC, Morten Welinder
none Details | Review
Updated patch (20.87 KB, patch)
2007-12-01 19:13 UTC, Morten Welinder
none Details | Review
gnumeric sample file (11.04 KB, application/octet-stream)
2007-12-01 20:15 UTC, Andreas J. Guelzow
  Details
Updated patch (21.73 KB, patch)
2007-12-02 00:11 UTC, Morten Welinder
none Details | Review
Updated patch (22.28 KB, patch)
2007-12-02 13:59 UTC, Morten Welinder
none Details | Review

Description Valek Filippov 2007-08-25 02:06:41 UTC
Please describe the problem:
if one change some format for chars after '/' in any cell, format info for 1st character will be lost as soon as focus changed to another cell. 

Steps to reproduce:
1. Type '+/??? in cell A1
2. Choose ??? and make it bold
3. Switch to cell A2


Actual results:
only last two ? are bold

Expected results:
all three ? have to be bold

Does this happen every time?
yes

Other information:
Comment 1 Andreas J. Guelzow 2007-11-29 21:23:11 UTC
THis seems to depend on the first character. Is happens for 
/?
but not for 
/g
Comment 2 Morten Welinder 2007-11-30 03:04:46 UTC
'+/ggg gives the same thing.

I see the reason -- it's the initial single quote that, when removed,
make the offsets off by one.  (And + might start an expression.)

This might be messy to fix.
Comment 3 Morten Welinder 2007-12-01 02:20:21 UTC
Created attachment 99943 [details] [review]
Patch

Not too bad.  Review needed for this patch.

It is tempting to move gnm_pango_attr_list_open_hole and gnm_pango_attr_list_open_hole over to goffice.
Comment 4 Morten Welinder 2007-12-01 19:13:41 UTC
Created attachment 99991 [details] [review]
Updated patch

This patch also fixes the fact that currently there is no way to unset
attributes.
Comment 5 Andreas J. Guelzow 2007-12-01 20:00:30 UTC
gnm_debug_object?  I guess this has nothing dirctly to do with this fix. I guess it's a short function for debugging purposes only. Do you want to commit it?
Comment 6 Andreas J. Guelzow 2007-12-01 20:15:24 UTC
Created attachment 99998 [details]
gnumeric sample file

I have tried the updated patch and found the following issue:
open the attachment
in cell A2 celect the first two question marks
since they are bold the bold button in the toolbar is depressed
click on that bold button, it becomes undepressd and the question marks change to unbold
enter

the question marks are bold again when they should be unbold...
Comment 7 Morten Welinder 2007-12-02 00:01:09 UTC
I see that problem too.

Re. gnm_debug_object -- I might add that to gnumeric or goffice.  It's a
life saver when gdb acts up and thinks everything returns integers.
Comment 8 Morten Welinder 2007-12-02 00:11:22 UTC
Created attachment 100016 [details] [review]
Updated patch

That was easy because I had just looked at the pango_attribute_equal
documentation.
Comment 9 Morten Welinder 2007-12-02 13:59:40 UTC
Created attachment 100042 [details] [review]
Updated patch

Minor optimization: empty markup is now treated as no markup.
Comment 10 Jody Goldberg 2007-12-04 13:47:39 UTC
The logic seems correct, but as long as we are moving the pango support code around let's stick it into a goffice/utils/go-pango-extras
The same logic is going to be necessary for more complete rich text support there.
Comment 11 Morten Welinder 2007-12-04 17:31:24 UTC
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.