diff options
| author | Adrian Boguszewski <adrbogus1@student.pg.gda.pl> | 2016-03-10 22:00:32 +0000 |
|---|---|---|
| committer | Marc Jeanmougin <marcjeanmougin@free.fr> | 2016-03-10 22:00:32 +0000 |
| commit | 9836d660348065f224b68a0f13765b73c65d54f3 (patch) | |
| tree | eedb90e11754ab05167755de63803f1cbcfbacb2 /src | |
| parent | Add PDF/PS output support for 'paint-order' property. (diff) | |
| download | inkscape-9836d660348065f224b68a0f13765b73c65d54f3.tar.gz inkscape-9836d660348065f224b68a0f13765b73c65d54f3.zip | |
Displays filename instead of blank string in unnamed palettes
Fixed bugs:
- https://launchpad.net/bugs/780659
(bzr r14697)
Diffstat (limited to 'src')
| -rw-r--r-- | src/ui/dialog/swatches.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/ui/dialog/swatches.cpp b/src/ui/dialog/swatches.cpp index ed1cd2079..924ebe03d 100644 --- a/src/ui/dialog/swatches.cpp +++ b/src/ui/dialog/swatches.cpp @@ -393,10 +393,10 @@ static bool parseNum( char*& str, int& val ) { } -void _loadPaletteFile( gchar const *filename, gboolean user/*=FALSE*/ ) +void _loadPaletteFile( gchar const *filename, gchar const *path, gboolean user/*=FALSE*/ ) { char block[1024]; - FILE *f = Inkscape::IO::fopen_utf8name( filename, "r" ); + FILE *f = Inkscape::IO::fopen_utf8name(path, "r" ); if ( f ) { char* result = fgets( block, sizeof(block), f ); if ( result ) { @@ -405,6 +405,7 @@ void _loadPaletteFile( gchar const *filename, gboolean user/*=FALSE*/ ) bool hasErr = false; SwatchPage *onceMore = new SwatchPage(); + onceMore->_name = filename; do { result = fgets( block, sizeof(block), f ); @@ -521,7 +522,7 @@ compare_swatch_names(SwatchPage const *a, SwatchPage const *b) { static void loadEmUp() { static bool beenHere = false; - gboolean userPalete = true; + gboolean userPalette = true; if ( !beenHere ) { beenHere = true; @@ -549,7 +550,7 @@ static void loadEmUp() if ( !g_str_has_suffix(lower, "~") ) { gchar* full = g_build_filename(dirname, filename, NULL); if ( !Inkscape::IO::file_test( full, G_FILE_TEST_IS_DIR ) ) { - _loadPaletteFile(full, userPalete); + _loadPaletteFile(filename, full, userPalette); } g_free(full); } @@ -563,7 +564,7 @@ static void loadEmUp() // toss the dirname g_free(dirname); sources.pop_front(); - userPalete = false; + userPalette = false; } } |
