]> git.lyx.org Git - features.git/commitdiff
small changes read ChangeLog
authorLars Gullik Bjønnes <larsbj@gullik.org>
Mon, 31 Jul 2000 16:39:50 +0000 (16:39 +0000)
committerLars Gullik Bjønnes <larsbj@gullik.org>
Mon, 31 Jul 2000 16:39:50 +0000 (16:39 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@941 a592a061-630c-0410-9148-cb99ea01b6c8

ChangeLog
po/POTFILES.in
src/BufferView2.C
src/graphics/GraphicsCache.C
src/graphics/GraphicsCache.h
src/graphics/GraphicsCacheItem.C
src/graphics/GraphicsCacheItem.h
src/lyxlex_pimpl.C
src/lyxlex_pimpl.h
src/support/translator.h

index 2dc2c23bf4e93af441a046070da4b4282c089a38..bfd2adaed4c6cda83e06d07cbe6985c4441d6302 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,21 @@
+2000-07-31  Lars Gullik Bjønnes  <larsbj@lyx.org>
+
+       * src/support/translator.h (equal_1st_in_pair::operator()): take
+       const ref pair_type as arg. 
+       (equal_2nd_in_pair::operator()): ditto
+       (Translator::~Translator): remove empty d-tor.
+
+       * src/graphics/GraphicsCache.C: move include config.h to top, also
+       put initialization of GraphicsCache::singleton here.
+       (~GraphicsCache): move here
+       (addFile): take const ref as arg
+       (removeFile): ditto
+
+       * src/lyxlex_pimpl.C (setFile): comment in old behaviour
+
+       * src/BufferView2.C (insertLyXFile): change te with/without header
+       check slightly.
+
 2000-07-31  Jean-Marc Lasgouttes  <Jean-Marc.Lasgouttes@inria.fr>
 
        * src/frontends/xforms/FormGraphics.C (apply): add some
index 142c74d2a0da2a516a99724dda343dc52e7a991b..84a5cee92bafbf779f68920321191881c433c123 100644 (file)
@@ -26,7 +26,6 @@ src/ext_l10n.h
 src/filedlg.C
 src/FontLoader.C
 src/form1.C
-src/frontends/gnome/Menubar_pimpl.C
 src/frontends/xforms/FormCitation.C
 src/frontends/xforms/form_citation.C
 src/frontends/xforms/FormCopyright.C
@@ -37,12 +36,6 @@ src/frontends/xforms/FormPreferences.C
 src/frontends/xforms/form_preferences.C
 src/frontends/xforms/FormPrint.C
 src/frontends/xforms/form_print.C
-src/frontends/xforms/forms/form_citation.C
-src/frontends/xforms/forms/form_copyright.C
-src/frontends/xforms/forms/form_preferences.C
-src/frontends/xforms/forms/form_print.C
-src/frontends/xforms/forms/form_tabular.C
-src/frontends/xforms/forms/form_url.C
 src/frontends/xforms/FormTabular.C
 src/frontends/xforms/form_tabular.C
 src/frontends/xforms/FormUrl.C
index c8675a0a1cc53abd8751415a4cf1c2bcbb20fa52..f241071ed2787093c4bee704cabafa728a8c3d97 100644 (file)
@@ -73,10 +73,11 @@ bool BufferView::insertLyXFile(string const & filen)
                           MakeDisplayPath(fname, 50));
                return false;
        }
+       
+       char c = ifs.peek();
+       
        LyXLex lex(0, 0);
        lex.setStream(ifs);
-       char c; ifs.get(c);
-       ifs.putback(c);
 
        bool res = true;
 
index a52e7291f33937a264413a7bb50d2c6aa23156d7..1721b0c6f38835ca056c95da816d4b7daf9d77be 100644 (file)
@@ -9,13 +9,18 @@
  *          This file Copyright 2000 Baruch Even
  * ================================================= */
 
+#include <config.h>
+
 #ifdef __GNUG__
 #pragma implementation
 #endif
 
-#include <config.h>
 #include "GraphicsCache.h"
 
+
+GraphicsCache * GraphicsCache::singleton = 0;
+
+
 GraphicsCache * 
 GraphicsCache::getInstance()
 {
@@ -27,8 +32,14 @@ GraphicsCache::getInstance()
 }
 
 
+GraphicsCache::~GraphicsCache()
+{
+        delete singleton;
+}
+
+
 GraphicsCacheItem * 
-GraphicsCache::addFile(string filename)
+GraphicsCache::addFile(string const & filename)
 {
     CacheType::const_iterator it = cache.find(filename);
     
@@ -39,8 +50,9 @@ GraphicsCache::addFile(string filename)
     return 0;
 }
 
+
 void
-GraphicsCache::removeFile(string filename)
+GraphicsCache::removeFile(string const & filename)
 {
     CacheType::const_iterator it = cache.find(filename);
     
index 881a90d13b832f3016a7c6fe12bd01a3c2ff3836..d64df5f5d321193930dcc2b9c1fb2ab5433721d7 100644 (file)
@@ -33,19 +33,17 @@ public:
     static GraphicsCache * getInstance();
 
     /// Add a file to the cache.
-    GraphicsCacheItem * addFile(string filename);
+    GraphicsCacheItem * addFile(string const & filename);
 
 private:
     /// Remove a cache item if it's count has gone to zero.
-    void removeFile(string filename);
+    void removeFile(string const & filename);
     
     /// Private c-tor so we can control how many objects are instantiated.
     GraphicsCache() {}
 
     /// Private d-tor so that no-one will destroy us.
-    ~GraphicsCache() {
-        delete singleton;
-    }
+    ~GraphicsCache();
 
     /// Holder of the single instance of the class.
     static GraphicsCache * singleton;
@@ -53,7 +51,4 @@ private:
     typedef std::map<string, GraphicsCacheItem *> CacheType;
     CacheType cache;
 };
-
-GraphicsCache * GraphicsCache::singleton = 0;
-
 #endif
index 172c2e33bb0dc74d88078359e94fed1c2b7aa62d..c2704e62cbfd3c7a56279ac4cb891e37e746fceb 100644 (file)
@@ -9,10 +9,11 @@
  *          This file Copyright 2000 Baruch Even
  * ================================================= */
 
+#include <config.h>
+
 #ifdef __GNUG__
 #pragma implementation
 #endif
 
-#include <config.h>
 #include "GraphicsCacheItem.h"
 
index da347f3d0274c23854468d74a323729b212fb9de..e139fbffc46a4d24387dbfc728878aab066efc9b 100644 (file)
 #pragma interface
 #endif
 
+///
 class GraphicsCacheItem {
 public:
-    ~GraphicsCacheItem() {}
-    
 private:
+    ///
     GraphicsCacheItem() {}
-
+    //
     friend class GraphicsCache;
 };
 
index f12f119e463526e53afd897f38e896a278abb6c2..7da1fbef105ff296f19cabad3af133cabe7bef0f 100644 (file)
@@ -114,11 +114,11 @@ void LyXLex::Pimpl::popTable()
 
 bool LyXLex::Pimpl::setFile(string const & filename)
 {
-       //if (fb__.is_open())
-       //      lyxerr << "Error in LyXLex::setFile: "
-       //              "file or stream already set." << endl;
+       if (fb__.is_open())
+               lyxerr << "Error in LyXLex::setFile: "
+                       "file or stream already set." << endl;
        fb__.open(filename.c_str(), ios::in);
-       //is.rdbuf(&fb__);
+       is.rdbuf(&fb__);
        name = filename;
        lineno = 0;
        return fb__.is_open() && is.good();
index 2991328f79c46f42f0ce15d03c1789ee28e52a0f..0e1b1f265cae2593985b97b5080238707be13d56 100644 (file)
@@ -33,34 +33,33 @@ struct LyXLex::Pimpl {
                ///
                int table_siz;
        };
-       
+       ///
        Pimpl(keyword_item * tab, int num);
-       
+       ///
        string GetString() const;
-       
+       ///
        void printError(string const & message) const;
-       
+       ///
        void printTable(std::ostream & os);
-       
+       ///
        void pushTable(keyword_item * tab, int num);
-       
+       ///
        void popTable();
-       
+       ///
        bool setFile(string const & filename);
-       
+       ///
        void setStream(std::istream & i);
-       
+       ///
        bool next(bool esc = false);
-       
        ///
        int search_kw(char const * const tag) const;
-       
+       ///
        int lex();
-       
+       ///
        bool EatLine();
-       
+       ///
        bool nextToken();
-       
+       ///
        void pushToken(string const &);
 
        /// fb__ is only used to open files, the stream is accessed through is
index 2170d5fa6a91c3b512ef0292ccf3713c1d15f63c..7c6fcdf360e17e5d508c76db6180a77af66e4671 100644 (file)
@@ -25,7 +25,7 @@ public:
     equal_1st_in_pair(T1 const & value) : value_(value) {}
 
     typedef std::pair<T1, T2> pair_type;
-    bool operator() (pair_type p) const {
+    bool operator() (pair_type const & p) const {
         return p.first == value_;
     }
 private:
@@ -38,7 +38,7 @@ public:
     equal_2nd_in_pair(T2 const & value) : value_(value) {}
 
     typedef std::pair<T1, T2> pair_type;
-    bool operator() (pair_type p) const {
+    bool operator() (pair_type const & p) const {
         return p.second == value_;
     }
 private:
@@ -62,8 +62,6 @@ public:
     Translator(T1 const & t1, T2 const & t2) 
         : default_t1(t1), default_t2(t2) 
         {}
-    /// d-tor. Not virtual since it's not going to be inherited.
-    ~Translator() {}
 
     /// Add a mapping to the translator.
     void addPair(T1 const & first, T2 const & second) {