#include "debug.h"
#include "iterators.h"
#include "lyxlex.h"
+#include "WordLangTuple.h"
#include "frontends/Alert.h"
#include "frontends/Dialogs.h"
//
// Moved from lyx_cb.C (Lgb)
{
- if (filen.empty()) return false;
+ if (filen.empty())
+ return false;
string const fname = MakeAbsPath(filen);
}
-/* This is also a buffer property (ale) */
+// This is also a buffer property (ale)
// Not so sure about that. a goto Label function can not be buffer local, just
-// think how this will work in a multiwindo/buffer environment, all the
+// think how this will work in a multiwindow/buffer environment, all the
// cursors in all the views showing this buffer will move. (Lgb)
// OK, then no cursor action should be allowed in buffer. (ale)
bool BufferView::gotoLabel(string const & label)
-
{
for (Buffer::inset_iterator it = buffer()->inset_iterator_begin();
it != buffer()->inset_iterator_end(); ++it) {
- vector<string> labels = (*it)->getLabelList();
+ vector<string> labels = it->getLabelList();
if (find(labels.begin(),labels.end(),label)
!= labels.end()) {
beforeChange(text);
}
-void BufferView::copy()
-{
- if (available()) {
- getLyXText()->copySelection(this);
- owner()->message(_("Copy"));
- }
-}
-
-
-void BufferView::cut(bool realcut)
-{
- if (available()) {
- hideCursor();
- update(text, BufferView::SELECT|BufferView::FITCUR);
- text->cutSelection(this, true, realcut);
- update(text, BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE);
- owner()->message(_("Cut"));
- }
-}
-
-
-void BufferView::paste()
-{
- if (!available())
- return;
-
- owner()->message(_("Paste"));
-
- hideCursor();
- // clear the selection
- toggleSelection();
- text->clearSelection();
- update(text, BufferView::SELECT|BufferView::FITCUR);
-
- // paste
- text->pasteSelection(this);
- // bug 393
- text->clearSelection();
- update(text, BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE);
-// why fake a selection only I think it should be a real one and not only
-// a painted one (Jug 20020318).
-#if 0
- // clear the selection
- toggleSelection();
- text->clearSelection();
- update(text, BufferView::SELECT|BufferView::FITCUR);
-#endif
-}
-
-
-/* these functions are for the spellchecker */
+// these functions are for the spellchecker
WordLangTuple const BufferView::nextWord(float & value)
{
if (!available()) {
void BufferView::selectLastWord()
{
- if (!available()) return;
+ if (!available())
+ return;
LyXCursor cur = text->selection.cursor;
hideCursor();
void BufferView::replaceWord(string const & replacestring)
{
- if (!available()) return;
+ if (!available())
+ return;
LyXText * tt = getLyXText();
hideCursor();
update(tt, BufferView::SELECT|BufferView::FITCUR);
- /* clear the selection (if there is any) */
+ // clear the selection (if there is any)
toggleSelection(false);
update(tt, BufferView::SELECT|BufferView::FITCUR);
- /* clear the selection (if there is any) */
+ // clear the selection (if there is any)
toggleSelection(false);
tt->replaceSelectionWithString(this, replacestring);
}
}
// Then do a deep look of the inset and lock the right one
- Paragraph * par = &*(buffer()->paragraphs.begin());
int const id = inset->id();
- while (par) {
- InsetList::iterator it =
- par->insetlist.begin();
- InsetList::iterator const end =
- par->insetlist.end();
+ ParagraphList::iterator pit = buffer()->paragraphs.begin();
+ ParagraphList::iterator pend = buffer()->paragraphs.end();
+ for (; pit != pend; ++pit) {
+ InsetList::iterator it = pit->insetlist.begin();
+ InsetList::iterator end = pit->insetlist.end();
for (; it != end; ++it) {
if (it.getInset() == inset) {
- text->setCursorIntern(this, par, it.getPos());
+ text->setCursorIntern(this, &*pit, it.getPos());
theLockingInset(inset);
return true;
}
if (it.getInset()->getInsetFromID(id)) {
- text->setCursorIntern(this, par, it.getPos());
+ text->setCursorIntern(this, &*pit, it.getPos());
it.getInset()->edit(this);
return theLockingInset()->lockInsetInInset(this, inset);
}
}
- par = par->next();
}
return false;
}
// make sure we update the combo !
owner()->setLayout(getLyXText()->cursor.par()->layout()->name());
// Tell the paragraph dialog that we changed paragraph
- owner()->getDialogs()->updateParagraph();
+ owner()->getDialogs().updateParagraph();
finishUndo();
return 0;
} else if (inset && theLockingInset() &&
theLockingInset()->unlockInsetInInset(this, inset)) {
// Tell the paragraph dialog that we changed paragraph
- owner()->getDialogs()->updateParagraph();
+ owner()->getDialogs().updateParagraph();
// owner inset has updated the layout combo
finishUndo();
return 0;