Kaydet (Commit) c1fb6ce1 authored tarafından Jürgen Schmidt's avatar Jürgen Schmidt

#121732# add new interface XMarkingAccess

Patch by: Kai Labusch
Review by: arielch, jsc
üst 5898e201
/**************************************************************
*
* 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
......@@ -234,6 +234,7 @@ IDLFILES=\
XTextColumns.idl\
XTextContent.idl\
XTextCursor.idl\
XMarkingAccess.idl\
XTextCopy.idl\
XTextDocument.idl\
XTextEmbeddedObject.idl\
......
......@@ -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
......
......@@ -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---------------------------------------------------
-----------------------------------------------------------------------*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment