summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarc Jeanmougin <marc@jeanmougin.fr>2016-10-08 16:05:13 +0000
committerMarc Jeanmougin <marcjeanmougin@free.fr>2016-10-08 16:05:13 +0000
commit6092d5422b03608db00f18e6ad8c87465b5dc3e8 (patch)
tree2ae791c03acda4ca0bf1cc2fb309a94c39cbd058 /src
parent[Bug #770681] KEY MAPPING: Comma and period hijacked by scaling. (diff)
parentMade the style-utils.h license dual-with-GPLv2+. (diff)
downloadinkscape-6092d5422b03608db00f18e6ad8c87465b5dc3e8.tar.gz
inkscape-6092d5422b03608db00f18e6ad8c87465b5dc3e8.zip
merge trunk-refactoring
(bzr r15156)
Diffstat (limited to 'src')
-rw-r--r--src/color-profile.cpp2
-rw-r--r--src/desktop.cpp2
-rw-r--r--src/extension/internal/cairo-renderer.cpp6
-rw-r--r--src/gradient-drag.cpp7
-rw-r--r--src/inkscape.cpp2
-rw-r--r--src/livarot/Path.cpp20
-rw-r--r--src/livarot/PathOutline.cpp10
-rw-r--r--src/livarot/Shape.cpp4
-rw-r--r--src/livarot/float-line.cpp6
-rw-r--r--src/livarot/int-line.cpp2
-rw-r--r--src/live_effects/lpe-envelope.cpp8
-rw-r--r--src/sp-lpe-item.cpp6
-rw-r--r--src/style-internal.cpp4
-rw-r--r--src/ui/tools/freehand-base.cpp4
-rw-r--r--src/widgets/spray-toolbar.cpp4
-rw-r--r--src/widgets/stroke-style.cpp41
-rw-r--r--src/widgets/stroke-style.h1
-rw-r--r--src/widgets/style-utils.h45
-rw-r--r--src/widgets/text-toolbar.cpp3
19 files changed, 112 insertions, 65 deletions
diff --git a/src/color-profile.cpp b/src/color-profile.cpp
index 51b1505c5..6ebf40f2c 100644
--- a/src/color-profile.cpp
+++ b/src/color-profile.cpp
@@ -703,7 +703,7 @@ gint Inkscape::CMSSystem::getChannelCount(ColorProfile const *profile)
// sort home dir before the rest, and alphabetically oterhwise
bool compareProfileBoolPair(const std::pair<Glib::ustring, bool> & a, const std::pair<Glib::ustring, bool> & b)
{
- if (a.second != b.second) return a.second; // a comes first iff it's home, i.e., second == true
+ if (a.second != b.second) return a.second; // a comes first iff its home, i.e., second is true
return a.first < b.first;
}
diff --git a/src/desktop.cpp b/src/desktop.cpp
index 7efa3e438..89a7da9d0 100644
--- a/src/desktop.cpp
+++ b/src/desktop.cpp
@@ -902,7 +902,7 @@ void SPDesktop::zoom_quick(bool enable)
return;
}
- if (enable == true) {
+ if (enable) {
_quick_zoom_stored_area = get_display_area();
bool zoomed = false;
diff --git a/src/extension/internal/cairo-renderer.cpp b/src/extension/internal/cairo-renderer.cpp
index cd96a7f58..a2b8fb22f 100644
--- a/src/extension/internal/cairo-renderer.cpp
+++ b/src/extension/internal/cairo-renderer.cpp
@@ -541,8 +541,7 @@ static void sp_item_invoke_render(SPItem *item, CairoRenderContext *ctx)
return;
}
- SPStyle* style = item->style;
- if((ctx->getFilterToBitmap() == TRUE) && (style->filter.set != 0)) {
+ if(ctx->getFilterToBitmap() && (item->style->filter.set != 0)) {
return sp_asbitmap_render(item, ctx);
}
@@ -599,8 +598,7 @@ static void sp_item_invoke_render(SPItem *item, CairoRenderContext *ctx)
void
CairoRenderer::setStateForItem(CairoRenderContext *ctx, SPItem const *item)
{
- SPStyle const *style = item->style;
- ctx->setStateForStyle(style);
+ ctx->setStateForStyle(item->style);
CairoRenderState *state = ctx->getCurrentState();
state->clip_path = item->clip_ref->getObject();
diff --git a/src/gradient-drag.cpp b/src/gradient-drag.cpp
index eb33bdf9a..fc75054a0 100644
--- a/src/gradient-drag.cpp
+++ b/src/gradient-drag.cpp
@@ -1326,8 +1326,10 @@ GrDragger::moveMeshHandles ( Geom::Point pc_old, MeshNodeOperation op )
// We need a list of selected corners per mesh if scaling.
std::map<SPGradient*, std::vector<guint> > selected_corners;
- bool scale = false;
- if( scale == true ) {
+ // scaling was disabled so #if 0'ing out for now.
+#if 0
+ const bool scale = false;
+ if( scale ) {
for( std::set<GrDragger *>::const_iterator it = drag->selected.begin(); it != drag->selected.end(); ++it ) {
GrDragger *dragger = *it;
@@ -1345,6 +1347,7 @@ GrDragger::moveMeshHandles ( Geom::Point pc_old, MeshNodeOperation op )
}
}
}
+#endif
// Now we do the handle moves.
diff --git a/src/inkscape.cpp b/src/inkscape.cpp
index 6f8ea4324..2ba85026f 100644
--- a/src/inkscape.cpp
+++ b/src/inkscape.cpp
@@ -549,7 +549,7 @@ Application::Application(const char* argv, bool use_gui) :
#define DEFAULT_LOG_REDIRECT false
#endif
- if (use_gui == TRUE && prefs->getBool("/dialogs/debug/redirect", DEFAULT_LOG_REDIRECT))
+ if (use_gui && prefs->getBool("/dialogs/debug/redirect", DEFAULT_LOG_REDIRECT))
{
Inkscape::UI::Dialog::DebugDialog::getInstance()->captureLogMessages();
}
diff --git a/src/livarot/Path.cpp b/src/livarot/Path.cpp
index 68891e4aa..5fa418968 100644
--- a/src/livarot/Path.cpp
+++ b/src/livarot/Path.cpp
@@ -380,24 +380,18 @@ void Path::InsertBezierTo(Geom::Point const &iPt, int iNb, int at)
/*
- * points de la polyligne
+ * points of the polyline
*/
void
Path::SetBackData (bool nVal)
{
- if (back == false) {
- if (nVal == true && back == false) {
+ if (! back) {
+ if (nVal) {
back = true;
ResetPoints();
- } else if (nVal == false && back == true) {
- back = false;
- ResetPoints();
}
} else {
- if (nVal == true && back == false) {
- back = true;
- ResetPoints();
- } else if (nVal == false && back == true) {
+ if (! nVal) {
back = false;
ResetPoints();
}
@@ -417,7 +411,7 @@ int Path::AddPoint(Geom::Point const &iPt, bool mvto)
return AddPoint (iPt, -1, 0.0, mvto);
}
- if ( !mvto && pts.empty() == false && pts.back().p == iPt ) {
+ if ( !mvto && !pts.empty() && pts.back().p == iPt ) {
return -1;
}
@@ -441,11 +435,11 @@ int Path::ReplacePoint(Geom::Point const &iPt)
int Path::AddPoint(Geom::Point const &iPt, int ip, double it, bool mvto)
{
- if (back == false) {
+ if (! back) {
return AddPoint (iPt, mvto);
}
- if ( !mvto && pts.empty() == false && pts.back().p == iPt ) {
+ if ( !mvto && !pts.empty() && pts.back().p == iPt ) {
return -1;
}
diff --git a/src/livarot/PathOutline.cpp b/src/livarot/PathOutline.cpp
index 0683d8ae8..7043469d2 100644
--- a/src/livarot/PathOutline.cpp
+++ b/src/livarot/PathOutline.cpp
@@ -424,7 +424,7 @@ void Path::SubContractOutline(int off, int num_pd,
}
else if (nType == descr_close)
{
- if (doFirst == false)
+ if (! doFirst)
{
if (Geom::LInfty (curX - firstP) < 0.0001)
{
@@ -810,7 +810,7 @@ void Path::SubContractOutline(int off, int num_pd,
}
if (closeIfNeeded)
{
- if (doFirst == false)
+ if (! doFirst)
{
}
}
@@ -853,7 +853,7 @@ Path::IsNulCurve (std::vector<PathDescr*> const &cmd, int curD, Geom::Point cons
{
PathDescrArcTo* nData = dynamic_cast<PathDescrArcTo*>(cmd[curD]);
if ( Geom::LInfty(nData->p - curX) < 0.00001) {
- if ((nData->large == false)
+ if ((! nData->large)
|| (fabs (nData->rx) < 0.00001
|| fabs (nData->ry) < 0.00001)) {
return true;
@@ -1004,7 +1004,7 @@ void Path::TangentOnArcAt(double at, const Geom::Point &iS, PathDescrArcTo const
if (wise)
{
- if (large == true)
+ if (large)
{
drx = -drx;
dry = -dry;
@@ -1021,7 +1021,7 @@ void Path::TangentOnArcAt(double at, const Geom::Point &iS, PathDescrArcTo const
}
else
{
- if (large == false)
+ if (! large)
{
drx = -drx;
dry = -dry;
diff --git a/src/livarot/Shape.cpp b/src/livarot/Shape.cpp
index 0bb3390e8..33b383947 100644
--- a/src/livarot/Shape.cpp
+++ b/src/livarot/Shape.cpp
@@ -1688,8 +1688,8 @@ Shape::CmpToVert (Geom::Point ax, Geom::Point bx,bool as,bool bs)
if (si > 0.000001) tstSi = 1;
if (si < -0.000001) tstSi = -1;
if ( tstSi == 0 ) {
- if ( as == true && bs == false ) return -1;
- if ( as == false && bs == true ) return 1;
+ if ( as && !bs ) return -1;
+ if ( !as && bs ) return 1;
}
return tstSi;
}
diff --git a/src/livarot/float-line.cpp b/src/livarot/float-line.cpp
index 55fda019a..e5350edc6 100644
--- a/src/livarot/float-line.cpp
+++ b/src/livarot/float-line.cpp
@@ -499,7 +499,7 @@ void FloatLigne::Flatten()
}
// then scan all boundaries that start a portion at this position
- while ( i >= 0 && i < int(bords.size()) && bords[i].pos == cur && bords[i].start == true ) {
+ while ( i >= 0 && i < int(bords.size()) && bords[i].pos == cur && bords[i].start ) {
rightV += bords[i].val;
rightP += bords[i].pente;
#ifndef faster_flatten
@@ -748,8 +748,8 @@ void FloatLigne::Split(FloatLigne *a, float tresh, FloatLigne *over)
/**
* Clips the coverage runs to tresh.
*
- * If addIt == false, it only leaves the parts that are not entirely under
- * tresh. If addIt == true, it's the coverage clamped to tresh.
+ * If addIt is false, it only leaves the parts that are not entirely under
+ * tresh. If addIt is true, it's the coverage clamped to tresh.
*/
void FloatLigne::Max(FloatLigne *a, float tresh, bool addIt)
{
diff --git a/src/livarot/int-line.cpp b/src/livarot/int-line.cpp
index d03d62cd7..998f638e7 100644
--- a/src/livarot/int-line.cpp
+++ b/src/livarot/int-line.cpp
@@ -128,7 +128,7 @@ void IntLigne::Flatten()
i++;
}
midV = RemainingValAt(cur);
- while ( i < nbBord && bords[i].pos == cur && bords[i].start == true ) {
+ while ( i < nbBord && bords[i].pos == cur && bords[i].start ) {
rightV += bords[i].val;
Enqueue(bords[i].other);
i++;
diff --git a/src/live_effects/lpe-envelope.cpp b/src/live_effects/lpe-envelope.cpp
index 0ce784877..c3b0a7c10 100644
--- a/src/live_effects/lpe-envelope.cpp
+++ b/src/live_effects/lpe-envelope.cpp
@@ -47,7 +47,7 @@ Geom::Piecewise<Geom::D2<Geom::SBasis> >
LPEEnvelope::doEffect_pwd2 (Geom::Piecewise<Geom::D2<Geom::SBasis> > const & pwd2_in)
{
- if(xx.get_value() == false && yy.get_value() == false)
+ if(!xx.get_value() && !yy.get_value())
{
return pwd2_in;
}
@@ -158,7 +158,7 @@ LPEEnvelope::doEffect_pwd2 (Geom::Piecewise<Geom::D2<Geom::SBasis> > const & pwd
output_y = ybis*(compose((uskeleton1),x1) + y1*compose(n1,x1) )
+ y*(compose((uskeleton3),x3) + y3*compose(n3,x3) );
output_y /= (boundingbox_Y.extent());
- if(xx.get_value() == false && yy.get_value() == true)
+ if(!xx.get_value() && yy.get_value())
{
return output_y;
}
@@ -167,13 +167,13 @@ LPEEnvelope::doEffect_pwd2 (Geom::Piecewise<Geom::D2<Geom::SBasis> > const & pwd
output_x = x*(compose((uskeleton2),y2) + -x2*compose(n2,y2) )
+ xbis*(compose((uskeleton4),y4) + -x4*compose(n4,y4) );
output_x /= (boundingbox_X.extent());
- if(xx.get_value() == true && yy.get_value() == false)
+ if(xx.get_value() && !yy.get_value())
{
return output_x;
}
/*output : Deformation by Up, Left, Right and Down Bend Paths*/
- if(xx.get_value() == true && yy.get_value() == true)
+ if(xx.get_value() && yy.get_value())
{
Piecewise<SBasis> xsqr = x*xbis; /* xsqr = x * (BBox_X - x) */
Piecewise<SBasis> ysqr = y*ybis; /* xsqr = y * (BBox_Y - y) */
diff --git a/src/sp-lpe-item.cpp b/src/sp-lpe-item.cpp
index 936594679..c4247bd5a 100644
--- a/src/sp-lpe-item.cpp
+++ b/src/sp-lpe-item.cpp
@@ -479,7 +479,7 @@ void SPLPEItem::addPathEffect(LivePathEffectObject * new_lpeobj)
}
/**
- * If keep_path == true, the item should not be updated, effectively 'flattening' the LPE.
+ * If keep_path is true, the item should not be updated, effectively 'flattening' the LPE.
*/
void SPLPEItem::removeCurrentPathEffect(bool keep_paths)
{
@@ -489,7 +489,7 @@ void SPLPEItem::removeCurrentPathEffect(bool keep_paths)
if (Inkscape::LivePathEffect::Effect* effect_ = this->getCurrentLPE()) {
effect_->doOnRemove(this);
- }
+ }
PathEffectList new_list = *this->path_effect_list;
new_list.remove(lperef); //current lpe ref is always our 'own' pointer from the path_effect_list
this->getRepr()->setAttribute("inkscape:path-effect", patheffectlist_svg_string(new_list));
@@ -505,7 +505,7 @@ void SPLPEItem::removeCurrentPathEffect(bool keep_paths)
}
/**
- * If keep_path == true, the item should not be updated, effectively 'flattening' the LPE.
+ * If keep_path is true, the item should not be updated, effectively 'flattening' the LPE.
*/
void SPLPEItem::removeAllPathEffects(bool keep_paths)
{
diff --git a/src/style-internal.cpp b/src/style-internal.cpp
index 136a522f8..5a2a2f913 100644
--- a/src/style-internal.cpp
+++ b/src/style-internal.cpp
@@ -1555,7 +1555,7 @@ SPIPaintOrder::write( guint const flags, SPIBase const *const base) const {
css << "inherit";
} else {
for( unsigned i = 0; i < PAINT_ORDER_LAYERS; ++i ) {
- if( this->layer_set[i] == true ) {
+ if( layer_set[i] ) {
switch (this->layer[i]) {
case SP_CSS_PAINT_ORDER_NORMAL:
css << "normal";
@@ -2787,7 +2787,7 @@ SPITextDecoration::read( gchar const *str ) {
}
// If we set text_decoration_line, then update style_td (for CSS2 text-decoration)
- if( style->text_decoration_line.set == true ) {
+ if( style->text_decoration_line.set ) {
style_td = style;
}
}
diff --git a/src/ui/tools/freehand-base.cpp b/src/ui/tools/freehand-base.cpp
index 067035b97..a7cd39a89 100644
--- a/src/ui/tools/freehand-base.cpp
+++ b/src/ui/tools/freehand-base.cpp
@@ -372,7 +372,7 @@ static void spdc_check_for_and_apply_waiting_LPE(FreehandBase *dc, SPItem *item,
{
// take shape from clipboard;
Inkscape::UI::ClipboardManager *cm = Inkscape::UI::ClipboardManager::get();
- if(cm->paste(SP_ACTIVE_DESKTOP,true) == true){
+ if(cm->paste(SP_ACTIVE_DESKTOP,true)){
SPItem * pasted_clipboard = dc->selection->singleItem();
if(pasted_clipboard){
Inkscape::XML::Node *pasted_clipboard_root = pasted_clipboard->getRepr();
@@ -401,7 +401,7 @@ static void spdc_check_for_and_apply_waiting_LPE(FreehandBase *dc, SPItem *item,
case BEND_CLIPBOARD:
{
Inkscape::UI::ClipboardManager *cm = Inkscape::UI::ClipboardManager::get();
- if(cm->paste(SP_ACTIVE_DESKTOP,true) == true){
+ if(cm->paste(SP_ACTIVE_DESKTOP,true)){
gchar const *svgd = item->getRepr()->attribute("d");
bend_item = dc->selection->singleItem();
if(bend_item && (SP_IS_SHAPE(bend_item) || SP_IS_GROUP(bend_item))){
diff --git a/src/widgets/spray-toolbar.cpp b/src/widgets/spray-toolbar.cpp
index a724637e3..f456bc763 100644
--- a/src/widgets/spray-toolbar.cpp
+++ b/src/widgets/spray-toolbar.cpp
@@ -211,7 +211,7 @@ static void sp_toggle_pressure_scale( GtkToggleAction* act, gpointer data)
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
gboolean active = gtk_toggle_action_get_active(act);
prefs->setBool("/tools/spray/usepressurescale", active);
- if(active == true){
+ if(active){
prefs->setDouble("/tools/spray/scale_variation", 0);
}
GObject *tbl = G_OBJECT(data);
@@ -238,7 +238,7 @@ static void sp_toggle_picker( GtkToggleAction* act, gpointer data )
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
gboolean active = gtk_toggle_action_get_active(act);
prefs->setBool("/tools/spray/picker", active);
- if(active == true){
+ if(active){
prefs->setBool("/dialogs/clonetiler/dotrace", false);
SPDesktop *dt = SP_ACTIVE_DESKTOP;
if (Inkscape::UI::Dialog::CloneTiler *ct = get_clone_tiler_panel(dt)){
diff --git a/src/widgets/stroke-style.cpp b/src/widgets/stroke-style.cpp
index 4a658c5dc..81a8e8115 100644
--- a/src/widgets/stroke-style.cpp
+++ b/src/widgets/stroke-style.cpp
@@ -22,6 +22,7 @@
#include "svg/svg-color.h"
#include "ui/widget/unit-menu.h"
#include "desktop-widget.h"
+#include "widgets/style-utils.h"
using Inkscape::DocumentUndo;
using Inkscape::Util::unit_table;
@@ -437,6 +438,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 +451,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;
}
@@ -910,22 +913,20 @@ StrokeStyle::updateLine()
if (result_ml != QUERY_STYLE_NOTHING)
(*miterLimitAdj)->set_value(query.stroke_miterlimit.value); // TODO: reflect averagedness?
- if (result_join != QUERY_STYLE_MULTIPLE_DIFFERENT &&
- result_join != QUERY_STYLE_NOTHING ) {
+ using Inkscape::is_query_style_updateable;
+ if (! is_query_style_updateable(result_join)) {
setJoinType(query.stroke_linejoin.value);
} else {
setJoinButtons(NULL);
}
- if (result_cap != QUERY_STYLE_MULTIPLE_DIFFERENT &&
- result_cap != QUERY_STYLE_NOTHING ) {
+ if (! is_query_style_updateable(result_cap)) {
setCapType (query.stroke_linecap.value);
} else {
setCapButtons(NULL);
}
- if (result_order != QUERY_STYLE_MULTIPLE_DIFFERENT &&
- result_order != QUERY_STYLE_NOTHING ) {
+ if (! is_query_style_updateable(result_order)) {
setPaintOrder (query.paint_order.value);
} else {
setPaintOrder (NULL);
@@ -976,6 +977,16 @@ StrokeStyle::setScaledDash(SPCSSAttr *css,
}
}
+static inline double calcScaleLineWidth(const double width_typed, SPItem *const item, Inkscape::Util::Unit const *const unit)
+{
+ if (unit->type == Inkscape::Util::UNIT_TYPE_LINEAR) {
+ return Inkscape::Util::Quantity::convert(width_typed, unit, "px");
+ } else { // percentage
+ const gdouble old_w = item->style->stroke_width.computed;
+ return old_w * width_typed / 100;
+ }
+}
+
/**
* Sets line properties like width, dashes, markers, etc. on all currently selected items.
*/
@@ -1007,13 +1018,7 @@ StrokeStyle::scaleLine()
for(auto i=items.begin();i!=items.end();++i){
/* Set stroke width */
- double width;
- if (unit->type == Inkscape::Util::UNIT_TYPE_LINEAR) {
- width = Inkscape::Util::Quantity::convert(width_typed, unit, "px");
- } else { // percentage
- gdouble old_w = (*i)->style->stroke_width.computed;
- width = old_w * width_typed / 100;
- }
+ const double width = calcScaleLineWidth(width_typed, (*i), unit);
{
Inkscape::CSSOStringStream os_width;
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);
diff --git a/src/widgets/style-utils.h b/src/widgets/style-utils.h
new file mode 100644
index 000000000..65b635f0c
--- /dev/null
+++ b/src/widgets/style-utils.h
@@ -0,0 +1,45 @@
+/**
+ * @file
+ * Common utility functions for manipulating style.
+ */
+/* Author:
+ * Shlomi Fish <shlomif@cpan.org>
+ *
+ * Copyright (C) 2016 Shlomi Fish
+ *
+ * Dually-Licensed under:
+ *
+ * 1. The Expat license - https://www.gnu.org/licenses/license-list.html#Expat
+ *
+ * 2. The GNU General Public License, either version 2, or at your option,
+ * any later version of it.
+ * ( https://en.wikipedia.org/wiki/GNU_General_Public_License )
+ */
+
+#ifndef SEEN_DIALOGS_STYLE_UTILS_H
+#define SEEN_DIALOGS_STYLE_UTILS_H
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include "desktop-style.h"
+
+namespace Inkscape {
+ inline bool is_query_style_updateable(const int style) {
+ return (style == QUERY_STYLE_MULTIPLE_DIFFERENT || style == QUERY_STYLE_NOTHING);
+ }
+} // namespace Inkscape
+
+#endif // SEEN_DIALOGS_STYLE_UTILS_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/widgets/text-toolbar.cpp b/src/widgets/text-toolbar.cpp
index 4b22c8d7e..610d743a0 100644
--- a/src/widgets/text-toolbar.cpp
+++ b/src/widgets/text-toolbar.cpp
@@ -41,6 +41,7 @@
#include "ink-radio-action.h"
#include "ink-toggle-action.h"
#include "widgets/ink-comboboxentry-action.h"
+#include "widgets/style-utils.h"
#include "inkscape.h"
#include "selection-chemistry.h"
#include "sp-flowtext.h"
@@ -304,7 +305,7 @@ static void sp_text_script_changed( InkToggleAction* act, GObject *tbl )
bool setSuper = false;
bool setSub = false;
- if(result_baseline == QUERY_STYLE_NOTHING || result_baseline == QUERY_STYLE_MULTIPLE_DIFFERENT ) {
+ if (Inkscape::is_query_style_updateable(result_baseline)) {
// If not set or mixed, turn on superscript or subscript
if( prop == 0 ) {
setSuper = true;