diff options
| author | Jabier Arraiza Cenoz <jabier.arraiza@marker.es> | 2015-12-08 11:05:08 +0000 |
|---|---|---|
| committer | jabiertxof <jabier.arraiza@marker.es> | 2015-12-08 11:05:08 +0000 |
| commit | d79bd642b3214f1c44d7c1268e8adcb7bd55fffc (patch) | |
| tree | 74a8529da5f23996ba4b358c045a7588f8c27f24 /src/ui/dialog/text-edit.cpp | |
| parent | minor changes (diff) | |
| parent | merge lp:~inkscape.dev/inkscape/lock_guides (diff) | |
| download | inkscape-d79bd642b3214f1c44d7c1268e8adcb7bd55fffc.tar.gz inkscape-d79bd642b3214f1c44d7c1268e8adcb7bd55fffc.zip | |
update to trunk
(bzr r14272.1.11)
Diffstat (limited to 'src/ui/dialog/text-edit.cpp')
| -rw-r--r-- | src/ui/dialog/text-edit.cpp | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/src/ui/dialog/text-edit.cpp b/src/ui/dialog/text-edit.cpp index 7575cc854..05cf3a388 100644 --- a/src/ui/dialog/text-edit.cpp +++ b/src/ui/dialog/text-edit.cpp @@ -175,6 +175,19 @@ TextEdit::TextEdit() gtk_text_view_set_wrap_mode ((GtkTextView *) text_view, GTK_WRAP_WORD); #ifdef WITH_GTKSPELL +#ifdef WITH_GTKMM_3_0 +/* + TODO: Use computed xml:lang attribute of relevant element, if present, to specify the + language (either as 2nd arg of gtkspell_new_attach, or with explicit + gtkspell_set_language call in; see advanced.c example in gtkspell docs). + onReadSelection looks like a suitable place. +*/ + GtkSpellChecker * speller = gtk_spell_checker_new(); + + if (! gtk_spell_checker_attach(speller, GTK_TEXT_VIEW(text_view))) { + g_print("gtkspell error:\n"); + } +#else GError *error = NULL; /* @@ -188,6 +201,7 @@ TextEdit::TextEdit() g_error_free(error); } #endif +#endif gtk_widget_set_size_request (text_view, -1, 64); gtk_text_view_set_editable (GTK_TEXT_VIEW (text_view), TRUE); @@ -430,7 +444,7 @@ SPItem *TextEdit::getSelectedTextItem (void) return NULL; std::vector<SPItem*> tmp=SP_ACTIVE_DESKTOP->getSelection()->itemList(); - for(std::vector<SPItem*>::const_iterator i=tmp.begin();i!=tmp.end();i++) + for(std::vector<SPItem*>::const_iterator i=tmp.begin();i!=tmp.end();++i) { if (SP_IS_TEXT(*i) || SP_IS_FLOWTEXT(*i)) return *i; @@ -448,7 +462,7 @@ unsigned TextEdit::getSelectedTextCount (void) unsigned int items = 0; std::vector<SPItem*> tmp=SP_ACTIVE_DESKTOP->getSelection()->itemList(); - for(std::vector<SPItem*>::const_iterator i=tmp.begin();i!=tmp.end();i++) + for(std::vector<SPItem*>::const_iterator i=tmp.begin();i!=tmp.end();++i) { if (SP_IS_TEXT(*i) || SP_IS_FLOWTEXT(*i)) ++items; @@ -558,7 +572,7 @@ void TextEdit::onApply() SPCSSAttr *css = fillTextStyle (); sp_desktop_set_style(desktop, css, true); - for(std::vector<SPItem*>::const_iterator i=item_list.begin();i!=item_list.end();i++){ + for(std::vector<SPItem*>::const_iterator i=item_list.begin();i!=item_list.end();++i){ // apply style to the reprs of all text objects in the selection if (SP_IS_TEXT (*i)) { |
