summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTavmjong Bah <tavmjong@free.fr>2014-12-25 19:30:29 +0000
committertavmjong-free <tavmjong@free.fr>2014-12-25 19:30:29 +0000
commit05f2f043bdbadefa4ea435981e1a728420d6b93c (patch)
tree134097c69539d87e64940ab1a86642daac555281
parentRemove sp_style_merge_from_parent() and sp_style_merge_from_dying_parent(). (diff)
downloadinkscape-05f2f043bdbadefa4ea435981e1a728420d6b93c.tar.gz
inkscape-05f2f043bdbadefa4ea435981e1a728420d6b93c.zip
Remove sp_style_new().
(bzr r13822.1.6)
-rw-r--r--src/gradient-chemistry.cpp3
-rw-r--r--src/selection-chemistry.cpp9
-rw-r--r--src/sp-object.cpp2
-rw-r--r--src/sp-stop.cpp6
-rw-r--r--src/style.cpp18
-rw-r--r--src/style.h2
-rw-r--r--src/ui/dialog/glyphs.cpp9
-rw-r--r--src/ui/dialog/swatches.cpp24
-rw-r--r--src/ui/widget/object-composite-settings.cpp16
-rw-r--r--src/ui/widget/selected-style.cpp26
-rw-r--r--src/widgets/fill-style.cpp23
-rw-r--r--src/widgets/stroke-style.cpp24
12 files changed, 66 insertions, 96 deletions
diff --git a/src/gradient-chemistry.cpp b/src/gradient-chemistry.cpp
index 0701a9d49..cf75f6cf0 100644
--- a/src/gradient-chemistry.cpp
+++ b/src/gradient-chemistry.cpp
@@ -868,9 +868,8 @@ void sp_item_gradient_stop_set_style(SPItem *item, GrPointType point_type, guint
gchar const* color_str = sp_repr_css_property( stop, "stop-color", NULL );
if( color_str ) {
SPColor color( 0 );
- SPStyle* style = sp_style_new(0);
SPIPaint paint;
- paint.read( color_str, *style );
+ paint.read( color_str );
if( paint.isColor() ) {
color = paint.value.color;
}
diff --git a/src/selection-chemistry.cpp b/src/selection-chemistry.cpp
index 98ebd1f61..c9837aabe 100644
--- a/src/selection-chemistry.cpp
+++ b/src/selection-chemistry.cpp
@@ -2110,7 +2110,7 @@ GSList *sp_get_same_stroke_style(SPItem *sel, GSList *src, SPSelectStrokeStyleTy
SPStyle *sel_style_for_width = NULL;
if (type == SP_STROKE_STYLE_WIDTH) {
objects = g_slist_prepend(objects, sel);
- sel_style_for_width = sp_style_new (SP_ACTIVE_DOCUMENT);
+ sel_style_for_width = new SPStyle(SP_ACTIVE_DOCUMENT);
objects_query_strokewidth (objects, sel_style_for_width);
}
@@ -2125,11 +2125,11 @@ GSList *sp_get_same_stroke_style(SPItem *sel, GSList *src, SPSelectStrokeStyleTy
if (sel_style->stroke_width.set && iter_style->stroke_width.set) {
GSList *objects = NULL;
objects = g_slist_prepend(objects, iter);
- SPStyle *iter_style_for_width = sp_style_new (SP_ACTIVE_DOCUMENT);
- objects_query_strokewidth (objects, iter_style_for_width);
+ SPStyle tmp_style(SP_ACTIVE_DOCUMENT);
+ objects_query_strokewidth (objects, &tmp_style);
if (sel_style_for_width) {
- match = (sel_style_for_width->stroke_width.computed == iter_style_for_width->stroke_width.computed);
+ match = (sel_style_for_width->stroke_width.computed == tmp_style.stroke_width.computed);
}
g_slist_free(objects);
}
@@ -2161,6 +2161,7 @@ GSList *sp_get_same_stroke_style(SPItem *sel, GSList *src, SPSelectStrokeStyleTy
}
}
+ if( sel_style_for_width != NULL ) delete sel_style_for_width;
g_slist_free(objects);
return matches;
diff --git a/src/sp-object.cpp b/src/sp-object.cpp
index af8855562..4f213f943 100644
--- a/src/sp-object.cpp
+++ b/src/sp-object.cpp
@@ -145,6 +145,8 @@ SPObject::~SPObject() {
sp_object_unref(this->_successor, NULL);
this->_successor = NULL;
}
+
+ delete this->style;
}
// CPPIFY: make pure virtual
diff --git a/src/sp-stop.cpp b/src/sp-stop.cpp
index d644a9b4b..3ee467322 100644
--- a/src/sp-stop.cpp
+++ b/src/sp-stop.cpp
@@ -210,16 +210,14 @@ SPStop* SPStop::getPrevStop() {
SPColor SPStop::readStopColor(Glib::ustring const &styleStr, guint32 dfl) {
SPColor color(dfl);
- SPStyle* style = sp_style_new(0);
SPIPaint paint;
- paint.read( styleStr.c_str(), *style );
+
+ paint.read( styleStr.c_str() );
if ( paint.isColor() ) {
color = paint.value.color;
}
- sp_style_unref(style);
-
return color;
}
diff --git a/src/style.cpp b/src/style.cpp
index 739c7bdb5..1d08db4f8 100644
--- a/src/style.cpp
+++ b/src/style.cpp
@@ -1228,21 +1228,6 @@ sp_style_stroke_paint_server_ref_changed(SPObject *old_ref, SPObject *ref, SPSty
sp_style_paint_server_ref_modified(ref, 0, style);
}
-// Called in: desktop-style.cpp, gradient-chemistry.cpp, sp-object.cpp, sp-stop.cpp, style.cpp
-// text-editing.cpp, libnrtype/font-lister.cpp, widgets/dash-selector.cpp, widgets/fill-style.cpp,
-// widgets/stroke-style.cpp, widgets/text-toolbar.cpp, ui/dialog/glyphs.cpp, ui/dialog/swatches.cpp,
-// ui/dialog/swatches.cpp, ui/dialog/text-edit.cpp. ui/tools/freehand-base.cpp,
-// ui/widget/object-composite-settings.cpp, ui/widget/selected-style.cpp, ui/widget/style-swatch.cpp
-/**
- * Returns a new SPStyle object with default settings.
- */
-SPStyle *
-sp_style_new(SPDocument *document)
-{
- SPStyle *const style = new SPStyle( document );
- return style;
-}
-
// Called in display/drawing-item.cpp, display/nr-filter-primitive.cpp, libnrtype/Layout-TNG-Input.cpp
/**
* Increase refcount of style.
@@ -1257,8 +1242,7 @@ sp_style_ref(SPStyle *style)
return style;
}
-// Called in style.cpp, desktop-style.cpp, sp-object.cpp, sp-stop.cpp, text-editing.cpp
-// display/drawing-group.cpp, ...
+// Called in display/drawing-item.cpp, display/nr-filter-primitive.cpp, libnrtype/Layout-TNG-Input.cpp
/**
* Decrease refcount of style with possible destruction.
*/
diff --git a/src/style.h b/src/style.h
index c987a084a..9d3f0716a 100644
--- a/src/style.h
+++ b/src/style.h
@@ -282,8 +282,6 @@ public:
char const *getStrokeURI() const { return (stroke.value.href) ? stroke.value.href->getURI()->toString() : NULL; }
};
-SPStyle *sp_style_new(SPDocument *document); // SPStyle::SPStyle( SPDocument *document = NULL );
-
SPStyle *sp_style_ref(SPStyle *style); // SPStyle::ref();
SPStyle *sp_style_unref(SPStyle *style); // SPStyle::unref();
diff --git a/src/ui/dialog/glyphs.cpp b/src/ui/dialog/glyphs.cpp
index 9bad90e7c..2b9053da9 100644
--- a/src/ui/dialog/glyphs.cpp
+++ b/src/ui/dialog/glyphs.cpp
@@ -709,13 +709,12 @@ void GlyphsPanel::readSelection( bool updateStyle, bool /*updateContent*/ )
calcCanInsert();
if (targetDesktop && updateStyle) {
- //SPStyle *query = sp_style_new(SP_ACTIVE_DOCUMENT);
+ //SPStyle query(SP_ACTIVE_DOCUMENT);
- //int result_family = sp_desktop_query_style(targetDesktop, query, QUERY_STYLE_PROPERTY_FONTFAMILY);
- //int result_style = sp_desktop_query_style(targetDesktop, query, QUERY_STYLE_PROPERTY_FONTSTYLE);
- //int result_numbers = sp_desktop_query_style(targetDesktop, query, QUERY_STYLE_PROPERTY_FONTNUMBERS);
+ //int result_family = sp_desktop_query_style(targetDesktop, &query, QUERY_STYLE_PROPERTY_FONTFAMILY);
+ //int result_style = sp_desktop_query_style(targetDesktop, &query, QUERY_STYLE_PROPERTY_FONTSTYLE);
+ //int result_numbers = sp_desktop_query_style(targetDesktop, &query, QUERY_STYLE_PROPERTY_FONTNUMBERS);
- //sp_style_unref(query);
}
}
diff --git a/src/ui/dialog/swatches.cpp b/src/ui/dialog/swatches.cpp
index 772217fcd..8759039c3 100644
--- a/src/ui/dialog/swatches.cpp
+++ b/src/ui/dialog/swatches.cpp
@@ -125,12 +125,12 @@ static void editGradientImpl( SPDesktop* desktop, SPGradient* gr )
Inkscape::Selection *selection = desktop->getSelection();
GSList const *items = selection->itemList();
if (items) {
- SPStyle *query = sp_style_new( desktop->doc() );
- int result = objects_query_fillstroke(const_cast<GSList *>(items), query, true);
+ SPStyle query( desktop->doc() );
+ int result = objects_query_fillstroke(const_cast<GSList *>(items), &query, true);
if ( (result == QUERY_STYLE_MULTIPLE_SAME) || (result == QUERY_STYLE_SINGLE) ) {
// could be pertinent
- if (query->fill.isPaintserver()) {
- SPPaintServer* server = query->getFillPaintServer();
+ if (query.fill.isPaintserver()) {
+ SPPaintServer* server = query.getFillPaintServer();
if ( SP_IS_GRADIENT(server) ) {
SPGradient* grad = SP_GRADIENT(server);
if ( grad->isSwatch() && grad->getId() == gr->getId()) {
@@ -140,7 +140,6 @@ static void editGradientImpl( SPDesktop* desktop, SPGradient* gr )
}
}
}
- sp_style_unref(query);
}
}
@@ -1061,15 +1060,15 @@ void SwatchesPanel::_updateFromSelection()
Glib::ustring fillId;
Glib::ustring strokeId;
- SPStyle *tmpStyle = sp_style_new(_currentDesktop->getDocument());
- int result = sp_desktop_query_style( _currentDesktop, tmpStyle, QUERY_STYLE_PROPERTY_FILL );
+ SPStyle tmpStyle(_currentDesktop->getDocument());
+ int result = sp_desktop_query_style( _currentDesktop, &tmpStyle, QUERY_STYLE_PROPERTY_FILL );
switch (result) {
case QUERY_STYLE_SINGLE:
case QUERY_STYLE_MULTIPLE_AVERAGED:
case QUERY_STYLE_MULTIPLE_SAME:
{
- if (tmpStyle->fill.set && tmpStyle->fill.isPaintserver()) {
- SPPaintServer* server = tmpStyle->getFillPaintServer();
+ if (tmpStyle.fill.set && tmpStyle.fill.isPaintserver()) {
+ SPPaintServer* server = tmpStyle.getFillPaintServer();
if ( SP_IS_GRADIENT(server) ) {
SPGradient* target = 0;
SPGradient* grad = SP_GRADIENT(server);
@@ -1095,14 +1094,14 @@ void SwatchesPanel::_updateFromSelection()
}
}
- result = sp_desktop_query_style( _currentDesktop, tmpStyle, QUERY_STYLE_PROPERTY_STROKE );
+ result = sp_desktop_query_style( _currentDesktop, &tmpStyle, QUERY_STYLE_PROPERTY_STROKE );
switch (result) {
case QUERY_STYLE_SINGLE:
case QUERY_STYLE_MULTIPLE_AVERAGED:
case QUERY_STYLE_MULTIPLE_SAME:
{
- if (tmpStyle->stroke.set && tmpStyle->stroke.isPaintserver()) {
- SPPaintServer* server = tmpStyle->getStrokePaintServer();
+ if (tmpStyle.stroke.set && tmpStyle.stroke.isPaintserver()) {
+ SPPaintServer* server = tmpStyle.getStrokePaintServer();
if ( SP_IS_GRADIENT(server) ) {
SPGradient* target = 0;
SPGradient* grad = SP_GRADIENT(server);
@@ -1126,7 +1125,6 @@ void SwatchesPanel::_updateFromSelection()
break;
}
}
- sp_style_unref(tmpStyle);
for ( boost::ptr_vector<ColorItem>::iterator it = docPalette->_colors.begin(); it != docPalette->_colors.end(); ++it ) {
ColorItem* item = &*it;
diff --git a/src/ui/widget/object-composite-settings.cpp b/src/ui/widget/object-composite-settings.cpp
index 7439a402c..00a74c4fe 100644
--- a/src/ui/widget/object-composite-settings.cpp
+++ b/src/ui/widget/object-composite-settings.cpp
@@ -219,8 +219,8 @@ ObjectCompositeSettings::_subjectChanged() {
return;
_blocked = true;
- SPStyle *query = sp_style_new (desktop->getDocument());
- int result = _subject->queryStyle(query, QUERY_STYLE_PROPERTY_MASTEROPACITY);
+ SPStyle query(desktop->getDocument());
+ int result = _subject->queryStyle(&query, QUERY_STYLE_PROPERTY_MASTEROPACITY);
switch (result) {
case QUERY_STYLE_NOTHING:
@@ -231,19 +231,19 @@ ObjectCompositeSettings::_subjectChanged() {
case QUERY_STYLE_MULTIPLE_AVERAGED: // TODO: treat this slightly differently
case QUERY_STYLE_MULTIPLE_SAME:
_opacity_vbox.set_sensitive(true);
- _opacity_scale.get_adjustment()->set_value(100 * SP_SCALE24_TO_FLOAT(query->opacity.value));
+ _opacity_scale.get_adjustment()->set_value(100 * SP_SCALE24_TO_FLOAT(query.opacity.value));
break;
}
//query now for current filter mode and average blurring of selection
- const int blend_result = _subject->queryStyle(query, QUERY_STYLE_PROPERTY_BLEND);
+ const int blend_result = _subject->queryStyle(&query, QUERY_STYLE_PROPERTY_BLEND);
switch(blend_result) {
case QUERY_STYLE_NOTHING:
_fe_cb.set_sensitive(false);
break;
case QUERY_STYLE_SINGLE:
case QUERY_STYLE_MULTIPLE_SAME:
- _fe_cb.set_blend_mode(query->filter_blend_mode.value);
+ _fe_cb.set_blend_mode(query.filter_blend_mode.value);
_fe_cb.set_sensitive(true);
break;
case QUERY_STYLE_MULTIPLE_DIFFERENT:
@@ -253,7 +253,7 @@ ObjectCompositeSettings::_subjectChanged() {
}
if(blend_result == QUERY_STYLE_SINGLE || blend_result == QUERY_STYLE_MULTIPLE_SAME) {
- int blur_result = _subject->queryStyle(query, QUERY_STYLE_PROPERTY_BLUR);
+ int blur_result = _subject->queryStyle(&query, QUERY_STYLE_PROPERTY_BLUR);
switch (blur_result) {
case QUERY_STYLE_NOTHING: //no blurring
_fe_cb.set_blur_sensitive(false);
@@ -266,7 +266,7 @@ ObjectCompositeSettings::_subjectChanged() {
double perimeter = bbox->dimensions()[Geom::X] + bbox->dimensions()[Geom::Y]; // fixme: this is only half the perimeter, is that correct?
_fe_cb.set_blur_sensitive(true);
//update blur widget value
- float radius = query->filter_gaussianBlur_deviation.value;
+ float radius = query.filter_gaussianBlur_deviation.value;
float percent = radius * 400 / perimeter; // so that for a square, 100% == half side
_fe_cb.set_blur_value(percent);
}
@@ -274,8 +274,6 @@ ObjectCompositeSettings::_subjectChanged() {
}
}
- sp_style_unref(query);
-
_blocked = false;
}
diff --git a/src/ui/widget/selected-style.cpp b/src/ui/widget/selected-style.cpp
index 93b4893f2..1fc67dcef 100644
--- a/src/ui/widget/selected-style.cpp
+++ b/src/ui/widget/selected-style.cpp
@@ -977,7 +977,7 @@ SelectedStyle::update()
return;
// create temporary style
- SPStyle *query = sp_style_new (_desktop->getDocument());
+ SPStyle query(_desktop->getDocument());
for (int i = SS_FILL; i <= SS_STROKE; i++) {
Gtk::EventBox *place = (i == SS_FILL)? &_fill_place : &_stroke_place;
@@ -995,7 +995,7 @@ SelectedStyle::update()
_popup_copy[i].set_sensitive(false);
// query style from desktop. This returns a result flag and fills query with the style of subselection, if any, or selection
- int result = sp_desktop_query_style (_desktop, query,
+ int result = sp_desktop_query_style (_desktop, &query,
(i == SS_FILL)? QUERY_STYLE_PROPERTY_FILL : QUERY_STYLE_PROPERTY_STROKE);
switch (result) {
case QUERY_STYLE_NOTHING:
@@ -1020,12 +1020,12 @@ SelectedStyle::update()
}
SPIPaint *paint;
if (i == SS_FILL) {
- paint = &(query->fill);
+ paint = &(query.fill);
} else {
- paint = &(query->stroke);
+ paint = &(query.stroke);
}
if (paint->set && paint->isPaintserver()) {
- SPPaintServer *server = (i == SS_FILL)? SP_STYLE_FILL_SERVER (query) : SP_STYLE_STROKE_SERVER (query);
+ SPPaintServer *server = (i == SS_FILL)? SP_STYLE_FILL_SERVER (&query) : SP_STYLE_STROKE_SERVER (&query);
if ( server ) {
Inkscape::XML::Node *srepr = server->getRepr();
_paintserver_id[i] += "url(#";
@@ -1062,7 +1062,7 @@ SelectedStyle::update()
}
} else if (paint->set && paint->isColor()) {
guint32 color = paint->value.color.toRGBA32(
- SP_SCALE24_TO_FLOAT ((i == SS_FILL)? query->fill_opacity.value : query->stroke_opacity.value));
+ SP_SCALE24_TO_FLOAT ((i == SS_FILL)? query.fill_opacity.value : query.stroke_opacity.value));
_lastselected[i] = _thisselected[i];
_thisselected[i] = color; // include opacity
((Inkscape::UI::Widget::ColorPreview*)_color_preview[i])->setRgba32 (color);
@@ -1105,7 +1105,7 @@ SelectedStyle::update()
clearTooltip(_opacity_place);
clearTooltip(_opacity_sb);
- int result = sp_desktop_query_style (_desktop, query, QUERY_STYLE_PROPERTY_MASTEROPACITY);
+ int result = sp_desktop_query_style (_desktop, &query, QUERY_STYLE_PROPERTY_MASTEROPACITY);
switch (result) {
case QUERY_STYLE_NOTHING:
@@ -1122,16 +1122,16 @@ SelectedStyle::update()
_opacity_blocked = true;
_opacity_sb.set_sensitive(true);
#if WITH_GTKMM_3_0
- _opacity_adjustment->set_value(SP_SCALE24_TO_FLOAT(query->opacity.value) * 100);
+ _opacity_adjustment->set_value(SP_SCALE24_TO_FLOAT(query.opacity.value) * 100);
#else
- _opacity_adjustment.set_value(SP_SCALE24_TO_FLOAT(query->opacity.value) * 100);
+ _opacity_adjustment.set_value(SP_SCALE24_TO_FLOAT(query.opacity.value) * 100);
#endif
_opacity_blocked = false;
break;
}
// Now query stroke_width
- int result_sw = sp_desktop_query_style (_desktop, query, QUERY_STYLE_PROPERTY_STROKEWIDTH);
+ int result_sw = sp_desktop_query_style (_desktop, &query, QUERY_STYLE_PROPERTY_STROKEWIDTH);
switch (result_sw) {
case QUERY_STYLE_NOTHING:
_stroke_width.set_markup("");
@@ -1143,9 +1143,9 @@ SelectedStyle::update()
{
double w;
if (_sw_unit) {
- w = Inkscape::Util::Quantity::convert(query->stroke_width.computed, "px", _sw_unit);
+ w = Inkscape::Util::Quantity::convert(query.stroke_width.computed, "px", _sw_unit);
} else {
- w = query->stroke_width.computed;
+ w = query.stroke_width.computed;
}
current_stroke_width = w;
@@ -1168,8 +1168,6 @@ SelectedStyle::update()
default:
break;
}
-
- sp_style_unref(query);
}
void SelectedStyle::opacity_0(void) {_opacity_sb.set_value(0);}
diff --git a/src/widgets/fill-style.cpp b/src/widgets/fill-style.cpp
index fcdc9a36b..d60a92b8b 100644
--- a/src/widgets/fill-style.cpp
+++ b/src/widgets/fill-style.cpp
@@ -252,13 +252,13 @@ void FillNStroke::performUpdate()
update = true;
// create temporary style
- SPStyle *query = sp_style_new(desktop->doc());
+ SPStyle query(desktop->doc());
// query style from desktop into it. This returns a result flag and fills query with the style of subselection, if any, or selection
- int result = sp_desktop_query_style(desktop, query, (kind == FILL) ? QUERY_STYLE_PROPERTY_FILL : QUERY_STYLE_PROPERTY_STROKE);
+ int result = sp_desktop_query_style(desktop, &query, (kind == FILL) ? QUERY_STYLE_PROPERTY_FILL : QUERY_STYLE_PROPERTY_STROKE);
- SPIPaint &targPaint = (kind == FILL) ? query->fill : query->stroke;
- SPIScale24 &targOpacity = (kind == FILL) ? query->fill_opacity : query->stroke_opacity;
+ SPIPaint &targPaint = (kind == FILL) ? query.fill : query.stroke;
+ SPIScale24 &targOpacity = (kind == FILL) ? query.fill_opacity : query.stroke_opacity;
switch (result) {
case QUERY_STYLE_NOTHING:
@@ -272,11 +272,11 @@ void FillNStroke::performUpdate()
case QUERY_STYLE_MULTIPLE_AVERAGED: // TODO: treat this slightly differently, e.g. display "averaged" somewhere in paint selector
case QUERY_STYLE_MULTIPLE_SAME:
{
- SPPaintSelector::Mode pselmode = SPPaintSelector::getModeForStyle(*query, kind);
+ SPPaintSelector::Mode pselmode = SPPaintSelector::getModeForStyle(query, kind);
psel->setMode(pselmode);
if (kind == FILL) {
- psel->setFillrule(query->fill_rule.computed == ART_WIND_RULE_NONZERO?
+ psel->setFillrule(query.fill_rule.computed == ART_WIND_RULE_NONZERO?
SPPaintSelector::FILLRULE_NONZERO : SPPaintSelector::FILLRULE_EVENODD);
}
@@ -284,7 +284,7 @@ void FillNStroke::performUpdate()
psel->setColorAlpha(targPaint.value.color, SP_SCALE24_TO_FLOAT(targOpacity.value));
} else if (targPaint.set && targPaint.isPaintserver()) {
- SPPaintServer *server = (kind == FILL) ? query->getFillPaintServer() : query->getStrokePaintServer();
+ SPPaintServer *server = (kind == FILL) ? query.getFillPaintServer() : query.getStrokePaintServer();
if (server && SP_IS_GRADIENT(server) && SP_GRADIENT(server)->getVector()->isSwatch()) {
SPGradient *vector = SP_GRADIENT(server)->getVector();
@@ -318,8 +318,6 @@ void FillNStroke::performUpdate()
}
}
- sp_style_unref(query);
-
update = false;
}
@@ -562,10 +560,10 @@ void FillNStroke::updateFromPaint()
if (!vector) {
/* No vector in paint selector should mean that we just changed mode */
- SPStyle *query = sp_style_new(desktop->doc());
- int result = objects_query_fillstroke(const_cast<GSList *>(items), query, kind == FILL);
+ SPStyle query(desktop->doc());
+ int result = objects_query_fillstroke(const_cast<GSList *>(items), &query, kind == FILL);
if (result == QUERY_STYLE_MULTIPLE_SAME) {
- SPIPaint &targPaint = (kind == FILL) ? query->fill : query->stroke;
+ SPIPaint &targPaint = (kind == FILL) ? query.fill : query.stroke;
SPColor common;
if (!targPaint.isColor()) {
common = sp_desktop_get_color(desktop, kind == FILL);
@@ -577,7 +575,6 @@ void FillNStroke::updateFromPaint()
vector->setSwatch();
}
}
- sp_style_unref(query);
for (GSList const *i = items; i != NULL; i = i->next) {
//FIXME: see above
diff --git a/src/widgets/stroke-style.cpp b/src/widgets/stroke-style.cpp
index 755489e12..5ca06a795 100644
--- a/src/widgets/stroke-style.cpp
+++ b/src/widgets/stroke-style.cpp
@@ -815,13 +815,13 @@ StrokeStyle::updateLine()
FillOrStroke kind = GPOINTER_TO_INT(get_data("kind")) ? FILL : STROKE;
// create temporary style
- SPStyle *query = sp_style_new (SP_ACTIVE_DOCUMENT);
+ SPStyle query(SP_ACTIVE_DOCUMENT);
// query into it
- int result_sw = sp_desktop_query_style (SP_ACTIVE_DESKTOP, query, QUERY_STYLE_PROPERTY_STROKEWIDTH);
- int result_ml = sp_desktop_query_style (SP_ACTIVE_DESKTOP, query, QUERY_STYLE_PROPERTY_STROKEMITERLIMIT);
- int result_cap = sp_desktop_query_style (SP_ACTIVE_DESKTOP, query, QUERY_STYLE_PROPERTY_STROKECAP);
- int result_join = sp_desktop_query_style (SP_ACTIVE_DESKTOP, query, QUERY_STYLE_PROPERTY_STROKEJOIN);
- SPIPaint &targPaint = (kind == FILL) ? query->fill : query->stroke;
+ int result_sw = sp_desktop_query_style (SP_ACTIVE_DESKTOP, &query, QUERY_STYLE_PROPERTY_STROKEWIDTH);
+ int result_ml = sp_desktop_query_style (SP_ACTIVE_DESKTOP, &query, QUERY_STYLE_PROPERTY_STROKEMITERLIMIT);
+ int result_cap = sp_desktop_query_style (SP_ACTIVE_DESKTOP, &query, QUERY_STYLE_PROPERTY_STROKECAP);
+ int result_join = sp_desktop_query_style (SP_ACTIVE_DESKTOP, &query, QUERY_STYLE_PROPERTY_STROKEJOIN);
+ SPIPaint &targPaint = (kind == FILL) ? query.fill : query.stroke;
if (!sel || sel->isEmpty()) {
// Nothing selected, grey-out all controls in the stroke-style dialog
@@ -846,7 +846,7 @@ StrokeStyle::updateLine()
Inkscape::Util::Unit const *unit = unitSelector->getUnit();
if (unit->type == Inkscape::Util::UNIT_TYPE_LINEAR) {
- double avgwidth = Inkscape::Util::Quantity::convert(query->stroke_width.computed, "px", unit);
+ double avgwidth = Inkscape::Util::Quantity::convert(query.stroke_width.computed, "px", unit);
#if WITH_GTKMM_3_0
(*widthAdj)->set_value(avgwidth);
#else
@@ -879,27 +879,25 @@ StrokeStyle::updateLine()
if (result_ml != QUERY_STYLE_NOTHING)
#if WITH_GTKMM_3_0
- (*miterLimitAdj)->set_value(query->stroke_miterlimit.value); // TODO: reflect averagedness?
+ (*miterLimitAdj)->set_value(query.stroke_miterlimit.value); // TODO: reflect averagedness?
#else
- miterLimitAdj->set_value(query->stroke_miterlimit.value); // TODO: reflect averagedness?
+ miterLimitAdj->set_value(query.stroke_miterlimit.value); // TODO: reflect averagedness?
#endif
if (result_join != QUERY_STYLE_MULTIPLE_DIFFERENT &&
result_join != QUERY_STYLE_NOTHING ) {
- setJoinType(query->stroke_linejoin.value);
+ setJoinType(query.stroke_linejoin.value);
} else {
setJoinButtons(NULL);
}
if (result_cap != QUERY_STYLE_MULTIPLE_DIFFERENT &&
result_cap != QUERY_STYLE_NOTHING ) {
- setCapType (query->stroke_linecap.value);
+ setCapType (query.stroke_linecap.value);
} else {
setCapButtons(NULL);
}
- sp_style_unref(query);
-
if (!sel || sel->isEmpty())
return;