mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-23 10:18:50 +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); }
|
void resize(size_t i) { slices_.resize(i); }
|
||||||
|
|
||||||
/// is the iterator valid?
|
/// is the iterator valid?
|
||||||
operator const void*() const { return empty() ? 0 : this; }
|
explicit operator bool() const { return !empty(); }
|
||||||
/// is this iterator invalid?
|
|
||||||
bool operator!() const { return empty(); }
|
|
||||||
|
|
||||||
/// does this iterator have any content?
|
/// does this iterator have any content?
|
||||||
bool empty() const { return slices_.empty(); }
|
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_IN:
|
||||||
case LFUN_OUTLINE_OUT:
|
case LFUN_OUTLINE_OUT:
|
||||||
case LFUN_SECTION_SELECT:
|
case LFUN_SECTION_SELECT:
|
||||||
status.setEnabled(item.dit() != 0);
|
status.setEnabled((bool)item.dit());
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
case LFUN_LABEL_COPY_AS_REFERENCE: {
|
case LFUN_LABEL_COPY_AS_REFERENCE: {
|
||||||
|
@ -543,7 +543,7 @@ InsetTableCell splitCell(InsetTableCell & head, docstring const & align_d, bool
|
|||||||
{
|
{
|
||||||
InsetTableCell tail = InsetTableCell(head);
|
InsetTableCell tail = InsetTableCell(head);
|
||||||
DocIterator const dit = separatorPos(&head, align_d);
|
DocIterator const dit = separatorPos(&head, align_d);
|
||||||
hassep = dit;
|
hassep = (bool)dit;
|
||||||
if (hassep) {
|
if (hassep) {
|
||||||
pit_type const psize = head.paragraphs().front().size();
|
pit_type const psize = head.paragraphs().front().size();
|
||||||
head.paragraphs().front().eraseChars(dit.pos(), psize, false);
|
head.paragraphs().front().eraseChars(dit.pos(), psize, false);
|
||||||
|
Loading…
Reference in New Issue
Block a user