summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorShlomi Fish <shlomif@shlomifish.org>2017-01-28 11:44:56 +0000
committerShlomi Fish <shlomif@shlomifish.org>2017-01-28 11:44:56 +0000
commita11b9b0b60b4559cd9ffea150c7171fac7bec978 (patch)
treec79f0b3b79479ca4a22fecd442c857032543c25b /src
parentMerged. (diff)
parentrevert 15420 because of severe regression (diff)
downloadinkscape-a11b9b0b60b4559cd9ffea150c7171fac7bec978.tar.gz
inkscape-a11b9b0b60b4559cd9ffea150c7171fac7bec978.zip
Merged.
(bzr r15369.1.17)
Diffstat (limited to 'src')
-rw-r--r--src/color-profile.cpp2
-rw-r--r--src/display/cairo-utils.cpp2
-rw-r--r--src/display/snap-indicator.cpp4
-rw-r--r--src/extension/internal/cdr-input.cpp7
-rw-r--r--src/extension/internal/vsd-input.cpp7
-rw-r--r--src/extension/internal/wpg-input.cpp7
-rw-r--r--src/inkscape.cpp2
-rw-r--r--src/io/sys.cpp2
-rw-r--r--src/main.cpp2
-rw-r--r--src/sp-image.cpp2
-rw-r--r--src/sp-item.cpp1
-rw-r--r--src/ui/dialog/align-and-distribute.cpp4
-rw-r--r--src/ui/dialog/filedialogimpl-gtkmm.cpp2
13 files changed, 33 insertions, 11 deletions
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<std::pair<Glib::ustring, bool> > 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/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);
}
}
}
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()) {
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/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,
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/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 {
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<Geom::Point> 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);
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<gchar *>(
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));