]> git.lyx.org Git - lyx.git/blobdiff - src/LyXFunc.cpp
Cosmetics.
[lyx.git] / src / LyXFunc.cpp
index d0826210b9b1af5a1373e34791f944765f07de4b..e0eafe9b99a036223ca6348a585603557815164a 100644 (file)
 #include "LyXFunc.h"
 
 #include "BranchList.h"
-#include "Buffer.h"
 #include "buffer_funcs.h"
+#include "Buffer.h"
 #include "BufferList.h"
 #include "BufferParams.h"
 #include "BufferView.h"
-#include "bufferview_funcs.h"
+#include "callback.h"
+#include "Color.h"
 #include "Cursor.h"
 #include "CutAndPaste.h"
 #include "debug.h"
 #include "Intl.h"
 #include "KeyMap.h"
 #include "Language.h"
-#include "Color.h"
-#include "Session.h"
-#include "LyX.h"
-#include "callback.h"
+#include "Lexer.h"
 #include "LyXAction.h"
 #include "lyxfind.h"
-#include "Lexer.h"
+#include "LyX.h"
 #include "LyXRC.h"
-#include "Row.h"
-#include "Server.h"
-#include "TextClassList.h"
 #include "LyXVC.h"
 #include "Paragraph.h"
-#include "ParIterator.h"
 #include "ParagraphParameters.h"
+#include "ParIterator.h"
+#include "Row.h"
+#include "Server.h"
+#include "Session.h"
+#include "TextClassList.h"
+#include "ToolbarBackend.h"
 #include "Undo.h"
 
 #include "insets/InsetBox.h"
@@ -115,8 +115,6 @@ namespace fs = boost::filesystem;
 
 namespace lyx {
 
-using bv_funcs::freefont2string;
-
 using frontend::LyXView;
 
 using support::absolutePath;
@@ -150,8 +148,7 @@ namespace Alert = frontend::Alert;
 
 namespace {
 
-bool getLocalStatus(Cursor cursor,
-              FuncRequest const & cmd, FuncStatus & status)
+bool getLocalStatus(Cursor cursor, FuncRequest const & cmd, FuncStatus & status)
 {
        // Try to fix cursor in case it is broken.
        cursor.fixIfBroken();
@@ -695,6 +692,8 @@ FuncStatus LyXFunc::getStatus(FuncRequest const & cmd) const
        case LFUN_BUFFER_WRITE_AS:
        case LFUN_BUFFER_UPDATE:
        case LFUN_BUFFER_VIEW:
+       case LFUN_MASTER_BUFFER_UPDATE:
+       case LFUN_MASTER_BUFFER_VIEW:
        case LFUN_BUFFER_IMPORT:
        case LFUN_BUFFER_AUTO_SAVE:
        case LFUN_RECONFIGURE:
@@ -999,6 +998,16 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
                        Exporter::preview(lyx_view_->buffer(), argument);
                        break;
 
+               case LFUN_MASTER_BUFFER_UPDATE:
+                       BOOST_ASSERT(lyx_view_ && lyx_view_->buffer() && lyx_view_->buffer()->getMasterBuffer());
+                       Exporter::Export(lyx_view_->buffer()->getMasterBuffer(), argument, true);
+                       break;
+
+               case LFUN_MASTER_BUFFER_VIEW:
+                       BOOST_ASSERT(lyx_view_ && lyx_view_->buffer() && lyx_view_->buffer()->getMasterBuffer());
+                       Exporter::preview(lyx_view_->buffer()->getMasterBuffer(), argument);
+                       break;
+
                case LFUN_BUILD_PROGRAM:
                        BOOST_ASSERT(lyx_view_ && lyx_view_->buffer());
                        Exporter::Export(lyx_view_->buffer(), "program", true);
@@ -1187,7 +1196,8 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
 
                case LFUN_RECONFIGURE:
                        BOOST_ASSERT(lyx_view_);
-                       reconfigure(*lyx_view_);
+                       // argument is any additional parameter to the configure.py command
+                       reconfigure(*lyx_view_, argument);
                        break;
 
                case LFUN_HELP_OPEN: {
@@ -1416,7 +1426,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
                                InsetBranchParams p;
                                data = InsetBranchMailer::params2string(p);
                        } else if (name == "citation") {
-                               InsetCommandParams p("cite");
+                               InsetCommandParams p("citation");
                                data = InsetCommandMailer::params2string(name, p);
                        } else if (name == "ert") {
                                data = InsetERTMailer::params2string(InsetCollapsable::Open);
@@ -1496,7 +1506,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
                                        arg = token(argument, '|', 0);
                                        opt1 = token(argument, '|', 1);
                                }
-                               InsetCommandParams icp("cite");
+                               InsetCommandParams icp("citation");
                                icp["key"] = from_utf8(arg);
                                if (!opt1.empty())
                                        icp["before"] = from_utf8(opt1);