}
-bool Inset::isBufferValid() const
+bool Inset::isBufferLoaded() const
{
return buffer_ && theBufferList().isLoaded(buffer_);
}
/// retrieve associated Buffer
virtual Buffer & buffer();
virtual Buffer const & buffer() const;
- /// This checks whether the Buffer * actually points to an open
- /// Buffer. It might not if that Buffer has been closed.
- bool isBufferValid() const;
+ /// Returns true if buffer_ actually points to a Buffer that has
+ /// been loaded into LyX and is still open. Note that this will
+ /// always return false for cloned Buffers.
+ bool isBufferLoaded() const;
/// initialize view for this inset.
/**
InsetBibitem::~InsetBibitem()
{
- if (isBufferValid())
+ if (isBufferLoaded())
buffer_->invalidateBibinfoCache();
}
InsetBibtex::~InsetBibtex()
{
- if (isBufferValid())
+ if (isBufferLoaded())
buffer_->invalidateBibinfoCache();
}
docstring InsetQuotes::displayString() const
{
- Language const * loclang = isBufferValid() ? buffer().params().language : 0;
+ Language const * loclang = isBufferLoaded() ? buffer().params().language : 0;
int const index = quote_index[side_][language_];
docstring retdisp = docstring(1, display_quote_char[times_][index]);
// first time as a whole, and the second time only the inner math.
// In this last case inset.buffer() would be invalid.
static Encoding const * encoding = 0;
- if (inset.isBufferValid())
+ if (inset.isBufferLoaded())
encoding = &(inset.buffer().params().encoding());
WriteStream wi(ls, false, true, WriteStream::wsPreview, encoding);
inset.write(wi);
int MathMacroTemplate::maxArgumentInDefinition() const
{
// We don't have a buffer when pasting from the clipboard (bug 6014).
- Buffer const * macro_buffer = this->isBufferValid() ? &buffer() : 0;
+ Buffer const * macro_buffer = this->isBufferLoaded() ? &buffer() : 0;
int maxArg = 0;
DocIterator it = doc_iterator_begin(macro_buffer, this);
it.idx() = defIdx();