instanceOf now uses RTTI and checks its answer.
Some checks failed
CI / ubuntu-latest-html-tests (push) Has been cancelled
CI / ubuntu-latest-no-tls (push) Has been cancelled
CI / ubuntu-latest-mbedtls2 (push) Has been cancelled
CI / ubuntu-latest-openssl-3 (push) Has been cancelled
CI / ubuntu-latest-with-old-std (push) Has been cancelled
CI / ubuntu-20-04-openssl-1-1 (push) Has been cancelled
CI / alpine-mbedtls-3_6_0 (push) Has been cancelled
CI / macOS-13-openssl-1-1 (push) Has been cancelled
CI / macOS-13-openssl-3 (push) Has been cancelled
CI / freebsd-14-openssl-3 (push) Has been cancelled
CI / windows-mbedtls (push) Has been cancelled

Next I'll just remove it, but this commit lets me
have something in history such that I can fall back to
check for bugs that might get introduced.
This commit is contained in:
2025-08-09 05:27:43 -04:00
parent c107600de6
commit 6ec7e50758
7 changed files with 28 additions and 14 deletions

View File

@ -2523,7 +2523,7 @@ void Textblock::addWidget (core::Widget *widget, core::style::Style *style)
widget->setParent (this);
// TODO Replace (perhaps) later "textblock" by "OOF aware widget".
if (widget->instanceOf (Textblock::CLASS_ID)) {
if (widget->instanceOf <Textblock>()) {
for (int i = 0; i < NUM_OOFM; i++)
searchOutOfFlowMgr(i)->addWidgetInFlow ((Textblock*)widget, this,
words->size ());
@ -2765,7 +2765,7 @@ void Textblock::addParbreak (int space, core::style::Style *style)
consider normal flow, no floats etc.) */
for (Widget *widget = this;
widget->getParent() != NULL &&
widget->getParent()->instanceOf (Textblock::CLASS_ID) &&
widget->getParent()->instanceOf <Textblock>() &&
!isWidgetOOF (widget);
widget = widget->getParent ()) {
Textblock *textblock2 = (Textblock*)widget->getParent ();
@ -2959,7 +2959,7 @@ void Textblock::handOverBreak (core::style::Style *style)
Line *lastLine = lines->getRef (lines->size () - 1);
if (lastLine->breakSpace != 0 && (parent = getParent()) &&
parent->instanceOf (Textblock::CLASS_ID) &&
parent->instanceOf <Textblock>() &&
parent->getStyle()->display != core::style::DISPLAY_BLOCK) {
Textblock *textblock2 = (Textblock*) parent;
textblock2->addParbreak(lastLine->breakSpace, style);
@ -3193,7 +3193,7 @@ int Textblock::getGeneratorWidth ()
// 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::CLASS_ID)) {
word->content.widget->instanceOf<Textblock>()) {
Textblock *tbChild = (Textblock*)word->content.widget;
if(tbChild->findSizeRequestReference(this, &xRel, NULL))
wChild = max(wChild, xRel + tbChild->getGeneratorWidth());
@ -3291,7 +3291,7 @@ RegardingBorder *Textblock::getWidgetRegardingBorderForLine (int firstWord,
if (word->content.type == core::Content::WIDGET_IN_FLOW) {
Widget *widget = word->content.widget;
if (widget->instanceOf (RegardingBorder::CLASS_ID) &&
if (widget->instanceOf <RegardingBorder>() &&
// Exclude cases where a textblock constitutes a new floats
// container.
!isOOFContainer (widget, OOFM_FLOATS))