To comment on the following update, log in, then open the issue: http://www.openoffice.org/issues/show_bug.cgi?id=99508 Issue #|99508 Summary|XUnoTunnel::getSomething usage leads to unefficient co |de Component|Word processor Version|OOo 3.0 Platform|All URL| OS/Version|All Status|UNCONFIRMED Status whiteboard| Keywords| Resolution| Issue type|ENHANCEMENT Priority|P3 Subcomponent|code Assigned to|writerneedsconfirm Reported by|cguerber
------- Additional comments from [email protected] Sun Feb 22 15:32:58 +0000 2009 ------- Usage of XUnoTunnel::getSomething() is extensively used to try and guess the real object (the implementation). This leads to "complex" code (a lot of if-else's) which means lower maintainability and probably unefficient code. As an exemple, in unotext.cxx, SwXText::insertTextContent(), starting at line 547 and up to line 636: This part of the code may be replaced by xContent.attach(xTemRange); Indeed, all the implementations of XTextRange call attachToRange in their attach method. The two unauthorized classes for insertTextContent (Paragraphe and TextPortion) throw an exception in the attach method, so it seems that there is no side effects. The code in SwXShape::attach is equivalent to the one in SwXText::insertTextContent. Remains to be confirmed: SwXFrame should be a descriptor (SwXFrame::bIsDescriptor attribute) which may be easily checked if necessary, and the initialization of uno::Any aPos in SwXShape::attach is slightly different from the one in SwText::insertTextContent. Other examples of getSomething usage are found when trying to retrieve a SwDoc from an XTextRange, which is present at the beginning of each attach/attachToRange method. This could be eased if XTextRange would have a getDocument method. --------------------------------------------------------------------- Please do not reply to this automatically generated notification from Issue Tracker. Please log onto the website and enter your comments. http://qa.openoffice.org/issue_handling/project_issues.html#notification --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
