]> git.lyx.org Git - features.git/commitdiff
Revert accidental commit.
authorRichard Heck <rgheck@comcast.net>
Sat, 8 Sep 2007 17:49:37 +0000 (17:49 +0000)
committerRichard Heck <rgheck@comcast.net>
Sat, 8 Sep 2007 17:49:37 +0000 (17:49 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20152 a592a061-630c-0410-9148-cb99ea01b6c8

src/Buffer.cpp
src/BufferParams.cpp
src/LyXAction.cpp
src/LyXFunc.cpp
src/TextClassList.cpp
src/TextClassList.h
src/lfuns.h

index a7bca7bd371d498cb5e050d5c2ec106451f920c2..bdf866fbe12d863ab711351cdfefe113a46e8490 100644 (file)
@@ -531,9 +531,8 @@ bool Buffer::readDocument(Lexer & lex)
        BOOST_ASSERT(paragraphs().empty());
 
        readHeader(lex);
-       TextClass const & baseClass = textclasslist[params().getBaseClass()];
-       if (!baseClass.load(filePath())) {
-               string theclass = baseClass.name();
+       if (!params().getTextClass().load(filePath())) {
+               string theclass = params().getTextClass().name();
                Alert::error(_("Can't load document class"), bformat(
                        _("Using the default document class, because the "
                                     "class %1$s could not be loaded."), from_utf8(theclass)));
index e566cdd822210626c6ab7f559a10a43fc548ba4b..b78056b5298bc4cf1394ddfee6a5a8aa64a11c56 100644 (file)
@@ -1227,18 +1227,17 @@ void BufferParams::setTextClass(TextClass_ptr tc) {
 
 bool BufferParams::setBaseClass(textclass_type tc)
 {
-       bool retVal = true;
-       if (textclasslist[tc].load())
-               baseClass_ = tc;
-       else {
-               docstring s = 
-                       bformat(_("The document class %1$s could not be loaded."),
+       if (!textclasslist[tc].load()) {
+               docstring s = bformat(_("The document class %1$s."
+                                       "could not be loaded."),
                 from_utf8(textclasslist[tc].name()));
                frontend::Alert::error(_("Could not load class"), s);
-               retVal = false;
+               return false;
        }
+       
+       baseClass_ = tc;
        makeTextClass();
-       return retVal;
+       return true;
 }
 
 
index d26b4dffeb89c91a1923c97c30baed2781988e09..fe2369cac8654ff088a7f0608d4c6f643097dbed 100644 (file)
@@ -374,7 +374,6 @@ void LyXAction::init()
                { LFUN_LISTING_INSERT, "listing-insert", Noop },
                { LFUN_LAYOUT_MODULES_CLEAR, "layout-modules-clear", Noop },
                { LFUN_LAYOUT_MODULE_ADD, "layout-module-add", Noop },
-               { LFUN_LAYOUT_RELOAD, "layout-reload", Noop },
 
                { LFUN_NOACTION, "", Noop }
        };
index ff466d0323510149fbc11b6a652c20f14662b590..2dc4086bb4484d060b6990dcb69a6534edeb3a61 100644 (file)
@@ -731,7 +731,6 @@ FuncStatus LyXFunc::getStatus(FuncRequest const & cmd) const
        case LFUN_BUFFER_PARAMS_APPLY:
        case LFUN_LAYOUT_MODULES_CLEAR:
        case LFUN_LAYOUT_MODULE_ADD:
-       case LFUN_LAYOUT_RELOAD:
        case LFUN_LYXRC_APPLY:
        case LFUN_BUFFER_NEXT:
        case LFUN_BUFFER_PREVIOUS:
@@ -1836,18 +1835,6 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
                        updateFlags = Update::Force | Update::FitCursor;
                        break;
                }
-               
-               case LFUN_LAYOUT_RELOAD: {
-                       BOOST_ASSERT(lyx_view_);
-                       Buffer * buffer = lyx_view_->buffer();
-                       TextClass_ptr oldClass = buffer->params().getTextClass_ptr();
-                       textclass_type const tc = buffer->params().getBaseClass();
-                       textclasslist.reset(tc);
-                       buffer->params().setBaseClass(tc);
-                       updateLayout(oldClass, buffer);
-                       updateFlags = Update::Force | Update::FitCursor;
-                       break;
-               }
 
                case LFUN_TEXTCLASS_LOAD:
                        loadTextclass(argument);
index bfda9d35d59f8c3e1533677052b5f19f86098a4d..aee1144668182f85c9e28504738a433817de6bae 100644 (file)
@@ -66,12 +66,11 @@ TextClassList::numberOfClass(string const & textclass) const
 TextClass const &
 TextClassList::operator[](textclass_type textclass) const
 {
-       if (textclass >= classlist_.size())
-               return classlist_[0];
-       
-       //FIXME I don't believe the following line is actually necessary (rgh)
        classlist_[textclass].load();
-       return classlist_[textclass];
+       if (textclass < classlist_.size())
+               return classlist_[textclass];
+       else
+               return classlist_[0];
 }
 
 
@@ -176,16 +175,6 @@ bool TextClassList::read()
 }
 
 
-void TextClassList::reset(textclass_type const textclass) {
-       if (textclass >= classlist_.size())
-               return;
-       TextClass const & tc = classlist_[textclass];
-       TextClass tmpl(tc.name(), tc.latexname(), tc.description(), 
-                      tc.isTeXClassAvailable());
-       classlist_[textclass] = tmpl;
-}
-
-
 std::pair<bool, textclass_type> const
 TextClassList::addTextClass(std::string const & textclass, std::string const & path)
 {
index 740b87f5364dcbbcd265f949a01868786f9b0a0f..6f8f963fc530e752c742407d8725083afc47a21e 100644 (file)
@@ -50,9 +50,6 @@ public:
 
        /// Read textclass list.  Returns false if this fails.
        bool read();
-       
-       /// Clears the textclass so as to force it to be reloaded
-       void reset(textclass_type const textclass);
 
        /// add a textclass from user local directory.
        /// Return ture/false, and textclass number
index 299166c6a23d459c8deaa6e9ea0ed18e69de1499..4a6295abf69ed7f3ed2b33fde251bdab1eb06136 100644 (file)
@@ -402,7 +402,6 @@ enum kb_action {
        LFUN_PARAGRAPH_PARAMS,           // rgh, 200708XX
        LFUN_LAYOUT_MODULES_CLEAR,       // rgh, 20070825
        LFUN_LAYOUT_MODULE_ADD,          // rgh, 20070825
-       LFUN_LAYOUT_RELOAD,              // rgh, 20070903
 
        LFUN_LASTACTION                  // end of the table
 };