]> git.lyx.org Git - lyx.git/blobdiff - src/Text3.cpp
Fixed some lines that were too long. It compiled afterwards.
[lyx.git] / src / Text3.cpp
index 7231f07cfad293cd97d3f27120c4aea254c7bdfb..1d3f0e30dff6d41d3ef1c8ceca73660ffbba5566 100644 (file)
@@ -983,14 +983,13 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
                break;
        }
 
-       case LFUN_DATE_INSERT:
-               if (cmd.argument().empty())
-                       lyx::dispatch(FuncRequest(LFUN_SELF_INSERT,
-                               formatted_time(current_time())));
-               else
-                       lyx::dispatch(FuncRequest(LFUN_SELF_INSERT,
-                               formatted_time(current_time(), to_utf8(cmd.argument()))));
+       case LFUN_DATE_INSERT: {
+               string const format = cmd.argument().empty()
+                       ? lyxrc.date_insert_format : to_utf8(cmd.argument());
+               string const time = formatted_time(current_time(), format);
+               lyx::dispatch(FuncRequest(LFUN_SELF_INSERT, time));
                break;
+       }
 
        case LFUN_MOUSE_TRIPLE:
                if (cmd.button() == mouse_button::button1) {