]> git.lyx.org Git - features.git/commitdiff
Avoid const casts by making mutable the usermacros member.
authorEnrico Forestieri <forenr@lyx.org>
Tue, 21 Dec 2010 14:52:18 +0000 (14:52 +0000)
committerEnrico Forestieri <forenr@lyx.org>
Tue, 21 Dec 2010 14:52:18 +0000 (14:52 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36984 a592a061-630c-0410-9148-cb99ea01b6c8

src/Buffer.cpp
src/Buffer.h
src/insets/InsetInclude.cpp

index a046124250ea5852dd7476d75d94e5ef734da880..ea5b6e57aeb7c8534f5bb009b73fb033a5b857c8 100644 (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)
index d0d787687c94510f5ada9c1339be7bbb313c7c90..5819466bf7e635673a495d8d6e0b124961749b6b 100644 (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.
index bdb332d9d6947cc081f4eea4b6c504124058a124..e1e61b15c4a6b66a788f9a270cd3c4c67923a025 100644 (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);