From: André Pönitz Date: Wed, 3 Oct 2007 18:18:47 +0000 (+0000) Subject: shuffle code around. X-Git-Tag: 1.6.10~8045 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=65d1912cfeb278f7e90de404d20efc69174df2af;p=features.git shuffle code around. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20703 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/LyXFunc.cpp b/src/LyXFunc.cpp index 58a1dee39a..c6dd2ed9e6 100644 --- a/src/LyXFunc.cpp +++ b/src/LyXFunc.cpp @@ -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_); diff --git a/src/callback.cpp b/src/callback.cpp index 2f0aff354b..11559d6833 100644 --- a/src/callback.cpp +++ b/src/callback.cpp @@ -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) { diff --git a/src/callback.h b/src/callback.h index dc9e8465fa..dac259e0a1 100644 --- a/src/callback.h +++ b/src/callback.h @@ -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);