mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
explicit operator bool
This commit is contained in:
parent
f1582a2acb
commit
f0959cc292
@ -64,9 +64,7 @@ public:
|
||||
void resize(size_t i) { slices_.resize(i); }
|
||||
|
||||
/// is the iterator valid?
|
||||
operator const void*() const { return empty() ? 0 : this; }
|
||||
/// is this iterator invalid?
|
||||
bool operator!() const { return empty(); }
|
||||
explicit operator bool() const { return !empty(); }
|
||||
|
||||
/// does this iterator have any content?
|
||||
bool empty() const { return slices_.empty(); }
|
||||
|
@ -156,7 +156,7 @@ bool TocWidget::getStatus(Cursor & cur, FuncRequest const & cmd,
|
||||
case LFUN_OUTLINE_IN:
|
||||
case LFUN_OUTLINE_OUT:
|
||||
case LFUN_SECTION_SELECT:
|
||||
status.setEnabled(item.dit() != 0);
|
||||
status.setEnabled((bool)item.dit());
|
||||
return true;
|
||||
|
||||
case LFUN_LABEL_COPY_AS_REFERENCE: {
|
||||
|
@ -543,7 +543,7 @@ InsetTableCell splitCell(InsetTableCell & head, docstring const & align_d, bool
|
||||
{
|
||||
InsetTableCell tail = InsetTableCell(head);
|
||||
DocIterator const dit = separatorPos(&head, align_d);
|
||||
hassep = dit;
|
||||
hassep = (bool)dit;
|
||||
if (hassep) {
|
||||
pit_type const psize = head.paragraphs().front().size();
|
||||
head.paragraphs().front().eraseChars(dit.pos(), psize, false);
|
||||
|
Loading…
Reference in New Issue
Block a user