diff options
| author | Matthew Petroff <matthew@mpetroff.net> | 2013-06-25 00:53:34 +0000 |
|---|---|---|
| committer | Matthew Petroff <matthew@mpetroff.net> | 2013-06-25 00:53:34 +0000 |
| commit | 08807d307231af4c69dd55794fb6c1bcc1df7b04 (patch) | |
| tree | f0f44e0fd5b8ca5f6736235cdd098963f5fb08fa /src | |
| parent | Added length class. (diff) | |
| parent | Correctly ignore symbolic link to ltmain.sh (diff) | |
| download | inkscape-08807d307231af4c69dd55794fb6c1bcc1df7b04.tar.gz inkscape-08807d307231af4c69dd55794fb6c1bcc1df7b04.zip | |
Merge from trunk.
(bzr r12380.1.2)
Diffstat (limited to 'src')
| -rw-r--r-- | src/CMakeLists.txt | 1 | ||||
| -rw-r--r-- | src/Makefile_insert | 1 | ||||
| -rw-r--r-- | src/doxygen-main.cpp | 2 | ||||
| -rw-r--r-- | src/extension/internal/odf.cpp | 44 | ||||
| -rw-r--r-- | src/memeq.h | 25 | ||||
| -rw-r--r-- | src/sp-string.cpp | 8 | ||||
| -rw-r--r-- | src/ui/dialog/align-and-distribute.cpp | 4 | ||||
| -rw-r--r-- | src/ui/dialog/transformation.cpp | 4 | ||||
| -rw-r--r-- | src/unicoderange.cpp | 8 | ||||
| -rw-r--r-- | src/widgets/sp-color-icc-selector.cpp | 6 | ||||
| -rw-r--r-- | src/winconsole.cpp | 8 |
11 files changed, 49 insertions, 62 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a8925e24f..49f32fdea 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -407,7 +407,6 @@ set(inkscape_SRC marker.h measure-context.h media.h - memeq.h menus-skeleton.h mesh-context.h message-context.h diff --git a/src/Makefile_insert b/src/Makefile_insert index c6955c92a..87b2545c8 100644 --- a/src/Makefile_insert +++ b/src/Makefile_insert @@ -99,7 +99,6 @@ ink_common_sources += \ main-cmdlineact.cpp main-cmdlineact.h \ marker.cpp marker.h \ media.cpp media.h \ - memeq.h \ menus-skeleton.h \ mesh-context.cpp mesh-context.h \ message-context.cpp message-context.h \ diff --git a/src/doxygen-main.cpp b/src/doxygen-main.cpp index 71cd49dae..04e5ab33e 100644 --- a/src/doxygen-main.cpp +++ b/src/doxygen-main.cpp @@ -303,7 +303,7 @@ namespace XML {} * SPGuide [\ref sp-guide.cpp, \ref sp-guide.h, \ref satisfied-guide-cns.cpp, \ref sp-guide-attachment.h, \ref sp-guide-constraint.h] * * [\ref help.cpp] [\ref inkscape.cpp] [\ref inkscape-stock.cpp] - * [\ref interface.cpp, \ref memeq.h] [\ref main.cpp, \ref winmain.cpp] + * [\ref interface.cpp] [\ref main.cpp, \ref winmain.cpp] * [\ref menus-skeleton.h, \ref preferences-skeleton.h] * [\ref select-toolbar.cpp] [\ref shortcuts.cpp] * [\ref sp-cursor.cpp] [\ref text-edit.cpp] [\ref toolbox.cpp] diff --git a/src/extension/internal/odf.cpp b/src/extension/internal/odf.cpp index b23378fc3..9f745cdea 100644 --- a/src/extension/internal/odf.cpp +++ b/src/extension/internal/odf.cpp @@ -1191,16 +1191,29 @@ bool OdfOutput::writeMeta(ZipFile &zf) { creator = iter->second; } - Glib::ustring date = ""; + + Glib::ustring date; + Glib::ustring moddate; + char buf [80]; + time_t rawtime; + struct tm * timeinfo; + time (&rawtime); + timeinfo = localtime (&rawtime); + strftime (buf,80,"%Y-%m-%d %H:%M:%S",timeinfo); + moddate = Glib::ustring(buf); + iter = metadata.find("dc:date"); if (iter != metadata.end()) { date = iter->second; } + else + { + date = moddate; + } outs.writeString("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"); outs.writeString("\n"); - outs.writeString("\n"); outs.writeString("<!--\n"); outs.writeString("*************************************************************************\n"); outs.writeString(" file: meta.xml\n"); @@ -1209,7 +1222,6 @@ bool OdfOutput::writeMeta(ZipFile &zf) outs.writeString("*************************************************************************\n"); outs.writeString("-->\n"); outs.writeString("\n"); - outs.writeString("\n"); outs.writeString("<office:document-meta\n"); outs.writeString("xmlns:office=\"urn:oasis:names:tc:opendocument:xmlns:office:1.0\"\n"); outs.writeString("xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n"); @@ -1221,10 +1233,11 @@ bool OdfOutput::writeMeta(ZipFile &zf) outs.writeString("xmlns:anim=\"urn:oasis:names:tc:opendocument:xmlns:animation:1.0\"\n"); outs.writeString("office:version=\"1.0\">\n"); outs.writeString("<office:meta>\n"); - Glib::ustring tmp = Glib::ustring(" <meta:generator>") + InkscapeVersion + "</meta:generator>\n"; + Glib::ustring tmp = Glib::ustring::compose(" <meta:generator>%1</meta:generator>\n", InkscapeVersion); + tmp += Glib::ustring::compose(" <meta:initial-creator>%1</meta:initial-creator>\n", creator); + tmp += Glib::ustring::compose(" <meta:creation-date>%1</meta:creation-date>\n", date); + tmp += Glib::ustring::compose(" <dc:date>%1</dc:date>\n", moddate); outs.writeUString(tmp); - outs.printf(" <meta:initial-creator>%s</meta:initial-creator>\n", creator.c_str()); - outs.printf(" <meta:creation-date>%s</meta:creation-date>\n", date.c_str()); for (iter = metadata.begin() ; iter != metadata.end() ; ++iter) { Glib::ustring name = iter->first; @@ -1235,18 +1248,15 @@ bool OdfOutput::writeMeta(ZipFile &zf) outs.writeUString(tmp); } } - outs.writeString(" <meta:editing-cycles>2</meta:editing-cycles>\n"); - outs.writeString(" <meta:editing-duration>PT56S</meta:editing-duration>\n"); - outs.writeString(" <meta:user-defined meta:name=\"Info 1\"/>\n"); - outs.writeString(" <meta:user-defined meta:name=\"Info 2\"/>\n"); - outs.writeString(" <meta:user-defined meta:name=\"Info 3\"/>\n"); - outs.writeString(" <meta:user-defined meta:name=\"Info 4\"/>\n"); - outs.writeString(" <meta:document-statistic meta:object-count=\"2\"/>\n"); + // outs.writeString(" <meta:editing-cycles>2</meta:editing-cycles>\n"); + // outs.writeString(" <meta:editing-duration>PT56S</meta:editing-duration>\n"); + // outs.writeString(" <meta:user-defined meta:name=\"Info 1\"/>\n"); + // outs.writeString(" <meta:user-defined meta:name=\"Info 2\"/>\n"); + // outs.writeString(" <meta:user-defined meta:name=\"Info 3\"/>\n"); + // outs.writeString(" <meta:user-defined meta:name=\"Info 4\"/>\n"); + // outs.writeString(" <meta:document-statistic meta:object-count=\"2\"/>\n"); outs.writeString("</office:meta>\n"); outs.writeString("</office:document-meta>\n"); - outs.writeString("\n"); - outs.writeString("\n"); - outs.close(); //Make our entry @@ -1533,7 +1543,7 @@ bool OdfOutput::processGradient(SPItem *item, gradientTable.push_back(gi); gradientLookupTable[id] = gradientName; - int gradientCount = gradientTable.size(); + // int gradientCount = gradientTable.size(); char buf[128]; if (gi.style == "linear") { diff --git a/src/memeq.h b/src/memeq.h deleted file mode 100644 index ebccc3c9e..000000000 --- a/src/memeq.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef INKSCAPE_MEMEQ_H -#define INKSCAPE_MEMEQ_H - -#include <cstring> - -/** Convenience/readability wrapper for memcmp(a,b,n)==0. */ -inline bool -memeq(void const *a, void const *b, size_t n) -{ - return std::memcmp(a, b, n) == 0; -} - - -#endif /* !INKSCAPE_MEMEQ_H */ - -/* - Local Variables: - mode:c++ - c-file-style:"stroustrup" - c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +)) - indent-tabs-mode:nil - fill-column:99 - End: -*/ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/sp-string.cpp b/src/sp-string.cpp index 2fe84ac6a..457c248bc 100644 --- a/src/sp-string.cpp +++ b/src/sp-string.cpp @@ -132,10 +132,10 @@ sp_string_update(SPObject *object, SPCtx *ctx, unsigned flags) if (((SPObjectClass *) sp_string_parent_class)->update) ((SPObjectClass *) sp_string_parent_class)->update(object, ctx, flags); - if (flags & (SP_OBJECT_STYLE_MODIFIED_FLAG | SP_OBJECT_MODIFIED_FLAG)) { - /* Parent style or we ourselves changed, so recalculate */ - flags &= ~SP_OBJECT_USER_MODIFIED_FLAG_B; // won't be "just a transformation" anymore, we're going to recompute "x" and "y" attributes - } + // if (flags & (SP_OBJECT_STYLE_MODIFIED_FLAG | SP_OBJECT_MODIFIED_FLAG)) { + // /* Parent style or we ourselves changed, so recalculate */ + // flags &= ~SP_OBJECT_USER_MODIFIED_FLAG_B; // won't be "just a transformation" anymore, we're going to recompute "x" and "y" attributes + // } } diff --git a/src/ui/dialog/align-and-distribute.cpp b/src/ui/dialog/align-and-distribute.cpp index dbd06d9e8..7f88824f7 100644 --- a/src/ui/dialog/align-and-distribute.cpp +++ b/src/ui/dialog/align-and-distribute.cpp @@ -195,7 +195,7 @@ void ActionAlign::do_action(SPDesktop *desktop, int index) { //Move each item in the selected list separately for (std::list<SPItem *>::iterator it(selected.begin()); it != selected.end(); - it++) + ++it) { sp_desktop_document (desktop)->ensureUpToDate(); if (!sel_as_group) @@ -347,7 +347,7 @@ private : float pos = sorted.front().bbox.min()[_orientation]; for ( std::vector<BBoxSort> ::iterator it (sorted.begin()); it < sorted.end(); - it ++ ) + ++it ) { if (!Geom::are_near(pos, it->bbox.min()[_orientation], 1e-6)) { Geom::Point t(0.0, 0.0); diff --git a/src/ui/dialog/transformation.cpp b/src/ui/dialog/transformation.cpp index 4aa972296..2ae98beda 100644 --- a/src/ui/dialog/transformation.cpp +++ b/src/ui/dialog/transformation.cpp @@ -762,7 +762,7 @@ void Transformation::applyPageMove(Inkscape::Selection *selection) double move = x; for ( std::vector<BBoxSort> ::iterator it (sorted.begin()); it < sorted.end(); - it ++ ) + ++it ) { sp_item_move_rel(it->item, Geom::Translate(move, 0)); // move each next object by x relative to previous @@ -786,7 +786,7 @@ void Transformation::applyPageMove(Inkscape::Selection *selection) double move = y; for ( std::vector<BBoxSort> ::iterator it (sorted.begin()); it < sorted.end(); - it ++ ) + ++it ) { sp_item_move_rel(it->item, Geom::Translate(0, move)); // move each next object by x relative to previous diff --git a/src/unicoderange.cpp b/src/unicoderange.cpp index dcf461214..67239d0d2 100644 --- a/src/unicoderange.cpp +++ b/src/unicoderange.cpp @@ -37,8 +37,10 @@ int UnicodeRange::add_range(gchar* val){ Urange r; int i=0, count=0; - while(val[i]!='\0' && val[i]!='-' && val[i]!=' ' && val[i]!=',') i++; - r.start = (gchar*) malloc((i+1)*sizeof(gchar*)); + while(val[i]!='\0' && val[i]!='-' && val[i]!=' ' && val[i]!=','){ + i++; + } + r.start = (gchar*) malloc((i+1)*sizeof(gchar*)); strncpy(r.start, val, i); r.start[i] = '\0'; val+=i; @@ -50,7 +52,7 @@ UnicodeRange::add_range(gchar* val){ r.end = (gchar*) malloc((i+1)*sizeof(gchar*)); strncpy(r.end, val, i); r.end[i] = '\0'; - val+=i; + // val+=i; count+=i; } else { r.end=NULL; diff --git a/src/widgets/sp-color-icc-selector.cpp b/src/widgets/sp-color-icc-selector.cpp index 00b00ce38..53e73dd57 100644 --- a/src/widgets/sp-color-icc-selector.cpp +++ b/src/widgets/sp-color-icc-selector.cpp @@ -272,7 +272,8 @@ static void sp_color_icc_selector_class_init(SPColorICCSelectorClass *klass) ColorICCSelector::ColorICCSelector( SPColorSelector* csel ) - : ColorSelector( csel ) + : ColorSelector( csel ), + _impl(NULL) { } @@ -429,7 +430,8 @@ ColorICCSelectorImpl::~ColorICCSelectorImpl() void ColorICCSelector::init() { - _impl = new ColorICCSelectorImpl(this); + if (_impl) delete(_impl); + _impl = new ColorICCSelectorImpl(this); gint row = 0; _impl->_updating = FALSE; diff --git a/src/winconsole.cpp b/src/winconsole.cpp index 1515d2062..085fb441c 100644 --- a/src/winconsole.cpp +++ b/src/winconsole.cpp @@ -5,13 +5,13 @@ * Windows has two types of executables: GUI and console. * The GUI executables detach immediately when run from the command * prompt (cmd.exe), and whatever you write to standard output - * disappears into a black hole. Console executables handle + * disappears into a black hole. Console executables * do display standard output and take standard input from the console, * but when you run them from the GUI, an extra console window appears. - * It's possible to hide it, but it still flashes from a fraction + * It's possible to hide it, but it still flashes for a fraction * of a second. * - * To provide an Unix-like experienve, where the application will behave + * To provide an Unix-like experience, where the application will behave * correctly in command line mode and at the same time won't create * the ugly console window when run from the GUI, we have to have two * executables. The first one, inkscape.exe, is the GUI application. @@ -31,7 +31,7 @@ *//* * Authors: * Jos Hirth <jh@kaioa.com> - * Krzysztof Kosiński <tweenk.pl@gmail.com> + * Krzysztof Kosinski <tweenk.pl@gmail.com> * * Copyright (C) 2008-2010 Authors * |
