diff options
author | Kohei Yoshida <kyoshida@novell.com> | 2010-10-05 15:41:47 -0400 |
---|---|---|
committer | Kohei Yoshida <kyoshida@novell.com> | 2010-10-05 15:44:53 -0400 |
commit | 5b2794e27a81f8078cc251580ca59cc47807c7a0 (patch) | |
tree | bba8c835a5d7ce21014b0b1fec30ca3af4cbefa4 /sfx2/source/appl/appuno.cxx | |
parent | c360b9e3bd56a24f7399a27a6ae0feaaacca9f32 (diff) |
Ported dde-reconnect-on-load-*.diff from ooo-build.
Improve reliability of DDE connections between documents opened in LO.
With this change, LO tries to reconnect to a DDE server document upon
opening if that server document is being listened to by one of the
open documents.
Also, the old implementation would load a DDE server document
invisible, and would never close it when the user updates the link.
This had the consequence that when the user tries to open this
document while it's loaded hidden, it causes some weird focus issues,
and closing it and opening it again would disconnect the DDE
connection. The new implementation closes the server document
immediately after the DDE link update is complete.
This change also fixes a bug in Calc where DDE link updates to cells
would fail when the formula syntax is set to something other than Calc
A1.
Diffstat (limited to 'sfx2/source/appl/appuno.cxx')
-rw-r--r-- | sfx2/source/appl/appuno.cxx | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/sfx2/source/appl/appuno.cxx b/sfx2/source/appl/appuno.cxx index 03e8c9c2c88d..9a641377c7fa 100644 --- a/sfx2/source/appl/appuno.cxx +++ b/sfx2/source/appl/appuno.cxx @@ -149,6 +149,7 @@ static char const sOpenNewView[] = "OpenNewView"; static char const sViewId[] = "ViewId"; static char const sPluginMode[] = "PluginMode"; static char const sReadOnly[] = "ReadOnly"; +static char const sDdeReconnect[] = "DDEReconnect"; static char const sStartPresentation[] = "StartPresentation"; static char const sFrameName[] = "FrameName"; static char const sMediaType[] = "MediaType"; @@ -608,6 +609,14 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque if (bOK) rSet.Put( SfxBoolItem( SID_DOC_READONLY, bVal ) ); } + else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sDdeReconnect)) ) + { + sal_Bool bVal = sal_True; + sal_Bool bOK = (rProp.Value >>= bVal); + DBG_ASSERT( bOK, "invalid type for DDEReconnect" ); + if (bOK) + rSet.Put( SfxBoolItem( SID_DDE_RECONNECT_ONLOAD, bVal ) ); + } else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sStartPresentation)) ) { sal_Bool bVal = sal_False; @@ -1007,6 +1016,8 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, ::com::sun::sta nAdditional++; if ( rSet.GetItemState( SID_DOC_READONLY ) == SFX_ITEM_SET ) nAdditional++; + if ( rSet.GetItemState( SID_DDE_RECONNECT_ONLOAD ) == SFX_ITEM_SET ) + nAdditional++; if ( rSet.GetItemState( SID_DOC_STARTPRESENTATION ) == SFX_ITEM_SET ) nAdditional++; if ( rSet.GetItemState( SID_SELECTION ) == SFX_ITEM_SET ) @@ -1423,6 +1434,11 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, ::com::sun::sta pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sReadOnly)); pValue[nActProp++].Value <<= ( ((SfxBoolItem*)pItem)->GetValue() ); } + if ( rSet.GetItemState( SID_DDE_RECONNECT_ONLOAD, sal_False, &pItem ) == SFX_ITEM_SET ) + { + pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sDdeReconnect)); + pValue[nActProp++].Value <<= ( ((SfxBoolItem*)pItem)->GetValue() ); + } if ( rSet.GetItemState( SID_DOC_STARTPRESENTATION, sal_False, &pItem ) == SFX_ITEM_SET ) { pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sStartPresentation)); |