diff options
| author | Tavmjong Bah <tavmjong@free.fr> | 2018-04-13 07:25:09 +0000 |
|---|---|---|
| committer | Tavmjong Bah <tavmjong@free.fr> | 2018-04-13 07:25:09 +0000 |
| commit | 42e3c0b10a7e1b1e9a577e48b506022c276c424a (patch) | |
| tree | 0c1733396f515ddf6ff4a59cc0d3aafb9045acb0 /src | |
| parent | Merge branch 'master' of gitlab.com:meskobalazs/inkscape (diff) | |
| download | inkscape-42e3c0b10a7e1b1e9a577e48b506022c276c424a.tar.gz inkscape-42e3c0b10a7e1b1e9a577e48b506022c276c424a.zip | |
Remove unused variables.
Diffstat (limited to 'src')
| -rw-r--r-- | src/libnrtype/font-lister.cpp | 24 | ||||
| -rw-r--r-- | src/libnrtype/font-lister.h | 19 |
2 files changed, 9 insertions, 34 deletions
diff --git a/src/libnrtype/font-lister.cpp b/src/libnrtype/font-lister.cpp index b2b290272..7c26f0b92 100644 --- a/src/libnrtype/font-lister.cpp +++ b/src/libnrtype/font-lister.cpp @@ -85,8 +85,6 @@ FontLister::FontLister() current_family_row = 0; current_family = "sans-serif"; current_style = "Normal"; - current_fontspec = "sans-serif"; // Empty style -> Normal - current_fontspec_system = "Sans"; font_list_store->thaw_notify(); @@ -459,20 +457,12 @@ std::pair<Glib::ustring, Glib::ustring> FontLister::selection_update() //std::cout << " fontspec from thin air :" << fontspec << ":" << std::endl; } - // Do we really need? Removes spaces between font-families. - //current_fontspec = canonize_fontspec( fontspec ); - current_fontspec = fontspec; // Ignore for now - - current_fontspec_system = system_fontspec(current_fontspec); - - std::pair<Glib::ustring, Glib::ustring> ui = ui_from_fontspec(current_fontspec); + std::pair<Glib::ustring, Glib::ustring> ui = ui_from_fontspec(fontspec); set_font_family(ui.first); set_font_style(ui.second); #ifdef DEBUG_FONT std::cout << " family_row: :" << current_family_row << ":" << std::endl; - std::cout << " canonized: :" << current_fontspec << ":" << std::endl; - std::cout << " system: :" << current_fontspec_system << ":" << std::endl; std::cout << " family: :" << current_family << ":" << std::endl; std::cout << " style: :" << current_style << ":" << std::endl; std::cout << "FontLister::selection_update: exit" << std::endl; @@ -579,13 +569,9 @@ std::pair<Glib::ustring, Glib::ustring> FontLister::set_font_family(Glib::ustrin std::pair<Glib::ustring, Glib::ustring> ui = new_font_family(new_family, check_style); current_family = ui.first; current_style = ui.second; - current_fontspec = canonize_fontspec(current_family + ", " + current_style); - current_fontspec_system = system_fontspec(current_fontspec); #ifdef DEBUG_FONT std::cout << " family_row: :" << current_family_row << ":" << std::endl; - std::cout << " canonized: :" << current_fontspec << ":" << std::endl; - std::cout << " system: :" << current_fontspec_system << ":" << std::endl; std::cout << " family: :" << current_family << ":" << std::endl; std::cout << " style: :" << current_style << ":" << std::endl; std::cout << "FontLister::set_font_family: end" << std::endl; @@ -633,12 +619,8 @@ void FontLister::set_font_style(Glib::ustring new_style) std::cout << "FontLister:set_font_style: " << new_style << std::endl; #endif current_style = new_style; - current_fontspec = canonize_fontspec(current_family + ", " + current_style); - current_fontspec_system = system_fontspec(current_fontspec); #ifdef DEBUG_FONT - std::cout << " canonized: :" << current_fontspec << ":" << std::endl; - std::cout << " system: :" << current_fontspec_system << ":" << std::endl; std::cout << " family: " << current_family << std::endl; std::cout << " style: " << current_style << std::endl; std::cout << "FontLister::set_font_style: end" << std::endl; @@ -650,10 +632,10 @@ void FontLister::set_font_style(Glib::ustring new_style) // We do this ourselves as we can't rely on FontFactory. void FontLister::fill_css(SPCSSAttr *css, Glib::ustring fontspec) { - if (fontspec.empty()) { - fontspec = current_fontspec; + fontspec = get_fontspec(); } + std::pair<Glib::ustring, Glib::ustring> ui = ui_from_fontspec(fontspec); Glib::ustring family = ui.first; diff --git a/src/libnrtype/font-lister.h b/src/libnrtype/font-lister.h index 1d33912ee..e5acdc107 100644 --- a/src/libnrtype/font-lister.h +++ b/src/libnrtype/font-lister.h @@ -183,10 +183,7 @@ public: */ void set_fontspec(Glib::ustring fontspec, bool check = true); - Glib::ustring get_fontspec() - { - return current_fontspec; - } + Glib::ustring get_fontspec() { return (canonize_fontspec(current_family + ", " + current_style)); } /** * Changes font-family, updating style list and attempting to find @@ -241,7 +238,7 @@ public: Glib::ustring fontspec_from_style(SPStyle *style); /** - * Fill css using current_fontspec. + * Fill css using given fontspec (doesn't need to be member function). */ void fill_css(SPCSSAttr *css, Glib::ustring fontspec = ""); @@ -259,7 +256,10 @@ public: * Return best style match for new font given style for old font. */ Glib::ustring get_best_style_match(Glib::ustring family, Glib::ustring style); - + + /** + * Makes sure style ListStore is filled. + */ void ensureRowStyles(GtkTreeModel* model, GtkTreeIter const* iter); private: @@ -277,13 +277,6 @@ private: int current_family_row; Glib::ustring current_family; Glib::ustring current_style; - Glib::ustring current_fontspec; - - /** - * fontspec of system font closest to current_fontspec. - * (What the system will use to display current_fontspec.) - */ - Glib::ustring current_fontspec_system; /** * If a font-family is not on system, this list of styles is used. |
