}
-void GCache::update(InsetGraphics const & inset)
+void GCache::update(InsetGraphics const & inset, string const & filepath)
{
// A subset only of InsetGraphicsParams is needed for display purposes.
// The GraphicsParams c-tor also interrogates lyxrc to ascertain whether
// to display or not.
- GParams params(inset.params());
+ GParams params(inset.params(), filepath);
// Each inset can reference only one file, so check the cache for any
// graphics files referenced by inset. If the name of this file is
GCache::CacheType::iterator
GCache::find(InsetGraphics const & inset)
{
- CacheType::iterator it = cache->begin();
- for (; it != cache->end(); ++it) {
+ CacheType::iterator it = cache->begin();
+ CacheType::iterator end = cache->end();
+ for (; it != end; ++it) {
if (it->second->referencedBy(inset))
return it;
}
-
+
return cache->end();
}
GCache::CacheType::const_iterator
GCache::find(InsetGraphics const & inset) const
{
- CacheType::const_iterator it = cache->begin();
- for (; it != cache->end(); ++it) {
+ CacheType::const_iterator it = cache->begin();
+ CacheType::const_iterator end = cache->end();
+ for (; it != end; ++it) {
if (it->second->referencedBy(inset))
return it;
}
-
+
return cache->end();
}