]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiSpellchecker.cpp
do what the FIXME suggested
[lyx.git] / src / frontends / qt4 / GuiSpellchecker.cpp
index 6233a3b31be5e3357bb0748d2a970fd2303394b2..4e6143ad8d1e4be20a5037ba433867f500657373 100644 (file)
 #include "BufferView.h"
 #include "Cursor.h"
 #include "CutAndPaste.h"
-#include "support/debug.h"
-#include "support/gettext.h"
 #include "Language.h"
 #include "LyXRC.h"
 #include "Paragraph.h"
 
-#include "support/textutils.h"
+#include "support/debug.h"
 #include "support/docstring.h"
+#include "support/gettext.h"
 #include "support/lstrings.h"
+#include "support/textutils.h"
 
 #include <QListWidgetItem>
 
@@ -54,11 +54,10 @@ namespace frontend {
 
 
 GuiSpellchecker::GuiSpellchecker(GuiView & lv)
-       : GuiDialog(lv, "spellchecker"), exitEarly_(false),
+       : GuiDialog(lv, "spellchecker", qt_("Spellchecker")), exitEarly_(false),
          oldval_(0), newvalue_(0), count_(0), speller_(0)
 {
        setupUi(this);
-       setViewTitle(_("Spellchecker"));
 
        connect(closePB, SIGNAL(clicked()), this, SLOT(slotClose()));
        connect(replacePB, SIGNAL(clicked()), this, SLOT(replace()));
@@ -111,13 +110,6 @@ void GuiSpellchecker::replaceChanged(const QString & str)
 }
 
 
-void GuiSpellchecker::closeEvent(QCloseEvent * e)
-{
-       slotClose();
-       GuiDialog::closeEvent(e);
-}
-
-
 void GuiSpellchecker::reject()
 {
        slotClose();
@@ -231,7 +223,7 @@ static SpellBase * getSpeller(BufferParams const & bp)
 }
 
 
-bool GuiSpellchecker::initialiseParams(std::string const &)
+bool GuiSpellchecker::initialiseParams(string const &)
 {
        LYXERR(Debug::GUI, "Spellchecker::initialiseParams");
 
@@ -334,8 +326,8 @@ void GuiSpellchecker::check()
 
        ptrdiff_t start = 0;
        ptrdiff_t total = 0;
-       DocIterator it = DocIterator(buffer().inset());
-       for (start = 0; it != cur; it.forwardPos())
+       DocIterator it = doc_iterator_begin(buffer().inset());
+       for (start = 1; it != cur; it.forwardPos())
                ++start;
 
        for (total = start; it; it.forwardPos())