]> git.lyx.org Git - features.git/blobdiff - src/Paragraph.cpp
Set advanced repl_buffer internal as well (#12246)
[features.git] / src / Paragraph.cpp
index 8ac87d31c2d2060cfa08f56d30d417a110c02023..6248d8ebdff3187a29de22a32ac9b44d2139951d 100644 (file)
@@ -71,8 +71,8 @@
 using namespace std;
 using namespace lyx::support;
 
-// OSX clang, gcc < 4.8.0, and msvc < 2015 do not support C++11 thread_local
-#if defined(__APPLE__) || (defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 8)
+// OSX clang and msvc < 2015 do not support C++11 thread_local
+#if defined(__APPLE__)
 #define THREAD_LOCAL_STATIC static __thread
 #elif defined(_MSC_VER) && (_MSC_VER < 1900)
 #define THREAD_LOCAL_STATIC static __declspec(thread)
@@ -835,8 +835,9 @@ void Paragraph::Private::insertChar(pos_type pos, char_type c,
        speller_state_.increasePosAfterPos(pos);
 
        // Update bookmarks
-       theSession().bookmarks().adjustPosAfterPos(inset_owner_->buffer().fileName(),
-                                                  id_, pos, 1);
+       if (inset_owner_ && inset_owner_->isBufferValid())
+               theSession().bookmarks().adjustPosAfterPos(inset_owner_->buffer().fileName(),
+                                                      id_, pos, 1);
 }
 
 
@@ -922,8 +923,9 @@ bool Paragraph::eraseChar(pos_type pos, bool trackChanges)
        d->speller_state_.refreshLast(size());
 
        // Update bookmarks
-       theSession().bookmarks().adjustPosAfterPos(d->inset_owner_->buffer().fileName(),
-                                                  d->id_, pos, -1);
+       if (d->inset_owner_ && d->inset_owner_->isBufferValid())
+               theSession().bookmarks().adjustPosAfterPos(d->inset_owner_->buffer().fileName(),
+                                                      d->id_, pos, -1);
 
        return true;
 }