]> git.lyx.org Git - features.git/commitdiff
shuffle code around.
authorAndré Pönitz <poenitz@gmx.net>
Wed, 3 Oct 2007 18:18:47 +0000 (18:18 +0000)
committerAndré Pönitz <poenitz@gmx.net>
Wed, 3 Oct 2007 18:18:47 +0000 (18:18 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20703 a592a061-630c-0410-9148-cb99ea01b6c8

src/LyXFunc.cpp
src/callback.cpp
src/callback.h

index 58a1dee39a9fa52814abca9df4731778f775a42f..c6dd2ed9e6f4eb437c1900b3da72a1fffe36f56c 100644 (file)
@@ -1287,11 +1287,16 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
                        updateFlags = Update::None;
                        break;
 
-               case LFUN_FILE_NEW:
+               case LFUN_FILE_NEW: {
                        BOOST_ASSERT(lyx_view_);
-                       newFile(*lyx_view_, argument);
+                       string name;
+                       string tmpname = split(argument, name, ':'); // Split filename
+                       Buffer * const b = newFile(name, tmpname);
+                       if (b)
+                               lyx_view_->setBuffer(b);
                        updateFlags = Update::None;
                        break;
+               }
 
                case LFUN_FILE_OPEN:
                        BOOST_ASSERT(lyx_view_);
index 2f0aff354b2b7d9444feb26776bbdc8ca3ab5a34..11559d6833f2e3cea48407163d243486acc9040b 100644 (file)
@@ -91,28 +91,6 @@ using frontend::LyXView;
 
 namespace Alert = frontend::Alert;
 
-//
-// Copyright CHT Software Service GmbH
-// Uwe C. Schroeder
-//
-// create new file with template
-// SERVERCMD !
-//
-void newFile(LyXView & lv, string const & filename)
-{
-       // Split argument by :
-       string name;
-       string tmpname = split(filename, name, ':');
-       LYXERR(Debug::INFO) << "Arg is " << filename
-                           << "\nName is " << name
-                           << "\nTemplate is " << tmpname << endl;
-
-       Buffer * const b = newFile(name, tmpname);
-       if (b)
-               lv.setBuffer(b);
-}
-
-
 // Insert plain text file (if filename is empty, prompt for one)
 void insertPlaintextFile(BufferView * bv, string const & f, bool asParagraph)
 {
index dc9e8465fa3b8a2303a7a1dd1535b97f3a45b7e0..dac259e0a1f1f30bc19263305c4b8a8d1ed6a9c1 100644 (file)
@@ -30,8 +30,6 @@ extern bool quitting;
 docstring const getContentsOfPlaintextFile(BufferView * bv,
                std::string const & f, bool asParagraph);
 ///
-void newFile(frontend::LyXView & lv, std::string const & filename);
-///
 void insertPlaintextFile(BufferView * bv, std::string const & f, bool asParagraph);
 ///
 void reconfigure(frontend::LyXView & lv, std::string const & option);