]> git.lyx.org Git - lyx.git/commitdiff
27 moved, 19 killed...
authorAndré Pönitz <poenitz@gmx.net>
Tue, 27 Aug 2002 13:39:27 +0000 (13:39 +0000)
committerAndré Pönitz <poenitz@gmx.net>
Tue, 27 Aug 2002 13:39:27 +0000 (13:39 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5119 a592a061-630c-0410-9148-cb99ea01b6c8

src/BufferView_pimpl.C
src/text3.C

index b0bac3161019d4a7eefc5c2bd5a99d70768e13f0..00c98f725dfbd9deec83fe17089b2e840e5b84ae 100644 (file)
 #include "support/LAssert.h"
 #include "support/lstrings.h"
 #include "support/filetools.h"
-#include "support/lyxfunctional.h"
 
 #include <boost/bind.hpp>
 #include <boost/signals/connection.hpp>
 
 #include <cstdio>
-#include <ctime>
 #include <unistd.h>
 #include <sys/wait.h>
-#include <clocale>
 
 
-#ifndef CXX_GLOBAL_CSTD
-using std::tm;
-using std::localtime;
-using std::time;
-using std::setlocale;
-using std::strftime;
-#endif
-
 using std::vector;
 using std::find_if;
 using std::find;
@@ -94,15 +83,12 @@ using std::make_pair;
 using std::min;
 
 using lyx::pos_type;
-using lyx::textclass_type;
 
 /* the selection possible is needed, that only motion events are
  * used, where the bottom press event was on the drawing area too */
 bool selection_possible = false;
 
 extern BufferList bufferlist;
-extern char ascii_type;
-
 extern int bibitemMaxWidth(BufferView *, LyXFont const &);
 
 
@@ -892,7 +878,6 @@ Inset * BufferView::Pimpl::checkInsetHit(LyXText * text, int & x, int & y)
        }
 
        // look at previous position
-
        if (cursor.pos() == 0) {
                return 0;
        }
@@ -1859,35 +1844,6 @@ bool BufferView::Pimpl::dispatch(FuncRequest const & ev)
        }
                break;
 
-       case LFUN_DATE_INSERT:  // jdblair: date-insert cmd
-       {
-               time_t now_time_t = time(NULL);
-               struct tm * now_tm = localtime(&now_time_t);
-               setlocale(LC_TIME, "");
-               string arg;
-               if (!ev.argument.empty())
-                       arg = ev.argument;
-               else
-                       arg = lyxrc.date_insert_format;
-               char datetmp[32];
-               int const datetmp_len =
-                       ::strftime(datetmp, 32, arg.c_str(), now_tm);
-
-               LyXText * lt = bv_->getLyXText();
-
-               for (int i = 0; i < datetmp_len; i++) {
-                       lt->insertChar(bv_, datetmp[i]);
-                       update(lt,
-                              BufferView::SELECT
-                              | BufferView::FITCUR
-                              | BufferView::CHANGE);
-               }
-
-               lt->selection.cursor = lt->cursor;
-               moveCursorUpdate(false);
-       }
-       break;
-
        case LFUN_UNKNOWN_ACTION:
                ev.errorMessage(N_("Unknown function!"));
                break;
index 42f9ca54d61356cd819769795a5d07a17c9d63ac..007e0ab6e066d463e24fcf184c1c0748d03d7714 100644 (file)
@@ -33,6 +33,9 @@
 #include "insets/insetcommand.h"
 #include "undo_funcs.h"
 
+#include <ctime>
+#include <clocale>
+
 using std::endl;
 
 extern string current_layout;
@@ -1046,6 +1049,28 @@ Inset::RESULT LyXText::dispatch(FuncRequest const & cmd)
                break;
        }
 
+       case LFUN_DATE_INSERT:  { // jdblair: date-insert cmd
+               time_t now_time_t = time(NULL);
+               struct tm * now_tm = localtime(&now_time_t);
+               setlocale(LC_TIME, "");
+               string arg;
+               if (!cmd.argument.empty())
+                       arg = cmd.argument;
+               else
+                       arg = lyxrc.date_insert_format;
+               char datetmp[32];
+               int const datetmp_len =
+                       ::strftime(datetmp, 32, arg.c_str(), now_tm);
+
+               for (int i = 0; i < datetmp_len; i++) {
+                       insertChar(bv, datetmp[i]);
+                       update(bv, true);
+               }
+               selection.cursor = cursor;
+               bv->moveCursorUpdate(false);
+               break;
+       }
+
        case LFUN_SELFINSERT: {
                if (cmd.argument.empty())
                        break;