From 38fd440edb31b117678c0dda76b3a58dfe182ed2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andr=C3=A9=20P=C3=B6nitz?= Date: Tue, 27 Aug 2002 13:39:27 +0000 Subject: [PATCH] 27 moved, 19 killed... git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5119 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/BufferView_pimpl.C | 44 ------------------------------------------ src/text3.C | 25 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 44 deletions(-) diff --git a/src/BufferView_pimpl.C b/src/BufferView_pimpl.C index b0bac31610..00c98f725d 100644 --- a/src/BufferView_pimpl.C +++ b/src/BufferView_pimpl.C @@ -65,26 +65,15 @@ #include "support/LAssert.h" #include "support/lstrings.h" #include "support/filetools.h" -#include "support/lyxfunctional.h" #include #include #include -#include #include #include -#include -#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; diff --git a/src/text3.C b/src/text3.C index 42f9ca54d6..007e0ab6e0 100644 --- a/src/text3.C +++ b/src/text3.C @@ -33,6 +33,9 @@ #include "insets/insetcommand.h" #include "undo_funcs.h" +#include +#include + 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; -- 2.39.2