From a990b228dac4df40190334093d695e486ba1eee4 Mon Sep 17 00:00:00 2001 From: Alex Valavanis Date: Wed, 11 Jan 2017 14:51:54 +0000 Subject: fix comment typos (bzr r15408) --- src/ui/dialog/align-and-distribute.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/ui/dialog/align-and-distribute.cpp b/src/ui/dialog/align-and-distribute.cpp index 236832beb..1c88fc849 100644 --- a/src/ui/dialog/align-and-distribute.cpp +++ b/src/ui/dialog/align-and-distribute.cpp @@ -614,7 +614,7 @@ private : } }; -// instantiae the private static member +// instantiate the private static member boost::optional ActionExchangePositions::center; class ActionUnclump : public Action { @@ -928,7 +928,7 @@ AlignAndDistribute::AlignAndDistribute() { Inkscape::Preferences *prefs = Inkscape::Preferences::get(); - //Instanciate the align buttons + //Instantiate the align buttons addAlignButton(INKSCAPE_ICON("align-horizontal-right-to-anchor"), _("Align right edges of objects to the left edge of the anchor"), 0, 0); -- cgit v1.2.3 From 5d4aa9ac147ae6db7428aa876293cf2c46fae7a5 Mon Sep 17 00:00:00 2001 From: Diederik van Lierop Date: Wed, 11 Jan 2017 21:58:37 +0100 Subject: Fix snapping tooltips and highlighting of snapped bounding boxes (both of which were not shown) (bzr r15410) --- src/display/snap-indicator.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/display/snap-indicator.cpp b/src/display/snap-indicator.cpp index 17deea16d..f2271e0c6 100644 --- a/src/display/snap-indicator.cpp +++ b/src/display/snap-indicator.cpp @@ -287,7 +287,7 @@ SnapIndicator::set_new_snaptarget(Inkscape::SnappedPoint const &p, bool pre_snap } else if (p.getSource() != SNAPSOURCE_UNDEFINED) { tooltip_str = g_strdup(source_name); } - double fontsize = prefs->getInt("/tools/measure/fontsize"); + double fontsize = prefs->getDouble("/tools/measure/fontsize", 10.0); if (tooltip_str) { Geom::Point tooltip_pos = p.getPoint(); @@ -327,7 +327,7 @@ SnapIndicator::set_new_snaptarget(Inkscape::SnappedPoint const &p, bool pre_snap SP_CTRLRECT(box)->setDashed(true); SP_CTRLRECT(box)->pickable = false; // See the extensive comment above sp_canvas_item_move_to_z(box, 0); - _snaptarget_bbox = _desktop->add_temporary_canvasitem(box, timeout_val); + _snaptarget_bbox = _desktop->add_temporary_canvasitem(box, timeout_val*1000.0); } } } -- cgit v1.2.3 From 00bf8be09a333bb7434eeba9e885e6089b6eb5fd Mon Sep 17 00:00:00 2001 From: Eduard Braun Date: Thu, 12 Jan 2017 22:45:33 +0100 Subject: Use GStatBuf where appropriate to ensure usage of the correct type (fixes compilation with i686-w64-mingw32) (bzr r15414) --- src/color-profile.cpp | 2 +- src/display/cairo-utils.cpp | 2 +- src/inkscape.cpp | 2 +- src/io/sys.cpp | 2 +- src/sp-image.cpp | 2 +- src/ui/dialog/filedialogimpl-gtkmm.cpp | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/color-profile.cpp b/src/color-profile.cpp index 7a4dcc1cd..cbd3475b4 100644 --- a/src/color-profile.cpp +++ b/src/color-profile.cpp @@ -781,7 +781,7 @@ std::vector > ColorProfile::getBaseProfileDirs() static bool isIccFile( gchar const *filepath ) { bool isIccFile = false; - struct stat st; + GStatBuf st; if ( g_stat(filepath, &st) == 0 && (st.st_size > 128) ) { //0-3 == size //36-39 == 'acsp' 0x61637370 diff --git a/src/display/cairo-utils.cpp b/src/display/cairo-utils.cpp index 01b0d807c..8045007e7 100644 --- a/src/display/cairo-utils.cpp +++ b/src/display/cairo-utils.cpp @@ -290,7 +290,7 @@ Pixbuf *Pixbuf::create_from_file(std::string const &fn) if (!g_file_test(fn.c_str(), G_FILE_TEST_EXISTS)) { return NULL; } - struct stat stdir; + GStatBuf stdir; int val = g_stat(fn.c_str(), &stdir); if (val == 0 && stdir.st_mode & S_IFDIR){ return NULL; diff --git a/src/inkscape.cpp b/src/inkscape.cpp index 2ba85026f..bf694ada7 100644 --- a/src/inkscape.cpp +++ b/src/inkscape.cpp @@ -274,7 +274,7 @@ int Application::autosave() if (doc->isModifiedSinceSave()) { gchar *oldest_autosave = 0; const gchar *filename = 0; - struct stat sb; + GStatBuf sb; time_t min_time = 0; gint count = 0; diff --git a/src/io/sys.cpp b/src/io/sys.cpp index 94175176a..61a6a96f4 100644 --- a/src/io/sys.cpp +++ b/src/io/sys.cpp @@ -226,7 +226,7 @@ bool Inkscape::IO::file_is_writable( char const *utf8name) filename = g_filename_from_utf8 ( utf8name, -1, NULL, NULL, NULL ); } if ( filename ) { - struct stat st; + GStatBuf st; if (g_file_test (filename, G_FILE_TEST_EXISTS)){ if (g_lstat (filename, &st) == 0) { success = ((st.st_mode & S_IWRITE) != 0); diff --git a/src/sp-image.cpp b/src/sp-image.cpp index aa1dbfe20..1961971cb 100644 --- a/src/sp-image.cpp +++ b/src/sp-image.cpp @@ -793,7 +793,7 @@ void sp_image_refresh_if_outdated( SPImage* image ) if ( image->href && image->pixbuf && image->pixbuf->modificationTime()) { // It *might* change - struct stat st; + GStatBuf st; memset(&st, 0, sizeof(st)); int val = 0; if (g_file_test (image->pixbuf->originalPath().c_str(), G_FILE_TEST_EXISTS)){ diff --git a/src/ui/dialog/filedialogimpl-gtkmm.cpp b/src/ui/dialog/filedialogimpl-gtkmm.cpp index f5450ac9a..92e9ce834 100644 --- a/src/ui/dialog/filedialogimpl-gtkmm.cpp +++ b/src/ui/dialog/filedialogimpl-gtkmm.cpp @@ -554,7 +554,7 @@ bool SVGPreview::set(Glib::ustring &fileName, int dialogType) Glib::ustring fileNameUtf8 = Glib::filename_to_utf8(fileName); gchar *fName = const_cast( fileNameUtf8.c_str()); // const-cast probably not necessary? (not necessary on Windows version of stat()) - struct stat info; + GStatBuf info; if (g_stat(fName, &info)) // stat returns 0 upon success { g_warning("SVGPreview::set() : %s : %s", fName, strerror(errno)); -- cgit v1.2.3 From 2a903d02506837d99d043d50477950a148c140ab Mon Sep 17 00:00:00 2001 From: Marc Jeanmougin Date: Tue, 17 Jan 2017 11:33:02 +0100 Subject: Fix regression on selecting objects after locking layers Fixed bugs: - https://launchpad.net/bugs/1656141 (bzr r15419) --- src/sp-item.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/sp-item.cpp b/src/sp-item.cpp index 05af12229..5d02020c6 100644 --- a/src/sp-item.cpp +++ b/src/sp-item.cpp @@ -121,6 +121,7 @@ void SPItem::setLocked(bool locked) { setAttribute("sodipodi:insensitive", ( locked ? "1" : NULL )); updateRepr(); + document->_emitModified(); } bool SPItem::isHidden() const { -- cgit v1.2.3 From b6875ce1916a57c9e13cfc0b8fd63fa522b1e449 Mon Sep 17 00:00:00 2001 From: Marc Jeanmougin Date: Tue, 17 Jan 2017 17:03:42 +0100 Subject: Actually unsets attribute instead of ignoring it when it's 0 Fixed bugs: - https://launchpad.net/bugs/481805 (bzr r15420) --- src/sp-rect.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/sp-rect.cpp b/src/sp-rect.cpp index 88dad5354..e69cdfc7b 100644 --- a/src/sp-rect.cpp +++ b/src/sp-rect.cpp @@ -120,6 +120,7 @@ void SPRect::set(unsigned key, gchar const *value) { SPShape::set(key, value); break; } + updateRepr(); #ifdef OBJECT_TRACE objectTrace( "SPRect::set", false ); #endif @@ -171,10 +172,14 @@ Inkscape::XML::Node * SPRect::write(Inkscape::XML::Document *xml_doc, Inkscape:: if (this->rx._set) { sp_repr_set_svg_length(repr, "rx", this->rx); + } else { + repr->setAttribute("rx", NULL); } if (this->ry._set) { sp_repr_set_svg_length(repr, "ry", this->ry); + } else { + repr->setAttribute("ry", NULL); } sp_repr_set_svg_length(repr, "x", this->x); -- cgit v1.2.3 From 1dbe6c746f9f5b0ddbce22e228835010c000d67b Mon Sep 17 00:00:00 2001 From: Eduard Braun Date: Tue, 17 Jan 2017 23:06:15 +0100 Subject: Partially fix opening of librevenge based input formats (cdr/vsd/wpg) on Windows if the filename contains non-ASCII characters The problem is that "RVNGFileStream" uses "fopen()" internally which only supports ANSI filenames on Windows (i.e. a complete fix would require upstream code changes). By using "g_win32_locale_filename_from_utf8()" the problem can be worked around in most cases, though: * the filename is converted to the current codepage (i.e. all 255 characters that are available in the current character encoding are allowed in the filename) * even if the filename contains a character that's not available in the current character encoding it's attempted to use the alternative short (8.3) file name instead Therefore the input operation will only fail in the unlikely case that the filename contains a character not available in the current ANSI code page while at the same time short file names are disabled on the file system (which is not the case in standard configurations). Fixed bugs: - https://launchpad.net/bugs/1656763 - https://launchpad.net/bugs/1656763 (bzr r15421) --- src/extension/internal/cdr-input.cpp | 7 +++++++ src/extension/internal/vsd-input.cpp | 7 +++++++ src/extension/internal/wpg-input.cpp | 7 +++++++ 3 files changed, 21 insertions(+) (limited to 'src') diff --git a/src/extension/internal/cdr-input.cpp b/src/extension/internal/cdr-input.cpp index 92a11a6ac..0435f1396 100644 --- a/src/extension/internal/cdr-input.cpp +++ b/src/extension/internal/cdr-input.cpp @@ -214,6 +214,13 @@ void CdrImportDialog::_setPreviewPage() SPDocument *CdrInput::open(Inkscape::Extension::Input * /*mod*/, const gchar * uri) { + #ifdef WIN32 + // RVNGFileStream uses fopen() internally which unfortunately only uses ANSI encoding on Windows + // therefore attempt to convert uri to the system codepage + // even if this is not possible the alternate short (8.3) file name will be used if available + uri = g_win32_locale_filename_from_utf8(uri); + #endif + RVNGFileStream input(uri); if (!libcdr::CDRDocument::isSupported(&input)) { diff --git a/src/extension/internal/vsd-input.cpp b/src/extension/internal/vsd-input.cpp index 2fb4acf22..78783aa2d 100644 --- a/src/extension/internal/vsd-input.cpp +++ b/src/extension/internal/vsd-input.cpp @@ -216,6 +216,13 @@ void VsdImportDialog::_setPreviewPage() SPDocument *VsdInput::open(Inkscape::Extension::Input * /*mod*/, const gchar * uri) { + #ifdef WIN32 + // RVNGFileStream uses fopen() internally which unfortunately only uses ANSI encoding on Windows + // therefore attempt to convert uri to the system codepage + // even if this is not possible the alternate short (8.3) file name will be used if available + uri = g_win32_locale_filename_from_utf8(uri); + #endif + RVNGFileStream input(uri); if (!libvisio::VisioDocument::isSupported(&input)) { diff --git a/src/extension/internal/wpg-input.cpp b/src/extension/internal/wpg-input.cpp index 54a14fc72..12457791b 100644 --- a/src/extension/internal/wpg-input.cpp +++ b/src/extension/internal/wpg-input.cpp @@ -81,6 +81,13 @@ namespace Internal { SPDocument *WpgInput::open(Inkscape::Extension::Input * /*mod*/, const gchar * uri) { + #ifdef WIN32 + // RVNGFileStream uses fopen() internally which unfortunately only uses ANSI encoding on Windows + // therefore attempt to convert uri to the system codepage + // even if this is not possible the alternate short (8.3) file name will be used if available + uri = g_win32_locale_filename_from_utf8(uri); + #endif + RVNGInputStream* input = new RVNGFileStream(uri); #if WITH_LIBWPG03 if (input->isStructured()) { -- cgit v1.2.3 From 2118ac50fd5fff4306c8882ad230cc4c09c83c60 Mon Sep 17 00:00:00 2001 From: Eduard Braun Date: Wed, 18 Jan 2017 21:31:12 +0100 Subject: Fix usage information for "--export-pdf-version" (bzr r15422) --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/main.cpp b/src/main.cpp index fb627a020..605c1207e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -420,7 +420,7 @@ struct poptOption options[] = { {"export-pdf-version", 0, POPT_ARG_STRING, &sp_export_pdf_version, SP_ARG_EXPORT_PDF_VERSION, // TRANSLATORS: "--export-pdf-version" is an Inkscape command line option; see "inkscape --help" - N_("Export PDF to given version. (hint: make sure to input the exact string found in the PDF export dialog, e.g. \"PDF 1.4\" which is PDF-a conformant)"), + N_("Export PDF to given version. (hint: make sure to input a version found in the PDF export dialog, e.g. \"1.4\" which is PDF-a conformant)"), N_("PDF_VERSION")}, {"export-latex", 0, -- cgit v1.2.3 From dda1f59f8916265c7ef0a5de8ef4497a09cfc1da Mon Sep 17 00:00:00 2001 From: Marc Jeanmougin Date: Thu, 19 Jan 2017 15:56:11 +0100 Subject: revert 15420 because of severe regression (bzr r15423) --- src/sp-rect.cpp | 5 ----- 1 file changed, 5 deletions(-) (limited to 'src') diff --git a/src/sp-rect.cpp b/src/sp-rect.cpp index e69cdfc7b..88dad5354 100644 --- a/src/sp-rect.cpp +++ b/src/sp-rect.cpp @@ -120,7 +120,6 @@ void SPRect::set(unsigned key, gchar const *value) { SPShape::set(key, value); break; } - updateRepr(); #ifdef OBJECT_TRACE objectTrace( "SPRect::set", false ); #endif @@ -172,14 +171,10 @@ Inkscape::XML::Node * SPRect::write(Inkscape::XML::Document *xml_doc, Inkscape:: if (this->rx._set) { sp_repr_set_svg_length(repr, "rx", this->rx); - } else { - repr->setAttribute("rx", NULL); } if (this->ry._set) { sp_repr_set_svg_length(repr, "ry", this->ry); - } else { - repr->setAttribute("ry", NULL); } sp_repr_set_svg_length(repr, "x", this->x); -- cgit v1.2.3