Issue 122720

Summary: [FUP to 121917] Cleanup HasText and dangerous casts to SdrTextObj
Product: General Reporter: Armin Le Grand <Armin.Le.Grand>
Component: codeAssignee: Armin Le Grand <Armin.Le.Grand>
Status: CLOSED FIXED QA Contact:
Severity: Normal    
Priority: P3 CC: issues
Version: 4.0.0-dev   
Target Milestone: 4.1.0   
Hardware: All   
OS: All   
Issue Type: DEFECT Latest Confirmation in: ---
Developer Difficulty: ---

Description Armin Le Grand 2013-07-11 10:49:57 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()).
Comment 1 Armin Le Grand 2013-07-11 10:50:10 UTC
ALG: Grepping
Comment 2 Armin Le Grand 2013-07-17 10:40:50 UTC
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...
Comment 3 Armin Le Grand 2013-07-17 12:06:40 UTC
ALG: Built, checked that fix still works, comitting, done.
Comment 4 SVN Robot 2013-07-17 12:07:18 UTC
"alg" committed SVN revision 1504082 into trunk:
i122720 Adapted HasText() to SdrObject