Avoid const casts by making mutable the usermacros member.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36984 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Enrico Forestieri 2010-12-21 14:52:18 +00:00
parent 12cc8a301d
commit 89c1d25250
3 changed files with 3 additions and 3 deletions

View File

@ -822,7 +822,7 @@ bool Buffer::readDocument(Lexer & lex)
// inform parent buffer about local macros
if (parent()) {
Buffer * pbuf = const_cast<Buffer *>(parent());
Buffer const * pbuf = parent();
UserMacroSet::const_iterator cit = usermacros.begin();
UserMacroSet::const_iterator end = usermacros.end();
for (; cit != end; ++cit)

View File

@ -544,7 +544,7 @@ public:
/// Collect user macro names at loading time
typedef std::set<docstring> UserMacroSet;
UserMacroSet usermacros;
mutable UserMacroSet usermacros;
/// Replace the inset contents for insets which InsetCode is equal
/// to the passed \p inset_code.

View File

@ -463,7 +463,7 @@ Buffer * InsetInclude::loadIfNeeded() const
} else {
// The file was already loaded, so, simply
// inform parent buffer about local macros.
Buffer * parent = const_cast<Buffer *>(&buffer());
Buffer const * parent = &buffer();
child->setParent(parent);
MacroNameSet macros;
child->listMacroNames(macros);