+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
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
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
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;
* 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()
{
}
+GraphicsCache::~GraphicsCache()
+{
+ delete singleton;
+}
+
+
GraphicsCacheItem *
-GraphicsCache::addFile(string filename)
+GraphicsCache::addFile(string const & filename)
{
CacheType::const_iterator it = cache.find(filename);
return 0;
}
+
void
-GraphicsCache::removeFile(string filename)
+GraphicsCache::removeFile(string const & filename)
{
CacheType::const_iterator it = cache.find(filename);
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;
typedef std::map<string, GraphicsCacheItem *> CacheType;
CacheType cache;
};
-
-GraphicsCache * GraphicsCache::singleton = 0;
-
#endif
* This file Copyright 2000 Baruch Even
* ================================================= */
+#include <config.h>
+
#ifdef __GNUG__
#pragma implementation
#endif
-#include <config.h>
#include "GraphicsCacheItem.h"
#pragma interface
#endif
+///
class GraphicsCacheItem {
public:
- ~GraphicsCacheItem() {}
-
private:
+ ///
GraphicsCacheItem() {}
-
+ //
friend class GraphicsCache;
};
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();
///
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
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:
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:
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) {