mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-26 11:16:55 +00:00
Fix for #191, setting the cursor to the second paragraph if available if the
first one is empty. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3582 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
5539328a35
commit
6953743e22
@ -1,3 +1,8 @@
|
||||
2002-02-22 Juergen Vigna <jug@sad.it>
|
||||
|
||||
* insettext.C (insetUnlock): set the cursor to the second paragraph
|
||||
if available and if the first one is empty (fix #191).
|
||||
|
||||
2002-02-20 Juergen Vigna <jug@sad.it>
|
||||
|
||||
* insettext.C (getDrawFont): implemented this function to call the
|
||||
|
@ -753,7 +753,11 @@ void InsetText::insetUnlock(BufferView * bv)
|
||||
} else
|
||||
bv->owner()->setLayout(bv->text->cursor.par()->getLayout());
|
||||
// hack for deleteEmptyParMech
|
||||
if (par->size()) {
|
||||
lt->setCursor(bv, par, 0);
|
||||
} else if (par->next()) {
|
||||
lt->setCursor(bv, par->next(), 0);
|
||||
}
|
||||
if (clear)
|
||||
lt = 0;
|
||||
updateLocal(bv, code, false);
|
||||
|
@ -30,12 +30,21 @@ using std::getline;
|
||||
template <>
|
||||
string const write_attribute(string const & name, bool const & b)
|
||||
{
|
||||
// we write only true attribute values so we remove a bit of the
|
||||
// file format bloat for tabulars.
|
||||
if (!b)
|
||||
return string();
|
||||
|
||||
return write_attribute(name, int(b));
|
||||
}
|
||||
|
||||
template <>
|
||||
string const write_attribute(string const & name, LyXLength const & value)
|
||||
{
|
||||
// we write only the value if we really have one same reson as above.
|
||||
if (value.zero())
|
||||
return string();
|
||||
|
||||
return write_attribute(name, value.asString());
|
||||
}
|
||||
|
||||
@ -210,6 +219,9 @@ bool getTokenValue(string const & str, const char * token,
|
||||
|
||||
bool getTokenValue(string const & str, const char * token, bool & flag)
|
||||
{
|
||||
// set the flag always to false as this should be the default for bools
|
||||
// not in the file-format.
|
||||
flag = false;
|
||||
string tmp;
|
||||
if (!getTokenValue(str, token, tmp))
|
||||
return false;
|
||||
@ -219,6 +231,9 @@ bool getTokenValue(string const & str, const char * token, bool & flag)
|
||||
|
||||
bool getTokenValue(string const & str, const char * token, LyXLength & len)
|
||||
{
|
||||
// set the lenght to be zero() as default as this it should be if not
|
||||
// in the file format.
|
||||
len = LyXLength();
|
||||
string tmp;
|
||||
if (!getTokenValue(str, token, tmp))
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user