summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorShlomi Fish <shlomif@shlomifish.org>2016-10-01 14:27:14 +0000
committerShlomi Fish <shlomif@shlomifish.org>2016-10-01 14:27:14 +0000
commit13586717311b38bcddfa82602aa39c73e332dc87 (patch)
treec1b2db040ec9d0578e7a8472ece946c30924b8bf /src
parentExtract a function to prevent assignment + const-ing. (diff)
downloadinkscape-13586717311b38bcddfa82602aa39c73e332dc87.tar.gz
inkscape-13586717311b38bcddfa82602aa39c73e332dc87.zip
Extract a method instead of assigning a temp bool var.
(bzr r15100.1.27)
Diffstat (limited to 'src')
-rw-r--r--src/widgets/stroke-style.cpp12
-rw-r--r--src/widgets/stroke-style.h1
2 files changed, 8 insertions, 5 deletions
diff --git a/src/widgets/stroke-style.cpp b/src/widgets/stroke-style.cpp
index f5735190f..47131dec1 100644
--- a/src/widgets/stroke-style.cpp
+++ b/src/widgets/stroke-style.cpp
@@ -437,6 +437,12 @@ StrokeStyle::makeRadioButton(Gtk::RadioButtonGroup &grp,
return tb;
}
+bool StrokeStyle::shouldMarkersBeUpdated()
+{
+ return startMarkerCombo->update() || midMarkerCombo->update() ||
+ endMarkerCombo->update();
+}
+
/**
* Handles when user selects one of the markers from the marker combobox.
* Gets the marker uri string and applies it to all selected
@@ -444,11 +450,7 @@ StrokeStyle::makeRadioButton(Gtk::RadioButtonGroup &grp,
*/
void StrokeStyle::markerSelectCB(MarkerComboBox *marker_combo, StrokeStyle *spw, SPMarkerLoc const /*which*/)
{
- bool markers_update = spw->startMarkerCombo->update() ||
- spw->midMarkerCombo->update() ||
- spw->endMarkerCombo->update();
-
- if (spw->update || markers_update) {
+ if (spw->update || spw->shouldMarkersBeUpdated()) {
return;
}
diff --git a/src/widgets/stroke-style.h b/src/widgets/stroke-style.h
index 76582602d..2d7e187a1 100644
--- a/src/widgets/stroke-style.h
+++ b/src/widgets/stroke-style.h
@@ -177,6 +177,7 @@ private:
void miterLimitChangedCB();
void lineDashChangedCB();
void unitChangedCB();
+ bool shouldMarkersBeUpdated();
static void markerSelectCB(MarkerComboBox *marker_combo, StrokeStyle *spw, SPMarkerLoc const which);
static void buttonToggledCB(StrokeStyleButton *tb, StrokeStyle *spw);