]> git.lyx.org Git - lyx.git/blobdiff - src/DocIterator.cpp
Remove profiling.py
[lyx.git] / src / DocIterator.cpp
index b49fc2e9adde5d1c7bd0bcaec88684a9b33e7c6b..ace4498a56e91d6f4e8af525f77c567ec74544b0 100644 (file)
@@ -44,23 +44,6 @@ using namespace lyx::support;
 namespace lyx {
 
 
-DocIterator::DocIterator()
-       : boundary_(false), inset_(nullptr), buffer_(nullptr)
-{}
-
-
-// We could be able to get rid of this if only every BufferView were
-// associated to a buffer on construction.
-DocIterator::DocIterator(Buffer * buf)
-       : boundary_(false), inset_(nullptr), buffer_(buf)
-{}
-
-
-DocIterator::DocIterator(Buffer * buf, Inset * inset)
-       : boundary_(false), inset_(inset), buffer_(buf)
-{}
-
-
 DocIterator doc_iterator_begin(const Buffer * buf0, const Inset * inset0)
 {
        Buffer * buf = const_cast<Buffer *>(buf0);
@@ -512,8 +495,6 @@ void DocIterator::backwardPosIgnoreCollapsed()
 }
 
 
-#if 0
-// works, but currently not needed
 void DocIterator::backwardInset()
 {
        backwardPos();
@@ -531,7 +512,6 @@ void DocIterator::backwardInset()
                backwardPos();
        }
 }
-#endif
 
 
 bool DocIterator::hasPart(DocIterator const & it) const
@@ -566,6 +546,11 @@ void DocIterator::updateInsets(Inset * inset)
        size_t const n = slices_.size();
        slices_.resize(0);
        for (size_t i = 0 ; i < n; ++i) {
+               if (dit[i].empty() && pos() > 0 && prevMath().lyxCode() == MATH_SCRIPT_CODE)
+                       // Workaround: With empty optional argument and a trailing script,
+                       // we have empty slices in math macro args (#11676)
+                       // FIXME: Find real cause!
+                       continue;
                LBUFERR(inset);
                push_back(dit[i]);
                top().inset_ = inset;