]> git.lyx.org Git - lyx.git/blobdiff - src/text.C
remove unused code
[lyx.git] / src / text.C
index e29788c31c87e849cc4f5dd6e84366ad8fa2f2ef..4568a031077b7ee7aca15d6bb7b6bddbe1de749f 100644 (file)
@@ -29,6 +29,7 @@
 #include "ParagraphParameters.h"
 #include "undo_funcs.h"
 #include "WordLangTuple.h"
+#include "funcrequest.h"
 
 #include "insets/insetbib.h"
 #include "insets/insettext.h"
@@ -3947,3 +3948,49 @@ int LyXText::getDepth() const
 {
        return cursor.par()->getDepth();
 }
+
+
+Inset::RESULT LyXText::lfunAppendix(FuncRequest const & cmd)
+{
+       BufferView * bv = cmd.view();
+       // what is this good for?
+       if (!bv->available())
+               return Inset::UNDISPATCHED;
+
+       Paragraph * par = cursor.par();
+       bool start = !par->params().startOfAppendix();
+
+       // ensure that we have only one start_of_appendix in this document
+       Paragraph * tmp = ownerParagraph();
+       for (; tmp; tmp = tmp->next()) {
+               tmp->params().startOfAppendix(false);
+       }
+
+       par->params().startOfAppendix(start);
+
+       // we can set the refreshing parameters now
+       status(cmd.view(), LyXText::NEED_MORE_REFRESH);
+       refresh_y = 0;
+       refresh_row = 0; // not needed for full update
+       updateCounters(cmd.view());
+       setCursor(cmd.view(), cursor.par(), cursor.pos());
+       bv->update(this,
+                                BufferView::SELECT
+                                | BufferView::FITCUR
+                                | BufferView::CHANGE);
+       return Inset::DISPATCHED;
+}
+
+
+Inset::RESULT LyXText::dispatch(FuncRequest const & cmd)
+{
+       switch (cmd.action) {
+               case LFUN_APPENDIX:
+                       return lfunAppendix(cmd);
+
+               default:
+                       return Inset::UNDISPATCHED;
+       }
+       // shut up compiler
+       return Inset::UNDISPATCHED;
+}