src/CutAndPaste.C
src/debug.C
src/exporter.C
+src/ext_l10n.h
src/figureForm.C
src/figure_form.C
src/FontLoader.C
src/frontends/controllers/ControlPrint.C
src/frontends/controllers/ControlSearch.C
src/frontends/controllers/ControlSpellchecker.C
+src/frontends/controllers/ControlThesaurus.C
src/frontends/controllers/helper_funcs.C
src/frontends/gnome/FormCitation.C
src/frontends/gnome/FormIndex.C
LyXText * lt = bv_->getLyXText();
if (argument.empty()) {
- // Get word or selection
- lt->selectWordWhenUnderCursor(bv_, LyXText::PREVIOUS_WORD);
-
- if (!lt->selection.set()) {
- owner_->message(_("Nothing to index!"));
- break;
- }
- if (lt->selection.start.par() != lt->selection.end.par()) {
- owner_->message(_("Cannot index more than one paragraph!"));
+ string const idxstring(bv_->getLyXText()->getStringToIndex(bv_));
+ if (!idxstring.empty())
+ p.setContents(idxstring);
+ else
break;
- }
-
- p.setContents(lt->selectionAsString(buffer_));
} else {
p.setContents(argument);
}
case LFUN_INDEX_INSERT_LAST:
{
- LyXText * lt = bv_->getLyXText();
- // Get word or selection
- lt->selectWordWhenUnderCursor(bv_, LyXText::PREVIOUS_WORD);
-
- if (!lt->selection.set()) {
- owner_->message(_("Nothing to index!"));
- break;
- }
- if (lt->selection.start.par() != lt->selection.end.par()) {
- owner_->message(_("Cannot index more than one paragraph!"));
- break;
+ string const idxstring(bv_->getLyXText()->getStringToIndex(bv_));
+ if (!idxstring.empty()) {
+ owner_->message(_("Word `")
+ + idxstring + _(("' indexed.")));
+ InsetCommandParams p("index", idxstring);
+ InsetIndex * inset = new InsetIndex(p);
+
+ if (!insertInset(inset))
+ delete inset;
+ else
+ updateInset(inset, true);
}
-
- InsetCommandParams p("index", lt->selectionAsString(buffer_));
- InsetIndex * inset = new InsetIndex(p);
-
- if (!insertInset(inset))
- delete inset;
- else
- updateInset(inset, true);
}
break;
+2001-07-30 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
+
+ * BufferView_pimpl.C (Dispatch): improve handling of
+ LFUN_INDEX_INSERT_LAST and LFUN_INDEX_CREATE
+
+ * commandtags.h: #include lyxfont.h here temporarily to avoid
+ keybinding bug.
+
+ * bufferlist.h: include LString.h here.
+
+2001-07-27 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
+
+ * text2.C (getStringToIndex): new method.
+
2001-07-29 Asger Alstrup Nielsen <alstrup@alstrup>
* *: Reduced header file dependencies all over.
#include <vector>
#include <boost/utility.hpp>
+#include "LString.h"
+
/** A class to hold all the buffers in a structure
The point of this class is to hide from bufferlist what kind
of structure the buffers are stored in. Should be no concern for
#include <iosfwd>
+// this will not be needed anymore when NO_LATEX is the default.
+#include "lyxfont.h"
+
/** These are all the lyxfunctions (as enums).
Please add new functions at the end of the enum, right
before LFUN_LASTACTION.
+2001-07-30 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
+
+ * Liason.C: #include LAssert.h
+
2001-07-24 John Levon <moz@compsoc.man.ac.uk>
* Dialogs.h: add showThesaurus
#include "lyxrc.h"
#include "PrinterParams.h"
#include "lyx_gui_misc.h"
+#include "support/LAssert.h"
#include "support/lstrings.h"
#include "support/filetools.h"
#include "support/path.h"
+2001-07-30 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
+
+ * ControlPrint.C: #include Lassert.h here.
+
2001-07-26 Baruch Even <baruch@lyx.org>
* ControlGraphics.C: changed file search string to cover eps, jpeg, gif
#include "lyx_gui_misc.h" // WriteAlert
#include "gettext.h"
#include "BufferView.h"
+#include "support/LAssert.h"
using Liason::printBuffer;
using Liason::getPrinterParams;
+2001-07-30 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
+
+ * insetgraphicsParams.C: #include LOstream.h here.
+
+ * insetfoot.h: remove InsetFoot:: qualifier.
+
2001-07-30 Baruch Even <baruch@lyx.org>
* insetgraphics.C (decideOutputImageFormat): when doing postscript output
///
string const editMessage() const;
///
- void InsetFoot::validate(LaTeXFeatures & features) const;
+ void validate(LaTeXFeatures & features) const;
};
#endif
#include "support/translator.h"
#include "support/filetools.h"
#include "support/lyxlib.h"
+#include "support/LOstream.h"
#include "support/LAssert.h"
///
void toggleFree(BufferView *, LyXFont const &, bool toggleall = false);
+
+ ///
+ string getStringToIndex(BufferView *);
/** recalculates the heights of all previous rows of the
specified paragraph. needed, if the last characters font
}
+string
+LyXText::getStringToIndex(BufferView * bview)
+{
+ string idxstring;
+
+ // Try implicit word selection
+ // If there is a change in the language the implicit word selection
+ // is disabled.
+ LyXCursor resetCursor = cursor;
+ bool implicitSelection = selectWordWhenUnderCursor(bview, PREVIOUS_WORD);
+
+ if (!selection.set()) {
+ bview->owner()->message(_("Nothing to index!"));
+ return string();
+ }
+ if (selection.start.par() != selection.end.par()) {
+ bview->owner()->message(_("Cannot index more than one paragraph!"));
+ return string();
+ }
+
+ idxstring = selectionAsString(bview->buffer());
+
+ // Implicit selections are cleared afterwards
+ //and cursor is set to the original position.
+ if (implicitSelection) {
+ clearSelection(bview);
+ cursor = resetCursor;
+ setCursor(bview, cursor.par(), cursor.pos());
+ selection.cursor = cursor;
+ }
+ return idxstring;
+}
+
Paragraph::size_type
LyXText::beginningOfMainBody(Buffer const * buf,
Paragraph const * par) const