GNOME Bugzilla – Bug 611678
Printing: the red squiggly line under misspelled words is also printed
Last modified: 2020-11-24 09:58:11 UTC
In Ubuntu TheMiddleMan reported: When Autocheck Spelling in the tools menu is selected and the document is printed, the red squiggly line under the misspelled words is also printed. 1. This happens in Ubuntu 8.10 and 9.04 2. gedit version 2.24.2 3. I expected the squiggly underlines to not be on the printed page 4. There are red squiggly lines on the printed page, I have to disable the autocheck spelling to make them go away also it shows when you print to file (pdf) so if you want to test it you can save paper - http://launchpadlibrarian.net/25828041/Screenshot.png Launchpad ref: https://bugs.edge.launchpad.net/ubuntu/+source/gedit/+bug/364438 Thanks
Created attachment 293133 [details] [review] Printing with error line under misspelled words Added document signals "printing" and "printed" Spell plugin auto_spell feature is deactivated during printing and print preview process and reactivated after printing or print preview process
Review of attachment 293133 [details] [review]: ::: gedit/gedit-document.c @@ +503,3 @@ + * @document: the #GeditDocument. + * + * The "printing" signal is emitted while printing a file. The "printing" signal is emitted when printing a file. @@ +508,3 @@ + * when a file is opened as print preview. + * + * Since 3.16 @@ +518,3 @@ + G_TYPE_NONE, 0); + + * Extra newline @@ +528,3 @@ + * when a file is closed after print preview. + * + G_OBJECT_CLASS_TYPE (object_class), Since 3.16 ::: gedit/gedit-document.h @@ +76,3 @@ + void (* printing) (GeditDocument *document); + + void (* printed) (GeditDocument *document); This will break plugins, don't know if it really matters at this point. ::: plugins/spell/gedit-spell-plugin.c @@ +1086,3 @@ + + view = GEDIT_VIEW (g_object_get_data (G_OBJECT (doc), GEDIT_AUTOMATIC_SPELL_VIEW)); +} Shouldn't this be reset to it's prior value?
And what if the spell plugin is enabled during printing? It's better to have a property is-printing, so when the spell plugin starts it can check the property, and then listen to the notify signal.
Actually, no need to add a property, there is already GeditTab:state.
i am only disabling the autospell feature which highlights the misspelled words, when i try to print a large file to pdf with around 90 pages, the highlighting of misspelled words will be off during rendering for that document. During the rendering/printing process i can work on other tabs with highlighting on without any problems , after the rendering is complete the highlighting is turned back on
Created attachment 293179 [details] [review] Printing with error line under misspelled words Using notify::state signal to get GeditTabState Spell plugin auto_spell feature is deactivated during printing or print preview process and reactivated after printing or print preview process
Created attachment 293194 [details] [review] Printing with error line under misspelled words Checks whether the previous state was printing before reverting to the previous state.
Created attachment 293226 [details] [review] Printing with error line under misspelled words
Review of attachment 293226 [details] [review]: /home/slaf/spell.patch:54: trailing whitespace. previous_autospell_state = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (tab), /home/slaf/spell.patch:64: trailing whitespace. g_action_change_state (auto_spell_action, /home/slaf/spell.patch:72: trailing whitespace. g_object_set_data (G_OBJECT (tab), "auto-spell-state", /home/slaf/spell.patch:73: trailing whitespace. GINT_TO_POINTER (autospell ? HIGHLIGHT_ENABLED : warning: 4 lignes ont ajouté des erreurs d'espace. ::: plugins/spell/gedit-spell-plugin.c @@ -1072,0 +1073,33 @@ +on_tab_state_change (GeditTab *tab, + GParamSpec *pspec, + GeditSpellPlugin *plugin) ... 30 more ... the state of auto_spell_action reflect the state for the active tab and is updated in update_ui. What we need is set insensible the menu entry ( auto-spell check ) when printing or previewing and set it back to sensible when in GEDIT_TAB_STATE_NORMAL @@ +1106,3 @@ + } + } + } simplify to : if (state == GEDIT_TAB_STATE_NORMAL && previous_autospell_state == HIGHLIGHT_ENABLED) @@ -1072,0 +1073,42 @@ +on_tab_state_change (GeditTab *tab, + GParamSpec *pspec, + GeditSpellPlugin *plugin) ... 39 more ... HIGHLIGHT_ENABLED and HIGHLIGHT_DISABLED should be aligned @@ -1095,2 +1148,2 @@ } you must disconnect your signal in gedit_spell_plugin_deactivate for every tab where you connect it and in fact, you also must connect for every tab opened ( for the case where i activate the plugin with already opened tabs )
Still a problem with gedit 3.17.
Mass-closing of all gedit bugzilla tickets. Special "code" to find again all those gedit bugzilla tickets that were open before the mass-closing: 2bfe1b0590a78457e1f1a6a90fb975f5878cb60064ccfe1d7db76ca0da52f0f3 By searching the above sha256sum in bugzilla, the gedit contributors can find again the tickets. We may be interested to do so when we work on a specific area of the code, to at least know the known problems and possible enhancements. We do this mass-closing because bugzilla.gnome.org is being replaced by gitlab.gnome.org.