mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-22 07:42:02 +00:00
fix bug 3204
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_4_X@17347 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
474973d3cb
commit
fba95df450
@ -1,3 +1,8 @@
|
||||
2007-02-25 Jean-Marc Lasgouttes <lasgouttes@lyx.org>
|
||||
|
||||
* lyx_cb.C (InsertAsciiFile): delete selection before insertion
|
||||
and handle undo correctly (bug 3204)
|
||||
|
||||
2007-01-31 Jean-Marc Lasgouttes <lasgouttes@lyx.org>
|
||||
|
||||
* buffer.C (readFile): reword error message when lyx2lyx fails.
|
||||
|
12
src/lyx_cb.C
12
src/lyx_cb.C
@ -21,6 +21,7 @@
|
||||
#include "BufferView.h"
|
||||
#include "buffer_funcs.h"
|
||||
#include "cursor.h"
|
||||
#include "CutAndPaste.h"
|
||||
#include "debug.h"
|
||||
#include "gettext.h"
|
||||
#include "lastfiles.h"
|
||||
@ -30,6 +31,7 @@
|
||||
#include "lyxrc.h"
|
||||
#include "lyxtext.h"
|
||||
#include "paragraph.h"
|
||||
#include "undo.h"
|
||||
|
||||
#include "frontends/Alert.h"
|
||||
#include "frontends/FileDialog.h"
|
||||
@ -368,13 +370,13 @@ void InsertAsciiFile(BufferView * bv, string const & f, bool asParagraph)
|
||||
if (tmpstr.empty())
|
||||
return;
|
||||
|
||||
// clear the selection
|
||||
if (bv->text() == bv->getLyXText())
|
||||
bv->cursor().clearSelection();
|
||||
LCursor & cur = bv->cursor();
|
||||
lyx::cap::replaceSelection(cur);
|
||||
recordUndo(cur);
|
||||
if (asParagraph)
|
||||
bv->getLyXText()->insertStringAsParagraphs(bv->cursor(), tmpstr);
|
||||
cur.innerText()->insertStringAsParagraphs(cur, tmpstr);
|
||||
else
|
||||
bv->getLyXText()->insertStringAsLines(bv->cursor(), tmpstr);
|
||||
cur.innerText()->insertStringAsLines(cur, tmpstr);
|
||||
bv->update();
|
||||
}
|
||||
|
||||
|
@ -25,6 +25,7 @@ What's new
|
||||
|
||||
* USER INTERFACE:
|
||||
|
||||
- Handle undo correctly when inserting a plain text file (bug 3204).
|
||||
|
||||
* DOCUMENTATION AND LOCALIZATION
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user