diff --git a/src/data/field.cpp b/src/data/field.cpp index 3c4b30ca..0f3d36da 100644 --- a/src/data/field.cpp +++ b/src/data/field.cpp @@ -139,16 +139,16 @@ inline bool is_setw(const Scriptable& x) { } int Style::update(Context& ctx) { - int changed = - ( left .update(ctx) - | width .update(ctx) - | right .update(ctx) - | top .update(ctx) - | height .update(ctx) - | bottom .update(ctx) - | angle .update(ctx) ) * CHANGE_SIZE - | visible.update(ctx) * CHANGE_OTHER - | mask .update(ctx) * CHANGE_MASK; + int changed = 0; + changed |= left .update(ctx) * CHANGE_SIZE; + changed |= width .update(ctx) * CHANGE_SIZE; + changed |= right .update(ctx) * CHANGE_SIZE; + changed |= top .update(ctx) * CHANGE_SIZE; + changed |= height .update(ctx) * CHANGE_SIZE; + changed |= bottom .update(ctx) * CHANGE_SIZE; + changed |= angle .update(ctx) * CHANGE_SIZE; + changed |= visible.update(ctx) * CHANGE_OTHER; + changed |= mask .update(ctx) * CHANGE_MASK; // determine automatic_side and attachment of rotation point if (automatic_side == AUTO_UNKNOWN) { if (!is_set (right)) automatic_side = (AutomaticSide)(automatic_side | AUTO_RIGHT); diff --git a/src/data/field/choice.cpp b/src/data/field/choice.cpp index 65af5c68..d7d6b409 100644 --- a/src/data/field/choice.cpp +++ b/src/data/field/choice.cpp @@ -199,19 +199,19 @@ void ChoiceStyle::initImage() { int ChoiceStyle::update(Context& ctx) { // Don't update the choice images, leave that to invalidate() - int change = Style::update(ctx) - | font .update(ctx) * CHANGE_OTHER; + int changes = Style::update(ctx); + changes |= font.update(ctx) * CHANGE_OTHER; if (!choice_images_initialized) { // we only want to do this once because it is rather slow, other updates are handled by dependencies choice_images_initialized = true; FOR_EACH(ci, choice_images) { if (ci.second.update(ctx)) { - change |= CHANGE_OTHER; + changes |= CHANGE_OTHER; // TODO : remove this thumbnail } } } - return change; + return changes; } void ChoiceStyle::initDependencies(Context& ctx, const Dependency& dep) const { Style::initDependencies(ctx, dep); diff --git a/src/data/field/image.cpp b/src/data/field/image.cpp index 5082c0a2..42d92b06 100644 --- a/src/data/field/image.cpp +++ b/src/data/field/image.cpp @@ -27,8 +27,9 @@ IMPLEMENT_REFLECTION(ImageStyle) { } int ImageStyle::update(Context& ctx) { - return Style ::update(ctx) - | default_image.update(ctx) * CHANGE_DEFAULT; + int changes = Style::update(ctx); + changes |= default_image.update(ctx) * CHANGE_DEFAULT; + return changes; } // ----------------------------------------------------------------------------- : ImageValue diff --git a/src/data/field/information.cpp b/src/data/field/information.cpp index 821492eb..df005750 100644 --- a/src/data/field/information.cpp +++ b/src/data/field/information.cpp @@ -38,8 +38,9 @@ InfoStyle::InfoStyle(const InfoFieldP& field) {} int InfoStyle::update(Context& ctx) { - return Style ::update(ctx) - | font .update(ctx) * CHANGE_OTHER; + int changes = Style::update(ctx); + changes |= font.update(ctx) * CHANGE_OTHER; + return changes; } void InfoStyle::initDependencies(Context& ctx, const Dependency& dep) const { Style ::initDependencies(ctx, dep); diff --git a/src/data/field/multiple_choice.cpp b/src/data/field/multiple_choice.cpp index 8b04e2d8..11ade17e 100644 --- a/src/data/field/multiple_choice.cpp +++ b/src/data/field/multiple_choice.cpp @@ -40,9 +40,10 @@ IMPLEMENT_REFLECTION(MultipleChoiceStyle) { } int MultipleChoiceStyle::update(Context& ctx) { - return ChoiceStyle::update(ctx) - | direction.update(ctx) * CHANGE_OTHER - | spacing.update(ctx) * CHANGE_OTHER; + int changes = ChoiceStyle::update(ctx); + changes |= direction.update(ctx) * CHANGE_OTHER; + changes |= spacing.update(ctx) * CHANGE_OTHER; + return changes; } // ----------------------------------------------------------------------------- : MultipleChoiceValue diff --git a/src/data/field/package_choice.cpp b/src/data/field/package_choice.cpp index 6002d8b6..b866d54d 100644 --- a/src/data/field/package_choice.cpp +++ b/src/data/field/package_choice.cpp @@ -35,8 +35,9 @@ PackageChoiceStyle::PackageChoiceStyle(const PackageChoiceFieldP& field) {} int PackageChoiceStyle::update(Context& ctx) { - return Style ::update(ctx) - | font .update(ctx) * CHANGE_OTHER; + int changes = Style::update(ctx); + changes |= font.update(ctx) * CHANGE_OTHER; + return changes; } /*void PackageChoiceStyle::initDependencies(Context& ctx, const Dependency& dep) const { Style ::initDependencies(ctx, dep); diff --git a/src/data/field/text.cpp b/src/data/field/text.cpp index 46884229..0fae699f 100644 --- a/src/data/field/text.cpp +++ b/src/data/field/text.cpp @@ -67,25 +67,25 @@ double TextStyle::getStretch() const { } int TextStyle::update(Context& ctx) { - return Style ::update(ctx) - | font .update(ctx) * CHANGE_OTHER - | symbol_font.update(ctx) * CHANGE_OTHER - | alignment .update(ctx) * CHANGE_OTHER - | ( padding_left .update(ctx) - | padding_left_min .update(ctx) - | padding_right .update(ctx) - | padding_right_min .update(ctx) - | padding_top .update(ctx) - | padding_top_min .update(ctx) - | padding_bottom .update(ctx) - | padding_bottom_min .update(ctx) - | line_height_soft .update(ctx) - | line_height_hard .update(ctx) - | line_height_line .update(ctx) - | line_height_soft_max.update(ctx) - | line_height_hard_max.update(ctx) - | line_height_line_max.update(ctx) - ) * CHANGE_OTHER; + int changes = Style::update(ctx); + changes |= font .update(ctx) * CHANGE_OTHER; + changes |= symbol_font.update(ctx) * CHANGE_OTHER; + changes |= alignment .update(ctx) * CHANGE_OTHER; + changes |= padding_left .update(ctx) * CHANGE_OTHER; + changes |= padding_left_min .update(ctx) * CHANGE_OTHER; + changes |= padding_right .update(ctx) * CHANGE_OTHER; + changes |= padding_right_min .update(ctx) * CHANGE_OTHER; + changes |= padding_top .update(ctx) * CHANGE_OTHER; + changes |= padding_top_min .update(ctx) * CHANGE_OTHER; + changes |= padding_bottom .update(ctx) * CHANGE_OTHER; + changes |= padding_bottom_min .update(ctx) * CHANGE_OTHER; + changes |= line_height_soft .update(ctx) * CHANGE_OTHER; + changes |= line_height_hard .update(ctx) * CHANGE_OTHER; + changes |= line_height_line .update(ctx) * CHANGE_OTHER; + changes |= line_height_soft_max.update(ctx) * CHANGE_OTHER; + changes |= line_height_hard_max.update(ctx) * CHANGE_OTHER; + changes |= line_height_line_max.update(ctx) * CHANGE_OTHER; + return changes; } void TextStyle::initDependencies(Context& ctx, const Dependency& dep) const { Style ::initDependencies(ctx, dep); diff --git a/src/data/font.cpp b/src/data/font.cpp index 1586c89c..548192af 100644 --- a/src/data/font.cpp +++ b/src/data/font.cpp @@ -25,15 +25,15 @@ Font::Font() {} bool Font::update(Context& ctx) { - bool changes - = name .update(ctx) - | italic_name .update(ctx) - | size .update(ctx) - | weight .update(ctx) - | style .update(ctx) - | underline .update(ctx) - | color .update(ctx) - | shadow_color.update(ctx); + bool changes = false; + changes |= name .update(ctx); + changes |= italic_name .update(ctx); + changes |= size .update(ctx); + changes |= weight .update(ctx); + changes |= style .update(ctx); + changes |= underline .update(ctx); + changes |= color .update(ctx); + changes |= shadow_color.update(ctx); flags = (flags & ~FONT_BOLD & ~FONT_ITALIC) | (weight() == _("bold") ? FONT_BOLD : FONT_NORMAL) | (style() == _("italic") ? FONT_ITALIC : FONT_NORMAL);