summaryrefslogtreecommitdiffstats
path: root/src/widgets/gradient-toolbar.cpp
diff options
context:
space:
mode:
authorJabier Arraiza Cenoz <jabier.arraiza@marker.es>2015-03-18 18:07:14 +0000
committerJabiertxof <jtx@jtx.marker.es>2015-03-18 18:07:14 +0000
commite77956b4dbd029c9f6949f81fe083606f995c624 (patch)
tree74adda4df8986d65f70efb341c6235277361fd35 /src/widgets/gradient-toolbar.cpp
parentupdated code to work on 0.92 code (diff)
parentLatvian translation update (diff)
downloadinkscape-e77956b4dbd029c9f6949f81fe083606f995c624.tar.gz
inkscape-e77956b4dbd029c9f6949f81fe083606f995c624.zip
update to trunk
(bzr r12588.1.39)
Diffstat (limited to 'src/widgets/gradient-toolbar.cpp')
-rw-r--r--src/widgets/gradient-toolbar.cpp31
1 files changed, 17 insertions, 14 deletions
diff --git a/src/widgets/gradient-toolbar.cpp b/src/widgets/gradient-toolbar.cpp
index b6378b251..7ce04403b 100644
--- a/src/widgets/gradient-toolbar.cpp
+++ b/src/widgets/gradient-toolbar.cpp
@@ -18,7 +18,7 @@
#include "ui/widget/color-preview.h"
#include <glibmm/i18n.h>
-#include "desktop-handles.h"
+
#include "desktop.h"
#include "document-undo.h"
#include "document.h"
@@ -128,7 +128,7 @@ gboolean gr_vector_list(GtkWidget *combo_box, SPDesktop *desktop, bool selection
return sensitive;
}
- SPDocument *document = sp_desktop_document(desktop);
+ SPDocument *document = desktop->getDocument();
GtkTreeIter iter;
GtkListStore *store = (GtkListStore *)gtk_combo_box_get_model(GTK_COMBO_BOX(combo_box));
@@ -167,13 +167,15 @@ gboolean gr_vector_list(GtkWidget *combo_box, SPDesktop *desktop, bool selection
if (gr_selected == NULL) {
gtk_list_store_append(store, &iter);
gtk_list_store_set(store, &iter, 0, _("No gradient"), 1, NULL, 2, NULL, -1);
- sensitive = FALSE;
+ // Dead assignment: Value stored to 'sensitive' is never read
+ //sensitive = FALSE;
}
if (gr_multi) {
gtk_list_store_append(store, &iter);
gtk_list_store_set(store, &iter, 0, _("Multiple gradients"), 1, NULL, 2, NULL, -1);
- sensitive = FALSE;
+ // Dead assignment: Value stored to 'sensitive' is never read
+ //sensitive = FALSE;
}
guint idx = 0;
@@ -356,7 +358,7 @@ static void gr_tb_selection_changed(Inkscape::Selection * /*selection*/, gpointe
return;
}
- Inkscape::Selection *selection = sp_desktop_selection(desktop); // take from desktop, not from args
+ Inkscape::Selection *selection = desktop->getSelection(); // take from desktop, not from args
if (selection) {
ToolBase *ev = desktop->getEventContext();
GrDrag *drag = NULL;
@@ -560,7 +562,7 @@ static void gr_add_stop(GtkWidget * /*button*/, GtkWidget *vb)
return;
}
- Inkscape::Selection *selection = sp_desktop_selection(desktop);
+ Inkscape::Selection *selection = desktop->getSelection();
if (!selection) {
return;
}
@@ -582,7 +584,7 @@ static void gr_remove_stop(GtkWidget * /*button*/, GtkWidget *vb)
return;
}
- Inkscape::Selection *selection = sp_desktop_selection(desktop); // take from desktop, not from args
+ Inkscape::Selection *selection = desktop->getSelection(); // take from desktop, not from args
if (!selection) {
return;
}
@@ -786,7 +788,8 @@ static gboolean update_stop_list( GtkWidget *stop_combo, SPGradient *gradient, S
gtk_list_store_append(store, &iter);
gtk_list_store_set(store, &iter, 0, label.c_str(), 1, pb, 2, stop, -1);
- sensitive = FALSE;
+ // Dead assignment: Value stored to 'sensitive' is never read
+ //sensitive = FALSE;
}
}
@@ -918,12 +921,12 @@ static void gr_gradient_combo_changed(EgeSelectOneAction *act, gpointer data)
gr = sp_gradient_ensure_vector_normalized(gr);
SPDesktop *desktop = static_cast<SPDesktop *>(data);
- Inkscape::Selection *selection = sp_desktop_selection(desktop);
+ Inkscape::Selection *selection = desktop->getSelection();
ToolBase *ev = desktop->getEventContext();
gr_apply_gradient(selection, ev? ev->get_drag() : NULL, gr);
- DocumentUndo::done(sp_desktop_document(desktop), SP_VERB_CONTEXT_GRADIENT,
+ DocumentUndo::done(desktop->getDocument(), SP_VERB_CONTEXT_GRADIENT,
_("Assign gradient to object"));
}
@@ -936,7 +939,7 @@ static void gr_spread_change(EgeSelectOneAction *act, GtkWidget *widget)
}
SPDesktop *desktop = static_cast<SPDesktop *>(g_object_get_data(G_OBJECT(widget), "desktop"));
- Inkscape::Selection *selection = sp_desktop_selection(desktop);
+ Inkscape::Selection *selection = desktop->getSelection();
SPGradient *gradient = 0;
gr_get_dt_selected_gradient(selection, gradient);
@@ -945,7 +948,7 @@ static void gr_spread_change(EgeSelectOneAction *act, GtkWidget *widget)
gradient->setSpread(spread);
gradient->updateRepr();
- DocumentUndo::done(sp_desktop_document(desktop), SP_VERB_CONTEXT_GRADIENT,
+ DocumentUndo::done(desktop->getDocument(), SP_VERB_CONTEXT_GRADIENT,
_("Set gradient repeat"));
}
}
@@ -1246,8 +1249,8 @@ static void gradient_toolbox_check_ec(SPDesktop* desktop, Inkscape::UI::Tools::T
static sigc::connection connDefsModified;
if (SP_IS_GRADIENT_CONTEXT(ec)) {
- Inkscape::Selection *selection = sp_desktop_selection(desktop);
- SPDocument *document = sp_desktop_document(desktop);
+ Inkscape::Selection *selection = desktop->getSelection();
+ SPDocument *document = desktop->getDocument();
// connect to selection modified and changed signals
connChanged = selection->connectChanged(sigc::bind(sigc::ptr_fun(&gr_tb_selection_changed), holder));