* Buffer can be retrieved from currently set buffer_.
* detachMacroParameters() doesn't really need a Cursor.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32752 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Abdelrazak Younes 2010-01-03 11:00:21 +00:00
parent fb876be81f
commit 930088a07d
2 changed files with 7 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,11 +594,8 @@ 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());
}
}

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,