]> git.lyx.org Git - features.git/commitdiff
Fix nullptr warnings
authorRichard Kimberly Heck <rikiheck@lyx.org>
Thu, 12 Sep 2019 02:13:25 +0000 (22:13 -0400)
committerRichard Kimberly Heck <rikiheck@lyx.org>
Thu, 12 Sep 2019 02:13:25 +0000 (22:13 -0400)
src/CutAndPaste.cpp
src/insets/InsetPreview.cpp

index c71697ffda99b8892b57de705c5c0038541da0fc..d7a3a1fd3612929f646001f66a3e4857d3e9692d 100644 (file)
@@ -141,7 +141,7 @@ pasteSelectionHelper(DocIterator const & cur, ParagraphList const & parlist,
        InsetText * target_inset = cur.inset().asInsetText();
        if (!target_inset) {
                InsetTabular * it = cur.inset().asInsetTabular();
-               target_inset = it ? it->cell(cur.idx())->asInsetText() : 0;
+               target_inset = it ? it->cell(cur.idx())->asInsetText() : nullptr;
        }
        LASSERT(target_inset, return PasteReturnValue(pit, pos, need_update));
 
@@ -304,8 +304,7 @@ pasteSelectionHelper(DocIterator const & cur, ParagraphList const & parlist,
        InsetIterator const i_end = inset_iterator_end(in);
        for (InsetIterator it = inset_iterator_begin(in); it != i_end; ++it) {
                // Even though this will also be done later, it has to be done here
-               // since some inset might going to try to access
-               // the buffer() member.
+               // since some inset might try to access the buffer() member.
                it->setBuffer(const_cast<Buffer &>(buffer));
                switch (it->lyxCode()) {
 
@@ -580,7 +579,7 @@ Buffer * copyToTempBuffer(ParagraphList const & paragraphs, DocumentClassConstPt
        // Use a clone for the complicated stuff so that we do not need to clean
        // up in order to avoid a crash.
        Buffer * buffer = staticbuffer->cloneBufferOnly();
-       LASSERT(buffer, return 0);
+       LASSERT(buffer, return nullptr);
 
        // This needs doing every time.
        // Since setDocumentClass() causes deletion of the old document class
@@ -723,7 +722,7 @@ void copySelectionHelper(Buffer const & buf, Text const & text,
        it = copy_pars.begin();
        for (; it != it_end; ++it) {
                it->resetBuffer();
-               it->setInsetOwner(0);
+               it->setInsetOwner(nullptr);
        }
 
        cutstack.push(make_pair(copy_pars, dc));
index c306ae91d21ea3678bf31f7ec935e96073f74a5d..7b89e1ba6b9ecd851137686b84b316f88eda653b 100644 (file)
@@ -99,7 +99,7 @@ void InsetPreview::preparePreview(DocIterator const & pos) const
                dit.forwardInset();
        for (; dit != dend; dit.forwardInset()) {
                InsetMath * im = dit.nextInset()->asInsetMath();
-               InsetMathHull * hull = im ? im->asHullInset() : 0;
+               InsetMathHull * hull = im ? im->asHullInset() : nullptr;
                if (!hull)
                        continue;
                for (idx_type idx = 0; idx < hull->nargs(); ++idx)