diff options
-rw-r--r-- | sw/inc/unomap.hxx | 5 | ||||
-rw-r--r-- | sw/source/core/unocore/unomap.cxx | 5 | ||||
-rw-r--r-- | sw/source/core/unocore/unosect.cxx | 55 |
3 files changed, 58 insertions, 7 deletions
diff --git a/sw/inc/unomap.hxx b/sw/inc/unomap.hxx index 580dd1644a0c..566de61da4f2 100644 --- a/sw/inc/unomap.hxx +++ b/sw/inc/unomap.hxx @@ -2,9 +2,9 @@ * * $RCSfile: unomap.hxx,v $ * - * $Revision: 1.8 $ + * $Revision: 1.9 $ * - * last change: $Author: os $ $Date: 2000-11-08 12:19:40 $ + * last change: $Author: dvo $ $Date: 2000-11-20 14:00:30 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -136,6 +136,7 @@ #define WID_SECT_VISIBLE 8005 #define WID_SECT_PROTECTED 8006 #define WID_SECT_REGION 8007 +#define WID_SECT_DDE_AUTOUPDATE 8008 //Verzeichnisse #define WID_PRIMARY_KEY 1000 diff --git a/sw/source/core/unocore/unomap.cxx b/sw/source/core/unocore/unomap.cxx index 28d9ec2edaab..9122e7b4cfa8 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.20 $ + * $Revision: 1.21 $ * - * last change: $Author: os $ $Date: 2000-11-17 14:06:06 $ + * last change: $Author: dvo $ $Date: 2000-11-20 14:00:32 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1085,6 +1085,7 @@ const SfxItemPropertyMap* SwUnoPropertyMapProvider::GetPropertyMap(sal_uInt16 { SW_PROP_NAME(UNO_NAME_DDE_COMMAND_FILE), WID_SECT_DDE_TYPE, &::getCppuType((const OUString*)0) , PROPERTY_NONE, 0}, { SW_PROP_NAME(UNO_NAME_DDE_COMMAND_TYPE), WID_SECT_DDE_FILE, &::getCppuType((const OUString*)0) , PROPERTY_NONE, 0}, { SW_PROP_NAME(UNO_NAME_DDE_COMMAND_ELEMENT), WID_SECT_DDE_ELEMENT, &::getCppuType((const OUString*)0) , PROPERTY_NONE, 0}, + { SW_PROP_NAME(UNO_NAME_IS_AUTOMATIC_UPDATE), WID_SECT_DDE_AUTOUPDATE, &::getBooleanCppuType(), PROPERTY_NONE, 0}, #endif { SW_PROP_NAME(UNO_NAME_FILE_LINK), WID_SECT_LINK , &::getCppuType((const text::SectionFileLink*)0), PROPERTY_NONE, 0}, { SW_PROP_NAME(UNO_NAME_IS_VISIBLE), WID_SECT_VISIBLE , &::getBooleanCppuType(), PROPERTY_NONE, 0}, diff --git a/sw/source/core/unocore/unosect.cxx b/sw/source/core/unocore/unosect.cxx index 5a5d290c7487..69285d64db91 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.6 $ + * $Revision: 1.7 $ * - * last change: $Author: os $ $Date: 2000-11-15 15:00:48 $ + * last change: $Author: dvo $ $Date: 2000-11-20 14:00:32 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -82,6 +82,9 @@ #ifndef _LINKMGR_HXX #include <so3/linkmgr.hxx> #endif +#ifndef _LNKBASE_HXX +#include <so3/lnkbase.hxx> +#endif #ifndef _VOS_MUTEX_HXX_ //autogen #include <vos/mutex.hxx> #endif @@ -141,13 +144,15 @@ struct SwTextSectionProperties_Impl sal_Bool bDDE; sal_Bool bHidden; sal_Bool bProtect; + sal_Bool bUpdateType; SwTextSectionProperties_Impl() : bDDE(0), bHidden(0), bProtect(0), pColItem(0), - pBrushItem(0){} + pBrushItem(0), + bUpdateType(sal_True){} ~SwTextSectionProperties_Impl() { @@ -320,6 +325,18 @@ void SwXTextSection::attachToRange(const uno::Reference< text::XTextRange > & xT aSet.Put(*pProps->pColItem); pRet = pDoc->Insert( aPam, aSect, aSet.Count() ? &aSet : 0 ); pRet->GetFmt()->Add(this); + + // set update type if DDE link (and connect, if necessary) + if (pProps->bDDE) + { + if (! aSect.IsConnected()) + { + aSect.CreateLink(CREATE_CONNECT); + } + aSect.SetUpdateType(pProps->bUpdateType ? LINKUPDATE_ALWAYS : + LINKUPDATE_ONCALL); + } + // Undo-Klammerung hier beenden pDoc->EndUndo( UNDO_INSSECTION ); DELETEZ(pProps); @@ -463,6 +480,25 @@ void SwXTextSection::setPropertyValue( } } break; + case WID_SECT_DDE_AUTOUPDATE: + { + sal_Bool bVal = *(sal_Bool*)aValue.getValue(); + if(m_bIsDescriptor) + { + pProps->bUpdateType = bVal; + } + else + { + // set update type; needs an established link + if (! pSect->IsConnected()) + { + pSect->CreateLink(CREATE_CONNECT); + } + pSect->SetUpdateType(bVal ? LINKUPDATE_ALWAYS + : LINKUPDATE_ONCALL); + } + } + break; case WID_SECT_LINK : { if(aValue.getValueType() == ::getCppuType((const text::SectionFileLink*)0)) @@ -629,6 +665,14 @@ uno::Any SwXTextSection::getPropertyValue(const OUString& rPropertyName) aRet <<= OUString(sRet); } break; + case WID_SECT_DDE_AUTOUPDATE: + { + // GetUpdateType() returns .._ALWAYS or .._ONCALL + sal_Bool bTemp = + (pSect->GetUpdateType() == LINKUPDATE_ALWAYS); + aRet.setValue( &bTemp, ::getCppuBooleanType()); + } + break; case WID_SECT_LINK : { text::SectionFileLink aLink; @@ -779,6 +823,7 @@ Sequence< PropertyState > SwXTextSection::getPropertyStates( case WID_SECT_DDE_TYPE : case WID_SECT_DDE_FILE : case WID_SECT_DDE_ELEMENT : + case WID_SECT_DDE_AUTOUPDATE: case WID_SECT_LINK : case WID_SECT_REGION : case WID_SECT_VISIBLE : @@ -850,6 +895,9 @@ void SwXTextSection::setPropertyToDefault( const OUString& rPropertyName ) case WID_SECT_REGION : aSection.SetType(CONTENT_SECTION); break; + case WID_SECT_DDE_AUTOUPDATE: + aSection.SetUpdateType(LINKUPDATE_ALWAYS); + break; case WID_SECT_VISIBLE : { if(m_bIsDescriptor) @@ -926,6 +974,7 @@ Any SwXTextSection::getPropertyDefault( const OUString& rPropertyName ) case WID_SECT_LINK : aRet <<= SectionFileLink(); break; + case WID_SECT_DDE_AUTOUPDATE: case WID_SECT_VISIBLE : { sal_Bool bTemp = TRUE; |