]> git.lyx.org Git - features.git/blobdiff - src/mathed/InsetMathMacro.cpp
Fix broken Apple speller interface
[features.git] / src / mathed / InsetMathMacro.cpp
index b4f64b4cf74f1272296df9cc8d225e43b56635d2..7c9efa4859c0d2e49d1f45a0ddf92c72bb76dc0a 100644 (file)
@@ -1312,6 +1312,9 @@ void InsetMathMacro::infoize2(odocstream & os) const
 
 bool InsetMathMacro::completionSupported(Cursor const & cur) const
 {
+       if (cur.buffer()->isReadonly())
+               return false;
+
        if (displayMode() != DISPLAY_UNFOLDED)
                return InsetMathNest::completionSupported(cur);
 
@@ -1322,6 +1325,9 @@ bool InsetMathMacro::completionSupported(Cursor const & cur) const
 
 bool InsetMathMacro::inlineCompletionSupported(Cursor const & cur) const
 {
+       if (cur.buffer()->isReadonly())
+               return false;
+
        if (displayMode() != DISPLAY_UNFOLDED)
                return InsetMathNest::inlineCompletionSupported(cur);
 
@@ -1363,15 +1369,15 @@ docstring InsetMathMacro::completionPrefix(Cursor const & cur) const
        if (displayMode() != DISPLAY_UNFOLDED)
                return InsetMathNest::completionPrefix(cur);
 
-       if (!completionSupported(cur))
-               return docstring();
-
        return "\\" + name();
 }
 
 
 bool InsetMathMacro::insertCompletion(Cursor & cur, docstring const & s, bool finished)
 {
+       if (cur.buffer()->isReadonly())
+               return false;
+
        if (displayMode() != DISPLAY_UNFOLDED)
                return InsetMathNest::insertCompletion(cur, s, finished);