Kaydet (Commit) d90b475d authored tarafından Daniel Vogelheim's avatar Daniel Vogelheim

- added: IsAutomaticUpdate property to SwXTextSection (for DDE linked sections)

üst a6273c3f
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: unomap.hxx,v $ * $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 * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -136,6 +136,7 @@ ...@@ -136,6 +136,7 @@
#define WID_SECT_VISIBLE 8005 #define WID_SECT_VISIBLE 8005
#define WID_SECT_PROTECTED 8006 #define WID_SECT_PROTECTED 8006
#define WID_SECT_REGION 8007 #define WID_SECT_REGION 8007
#define WID_SECT_DDE_AUTOUPDATE 8008
//Verzeichnisse //Verzeichnisse
#define WID_PRIMARY_KEY 1000 #define WID_PRIMARY_KEY 1000
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: unomap.cxx,v $ * $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 * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -1085,6 +1085,7 @@ const SfxItemPropertyMap* SwUnoPropertyMapProvider::GetPropertyMap(sal_uInt16 ...@@ -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_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_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_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 #endif
{ SW_PROP_NAME(UNO_NAME_FILE_LINK), WID_SECT_LINK , &::getCppuType((const text::SectionFileLink*)0), PROPERTY_NONE, 0}, { 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}, { SW_PROP_NAME(UNO_NAME_IS_VISIBLE), WID_SECT_VISIBLE , &::getBooleanCppuType(), PROPERTY_NONE, 0},
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: unosect.cxx,v $ * $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 * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -82,6 +82,9 @@ ...@@ -82,6 +82,9 @@
#ifndef _LINKMGR_HXX #ifndef _LINKMGR_HXX
#include <so3/linkmgr.hxx> #include <so3/linkmgr.hxx>
#endif #endif
#ifndef _LNKBASE_HXX
#include <so3/lnkbase.hxx>
#endif
#ifndef _VOS_MUTEX_HXX_ //autogen #ifndef _VOS_MUTEX_HXX_ //autogen
#include <vos/mutex.hxx> #include <vos/mutex.hxx>
#endif #endif
...@@ -141,13 +144,15 @@ struct SwTextSectionProperties_Impl ...@@ -141,13 +144,15 @@ struct SwTextSectionProperties_Impl
sal_Bool bDDE; sal_Bool bDDE;
sal_Bool bHidden; sal_Bool bHidden;
sal_Bool bProtect; sal_Bool bProtect;
sal_Bool bUpdateType;
SwTextSectionProperties_Impl() : SwTextSectionProperties_Impl() :
bDDE(0), bDDE(0),
bHidden(0), bHidden(0),
bProtect(0), bProtect(0),
pColItem(0), pColItem(0),
pBrushItem(0){} pBrushItem(0),
bUpdateType(sal_True){}
~SwTextSectionProperties_Impl() ~SwTextSectionProperties_Impl()
{ {
...@@ -320,6 +325,18 @@ void SwXTextSection::attachToRange(const uno::Reference< text::XTextRange > & xT ...@@ -320,6 +325,18 @@ void SwXTextSection::attachToRange(const uno::Reference< text::XTextRange > & xT
aSet.Put(*pProps->pColItem); aSet.Put(*pProps->pColItem);
pRet = pDoc->Insert( aPam, aSect, aSet.Count() ? &aSet : 0 ); pRet = pDoc->Insert( aPam, aSect, aSet.Count() ? &aSet : 0 );
pRet->GetFmt()->Add(this); 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 // Undo-Klammerung hier beenden
pDoc->EndUndo( UNDO_INSSECTION ); pDoc->EndUndo( UNDO_INSSECTION );
DELETEZ(pProps); DELETEZ(pProps);
...@@ -463,6 +480,25 @@ void SwXTextSection::setPropertyValue( ...@@ -463,6 +480,25 @@ void SwXTextSection::setPropertyValue(
} }
} }
break; 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 : case WID_SECT_LINK :
{ {
if(aValue.getValueType() == ::getCppuType((const text::SectionFileLink*)0)) if(aValue.getValueType() == ::getCppuType((const text::SectionFileLink*)0))
...@@ -629,6 +665,14 @@ uno::Any SwXTextSection::getPropertyValue(const OUString& rPropertyName) ...@@ -629,6 +665,14 @@ uno::Any SwXTextSection::getPropertyValue(const OUString& rPropertyName)
aRet <<= OUString(sRet); aRet <<= OUString(sRet);
} }
break; 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 : case WID_SECT_LINK :
{ {
text::SectionFileLink aLink; text::SectionFileLink aLink;
...@@ -779,6 +823,7 @@ Sequence< PropertyState > SwXTextSection::getPropertyStates( ...@@ -779,6 +823,7 @@ Sequence< PropertyState > SwXTextSection::getPropertyStates(
case WID_SECT_DDE_TYPE : case WID_SECT_DDE_TYPE :
case WID_SECT_DDE_FILE : case WID_SECT_DDE_FILE :
case WID_SECT_DDE_ELEMENT : case WID_SECT_DDE_ELEMENT :
case WID_SECT_DDE_AUTOUPDATE:
case WID_SECT_LINK : case WID_SECT_LINK :
case WID_SECT_REGION : case WID_SECT_REGION :
case WID_SECT_VISIBLE : case WID_SECT_VISIBLE :
...@@ -850,6 +895,9 @@ void SwXTextSection::setPropertyToDefault( const OUString& rPropertyName ) ...@@ -850,6 +895,9 @@ void SwXTextSection::setPropertyToDefault( const OUString& rPropertyName )
case WID_SECT_REGION : case WID_SECT_REGION :
aSection.SetType(CONTENT_SECTION); aSection.SetType(CONTENT_SECTION);
break; break;
case WID_SECT_DDE_AUTOUPDATE:
aSection.SetUpdateType(LINKUPDATE_ALWAYS);
break;
case WID_SECT_VISIBLE : case WID_SECT_VISIBLE :
{ {
if(m_bIsDescriptor) if(m_bIsDescriptor)
...@@ -926,6 +974,7 @@ Any SwXTextSection::getPropertyDefault( const OUString& rPropertyName ) ...@@ -926,6 +974,7 @@ Any SwXTextSection::getPropertyDefault( const OUString& rPropertyName )
case WID_SECT_LINK : case WID_SECT_LINK :
aRet <<= SectionFileLink(); aRet <<= SectionFileLink();
break; break;
case WID_SECT_DDE_AUTOUPDATE:
case WID_SECT_VISIBLE : case WID_SECT_VISIBLE :
{ {
sal_Bool bTemp = TRUE; sal_Bool bTemp = TRUE;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment