Apache OpenOffice (AOO) Bugzilla – Issue 121732
new interface XMarkingAccess
Last modified: 2017-05-20 09:32:00 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.
Created attachment 80225 [details] patch file
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
(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
(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.
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.
Created attachment 80443 [details] patch file
"jsc" committed SVN revision 1458878 into trunk: #121732# add new interface XMarkingAccess
patch reviewed and applied on trunk