diff options
author | August Sodora <augsod@gmail.com> | 2011-11-03 16:50:24 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2011-11-04 08:21:25 +0100 |
commit | e04249337551653f63ba9b2a2302578961e38562 (patch) | |
tree | c8780254acf0b87c16f47725657a0b8c38871bfe /sfx2 | |
parent | fb17dce09e29c4518129587d347cc3787f74c396 (diff) |
String->OUString, remove unused code
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/appl/appdde.cxx | 36 |
1 files changed, 23 insertions, 13 deletions
diff --git a/sfx2/source/appl/appdde.cxx b/sfx2/source/appl/appdde.cxx index 5dbbdd007e33..f7d3c0e22d9c 100644 --- a/sfx2/source/appl/appdde.cxx +++ b/sfx2/source/appl/appdde.cxx @@ -265,23 +265,33 @@ sal_Bool SfxAppEvent_Impl( ApplicationEvent &rAppEvent, aEvent += '('; if ( rCmd.CompareIgnoreCaseToAscii( aEvent, aEvent.Len() ) == COMPARE_EQUAL ) { - String aData( rCmd ); - aData.Erase( 0, aEvent.Len() ); - if ( aData.Len() > 2 ) + ::rtl::OUStringBuffer aData( rCmd ); + aData.remove( 0, aEvent.Len() ); + if ( aData.getLength() > 2 ) { // Transform into the ApplicationEvent Format - aData.Erase( aData.Len()-1, 1 ); - for ( sal_uInt16 n = 0; n < aData.Len(); ++n ) + aData.remove( aData.getLength() - 1, 1 ); + for ( sal_Int32 n = 0; n < aData.getLength(); ) { - if ( aData.GetChar(n) == 0x0022 ) // " = 22h - for ( ; aData.GetChar(++n) != 0x0022 ; ) - /* empty loop */ ; - else if ( aData.GetChar(n) == 0x0020 ) // SPACE = 20h - aData.SetChar(n, '\n'); + switch ( aData[n] == '"' ) + { + case '"': + aData.remove( n, 1 ); + while ( n < aData.getLength() && aData[n] != '"' ) + ++n; + if ( n < aData.getLength() ) + aData.remove( n, 1 ); + break; + case ' ': + aData[n++] = '\n'; + break; + default: + ++n; + break; + } } - aData.EraseAllChars( 0x0022 ); - ApplicationAddress aAddr; - rAppEvent = ApplicationEvent( String(), aAddr, U2S(rEvent), aData ); + + rAppEvent = ApplicationEvent(rEvent, aData.makeStringAndClear()); return sal_True; } } |