]> git.lyx.org Git - features.git/commitdiff
s/isBufferValid/isBufferLoaded/
authorRichard Heck <rgheck@comcast.net>
Mon, 8 Mar 2010 18:57:42 +0000 (18:57 +0000)
committerRichard Heck <rgheck@comcast.net>
Mon, 8 Mar 2010 18:57:42 +0000 (18:57 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33677 a592a061-630c-0410-9148-cb99ea01b6c8

src/insets/Inset.cpp
src/insets/Inset.h
src/insets/InsetBibitem.cpp
src/insets/InsetBibtex.cpp
src/insets/InsetQuotes.cpp
src/mathed/InsetMathHull.cpp
src/mathed/MathMacroTemplate.cpp

index a1ff2392da563d24a3e55b0d1519ed9e931e722c..5df7d417207ac075e0bbb07290c1735c3148bef4 100644 (file)
@@ -198,7 +198,7 @@ Buffer const & Inset::buffer() const
 }
 
 
-bool Inset::isBufferValid() const
+bool Inset::isBufferLoaded() const
 {
        return buffer_ && theBufferList().isLoaded(buffer_);
 }
index 01907cb330ec9ab2eb51eab064eb0104cef28458..50c05645ee85192c7082d71a2afa67f4d08412c4 100644 (file)
@@ -107,9 +107,10 @@ public:
        /// 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.
        /**
index 3191bebd1ccedbae23bf4068b3e6f379d20fa889..46f30e214754c24b04d1c4f010a1776b7edbb851 100644 (file)
@@ -62,7 +62,7 @@ InsetBibitem::InsetBibitem(Buffer * buf, InsetCommandParams const & p)
 
 InsetBibitem::~InsetBibitem()
 {
-       if (isBufferValid())
+       if (isBufferLoaded())
                buffer_->invalidateBibinfoCache();
 }
 
index 073d2f113bbc1a6fe3a6f78640a6332fd47ec245..9a3f8d0033d6810ea29302ba2a435964322fb9e7 100644 (file)
@@ -59,7 +59,7 @@ InsetBibtex::InsetBibtex(Buffer * buf, InsetCommandParams const & p)
 
 InsetBibtex::~InsetBibtex()
 {
-       if (isBufferValid())
+       if (isBufferLoaded())
                buffer_->invalidateBibinfoCache();
 }
 
index e56d809decf53fd6b92a0cf43d195b7f30306aef..cf8a941ddaab6f24089daae83626d19196057149 100644 (file)
@@ -185,7 +185,7 @@ void InsetQuotes::parseString(string const & s)
 
 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]);
 
index 62a28ec4c99005711f938a808d22c37a6517018d..88147a48eda5c4fe1d3e595cf37766ec816daaa9 100644 (file)
@@ -471,7 +471,7 @@ static docstring latexString(InsetMathHull const & inset)
        // 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);
index 5c1dd7bf3785caf05e950ab3ee049e75e9bd3aa6..17688c3b9003eddbc3e4e3542a5fc66e8dee18a1 100644 (file)
@@ -673,7 +673,7 @@ void MathMacroTemplate::shiftArguments(size_t from, int by)
 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();