MathData: fix #6388 also for branch

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_6_X@33103 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Uwe Stöhr 2010-01-20 02:10:29 +00:00
parent cfe7299192
commit 66ad612769
3 changed files with 10 additions and 8 deletions

View File

@ -415,6 +415,9 @@ void MathData::updateMacros(Cursor * cur, MacroContext const & mc)
|| newDisplayMode == MathMacro::DISPLAY_UNFOLDED)) {
detachMacroParameters(cur, i);
// FIXME: proper anchor handling, this removes the selection
if (cur)
cur->clearSelection();
}
// the macro could have been copied while resizing this
@ -473,10 +476,9 @@ void MathData::updateMacros(Cursor * cur, MacroContext const & mc)
}
void MathData::detachMacroParameters(Cursor * cur, const size_type macroPos)
void MathData::detachMacroParameters(DocIterator * cur, const size_type macroPos)
{
MathMacro * macroInset = operator[](macroPos).nucleus()->asMacro();
Buffer * buf = &cur->buffer();
// detach all arguments
vector<MathData> detachedArgs;
@ -531,7 +533,7 @@ void MathData::detachMacroParameters(Cursor * cur, const size_type macroPos)
for (size_t q = 0; q < arg.size(); ++q) {
if (arg[q]->getChar() == ']') {
// put brace
brace = new InsetMathBrace(buf);
brace = new InsetMathBrace(buffer_);
break;
}
}
@ -592,12 +594,9 @@ void MathData::detachMacroParameters(Cursor * cur, const size_type macroPos)
++(*cur)[curMacroSlice - 1].pos();
}
if (cur) {
// FIXME: proper anchor handling, this removes the selection
cur->clearSelection();
if (cur)
cur->updateInsets(&cur->bottom().inset());
}
}
void MathData::attachMacroParameters(Cursor * cur,

View File

@ -179,7 +179,7 @@ private:
bool find1(MathData const & ar, size_type pos) const;
///
void detachMacroParameters(Cursor * cur, const size_type macroPos);
void detachMacroParameters(DocIterator * dit, const size_type macroPos);
///
void attachMacroParameters(Cursor * cur, const size_type macroPos,
const size_type macroNumArgs, const int macroOptionals,

View File

@ -83,6 +83,9 @@ What's new
* DOCUMENT INPUT/OUTPUT
- Fix crash when vieving files that contain math macros as PDF
(bug 6388).
- Export the image when generating a preview, after an image
reload (bug 6356).