X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FTextCache.h;h=c65111d45b9474821c9af18dff9286e9a48baf2a;hb=6bba977f42b0cde753ac2ffd26f3f9c6b32ba0b6;hp=68af6be328c73290d8a76407c767bb45761b15fa;hpb=2889b5fd3e8987d0c265ff4726a7fb6c6cb6c034;p=features.git diff --git a/src/TextCache.h b/src/TextCache.h index 68af6be328..c65111d45b 100644 --- a/src/TextCache.h +++ b/src/TextCache.h @@ -19,11 +19,11 @@ #endif #include +#include #include "LString.h" #include "lyxtext.h" - -class Buffer; +#include "buffer.h" // This is only the very first implemetation and use of the TextCache, // operations on it needs to be put into a class or a namespace, that part @@ -112,21 +112,22 @@ class Buffer; class TextCache { public: /// - typedef std::vector Cache; + typedef std::map > Cache; + /// - typedef LyXText * value_type; + typedef Cache::value_type value_type; /** Returns a pointer to a LyXText that fits the provided buffer and width. Of there is no match 0 is returned. */ - LyXText * findFit(Buffer * b, unsigned short p); + LyXText * findFit(Buffer * b, int p); /** Lists all the LyXText's currently in the cache. Uses msg as header for the list. */ void show(std::ostream & o, string const & msg); /// Gives info on a single LyXText (buffer and width) - static void show(std::ostream & o, LyXText *); + static void show(std::ostream & o, value_type const &); /** Adds a LyXText to the cache iff its buffer is present in bufferlist. */ - void add(LyXText *); + void add(Buffer *, int witdth, LyXText *); /** Clears the cache. Deletes all LyXText's and releases the allocated memory. */ void clear();