diff options
author | Jürgen Schmidt <jsc@apache.org> | 2013-03-20 14:17:09 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-05-23 11:55:26 +0100 |
commit | c5b604b9527d0dc32066e17dc3ce7f7370a78fe1 (patch) | |
tree | b00c084f1ad200d345aa25e656b4ae0caade166b /sw | |
parent | 5e059c1ee53b6be058f66a7c43af0e75f3cadfa1 (diff) |
Resolves: #i121732# add new interface XMarkingAccess
Patch by: Kai Labusch
Review by: arielch, jsc
(cherry picked from commit c1fb6ce135ad39299164aeecebfa746db210d0e3)
Conflicts:
offapi/com/sun/star/text/makefile.mk
sw/inc/unotextcursor.hxx
sw/source/core/unocore/unoobj.cxx
Change-Id: I68029b28908a57c4ed39d798269b5a8786972be0
Diffstat (limited to 'sw')
-rw-r--r-- | sw/inc/unotextcursor.hxx | 15 | ||||
-rw-r--r-- | sw/source/core/unocore/unoobj.cxx | 41 |
2 files changed, 54 insertions, 2 deletions
diff --git a/sw/inc/unotextcursor.hxx b/sw/inc/unotextcursor.hxx index 6bb5bab8e9d6..fc45d436528f 100644 --- a/sw/inc/unotextcursor.hxx +++ b/sw/inc/unotextcursor.hxx @@ -34,11 +34,18 @@ #include <com/sun/star/text/XWordCursor.hpp> #include <com/sun/star/text/XParagraphCursor.hpp> #include <com/sun/star/text/XRedline.hpp> +#include <com/sun/star/text/XMarkingAccess.hpp> #include <cppuhelper/implbase13.hxx> #include <comphelper/uno3.hxx> +#if ! defined(INCLUDED_COMPHELPER_IMPLBASE_VAR_HXX_14) +#define INCLUDED_COMPHELPER_IMPLBASE_VAR_HXX_14 +#define COMPHELPER_IMPLBASE_INTERFACE_NUMBER 14 +#include <comphelper/implbase_var.hxx> +#endif + #include <unobaseclass.hxx> #include <TextCursorHelper.hxx> @@ -47,8 +54,7 @@ class SwDoc; struct SwPosition; class SwUnoCrsr; - -typedef ::cppu::WeakImplHelper13 +typedef ::comphelper::WeakImplHelper14 < ::com::sun::star::lang::XServiceInfo , ::com::sun::star::beans::XPropertySet , ::com::sun::star::beans::XPropertyState @@ -62,6 +68,7 @@ typedef ::cppu::WeakImplHelper13 , ::com::sun::star::text::XWordCursor , ::com::sun::star::text::XParagraphCursor , ::com::sun::star::text::XRedline +, ::com::sun::star::text::XMarkingAccess > SwXTextCursor_Base; class SwXTextCursor @@ -362,6 +369,10 @@ public: throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); + //XMarkingAccess + virtual void SAL_CALL invalidateMarkings(::sal_Int32 nType) + throw (::com::sun::star::uno::RuntimeException); + }; #endif // SW_UNOTEXTCURSOR_HXX diff --git a/sw/source/core/unocore/unoobj.cxx b/sw/source/core/unocore/unoobj.cxx index 1771cdc1d3e3..caa45670573e 100644 --- a/sw/source/core/unocore/unoobj.cxx +++ b/sw/source/core/unocore/unoobj.cxx @@ -85,6 +85,7 @@ #include <fmtftn.hxx> #include <com/sun/star/text/WrapTextMode.hpp> #include <com/sun/star/text/TextContentAnchorType.hpp> +#include <com/sun/star/text/TextMarkupType.hpp> #include <com/sun/star/style/PageStyleLayout.hpp> #include <com/sun/star/text/XTextDocument.hpp> #include <com/sun/star/style/XStyleFamiliesSupplier.hpp> @@ -2572,6 +2573,46 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException, return aRet; } +void SAL_CALL SwXTextCursor::invalidateMarkings(::sal_Int32 nType) +throw (uno::RuntimeException) +{ + SolarMutexGuard aGuard; + + SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() ); + + SwNode* node = rUnoCursor.GetNode(); + + if (node == 0) return; + + SwTxtNode* txtNode = node->GetTxtNode(); + + if (txtNode == 0) return; + + if ( text::TextMarkupType::SPELLCHECK == nType ) + { + txtNode->SetWrongDirty(true); + txtNode->SetWrong(0, true); + } + else if( text::TextMarkupType::PROOFREADING == nType ) + { + txtNode->SetGrammarCheckDirty(true); + txtNode->SetGrammarCheck(0,true); + } + else if ( text::TextMarkupType::SMARTTAG == nType ) + { + txtNode->SetSmartTagDirty(true); + txtNode->SetSmartTags (0, true); + } + else return; + + SwFmtColl* fmtColl=txtNode->GetFmtColl(); + + if (fmtColl == 0) return; + + SwFmtChg aNew( fmtColl ); + txtNode->NotifyClients( 0, &aNew ); +} + void SAL_CALL SwXTextCursor::makeRedline( const OUString& rRedlineType, |