#include "buffer.h"
#include "bufferlist.h"
#include "BufferView.h"
+#include "cursor.h"
#include "debug.h"
#include "gettext.h"
#include "lastfiles.h"
#include "support/FileInfo.h"
#include "support/filetools.h"
#include "support/forkedcall.h"
+#include "support/globbing.h"
#include "support/lyxlib.h"
#include "support/os.h"
#include "support/path.h"
using lyx::support::AddName;
using lyx::support::bformat;
using lyx::support::destroyDir;
+using lyx::support::FileFilterList;
using lyx::support::FileInfo;
using lyx::support::ForkedProcess;
using lyx::support::IsLyXFilename;
if (!IsLyXFilename(fname))
fname += ".lyx";
+ FileFilterList const filter (_("LyX Documents (*.lyx)"));
+
FileDialog::Result result =
fileDlg.save(OnlyPath(fname),
- _("*.lyx| LyX Documents (*.lyx)"),
- OnlyFilename(fname));
+ filter,
+ OnlyFilename(fname));
if (result.first == FileDialog::Later)
return false;
return;
// clear the selection
- bool flag = (bv->text == bv->getLyXText());
- if (flag)
- bv->beforeChange(bv->text);
- if (!asParagraph)
- bv->getLyXText()->insertStringAsLines(tmpstr);
- else
+ if (bv->text() == bv->getLyXText())
+ bv->cursor().clearSelection();
+ if (asParagraph)
bv->getLyXText()->insertStringAsParagraphs(tmpstr);
+ else
+ bv->getLyXText()->insertStringAsLines(tmpstr);
bv->update();
}
FileDialog fileDlg(_("Select file to insert"),
(asParagraph) ? LFUN_FILE_INSERT_ASCII_PARA : LFUN_FILE_INSERT_ASCII);
- FileDialog::Result result = fileDlg.open(bv->owner()->buffer()->filePath());
+ FileDialog::Result result =
+ fileDlg.open(bv->owner()->buffer()->filePath(),
+ FileFilterList(), string());
if (result.first == FileDialog::Later)
return string();
string const getPossibleLabel(BufferView const & bv)
{
ParagraphList::iterator pit = bv.getLyXText()->cursorPar();
- ParagraphList & plist = bv.getLyXText()->ownerParagraphs();
+ ParagraphList & plist = bv.getLyXText()->paragraphs();
LyXLayout_ptr layout = pit->layout();
break;
string head;
par_text = split(par_text, head, ' ');
+ // Is it legal to use spaces in labels ?
if (i > 0)
- text += '-'; // Is it legal to use spaces in
- // labels ?
+ text += '-';
text += head;
}