diff options
| author | Tavmjong Bah <tavmjong@free.fr> | 2014-10-02 08:20:01 +0000 |
|---|---|---|
| committer | tavmjong-free <tavmjong@free.fr> | 2014-10-02 08:20:01 +0000 |
| commit | a7fe90319533cc4fdc79e3bc51355c3e69e341fa (patch) | |
| tree | ffe0a059b38f4f6c398e381707ced2d32b7b4444 /src | |
| parent | Fix style string while searching for best face match. (diff) | |
| download | inkscape-a7fe90319533cc4fdc79e3bc51355c3e69e341fa.tar.gz inkscape-a7fe90319533cc4fdc79e3bc51355c3e69e341fa.zip | |
Sort styles for GUI. (Regression)
(bzr r13341.1.237)
Diffstat (limited to 'src')
| -rw-r--r-- | src/libnrtype/FontFactory.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/libnrtype/FontFactory.cpp b/src/libnrtype/FontFactory.cpp index c2b3c64fe..dd2ecddeb 100644 --- a/src/libnrtype/FontFactory.cpp +++ b/src/libnrtype/FontFactory.cpp @@ -513,6 +513,12 @@ static bool StyleNameCompareInternal(const StyleNames &style1, const StyleNames return( StyleNameValue( style1.CssName ) < StyleNameValue( style2.CssName ) ); } +static gint StyleNameCompareInternalGlib(gconstpointer a, gconstpointer b) +{ + return( StyleNameValue( ((StyleNames *)a)->CssName ) < + StyleNameValue( ((StyleNames *)b)->CssName ) ? -1 : 1 ); +} + static bool ustringPairSort(std::pair<PangoFontFamily*, Glib::ustring> const& first, std::pair<PangoFontFamily*, Glib::ustring> const& second) { // well, this looks weird. @@ -586,9 +592,12 @@ GList* font_factory::GetUIStyles(PangoFontFamily * in) pango_font_description_free(faceDescr); } g_free(faces); + + ret = g_list_sort( ret, StyleNameCompareInternalGlib ); return ret; } +// Used only by pdfinput/svg-builder.cpp (since rewrite to cache style) void font_factory::GetUIFamiliesAndStyles(FamilyToStylesMap *map) { g_assert(map); |
