]> git.lyx.org Git - lyx.git/blobdiff - src/LyXFunc.cpp
Continue working on the embedding feature. An additional parameter updateFile is...
[lyx.git] / src / LyXFunc.cpp
index 7a639d4272ea6f1b1af65946d98c548bb67ce2ee..138865d87c1f017ca657514d86d5a311044f8ce6 100644 (file)
@@ -21,7 +21,7 @@
 
 #include "LyXFunc.h"
 
-#include "BaseClassList.h"
+#include "LayoutFile.h"
 #include "BranchList.h"
 #include "buffer_funcs.h"
 #include "Buffer.h"
@@ -709,14 +709,14 @@ void showPrintError(string const & name)
 
 bool loadLayoutFile(string const & name, string const & buf_path)
 {
-       if (!BaseClassList::get().haveClass(name)) {
+       if (!LayoutFileList::get().haveClass(name)) {
                lyxerr << "Document class \"" << name
                       << "\" does not exist."
                       << endl;
                return false;
        }
 
-       LayoutFile & tc = BaseClassList::get()[name];
+       LayoutFile & tc = LayoutFileList::get()[name];
        if (!tc.load(buf_path)) {
                docstring s = bformat(_("The document class %1$s."
                                   "could not be loaded."), from_utf8(name));
@@ -1523,13 +1523,9 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
 
                case LFUN_BUFFER_PARAMS_APPLY: {
                        BOOST_ASSERT(lyx_view_);
-                       biblio::CiteEngine const oldEngine =
-                                       lyx_view_->buffer()->params().getEngine();
                        
                        Buffer * buffer = lyx_view_->buffer();
-
                        DocumentClass * oldClass = buffer->params().documentClassPtr();
-
                        Cursor & cur = view()->cursor();
                        cur.recordUndoFullDocument();
                        
@@ -1547,24 +1543,10 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
                        
                        updateLayout(oldClass, buffer);
                        
-                       biblio::CiteEngine const newEngine =
-                                       lyx_view_->buffer()->params().getEngine();
-                       
-                       if (oldEngine != newEngine) {
-                               FuncRequest fr(LFUN_INSET_REFRESH);
-       
-                               Inset & inset = lyx_view_->buffer()->inset();
-                               InsetIterator it  = inset_iterator_begin(inset);
-                               InsetIterator const end = inset_iterator_end(inset);
-                               for (; it != end; ++it)
-                                       if (it->lyxCode() == CITE_CODE)
-                                               it->dispatch(cur, fr);
-                       }
-                       
                        updateFlags = Update::Force | Update::FitCursor;
-                       // We are here most certainaly because of a change in the document
-                       // It is then better to make sure that all dialogs are in sync
-                       // with current document settings. LyXView::restartCursor() achieve this.
+                       // We are most certainly here because of a change in the document
+                       // It is then better to make sure that all dialogs are in sync with
+                       // current document settings. LyXView::restartCursor() achieve this.
                        lyx_view_->restartCursor();
                        break;
                }
@@ -1601,7 +1583,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
                                break;
 
                        LayoutFile const * old_layout = buffer->params().baseClass();
-                       LayoutFile const * new_layout = &(BaseClassList::get()[argument]);
+                       LayoutFile const * new_layout = &(LayoutFileList::get()[argument]);
 
                        if (old_layout == new_layout)
                                // nothing to do
@@ -1622,7 +1604,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
                        Buffer * buffer = lyx_view_->buffer();
                        DocumentClass * oldClass = buffer->params().documentClassPtr();
                        LayoutFileIndex bc = buffer->params().baseClassID();
-                       BaseClassList::get().reset(bc);
+                       LayoutFileList::get().reset(bc);
                        buffer->params().makeDocumentClass();
                        updateLayout(oldClass, buffer);
                        updateFlags = Update::Force | Update::FitCursor;