More virtual base fixups.

This commit is contained in:
2025-08-23 08:55:48 -04:00
parent 0bc863faf1
commit 13f931d82e
13 changed files with 31 additions and 31 deletions

View File

@ -220,9 +220,9 @@ EmptyIterator::EmptyIterator (EmptyIterator &it): Iterator (it)
{
}
object::Object *EmptyIterator::clone ()
object::Object *EmptyIterator::clone () const
{
return new EmptyIterator (*this);
return new EmptyIterator (const_cast< EmptyIterator & >( *this ));
}
int EmptyIterator::compareTo (object::Comparable *other)
@ -595,7 +595,7 @@ DeepIterator::~DeepIterator ()
//printf ("Deleting DeepIterator %p ...\n", this);
}
object::Object *DeepIterator::clone ()
object::Object *DeepIterator::clone () const
{
DeepIterator *it = new DeepIterator ();
@ -762,7 +762,7 @@ CharIterator::~CharIterator ()
delete it;
}
object::Object *CharIterator::clone()
object::Object *CharIterator::clone() const
{
CharIterator *cloned = new CharIterator ();
cloned->it = it->cloneDeepIterator ();

View File

@ -34,8 +34,9 @@ public:
void intoStringBuffer(lout::misc::StringBuffer *sb) const override;
inline Widget *getWidget () { return widget; }
inline const Widget *getWidget () const { return widget; }
inline Content *getContent () { return &content; }
inline Content::Type getMask () { return mask; }
inline Content::Type getMask () const { return mask; }
virtual void unref ();
@ -101,7 +102,7 @@ private:
public:
EmptyIterator (Widget *widget, Content::Type mask, bool atEnd);
lout::object::Object *clone();
lout::object::Object *clone() const override;
int compareTo(lout::object::Comparable *other);
bool next ();
bool prev ();
@ -183,7 +184,7 @@ public:
DeepIterator(Iterator *it);
~DeepIterator();
lout::object::Object *clone ();
lout::object::Object *clone () const override;
DeepIterator *createVariant(Iterator *it);
inline Iterator *getTopIterator () { return stack.getTop(); }
@ -244,7 +245,7 @@ public:
CharIterator (Widget *widget, bool followReferences);
~CharIterator ();
lout::object::Object *clone();
lout::object::Object *clone() const override;
int compareTo(lout::object::Comparable *other);
bool next ();

View File

@ -97,7 +97,7 @@ protected:
virtual void getContentInFlow (int index, core::Content *content) = 0;
void setValues (int sectionIndex, int index);
inline void cloneValues (OOFAwareWidgetIterator *other)
inline void cloneValues (OOFAwareWidgetIterator *other) const
{ other->setValues (sectionIndex, index); }
inline bool inFlow () { return sectionIndex == 0; }
@ -110,7 +110,7 @@ protected:
OOFAwareWidgetIterator (OOFAwareWidget *widget, core::Content::Type mask,
bool atEnd, int numContentsInFlow);
void intoStringBuffer(lout::misc::StringBuffer *sb);
void intoStringBuffer(lout::misc::StringBuffer *sb) const override;
int compareTo(lout::object::Comparable *other);
bool next ();

View File

@ -106,7 +106,7 @@ void OOFAwareWidget::OOFAwareWidgetIterator::getPart (int sectionIndex,
}
}
void OOFAwareWidget::OOFAwareWidgetIterator::intoStringBuffer (StringBuffer *sb)
void OOFAwareWidget::OOFAwareWidgetIterator::intoStringBuffer (StringBuffer *sb) const
{
Iterator::intoStringBuffer (sb);
sb->append (", sectionIndex = ");

View File

@ -354,7 +354,7 @@ private:
public:
TableIterator (Table *table, core::Content::Type mask, bool atEnd);
lout::object::Object *clone();
lout::object::Object *clone() const override;
void highlight (int start, int end, core::HighlightLayer layer);
void unhighlight (int direction, core::HighlightLayer layer);

View File

@ -32,7 +32,7 @@ Table::TableIterator::TableIterator (Table *table,
{
}
object::Object *Table::TableIterator::clone()
object::Object *Table::TableIterator::clone() const
{
TableIterator *tIt =
new TableIterator ((Table*)getWidget(), getMask(), false);

View File

@ -522,7 +522,7 @@ protected:
static TextblockIterator *createWordIndexIterator
(Textblock *textblock, core::Content::Type mask, int wordIndex);
lout::object::Object *clone();
lout::object::Object *clone() const override;
void highlight (int start, int end, core::HighlightLayer layer);
void unhighlight (int direction, core::HighlightLayer layer);

View File

@ -48,7 +48,7 @@ Textblock::TextblockIterator
return tbIt;
}
object::Object *Textblock::TextblockIterator::clone()
object::Object *Textblock::TextblockIterator::clone() const
{
TextblockIterator *tbIt =
new TextblockIterator ((Textblock*)getWidget(), getMask(), false);