All these problems have the same root: the address of a reference can never be 0, and it does not make sense to test it.
case LFUN_CAPTION_INSERT: {
code = CAPTION_CODE;
string arg = cmd.getArg(0);
- bool varia = arg != "LongTableNoNumber";
- if (cur.depth() > 0) {
- if (&cur[cur.depth() - 1].inset())
- varia = cur[cur.depth() - 1].inset().allowsCaptionVariation(arg);
- }
+ bool varia = arg != "LongTableNoNumber"
+ && cur.inset().allowsCaptionVariation(arg);
// not allowed in description items,
// and in specific insets
enable = !inDescriptionItem(cur)
Buffer * const last = theBufferList().last();
foreach (GuiView * view, allViews) {
// all of the buffers might be locally hidden. That is, there is no active buffer.
- if (!view || !view->currentBufferView() || !&view->currentBufferView()->buffer())
+ if (!view || !view->currentBufferView())
activeBuffers[view] = 0;
else
activeBuffers[view] = &view->currentBufferView()->buffer();
{
Layout::LaTeXArgMap args = it.paragraph().layout().args();
pass_thru_ = it.paragraph().layout().pass_thru;
- bool const insetlayout = &it.inset() && args.empty();
+ bool const insetlayout = args.empty();
if (insetlayout) {
args = it.inset().getLayout().args();
pass_thru_ = it.inset().getLayout().isPassThru();
return true;
}
Layout::LaTeXArgMap args;
- bool const insetlayout = &cur.inset() && cur.paragraph().layout().latexargs().empty();
+ bool const insetlayout = cur.paragraph().layout().latexargs().empty();
if (insetlayout)
args = cur.inset().getLayout().latexargs();
else
bool varia = type != "LongTableNoNumber";
// check if the immediate parent inset allows caption variation
if (cur.depth() > 1) {
- if (&cur[cur.depth() - 2].inset())
- varia = cur[cur.depth() - 2].inset().allowsCaptionVariation(type);
+ varia = cur[cur.depth() - 2].inset().allowsCaptionVariation(type);
}
status.setEnabled(varia
&& buffer().params().documentClass().hasInsetLayout(