X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FRow.h;h=49513d32b970b63124ce6a3c5290283ab145b317;hb=08aef452e7d3d5901e42b5e6a38ecaf18cd38529;hp=a1fedd7e5da97d043f8e55936aa8e942903af27e;hpb=a71610b9d72d346ac694518d6dab634f02247e2b;p=lyx.git diff --git a/src/Row.h b/src/Row.h index a1fedd7e5d..49513d32b9 100644 --- a/src/Row.h +++ b/src/Row.h @@ -136,6 +136,29 @@ public: /// Row(); + /** + * Helper function: set variable \c var to value \c val, and mark + * row as changed is the values were different. This is intended + * for use when changing members of the row object. + */ + template + void change(T1 & var, T2 const val) { + if (var != val) + changed(true); + var = val; + } + /** + * Helper function: set variable \c var to value \c val, and mark + * row as changed is the values were different. This is intended + * for use when changing members of the row object. + * This is the const version, useful for mutable members. + */ + template + void change(T1 & var, T2 const val) const { + if (var != val) + changed(true); + var = val; + } /// bool changed() const { return changed_; } ///