Issue 121391 - Extension to XSmartTagRecognizer interface
Summary: Extension to XSmartTagRecognizer interface
Alias: None
Product: App Dev
Classification: Unclassified
Component: api (show other issues)
Version: 3.3.0 or older (OOo)
Hardware: All All
: P3 Normal
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
Depends on: 121730 121731 121732 121733 121734
  Show dependency tree
Reported: 2012-11-23 17:55 UTC by Robert Barbey
Modified: 2017-05-20 09:32 UTC (History)
3 users (show)

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

This patch contains the extensions mentioned in the description. (13.72 KB, application/octet-stream)
2012-11-23 17:55 UTC, Robert Barbey
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description Robert Barbey 2012-11-23 17:55:30 UTC
Created attachment 79945 [details]
This patch contains the extensions mentioned in the description.

For a Writer extension, we're traversing a document using the Java text iteration API. The text is extracted and sent to a server backend for linguistic analysis. This server returns a report containing corrections for the current document which the extension needs to map back into the document. All of this is based on XTextRange objects. 

In order to highlight these corrections within document, we are using smart tags. But with the existing XSmartTagRecognizer interface it's not possible to determine reliably the absolute position of  the text that is to be processed in the recognize method of the interface. To be able to do that we would need an XTextRange object as argument. This, of course, would require a change of the XTextMarkup interface so that it also supports committing markup for XTextRanges.

In the attached file, you find a patch that adds this functionality. It would be really great if you could review these changes and provide feedback for improvements or if you think that we have missed something essential. WE think that this addition could be beneficial to other extensions as well.

Thank you very much and have a nice weekend.

Comment 1 Ariel Constenla-Haile 2012-11-23 19:01:45 UTC
Concerning the new IDL methods, it may make more sense to rename them:


void recognizeString( [in] string aText,
                      [in] long nStart,
                      [in] long nLength,
                      [in] SmartTagRecognizerMode eDataType,
                      [in] com::sun::star::lang::Locale aLocale,
                      [in] com::sun::star::text::XTextMarkup xTextMarkup,
                      [in] string aApplicationName,
                      [in] com::sun::star::frame::XController xController,
                      [in] com::sun::star::i18n::XBreakIterator xTokenizer );

void recognizeTextRange( [in] com::sun::star::text::XTextRange xRange,
                         [in] SmartTagRecognizerMode eDataType,
                         [in] com::sun::star::text::XTextMarkup xTextMarkup,
                         [in] string aApplicationName,
                         [in] com::sun::star::frame::XController xController);


void commitStringMarkup( [in] long nType,
                         [in] string aIdentifier,
                         [in] long nStart,
                         [in] long nLength,
                         [in] com::sun::star::container::XStringKeyMap xMarkupInfoContainer );

void commitTextRangeMarkupRange( [in] long nType,
                                 [in] string aIdentifier,
                                 [in] com::sun::star::text::XTextRange xRange,
                                 [in] com::sun::star::container::XStringKeyMap xMarkupInfoContainer );

And it may make sense to specify both start and end as text ranges withing the original text range.
Comment 2 Ariel Constenla-Haile 2012-11-23 19:02:42 UTC
(In reply to comment #1)
> void commitTextRangeMarkupRange

this should read commitTextRangeMarkup
Comment 3 Rob Weir 2013-03-11 14:59:14 UTC
I'm adding this comment to all open issues with Issue Type == PATCH.  We have 220 such issues, many of them quite old.  I apologize for that.  

We need your help in prioritizing which patches should be integrated into our next release, Apache OpenOffice 4.0.

If you have submitted a patch and think it is applicable for AOO 4.0, please respond with a comment to let us know.

On the other hand, if the patch is no longer relevant, please let us know that as well.

If you have any general questions or want to discuss this further, please send a note to our dev mailing list:


Comment 4 jsc 2013-03-20 12:20:05 UTC
add dependencies
Comment 5 jsc 2013-03-20 12:21:41 UTC
I added the other related issue as dependencies to this one and take this one as meta issue to cover all related changes
Comment 6 jsc 2013-03-21 15:42:52 UTC
the related dependency issues are all reviewed and fixed. 

I have tested a trunk build with a sample SmartTag and everything worked after I made a minor change to adapt the change of the  not yet published interface.