Kaydet (Commit) c5b604b9 authored tarafından Jürgen Schmidt's avatar Jürgen Schmidt Kaydeden (comit) Caolán McNamara

Resolves: #i121732# add new interface XMarkingAccess

Patch by: Kai Labusch
Review by: arielch, jsc
(cherry picked from commit c1fb6ce1)

Conflicts:
	offapi/com/sun/star/text/makefile.mk
	sw/inc/unotextcursor.hxx
	sw/source/core/unocore/unoobj.cxx

Change-Id: I68029b28908a57c4ed39d798269b5a8786972be0
üst 5e059c1e
...@@ -3732,6 +3732,7 @@ $(eval $(call gb_UnoApi_add_idlfiles,offapi,offapi/com/sun/star/text,\ ...@@ -3732,6 +3732,7 @@ $(eval $(call gb_UnoApi_add_idlfiles,offapi,offapi/com/sun/star/text,\
XLineNumberingProperties \ XLineNumberingProperties \
XMailMergeBroadcaster \ XMailMergeBroadcaster \
XMailMergeListener \ XMailMergeListener \
XMarkingAccess \
XMultiTextMarkup \ XMultiTextMarkup \
XNumberingFormatter \ XNumberingFormatter \
XNumberingRulesSupplier \ XNumberingRulesSupplier \
......
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* 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 .
*/
#ifndef __com_sun_star_text_XMarkingAccess_idl__
#define __com_sun_star_text_XMarkingAccess_idl__
#include <com/sun/star/uno/XInterface.idl>
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
...@@ -34,11 +34,18 @@ ...@@ -34,11 +34,18 @@
#include <com/sun/star/text/XWordCursor.hpp> #include <com/sun/star/text/XWordCursor.hpp>
#include <com/sun/star/text/XParagraphCursor.hpp> #include <com/sun/star/text/XParagraphCursor.hpp>
#include <com/sun/star/text/XRedline.hpp> #include <com/sun/star/text/XRedline.hpp>
#include <com/sun/star/text/XMarkingAccess.hpp>
#include <cppuhelper/implbase13.hxx> #include <cppuhelper/implbase13.hxx>
#include <comphelper/uno3.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 <unobaseclass.hxx>
#include <TextCursorHelper.hxx> #include <TextCursorHelper.hxx>
...@@ -47,8 +54,7 @@ class SwDoc; ...@@ -47,8 +54,7 @@ class SwDoc;
struct SwPosition; struct SwPosition;
class SwUnoCrsr; class SwUnoCrsr;
typedef ::comphelper::WeakImplHelper14
typedef ::cppu::WeakImplHelper13
< ::com::sun::star::lang::XServiceInfo < ::com::sun::star::lang::XServiceInfo
, ::com::sun::star::beans::XPropertySet , ::com::sun::star::beans::XPropertySet
, ::com::sun::star::beans::XPropertyState , ::com::sun::star::beans::XPropertyState
...@@ -62,6 +68,7 @@ typedef ::cppu::WeakImplHelper13 ...@@ -62,6 +68,7 @@ typedef ::cppu::WeakImplHelper13
, ::com::sun::star::text::XWordCursor , ::com::sun::star::text::XWordCursor
, ::com::sun::star::text::XParagraphCursor , ::com::sun::star::text::XParagraphCursor
, ::com::sun::star::text::XRedline , ::com::sun::star::text::XRedline
, ::com::sun::star::text::XMarkingAccess
> SwXTextCursor_Base; > SwXTextCursor_Base;
class SwXTextCursor class SwXTextCursor
...@@ -362,6 +369,10 @@ public: ...@@ -362,6 +369,10 @@ public:
throw (::com::sun::star::lang::IllegalArgumentException, throw (::com::sun::star::lang::IllegalArgumentException,
::com::sun::star::uno::RuntimeException); ::com::sun::star::uno::RuntimeException);
//XMarkingAccess
virtual void SAL_CALL invalidateMarkings(::sal_Int32 nType)
throw (::com::sun::star::uno::RuntimeException);
}; };
#endif // SW_UNOTEXTCURSOR_HXX #endif // SW_UNOTEXTCURSOR_HXX
......
...@@ -85,6 +85,7 @@ ...@@ -85,6 +85,7 @@
#include <fmtftn.hxx> #include <fmtftn.hxx>
#include <com/sun/star/text/WrapTextMode.hpp> #include <com/sun/star/text/WrapTextMode.hpp>
#include <com/sun/star/text/TextContentAnchorType.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/style/PageStyleLayout.hpp>
#include <com/sun/star/text/XTextDocument.hpp> #include <com/sun/star/text/XTextDocument.hpp>
#include <com/sun/star/style/XStyleFamiliesSupplier.hpp> #include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
...@@ -2572,6 +2573,46 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException, ...@@ -2572,6 +2573,46 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException,
return aRet; 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 void SAL_CALL
SwXTextCursor::makeRedline( SwXTextCursor::makeRedline(
const OUString& rRedlineType, const OUString& rRedlineType,
......
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