]> git.lyx.org Git - features.git/blobdiff - src/insets/InsetText.cpp
Allow removing words from the personal dictionary, that weren't previously added.
[features.git] / src / insets / InsetText.cpp
index 626818c607e3012378120c022336a1aa9771c48e..4cecec8cd7ec31019ca85795a67b609ffd5363dd 100644 (file)
@@ -485,6 +485,7 @@ void InsetText::latex(otexstream & os, OutputParams const & runparams) const
        // environment. Standard collapsible insets should not
        // redefine this, non-standard ones may call this.
        InsetLayout const & il = getLayout();
+
        if (il.forceOwnlines())
                os << breakln;
        bool needendgroup = false;
@@ -664,6 +665,8 @@ void InsetText::docbookRenderAsImage(XMLStream & xs, OutputParams const & rp, XH
        // TODO: no real support for Unicode. This code is very similar to RenderPreview::addPreview, the same gotcha applies.
 
        graphics::PreviewLoader* loader = buffer().loader();
+       // This should be OK because we are exporting
+       LASSERT(loader != nullptr, return);
        loader->add(snippet);
        loader->startLoading(true); // Generate the image and wait until done.
        graphics::PreviewImage const * img = loader->preview(snippet);
@@ -1037,6 +1040,10 @@ bool InsetText::insetAllowed(InsetCode code) const
        case QUOTE_CODE:
        case COUNTER_CODE:
                return true;
+       // These are only allowed in index insets
+       case INDEXMACRO_CODE:
+       case INDEXMACRO_SORTKEY_CODE:
+               return false;
        default:
                return !isPassThru();
        }
@@ -1115,7 +1122,7 @@ void InsetText::updateBuffer(ParIterator const & it, UpdateType utype, bool cons
                tclass.counters().current_float(savecnt.current_float());
                tclass.counters().isSubfloat(savecnt.isSubfloat());
                buffer().updateBuffer(it2, utype, deleted);
-               tclass.counters() = move(savecnt);
+               tclass.counters() = std::move(savecnt);
        }
 }
 
@@ -1319,13 +1326,12 @@ docstring InsetText::completionPrefix(Cursor const & cur) const
 }
 
 
-bool InsetText::insertCompletion(Cursor & cur, docstring const & s,
-       bool finished)
+bool InsetText::insertCompletion(Cursor & cur, docstring const & s, bool /*finished*/)
 {
        if (!completionSupported(cur))
                return false;
 
-       return text_.insertCompletion(cur, s, finished);
+       return text_.insertCompletion(cur, s);
 }