Issue 121732 - new interface XMarkingAccess
Summary: new interface XMarkingAccess
Status: CLOSED FIXED
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:
URL:
Keywords:
Depends on:
Blocks: 121391
  Show dependency tree
 
Reported: 2013-02-07 15:51 UTC by labusch
Modified: 2017-05-20 09:32 UTC (History)
3 users (show)

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


Attachments
patch file (23.84 KB, patch)
2013-02-07 15:51 UTC, labusch
no flags Details | Diff
patch file (3.23 KB, patch)
2013-03-20 08:56 UTC, labusch
no flags Details | Diff
patch file (5.38 KB, patch)
2013-03-20 09:23 UTC, labusch
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description labusch 2013-02-07 15:51:15 UTC
Let SwXTextCursor implement an additional interface that we named XMarkingAccess. This new interface provides the invalidateMarking function which triggers a re-determination of the smart tags within the range of the cursor. This is required in order to  selectively remove/add/modify particular smart tags based on actions that are performed by the user by means of the plugin-UI.

Make this possibly by addition of implbase13.hxx that extends the template inheritance helper mechanism to 13 interfaces.

I send a more detailed explanation of this patch proposal to dev@openoffice.apache.org.
Comment 1 labusch 2013-02-07 15:51:53 UTC
Created attachment 80225 [details]
patch file
Comment 2 Rob Weir 2013-03-11 14:59:50 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:  dev@openoffice.apache.org

Thanks!

-Rob
Comment 3 Ariel Constenla-Haile 2013-03-14 22:56:31 UTC
(In reply to comment #0)
> Make this possibly by addition of implbase13.hxx that extends the template
> inheritance helper mechanism to 13 interfaces.

Unless you need it for your C++ extension, in the internal source code use <comphelper/implbase_var.hxx>

You can see its usage in SfxBaseModel 
http://opengrok.adfinis-sygroup.org/source/xref/aoo-trunk/main/sfx2/inc/sfx2/sfxbasemodel.hxx#97

For your case:

#if ! defined(INCLUDED_COMPHELPER_IMPLBASE_VAR_HXX_13)
#define INCLUDED_COMPHELPER_IMPLBASE_VAR_HXX_13
#define COMPHELPER_IMPLBASE_INTERFACE_NUMBER 13
#include <comphelper/implbase_var.hxx>
#endif
Comment 4 Ariel Constenla-Haile 2013-03-15 09:00:40 UTC
(In reply to comment #0)
> Let SwXTextCursor implement an additional interface that we named
> XMarkingAccess. This new interface provides the invalidateMarking function
> which triggers a re-determination of the smart tags within the range of the
> cursor

The code invalidates much more than the smart tag (grammar checking, spell checking, word counting,...), wouldn't it be counterproductive for others, like the spellchecker and the grammar checker?

The XFlatParagraph interface has a more clever way of triggering invalidation selectively, see http://opengrok.adfinis-sygroup.org/source/xref/aoo-trunk/main/sw/source/core/unocore/unoflatpara.cxx#142

133void SAL_CALL SwXFlatParagraph::setChecked( ::sal_Int32 nType, ::sal_Bool bVal ) throw (uno::RuntimeException)
134{
135    vos::OGuard aGuard(Application::GetSolarMutex());
136
137    if ( mpTxtNode )
138    {
139        if ( text::TextMarkupType::SPELLCHECK == nType )
140            mpTxtNode->SetWrongDirty( !bVal );
141        else if ( text::TextMarkupType::SMARTTAG == nType )
142            mpTxtNode->SetSmartTagDirty( !bVal );
143        else if( text::TextMarkupType::PROOFREADING == nType )
144        {
145            mpTxtNode->SetGrammarCheckDirty( !bVal );
146            if( bVal )
147                ::finishGrammarCheck( *mpTxtNode );
148        }
149    }
150}

A css::text::XTextRangeMarkup with isChecked/setChecked/[check?/]... may be more appropriated.
Comment 5 labusch 2013-03-20 08:56:26 UTC
Created attachment 80438 [details]
patch file

I consider this patch request as relevant for the AOO 4.0 release.
Currently, we have a discussion about this patch request at dev@openoffice.apache.org. 
The title of the thread is "[Call-for-Review] code changes for more powerful smarttag extensions".

Jürgen tried to apply the separate patches to the AOO trunk sources and reported that some of the patch-files were broken. 

Therefore, I have regenerated the patch files and submitted them again.

I also integrated the suggestions of Ariel into the patch request, i.e., now 
the markup is selectively invalidated and the code uses the generic inheritance mechanism.
Comment 6 labusch 2013-03-20 09:23:34 UTC
Created attachment 80443 [details]
patch file
Comment 7 SVN Robot 2013-03-20 15:18:17 UTC
"jsc" committed SVN revision 1458878 into trunk:
#121732# add new interface XMarkingAccess
Comment 8 jsc 2013-03-21 15:39:52 UTC
patch reviewed and applied on trunk