]> git.lyx.org Git - features.git/commitdiff
Backport r38613 for branch, fixing #7532.
authorRichard Heck <rgheck@comcast.net>
Sat, 7 May 2011 16:45:45 +0000 (16:45 +0000)
committerRichard Heck <rgheck@comcast.net>
Sat, 7 May 2011 16:45:45 +0000 (16:45 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_2_0_X@38615 a592a061-630c-0410-9148-cb99ea01b6c8

src/Buffer.h
src/mathed/MathData.cpp
src/mathed/MathData.h
src/mathed/MathMacro.cpp
src/mathed/MathMacro.h
status.20x

index fd17ac14f0a40ab611bd22a3d3413db1c07eea51..bd462e2640703235bc0399cbe6801698888180ae 100644 (file)
@@ -530,7 +530,7 @@ public:
        /// Collect macro definitions in paragraphs
        void updateMacros() const;
        /// Iterate through the whole buffer and try to resolve macros
-       void updateMacroInstances() const;
+       void updateMacroInstances(UpdateType) const;
 
        /// List macro names of this buffer, the parent and the children
        void listMacroNames(MacroNameSet & macros) const;
index 8a1a58b0a0f8774a83c97d5f2d91d2da0a2feaf6..8fcf7466e34c825cfbe07f7badab5ca09befa1ee 100644 (file)
@@ -252,7 +252,7 @@ void MathData::metrics(MetricsInfo & mi, Dimension & dim) const
        }
 
        Cursor & cur = mi.base.bv->cursor();
-       const_cast<MathData*>(this)->updateMacros(&cur, mi.macrocontext);
+       const_cast<MathData*>(this)->updateMacros(&cur, mi.macrocontext, InternalUpdate);
 
        DocIterator const & inlineCompletionPos = mi.base.bv->inlineCompletionPos();
        MathData const * inlineCompletionData = 0;
@@ -387,7 +387,8 @@ void MathData::updateBuffer(ParIterator const & it, UpdateType utype)
 }
 
 
-void MathData::updateMacros(Cursor * cur, MacroContext const & mc)
+void MathData::updateMacros(Cursor * cur, MacroContext const & mc,
+               UpdateType utype)
 {
        // If we are editing a macro, we cannot update it immediately,
        // otherwise wrong undo steps will be recorded (bug 6208).
@@ -484,7 +485,7 @@ void MathData::updateMacros(Cursor * cur, MacroContext const & mc)
                if (inset->asScriptInset())
                        inset = inset->asScriptInset()->nuc()[0].nucleus();
                LASSERT(inset->asMacro(), /**/);
-               inset->asMacro()->updateRepresentation();
+               inset->asMacro()->updateRepresentation(cur, mc, utype);
        }
 }
 
index 877ce319706b0be204f003281914adab0c44b95e..6f92852a0171ddb77039c82b7e6f7961be512b6f 100644 (file)
@@ -167,7 +167,7 @@ public:
 
        /// attach/detach arguments to macros, updating the cur to 
        /// stay visually at the same position (cur==0 is allowed)
-       void updateMacros(Cursor * cur, MacroContext const & mc);
+       void updateMacros(Cursor * cur, MacroContext const & mc, UpdateType);
        ///
        void updateBuffer(ParIterator const &, UpdateType);
 
index 3d5b8fec62dc897fc588c2b7ff25bfbdf821d575..cd9b757a51742385a883a283ccd1d68913d59e8b 100644 (file)
@@ -311,7 +311,8 @@ void MathMacro::updateMacro(MacroContext const & mc)
 }
 
 
-void MathMacro::updateRepresentation()
+void MathMacro::updateRepresentation(Cursor * cur, MacroContext const & mc,
+               UpdateType utype)
 {
        // known macro?
        if (macro_ == 0)
@@ -342,6 +343,8 @@ void MathMacro::updateRepresentation()
        }
        // expanding macro with the values
        macro_->expand(values, expanded_.cell(0));
+       if (utype == OutputUpdate && !expanded_.cell(0).empty())
+               expanded_.cell(0).updateMacros(cur, mc, utype);
        // get definition for list edit mode
        docstring const & display = macro_->display();
        asArray(display.empty() ? macro_->definition() : display, definition_);
index 1e9536321fa8628ca039f6981855e76cb69ef342..b7308562ff2df2c26b58733081e78e2a3e8522e8 100644 (file)
@@ -139,7 +139,7 @@ protected:
        /// update macro definition
        void updateMacro(MacroContext const & mc);
        /// check if macro definition changed, argument changed etc. and adapt
-       void updateRepresentation();
+       void updateRepresentation(Cursor * cur, MacroContext const & mc, UpdateType);
        /// empty macro, put arguments into args, possibly strip arity-attachedArgsNum_ empty ones.
        /// Includes the optional arguments.
        void detachArguments(std::vector<MathData> & args, bool strip);
index 29aceee7247e12c10a8b234693d07412ffb29ce8..1906d76fe53ebb72ae66e1b0d3e1699567b91b71 100644 (file)
@@ -28,6 +28,8 @@ What's new
   except on Windows, where 30 minutes are allowed. This is because the Windows
   installer may trigger MiKTeX updates that suffer from network latencies.
 
+- Macros that use other macros now output properly to XHTML (bug 7532).
+
 
 * USER INTERFACE