mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-06 00:10:59 +00:00
various fixes
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2387 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
b8cad4ca9d
commit
fd836612cb
@ -9,6 +9,7 @@ src/converter.C
|
||||
src/CutAndPaste.C
|
||||
src/debug.C
|
||||
src/exporter.C
|
||||
src/ext_l10n.h
|
||||
src/figureForm.C
|
||||
src/figure_form.C
|
||||
src/FontLoader.C
|
||||
@ -24,6 +25,7 @@ src/frontends/controllers/ControlPreamble.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
|
||||
|
@ -2984,19 +2984,11 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument)
|
||||
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!"));
|
||||
string const idxstring(bv_->getLyXText()->getStringToIndex(bv_));
|
||||
if (!idxstring.empty())
|
||||
p.setContents(idxstring);
|
||||
else
|
||||
break;
|
||||
}
|
||||
if (lt->selection.start.par() != lt->selection.end.par()) {
|
||||
owner_->message(_("Cannot index more than one paragraph!"));
|
||||
break;
|
||||
}
|
||||
|
||||
p.setContents(lt->selectionAsString(buffer_));
|
||||
} else {
|
||||
p.setContents(argument);
|
||||
}
|
||||
@ -3020,20 +3012,11 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & 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;
|
||||
}
|
||||
|
||||
InsetCommandParams p("index", lt->selectionAsString(buffer_));
|
||||
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))
|
||||
@ -3041,6 +3024,7 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument)
|
||||
else
|
||||
updateInset(inset, true);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case LFUN_INDEX_PRINT:
|
||||
|
@ -1,3 +1,17 @@
|
||||
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.
|
||||
|
@ -23,6 +23,8 @@ class UpdatableInset;
|
||||
#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
|
||||
|
@ -12,6 +12,9 @@
|
||||
|
||||
#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.
|
||||
|
@ -1,3 +1,7 @@
|
||||
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
|
||||
|
@ -21,6 +21,7 @@
|
||||
#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"
|
||||
|
@ -1,3 +1,7 @@
|
||||
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
|
||||
|
@ -31,6 +31,7 @@
|
||||
#include "lyx_gui_misc.h" // WriteAlert
|
||||
#include "gettext.h"
|
||||
#include "BufferView.h"
|
||||
#include "support/LAssert.h"
|
||||
|
||||
using Liason::printBuffer;
|
||||
using Liason::getPrinterParams;
|
||||
|
@ -1,3 +1,9 @@
|
||||
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
|
||||
|
@ -39,7 +39,7 @@ public:
|
||||
///
|
||||
string const editMessage() const;
|
||||
///
|
||||
void InsetFoot::validate(LaTeXFeatures & features) const;
|
||||
void validate(LaTeXFeatures & features) const;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -19,6 +19,7 @@
|
||||
#include "support/translator.h"
|
||||
#include "support/filetools.h"
|
||||
#include "support/lyxlib.h"
|
||||
#include "support/LOstream.h"
|
||||
|
||||
#include "support/LAssert.h"
|
||||
|
||||
|
@ -151,6 +151,9 @@ public:
|
||||
///
|
||||
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
|
||||
has changed.
|
||||
|
33
src/text2.C
33
src/text2.C
@ -1059,6 +1059,39 @@ void LyXText::toggleFree(BufferView * bview,
|
||||
}
|
||||
|
||||
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user