summaryrefslogtreecommitdiff
path: root/sfx2/source/appl
diff options
context:
space:
mode:
authorHerbert Dürr <hdu@apache.org>2014-07-14 07:17:59 +0000
committerChristian Lohmaier <lohmaier+LibreOffice@googlemail.com>2014-07-15 23:05:05 +0000
commitc6fe1d2e6555f38b6cb7249eeb258812b2fd7985 (patch)
treeac8bd6110ae3b127689b6d62809bc90c4b3b1f46 /sfx2/source/appl
parent012bdc381f1ee36a1ee1157c1821fdeb49066078 (diff)
Related: #i125226# expect DDE servers to be already up
"soffice" is always up anyway and other DDE apps should be started manually (cherry picked from commit e0bfdb26cef87c8d3b3435293116a33cf99c11f0) Conflicts: sfx2/source/appl/impldde.cxx Change-Id: I52ebb26528952a4abf33ac95cb67c598f08b2790 (cherry picked from commit f4a8d7cd10cda57143b22519e16cdf8d5f19e759) Reviewed-on: https://gerrit.libreoffice.org/10287 Reviewed-by: Eike Rathke <erack@redhat.com> Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> Tested-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
Diffstat (limited to 'sfx2/source/appl')
-rw-r--r--sfx2/source/appl/impldde.cxx72
1 files changed, 11 insertions, 61 deletions
diff --git a/sfx2/source/appl/impldde.cxx b/sfx2/source/appl/impldde.cxx
index 7ec637a825ca..9fbe93d25999 100644
--- a/sfx2/source/appl/impldde.cxx
+++ b/sfx2/source/appl/impldde.cxx
@@ -198,9 +198,6 @@ bool SvDDEObject::GetData( ::com::sun::star::uno::Any & rData /*out param*/,
bool SvDDEObject::Connect( SvBaseLink * pSvLink )
{
-#if defined(WNT)
- static sal_Bool bInWinExec = sal_False;
-#endif
sal_uInt16 nLinkType = pSvLink->GetUpdateMode();
if( pConnection ) // Connection is already made
{
@@ -227,69 +224,22 @@ bool SvDDEObject::Connect( SvBaseLink * pSvLink )
pConnection = new DdeConnection( sServer, sTopic );
if( pConnection->GetError() )
{
- // Is it possible to address the system-Topic?
- // then the server is up, it just does not know the topic!
- if( sTopic.equalsIgnoreAsciiCase( "SYSTEM" ) )
+ // check if the DDE server knows the "SYSTEM" topic
+ bool bSysTopic = false;
+ if (!sTopic.equalsIgnoreAsciiCase("SYSTEM"))
{
- bool bSysTopic;
- {
- DdeConnection aTmp(sServer, OUString("SYSTEM"));
- bSysTopic = !aTmp.GetError();
- }
-
- if( bSysTopic )
- {
- nError = DDELINK_ERROR_DATA;
- return false;
- }
- // otherwise in Win/WinNT, start the Application directly
+ DdeConnection aTmp(sServer, OUString("SYSTEM"));
+ bSysTopic = !aTmp.GetError();
}
-#if defined(WNT)
- // check the suitability of starting the DDE server
- const SvtSecurityOptions aSecOpts;
- bool bForbidden = (aSecOpts.GetMacroSecurityLevel() == eNEVER_EXECUTE);
- bForbidden |= (comphelper::string::indexOfAny(sServer, L":./%\\") != -1);
- static const char* aBadServers[] = { "cmd", "rundll32" };
- for (size_t i = 0; i < sizeof(aBadServers)/sizeof(*aBadServers); ++i)
- bForbidden |= sServer.equalsAscii(aBadServers[i]);
-
- // try to start the DDE server if it is not there already
- bForbidden |= (bInWinExec != false);
- if( !bForbidden )
+ if( bSysTopic )
{
- OStringBuffer aCmdLine(OUStringToOString(sServer, RTL_TEXTENCODING_ASCII_US));
- aCmdLine.append(".exe ");
- aCmdLine.append(OUStringToOString(sTopic, RTL_TEXTENCODING_ASCII_US));
-
- if( WinExec( aCmdLine.getStr(), SW_SHOWMINIMIZED ) < 32 ) // TODO: use CreateProcess() instead
- 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
- {
- 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 false;
}
+
+ nError = DDELINK_ERROR_APP;
}
if( LINKUPDATE_ALWAYS == nLinkType && !pLink && !pConnection->GetError() )