Apache OpenOffice (AOO) Bugzilla – Issue 122720
[FUP to 121917] Cleanup HasText and dangerous casts to SdrTextObj
Last modified: 2017-05-20 10:35:23 UTC
ALG: Follow-up to #121917#: To call HasText() which only exists on SdrTextObj there are many cases which das SdrObjects of unknown type to SdrTextObj using old, C++-style casts. This goes wrong e.g. when the SdrObject is a SdrVirtObj from Writer. Better add HasText() to SdrObject virtual, add to SdrVirtObj accordingly and add a tooling method which also adds checking of TextObject types (from GetType()).
ALG: Grepping
ALG: Minimal change: Add HasText() as virtual base method to SdrObject, implement as default returning false, adapt pales of usage to do dynamic_casts to SdrTextObj as less as possible. Thought about adding to SdrVirtObj, but this will not really fix things and collide with aw080 changes. Better fix is in the future to get completely rid of SdrVirtObj. Checking if minimal change works...
ALG: Built, checked that fix still works, comitting, done.
"alg" committed SVN revision 1504082 into trunk: i122720 Adapted HasText() to SdrObject