Get rid of easily removable uses of const_cast

This commit is contained in:
rune-scape
2024-07-29 21:23:12 -07:00
committed by rune-scape
parent 893bbdfde8
commit d58b2e879f
69 changed files with 342 additions and 306 deletions

View File

@ -3625,10 +3625,10 @@ double TextServerFallback::_shaped_text_fit_to_width(const RID &p_shaped, double
MutexLock lock(sd->mutex);
if (!sd->valid.is_set()) {
const_cast<TextServerFallback *>(this)->_shaped_text_shape(p_shaped);
_shaped_text_shape(p_shaped);
}
if (!sd->justification_ops_valid) {
const_cast<TextServerFallback *>(this)->_shaped_text_update_justification_ops(p_shaped);
_shaped_text_update_justification_ops(p_shaped);
}
int start_pos = 0;
@ -3734,10 +3734,10 @@ double TextServerFallback::_shaped_text_tab_align(const RID &p_shaped, const Pac
MutexLock lock(sd->mutex);
if (!sd->valid.is_set()) {
const_cast<TextServerFallback *>(this)->_shaped_text_shape(p_shaped);
_shaped_text_shape(p_shaped);
}
if (!sd->line_breaks_valid) {
const_cast<TextServerFallback *>(this)->_shaped_text_update_breaks(p_shaped);
_shaped_text_update_breaks(p_shaped);
}
for (int i = 0; i < p_tab_stops.size(); i++) {
@ -4444,7 +4444,7 @@ const Glyph *TextServerFallback::_shaped_text_sort_logical(const RID &p_shaped)
MutexLock lock(sd->mutex);
if (!sd->valid.is_set()) {
const_cast<TextServerFallback *>(this)->_shaped_text_shape(p_shaped);
_shaped_text_shape(p_shaped);
}
return sd->glyphs.ptr(); // Already in the logical order, return as is.