You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by hd...@apache.org on 2014/07/14 09:21:47 UTC
svn commit: r1610349 - in /openoffice/branches/AOO410: ./ main/
main/sfx2/source/appl/impldde.cxx
Author: hdu
Date: Mon Jul 14 07:21:47 2014
New Revision: 1610349
URL: http://svn.apache.org/r1610349
Log:
#i125226# expect DDE servers to be already up
Merged from trunk.
Modified:
openoffice/branches/AOO410/ (props changed)
openoffice/branches/AOO410/main/ (props changed)
openoffice/branches/AOO410/main/sfx2/source/appl/impldde.cxx
Propchange: openoffice/branches/AOO410/
------------------------------------------------------------------------------
Merged /openoffice/trunk:r1609204,1609208,1609302,1609426,1610347
Propchange: openoffice/branches/AOO410/main/
------------------------------------------------------------------------------
Merged /openoffice/trunk/main:r1609204,1609208,1609302,1609426,1610347
Modified: openoffice/branches/AOO410/main/sfx2/source/appl/impldde.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/AOO410/main/sfx2/source/appl/impldde.cxx?rev=1610349&r1=1610348&r2=1610349&view=diff
==============================================================================
--- openoffice/branches/AOO410/main/sfx2/source/appl/impldde.cxx (original)
+++ openoffice/branches/AOO410/main/sfx2/source/appl/impldde.cxx Mon Jul 14 07:21:47 2014
@@ -49,6 +49,8 @@
#include <svl/svdde.hxx>
#include <sot/formats.hxx>
+#include <unotools/securityoptions.hxx>
+
#define DDELINK_COLD 0
#define DDELINK_HOT 1
@@ -207,9 +209,6 @@ sal_Bool SvDDEObject::GetData( ::com::su
sal_Bool SvDDEObject::Connect( SvBaseLink * pSvLink )
{
-#if defined(WNT)
- static sal_Bool bInWinExec = sal_False;
-#endif
sal_uInt16 nLinkType = pSvLink->GetUpdateMode();
if( pConnection ) // Verbindung steht ja schon
{
@@ -236,61 +235,22 @@ sal_Bool SvDDEObject::Connect( SvBaseLin
pConnection = new DdeConnection( sServer, sTopic );
if( pConnection->GetError() )
{
- // kann man denn das System-Topic ansprechen ?
- // dann ist der Server oben, kennt nur nicht das Topic!
- if( sTopic.EqualsIgnoreCaseAscii( "SYSTEM" ) )
+ // check if the DDE server knows the "SYSTEM" topic
+ bool bSysTopic = false;
+ if( !sTopic.EqualsIgnoreCaseAscii( "SYSTEM" ))
{
- sal_Bool bSysTopic;
- {
- DdeConnection aTmp( sServer, String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "SYSTEM" ) ) );
- bSysTopic = !aTmp.GetError();
- }
-
- if( bSysTopic )
- {
- nError = DDELINK_ERROR_DATA;
- return sal_False;
- }
- // ansonsten unter Win/WinNT die Applikation direkt starten
+ DdeConnection aTmp( sServer, String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "SYSTEM" ) ) );
+ bSysTopic = !aTmp.GetError();
}
-#if defined(WNT)
-
- // Server nicht da, starten und nochmal versuchen
- if( !bInWinExec )
- {
- ByteString aCmdLine( sServer, RTL_TEXTENCODING_ASCII_US );
- aCmdLine.Append( ".exe " );
- aCmdLine.Append( ByteString( sTopic, RTL_TEXTENCODING_ASCII_US ) );
-
- if( WinExec( aCmdLine.GetBuffer(), SW_SHOWMINIMIZED ) < 32 )
- nError = DDELINK_ERROR_APP;
- else
- {
- sal_uInt16 i;
- for( i=0; i<5; i++ )
- {
- bInWinExec = sal_True;
- Application::Reschedule();
- bInWinExec = sal_False;
-
- delete pConnection;
- pConnection = new DdeConnection( sServer, sTopic );
- if( !pConnection->GetError() )
- break;
- }
-
- if( i == 5 )
- {
- nError = DDELINK_ERROR_APP;
- }
- }
- }
- else
-#endif // WNT
+ if( bSysTopic )
{
- nError = DDELINK_ERROR_APP;
+ // if the system topic works then the server is up but just doesn't know the original topic
+ nError = DDELINK_ERROR_DATA;
+ return sal_False;
}
+
+ nError = DDELINK_ERROR_APP;
}
if( LINKUPDATE_ALWAYS == nLinkType && !pLink && !pConnection->GetError() )