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 647888 - GetNoteContents returns wrong text for notes not displayed
GetNoteContents returns wrong text for notes not displayed
Status: RESOLVED FIXED
Product: gnote
Classification: Applications
Component: dbus
0.7.x
Other Linux
: Normal normal
: ---
Assigned To: gnote-maint
gnote-maint
Depends on:
Blocks:
 
 
Reported: 2011-04-15 17:14 UTC by ulrik sverdrup
Modified: 2011-10-23 15:04 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Initialize buffer before returning text_content. (865 bytes, patch)
2011-10-21 01:04 UTC, Casey Harkins
none Details | Review

Description ulrik sverdrup 2011-04-15 17:14:05 UTC
Gnote 0.7.3 (debian testing)

For a note using bulleted lists, GetNoteContents (D-Bus API) will return different text depending on whether the note has been displayed or not. Only displaying the note first will make it return the correct text (with unicode bullets).

I discovered this when exporting all notes via D-Bus to my own plaintext note solution instead.

A workaround was to call DisplayNote on each note before exporting it, in my case the amount of windows was pretty low (below 100?) so it worked fine.
Comment 1 Casey Harkins 2011-10-21 01:04:36 UTC
Created attachment 199597 [details] [review]
Initialize buffer before returning text_content.

GetNoteContent calls Note::text_content() which returns the text from m_buffer if initialized, otherwise it just decodes the xml content. This patch will call Note::get_buffer() if its not initialized, then always return the text from the buffer (fixing the issue with expanding bullets reported in this bug).
Comment 2 Aurimas Černius 2011-10-21 20:03:01 UTC
Looks pretty simple fix, thanks.
I'll take a deeper look soon.
Comment 3 Aurimas Černius 2011-10-22 12:47:23 UTC
This problem has been fixed in our software repository. The fix will go into 0.7.6 and 0.8.1 releases. Thank you for your bug report.
Comment 4 ulrik sverdrup 2011-10-23 15:04:11 UTC
Thank you!