summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/desktop.cpp3
-rw-r--r--src/display/nr-filter-gaussian.cpp6
-rw-r--r--src/display/nr-filter-morphology.cpp1
-rw-r--r--src/display/nr-filter-primitive.cpp67
-rw-r--r--src/draw-context.cpp2
-rw-r--r--src/event-context.cpp2
-rw-r--r--src/extension/internal/bitmap/despeckle.cpp2
-rw-r--r--src/extension/internal/bitmap/enhance.cpp2
-rw-r--r--src/extension/internal/bitmap/equalize.cpp2
-rw-r--r--src/extension/internal/bitmap/negate.cpp2
-rw-r--r--src/extension/internal/bitmap/normalize.cpp2
-rw-r--r--src/extension/internal/cdr-input.cpp3
-rw-r--r--src/extension/internal/emf-inout.cpp11
-rw-r--r--src/extension/internal/pdf-input-cairo.cpp2
-rw-r--r--src/extension/internal/wmf-inout.cpp11
-rw-r--r--src/extension/internal/wmf-print.cpp2
-rw-r--r--src/extension/internal/wpg-input.cpp2
-rw-r--r--src/libavoid/connector.cpp4
-rw-r--r--src/libcola/cola.h2
-rw-r--r--src/libnrtype/font-lister.cpp2
-rw-r--r--src/livarot/ShapeMisc.cpp2
-rw-r--r--src/marker.cpp4
-rw-r--r--src/mesh-context.cpp2
-rw-r--r--src/selection-chemistry.cpp20
-rw-r--r--src/sp-flowtext.cpp2
-rw-r--r--src/sp-image.cpp4
-rw-r--r--src/sp-item.cpp23
-rw-r--r--src/sp-linear-gradient.cpp2
-rw-r--r--src/sp-lpe-item.cpp2
-rw-r--r--src/sp-mesh-gradient.cpp2
-rw-r--r--src/sp-mesh-row.cpp2
-rw-r--r--src/sp-metadata.cpp2
-rw-r--r--src/sp-object.cpp6
-rw-r--r--src/sp-script.cpp6
-rw-r--r--src/sp-shape.cpp2
-rw-r--r--src/sp-switch.cpp2
-rw-r--r--src/sp-text.cpp2
-rw-r--r--src/svg/svg-length.cpp3
-rw-r--r--src/text-editing.cpp12
-rw-r--r--src/trace/siox.cpp2
-rw-r--r--src/ui/dialog/document-properties.cpp30
-rw-r--r--src/ui/dialog/filter-effects-dialog.cpp2
-rw-r--r--src/util/units.cpp11
-rw-r--r--src/util/units.h4
-rw-r--r--src/winmain.cpp8
45 files changed, 158 insertions, 129 deletions
diff --git a/src/desktop.cpp b/src/desktop.cpp
index f5c35514c..ec446e0f0 100644
--- a/src/desktop.cpp
+++ b/src/desktop.cpp
@@ -681,7 +681,6 @@ void SPDesktop::set_event_context2(const std::string& toolName) {
SPEventContext* ec_new = ToolFactory::instance().createObject(toolName);
ec_new->desktop = this;
ec_new->message_context = new Inkscape::MessageContext(this->messageStack());
- ec_new->setup();
event_context = ec_new;
@@ -690,6 +689,8 @@ void SPDesktop::set_event_context2(const std::string& toolName) {
delete ec_old;
}
+ ec_new->setup();
+
sp_event_context_activate(event_context);
_event_context_changed_signal.emit(this, event_context);
diff --git a/src/display/nr-filter-gaussian.cpp b/src/display/nr-filter-gaussian.cpp
index 9d7c32585..b96e24cbc 100644
--- a/src/display/nr-filter-gaussian.cpp
+++ b/src/display/nr-filter-gaussian.cpp
@@ -304,10 +304,9 @@ filter2D_IIR(PT *const dest, int const dstr1, int const dstr2,
#define PREMUL_ALPHA_LOOP for(unsigned int c=1; c<PC; ++c)
#endif
+INK_UNUSED(num_threads); // to suppress unused argument compiler warning
#if HAVE_OPENMP
#pragma omp parallel for num_threads(num_threads)
-#else
- INK_UNUSED(num_threads);
#endif // HAVE_OPENMP
for ( int c2 = 0 ; c2 < n2 ; c2++ ) {
#if HAVE_OPENMP
@@ -375,10 +374,9 @@ filter2D_FIR(PT *const dst, int const dstr1, int const dstr2,
// Past pixels seen (to enable in-place operation)
PT history[scr_len+1][PC];
+INK_UNUSED(num_threads); // suppresses unused argument compiler warning
#if HAVE_OPENMP
#pragma omp parallel for num_threads(num_threads) private(history)
-#else
- INK_UNUSED(num_threads);
#endif // HAVE_OPENMP
for ( int c2 = 0 ; c2 < n2 ; c2++ ) {
diff --git a/src/display/nr-filter-morphology.cpp b/src/display/nr-filter-morphology.cpp
index b058307cf..b6e5052e1 100644
--- a/src/display/nr-filter-morphology.cpp
+++ b/src/display/nr-filter-morphology.cpp
@@ -69,6 +69,7 @@ void morphologicalFilter1D(cairo_surface_t * const input, cairo_surface_t * cons
int limit = w * h;
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
int numOfThreads = prefs->getIntLimited("/options/threading/numthreads", omp_get_num_procs(), 1, 256);
+ (void) numOfThreads; // suppress unused variable warning
#pragma omp parallel for if(limit > OPENMP_THRESHOLD) num_threads(numOfThreads)
#endif // HAVE_OPENMP
for (int i = 0; i < h; ++i) {
diff --git a/src/display/nr-filter-primitive.cpp b/src/display/nr-filter-primitive.cpp
index fca82c810..95d5d4b09 100644
--- a/src/display/nr-filter-primitive.cpp
+++ b/src/display/nr-filter-primitive.cpp
@@ -110,8 +110,16 @@ void FilterPrimitive::set_subregion(SVGLength const &x, SVGLength const &y,
Geom::Rect FilterPrimitive::filter_primitive_area(FilterUnits const &units)
{
- Geom::OptRect bb = units.get_item_bbox();
- Geom::OptRect fa = units.get_filter_area();
+ Geom::OptRect const bb_opt = units.get_item_bbox();
+ Geom::OptRect const fa_opt = units.get_filter_area();
+ Geom::Rect bb;
+ Geom::Rect fa;
+ if (!bb_opt || !fa_opt) {
+ return Geom::Rect (Geom::Point(0.,0.), Geom::Point(0.,0.));
+ } else {
+ bb = *bb_opt;
+ fa = *fa_opt;
+ }
// This is definitely a hack... but what else to do?
// Current viewport might not be document viewport... but how to find?
@@ -127,8 +135,8 @@ Geom::Rect FilterPrimitive::filter_primitive_area(FilterUnits const &units)
/* Update computed values for ex, em, %. For %, assumes primitive unit is objectBoundingBox. */
/* TODO: fetch somehow the object ex and em lengths; 12, 6 are just dummy values. */
- double len_x = bb->width();
- double len_y = bb->height();
+ double len_x = bb.width();
+ double len_y = bb.height();
_subregion_x.update(12, 6, len_x);
_subregion_y.update(12, 6, len_y);
_subregion_width.update(12, 6, len_x);
@@ -143,44 +151,37 @@ Geom::Rect FilterPrimitive::filter_primitive_area(FilterUnits const &units)
double height = 0;
// If subregion not set, by special case use filter region.
- if( !_subregion_x._set ) x = fa->min()[X];
- if( !_subregion_y._set ) y = fa->min()[Y];
- if( !_subregion_width._set ) width = fa->width();
- if( !_subregion_height._set ) height = fa->height();
+ if( !_subregion_x._set ) x = fa.min()[X];
+ if( !_subregion_y._set ) y = fa.min()[Y];
+ if( !_subregion_width._set ) width = fa.width();
+ if( !_subregion_height._set ) height = fa.height();
if( units.get_primitive_units() == SP_FILTER_UNITS_OBJECTBOUNDINGBOX ) {
// Values are in terms of fraction of bounding box.
- if( _subregion_x._set && _subregion_x.unit != SVGLength::PERCENT ) x = bb->min()[X] + bb->width() * _subregion_x.value;
- if( _subregion_y._set && _subregion_y.unit != SVGLength::PERCENT ) y = bb->min()[Y] + bb->height() * _subregion_y.value;
- if( _subregion_width._set && _subregion_width.unit != SVGLength::PERCENT ) width = bb->width() * _subregion_width.value;
- if( _subregion_height._set && _subregion_height.unit != SVGLength::PERCENT ) height = bb->height() * _subregion_height.value;
- // Values are in terms of percent
- if( _subregion_x._set && _subregion_x.unit == SVGLength::PERCENT ) x = bb->min()[X] + _subregion_x.computed;
- if( _subregion_y._set && _subregion_y.unit == SVGLength::PERCENT ) y = bb->min()[Y] + _subregion_y.computed;
- if( _subregion_width._set && _subregion_width.unit == SVGLength::PERCENT ) width = _subregion_width.computed;
- if( _subregion_height._set && _subregion_height.unit == SVGLength::PERCENT ) height = _subregion_height.computed;
+ if( _subregion_x._set && (_subregion_x.unit != SVGLength::PERCENT) ) x = bb.min()[X] + bb.width() * _subregion_x.value;
+ if( _subregion_y._set && (_subregion_y.unit != SVGLength::PERCENT) ) y = bb.min()[Y] + bb.height() * _subregion_y.value;
+ if( _subregion_width._set && (_subregion_width.unit != SVGLength::PERCENT) ) width = bb.width() * _subregion_width.value;
+ if( _subregion_height._set && (_subregion_height.unit != SVGLength::PERCENT) ) height = bb.height() * _subregion_height.value;
+ // Values are in terms of percent
+ if( _subregion_x._set && (_subregion_x.unit == SVGLength::PERCENT) ) x = bb.min()[X] + _subregion_x.computed;
+ if( _subregion_y._set && (_subregion_y.unit == SVGLength::PERCENT) ) y = bb.min()[Y] + _subregion_y.computed;
+ if( _subregion_width._set && (_subregion_width.unit == SVGLength::PERCENT) ) width = _subregion_width.computed;
+ if( _subregion_height._set && (_subregion_height.unit == SVGLength::PERCENT) ) height = _subregion_height.computed;
} else {
// Values are in terms of user space coordinates or percent of viewbox (yuck!),
// which is usually the size of SVG drawing. Default.
- if( _subregion_x._set && _subregion_x.unit != SVGLength::PERCENT ) x = _subregion_x.computed;
- if( _subregion_y._set && _subregion_y.unit != SVGLength::PERCENT ) y = _subregion_y.computed;
- if( _subregion_width._set && _subregion_width.unit != SVGLength::PERCENT ) width = _subregion_width.computed;
- if( _subregion_height._set && _subregion_height.unit != SVGLength::PERCENT ) height = _subregion_height.computed;
+ if( _subregion_x._set && (_subregion_x.unit != SVGLength::PERCENT) ) x = _subregion_x.computed;
+ if( _subregion_y._set && (_subregion_y.unit != SVGLength::PERCENT) ) y = _subregion_y.computed;
+ if( _subregion_width._set && (_subregion_width.unit != SVGLength::PERCENT) ) width = _subregion_width.computed;
+ if( _subregion_height._set && (_subregion_height.unit != SVGLength::PERCENT) ) height = _subregion_height.computed;
// Percent of viewport
- if( _subregion_x._set && _subregion_x.unit == SVGLength::PERCENT ) x = _subregion_x.value * viewport.width();
- if( _subregion_y._set && _subregion_y.unit == SVGLength::PERCENT ) y = _subregion_y.value * viewport.height();
- if( _subregion_width._set && _subregion_width.unit == SVGLength::PERCENT ) width = _subregion_width.value * viewport.width();
- if( _subregion_height._set && _subregion_height.unit == SVGLength::PERCENT ) height = _subregion_height.value * viewport.height();
+ if( _subregion_x._set && (_subregion_x.unit == SVGLength::PERCENT) ) x = _subregion_x.value * viewport.width();
+ if( _subregion_y._set && (_subregion_y.unit == SVGLength::PERCENT) ) y = _subregion_y.value * viewport.height();
+ if( _subregion_width._set && (_subregion_width.unit == SVGLength::PERCENT) ) width = _subregion_width.value * viewport.width();
+ if( _subregion_height._set && (_subregion_height.unit == SVGLength::PERCENT) ) height = _subregion_height.value * viewport.height();
}
- Geom::Point minp, maxp;
- minp[X] = x;
- minp[Y] = y;
- maxp[X] = x + width;
- maxp[Y] = y + height;
-
- Geom::Rect area(minp, maxp);
- return area;
+ return Geom::Rect (Geom::Point(x,y), Geom::Point(x + width, y + height));
}
void FilterPrimitive::setStyle(SPStyle *style)
diff --git a/src/draw-context.cpp b/src/draw-context.cpp
index dafb773f6..14f969f3f 100644
--- a/src/draw-context.cpp
+++ b/src/draw-context.cpp
@@ -165,7 +165,7 @@ void SPDrawContext::finish() {
spdc_free_colors(this);
}
-void SPDrawContext::set(const Inkscape::Preferences::Entry& value) {
+void SPDrawContext::set(const Inkscape::Preferences::Entry& /*value*/) {
}
bool SPDrawContext::root_handler(GdkEvent* event) {
diff --git a/src/event-context.cpp b/src/event-context.cpp
index e5ea85818..398d3b0e3 100644
--- a/src/event-context.cpp
+++ b/src/event-context.cpp
@@ -77,7 +77,7 @@ static guint32 scroll_event_time = 0;
static gdouble scroll_multiply = 1;
static guint scroll_keyval = 0;
-void SPEventContext::set(const Inkscape::Preferences::Entry& val) {
+void SPEventContext::set(const Inkscape::Preferences::Entry& /*val*/) {
}
void SPEventContext::activate() {
diff --git a/src/extension/internal/bitmap/despeckle.cpp b/src/extension/internal/bitmap/despeckle.cpp
index f818ef81a..c40e6e227 100644
--- a/src/extension/internal/bitmap/despeckle.cpp
+++ b/src/extension/internal/bitmap/despeckle.cpp
@@ -23,7 +23,7 @@ Despeckle::applyEffect(Magick::Image *image) {
}
void
-Despeckle::refreshParameters(Inkscape::Extension::Effect *module) {
+Despeckle::refreshParameters(Inkscape::Extension::Effect */*module*/) {
}
#include "../clear-n_.h"
diff --git a/src/extension/internal/bitmap/enhance.cpp b/src/extension/internal/bitmap/enhance.cpp
index 0bd362e8c..5b06a2d27 100644
--- a/src/extension/internal/bitmap/enhance.cpp
+++ b/src/extension/internal/bitmap/enhance.cpp
@@ -23,7 +23,7 @@ Enhance::applyEffect(Magick::Image *image) {
}
void
-Enhance::refreshParameters(Inkscape::Extension::Effect *module) { }
+Enhance::refreshParameters(Inkscape::Extension::Effect */*module*/) { }
#include "../clear-n_.h"
diff --git a/src/extension/internal/bitmap/equalize.cpp b/src/extension/internal/bitmap/equalize.cpp
index b0726b61a..6098f74b1 100644
--- a/src/extension/internal/bitmap/equalize.cpp
+++ b/src/extension/internal/bitmap/equalize.cpp
@@ -23,7 +23,7 @@ Equalize::applyEffect(Magick::Image *image) {
}
void
-Equalize::refreshParameters(Inkscape::Extension::Effect *module) { }
+Equalize::refreshParameters(Inkscape::Extension::Effect */*module*/) { }
#include "../clear-n_.h"
diff --git a/src/extension/internal/bitmap/negate.cpp b/src/extension/internal/bitmap/negate.cpp
index 2e564821e..4737e6443 100644
--- a/src/extension/internal/bitmap/negate.cpp
+++ b/src/extension/internal/bitmap/negate.cpp
@@ -23,7 +23,7 @@ Negate::applyEffect(Magick::Image* image) {
}
void
-Negate::refreshParameters(Inkscape::Extension::Effect* module) {
+Negate::refreshParameters(Inkscape::Extension::Effect* /*module*/) {
}
#include "../clear-n_.h"
diff --git a/src/extension/internal/bitmap/normalize.cpp b/src/extension/internal/bitmap/normalize.cpp
index 591fe1fdd..1444aa654 100644
--- a/src/extension/internal/bitmap/normalize.cpp
+++ b/src/extension/internal/bitmap/normalize.cpp
@@ -23,7 +23,7 @@ Normalize::applyEffect(Magick::Image* image) {
}
void
-Normalize::refreshParameters(Inkscape::Extension::Effect* module) {
+Normalize::refreshParameters(Inkscape::Extension::Effect* /*module*/) {
}
#include "../clear-n_.h"
diff --git a/src/extension/internal/cdr-input.cpp b/src/extension/internal/cdr-input.cpp
index 04087e268..0111ed626 100644
--- a/src/extension/internal/cdr-input.cpp
+++ b/src/extension/internal/cdr-input.cpp
@@ -256,8 +256,9 @@ SPDocument *CdrInput::open(Inkscape::Extension::Input * /*mod*/, const gchar * u
}
SPDocument * doc = SPDocument::createNewDocFromMem(tmpSVGOutput[page_num-1].cstr(), strlen(tmpSVGOutput[page_num-1].cstr()), TRUE);
+
// Set viewBox if it doesn't exist
- if (!doc->getRoot()->viewBox_set) {
+ if (doc && !doc->getRoot()->viewBox_set) {
doc->setViewBox(Geom::Rect::from_xywh(0, 0, doc->getWidth().value(doc->getDefaultUnit()), doc->getHeight().value(doc->getDefaultUnit())));
}
return doc;
diff --git a/src/extension/internal/emf-inout.cpp b/src/extension/internal/emf-inout.cpp
index 36d7ca145..c8c708051 100644
--- a/src/extension/internal/emf-inout.cpp
+++ b/src/extension/internal/emf-inout.cpp
@@ -3496,7 +3496,7 @@ Emf::open( Inkscape::Extension::Input * /*mod*/, const gchar *uri )
d.tri = trinfo_release_except_FC(d.tri);
// Set viewBox if it doesn't exist
- if (!doc->getRoot()->viewBox_set) {
+ if (doc && !doc->getRoot()->viewBox_set) {
bool saved = Inkscape::DocumentUndo::getUndoSensitive(doc);
Inkscape::DocumentUndo::setUndoSensitive(doc, false);
@@ -3511,15 +3511,14 @@ Emf::open( Inkscape::Extension::Input * /*mod*/, const gchar *uri )
// Set viewBox
doc->setViewBox(Geom::Rect::from_xywh(0, 0, doc->getWidth().value(doc_unit), doc->getHeight().value(doc_unit)));
+ doc->ensureUpToDate();
// Scale and translate objects
- double scale = Inkscape::Util::Quantity::convert(1, "px", doc->getWidth().unit);
+ double scale = Inkscape::Util::Quantity::convert(1, "px", doc_unit);
ShapeEditor::blockSetItem(true);
- doc->getRoot()->scaleChildItemsRec(Geom::Scale(scale), Geom::Point(0, SP_ACTIVE_DOCUMENT->getHeight().value("px")));
+ doc->getRoot()->scaleChildItemsRec(Geom::Scale(scale), Geom::Point(0, doc->getHeight().value("px")));
ShapeEditor::blockSetItem(false);
-
- doc->ensureUpToDate();
-
+
Inkscape::DocumentUndo::setUndoSensitive(doc, saved);
}
diff --git a/src/extension/internal/pdf-input-cairo.cpp b/src/extension/internal/pdf-input-cairo.cpp
index f47fbaf87..c45367c08 100644
--- a/src/extension/internal/pdf-input-cairo.cpp
+++ b/src/extension/internal/pdf-input-cairo.cpp
@@ -625,7 +625,7 @@ PdfInputCairo::open(Inkscape::Extension::Input * /*mod*/, const gchar * uri) {
SPDocument * doc = SPDocument::createNewDocFromMem(output->c_str(), output->length(), TRUE);
// Set viewBox if it doesn't exist
- if (!doc->getRoot()->viewBox_set) {
+ if (doc && !doc->getRoot()->viewBox_set) {
doc->setViewBox(Geom::Rect::from_xywh(0, 0, doc->getWidth().value(doc->getDefaultUnit()), doc->getHeight().value(doc->getDefaultUnit())));
}
diff --git a/src/extension/internal/wmf-inout.cpp b/src/extension/internal/wmf-inout.cpp
index 2c6fd9e52..3f37e4402 100644
--- a/src/extension/internal/wmf-inout.cpp
+++ b/src/extension/internal/wmf-inout.cpp
@@ -3181,7 +3181,7 @@ Wmf::open( Inkscape::Extension::Input * /*mod*/, const gchar *uri )
d.tri = trinfo_release_except_FC(d.tri);
// Set viewBox if it doesn't exist
- if (!doc->getRoot()->viewBox_set) {
+ if (doc && !doc->getRoot()->viewBox_set) {
bool saved = Inkscape::DocumentUndo::getUndoSensitive(doc);
Inkscape::DocumentUndo::setUndoSensitive(doc, false);
@@ -3196,15 +3196,14 @@ Wmf::open( Inkscape::Extension::Input * /*mod*/, const gchar *uri )
// Set viewBox
doc->setViewBox(Geom::Rect::from_xywh(0, 0, doc->getWidth().value(doc_unit), doc->getHeight().value(doc_unit)));
-
+ doc->ensureUpToDate();
+
// Scale and translate objects
- double scale = Inkscape::Util::Quantity::convert(1, "px", doc->getWidth().unit);
+ double scale = Inkscape::Util::Quantity::convert(1, "px", doc_unit);
ShapeEditor::blockSetItem(true);
doc->getRoot()->scaleChildItemsRec(Geom::Scale(scale), Geom::Point(0, doc->getHeight().value("px")));
ShapeEditor::blockSetItem(false);
-
- doc->ensureUpToDate();
-
+
Inkscape::DocumentUndo::setUndoSensitive(doc, saved);
}
diff --git a/src/extension/internal/wmf-print.cpp b/src/extension/internal/wmf-print.cpp
index 3bb17146c..d60b2adf7 100644
--- a/src/extension/internal/wmf-print.cpp
+++ b/src/extension/internal/wmf-print.cpp
@@ -1101,7 +1101,7 @@ unsigned int PrintWmf::image(
unsigned int w, /** width of bitmap */
unsigned int h, /** height of bitmap */
unsigned int rs, /** row stride (normally w*4) */
- Geom::Affine const &tf_ignore, /** WRONG affine transform, use the one from m_tr_stack */
+ Geom::Affine const & /*tf_ignore*/, /** WRONG affine transform, use the one from m_tr_stack */
SPStyle const *style) /** provides indirect link to image object */
{
double x1, y1, dw, dh;
diff --git a/src/extension/internal/wpg-input.cpp b/src/extension/internal/wpg-input.cpp
index b5eb3ce8f..14ff3ec77 100644
--- a/src/extension/internal/wpg-input.cpp
+++ b/src/extension/internal/wpg-input.cpp
@@ -113,7 +113,7 @@ SPDocument *WpgInput::open(Inkscape::Extension::Input * /*mod*/, const gchar * u
SPDocument * doc = SPDocument::createNewDocFromMem(output.cstr(), strlen(output.cstr()), TRUE);
// Set viewBox if it doesn't exist
- if (!doc->getRoot()->viewBox_set) {
+ if (doc && !doc->getRoot()->viewBox_set) {
doc->setViewBox(Geom::Rect::from_xywh(0, 0, doc->getWidth().value(doc->getDefaultUnit()), doc->getHeight().value(doc->getDefaultUnit())));
}
diff --git a/src/libavoid/connector.cpp b/src/libavoid/connector.cpp
index cf8cfa11a..8dcb66f2d 100644
--- a/src/libavoid/connector.cpp
+++ b/src/libavoid/connector.cpp
@@ -1736,7 +1736,8 @@ CrossingsInfoPair countRealCrossings(Avoid::Polygon& poly,
!reversedY);
}
else
- {
+ { /// \todo FIXME: this whole branch was not doing anything
+ /*
int turnDirA = vecDir(a0, a1, a2);
int turnDirB = vecDir(b0, b1, b2);
bool reversed = (side1 != -turnDirA);
@@ -1761,6 +1762,7 @@ CrossingsInfoPair countRealCrossings(Avoid::Polygon& poly,
}
VertID vID(b1.id, true, b1.vn);
//(*pointOrders)[b1].addPoints(&b1, &a1, reversed);
+ */
}
}
}
diff --git a/src/libcola/cola.h b/src/libcola/cola.h
index e1f19994e..a4b05fd92 100644
--- a/src/libcola/cola.h
+++ b/src/libcola/cola.h
@@ -120,7 +120,7 @@ public:
maxiterations(maxiterations) { reset(); }
virtual ~TestConvergence() {}
- virtual bool operator()(double new_stress, double* X, double* Y) {
+ virtual bool operator()(double new_stress, double* /*X*/, double* /*Y*/) {
//std::cout<<"iteration="<<iterations<<", new_stress="<<new_stress<<std::endl;
if (old_stress == DBL_MAX) {
old_stress = new_stress;
diff --git a/src/libnrtype/font-lister.cpp b/src/libnrtype/font-lister.cpp
index aa50f4be0..759acfb26 100644
--- a/src/libnrtype/font-lister.cpp
+++ b/src/libnrtype/font-lister.cpp
@@ -155,7 +155,7 @@ namespace Inkscape
/* See if font-family (or first in fallback list) is on system. If so, get styles. */
std::vector<Glib::ustring> tokens = Glib::Regex::split_simple(",", *i );
- if( !tokens[0].empty() ) {
+ if( !tokens.empty() && !tokens[0].empty() ) {
Gtk::TreeModel::iterator iter2 = font_list_store->get_iter( "0" );
while( iter2 != font_list_store->children().end() ) {
diff --git a/src/livarot/ShapeMisc.cpp b/src/livarot/ShapeMisc.cpp
index 6fd40790f..e40915cba 100644
--- a/src/livarot/ShapeMisc.cpp
+++ b/src/livarot/ShapeMisc.cpp
@@ -327,7 +327,7 @@ Shape::ConvertToForme (Path * dest, int nbP, Path * *orig, bool splitWhenForced)
MakeSweepDestData (false);
}
void
-Shape::ConvertToFormeNested (Path * dest, int nbP, Path * *orig, int wildPath,int &nbNest,int *&nesting,int *&contStart,bool splitWhenForced)
+Shape::ConvertToFormeNested (Path * dest, int nbP, Path * *orig, int /*wildPath*/,int &nbNest,int *&nesting,int *&contStart,bool splitWhenForced)
{
nesting=NULL;
contStart=NULL;
diff --git a/src/marker.cpp b/src/marker.cpp
index b38138f8c..d145aadaf 100644
--- a/src/marker.cpp
+++ b/src/marker.cpp
@@ -503,11 +503,11 @@ void SPMarker::hide(unsigned int key) {
SPGroup::hide(key);
}
-Geom::OptRect SPMarker::bbox(Geom::Affine const &transform, SPItem::BBoxType type) const {
+Geom::OptRect SPMarker::bbox(Geom::Affine const &/*transform*/, SPItem::BBoxType /*type*/) const {
return Geom::OptRect();
}
-void SPMarker::print(SPPrintContext* ctx) {
+void SPMarker::print(SPPrintContext* /*ctx*/) {
}
diff --git a/src/mesh-context.cpp b/src/mesh-context.cpp
index ecd847fa4..142c3d2b1 100644
--- a/src/mesh-context.cpp
+++ b/src/mesh-context.cpp
@@ -104,7 +104,7 @@ const gchar *ms_handle_descr [] = {
N_("Mesh gradient <b>tensor</b>")
};
-void SPMeshContext::selection_changed(Inkscape::Selection* sel) {
+void SPMeshContext::selection_changed(Inkscape::Selection* /*sel*/) {
GrDrag *drag = this->_grdrag;
Inkscape::Selection *selection = sp_desktop_selection(this->desktop);
diff --git a/src/selection-chemistry.cpp b/src/selection-chemistry.cpp
index c5169fff5..e68feb188 100644
--- a/src/selection-chemistry.cpp
+++ b/src/selection-chemistry.cpp
@@ -3232,19 +3232,21 @@ void sp_selection_untile(SPDesktop *desktop)
pat_transform *= item->transform;
for (SPObject *child = pattern->firstChild() ; child != NULL; child = child->next ) {
- Inkscape::XML::Node *copy = child->getRepr()->duplicate(xml_doc);
- SPItem *i = SP_ITEM(desktop->currentLayer()->appendChildRepr(copy));
+ if (SP_IS_ITEM(child)) {
+ Inkscape::XML::Node *copy = child->getRepr()->duplicate(xml_doc);
+ SPItem *i = SP_ITEM(desktop->currentLayer()->appendChildRepr(copy));
- // FIXME: relink clones to the new canvas objects
- // use SPObject::setid when mental finishes it to steal ids of
+ // FIXME: relink clones to the new canvas objects
+ // use SPObject::setid when mental finishes it to steal ids of
- // this is needed to make sure the new item has curve (simply requestDisplayUpdate does not work)
- doc->ensureUpToDate();
+ // this is needed to make sure the new item has curve (simply requestDisplayUpdate does not work)
+ doc->ensureUpToDate();
- Geom::Affine transform( i->transform * pat_transform );
- i->doWriteTransform(i->getRepr(), transform);
+ Geom::Affine transform( i->transform * pat_transform );
+ i->doWriteTransform(i->getRepr(), transform);
- new_select = g_slist_prepend(new_select, i);
+ new_select = g_slist_prepend(new_select, i);
+ }
}
SPCSSAttr *css = sp_repr_css_attr_new();
diff --git a/src/sp-flowtext.cpp b/src/sp-flowtext.cpp
index 0331df312..fee320e90 100644
--- a/src/sp-flowtext.cpp
+++ b/src/sp-flowtext.cpp
@@ -316,7 +316,7 @@ void SPFlowtext::snappoints(std::vector<Inkscape::SnapCandidatePoint> &p, Inksca
}
}
-Inkscape::DrawingItem* SPFlowtext::show(Inkscape::Drawing &drawing, unsigned int key, unsigned int flags) {
+Inkscape::DrawingItem* SPFlowtext::show(Inkscape::Drawing &drawing, unsigned int /*key*/, unsigned int /*flags*/) {
Inkscape::DrawingGroup *flowed = new Inkscape::DrawingGroup(drawing);
flowed->setPickChildren(false);
flowed->setStyle(this->style);
diff --git a/src/sp-image.cpp b/src/sp-image.cpp
index 1032b6d93..8f7a60ca6 100644
--- a/src/sp-image.cpp
+++ b/src/sp-image.cpp
@@ -555,7 +555,7 @@ Inkscape::XML::Node *SPImage::write(Inkscape::XML::Document *xml_doc, Inkscape::
return repr;
}
-Geom::OptRect SPImage::bbox(Geom::Affine const &transform, SPItem::BBoxType type) const {
+Geom::OptRect SPImage::bbox(Geom::Affine const &transform, SPItem::BBoxType /*type*/) const {
Geom::OptRect bbox;
if ((this->width.computed > 0.0) && (this->height.computed > 0.0)) {
@@ -638,7 +638,7 @@ gchar* SPImage::description() const {
return ret;
}
-Inkscape::DrawingItem* SPImage::show(Inkscape::Drawing &drawing, unsigned int key, unsigned int flags) {
+Inkscape::DrawingItem* SPImage::show(Inkscape::Drawing &drawing, unsigned int /*key*/, unsigned int /*flags*/) {
Inkscape::DrawingImage *ai = new Inkscape::DrawingImage(drawing);
sp_image_update_arenaitem(this, ai);
diff --git a/src/sp-item.cpp b/src/sp-item.cpp
index d32fbdef6..c6daa853c 100644
--- a/src/sp-item.cpp
+++ b/src/sp-item.cpp
@@ -562,7 +562,7 @@ void SPItem::mask_ref_changed(SPObject *old_mask, SPObject *mask, SPItem *item)
}
}
-void SPItem::update(SPCtx *ctx, guint flags) {
+void SPItem::update(SPCtx* /*ctx*/, guint flags) {
SPItem *item = this;
SPItem* object = item;
@@ -688,7 +688,7 @@ Inkscape::XML::Node* SPItem::write(Inkscape::XML::Document *xml_doc, Inkscape::X
}
// CPPIFY: make pure virtual
-Geom::OptRect SPItem::bbox(Geom::Affine const &transform, SPItem::BBoxType type) const {
+Geom::OptRect SPItem::bbox(Geom::Affine const & /*transform*/, SPItem::BBoxType /*type*/) const {
//throw;
return Geom::OptRect();
}
@@ -869,7 +869,7 @@ unsigned int SPItem::pos_in_parent() const {
}
// CPPIFY: make pure virtual, see below!
-void SPItem::snappoints(std::vector<Inkscape::SnapCandidatePoint> &p, Inkscape::SnapPreferences const *snapprefs) const {
+void SPItem::snappoints(std::vector<Inkscape::SnapCandidatePoint> & /*p*/, Inkscape::SnapPreferences const */*snapprefs*/) const {
//throw;
}
/* This will only be called if the derived class doesn't override this.
@@ -919,7 +919,7 @@ void SPItem::getSnappoints(std::vector<Inkscape::SnapCandidatePoint> &p, Inkscap
}
// CPPIFY: make pure virtual
-void SPItem::print(SPPrintContext* ctx) {
+void SPItem::print(SPPrintContext* /*ctx*/) {
//throw;
}
@@ -1006,7 +1006,7 @@ unsigned SPItem::display_key_new(unsigned numkeys)
}
// CPPIFY: make pure virtual
-Inkscape::DrawingItem* SPItem::show(Inkscape::Drawing &drawing, unsigned int key, unsigned int flags) {
+Inkscape::DrawingItem* SPItem::show(Inkscape::Drawing& /*drawing*/, unsigned int /*key*/, unsigned int /*flags*/) {
//throw;
return 0;
}
@@ -1065,7 +1065,7 @@ Inkscape::DrawingItem *SPItem::invoke_show(Inkscape::Drawing &drawing, unsigned
}
// CPPIFY: make pure virtual
-void SPItem::hide(unsigned int key) {
+void SPItem::hide(unsigned int /*key*/) {
//throw;
}
@@ -1374,11 +1374,12 @@ void SPItem::doWriteTransform(Inkscape::XML::Node *repr, Geom::Affine const &tra
if ( // run the object's set_transform (i.e. embed transform) only if:
!preserve && // user did not chose to preserve all transforms
- !clip_ref->getObject() && // the object does not have a clippath
- !mask_ref->getObject() && // the object does not have a mask
+ (!clip_ref || !clip_ref->getObject()) && // the object does not have a clippath
+ (!mask_ref || !mask_ref->getObject()) && // the object does not have a mask
!(!transform.isTranslation() && style && style->getFilter()) // the object does not have a filter, or the transform is translation (which is supposed to not affect filters)
- ) {
- transform_attr = this->set_transform(transform);
+ )
+ {
+ transform_attr = this->set_transform(transform);
if (freeze_stroke_width) {
freeze_stroke_width_recursive(false);
@@ -1411,7 +1412,7 @@ void SPItem::doWriteTransform(Inkscape::XML::Node *repr, Geom::Affine const &tra
}
// CPPIFY: see below, do not make pure?
-gint SPItem::event(SPEvent* event) {
+gint SPItem::event(SPEvent* /*event*/) {
return FALSE;
}
diff --git a/src/sp-linear-gradient.cpp b/src/sp-linear-gradient.cpp
index 4e7a08f4b..959e8d733 100644
--- a/src/sp-linear-gradient.cpp
+++ b/src/sp-linear-gradient.cpp
@@ -96,7 +96,7 @@ Inkscape::XML::Node* SPLinearGradient::write(Inkscape::XML::Document *xml_doc, I
return repr;
}
-cairo_pattern_t* SPLinearGradient::pattern_new(cairo_t *ct, Geom::OptRect const &bbox, double opacity) {
+cairo_pattern_t* SPLinearGradient::pattern_new(cairo_t * /*ct*/, Geom::OptRect const &bbox, double opacity) {
this->ensureVector();
cairo_pattern_t *cp = cairo_pattern_create_linear(
diff --git a/src/sp-lpe-item.cpp b/src/sp-lpe-item.cpp
index 61ba2ae0d..666c79e49 100644
--- a/src/sp-lpe-item.cpp
+++ b/src/sp-lpe-item.cpp
@@ -258,7 +258,7 @@ bool SPLPEItem::performPathEffect(SPCurve *curve) {
}
// CPPIFY: make pure virtual
-void SPLPEItem::update_patheffect(bool write) {
+void SPLPEItem::update_patheffect(bool /*write*/) {
//throw;
}
diff --git a/src/sp-mesh-gradient.cpp b/src/sp-mesh-gradient.cpp
index 3fd277f52..eb5ed1bd0 100644
--- a/src/sp-mesh-gradient.cpp
+++ b/src/sp-mesh-gradient.cpp
@@ -93,7 +93,7 @@ sp_meshgradient_repr_write(SPMeshGradient *mg)
}
-cairo_pattern_t* SPMeshGradient::pattern_new(cairo_t *ct,
+cairo_pattern_t* SPMeshGradient::pattern_new(cairo_t * /*ct*/,
#if defined(MESH_DEBUG) || (CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 11, 4))
Geom::OptRect const &bbox,
double opacity
diff --git a/src/sp-mesh-row.cpp b/src/sp-mesh-row.cpp
index 04619d6cc..07747f7f5 100644
--- a/src/sp-mesh-row.cpp
+++ b/src/sp-mesh-row.cpp
@@ -81,7 +81,7 @@ void SPMeshRow::build(SPDocument* doc, Inkscape::XML::Node* repr) {
* Virtual build: set meshrow attributes from its associated XML node.
*/
-void SPMeshRow::set(unsigned int key, const gchar* value) {
+void SPMeshRow::set(unsigned int /*key*/, const gchar* /*value*/) {
}
/**
diff --git a/src/sp-metadata.cpp b/src/sp-metadata.cpp
index a093107ac..bf4ce27a1 100644
--- a/src/sp-metadata.cpp
+++ b/src/sp-metadata.cpp
@@ -98,7 +98,7 @@ void SPMetadata::set(unsigned int key, const gchar* value) {
SPObject::set(key, value);
}
-void SPMetadata::update(SPCtx* ctx, unsigned int flags) {
+void SPMetadata::update(SPCtx* /*ctx*/, unsigned int flags) {
debug("0x%08x",(unsigned int)this);
//SPMetadata *metadata = SP_METADATA(object);
diff --git a/src/sp-object.cpp b/src/sp-object.cpp
index e5f119ee0..4a32c9470 100644
--- a/src/sp-object.cpp
+++ b/src/sp-object.cpp
@@ -151,11 +151,11 @@ void SPObject::read_content() {
//throw;
}
-void SPObject::update(SPCtx* ctx, unsigned int flags) {
+void SPObject::update(SPCtx* /*ctx*/, unsigned int /*flags*/) {
//throw;
}
-void SPObject::modified(unsigned int flags) {
+void SPObject::modified(unsigned int /*flags*/) {
//throw;
}
@@ -624,7 +624,7 @@ void SPObject::remove_child(Inkscape::XML::Node* child) {
}
}
-void SPObject::order_changed(Inkscape::XML::Node *child, Inkscape::XML::Node * old_ref, Inkscape::XML::Node *new_ref) {
+void SPObject::order_changed(Inkscape::XML::Node *child, Inkscape::XML::Node * /*old_ref*/, Inkscape::XML::Node *new_ref) {
SPObject* object = this;
SPObject *ochild = object->get_child_by_repr(child);
diff --git a/src/sp-script.cpp b/src/sp-script.cpp
index 158796e51..260b3dcfd 100644
--- a/src/sp-script.cpp
+++ b/src/sp-script.cpp
@@ -57,11 +57,11 @@ void SPScript::release() {
SPObject::release();
}
-void SPScript::update(SPCtx* ctx, unsigned int flags) {
+void SPScript::update(SPCtx* /*ctx*/, unsigned int /*flags*/) {
}
-void SPScript::modified(unsigned int flags) {
+void SPScript::modified(unsigned int /*flags*/) {
}
@@ -81,7 +81,7 @@ void SPScript::set(unsigned int key, const gchar* value) {
}
}
-Inkscape::XML::Node* SPScript::write(Inkscape::XML::Document* doc, Inkscape::XML::Node* repr, guint flags) {
+Inkscape::XML::Node* SPScript::write(Inkscape::XML::Document* /*doc*/, Inkscape::XML::Node* repr, guint /*flags*/) {
return repr;
}
diff --git a/src/sp-shape.cpp b/src/sp-shape.cpp
index 3cc7ea1ce..b3a331cba 100644
--- a/src/sp-shape.cpp
+++ b/src/sp-shape.cpp
@@ -712,7 +712,7 @@ void SPShape::print(SPPrintContext* ctx) {
}
}
-Inkscape::DrawingItem* SPShape::show(Inkscape::Drawing &drawing, unsigned int key, unsigned int flags) {
+Inkscape::DrawingItem* SPShape::show(Inkscape::Drawing &drawing, unsigned int /*key*/, unsigned int /*flags*/) {
Inkscape::DrawingShape *s = new Inkscape::DrawingShape(drawing);
s->setStyle(this->style);
s->setPath(this->_curve);
diff --git a/src/sp-switch.cpp b/src/sp-switch.cpp
index 911357660..5c88d7af8 100644
--- a/src/sp-switch.cpp
+++ b/src/sp-switch.cpp
@@ -81,7 +81,7 @@ gchar *SPSwitch::description() const {
ngettext(_("of <b>%d</b> object"), _("of <b>%d</b> objects"), len), len);
}
-void SPSwitch::child_added(Inkscape::XML::Node* child, Inkscape::XML::Node* ref) {
+void SPSwitch::child_added(Inkscape::XML::Node* /*child*/, Inkscape::XML::Node* /*ref*/) {
this->_reevaluate(true);
}
diff --git a/src/sp-text.cpp b/src/sp-text.cpp
index 11d0e1a6c..d2f433eba 100644
--- a/src/sp-text.cpp
+++ b/src/sp-text.cpp
@@ -305,7 +305,7 @@ Geom::OptRect SPText::bbox(Geom::Affine const &transform, SPItem::BBoxType type)
return bbox;
}
-Inkscape::DrawingItem* SPText::show(Inkscape::Drawing &drawing, unsigned key, unsigned flags) {
+Inkscape::DrawingItem* SPText::show(Inkscape::Drawing &drawing, unsigned /*key*/, unsigned /*flags*/) {
Inkscape::DrawingGroup *flowed = new Inkscape::DrawingGroup(drawing);
flowed->setPickChildren(false);
flowed->setStyle(this->style);
diff --git a/src/svg/svg-length.cpp b/src/svg/svg-length.cpp
index 6f1a88a58..b9e8e6340 100644
--- a/src/svg/svg-length.cpp
+++ b/src/svg/svg-length.cpp
@@ -65,6 +65,7 @@ unsigned int sp_svg_number_read_d(gchar const *str, double *val)
}
// TODO must add a buffer length parameter for safety:
+// rewrite using std::string?
static unsigned int sp_svg_number_write_ui(gchar *buf, unsigned int val)
{
unsigned int i = 0;
@@ -81,6 +82,7 @@ static unsigned int sp_svg_number_write_ui(gchar *buf, unsigned int val)
}
// TODO unsafe code ingnoring bufLen
+// rewrite using std::string?
static unsigned int sp_svg_number_write_i(gchar *buf, int bufLen, int val)
{
int p = 0;
@@ -98,6 +100,7 @@ static unsigned int sp_svg_number_write_i(gchar *buf, int bufLen, int val)
}
// TODO unsafe code ingnoring bufLen
+// rewrite using std::string?
static unsigned sp_svg_number_write_d(gchar *buf, int bufLen, double val, unsigned int tprec, unsigned int fprec)
{
/* Process sign */
diff --git a/src/text-editing.cpp b/src/text-editing.cpp
index cf1c4811f..cae123616 100644
--- a/src/text-editing.cpp
+++ b/src/text-editing.cpp
@@ -1558,7 +1558,7 @@ static SPObject* ascend_while_first(SPObject *item, Glib::ustring::iterator text
/** empty spans: abc<span></span>def
-> abcdef */
-static bool tidy_operator_empty_spans(SPObject **item, bool has_text_decoration)
+static bool tidy_operator_empty_spans(SPObject **item, bool /*has_text_decoration*/)
{
bool result = false;
if ( !(*item)->hasChildren()
@@ -1576,7 +1576,7 @@ static bool tidy_operator_empty_spans(SPObject **item, bool has_text_decoration)
/** inexplicable spans: abc<span style="">def</span>ghi
-> "abc""def""ghi"
the repeated strings will be merged by another operator. */
-static bool tidy_operator_inexplicable_spans(SPObject **item, bool has_text_decoration)
+static bool tidy_operator_inexplicable_spans(SPObject **item, bool /*has_text_decoration*/)
{
//XML Tree being directly used here while it shouldn't be.
if (*item && sp_repr_is_meta_element((*item)->getRepr())) {
@@ -1611,7 +1611,7 @@ static bool tidy_operator_inexplicable_spans(SPObject **item, bool has_text_deco
/** repeated spans: <font a>abc</font><font a>def</font>
-> <font a>abcdef</font> */
-static bool tidy_operator_repeated_spans(SPObject **item, bool has_text_decoration)
+static bool tidy_operator_repeated_spans(SPObject **item, bool /*has_text_decoration*/)
{
SPObject *first = *item;
SPObject *second = first->getNext();
@@ -1657,7 +1657,7 @@ static bool tidy_operator_repeated_spans(SPObject **item, bool has_text_decorati
-> <font b>abc</font>
excessive nesting: <font a><size 1>abc</size></font>
-> <font a,size 1>abc</font> */
-static bool tidy_operator_excessive_nesting(SPObject **item, bool has_text_decoration)
+static bool tidy_operator_excessive_nesting(SPObject **item, bool /*has_text_decoration*/)
{
if (!(*item)->hasChildren()) {
return false;
@@ -1735,7 +1735,7 @@ example. You may note that this only does its work when the doubly-nested
child is the first or last. The other cases are called 'style inversion'
below, and I'm not yet convinced that the result of that operation will be
tidier in all cases. */
-static bool tidy_operator_redundant_double_nesting(SPObject **item, bool has_text_decoration)
+static bool tidy_operator_redundant_double_nesting(SPObject **item, bool /*has_text_decoration*/)
{
if (!(*item)->hasChildren()) return false;
if ((*item)->firstChild() == (*item)->lastChild()) return false; // this is excessive nesting, done above
@@ -1796,7 +1796,7 @@ static bool redundant_semi_nesting_processor(SPObject **item, SPObject *child, b
-> <font b>abc</font><font>def</font>
test this by applying a colour to a region, then a different colour to
a partially-overlapping region. */
-static bool tidy_operator_redundant_semi_nesting(SPObject **item, bool has_text_decoration)
+static bool tidy_operator_redundant_semi_nesting(SPObject **item, bool /*has_text_decoration*/)
{
if (!(*item)->hasChildren()) return false;
if ((*item)->firstChild() == (*item)->lastChild()) return false; // this is redundant nesting, done above
diff --git a/src/trace/siox.cpp b/src/trace/siox.cpp
index 8c9130412..92992d440 100644
--- a/src/trace/siox.cpp
+++ b/src/trace/siox.cpp
@@ -888,7 +888,7 @@ SioxImage Siox::extractForeground(const SioxImage &originalImage,
return workImage;
}
- trace("knownBg:%zu knownFg:%zu", knownBg.size(), knownFg.size());
+ trace("knownBg:%u knownFg:%u", knownBg.size(), knownFg.size());
std::vector<CieLab> bgSignature ;
diff --git a/src/ui/dialog/document-properties.cpp b/src/ui/dialog/document-properties.cpp
index 79fb953ac..32f23d55f 100644
--- a/src/ui/dialog/document-properties.cpp
+++ b/src/ui/dialog/document-properties.cpp
@@ -1677,11 +1677,31 @@ void DocumentProperties::onDocUnitChange()
}
// Scale and translate objects
- gdouble scale = Inkscape::Util::Quantity::convert(1, old_doc_unit, doc_unit);
- ShapeEditor::blockSetItem(true);
- doc->getRoot()->scaleChildItemsRec(Geom::Scale(scale), Geom::Point(0, doc->getHeight().value("px")));
- ShapeEditor::blockSetItem(false);
-
+ // set transform options to scale all things with the transform, so all things scale properly after the viewbox change.
+ /// \todo this "low-level" code of changing viewbox/unit should be moved somewhere else
+
+ // save prefs
+ Inkscape::Preferences *prefs = Inkscape::Preferences::get();
+ bool transform_stroke = prefs->getBool("/options/transform/stroke", true);
+ bool transform_rectcorners = prefs->getBool("/options/transform/rectcorners", true);
+ bool transform_pattern = prefs->getBool("/options/transform/pattern", true);
+ bool transform_gradient = prefs->getBool("/options/transform/gradient", true);
+
+ prefs->setBool("/options/transform/stroke", true);
+ prefs->setBool("/options/transform/rectcorners", true);
+ prefs->setBool("/options/transform/pattern", true);
+ prefs->setBool("/options/transform/gradient", true);
+ {
+ ShapeEditor::blockSetItem(true);
+ gdouble scale = Inkscape::Util::Quantity::convert(1, old_doc_unit, doc_unit);
+ doc->getRoot()->scaleChildItemsRec(Geom::Scale(scale), Geom::Point(0, doc->getHeight().value("px")));
+ ShapeEditor::blockSetItem(false);
+ }
+ prefs->setBool("/options/transform/stroke", transform_stroke);
+ prefs->setBool("/options/transform/rectcorners", transform_rectcorners);
+ prefs->setBool("/options/transform/pattern", transform_pattern);
+ prefs->setBool("/options/transform/gradient", transform_gradient);
+
doc->setModifiedSinceSave();
DocumentUndo::done(doc, SP_VERB_NONE, _("Changed document unit"));
diff --git a/src/ui/dialog/filter-effects-dialog.cpp b/src/ui/dialog/filter-effects-dialog.cpp
index 4ce2eafd1..38e05a1c7 100644
--- a/src/ui/dialog/filter-effects-dialog.cpp
+++ b/src/ui/dialog/filter-effects-dialog.cpp
@@ -1307,7 +1307,7 @@ void FilterEffectsDialog::FilterModifier::on_name_edited(const Glib::ustring& pa
}
}
-void FilterEffectsDialog::FilterModifier::on_filter_reorder(const Gtk::TreeModel::Path& path) {
+void FilterEffectsDialog::FilterModifier::on_filter_reorder(const Gtk::TreeModel::Path& /*path*/) {
for(Gtk::TreeModel::iterator i = _model->children().begin(); i != _model->children().end(); ++i) {
SPObject* object = (*i)[_columns.filter];
if(object && object->getRepr())
diff --git a/src/util/units.cpp b/src/util/units.cpp
index 1023cfb6e..40cce028d 100644
--- a/src/util/units.cpp
+++ b/src/util/units.cpp
@@ -362,16 +362,17 @@ bool UnitTable::load(std::string const &filename) {
return true;
}
+/*
bool UnitTable::save(std::string const &filename) {
-
g_warning("UnitTable::save(): not implemented");
- return true;
+ return false;
}
+*/
Inkscape::Util::UnitTable unit_table;
-void UnitParser::on_start_element(Ctx &ctx, Glib::ustring const &name, AttrMap const &attrs)
+void UnitParser::on_start_element(Ctx &/*ctx*/, Glib::ustring const &name, AttrMap const &attrs)
{
if (name == "unit") {
// reset for next use
@@ -413,7 +414,7 @@ void UnitParser::on_text(Ctx &ctx, Glib::ustring const &text)
}
}
-void UnitParser::on_end_element(Ctx &ctx, Glib::ustring const &name)
+void UnitParser::on_end_element(Ctx &/*ctx*/, Glib::ustring const &name)
{
if (name == "unit" && !skip) {
tbl->addUnit(unit, primary);
@@ -463,7 +464,7 @@ double Quantity::value(char const *u) const
}
Glib::ustring Quantity::string(Unit const *u) const {
- return Glib::ustring::format(std::fixed, std::setprecision(2), value(u)) + " " + unit->abbr;
+ return Glib::ustring::format(std::fixed, std::setprecision(2), value(u)) + " " + u->abbr;
}
Glib::ustring Quantity::string(Glib::ustring const &u) const {
return string(unit_table.getUnit(u.c_str()));
diff --git a/src/util/units.h b/src/util/units.h
index e1addaa24..597371369 100644
--- a/src/util/units.h
+++ b/src/util/units.h
@@ -168,8 +168,8 @@ public:
*/
bool load(std::string const &filename);
- /** Saves the current UnitTable to the given file. */
- bool save(std::string const &filename);
+ /* * Saves the current UnitTable to the given file. */
+ //bool save(std::string const &filename);
protected:
UnitCodeMap _unit_map;
diff --git a/src/winmain.cpp b/src/winmain.cpp
index 752ab8e6b..607660740 100644
--- a/src/winmain.cpp
+++ b/src/winmain.cpp
@@ -25,10 +25,10 @@ extern int main (int argc, char **argv);
#endif
int _stdcall
-WinMain (struct HINSTANCE__ *hInstance,
- struct HINSTANCE__ *hPrevInstance,
- char *lpszCmdLine,
- int nCmdShow)
+WinMain (struct HINSTANCE__ */*hInstance*/,
+ struct HINSTANCE__ */*hPrevInstance*/,
+ char */*lpszCmdLine*/,
+ int /*nCmdShow*/)
{
if (fileno (stdout) != -1 &&
_get_osfhandle (fileno (stdout)) != -1)