Small fix to ert compatibility read where white spaces where removed when

effectively they were needed.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH-1_2_X@4177 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jürgen Vigna 2002-05-21 13:10:23 +00:00
parent de8a85e89a
commit 8976e585b6
2 changed files with 9 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2002-05-21 Juergen Vigna <jug@sad.it>
* buffer.C (insertErtContents): fix to insert ert asis if it is
non empty. Skip it completely if it contains only whitespaces.
2002-05-15 John Levon <moz@compsoc.man.ac.uk>
* BufferView_pimpl.C:

View File

@ -418,8 +418,10 @@ Inset * Buffer::isErtInset(Paragraph * par, int pos) const
void Buffer::insertErtContents(Paragraph * par, int & pos, bool set_inactive)
{
string str = frontStrip(strip(ert_comp.contents, ' '), ' ');
if (!str.empty()) {
if (ert_comp.contents.find_first_not_of(' ') != string::npos) {
// we only skip completely empty ERT (only spaces) otherwise
// we have to insert it as is.
string str(ert_comp.contents);
lyxerr[Debug::INSETS] << "ERT contents:\n'"
<< str << "'" << endl;
// check if we have already an ert inset a position earlier