diff options
-rw-r--r-- | offapi/com/sun/star/text/XMarkingAccess.idl | 47 | ||||
-rw-r--r-- | offapi/com/sun/star/text/makefile.mk | 1 | ||||
-rw-r--r-- | sw/inc/unotextcursor.hxx | 15 | ||||
-rw-r--r-- | sw/source/core/unocore/unoobj.cxx | 42 |
4 files changed, 103 insertions, 2 deletions
diff --git a/offapi/com/sun/star/text/XMarkingAccess.idl b/offapi/com/sun/star/text/XMarkingAccess.idl new file mode 100644 index 000000000000..cb9b539816ee --- /dev/null +++ b/offapi/com/sun/star/text/XMarkingAccess.idl @@ -0,0 +1,47 @@ +/************************************************************** + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + *************************************************************/ + + +#ifndef __com_sun_star_text_XMarkingAccess_idl__ +#define __com_sun_star_text_XMarkingAccess_idl__ + +#ifndef __com_sun_star_uno_XInterface_idl__ +#include <com/sun/star/uno/XInterface.idl> +#endif + +//============================================================================= + + module com { module sun { module star { module text { + +//============================================================================= + +/** extends a text range by method to modify its position. + */ +interface XMarkingAccess +{ + void invalidateMarkings([in] long nType); +}; + +//============================================================================= + +}; }; }; }; + +#endif diff --git a/offapi/com/sun/star/text/makefile.mk b/offapi/com/sun/star/text/makefile.mk index adf2e89c8955..82be3aa9ddc3 100644 --- a/offapi/com/sun/star/text/makefile.mk +++ b/offapi/com/sun/star/text/makefile.mk @@ -234,6 +234,7 @@ IDLFILES=\ XTextColumns.idl\ XTextContent.idl\ XTextCursor.idl\ + XMarkingAccess.idl\ XTextCopy.idl\ XTextDocument.idl\ XTextEmbeddedObject.idl\ diff --git a/sw/inc/unotextcursor.hxx b/sw/inc/unotextcursor.hxx index 13b43a4545a5..3b581e385f72 100644 --- a/sw/inc/unotextcursor.hxx +++ b/sw/inc/unotextcursor.hxx @@ -37,11 +37,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/implbase12.hxx> #include <comphelper/uno3.hxx> +#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 + #include <unobaseclass.hxx> #include <TextCursorHelper.hxx> @@ -50,8 +57,7 @@ class SwDoc; struct SwPosition; class SwUnoCrsr; - -typedef ::cppu::WeakImplHelper12 +typedef ::comphelper::WeakImplHelper13 < ::com::sun::star::lang::XServiceInfo , ::com::sun::star::beans::XPropertySet , ::com::sun::star::beans::XPropertyState @@ -64,6 +70,7 @@ typedef ::cppu::WeakImplHelper12 , ::com::sun::star::text::XWordCursor , ::com::sun::star::text::XParagraphCursor , ::com::sun::star::text::XRedline +, ::com::sun::star::text::XMarkingAccess > SwXTextCursor_Base; class SwXTextCursor @@ -337,6 +344,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 aba66a6c2658..fbfc76b20dc0 100644 --- a/sw/source/core/unocore/unoobj.cxx +++ b/sw/source/core/unocore/unoobj.cxx @@ -99,6 +99,7 @@ #include <com/sun/star/text/XTextDocument.hpp> #include <com/sun/star/style/XStyleFamiliesSupplier.hpp> #include <com/sun/star/drawing/XDrawPageSupplier.hpp> +#include <com/sun/star/text/TextMarkupType.hpp> #include <unoidx.hxx> #include <unoframe.hxx> #include <fmthdft.hxx> @@ -2683,6 +2684,47 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException, return aRet; } +void SAL_CALL SwXTextCursor::invalidateMarkings(::sal_Int32 nType) +throw (uno::RuntimeException) +{ + vos::OGuard aGuard(Application::GetSolarMutex()); + + 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 ); +} + + /*-- 10.03.2008 09:58:47--------------------------------------------------- -----------------------------------------------------------------------*/ |