Page MenuHomeWildfire Games

Remove redundant IGUITextOwner::AddText IGUIObject argument
ClosedPublic

Authored by elexis on Sep 28 2019, 1:39 PM.

Details

Summary

The IGUITextOwner is the same GUIObject that should own the text, literally. Therefore this argument is always this, so it can be this inside of the function call.

Test Plan

Notice that one might consider removing the IGUIObject reference from CGUIText, but that this would be more involved cleanup, whereas this diff is a preparation for D2325 (amongst D2332).
See that the code is equivalent and measurably less complex (less nr of arguments) and less prone to passing the wrong object.

Notice that the other arguments like Font and BufferZone are not defined in the IGUITextOwner but the derived class such as CText, hence this is the only argument that can be removed this way here.

Diff Detail

Repository
rP 0 A.D. Public Repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

elexis created this revision.Sep 28 2019, 1:39 PM

Build failure - The Moirai have given mortals hearts that can endure.

Link to build: https://jenkins.wildfiregames.com/job/docker-differential/856/display/redirect

Successful build - Chance fights ever on the side of the prudent.

Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/340/display/redirect

elexis edited the test plan for this revision. (Show Details)Sep 28 2019, 1:45 PM
This revision was not accepted when it landed; it landed in state Needs Review.Sep 28 2019, 1:46 PM
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.