The last few instanceOf uses?

This commit is contained in:
2025-08-09 06:09:12 -04:00
parent 31531b6cba
commit 0e6984196b
4 changed files with 12 additions and 12 deletions

View File

@ -195,8 +195,9 @@ void OOFAwareWidget::notifySetParent ()
widget != NULL && oofContainer[oofmIndex] == NULL;
widget = widget->getParent ())
if (isOOFContainer (widget, oofmIndex)) {
assert (widget->instanceOf <OOFAwareWidget>());
oofContainer[oofmIndex] = (OOFAwareWidget*)widget;
auto *oaw= dynamic_cast< OOFAwareWidget * >( widget );
assert (oaw);
oofContainer[oofmIndex]= oaw;
}
DBG_OBJ_ARRSET_PTR ("oofContainer", oofmIndex, oofContainer[oofmIndex]);

View File

@ -66,8 +66,8 @@ void OOFPosRelMgr::calcWidgetRefSize (Widget *widget, Requisition *size)
// (Notice also that Widget::sizeRequest has to be called in all
// cases.)
if (widget->instanceOf <OOFAwareWidget>())
*size = *((OOFAwareWidget*)widget)->getRequisitionWithoutOOF ();
if (auto *oaw= dynamic_cast< OOFAwareWidget * >( widget ))
*size = *oaw->getRequisitionWithoutOOF ();
DBG_OBJ_LEAVE_VAL ("%d * (%d + %d)",

View File

@ -607,8 +607,8 @@ AlignedTableCell *Table::getCellRef ()
int n = curCol + row * numCols;
if (childDefined (n)) {
child = children->get(n)->cell.widget;
if (child->instanceOf <AlignedTableCell>())
return (AlignedTableCell*)child;
if (auto *atc= dynamic_cast< AlignedTableCell * >( child ))
return atc;
}
}

View File

@ -2763,12 +2763,11 @@ void Textblock::addParbreak (int space, core::style::Style *style)
way that the space is in any case visible. */
/* Find the widget where to adjust the breakSpace. (Only
consider normal flow, no floats etc.) */
Textblock *textblock2= nullptr;
for (Widget *widget = this;
widget->getParent() != NULL &&
widget->getParent()->instanceOf <Textblock>() &&
( textblock2= dynamic_cast< Textblock * >( widget->getParent() ) ) &&
!isWidgetOOF (widget);
widget = widget->getParent ()) {
Textblock *textblock2 = (Textblock*)widget->getParent ();
int index = textblock2->hasListitemValue ? 1 : 0;
bool isfirst = (textblock2->words->getRef(index)->content.type
== core::Content::WIDGET_IN_FLOW
@ -3192,9 +3191,9 @@ int Textblock::getGeneratorWidth ()
int xRel;
// We only examine instances of dw::Textblock, since they are relevant
// for floats, for which this method is only called.
if(word->content.type == core::Content::WIDGET_IN_FLOW &&
word->content.widget->instanceOf<Textblock>()) {
Textblock *tbChild = (Textblock*)word->content.widget;
if(Textblock *tbChild= nullptr;
word->content.type == core::Content::WIDGET_IN_FLOW &&
( tbChild= dynamic_cast< Textblock * >( word->content.widget ) )) {
if(tbChild->findSizeRequestReference(this, &xRel, NULL))
wChild = max(wChild, xRel + tbChild->getGeneratorWidth());
}