]> git.lyx.org Git - lyx.git/blobdiff - src/paragraph_funcs.cpp
This patch introduces ProvidesModule and ExcludesModule layout tags.
[lyx.git] / src / paragraph_funcs.cpp
index f77139156081f82af6eb40902e4e6612d74c9130..e59e4a5909ef05df2e6b0d6a512ed0a920a37c61 100644 (file)
@@ -36,13 +36,17 @@ static bool moveItem(Paragraph & fromPar, pos_type fromPos,
        // Note: moveItem() does not honour change tracking!
        // Therefore, it should only be used for breaking and merging paragraphs
 
-       Font const tmpFont = fromPar.getFontSettings(params, fromPos);
+       Font const tmpFont = fromPar.getFontSettings(params, fromPos);
        Change const & tmpChange = fromPar.lookupChange(fromPos);
 
        if (Inset * tmpInset = fromPar.getInset(fromPos)) {
                fromPar.releaseInset(fromPos);
                // The inset is not in fromPar any more.
-               return toPar.insertInset(toPos, tmpInset, tmpFont, tmpChange);
+               if (!toPar.insertInset(toPos, tmpInset, tmpFont, tmpChange)) {
+                       delete tmpInset;
+                       return false;
+               }
+               return true;
        }
 
        char_type const tmpChar = fromPar.getChar(fromPos);
@@ -119,7 +123,7 @@ void breakParagraph(BufferParams const & bparams,
                // breaking paragraph.
                if (tmp->empty()) {
                        Font changed = tmp->getFirstFontSettings(bparams);
-                       Font old = par.getFontSettings(bparams, par.size());
+                       Font const & old = par.getFontSettings(bparams, par.size());
                        changed.setLanguage(old.language());
                        tmp->setFont(0, changed);
                }