From 71b4a6798be7a056aceca295a28c99ea98ee31fd Mon Sep 17 00:00:00 2001 From: =?utf8?q?Lars=20Gullik=20Bj=C3=B8nnes?= Date: Sun, 17 Jul 2005 14:32:59 +0000 Subject: [PATCH] bug 1375 rename set_label_ to updateButtonLabel_ and reverse the logic. Make sure to set updateButtonLabel_ to true in all places where params is set (directly or indirectly). git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@10287 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/insets/ChangeLog | 6 ++++++ src/insets/insetcommand.C | 10 +++++----- src/insets/insetcommand.h | 26 +++++++++++++++++++++----- 3 files changed, 32 insertions(+), 10 deletions(-) diff --git a/src/insets/ChangeLog b/src/insets/ChangeLog index 7c52241d38..ab046e5593 100644 --- a/src/insets/ChangeLog +++ b/src/insets/ChangeLog @@ -1,3 +1,9 @@ +2005-07-17 Lars Gullik Bjønnes + + bug 1375 + * insetcommand.[hC]: rename set_label_ to updateButtonLabel_ and + reverse the logic. Make sure to set updateButtonLabel_ to true in all + places where params is set (directly or indirectly). 2005-07-15 André Pönitz diff --git a/src/insets/insetcommand.C b/src/insets/insetcommand.C index deef84d0ea..ff815add1f 100644 --- a/src/insets/insetcommand.C +++ b/src/insets/insetcommand.C @@ -33,7 +33,7 @@ InsetCommand::InsetCommand(InsetCommandParams const & p, string const & mailer_name) : p_(p.getCmdName(), p.getContents(), p.getOptions(), p.getSecOptions()), mailer_name_(mailer_name), - set_label_(false) + updateButtonLabel_(true) {} @@ -46,8 +46,8 @@ InsetCommand::~InsetCommand() void InsetCommand::metrics(MetricsInfo & mi, Dimension & dim) const { - if (!set_label_) { - set_label_ = true; + if (updateButtonLabel_) { + updateButtonLabel_ = false; button_.update(getScreenLabel(*mi.base.bv->buffer()), editable() != NOT_EDITABLE); } @@ -66,7 +66,7 @@ void InsetCommand::draw(PainterInfo & pi, int x, int y) const void InsetCommand::setParams(InsetCommandParams const & p) { p_ = p; - set_label_ = false; + updateButtonLabel_ = true; } @@ -103,7 +103,7 @@ void InsetCommand::doDispatch(LCursor & cur, FuncRequest & cmd) { switch (cmd.action) { case LFUN_INSET_REFRESH: - set_label_ = false; + updateButtonLabel_ = true; break; case LFUN_INSET_MODIFY: { diff --git a/src/insets/insetcommand.h b/src/insets/insetcommand.h index a798796ec2..902ad19bda 100644 --- a/src/insets/insetcommand.h +++ b/src/insets/insetcommand.h @@ -66,7 +66,11 @@ public: /// std::string const & getContents() const { return p_.getContents(); } /// - void setContents(std::string const & c) { p_.setContents(c); } + void setContents(std::string const & c) + { + updateButtonLabel_ = true; + p_.setContents(c); + } /// std::string const & getOptions() const { return p_.getOptions(); } /// @@ -84,11 +88,23 @@ protected: /// std::string const & getCmdName() const { return p_.getCmdName(); } /// - void setCmdName(std::string const & n) { p_.setCmdName(n); } + void setCmdName(std::string const & n) + { + updateButtonLabel_ = true; + p_.setCmdName(n); + } /// - void setOptions(std::string const & o) { p_.setOptions(o); } + void setOptions(std::string const & o) + { + updateButtonLabel_ = true; + p_.setOptions(o); + } /// - void setSecOptions(std::string const & s) { p_.setSecOptions(s); } + void setSecOptions(std::string const & s) + { + updateButtonLabel_ = true; + p_.setSecOptions(s); + } /// void setParams(InsetCommandParams const &); /// This should provide the text for the button @@ -98,7 +114,7 @@ private: /// InsetCommandParams p_; std::string mailer_name_; - mutable bool set_label_; + mutable bool updateButtonLabel_; mutable RenderButton button_; }; -- 2.39.5