Issue 122720 - [FUP to 121917] Cleanup HasText and dangerous casts to SdrTextObj
Summary: [FUP to 121917] Cleanup HasText and dangerous casts to SdrTextObj
Status: CLOSED FIXED
Alias: None
Product: General
Classification: Code
Component: code (show other issues)
Version: 4.0.0-dev
Hardware: All All
: P3 Normal (vote)
Target Milestone: 4.1.0
Assignee: Armin Le Grand
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-07-11 10:49 UTC by Armin Le Grand
Modified: 2017-05-20 10:35 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments

Note You need to log in before you can comment on or make changes to this issue.
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