diff options
| author | Marc Jeanmougin <marc@jeanmougin.fr> | 2018-06-14 18:16:30 +0000 |
|---|---|---|
| committer | Marc Jeanmougin <marc@jeanmougin.fr> | 2018-06-14 18:16:30 +0000 |
| commit | 3a70f80a739cb2dc9e9ed5b00c2ea10454e94c05 (patch) | |
| tree | e7d7a510dd21581b047d40235327295737c1b0bc /src/libnrtype | |
| parent | Merge branch 'fontmarkup' of gitlab.com:darktrojan/inkscape (diff) | |
| parent | In font list, don't change selection if current font is already selected; oth... (diff) | |
| download | inkscape-3a70f80a739cb2dc9e9ed5b00c2ea10454e94c05.tar.gz inkscape-3a70f80a739cb2dc9e9ed5b00c2ea10454e94c05.zip | |
Merge branch 'fontselection' of gitlab.com:darktrojan/inkscape
Diffstat (limited to 'src/libnrtype')
| -rw-r--r-- | src/libnrtype/font-lister.cpp | 10 | ||||
| -rw-r--r-- | src/libnrtype/font-lister.h | 2 |
2 files changed, 12 insertions, 0 deletions
diff --git a/src/libnrtype/font-lister.cpp b/src/libnrtype/font-lister.cpp index 0c0c1c29c..8c50f47d4 100644 --- a/src/libnrtype/font-lister.cpp +++ b/src/libnrtype/font-lister.cpp @@ -919,6 +919,16 @@ Gtk::TreePath FontLister::get_path_for_font(Glib::ustring family) return font_list_store->get_path(get_row_for_font(family)); } +bool FontLister::is_path_for_font(Gtk::TreePath path, Glib::ustring family) +{ + Gtk::TreeModel::iterator iter = font_list_store->get_iter(path); + if (iter) { + return familyNamesAreEqual(family, (*iter)[FontList.family]); + } + + return false; +} + Gtk::TreeModel::Row FontLister::get_row_for_style(Glib::ustring style) { diff --git a/src/libnrtype/font-lister.h b/src/libnrtype/font-lister.h index c505b3b18..358340c76 100644 --- a/src/libnrtype/font-lister.h +++ b/src/libnrtype/font-lister.h @@ -261,6 +261,8 @@ public: Gtk::TreePath get_path_for_font(Glib::ustring family); + bool is_path_for_font(Gtk::TreePath path, Glib::ustring family); + Gtk::TreeModel::Row get_row_for_style() { return get_row_for_style (current_style); } Gtk::TreeModel::Row get_row_for_style(Glib::ustring style); |
