You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by js...@apache.org on 2013/03/20 16:17:09 UTC
svn commit: r1458878 - in /openoffice/trunk/main:
offapi/com/sun/star/text/XMarkingAccess.idl
offapi/com/sun/star/text/makefile.mk sw/inc/unotextcursor.hxx
sw/source/core/unocore/unoobj.cxx
Author: jsc
Date: Wed Mar 20 15:17:09 2013
New Revision: 1458878
URL: http://svn.apache.org/r1458878
Log:
#121732# add new interface XMarkingAccess
Patch by: Kai Labusch
Review by: arielch, jsc
Added:
openoffice/trunk/main/offapi/com/sun/star/text/XMarkingAccess.idl
Modified:
openoffice/trunk/main/offapi/com/sun/star/text/makefile.mk
openoffice/trunk/main/sw/inc/unotextcursor.hxx
openoffice/trunk/main/sw/source/core/unocore/unoobj.cxx
Added: openoffice/trunk/main/offapi/com/sun/star/text/XMarkingAccess.idl
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/offapi/com/sun/star/text/XMarkingAccess.idl?rev=1458878&view=auto
==============================================================================
--- openoffice/trunk/main/offapi/com/sun/star/text/XMarkingAccess.idl (added)
+++ openoffice/trunk/main/offapi/com/sun/star/text/XMarkingAccess.idl Wed Mar 20 15:17:09 2013
@@ -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
Modified: openoffice/trunk/main/offapi/com/sun/star/text/makefile.mk
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/offapi/com/sun/star/text/makefile.mk?rev=1458878&r1=1458877&r2=1458878&view=diff
==============================================================================
--- openoffice/trunk/main/offapi/com/sun/star/text/makefile.mk (original)
+++ openoffice/trunk/main/offapi/com/sun/star/text/makefile.mk Wed Mar 20 15:17:09 2013
@@ -234,6 +234,7 @@ IDLFILES=\
XTextColumns.idl\
XTextContent.idl\
XTextCursor.idl\
+ XMarkingAccess.idl\
XTextCopy.idl\
XTextDocument.idl\
XTextEmbeddedObject.idl\
Modified: openoffice/trunk/main/sw/inc/unotextcursor.hxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sw/inc/unotextcursor.hxx?rev=1458878&r1=1458877&r2=1458878&view=diff
==============================================================================
--- openoffice/trunk/main/sw/inc/unotextcursor.hxx (original)
+++ openoffice/trunk/main/sw/inc/unotextcursor.hxx Wed Mar 20 15:17:09 2013
@@ -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
Modified: openoffice/trunk/main/sw/source/core/unocore/unoobj.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sw/source/core/unocore/unoobj.cxx?rev=1458878&r1=1458877&r2=1458878&view=diff
==============================================================================
--- openoffice/trunk/main/sw/source/core/unocore/unoobj.cxx (original)
+++ openoffice/trunk/main/sw/source/core/unocore/unoobj.cxx Wed Mar 20 15:17:09 2013
@@ -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,
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---------------------------------------------------
-----------------------------------------------------------------------*/