From 03d9514bd71dbc8b35c61e97de78ccee29799da0 Mon Sep 17 00:00:00 2001 From: Abdelrazak Younes Date: Tue, 7 Nov 2006 15:21:47 +0000 Subject: [PATCH] * InsetText: - wide_inset_ is not mutable any more - Wide(): split up in Wide() and setWide() * rowpainter.C: - paintPar(): use a const_cast instead of the mutable InsetText::Wide() git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15779 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/insets/insettext.h | 6 ++++-- src/rowpainter.C | 9 +++++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/insets/insettext.h b/src/insets/insettext.h index 1baf6fc9fb..d11bc97c88 100644 --- a/src/insets/insettext.h +++ b/src/insets/insettext.h @@ -133,7 +133,9 @@ public: /// InsetText(InsetText const &); /// - bool & Wide() const { return wide_inset_; } + bool Wide() const { return wide_inset_; } + /// + void setWide(bool wide_inset) { wide_inset_ = wide_inset; } protected: /// @@ -156,7 +158,7 @@ private: /// static int border_; /// - mutable bool wide_inset_; + bool wide_inset_; public: /// mutable LyXText text_; diff --git a/src/rowpainter.C b/src/rowpainter.C index a2936fe8d9..6d3707c398 100644 --- a/src/rowpainter.C +++ b/src/rowpainter.C @@ -880,12 +880,17 @@ void paintPar text); // If this is the only object on the row, we can make it wide + // + // FIXME: there is a const_cast here because paintPar() is not supposed + // to touch the paragraph contents. So either we move this "wide" + // property out of InsetText or we localize the feature to the painting + // done here. for (pos_type i = rit->pos() ; i != rit->endpos(); ++i) { InsetBase const * const in = par.getInset(i); if (in) { - InsetText const * const t = in->asTextInset(); + InsetText * t = const_cast(in->asTextInset()); if (t) - t->Wide() = in_inset_alone_on_row; + t->setWide(in_inset_alone_on_row); } } -- 2.39.2