diff options
author | Oliver Specht <os@openoffice.org> | 2001-01-12 15:15:41 +0000 |
---|---|---|
committer | Oliver Specht <os@openoffice.org> | 2001-01-12 15:15:41 +0000 |
commit | 6bff13645223e2a2701acc1b6f7d579671c97e06 (patch) | |
tree | facae3496642bf8542a195b434d4c95c676b7b7f | |
parent | 6e2054fc20b8769a94d412d977e740142cc07816 (diff) |
new: Redline container
-rw-r--r-- | sw/inc/unomap.hxx | 7 | ||||
-rw-r--r-- | sw/inc/unoobj.hxx | 58 | ||||
-rw-r--r-- | sw/inc/unoprnms.hxx | 7 | ||||
-rw-r--r-- | sw/source/core/unocore/makefile.mk | 6 | ||||
-rw-r--r-- | sw/source/core/unocore/unobkm.cxx | 9 | ||||
-rw-r--r-- | sw/source/core/unocore/unocoll.cxx | 84 | ||||
-rw-r--r-- | sw/source/core/unocore/unofield.cxx | 6 | ||||
-rw-r--r-- | sw/source/core/unocore/unoframe.cxx | 6 | ||||
-rw-r--r-- | sw/source/core/unocore/unoftn.cxx | 9 | ||||
-rw-r--r-- | sw/source/core/unocore/unoidx.cxx | 6 | ||||
-rw-r--r-- | sw/source/core/unocore/unomap.cxx | 31 | ||||
-rw-r--r-- | sw/source/core/unocore/unoobj.cxx | 141 | ||||
-rw-r--r-- | sw/source/core/unocore/unoobj2.cxx | 384 | ||||
-rw-r--r-- | sw/source/core/unocore/unoprnms.cxx | 7 | ||||
-rw-r--r-- | sw/source/core/unocore/unoredline.cxx | 343 | ||||
-rw-r--r-- | sw/source/core/unocore/unorefmk.cxx | 9 | ||||
-rw-r--r-- | sw/source/core/unocore/unosect.cxx | 6 | ||||
-rw-r--r-- | sw/source/filter/xml/xmlimp.cxx | 6 | ||||
-rw-r--r-- | sw/source/filter/xml/xmltble.cxx | 6 | ||||
-rw-r--r-- | sw/source/filter/xml/xmltbli.cxx | 6 | ||||
-rw-r--r-- | sw/source/ui/uno/unotxdoc.cxx | 167 | ||||
-rw-r--r-- | sw/source/ui/uno/unotxvw.cxx | 10 |
22 files changed, 755 insertions, 559 deletions
diff --git a/sw/inc/unomap.hxx b/sw/inc/unomap.hxx index 7b3aa76f914a..ad89928d9dc0 100644 --- a/sw/inc/unomap.hxx +++ b/sw/inc/unomap.hxx @@ -2,9 +2,9 @@ * * $RCSfile: unomap.hxx,v $ * - * $Revision: 1.15 $ + * $Revision: 1.16 $ * - * last change: $Author: os $ $Date: 2000-12-22 09:54:15 $ + * last change: $Author: os $ $Date: 2001-01-12 16:11:27 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -106,7 +106,8 @@ #define PROPERTY_MAP_TEXT_COLUMS 36 #define PROPERTY_MAP_PARAGRAPH 37 #define PROPERTY_MAP_EMBEDDED_OBJECT 38 -#define PROPERTY_MAP_END 39 +#define PROPERTY_MAP_REDLINE 39 +#define PROPERTY_MAP_END 40 #define PROPERTY_SET_CHAR_STYLE 1 #define PROPERTY_SET_PARA_STYLE 2 diff --git a/sw/inc/unoobj.hxx b/sw/inc/unoobj.hxx index cff0653318d6..a625ae31beb2 100644 --- a/sw/inc/unoobj.hxx +++ b/sw/inc/unoobj.hxx @@ -2,9 +2,9 @@ * * $RCSfile: unoobj.hxx,v $ * - * $Revision: 1.9 $ + * $Revision: 1.10 $ * - * last change: $Author: mib $ $Date: 2001-01-08 09:43:08 $ + * last change: $Author: os $ $Date: 2001-01-12 16:11:08 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -64,15 +64,15 @@ #ifndef _UNOEVTLSTNR_HXX #include <unoevtlstnr.hxx> #endif +#ifndef _UNOBASECLASS_HXX +#include <unobaseclass.hxx> +#endif #ifndef _SFX_ITEMPROP_HXX #include <svtools/itemprop.hxx> #endif #ifndef _SVARRAY_HXX //autogen #include <svtools/svarray.hxx> #endif -#ifndef _CALBCK_HXX //autogen -#include <calbck.hxx> -#endif #ifndef _FRMFMT_HXX //autogen #include <frmfmt.hxx> #endif @@ -127,9 +127,6 @@ #ifndef _COM_SUN_STAR_UTIL_XSORTABLE_HPP_ #include <com/sun/star/util/XSortable.hpp> #endif -#ifndef _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_ -#include <com/sun/star/lang/XServiceInfo.hpp> -#endif #ifndef _COM_SUN_STAR_CONTAINER_XENUMERATIONACCESS_HPP_ #include <com/sun/star/container/XEnumerationAccess.hpp> #endif @@ -166,9 +163,6 @@ #ifndef _CPPUHELPER_FACTORY_HXX_ #include <cppuhelper/factory.hxx> // helper for factories #endif -#ifndef _CPPUHELPER_IMPLBASE2_HXX_ -#include <cppuhelper/implbase2.hxx> // helper for implementations -#endif #ifndef _CPPUHELPER_IMPLBASE3_HXX_ #include <cppuhelper/implbase3.hxx> // helper for implementations #endif @@ -244,9 +238,6 @@ enum CursorType * * --------------------------------------------------*/ SwPageDesc* GetPageDescByName_Impl(SwDoc& rDoc, const String& rName); -::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > CreateTextRangeFromPosition(SwDoc* pDoc, - const SwPosition& rPos, const SwPosition* pMark); - ::com::sun::star::uno::Sequence< sal_Int8 > CreateUnoTunnelId(); /* -----------------29.04.98 07:35------------------- @@ -781,6 +772,8 @@ public: static BOOL XTextRangeToSwPaM( SwUnoInternalPaM& rToFill, const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & xTextRange); + static ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > CreateTextRangeFromPosition(SwDoc* pDoc, + const SwPosition& rPos, const SwPosition* pMark); }; /* -----------------15.05.98 08:29------------------- @@ -1005,11 +998,7 @@ public: /*-----------------07.04.98 08:10------------------- --------------------------------------------------*/ -class SwXParagraphEnumeration : public cppu::WeakImplHelper2 -< - ::com::sun::star::container::XEnumeration, - ::com::sun::star::lang::XServiceInfo ->, +class SwXParagraphEnumeration : public SwSimpleEnumerationBaseClass, public SwClient { ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > xParentText; @@ -1353,37 +1342,6 @@ public: SwDoc* GetDoc() const{return pDoc;} void Invalidate(); }; -/* -----------------01.09.98 16:09------------------- - * - * --------------------------------------------------*/ -// os: 04.12.98 11:44 - keine Definition -//class SwXRedline : public XRedline, -/* -class SwXRedline : public XRedline, - public UsrObject, - public SwClient -{ - SwDoc* pDoc; - const SwRedline* pRedline; - - BOOL IsValid() const; -public: - SwXRedline(SwDoc* pDoc, const SwRedline* pRedline); - virtual ~SwXRedline(); - - //XRedline - virtual sal_uInt16 getActionType(void) const; - virtual rtl::OUString getAuthor(void) const; - virtual ::com::sun::star::util::DateTime getCreationDateTime(void) const; - virtual rtl::OUString getDescription(void) const; - virtual void setDescription(const rtl::OUString& Description_); - - //SwClient - virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew); -}; - - -*/ #endif diff --git a/sw/inc/unoprnms.hxx b/sw/inc/unoprnms.hxx index 8b2a639d9b61..a6c1d275bd17 100644 --- a/sw/inc/unoprnms.hxx +++ b/sw/inc/unoprnms.hxx @@ -2,9 +2,9 @@ * * $RCSfile: unoprnms.hxx,v $ * - * $Revision: 1.31 $ + * $Revision: 1.32 $ * - * last change: $Author: os $ $Date: 2001-01-11 12:32:20 $ + * last change: $Author: os $ $Date: 2001-01-12 16:11:27 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -645,6 +645,9 @@ extern const SwPropNameLen __FAR_DATA UNO_NAME_REDLINE_IDENTIFIER; extern const SwPropNameLen __FAR_DATA UNO_NAME_START_REDLINE; extern const SwPropNameLen __FAR_DATA UNO_NAME_END_REDLINE; +extern const SwPropNameLen __FAR_DATA UNO_NAME_REDLINE_START; +extern const SwPropNameLen __FAR_DATA UNO_NAME_REDLINE_END ; +extern const SwPropNameLen __FAR_DATA UNO_NAME_REDLINE_TEXT; #endif diff --git a/sw/source/core/unocore/makefile.mk b/sw/source/core/unocore/makefile.mk index 015bfe7343e6..0ab19806b0a4 100644 --- a/sw/source/core/unocore/makefile.mk +++ b/sw/source/core/unocore/makefile.mk @@ -2,9 +2,9 @@ # # $RCSfile: makefile.mk,v $ # -# $Revision: 1.6 $ +# $Revision: 1.7 $ # -# last change: $Author: dvo $ $Date: 2000-12-19 17:28:54 $ +# last change: $Author: os $ $Date: 2001-01-12 16:12:44 $ # # The Contents of this file are made available subject to the terms of # either of the following licenses @@ -105,6 +105,7 @@ CXXFILES = \ unoportenum.cxx \ unoprnms.cxx \ unoredline.cxx \ + unoredlines.cxx \ unorefmk.cxx \ unosett.cxx \ unosrch.cxx \ @@ -136,6 +137,7 @@ SLOFILES = \ $(SLO)$/unoportenum.obj\ $(SLO)$/unoprnms.obj\ $(SLO)$/unoredline.obj\ + $(SLO)$/unoredlines.obj\ $(SLO)$/unosrch.obj\ $(SLO)$/unostyle.obj\ $(SLO)$/unotbl.obj \ diff --git a/sw/source/core/unocore/unobkm.cxx b/sw/source/core/unocore/unobkm.cxx index e13513a90e4a..cdc7ad3c933d 100644 --- a/sw/source/core/unocore/unobkm.cxx +++ b/sw/source/core/unocore/unobkm.cxx @@ -2,9 +2,9 @@ * * $RCSfile: unobkm.cxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-19 00:08:28 $ + * last change: $Author: os $ $Date: 2001-01-12 16:12:44 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -212,7 +212,7 @@ uno::Reference< text::XTextRange > SwXBookmark::getAnchor(void) throw( uno::Run const SwPosition& rPos = pBkm->GetPos(); const SwPosition* pMarkPos = pBkm->GetOtherPos(); - aRet = CreateTextRangeFromPosition(pDoc, rPos, pMarkPos); + aRet = SwXTextRange::CreateTextRangeFromPosition(pDoc, rPos, pMarkPos); } else throw uno::RuntimeException(); @@ -417,6 +417,9 @@ void SwXBookmark::removeVetoableChangeListener(const OUString& PropertyName, con /*------------------------------------------------------------------------ $Log: not supported by cvs2svn $ + Revision 1.1.1.1 2000/09/19 00:08:28 hr + initial import + Revision 1.3 2000/09/18 16:04:31 willem.vandorp OpenOffice header added. diff --git a/sw/source/core/unocore/unocoll.cxx b/sw/source/core/unocore/unocoll.cxx index f8a71eaedcb0..49bb63be6c51 100644 --- a/sw/source/core/unocore/unocoll.cxx +++ b/sw/source/core/unocore/unocoll.cxx @@ -2,9 +2,9 @@ * * $RCSfile: unocoll.cxx,v $ * - * $Revision: 1.9 $ + * $Revision: 1.10 $ * - * last change: $Author: dvo $ $Date: 2000-12-19 17:28:55 $ + * last change: $Author: os $ $Date: 2001-01-12 16:12:45 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1963,86 +1963,6 @@ SwXReferenceMark* SwXReferenceMarks::GetObject( SwDoc* pDoc, const SwFmtRefMark* /****************************************************************** * ******************************************************************/ -/* -----------------------------06.04.00 12:44-------------------------------- - - ---------------------------------------------------------------------------*/ -OUString SwXRedlines::getImplementationName(void) throw( RuntimeException ) -{ - return C2U("SwXRedlines"); -} -/* -----------------------------06.04.00 12:44-------------------------------- - - ---------------------------------------------------------------------------*/ -BOOL SwXRedlines::supportsService(const OUString& rServiceName) throw( RuntimeException ) -{ - return C2U("com.sun.star.text.Redlines") == rServiceName; -} -/* -----------------------------06.04.00 12:44-------------------------------- - - ---------------------------------------------------------------------------*/ -Sequence< OUString > SwXRedlines::getSupportedServiceNames(void) throw( RuntimeException ) -{ - Sequence< OUString > aRet(1); - OUString* pArray = aRet.getArray(); - pArray[0] = C2U("com.sun.star.text.Redlines"); - return aRet; -} -/*-- 14.01.99 09:02:36--------------------------------------------------- - - -----------------------------------------------------------------------*/ -SwXRedlines::SwXRedlines(SwDoc* pDoc) : - SwUnoCollection(pDoc) -{ -} -/*-- 14.01.99 09:02:36--------------------------------------------------- - - -----------------------------------------------------------------------*/ -SwXRedlines::~SwXRedlines() -{ -} -/*-- 14.01.99 09:02:37--------------------------------------------------- - - -----------------------------------------------------------------------*/ -sal_Int32 SwXRedlines::getCount(void) throw( uno::RuntimeException ) -{ - vos::OGuard aGuard(Application::GetSolarMutex()); - if(!IsValid()) - throw uno::RuntimeException(); - return GetDoc()->GetRedlineTbl().Count(); -} -/*-- 14.01.99 09:02:37--------------------------------------------------- - - -----------------------------------------------------------------------*/ -uno::Any SwXRedlines::getByIndex(sal_Int32 nIndex) throw( IndexOutOfBoundsException, WrappedTargetException, uno::RuntimeException ) -{ - vos::OGuard aGuard(Application::GetSolarMutex()); - //Definition der Redline existiert noch nicht - DBG_WARNING("not implemented") - return uno::Any(); -} -/*-- 14.01.99 09:02:37--------------------------------------------------- - - -----------------------------------------------------------------------*/ -uno::Type SAL_CALL SwXRedlines::getElementType() throw(uno::RuntimeException) -{ - vos::OGuard aGuard(Application::GetSolarMutex()); - //Definition der Redline existiert noch nicht - DBG_WARNING("not implemented") - return ::getCppuVoidType(); -} -/*-- 14.01.99 09:02:37--------------------------------------------------- - - -----------------------------------------------------------------------*/ -sal_Bool SwXRedlines::hasElements(void) throw( uno::RuntimeException ) -{ - vos::OGuard aGuard(Application::GetSolarMutex()); - if(!IsValid()) - throw uno::RuntimeException(); - return 0 != GetDoc()->GetRedlineTbl().Count(); -} -/****************************************************************** - * - ******************************************************************/ /*-----------------11.03.98 11:18------------------- Gueltigkeitspruefung --------------------------------------------------*/ diff --git a/sw/source/core/unocore/unofield.cxx b/sw/source/core/unocore/unofield.cxx index 0d9731dfd73b..084378483695 100644 --- a/sw/source/core/unocore/unofield.cxx +++ b/sw/source/core/unocore/unofield.cxx @@ -2,9 +2,9 @@ * * $RCSfile: unofield.cxx,v $ * - * $Revision: 1.15 $ + * $Revision: 1.16 $ * - * last change: $Author: os $ $Date: 2000-12-07 12:06:41 $ + * last change: $Author: os $ $Date: 2001-01-12 16:12:45 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -2210,7 +2210,7 @@ uno::Reference< XTextRange > SwXTextField::getAnchor(void) throw( uno::RuntimeE SwPaM aPam(rTxtNode, *pTxtFld->GetStart() + 1, rTxtNode, *pTxtFld->GetStart()); - aRef = ::CreateTextRangeFromPosition(m_pDoc, + aRef = SwXTextRange::CreateTextRangeFromPosition(m_pDoc, *aPam.GetPoint(), aPam.GetMark()); } return aRef; diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx index 8ade722812c2..c3e36adb136a 100644 --- a/sw/source/core/unocore/unoframe.cxx +++ b/sw/source/core/unocore/unoframe.cxx @@ -2,9 +2,9 @@ * * $RCSfile: unoframe.cxx,v $ * - * $Revision: 1.26 $ + * $Revision: 1.27 $ * - * last change: $Author: os $ $Date: 2000-12-22 09:51:05 $ + * last change: $Author: os $ $Date: 2001-01-12 16:12:45 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1813,7 +1813,7 @@ uno::Reference< XTextRange > SwXFrame::getAnchor(void) throw( RuntimeException if( pFmt->GetAnchor().GetAnchorId() != FLY_PAGE ) { const SwPosition &rPos = *(pFmt->GetAnchor().GetCntntAnchor()); - aRef = ::CreateTextRangeFromPosition(pFmt->GetDoc(), rPos, 0); + aRef = SwXTextRange::CreateTextRangeFromPosition(pFmt->GetDoc(), rPos, 0); } } else diff --git a/sw/source/core/unocore/unoftn.cxx b/sw/source/core/unocore/unoftn.cxx index f54f4e0c4699..08ae487614e8 100644 --- a/sw/source/core/unocore/unoftn.cxx +++ b/sw/source/core/unocore/unoftn.cxx @@ -2,9 +2,9 @@ * * $RCSfile: unoftn.cxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: os $ $Date: 2000-10-23 08:45:59 $ + * last change: $Author: os $ $Date: 2001-01-12 16:12:45 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -354,7 +354,7 @@ uno::Reference< text::XTextRange > SwXFootnote::getAnchor(void) throw( uno::Run { const SwTxtFtn* pTxtFtn = pFmt->GetTxtFtn(); SwPosition aPos( *pTxtFtn->GetStartNode() ); - aRef = ::CreateTextRangeFromPosition((SwDoc*)GetDoc(), aPos, 0); + aRef = SwXTextRange::CreateTextRangeFromPosition((SwDoc*)GetDoc(), aPos, 0); } else throw uno::RuntimeException(); @@ -619,6 +619,9 @@ void SwXFootnote::removeVetoableChangeListener( const OUString& PropertyName, /*------------------------------------------------------------------------ $Log: not supported by cvs2svn $ + Revision 1.4 2000/10/23 08:45:59 os + syntax: ')' + Revision 1.3 2000/10/20 15:55:57 os #78714# set reference number directly if document is in reading diff --git a/sw/source/core/unocore/unoidx.cxx b/sw/source/core/unocore/unoidx.cxx index c591ab95b932..f82b58e46e71 100644 --- a/sw/source/core/unocore/unoidx.cxx +++ b/sw/source/core/unocore/unoidx.cxx @@ -2,9 +2,9 @@ * * $RCSfile: unoidx.cxx,v $ * - * $Revision: 1.20 $ + * $Revision: 1.21 $ * - * last change: $Author: os $ $Date: 2000-12-09 14:12:18 $ + * last change: $Author: os $ $Date: 2001-01-12 16:12:45 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1067,7 +1067,7 @@ Reference< text::XTextRange > SwXDocumentIndex::getAnchor(void) throw( RuntimeE aPaM.SetMark(); aPaM.GetPoint()->nNode = *pIdx->GetNode().EndOfSectionNode(); aPaM.Move( fnMoveBackward, fnGoCntnt ); - xRet = ::CreateTextRangeFromPosition(pSectFmt->GetDoc(), + xRet = SwXTextRange::CreateTextRangeFromPosition(pSectFmt->GetDoc(), *aPaM.GetMark(), aPaM.GetPoint()); } } diff --git a/sw/source/core/unocore/unomap.cxx b/sw/source/core/unocore/unomap.cxx index fa1d304a4081..b47a29480652 100644 --- a/sw/source/core/unocore/unomap.cxx +++ b/sw/source/core/unocore/unomap.cxx @@ -2,9 +2,9 @@ * * $RCSfile: unomap.cxx,v $ * - * $Revision: 1.39 $ + * $Revision: 1.40 $ * - * last change: $Author: os $ $Date: 2001-01-11 12:40:02 $ + * last change: $Author: os $ $Date: 2001-01-12 16:12:45 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -506,6 +506,13 @@ void SwUnoPropertyMapProvider::Sort(sal_uInt16 nId) { SW_PROP_NAME(UNO_NAME_END_REDLINE), FN_UNO_REDLINE_NODE_END , &::getCppuType((Sequence<PropertyValue>*)0) , PropertyAttribute::MAYBEVOID|PropertyAttribute::READONLY, 0xff }, #endif +#define _REDLINE_PROPERTIES \ + {SW_PROP_NAME(UNO_NAME_REDLINE_AUTHOR), 0, &::getCppuType((OUString*)0), PropertyAttribute::MAYBEVOID|PropertyAttribute::READONLY, 0},\ + {SW_PROP_NAME(UNO_NAME_REDLINE_DATE_TIME), 0, &::getCppuType((util::DateTime*)0), PropertyAttribute::MAYBEVOID|PropertyAttribute::READONLY, 0},\ + {SW_PROP_NAME(UNO_NAME_REDLINE_COMMENT), 0, &::getCppuType((OUString*)0), PropertyAttribute::MAYBEVOID|PropertyAttribute::READONLY, 0},\ + {SW_PROP_NAME(UNO_NAME_REDLINE_TYPE), 0, &::getCppuType((OUString*)0), PropertyAttribute::MAYBEVOID|PropertyAttribute::READONLY, 0},\ + {SW_PROP_NAME(UNO_NAME_REDLINE_SUCCESSOR_DATA), 0, &::getCppuType((Sequence<PropertyValue>*)0), PropertyAttribute::MAYBEVOID|PropertyAttribute::READONLY, 0},\ + {SW_PROP_NAME(UNO_NAME_REDLINE_IDENTIFIER), 0, &::getCppuType((OUString*)0), PropertyAttribute::MAYBEVOID|PropertyAttribute::READONLY, 0}, /* -----------------24.06.98 18:12------------------- * @@ -1867,12 +1874,7 @@ const SfxItemPropertyMap* SwUnoPropertyMapProvider::GetPropertyMap(sal_uInt16 {SW_PROP_NAME(UNO_NAME_CONTROL_CHARACTER ), 0, &::getCppuType((const sal_Int16*)0), PropertyAttribute::MAYBEVOID|PropertyAttribute::READONLY, MID_HYPHEN_MIN_LEAD }, {SW_PROP_NAME(UNO_NAME_IS_COLLAPSED), 0, &::getBooleanCppuType(), PropertyAttribute::MAYBEVOID|PropertyAttribute::READONLY, 0 }, {SW_PROP_NAME(UNO_NAME_IS_START), 0, &::getBooleanCppuType(), PropertyAttribute::MAYBEVOID|PropertyAttribute::READONLY, 0 }, - {SW_PROP_NAME(UNO_NAME_REDLINE_AUTHOR), 0, &::getCppuType((OUString*)0), PropertyAttribute::MAYBEVOID|PropertyAttribute::READONLY, 0}, - {SW_PROP_NAME(UNO_NAME_REDLINE_DATE_TIME), 0, &::getCppuType((util::DateTime*)0), PropertyAttribute::MAYBEVOID|PropertyAttribute::READONLY, 0}, - {SW_PROP_NAME(UNO_NAME_REDLINE_COMMENT), 0, &::getCppuType((OUString*)0), PropertyAttribute::MAYBEVOID|PropertyAttribute::READONLY, 0}, - {SW_PROP_NAME(UNO_NAME_REDLINE_TYPE), 0, &::getCppuType((OUString*)0), PropertyAttribute::MAYBEVOID|PropertyAttribute::READONLY, 0}, - {SW_PROP_NAME(UNO_NAME_REDLINE_SUCCESSOR_DATA), 0, &::getCppuType((Sequence<PropertyValue>*)0), PropertyAttribute::MAYBEVOID|PropertyAttribute::READONLY, 0}, - {SW_PROP_NAME(UNO_NAME_REDLINE_IDENTIFIER), 0, &::getCppuType((OUString*)0), PropertyAttribute::MAYBEVOID|PropertyAttribute::READONLY, 0}, + _REDLINE_PROPERTIES {SW_PROP_NAME(UNO_NAME_TEXT_PORTION_TYPE), 0, &::getCppuType((OUString*)0), PropertyAttribute::READONLY, 0}, {0,0,0,0} }; @@ -1910,6 +1912,19 @@ const SfxItemPropertyMap* SwUnoPropertyMapProvider::GetPropertyMap(sal_uInt16 aMapArr[nPropertyId] = aTextColumns_Impl; } break; + case PROPERTY_MAP_REDLINE : + { + static SfxItemPropertyMap aRedlineMap_Impl[] = + { + _REDLINE_PROPERTIES + {SW_PROP_NAME(UNO_NAME_REDLINE_START), 0, &::getCppuType((Reference<XInterface>*)0), PropertyAttribute::READONLY, 0}, + {SW_PROP_NAME(UNO_NAME_REDLINE_END ), 0, &::getCppuType((Reference<XInterface>*)0), PropertyAttribute::MAYBEVOID|PropertyAttribute::READONLY, 0}, + {SW_PROP_NAME(UNO_NAME_REDLINE_TEXT ), 0, &::getCppuType((Reference<XText>*)0), PropertyAttribute::MAYBEVOID|PropertyAttribute::READONLY, 0}, + {0,0,0,0} + }; + aMapArr[nPropertyId] = aRedlineMap_Impl; + } + break; } Sort(nPropertyId); } diff --git a/sw/source/core/unocore/unoobj.cxx b/sw/source/core/unocore/unoobj.cxx index 7957a8f4c354..6b3a6ccca276 100644 --- a/sw/source/core/unocore/unoobj.cxx +++ b/sw/source/core/unocore/unoobj.cxx @@ -2,9 +2,9 @@ * * $RCSfile: unoobj.cxx,v $ * - * $Revision: 1.32 $ + * $Revision: 1.33 $ * - * last change: $Author: os $ $Date: 2000-12-20 17:27:05 $ + * last change: $Author: os $ $Date: 2001-01-12 16:12:45 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -857,144 +857,7 @@ SwFmtColl* SwXTextCursor::GetCurTxtFmtColl(SwPaM& rPam, BOOL bConditional) ****************************************************************************** * Taskforce ONE51 ******************************************************************************/ -/* -----------------24.02.99 14:18------------------- - * Der StartNode muss in einem existierenden Header/Footen liegen - * --------------------------------------------------*/ -sal_Bool lcl_IsStarNodeInFormat(sal_Bool bHeader, SwStartNode* pSttNode, - const SwFrmFmt* pFrmFmt, SwFrmFmt*& rpFormat) -{ - sal_Bool bRet = sal_False; - const SfxItemSet& rSet = pFrmFmt->GetAttrSet(); - const SfxPoolItem* pItem; - SwFrmFmt* pHeadFootFmt; - if(SFX_ITEM_SET == rSet.GetItemState(bHeader ? RES_HEADER : RES_FOOTER, sal_True, &pItem) && - 0 != (pHeadFootFmt = bHeader ? - ((SwFmtHeader*)pItem)->GetHeaderFmt() : - ((SwFmtFooter*)pItem)->GetFooterFmt())) - { - const SwFmtCntnt& rFlyCntnt = pHeadFootFmt->GetCntnt(); - const SwNode& rNode = rFlyCntnt.GetCntntIdx()->GetNode(); - const SwStartNode* pCurSttNode = rNode.FindSttNodeByType( - bHeader ? SwHeaderStartNode : SwFooterStartNode); - if(pCurSttNode && pCurSttNode == pSttNode) - { - bRet = sal_True; - rpFormat = pHeadFootFmt; - } - } - return bRet; -} - -/* -----------------03.11.98 15:58------------------- - * - * --------------------------------------------------*/ -uno::Reference< XTextRange > CreateTextRangeFromPosition(SwDoc* pDoc, - const SwPosition& rPos, const SwPosition* pMark) -{ - uno::Reference< XTextRange > aRet; - SwUnoCrsr* pNewCrsr = pDoc->CreateUnoCrsr(rPos, sal_False); - if(pMark) - { - pNewCrsr->SetMark(); - *pNewCrsr->GetMark() = *pMark; - } - uno::Reference< XText > xParentText; - //jetzt besorgen wir uns mal den Parent: - SwStartNode* pSttNode = rPos.nNode.GetNode().FindStartNode(); - while(pSttNode && pSttNode->IsSectionNode()) - { - pSttNode = pSttNode->FindStartNode(); - } - SwStartNodeType eType = pSttNode->GetStartNodeType(); - switch(eType) - { - case SwTableBoxStartNode: - { - const SwTableNode* pTblNode = pSttNode->FindTableNode(); - SwFrmFmt* pTableFmt = (SwFrmFmt*)pTblNode->GetTable().GetFrmFmt(); - SwTableBox* pBox = pSttNode->GetTblBox(); - - if( pBox ) - aRet = new SwXTextRange(*pTableFmt, *pBox, *pNewCrsr); - else - aRet = new SwXTextRange(*pTableFmt, *pSttNode, *pNewCrsr); - } - break; - case SwFlyStartNode: - { - SwFrmFmt* pFmt; - if(0 != (pFmt = pSttNode->GetFlyFmt())) - { - aRet = new SwXTextRange(*pFmt, *pNewCrsr); - } - } - break; - case SwHeaderStartNode: - case SwFooterStartNode: - { - sal_Bool bHeader = SwHeaderStartNode == eType; - sal_uInt16 nPDescCount = pDoc->GetPageDescCnt(); - for(sal_uInt16 i = 0; i < nPDescCount; i++) - { - const SwPageDesc& rDesc = pDoc->GetPageDesc( i ); - const SwFrmFmt* pFrmFmtMaster = &rDesc.GetMaster(); - const SwFrmFmt* pFrmFmtLeft = &rDesc.GetLeft(); - - SwFrmFmt* pHeadFootFmt = 0; - if(!lcl_IsStarNodeInFormat(bHeader, pSttNode, pFrmFmtMaster, pHeadFootFmt)) - lcl_IsStarNodeInFormat(bHeader, pSttNode, pFrmFmtLeft, pHeadFootFmt); - - if(pHeadFootFmt) - { - SwXHeadFootText* pxHdFt = (SwXHeadFootText*)SwClientIter( *pHeadFootFmt ). - First( TYPE( SwXHeadFootText )); - xParentText = pxHdFt; - if(!pxHdFt) - xParentText = new SwXHeadFootText(*pHeadFootFmt, bHeader); - break; - } - } - } - break; - case SwFootnoteStartNode: - { - sal_uInt16 n, nFtnCnt = pDoc->GetFtnIdxs().Count(); - SwTxtFtn* pTxtFtn; - uno::Reference< XFootnote > xRef; - for( n = 0; n < nFtnCnt; ++n ) - { - pTxtFtn = pDoc->GetFtnIdxs()[ n ]; - const SwFmtFtn& rFtn = pTxtFtn->GetFtn(); - const SwTxtFtn* pTxtFtn = rFtn.GetTxtFtn(); -#ifdef DEBUG - const SwStartNode* pTmpSttNode = pTxtFtn->GetStartNode()->GetNode(). - FindSttNodeByType(SwFootnoteStartNode); -#endif - - if(pSttNode == pTxtFtn->GetStartNode()->GetNode(). - FindSttNodeByType(SwFootnoteStartNode)) - { - aRet = new SwXFootnote(pDoc, rFtn); - break; - } - } - } - break; - default: - { - // dann ist es der Body-Text - uno::Reference<frame::XModel> xModel = pDoc->GetDocShell()->GetBaseModel(); - uno::Reference< XTextDocument > xDoc( - xModel, uno::UNO_QUERY); - xParentText = xDoc->getText(); - } - } - if(!aRet.is()) - aRet = new SwXTextRange(*pNewCrsr, xParentText); - delete pNewCrsr; - return aRet; -} /****************************************************************** * SwXTextCursor ******************************************************************/ diff --git a/sw/source/core/unocore/unoobj2.cxx b/sw/source/core/unocore/unoobj2.cxx index d5c8cf08b431..65baa8364cd5 100644 --- a/sw/source/core/unocore/unoobj2.cxx +++ b/sw/source/core/unocore/unoobj2.cxx @@ -2,9 +2,9 @@ * * $RCSfile: unoobj2.cxx,v $ * - * $Revision: 1.7 $ + * $Revision: 1.8 $ * - * last change: $Author: os $ $Date: 2000-12-21 14:52:16 $ + * last change: $Author: os $ $Date: 2001-01-12 16:12:45 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1186,7 +1186,7 @@ uno::Reference< XText > SwXTextRange::getText(void) throw( uno::RuntimeExceptio SwTable* pTable = SwTable::FindTable( pTblFmt ); SwTableNode* pTblNode = pTable->GetTableNode(); SwPosition aPosition( *pTblNode ); - Reference< XTextRange > xRange = CreateTextRangeFromPosition(pDoc, + Reference< XTextRange > xRange = SwXTextRange::CreateTextRangeFromPosition(pDoc, aPosition, 0); xParentText = xRange->getText(); } @@ -1379,6 +1379,265 @@ sal_Bool SwXTextRange::XTextRangeToSwPaM( SwUnoInternalPaM& rToFill, } return bRet; } +/* -----------------24.02.99 14:18------------------- + * Der StartNode muss in einem existierenden Header/Footen liegen + * --------------------------------------------------*/ +sal_Bool lcl_IsStartNodeInFormat(sal_Bool bHeader, SwStartNode* pSttNode, + const SwFrmFmt* pFrmFmt, SwFrmFmt*& rpFormat) +{ + sal_Bool bRet = sal_False; + const SfxItemSet& rSet = pFrmFmt->GetAttrSet(); + const SfxPoolItem* pItem; + SwFrmFmt* pHeadFootFmt; + if(SFX_ITEM_SET == rSet.GetItemState(bHeader ? RES_HEADER : RES_FOOTER, sal_True, &pItem) && + 0 != (pHeadFootFmt = bHeader ? + ((SwFmtHeader*)pItem)->GetHeaderFmt() : + ((SwFmtFooter*)pItem)->GetFooterFmt())) + { + const SwFmtCntnt& rFlyCntnt = pHeadFootFmt->GetCntnt(); + const SwNode& rNode = rFlyCntnt.GetCntntIdx()->GetNode(); + const SwStartNode* pCurSttNode = rNode.FindSttNodeByType( + bHeader ? SwHeaderStartNode : SwFooterStartNode); + if(pCurSttNode && pCurSttNode == pSttNode) + { + bRet = sal_True; + rpFormat = pHeadFootFmt; + } + } + return bRet; +} +/* -----------------03.11.98 15:58------------------- + * + * --------------------------------------------------*/ +uno::Reference< XTextRange > SwXTextRange::CreateTextRangeFromPosition(SwDoc* pDoc, + const SwPosition& rPos, const SwPosition* pMark) +{ + uno::Reference< XTextRange > aRet; + SwUnoCrsr* pNewCrsr = pDoc->CreateUnoCrsr(rPos, sal_False); + if(pMark) + { + pNewCrsr->SetMark(); + *pNewCrsr->GetMark() = *pMark; + } + uno::Reference< XText > xParentText; + //jetzt besorgen wir uns mal den Parent: + SwStartNode* pSttNode = rPos.nNode.GetNode().FindStartNode(); + while(pSttNode && pSttNode->IsSectionNode()) + { + pSttNode = pSttNode->FindStartNode(); + } + SwStartNodeType eType = pSttNode->GetStartNodeType(); + switch(eType) + { + case SwTableBoxStartNode: + { + const SwTableNode* pTblNode = pSttNode->FindTableNode(); + SwFrmFmt* pTableFmt = (SwFrmFmt*)pTblNode->GetTable().GetFrmFmt(); + SwTableBox* pBox = pSttNode->GetTblBox(); + + if( pBox ) + aRet = new SwXTextRange(*pTableFmt, *pBox, *pNewCrsr); + else + aRet = new SwXTextRange(*pTableFmt, *pSttNode, *pNewCrsr); + } + break; + case SwFlyStartNode: + { + SwFrmFmt* pFmt; + if(0 != (pFmt = pSttNode->GetFlyFmt())) + { + aRet = new SwXTextRange(*pFmt, *pNewCrsr); + + } + } + break; + case SwHeaderStartNode: + case SwFooterStartNode: + { + sal_Bool bHeader = SwHeaderStartNode == eType; + sal_uInt16 nPDescCount = pDoc->GetPageDescCnt(); + for(sal_uInt16 i = 0; i < nPDescCount; i++) + { + const SwPageDesc& rDesc = pDoc->GetPageDesc( i ); + const SwFrmFmt* pFrmFmtMaster = &rDesc.GetMaster(); + const SwFrmFmt* pFrmFmtLeft = &rDesc.GetLeft(); + + SwFrmFmt* pHeadFootFmt = 0; + if(!lcl_IsStartNodeInFormat(bHeader, pSttNode, pFrmFmtMaster, pHeadFootFmt)) + lcl_IsStartNodeInFormat(bHeader, pSttNode, pFrmFmtLeft, pHeadFootFmt); + + if(pHeadFootFmt) + { + SwXHeadFootText* pxHdFt = (SwXHeadFootText*)SwClientIter( *pHeadFootFmt ). + First( TYPE( SwXHeadFootText )); + xParentText = pxHdFt; + if(!pxHdFt) + xParentText = new SwXHeadFootText(*pHeadFootFmt, bHeader); + break; + } + } + } + break; + case SwFootnoteStartNode: + { + sal_uInt16 n, nFtnCnt = pDoc->GetFtnIdxs().Count(); + SwTxtFtn* pTxtFtn; + uno::Reference< XFootnote > xRef; + for( n = 0; n < nFtnCnt; ++n ) + { + pTxtFtn = pDoc->GetFtnIdxs()[ n ]; + const SwFmtFtn& rFtn = pTxtFtn->GetFtn(); + const SwTxtFtn* pTxtFtn = rFtn.GetTxtFtn(); +#ifdef DEBUG + const SwStartNode* pTmpSttNode = pTxtFtn->GetStartNode()->GetNode(). + FindSttNodeByType(SwFootnoteStartNode); +#endif + + if(pSttNode == pTxtFtn->GetStartNode()->GetNode(). + FindSttNodeByType(SwFootnoteStartNode)) + { + aRet = new SwXFootnote(pDoc, rFtn); + break; + } + } + } + break; + default: + { + // dann ist es der Body-Text + uno::Reference<frame::XModel> xModel = pDoc->GetDocShell()->GetBaseModel(); + uno::Reference< XTextDocument > xDoc( + xModel, uno::UNO_QUERY); + xParentText = xDoc->getText(); + } + } + if(!aRet.is()) + aRet = new SwXTextRange(*pNewCrsr, xParentText); + delete pNewCrsr; + return aRet; +} +/*Reference< XTextRange > SwXTextRange::createTextRangeFromPaM( + SwPaM& rPaM, Reference<XText> xParentText) +{ + Reference< XTextRange > xRet; + // in welcher Umgebung steht denn der PaM? + SwStartNode* pSttNode = rPaM.GetNode()->FindStartNode(); + SwStartNodeType eType = pSttNode->GetStartNodeType(); + uno::Reference< XText > xCurParentRef; + switch(eType) + { + case SwTableBoxStartNode: + { + SwTableBox* pBox = pSttNode->GetTblBox(); + xRet = new SwXTextRange(*pBox->GetFrmFmt(), *pBox, rPaM); + } + break; + case SwFlyStartNode: + { + SwFrmFmt* pFlyFmt = pSttNode->GetFlyFmt(); + SwXTextFrame* pxFrm = (SwXTextFrame*)SwClientIter( *pFlyFmt ). + First( TYPE( SwXTextFrame )); + if(pxFrm) + xCurParentRef = pxFrm; + else + xRet = new SwXTextRange(*pFlyFmt, rPaM); + } + break; + case SwFootnoteStartNode: + { + const SwFtnIdxs& rIdxs = rPaM.GetDoc()->GetFtnIdxs(); + sal_uInt16 n, nFtnCnt = rIdxs.Count(); + for( n = 0; n < nFtnCnt; ++n ) + { + const SwTxtFtn* pFtn = rIdxs[ n ]; + + const SwStartNode* pTemp = 0; + const SwNode& rNode = pFtn->GetStartNode()->GetNode(); + if(rNode.GetNodeType() == ND_STARTNODE) + pTemp = (const SwStartNode*)&rNode; + if(pSttNode == pTemp) + { + const SwFmtFtn& rFtn = pFtn->GetFtn(); + //TODO: schon existierendes Fussnotenobjekt wiederfinden! + xCurParentRef = new SwXFootnote(rPaM.GetDoc(), rFtn); + break; + } + } + } + break; + case SwHeaderStartNode: + case SwFooterStartNode: + { + //PageStyle besorgen, HeaderText anlegen/erfragen, + //und dann SwXTextPosition damit anlegen + String sPageStyleName = SwUnoCursorHelper::GetCurPageStyle(rPaM); + uno::Reference< style::XStyleFamiliesSupplier > xStyleSupp( + rPaM.GetDoc()->GetDocShell()->GetBaseModel(), uno::UNO_QUERY); + + uno::Reference< container::XNameAccess > xStyles = xStyleSupp->getStyleFamilies(); + uno::Any aStyleFamily = xStyles->getByName(C2U("PageStyles")); + + uno::Reference< container::XNameContainer > xFamily = + *(uno::Reference< container::XNameContainer > *)aStyleFamily.getValue(); + uno::Any aStyle = xFamily->getByName(sPageStyleName); + uno::Reference< style::XStyle > xStyle = *(uno::Reference< style::XStyle > *)aStyle.getValue(); + + uno::Reference< beans::XPropertySet > xPropSet(xStyle, uno::UNO_QUERY); + uno::Any aLayout = xPropSet->getPropertyValue(C2U(UNO_NAME_PAGE_STYLE_LAYOUT)); + + style::PageStyleLayout eLayout = *(style::PageStyleLayout*)aLayout.getValue(); + uno::Any aShare = xPropSet->getPropertyValue(C2U(UNO_NAME_HEADER_IS_SHARED)); + sal_Bool bShare; + aShare >>= bShare; + sal_Bool bLeft = sal_False; + sal_Bool bRight = sal_False; + //jetzt evtl. noch zw. linker/rechter Kopf-/Fusszeile unterscheiden + if(!bShare && eLayout == style::PageStyleLayout_MIRRORED) + { + uno::Reference<lang::XUnoTunnel> xTunnel(xStyle, uno::UNO_QUERY); + SwXPageStyle* pStyle = (SwXPageStyle*) + xTunnel->getSomething( SwXPageStyle::getUnoTunnelId()); + + DBG_ASSERT(pStyle, "Was ist das fuer ein style::XStyle?") + bLeft = pSttNode == pStyle->GetStartNode(eType == SwHeaderStartNode, sal_True); + bRight = !bLeft; + } + uno::Any aParent; + sal_Bool bFooter = eType == SwFooterStartNode; + if(eLayout == style::PageStyleLayout_LEFT || bLeft) + aParent = xPropSet->getPropertyValue(C2U(bFooter ? UNO_NAME_FOOTER_TEXT_LEFT : UNO_NAME_HEADER_TEXT_LEFT)); + else if(eLayout == style::PageStyleLayout_RIGHT) + aParent = xPropSet->getPropertyValue(C2U(bFooter ? UNO_NAME_FOOTER_TEXT_RIGHT : UNO_NAME_HEADER_TEXT_RIGHT)); + else + aParent = xPropSet->getPropertyValue(C2U(bFooter ? UNO_NAME_FOOTER_TEXT : UNO_NAME_HEADER_TEXT)); + + if(aParent.getValueType() != ::getVoidCppuType()) + { + uno::Reference< XText > xText = *(uno::Reference< XText > *)aParent.getValue(); + xCurParentRef = xText; + } + } + + + break; +// case SwNormalStartNode: + default: + { + if(!xParentText.is()) + { + uno::Reference< XTextDocument > xDoc( + rPaM.GetDoc()->GetDocShell()->GetBaseModel(), uno::UNO_QUERY); + xParentText = xDoc->getText(); + } + xCurParentRef = xParentText; + } + } + if(xCurParentRef.is() && !xRet.is()) + xRet = new SwXTextRange(rPaM, xCurParentRef); + DBG_ASSERT(xRet.is(), "SwXTextRange not created") + return xRet; +}*/ + /* -----------------------------03.04.00 09:11-------------------------------- ---------------------------------------------------------------------------*/ @@ -1717,122 +1976,11 @@ XTextRangeArr* SwXTextRanges::GetRangesArray() { pRangeArr = new XTextRangeArr(); FOREACHUNOPAM_START(pCrsr) - uno::Reference< XTextRange > * pPtr = new uno::Reference< XTextRange > ; - // in welcher Umgebung steht denn der PaM? - SwStartNode* pSttNode = PUNOPAM->GetNode()->FindStartNode(); - SwStartNodeType eType = pSttNode->GetStartNodeType(); - uno::Reference< XText > xCurParentRef; - switch(eType) - { - case SwTableBoxStartNode: - { - SwTableBox* pBox = pSttNode->GetTblBox(); - *pPtr = new SwXTextRange(*pBox->GetFrmFmt(), *pBox, *PUNOPAM); - } - break; - case SwFlyStartNode: - { - SwFrmFmt* pFlyFmt = pSttNode->GetFlyFmt(); - SwXTextFrame* pxFrm = (SwXTextFrame*)SwClientIter( *pFlyFmt ). - First( TYPE( SwXTextFrame )); - if(pxFrm) - xCurParentRef = pxFrm; - else - *pPtr = new SwXTextRange(*pFlyFmt, *PUNOPAM); - } - break; - case SwFootnoteStartNode: - { - const SwFtnIdxs& rIdxs = pCrsr->GetDoc()->GetFtnIdxs(); - sal_uInt16 n, nFtnCnt = rIdxs.Count(); - for( n = 0; n < nFtnCnt; ++n ) - { - const SwTxtFtn* pFtn = rIdxs[ n ]; - - const SwStartNode* pTemp = 0; - const SwNode& rNode = pFtn->GetStartNode()->GetNode(); - if(rNode.GetNodeType() == ND_STARTNODE) - pTemp = (const SwStartNode*)&rNode; - if(pSttNode == pTemp) - { - const SwFmtFtn& rFtn = pFtn->GetFtn(); - //TODO: schon existierendes Fussnotenobjekt wiederfinden! - xCurParentRef = new SwXFootnote(pCrsr->GetDoc(), rFtn); - break; - } - } - } - break; - case SwHeaderStartNode: - case SwFooterStartNode: - { - //PageStyle besorgen, HeaderText anlegen/erfragen, - //und dann SwXTextPosition damit anlegen - String sPageStyleName = SwUnoCursorHelper::GetCurPageStyle(*pCrsr); - uno::Reference< style::XStyleFamiliesSupplier > xStyleSupp( - pCrsr->GetDoc()->GetDocShell()->GetBaseModel(), uno::UNO_QUERY); - - uno::Reference< container::XNameAccess > xStyles = xStyleSupp->getStyleFamilies(); - uno::Any aStyleFamily = xStyles->getByName(C2U("PageStyles")); - - uno::Reference< container::XNameContainer > xFamily = - *(uno::Reference< container::XNameContainer > *)aStyleFamily.getValue(); - uno::Any aStyle = xFamily->getByName(sPageStyleName); - uno::Reference< style::XStyle > xStyle = *(uno::Reference< style::XStyle > *)aStyle.getValue(); - - uno::Reference< beans::XPropertySet > xPropSet(xStyle, uno::UNO_QUERY); - uno::Any aLayout = xPropSet->getPropertyValue(C2U(UNO_NAME_PAGE_STYLE_LAYOUT)); - - style::PageStyleLayout eLayout = *(style::PageStyleLayout*)aLayout.getValue(); - uno::Any aShare = xPropSet->getPropertyValue(C2U(UNO_NAME_HEADER_IS_SHARED)); - sal_Bool bShare; - aShare >>= bShare; - sal_Bool bLeft = sal_False; - sal_Bool bRight = sal_False; - //jetzt evtl. noch zw. linker/rechter Kopf-/Fusszeile unterscheiden - if(!bShare && eLayout == style::PageStyleLayout_MIRRORED) - { - uno::Reference<lang::XUnoTunnel> xTunnel(xStyle, uno::UNO_QUERY); - SwXPageStyle* pStyle = (SwXPageStyle*) - xTunnel->getSomething( SwXPageStyle::getUnoTunnelId()); - - DBG_ASSERT(pStyle, "Was ist das fuer ein style::XStyle?") - bLeft = pSttNode == pStyle->GetStartNode(eType == SwHeaderStartNode, sal_True); - bRight = !bLeft; - } - uno::Any aParent; - sal_Bool bFooter = eType == SwFooterStartNode; - if(eLayout == style::PageStyleLayout_LEFT || bLeft) - aParent = xPropSet->getPropertyValue(C2U(bFooter ? UNO_NAME_FOOTER_TEXT_LEFT : UNO_NAME_HEADER_TEXT_LEFT)); - else if(eLayout == style::PageStyleLayout_RIGHT) - aParent = xPropSet->getPropertyValue(C2U(bFooter ? UNO_NAME_FOOTER_TEXT_RIGHT : UNO_NAME_HEADER_TEXT_RIGHT)); - else - aParent = xPropSet->getPropertyValue(C2U(bFooter ? UNO_NAME_FOOTER_TEXT : UNO_NAME_HEADER_TEXT)); - - if(aParent.getValueType() != ::getVoidCppuType()) - { - uno::Reference< XText > xText = *(uno::Reference< XText > *)aParent.getValue(); - xCurParentRef = xText; - } - } - - - break; -// case SwNormalStartNode: - default: - { - if(!xParentText.is()) - { - uno::Reference< XTextDocument > xDoc( - pCrsr->GetDoc()->GetDocShell()->GetBaseModel(), uno::UNO_QUERY); - xParentText = xDoc->getText(); - } - xCurParentRef = xParentText; - } - } - if(xCurParentRef.is()) - *pPtr = new SwXTextRange(*PUNOPAM, xCurParentRef); + Reference< XTextRange >* pPtr = + new Reference<XTextRange>( SwXTextRange::CreateTextRangeFromPosition(PUNOPAM->GetDoc(), + *PUNOPAM->GetPoint(), PUNOPAM->GetMark())); +// new Reference<XTextRange>( SwXTextRange::createTextRangeFromPaM(*PUNOPAM, xParentText)); if(pPtr->is()) pRangeArr->Insert(pPtr, pRangeArr->Count()); FOREACHUNOPAM_END() diff --git a/sw/source/core/unocore/unoprnms.cxx b/sw/source/core/unocore/unoprnms.cxx index 98e7dd36533e..1ec643da0d2e 100644 --- a/sw/source/core/unocore/unoprnms.cxx +++ b/sw/source/core/unocore/unoprnms.cxx @@ -2,9 +2,9 @@ * * $RCSfile: unoprnms.cxx,v $ * - * $Revision: 1.33 $ + * $Revision: 1.34 $ * - * last change: $Author: os $ $Date: 2001-01-11 12:40:02 $ + * last change: $Author: os $ $Date: 2001-01-12 16:12:45 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -640,4 +640,7 @@ const SwPropNameLen __FAR_DATA UNO_NAME_REDLINE_IDENTIFIER (MAP const SwPropNameLen __FAR_DATA UNO_NAME_START_REDLINE (MAP_CHAR_LEN("StartRedline")); const SwPropNameLen __FAR_DATA UNO_NAME_END_REDLINE (MAP_CHAR_LEN("EndRedline")); +const SwPropNameLen __FAR_DATA UNO_NAME_REDLINE_START (MAP_CHAR_LEN("RedlineStart")); +const SwPropNameLen __FAR_DATA UNO_NAME_REDLINE_END (MAP_CHAR_LEN("RedlineEnd")); +const SwPropNameLen __FAR_DATA UNO_NAME_REDLINE_TEXT (MAP_CHAR_LEN("RedlineText")); diff --git a/sw/source/core/unocore/unoredline.cxx b/sw/source/core/unocore/unoredline.cxx index a4aaf1041e63..c237ebbf0474 100644 --- a/sw/source/core/unocore/unoredline.cxx +++ b/sw/source/core/unocore/unoredline.cxx @@ -2,9 +2,9 @@ * * $RCSfile: unoredline.cxx,v $ * - * $Revision: 1.6 $ + * $Revision: 1.7 $ * - * last change: $Author: os $ $Date: 2001-01-11 12:40:02 $ + * last change: $Author: os $ $Date: 2001-01-12 16:12:45 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -71,15 +71,28 @@ #ifndef _SV_SVAPP_HXX //autogen #include <vcl/svapp.hxx> #endif +#ifndef _PAGEDESC_HXX //autogen +#include <pagedesc.hxx> +#endif +#include "poolfmt.hxx" #ifndef _REDLINE_HXX #include <redline.hxx> #endif +#ifndef _SECTION_HXX +#include <section.hxx> +#endif #ifndef _UNOPRNMS_HXX #include <unoprnms.hxx> #endif #ifndef _UNOOBJ_HXX #include <unoobj.hxx> #endif +#ifndef _UNOCOLL_HXX +#include <unocoll.hxx> +#endif +#ifndef _UNOMAP_HXX +#include <unomap.hxx> +#endif #ifndef _UNOCRSR_HXX #include <unocrsr.hxx> #endif @@ -105,6 +118,9 @@ #ifndef _COM_SUN_STAR_UTIL_DATETIME_HPP_ #include <com/sun/star/util/DateTime.hpp> #endif +#ifndef _COM_SUN_STAR_TEXT_XTEXTTABLE_HPP_ +#include <com/sun/star/text/XTextTable.hpp> +#endif using namespace ::com::sun::star; using namespace ::com::sun::star::lang; @@ -115,16 +131,17 @@ using namespace ::com::sun::star::beans; using namespace ::rtl; -/* -----------------------------19.12.00 11:36-------------------------------- +/* --------------------------------------------------------------------------- ---------------------------------------------------------------------------*/ - SwXRedlineText::SwXRedlineText(SwDoc* pDoc, SwNodeIndex aIndex) : SwXText(pDoc, CURSOR_REDLINE), aNodeIndex(aIndex) { } +/* --------------------------------------------------------------------------- + ---------------------------------------------------------------------------*/ Any SwXRedlineText::queryInterface( const Type& rType ) throw(RuntimeException) { @@ -136,28 +153,32 @@ Any SwXRedlineText::queryInterface( const Type& rType ) } return aRet; } +/* --------------------------------------------------------------------------- + ---------------------------------------------------------------------------*/ Sequence<Type> SwXRedlineText::getTypes() throw(RuntimeException) { - // merge getTypes() from superclasses - // SwXText::getTypes() uno::Sequence<uno::Type> aTypes = SwXText::getTypes(); - return aTypes; } +/* --------------------------------------------------------------------------- + ---------------------------------------------------------------------------*/ Sequence<sal_Int8> SwXRedlineText::getImplementationId() throw(RuntimeException) { + vos::OGuard aGuard(Application::GetSolarMutex()); static uno::Sequence< sal_Int8 > aId( 16 ); static sal_Bool bInit = FALSE; if(!bInit) rtl_createUuid( (sal_uInt8 *)aId.getArray(), 0, sal_True ); return aId; } +/* --------------------------------------------------------------------------- + ---------------------------------------------------------------------------*/ Reference<XTextCursor> SwXRedlineText::createTextCursor(void) throw( RuntimeException ) { @@ -170,7 +191,9 @@ Reference<XTextCursor> SwXRedlineText::createTextCursor(void) pUnoCursor->Move(fnMoveForward, fnGoNode); return (XWordCursor*)pCrsr; } +/* --------------------------------------------------------------------------- + ---------------------------------------------------------------------------*/ Reference<XTextCursor> SwXRedlineText::createTextCursorByRange( const Reference<XTextRange> & aTextRange) throw( RuntimeException ) @@ -180,7 +203,6 @@ Reference<XTextCursor> SwXRedlineText::createTextCursorByRange( xCursor->gotoRange(aTextRange->getEnd(), sal_True); return xCursor; } - /* -----------------------------19.12.00 11:36-------------------------------- ---------------------------------------------------------------------------*/ @@ -293,6 +315,19 @@ util::DateTime lcl_DateTimeToUno(const DateTime& rDT) return aRetDT; } // --------------------------------------------------------------------------- +DateTime lcl_DateTimeFromUno(const util::DateTime& rDT) +{ + DateTime aRetDT; + aRetDT.SetYear(rDT.Year); + aRetDT.SetMonth(rDT.Month); + aRetDT.SetDay(rDT.Day); + aRetDT.SetHour(rDT.Hours); + aRetDT.SetMin(rDT.Minutes); + aRetDT.SetSec(rDT.Seconds); + aRetDT.Set100Sec(rDT.HundredthSeconds); + return aRetDT; +} +// --------------------------------------------------------------------------- OUString lcl_RedlineTypeToOUString(SwRedlineType eType) { OUString sRet; @@ -307,6 +342,21 @@ OUString lcl_RedlineTypeToOUString(SwRedlineType eType) return sRet; } // --------------------------------------------------------------------------- +SwRedlineType lcl_OUStringToRedlineType(const OUString& rType) +{ + SwRedlineType eType = REDLINE_INSERT; + if(!rType.compareToAscii("Delete")) + eType = REDLINE_DELETE; + else if(!rType.compareToAscii("Format")) + eType = REDLINE_FORMAT; + else if(!rType.compareToAscii("TextTable")) + eType = REDLINE_TABLE; + else if(!rType.compareToAscii("Style")) + eType = REDLINE_FMTCOLL; +// else if(!rType.compareToAscii("Insert")) + return eType; +} +// --------------------------------------------------------------------------- Sequence<PropertyValue> lcl_GetSuccessorProperties(const SwRedline& rRedline) { Sequence<PropertyValue> aValues(4); @@ -333,39 +383,9 @@ Any SwXRedlinePortion::getPropertyValue( const OUString& rPropertyName ) throw(UnknownPropertyException, WrappedTargetException, RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - SwUnoCrsr* pUnoCrsr = GetCrsr(); Validate(); - - Any aRet; - if(rPropertyName.equalsAsciiL(UNO_NAME_REDLINE_AUTHOR .pName, UNO_NAME_REDLINE_AUTHOR.nNameLen)) - aRet <<= OUString(pRedline->GetAuthorString()); - else if(rPropertyName.equalsAsciiL(UNO_NAME_REDLINE_DATE_TIME.pName, UNO_NAME_REDLINE_DATE_TIME.nNameLen)) - { - aRet <<= lcl_DateTimeToUno(pRedline->GetTimeStamp()); - } - else if(rPropertyName.equalsAsciiL(UNO_NAME_REDLINE_COMMENT .pName, UNO_NAME_REDLINE_COMMENT .nNameLen)) - aRet <<= OUString(pRedline->GetComment()); - else if(rPropertyName.equalsAsciiL(UNO_NAME_REDLINE_TYPE .pName, UNO_NAME_REDLINE_TYPE .nNameLen)) - { - aRet <<= lcl_RedlineTypeToOUString(pRedline->GetType()); - } - else if(rPropertyName.equalsAsciiL(UNO_NAME_REDLINE_SUCCESSOR_DATA.pName, UNO_NAME_REDLINE_SUCCESSOR_DATA.nNameLen)) - { - if(pRedline->GetRedlineData().Next()) - aRet <<= lcl_GetSuccessorProperties(*pRedline); - } - else if (rPropertyName.equalsAsciiL(UNO_NAME_REDLINE_IDENTIFIER.pName, - UNO_NAME_REDLINE_IDENTIFIER.nNameLen)) - { - // create identifier from SwRedline address (if available) - if (NULL != pRedline) - { - OUStringBuffer sBuf; - sBuf.append((sal_Int64)pRedline); - aRet <<= sBuf.makeStringAndClear(); - } - } - else + Any aRet = GetPropertyValue( rPropertyName, *pRedline); + if(!aRet.hasValue()) aRet = SwXTextPortion::getPropertyValue(rPropertyName); return aRet; } @@ -442,6 +462,38 @@ uno::Sequence< sal_Int8 > SAL_CALL SwXRedlinePortion::getImplementationId( ) th rtl_createUuid( (sal_uInt8 *)aId.getArray(), 0, sal_True ); return aId; } +/* -----------------------------11.01.01 16:39-------------------------------- + + ---------------------------------------------------------------------------*/ +Any SwXRedlinePortion::GetPropertyValue( const OUString& rPropertyName, const SwRedline& rRedline ) throw() +{ + Any aRet; + if(rPropertyName.equalsAsciiL(UNO_NAME_REDLINE_AUTHOR .pName, UNO_NAME_REDLINE_AUTHOR.nNameLen)) + aRet <<= OUString(rRedline.GetAuthorString()); + else if(rPropertyName.equalsAsciiL(UNO_NAME_REDLINE_DATE_TIME.pName, UNO_NAME_REDLINE_DATE_TIME.nNameLen)) + { + aRet <<= lcl_DateTimeToUno(rRedline.GetTimeStamp()); + } + else if(rPropertyName.equalsAsciiL(UNO_NAME_REDLINE_COMMENT .pName, UNO_NAME_REDLINE_COMMENT .nNameLen)) + aRet <<= OUString(rRedline.GetComment()); + else if(rPropertyName.equalsAsciiL(UNO_NAME_REDLINE_TYPE .pName, UNO_NAME_REDLINE_TYPE .nNameLen)) + { + aRet <<= lcl_RedlineTypeToOUString(rRedline.GetType()); + } + else if(rPropertyName.equalsAsciiL(UNO_NAME_REDLINE_SUCCESSOR_DATA.pName, UNO_NAME_REDLINE_SUCCESSOR_DATA.nNameLen)) + { + if(rRedline.GetRedlineData().Next()) + aRet <<= lcl_GetSuccessorProperties(rRedline); + } + else if (rPropertyName.equalsAsciiL(UNO_NAME_REDLINE_IDENTIFIER.pName, + UNO_NAME_REDLINE_IDENTIFIER.nNameLen)) + { + OUStringBuffer sBuf; + sBuf.append((sal_Int64)&rRedline); + aRet <<= sBuf.makeStringAndClear(); + } + return aRet; +} /* -----------------------------11.01.01 11:22-------------------------------- ---------------------------------------------------------------------------*/ @@ -467,4 +519,215 @@ Sequence< PropertyValue > SwXRedlinePortion::CreateRedlineProperties( const SwRe } return aRet; } +/*-- 11.01.01 17:06:07--------------------------------------------------- + + -----------------------------------------------------------------------*/ +TYPEINIT1(SwXRedline, SwClient); +SwXRedline::SwXRedline(SwRedline& rRedline, SwDoc& rDoc) : + pDoc(&rDoc), + pRedline(&rRedline) +{ + pDoc->GetPageDescFromPool(RES_POOLPAGE_STANDARD)->Add(this); +} +/*-- 11.01.01 17:06:08--------------------------------------------------- + + -----------------------------------------------------------------------*/ +SwXRedline::~SwXRedline() +{ +} +/*-- 11.01.01 17:06:08--------------------------------------------------- + + -----------------------------------------------------------------------*/ +Reference< XPropertySetInfo > SwXRedline::getPropertySetInfo( ) throw(RuntimeException) +{ + static uno::Reference< beans::XPropertySetInfo > xRef = + SfxItemPropertySet(aSwMapProvider.GetPropertyMap(PROPERTY_MAP_REDLINE)).getPropertySetInfo(); + return xRef; +} +/*-- 11.01.01 17:06:08--------------------------------------------------- + + -----------------------------------------------------------------------*/ +void SwXRedline::setPropertyValue( const OUString& rPropertyName, const Any& aValue ) + throw(UnknownPropertyException, PropertyVetoException, IllegalArgumentException, + WrappedTargetException, RuntimeException) +{ + vos::OGuard aGuard(Application::GetSolarMutex()); + if(!pDoc) + throw RuntimeException(); + if(rPropertyName.equalsAsciiL(UNO_NAME_REDLINE_AUTHOR .pName, UNO_NAME_REDLINE_AUTHOR.nNameLen)) + { + DBG_ERROR("currently not available") + } + else if(rPropertyName.equalsAsciiL(UNO_NAME_REDLINE_DATE_TIME.pName, UNO_NAME_REDLINE_DATE_TIME.nNameLen)) + { + DBG_ERROR("currently not available") +// util::DateTime aDT; +// if(aValue >>= aDT) +// pRedline->SetTimeStamp(lcl_DateTimeFromUno(aDT)); + } + else if(rPropertyName.equalsAsciiL(UNO_NAME_REDLINE_COMMENT .pName, UNO_NAME_REDLINE_COMMENT .nNameLen)) + { + OUString sTmp; aValue >>= sTmp; + pRedline->SetComment(sTmp); + } + else if(rPropertyName.equalsAsciiL(UNO_NAME_REDLINE_TYPE .pName, UNO_NAME_REDLINE_TYPE .nNameLen)) + { + DBG_ERROR("currently not available") + OUString sTmp; aValue >>= sTmp; + if(!sTmp.getLength()) + throw IllegalArgumentException(); +// pRedline->SetType(lcl_OUStringToRedlineType(sTmp)); + } + else if(rPropertyName.equalsAsciiL(UNO_NAME_REDLINE_SUCCESSOR_DATA.pName, UNO_NAME_REDLINE_SUCCESSOR_DATA.nNameLen)) + { + DBG_ERROR("currently not available") +/* SwRedlineData* pNext = pRedline->GetRedlineData().Next(); + Sequence<PropertyValue> aValues; + if(!(aValue =>> aValues) || !pNext) + throw IllegalArgumentException(); + + const PropertyValue* pValues = aValues.getConstArray(); + for(sal_Int32 nValue = 0; nValue < aValues.getLength(); nValue++) + { + if(pValues[nValue].Name.equalsAscii(UNO_NAME_REDLINE_AUTHOR.pName) + { + DBG_ERROR("currently not available") + } + else if(pValues[nValue].Name.equalsAscii(UNO_NAME_REDLINE_DATE_TIME.pName)) + { + util::DateTime aDT; + if(pValues[nValue].Value >>= aDT) + pNext->SetTimeStamp(lcl_DateTimeFromUno(aDT)); + } + else if(pValues[nValue].Name.equalsAscii(UNO_NAME_REDLINE_COMMENT.pName)) + { + OUString sTmp; pValues[nValue].Value >>= sTmp; + pNext->SetComment(sTmp); + } + else if(pValues[nValue].Name.equalsAscii(UNO_NAME_REDLINE_TYPE.pName)) + { + OUString sTmp; pValues[nValue].Value >>= sTmp; + pNext->SetType(lcl_OUStringToRedlineType(sTmp); + } + } +*/ } + else + { + throw IllegalArgumentException(); + } +} +/*-- 11.01.01 17:06:08--------------------------------------------------- + + -----------------------------------------------------------------------*/ +Any SwXRedline::getPropertyValue( const OUString& rPropertyName ) + throw(UnknownPropertyException, WrappedTargetException, RuntimeException) +{ + vos::OGuard aGuard(Application::GetSolarMutex()); + if(!pDoc) + throw RuntimeException(); + Any aRet; + BOOL bStart = rPropertyName.equalsAsciiL(UNO_NAME_REDLINE_START .pName, UNO_NAME_REDLINE_START.nNameLen); + if(bStart || + rPropertyName.equalsAsciiL(UNO_NAME_REDLINE_END .pName, UNO_NAME_REDLINE_END.nNameLen)) + { + Reference<XInterface> xRet; + SwNode* pNode = pRedline->GetNode(); + if(!bStart && pRedline->HasMark()) + pNode = pRedline->GetNode(FALSE); + switch(pNode->GetNodeType()) + { + case ND_SECTIONNODE: + { + SwSectionNode* pSectNode = pNode->GetSectionNode(); + DBG_ASSERT(pSectNode, "No section node!") + xRet = SwXTextSections::GetObject( *pSectNode->GetSection().GetFmt() ); + } + break; + case ND_TABLENODE : + { + SwTableNode* pTblNode = pNode->GetTableNode(); + DBG_ASSERT(pTblNode, "No table node!") + SwTable& rTbl = pTblNode->GetTable(); + SwFrmFmt* pTblFmt = rTbl.GetFrmFmt(); + xRet = SwXTextTables::GetObject( *pTblFmt ); + } + break; + case ND_TEXTNODE : + { + SwPosition* pPoint = 0; + if(bStart || !pRedline->HasMark()) + pPoint = pRedline->GetPoint(); + else + pPoint = pRedline->GetMark(); + SwPaM aTmp(*pPoint); + Reference<XText> xTmpParent; +// Reference< XTextRange > xRange = SwXTextRange::createTextRangeFromPaM(aTmp); + Reference<XTextRange>xRange = + SwXTextRange::CreateTextRangeFromPosition( pDoc, *pPoint, 0 ); + xRet = xRange.get(); + } + break; + default: + DBG_ERROR("illegal node type") + } + aRet <<= xRet; + } + else if(rPropertyName.equalsAsciiL(UNO_NAME_REDLINE_TEXT .pName, UNO_NAME_REDLINE_TEXT.nNameLen)) + { + SwNodeIndex* pNodeIdx = pRedline->GetContentIdx(); + if(pNodeIdx) + { + Reference<XText> xRet = new SwXRedlineText(pDoc, *pNodeIdx); + aRet <<= xRet; + } + } + else + aRet = SwXRedlinePortion::GetPropertyValue(rPropertyName, *pRedline); + return aRet; +} +/*-- 11.01.01 17:06:09--------------------------------------------------- + + -----------------------------------------------------------------------*/ +void SwXRedline::addPropertyChangeListener( + const OUString& aPropertyName, + const Reference< XPropertyChangeListener >& xListener ) + throw(UnknownPropertyException, WrappedTargetException, RuntimeException) +{ +} +/*-- 11.01.01 17:06:09--------------------------------------------------- + + -----------------------------------------------------------------------*/ +void SwXRedline::removePropertyChangeListener( + const OUString& aPropertyName, const Reference< XPropertyChangeListener >& aListener ) + throw(UnknownPropertyException, WrappedTargetException, RuntimeException) +{ +} +/*-- 11.01.01 17:06:09--------------------------------------------------- + + -----------------------------------------------------------------------*/ +void SwXRedline::addVetoableChangeListener( + const OUString& PropertyName, const Reference< XVetoableChangeListener >& aListener ) + throw(UnknownPropertyException, WrappedTargetException, RuntimeException) +{ +} +/*-- 11.01.01 17:06:09--------------------------------------------------- + + -----------------------------------------------------------------------*/ +void SwXRedline::removeVetoableChangeListener( + const OUString& PropertyName, const Reference< XVetoableChangeListener >& aListener ) + throw(UnknownPropertyException, WrappedTargetException, RuntimeException) +{ +} +/*-- 11.01.01 17:06:10--------------------------------------------------- + + -----------------------------------------------------------------------*/ +void SwXRedline::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew) +{ + ClientModify(this, pOld, pNew); + if(!GetRegisteredIn()) + { + pDoc = 0; + pRedline = 0; + } +} diff --git a/sw/source/core/unocore/unorefmk.cxx b/sw/source/core/unocore/unorefmk.cxx index 7ac8d4ef8f56..c0ddd21b107f 100644 --- a/sw/source/core/unocore/unorefmk.cxx +++ b/sw/source/core/unocore/unorefmk.cxx @@ -2,9 +2,9 @@ * * $RCSfile: unorefmk.cxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-19 00:08:28 $ + * last change: $Author: os $ $Date: 2001-01-12 16:12:45 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -268,7 +268,7 @@ uno::Reference< text::XTextRange > SwXReferenceMark::getAnchor(void) throw( uno new SwPaM( rTxtNode, *pTxtMark->GetStart()); - xRet = ::CreateTextRangeFromPosition(pDoc, + xRet = SwXTextRange::CreateTextRangeFromPosition(pDoc, *pPam->Start(), pPam->End()); delete pPam; } @@ -479,6 +479,9 @@ void SwXReferenceMark::removeVetoableChangeListener( /*------------------------------------------------------------------------ $Log: not supported by cvs2svn $ + Revision 1.1.1.1 2000/09/19 00:08:28 hr + initial import + Revision 1.4 2000/09/18 16:04:34 willem.vandorp OpenOffice header added. diff --git a/sw/source/core/unocore/unosect.cxx b/sw/source/core/unocore/unosect.cxx index 4c6807a85838..f6f3de091897 100644 --- a/sw/source/core/unocore/unosect.cxx +++ b/sw/source/core/unocore/unosect.cxx @@ -2,9 +2,9 @@ * * $RCSfile: unosect.cxx,v $ * - * $Revision: 1.11 $ + * $Revision: 1.12 $ * - * last change: $Author: os $ $Date: 2001-01-11 12:40:02 $ + * last change: $Author: os $ $Date: 2001-01-12 16:12:45 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -423,7 +423,7 @@ uno::Reference< text::XTextRange > SwXTextSection::getAnchor(void) throw( uno:: SwCursor aCrsr(*aPaM.GetPoint()); aCrsr.SetMark(); aCrsr.MoveRegion( fnRegionCurr, fnRegionEnd ); - xRet = ::CreateTextRangeFromPosition(pSectFmt->GetDoc(), + xRet = SwXTextRange::CreateTextRangeFromPosition(pSectFmt->GetDoc(), *aCrsr.Start(), aCrsr.End()); } } diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx index 4da011c13fbd..0ef610c9e4bf 100644 --- a/sw/source/filter/xml/xmlimp.cxx +++ b/sw/source/filter/xml/xmlimp.cxx @@ -2,9 +2,9 @@ * * $RCSfile: xmlimp.cxx,v $ * - * $Revision: 1.13 $ + * $Revision: 1.14 $ * - * last change: $Author: mib $ $Date: 2001-01-03 11:40:56 $ + * last change: $Author: os $ $Date: 2001-01-12 16:15:11 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -283,7 +283,7 @@ SwXMLImport::SwXMLImport( _InitItemImport(); Reference < XTextRange > xTextRange = - CreateTextRangeFromPosition( &rDoc, *rPaM.GetPoint(), 0 ); + SwXTextRange::CreateTextRangeFromPosition( &rDoc, *rPaM.GetPoint(), 0 ); Reference < XText > xText = xTextRange->getText(); Reference < XTextCursor > xTextCursor = xText->createTextCursorByRange( xTextRange ); diff --git a/sw/source/filter/xml/xmltble.cxx b/sw/source/filter/xml/xmltble.cxx index b503a2a8ec66..9959d9dd7bed 100644 --- a/sw/source/filter/xml/xmltble.cxx +++ b/sw/source/filter/xml/xmltble.cxx @@ -2,9 +2,9 @@ * * $RCSfile: xmltble.cxx,v $ * - * $Revision: 1.8 $ + * $Revision: 1.9 $ * - * last change: $Author: dvo $ $Date: 2000-12-11 20:15:54 $ + * last change: $Author: os $ $Date: 2001-01-12 16:15:12 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -176,7 +176,7 @@ Reference < XTextRange > lcl_xml_CreateTableBoxTextRange( aPaM.Move( fnMoveForward, fnGoNode ); Reference < XTextRange > xTextRange = - CreateTextRangeFromPosition( aPaM.GetDoc(), *aPaM.GetPoint(), + SwXTextRange::CreateTextRangeFromPosition( aPaM.GetDoc(), *aPaM.GetPoint(), aPaM.GetMark() ); return xTextRange; } diff --git a/sw/source/filter/xml/xmltbli.cxx b/sw/source/filter/xml/xmltbli.cxx index 0cf181312bb8..5f1f80aa4007 100644 --- a/sw/source/filter/xml/xmltbli.cxx +++ b/sw/source/filter/xml/xmltbli.cxx @@ -2,9 +2,9 @@ * * $RCSfile: xmltbli.cxx,v $ * - * $Revision: 1.14 $ + * $Revision: 1.15 $ * - * last change: $Author: dvo $ $Date: 2000-12-11 20:15:55 $ + * last change: $Author: os $ $Date: 2001-01-12 16:15:12 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -2358,7 +2358,7 @@ const SwStartNode *SwXMLTableContext::InsertTableSection( aPos.nContent.Assign( pCNd, 0U ); Reference < XTextRange > xTextRange = - CreateTextRangeFromPosition( pDoc, aPos, 0 ); + SwXTextRange::CreateTextRangeFromPosition( pDoc, aPos, 0 ); Reference < XText > xText = xTextRange->getText(); Reference < XTextCursor > xTextCursor = xText->createTextCursorByRange( xTextRange ); diff --git a/sw/source/ui/uno/unotxdoc.cxx b/sw/source/ui/uno/unotxdoc.cxx index fb2d3007f1ff..79e06d0a23ec 100644 --- a/sw/source/ui/uno/unotxdoc.cxx +++ b/sw/source/ui/uno/unotxdoc.cxx @@ -2,9 +2,9 @@ * * $RCSfile: unotxdoc.cxx,v $ * - * $Revision: 1.9 $ + * $Revision: 1.10 $ * - * last change: $Author: os $ $Date: 2001-01-12 10:46:46 $ + * last change: $Author: os $ $Date: 2001-01-12 16:15:41 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -113,6 +113,9 @@ #ifndef _UNOCOLL_HXX #include <unocoll.hxx> #endif +#ifndef _UNOREDLINES_HXX +#include <unoredlines.hxx> +#endif #ifndef _UNOSRCH_HXX #include <unosrch.hxx> #endif @@ -199,6 +202,7 @@ using namespace ::com::sun::star; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::beans; using namespace ::com::sun::star::lang; +using namespace ::com::sun::star::container; using namespace ::rtl; /****************************************************************************** @@ -358,8 +362,8 @@ SwXTextDocument::SwXTextDocument(SwDocShell* pShell) : pDrawPage(0), pxXDrawPage(0), pxXReferenceMarks(0), - pxLinkTargetSupplier(0) -// pxXRedlines(0) + pxLinkTargetSupplier(0), + pxXRedlines(0) { } /*-- 18.12.98 11:53:00--------------------------------------------------- @@ -374,12 +378,6 @@ SwXTextDocument::~SwXTextDocument() xNumFmtAgg->setDelegator(x0); xNumFmtAgg = 0; } - if(pxLinkTargetSupplier) - { - container::XNameAccess* pAccess = (*pxLinkTargetSupplier).get(); - ((SwXLinkTargetSupplier*)pAccess)->Invalidate(); - delete pAccess; - } } /*-- 18.12.98 11:55:08--------------------------------------------------- @@ -493,7 +491,7 @@ Reference< frame::XController > SwXTextDocument::getCurrentController(void) thr -----------------------------------------------------------------------*/ void SwXTextDocument::setCurrentController(const Reference< frame::XController > & xController) - throw( container::NoSuchElementException, RuntimeException ) + throw( NoSuchElementException, RuntimeException ) { SfxBaseModel::setCurrentController(xController); } @@ -602,7 +600,7 @@ Reference< XPropertySet > SwXTextDocument::getLineNumberingProperties(void) /*-- 18.12.98 11:55:20--------------------------------------------------- -----------------------------------------------------------------------*/ -Reference< container::XIndexReplace > SwXTextDocument::getChapterNumberingRules(void) +Reference< XIndexReplace > SwXTextDocument::getChapterNumberingRules(void) throw( RuntimeException ) { ::vos::OGuard aGuard(Application::GetSolarMutex()); @@ -610,7 +608,7 @@ Reference< container::XIndexReplace > SwXTextDocument::getChapterNumberingRules throw RuntimeException(); if(!pxXChapterNumbering) { - pxXChapterNumbering = new Reference< container::XIndexReplace > ; + pxXChapterNumbering = new Reference< XIndexReplace > ; *pxXChapterNumbering = new SwXChapterNumbering(*pDocShell); } return *pxXChapterNumbering; @@ -618,14 +616,14 @@ Reference< container::XIndexReplace > SwXTextDocument::getChapterNumberingRules /*-- 18.12.98 11:55:21--------------------------------------------------- -----------------------------------------------------------------------*/ -Reference< container::XIndexAccess > SwXTextDocument::getFootnotes(void) throw( RuntimeException ) +Reference< XIndexAccess > SwXTextDocument::getFootnotes(void) throw( RuntimeException ) { ::vos::OGuard aGuard(Application::GetSolarMutex()); if(!IsValid()) throw RuntimeException(); if(!pxXFootnotes) { - ((SwXTextDocument*)this)->pxXFootnotes = new Reference< container::XIndexAccess > ; + ((SwXTextDocument*)this)->pxXFootnotes = new Reference< XIndexAccess > ; *pxXFootnotes = new SwXFootnotes(sal_False, pDocShell->GetDoc()); } return *pxXFootnotes; @@ -649,14 +647,14 @@ Reference< XPropertySet > SAL_CALL /*-- 18.12.98 11:55:21--------------------------------------------------- -----------------------------------------------------------------------*/ -Reference< container::XIndexAccess > SwXTextDocument::getEndnotes(void) throw( RuntimeException ) +Reference< XIndexAccess > SwXTextDocument::getEndnotes(void) throw( RuntimeException ) { ::vos::OGuard aGuard(Application::GetSolarMutex()); if(!IsValid()) throw RuntimeException(); if(!pxXEndnotes) { - ((SwXTextDocument*)this)->pxXEndnotes = new Reference< container::XIndexAccess > ; + ((SwXTextDocument*)this)->pxXEndnotes = new Reference< XIndexAccess > ; *pxXEndnotes = new SwXFootnotes(sal_True, pDocShell->GetDoc()); } return *pxXEndnotes; @@ -947,7 +945,7 @@ SwUnoCrsr* SwXTextDocument::FindAny(const Reference< util::XSearchDescriptor > /*-- 18.12.98 11:55:23--------------------------------------------------- -----------------------------------------------------------------------*/ -Reference< container::XIndexAccess > +Reference< XIndexAccess > SwXTextDocument::findAll(const Reference< util::XSearchDescriptor > & xDesc) throw( RuntimeException ) { @@ -958,7 +956,7 @@ Reference< container::XIndexAccess > SwUnoCrsr* pResultCrsr = FindAny(xDesc, xCrsr, sal_True, nResult, xTmp); if(!pResultCrsr) throw RuntimeException(); - Reference< container::XIndexAccess > xRet; + Reference< XIndexAccess > xRet; if(nResult) xRet = new SwXTextRanges(pResultCrsr); else @@ -981,7 +979,7 @@ Reference< XInterface > SwXTextDocument::findFirst(const Reference< util::XSear Reference< XInterface > xRet; if(nResult) { - Reference< text::XTextRange > xTempRange = CreateTextRangeFromPosition( + Reference< text::XTextRange > xTempRange = SwXTextRange::CreateTextRangeFromPosition( pDocShell->GetDoc(), *pResultCrsr->GetPoint(), pResultCrsr->GetMark()); @@ -1008,7 +1006,7 @@ Reference< XInterface > SwXTextDocument::findNext(const Reference< XInterface > Reference< XInterface > xRet; if(nResult) { - Reference< text::XTextRange > xTempRange = CreateTextRangeFromPosition( + Reference< text::XTextRange > xTempRange = SwXTextRange::CreateTextRangeFromPosition( pDocShell->GetDoc(), *pResultCrsr->GetPoint(), pResultCrsr->GetMark()); @@ -1256,7 +1254,7 @@ void SwXTextDocument::printPages(const Sequence< beans::PropertyValue >& xOption /*-- 18.12.98 11:55:25--------------------------------------------------- -----------------------------------------------------------------------*/ -Reference< container::XNameAccess > SwXTextDocument::getReferenceMarks(void) +Reference< XNameAccess > SwXTextDocument::getReferenceMarks(void) throw( RuntimeException ) { ::vos::OGuard aGuard(Application::GetSolarMutex()); @@ -1264,7 +1262,7 @@ Reference< container::XNameAccess > SwXTextDocument::getReferenceMarks(void) throw RuntimeException(); if(!pxXReferenceMarks) { - ((SwXTextDocument*)this)->pxXReferenceMarks = new Reference< container::XNameAccess > ; + ((SwXTextDocument*)this)->pxXReferenceMarks = new Reference< XNameAccess > ; *pxXReferenceMarks = new SwXReferenceMarks(pDocShell->GetDoc()); } return *pxXReferenceMarks; @@ -1272,14 +1270,14 @@ Reference< container::XNameAccess > SwXTextDocument::getReferenceMarks(void) /* -----------------21.12.98 10:20------------------- * * --------------------------------------------------*/ -Reference< container::XEnumerationAccess > SwXTextDocument::getTextFields(void) throw( RuntimeException ) +Reference< XEnumerationAccess > SwXTextDocument::getTextFields(void) throw( RuntimeException ) { ::vos::OGuard aGuard(Application::GetSolarMutex()); if(!IsValid()) throw RuntimeException(); if(!pxXTextFieldTypes) { - ((SwXTextDocument*)this)->pxXTextFieldTypes = new Reference< container::XEnumerationAccess > ; + ((SwXTextDocument*)this)->pxXTextFieldTypes = new Reference< XEnumerationAccess > ; *pxXTextFieldTypes = new SwXTextFieldTypes(pDocShell->GetDoc()); } return *pxXTextFieldTypes; @@ -1287,7 +1285,7 @@ Reference< container::XEnumerationAccess > SwXTextDocument::getTextFields(void) /*-- 21.12.98 10:21:12--------------------------------------------------- -----------------------------------------------------------------------*/ -Reference< container::XNameAccess > SwXTextDocument::getTextFieldMasters(void) +Reference< XNameAccess > SwXTextDocument::getTextFieldMasters(void) throw( RuntimeException ) { ::vos::OGuard aGuard(Application::GetSolarMutex()); @@ -1295,7 +1293,7 @@ Reference< container::XNameAccess > SwXTextDocument::getTextFieldMasters(void) throw RuntimeException(); if(!pxXTextFieldMasters) { - ((SwXTextDocument*)this)->pxXTextFieldMasters = new Reference< container::XNameAccess > ; + ((SwXTextDocument*)this)->pxXTextFieldMasters = new Reference< XNameAccess > ; *pxXTextFieldMasters = new SwXTextFieldMasters(pDocShell->GetDoc()); } return *pxXTextFieldMasters; @@ -1303,14 +1301,14 @@ Reference< container::XNameAccess > SwXTextDocument::getTextFieldMasters(void) /*-- 21.12.98 10:21:12--------------------------------------------------- -----------------------------------------------------------------------*/ -Reference< container::XNameAccess > SwXTextDocument::getEmbeddedObjects(void) throw( RuntimeException ) +Reference< XNameAccess > SwXTextDocument::getEmbeddedObjects(void) throw( RuntimeException ) { ::vos::OGuard aGuard(Application::GetSolarMutex()); if(!IsValid()) throw RuntimeException(); if(!pxXEmbeddedObjects) { - ((SwXTextDocument*)this)->pxXEmbeddedObjects = new Reference< container::XNameAccess > ; + ((SwXTextDocument*)this)->pxXEmbeddedObjects = new Reference< XNameAccess > ; *pxXEmbeddedObjects = new SwXTextEmbeddedObjects(pDocShell->GetDoc()); } return *pxXEmbeddedObjects; @@ -1318,14 +1316,14 @@ Reference< container::XNameAccess > SwXTextDocument::getEmbeddedObjects(void) t /*-- 21.12.98 10:21:13--------------------------------------------------- -----------------------------------------------------------------------*/ -Reference< container::XNameAccess > SwXTextDocument::getBookmarks(void) throw( RuntimeException ) +Reference< XNameAccess > SwXTextDocument::getBookmarks(void) throw( RuntimeException ) { ::vos::OGuard aGuard(Application::GetSolarMutex()); if(!IsValid()) throw RuntimeException(); if(!pxXBookmarks) { - ((SwXTextDocument*)this)->pxXBookmarks = new Reference< container::XNameAccess > ; + ((SwXTextDocument*)this)->pxXBookmarks = new Reference< XNameAccess > ; *pxXBookmarks = new SwXBookmarks(pDocShell->GetDoc()); } return *pxXBookmarks; @@ -1333,14 +1331,14 @@ Reference< container::XNameAccess > SwXTextDocument::getBookmarks(void) throw( /*-- 21.12.98 10:21:13--------------------------------------------------- -----------------------------------------------------------------------*/ -Reference< container::XNameAccess > SwXTextDocument::getTextSections(void) throw( RuntimeException ) +Reference< XNameAccess > SwXTextDocument::getTextSections(void) throw( RuntimeException ) { ::vos::OGuard aGuard(Application::GetSolarMutex()); if(!IsValid()) throw RuntimeException(); if(!pxXTextSections) { - ((SwXTextDocument*)this)->pxXTextSections = new Reference< container::XNameAccess > ; + ((SwXTextDocument*)this)->pxXTextSections = new Reference< XNameAccess > ; *pxXTextSections = new SwXTextSections(pDocShell->GetDoc()); } return *pxXTextSections; @@ -1348,14 +1346,14 @@ Reference< container::XNameAccess > SwXTextDocument::getTextSections(void) thro /*-- 21.12.98 10:21:13--------------------------------------------------- -----------------------------------------------------------------------*/ -Reference< container::XNameAccess > SwXTextDocument::getTextTables(void) throw( RuntimeException ) +Reference< XNameAccess > SwXTextDocument::getTextTables(void) throw( RuntimeException ) { ::vos::OGuard aGuard(Application::GetSolarMutex()); if(!IsValid()) throw RuntimeException(); if(!pxXTextTables) { - ((SwXTextDocument*)this)->pxXTextTables = new Reference< container::XNameAccess > ; + ((SwXTextDocument*)this)->pxXTextTables = new Reference< XNameAccess > ; *pxXTextTables = new SwXTextTables(pDocShell->GetDoc()); } return *pxXTextTables; @@ -1363,14 +1361,14 @@ Reference< container::XNameAccess > SwXTextDocument::getTextTables(void) throw( /*-- 21.12.98 10:21:13--------------------------------------------------- -----------------------------------------------------------------------*/ -Reference< container::XNameAccess > SwXTextDocument::getGraphicObjects(void) throw( RuntimeException ) +Reference< XNameAccess > SwXTextDocument::getGraphicObjects(void) throw( RuntimeException ) { ::vos::OGuard aGuard(Application::GetSolarMutex()); if(!IsValid()) throw RuntimeException(); if(!pxXGraphicObjects) { - ((SwXTextDocument*)this)->pxXGraphicObjects = new Reference< container::XNameAccess > ; + ((SwXTextDocument*)this)->pxXGraphicObjects = new Reference< XNameAccess > ; *pxXGraphicObjects = new SwXTextGraphicObjects(pDocShell->GetDoc()); } return *pxXGraphicObjects; @@ -1378,14 +1376,14 @@ Reference< container::XNameAccess > SwXTextDocument::getGraphicObjects(void) th /*-- 21.12.98 10:21:14--------------------------------------------------- -----------------------------------------------------------------------*/ -Reference< container::XNameAccess > SwXTextDocument::getTextFrames(void) throw( RuntimeException ) +Reference< XNameAccess > SwXTextDocument::getTextFrames(void) throw( RuntimeException ) { ::vos::OGuard aGuard(Application::GetSolarMutex()); if(!IsValid()) throw RuntimeException(); if(!pxXTextFrames) { - ((SwXTextDocument*)this)->pxXTextFrames = new Reference< container::XNameAccess > ; + ((SwXTextDocument*)this)->pxXTextFrames = new Reference< XNameAccess > ; *pxXTextFrames = new SwXTextFrames(pDocShell->GetDoc()); } return *pxXTextFrames; @@ -1393,14 +1391,14 @@ Reference< container::XNameAccess > SwXTextDocument::getTextFrames(void) throw( /* -----------------21.12.98 10:56------------------- * * --------------------------------------------------*/ -Reference< container::XNameAccess > SwXTextDocument::getStyleFamilies(void) throw( RuntimeException ) +Reference< XNameAccess > SwXTextDocument::getStyleFamilies(void) throw( RuntimeException ) { ::vos::OGuard aGuard(Application::GetSolarMutex()); if(!IsValid()) throw RuntimeException(); if(!pxXStyleFamilies) { - ((SwXTextDocument*)this)->pxXStyleFamilies = new Reference< container::XNameAccess > ; + ((SwXTextDocument*)this)->pxXStyleFamilies = new Reference< XNameAccess > ; *pxXStyleFamilies = new SwXStyleFamilies(*pDocShell); } return *pxXStyleFamilies; @@ -1482,7 +1480,7 @@ void SwXTextDocument::InitNewDoc() // zunaechst alle Collections invalidieren, dann Referenzen loeschen und Null setzen if(pxXTextTables) { - container::XNameAccess* pTbls = pxXTextTables->get(); + XNameAccess* pTbls = pxXTextTables->get(); ((SwXTextTables*)pTbls)->Invalidate(); delete pxXTextTables; pxXTextTables = 0; @@ -1490,7 +1488,7 @@ void SwXTextDocument::InitNewDoc() if(pxXTextFrames) { - container::XNameAccess* pFrms = pxXTextFrames->get(); + XNameAccess* pFrms = pxXTextFrames->get(); ((SwXTextFrames*)pFrms)->Invalidate(); delete pxXTextFrames; pxXTextFrames = 0; @@ -1498,7 +1496,7 @@ void SwXTextDocument::InitNewDoc() if(pxXGraphicObjects) { - container::XNameAccess* pFrms = pxXGraphicObjects->get(); + XNameAccess* pFrms = pxXGraphicObjects->get(); ((SwXTextGraphicObjects*)pFrms)->Invalidate(); delete pxXGraphicObjects; pxXGraphicObjects = 0; @@ -1506,7 +1504,7 @@ void SwXTextDocument::InitNewDoc() if(pxXEmbeddedObjects) { - container::XNameAccess* pOLE = pxXEmbeddedObjects->get(); + XNameAccess* pOLE = pxXEmbeddedObjects->get(); ((SwXTextEmbeddedObjects*)pOLE)->Invalidate(); delete pxXEmbeddedObjects; pxXEmbeddedObjects = 0; @@ -1537,7 +1535,7 @@ void SwXTextDocument::InitNewDoc() if(pxXTextFieldTypes) { - container::XEnumerationAccess* pT = pxXTextFieldTypes->get(); + XEnumerationAccess* pT = pxXTextFieldTypes->get(); ((SwXTextFieldTypes*)pT)->Invalidate(); delete pxXTextFieldTypes; pxXTextFieldTypes = 0; @@ -1545,7 +1543,7 @@ void SwXTextDocument::InitNewDoc() if(pxXTextFieldMasters) { - container::XNameAccess* pT = pxXTextFieldMasters->get(); + XNameAccess* pT = pxXTextFieldMasters->get(); ((SwXTextFieldMasters*)pT)->Invalidate(); delete pxXTextFieldMasters; pxXTextFieldMasters = 0; @@ -1553,7 +1551,7 @@ void SwXTextDocument::InitNewDoc() if(pxXTextSections) { - container::XNameAccess* pSect = pxXTextSections->get(); + XNameAccess* pSect = pxXTextSections->get(); ((SwXTextSections*)pSect)->Invalidate(); delete pxXTextSections; pxXTextSections = 0; @@ -1569,7 +1567,7 @@ void SwXTextDocument::InitNewDoc() if(pxXFootnotes) { - container::XIndexAccess* pFtn = pxXFootnotes->get(); + XIndexAccess* pFtn = pxXFootnotes->get(); ((SwXFootnotes*)pFtn)->Invalidate(); delete pxXFootnotes; pxXFootnotes = 0; @@ -1577,7 +1575,7 @@ void SwXTextDocument::InitNewDoc() if(pxXEndnotes) { - container::XIndexAccess* pFtn = pxXEndnotes->get(); + XIndexAccess* pFtn = pxXEndnotes->get(); ((SwXFootnotes*)pFtn)->Invalidate(); delete pxXEndnotes; pxXEndnotes = 0; @@ -1585,7 +1583,7 @@ void SwXTextDocument::InitNewDoc() if(pxXDocumentIndexes) { - container::XIndexAccess* pIdxs = pxXDocumentIndexes->get(); + XIndexAccess* pIdxs = pxXDocumentIndexes->get(); ((SwXDocumentIndexes*)pIdxs)->Invalidate(); delete pxXDocumentIndexes; pxXDocumentIndexes = 0; @@ -1593,7 +1591,7 @@ void SwXTextDocument::InitNewDoc() if(pxXStyleFamilies) { - container::XNameAccess* pStyles = pxXStyleFamilies->get(); + XNameAccess* pStyles = pxXStyleFamilies->get(); ((SwXStyleFamilies*)pStyles)->Invalidate(); delete pxXStyleFamilies; pxXStyleFamilies = 0; @@ -1601,7 +1599,7 @@ void SwXTextDocument::InitNewDoc() if(pxXBookmarks) { - container::XNameAccess* pBm = pxXBookmarks->get(); + XNameAccess* pBm = pxXBookmarks->get(); ((SwXBookmarks*)pBm)->Invalidate(); delete pxXBookmarks; pxXBookmarks = 0; @@ -1609,7 +1607,7 @@ void SwXTextDocument::InitNewDoc() if(pxXChapterNumbering) { - container::XIndexReplace* pCh = pxXChapterNumbering->get(); + XIndexReplace* pCh = pxXChapterNumbering->get(); ((SwXChapterNumbering*)pCh)->Invalidate(); delete pxXChapterNumbering; pxXChapterNumbering = 0; @@ -1652,22 +1650,24 @@ void SwXTextDocument::InitNewDoc() */ if(pxXReferenceMarks) { - container::XNameAccess* pMarks = pxXReferenceMarks->get(); + XNameAccess* pMarks = pxXReferenceMarks->get(); ((SwXReferenceMarks*)pMarks)->Invalidate(); delete pxXReferenceMarks; pxXReferenceMarks = 0; } -/* + if(pxLinkTargetSupplier) + { + XNameAccess* pAccess = (*pxLinkTargetSupplier).get(); + ((SwXLinkTargetSupplier*)pAccess)->Invalidate(); + delete pAccess; + } if(pxXRedlines) { - XRedlines* pMarks = *pxXRedlines; + XEnumerationAccess* pMarks = pxXRedlines->get(); ((SwXRedlines*)pMarks)->Invalidate(); delete pxXRedlines; pxXRedlines = 0; } - - -*/ } /*-- 11.03.99 11:51:40--------------------------------------------------- @@ -1776,14 +1776,14 @@ Sequence< OUString > SwXTextDocument::getSupportedServiceNames(void) throw( Runt /* -----------------05.05.99 12:10------------------- * * --------------------------------------------------*/ -Reference< container::XIndexAccess > SwXTextDocument::getDocumentIndexes(void) throw( RuntimeException ) +Reference< XIndexAccess > SwXTextDocument::getDocumentIndexes(void) throw( RuntimeException ) { ::vos::OGuard aGuard(Application::GetSolarMutex()); if(!IsValid()) throw RuntimeException(); if(!pxXDocumentIndexes) { - ((SwXTextDocument*)this)->pxXDocumentIndexes = new Reference< container::XIndexAccess > ; + ((SwXTextDocument*)this)->pxXDocumentIndexes = new Reference< XIndexAccess > ; *pxXDocumentIndexes = new SwXDocumentIndexes(pDocShell->GetDoc()); } return *pxXDocumentIndexes; @@ -1979,16 +1979,27 @@ void SwXTextDocument::removeVetoableChangeListener(const OUString& PropertyName, /* -----------------25.10.99 10:42------------------- --------------------------------------------------*/ -Reference< container::XNameAccess > SwXTextDocument::getLinks(void) throw( RuntimeException ) +Reference< XNameAccess > SwXTextDocument::getLinks(void) throw( RuntimeException ) { if(!pxLinkTargetSupplier) { - ((SwXTextDocument*)this)->pxLinkTargetSupplier = new Reference< container::XNameAccess > ; + pxLinkTargetSupplier = new Reference< XNameAccess > ; (*pxLinkTargetSupplier) = new SwXLinkTargetSupplier(*(SwXTextDocument*)this); } return (*pxLinkTargetSupplier); } +/* -----------------------------11.01.01 15:01-------------------------------- + ---------------------------------------------------------------------------*/ +Reference< XEnumerationAccess > SwXTextDocument::getRedlines( ) throw(RuntimeException) +{ + if(!pxXRedlines) + { + pxXRedlines = new Reference< XEnumerationAccess > ; + (*pxXRedlines) = new SwXRedlines(pDocShell->GetDoc()); + } + return *pxXRedlines; +} /*-- 21.02.00 08:41:06--------------------------------------------------- -----------------------------------------------------------------------*/ @@ -2055,7 +2066,7 @@ SwXLinkTargetSupplier::~SwXLinkTargetSupplier() -----------------------------------------------------------------------*/ Any SwXLinkTargetSupplier::getByName(const OUString& rName) - throw( container::NoSuchElementException, WrappedTargetException, RuntimeException ) + throw( NoSuchElementException, WrappedTargetException, RuntimeException ) { Any aRet; if(!pxDoc) @@ -2066,7 +2077,7 @@ Any SwXLinkTargetSupplier::getByName(const OUString& rName) { sSuffix += UniString::CreateFromAscii(pMarkToTable); - Reference< container::XNameAccess > xTbls = new SwXLinkNameAccessWrapper( + Reference< XNameAccess > xTbls = new SwXLinkNameAccessWrapper( pxDoc->getTextTables(), sToCompare, sSuffix ); Reference< XPropertySet > xRet(xTbls, UNO_QUERY); aRet.setValue(&xRet, ::getCppuType((Reference<XPropertySet>*)0)); @@ -2074,7 +2085,7 @@ Any SwXLinkTargetSupplier::getByName(const OUString& rName) else if(sToCompare == sFrames) { sSuffix += UniString::CreateFromAscii(pMarkToFrame); - Reference< container::XNameAccess > xTbls = new SwXLinkNameAccessWrapper( + Reference< XNameAccess > xTbls = new SwXLinkNameAccessWrapper( pxDoc->getTextFrames(), sToCompare, sSuffix ); Reference< XPropertySet > xRet(xTbls, UNO_QUERY); aRet.setValue(&xRet, ::getCppuType((Reference< XPropertySet>*)0)); @@ -2082,7 +2093,7 @@ Any SwXLinkTargetSupplier::getByName(const OUString& rName) else if(sToCompare == sSections) { sSuffix += UniString::CreateFromAscii(pMarkToRegion); - Reference< container::XNameAccess > xTbls = new SwXLinkNameAccessWrapper( + Reference< XNameAccess > xTbls = new SwXLinkNameAccessWrapper( pxDoc->getTextSections(), sToCompare, sSuffix ); Reference< XPropertySet > xRet(xTbls, UNO_QUERY); aRet.setValue(&xRet, ::getCppuType((Reference< XPropertySet>*)0)); @@ -2090,7 +2101,7 @@ Any SwXLinkTargetSupplier::getByName(const OUString& rName) /* else if(sToCompare == ) { sSuffix += UniString::CreateFromAscii(pMarkToText); - Reference< container::XNameAccess > xTbls = new SwXLinkNameAccessWrapper( + Reference< XNameAccess > xTbls = new SwXLinkNameAccessWrapper( pxDoc->, sSuffix ); Reference< XPropertySet > xRet(xTbls, UNO_QUERY); aRet.setValue(&xRet, ::getCppuType((const XPropertySet*)0)); @@ -2098,7 +2109,7 @@ Any SwXLinkTargetSupplier::getByName(const OUString& rName) else if(sToCompare == sGraphics) { sSuffix += UniString::CreateFromAscii(pMarkToGraphic); - Reference< container::XNameAccess > xTbls = new SwXLinkNameAccessWrapper( + Reference< XNameAccess > xTbls = new SwXLinkNameAccessWrapper( pxDoc->getGraphicObjects(), sToCompare, sSuffix ); Reference< XPropertySet > xRet(xTbls, UNO_QUERY); aRet.setValue(&xRet, ::getCppuType((Reference< XPropertySet>*)0)); @@ -2106,7 +2117,7 @@ Any SwXLinkTargetSupplier::getByName(const OUString& rName) else if(sToCompare == sOLEs) { sSuffix += UniString::CreateFromAscii(pMarkToOLE); - Reference< container::XNameAccess > xTbls = new SwXLinkNameAccessWrapper( + Reference< XNameAccess > xTbls = new SwXLinkNameAccessWrapper( pxDoc->getEmbeddedObjects(), sToCompare, sSuffix ); Reference< XPropertySet > xRet(xTbls, UNO_QUERY); aRet.setValue(&xRet, ::getCppuType((Reference< XPropertySet>*)0)); @@ -2114,7 +2125,7 @@ Any SwXLinkTargetSupplier::getByName(const OUString& rName) else if(sToCompare == sOutlines) { sSuffix += UniString::CreateFromAscii(pMarkToOutline); - Reference< container::XNameAccess > xTbls = new SwXLinkNameAccessWrapper( + Reference< XNameAccess > xTbls = new SwXLinkNameAccessWrapper( *pxDoc, sToCompare, sSuffix ); Reference< XPropertySet > xRet(xTbls, UNO_QUERY); aRet.setValue(&xRet, ::getCppuType((Reference< XPropertySet>*)0)); @@ -2122,13 +2133,13 @@ Any SwXLinkTargetSupplier::getByName(const OUString& rName) else if(sToCompare == sBookmarks) { sSuffix.Erase(); - Reference< container::XNameAccess > xBkms = new SwXLinkNameAccessWrapper( + Reference< XNameAccess > xBkms = new SwXLinkNameAccessWrapper( pxDoc->getBookmarks(), sToCompare, sSuffix ); Reference< XPropertySet > xRet(xBkms, UNO_QUERY); aRet.setValue(&xRet, ::getCppuType((Reference< XPropertySet>*)0)); } else - throw container::NoSuchElementException(); + throw NoSuchElementException(); return aRet; } /*-- 25.10.99 11:12:46--------------------------------------------------- @@ -2212,7 +2223,7 @@ Sequence< OUString > SwXLinkTargetSupplier::getSupportedServiceNames(void) -----------------------------------------------------------------------*/ SwXLinkNameAccessWrapper::SwXLinkNameAccessWrapper( - Reference< container::XNameAccess > xAccess, const String& rLinkDisplayName, String sSuffix ) : + Reference< XNameAccess > xAccess, const String& rLinkDisplayName, String sSuffix ) : aPropSet(aSwMapProvider.GetPropertyMap(PROPERTY_MAP_LINK_TARGET)), sLinkDisplayName(rLinkDisplayName), xRealAccess(xAccess), @@ -2242,7 +2253,7 @@ SwXLinkNameAccessWrapper::~SwXLinkNameAccessWrapper() -----------------------------------------------------------------------*/ Any SwXLinkNameAccessWrapper::getByName(const OUString& rName) - throw( container::NoSuchElementException, WrappedTargetException, RuntimeException ) + throw( NoSuchElementException, WrappedTargetException, RuntimeException ) { Any aRet; sal_Bool bFound = sal_False; @@ -2288,7 +2299,7 @@ Any SwXLinkNameAccessWrapper::getByName(const OUString& rName) } } if(!bFound) - throw container::NoSuchElementException(); + throw NoSuchElementException(); return aRet; } /*-- 26.10.99 09:16:24--------------------------------------------------- @@ -2510,7 +2521,7 @@ void SwXLinkNameAccessWrapper::removeVetoableChangeListener( /*-- 26.10.99 09:16:32--------------------------------------------------- -----------------------------------------------------------------------*/ -Reference< container::XNameAccess > SwXLinkNameAccessWrapper::getLinks(void) +Reference< XNameAccess > SwXLinkNameAccessWrapper::getLinks(void) throw( RuntimeException ) { return (SwXLinkNameAccessWrapper*)this; diff --git a/sw/source/ui/uno/unotxvw.cxx b/sw/source/ui/uno/unotxvw.cxx index a40a03e16c1f..699abe1daf5c 100644 --- a/sw/source/ui/uno/unotxvw.cxx +++ b/sw/source/ui/uno/unotxvw.cxx @@ -2,9 +2,9 @@ * * $RCSfile: unotxvw.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: os $ $Date: 2000-10-16 09:08:13 $ + * last change: $Author: os $ $Date: 2001-01-12 16:15:41 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1293,7 +1293,7 @@ Reference< text::XText > SwXTextViewCursor::getText(void) throw( uno::RuntimeEx SwWrtShell& rSh = pView->GetWrtShell(); SwPaM* pShellCrsr = rSh.GetCrsr(); SwDoc* pDoc = pView->GetDocShell()->GetDoc(); - Reference< text::XTextRange > xRg = ::CreateTextRangeFromPosition(pDoc, + Reference< text::XTextRange > xRg = SwXTextRange::CreateTextRangeFromPosition(pDoc, *pShellCrsr->Start(), 0); xRet = xRg->getText(); } @@ -1313,7 +1313,7 @@ Reference< text::XTextRange > SwXTextViewCursor::getStart(void) throw( uno::Run SwWrtShell& rSh = pView->GetWrtShell(); SwPaM* pShellCrsr = rSh.GetCrsr(); SwDoc* pDoc = pView->GetDocShell()->GetDoc(); - xRet = ::CreateTextRangeFromPosition(pDoc, + xRet = SwXTextRange::CreateTextRangeFromPosition(pDoc, *pShellCrsr->Start(), 0); } else @@ -1332,7 +1332,7 @@ Reference< text::XTextRange > SwXTextViewCursor::getEnd(void) throw( uno::Runti SwWrtShell& rSh = pView->GetWrtShell(); SwPaM* pShellCrsr = rSh.GetCrsr(); SwDoc* pDoc = pView->GetDocShell()->GetDoc(); - xRet = ::CreateTextRangeFromPosition(pDoc, + xRet = SwXTextRange::CreateTextRangeFromPosition(pDoc, *pShellCrsr->End(), 0); } else |