diff options
author | Gert Faller <gertfaller@aliceadsl.fr> | 2010-11-27 09:10:56 +0100 |
---|---|---|
committer | Gert Faller <gertfaller@aliceadsl.fr> | 2010-11-27 09:10:56 +0100 |
commit | 7ccc9aaef5c992f7baa7b0c547e3f3a2c06056fe (patch) | |
tree | 3b6b1e202e7ace21d826587664284d0ec99406ad /odk/examples/cpp | |
parent | 6fdcddfa77a32f324e5b67d3bf71d54cf88f7a54 (diff) |
RTL_CONSTASCII_USTRINGPARAM in sdk 1
Diffstat (limited to 'odk/examples/cpp')
6 files changed, 58 insertions, 58 deletions
diff --git a/odk/examples/cpp/DocumentLoader/DocumentLoader.cxx b/odk/examples/cpp/DocumentLoader/DocumentLoader.cxx index 6d72448c8762..f18cb7b165be 100644 --- a/odk/examples/cpp/DocumentLoader/DocumentLoader.cxx +++ b/odk/examples/cpp/DocumentLoader/DocumentLoader.cxx @@ -114,7 +114,7 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) */ Reference< XInterface > xInterface = xMultiComponentFactoryClient->createInstanceWithContext( - OUString::createFromAscii( "com.sun.star.bridge.UnoUrlResolver" ), + OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.bridge.UnoUrlResolver")), xComponentContext ); Reference< XUnoUrlResolver > resolver( xInterface, UNO_QUERY ); @@ -135,7 +135,7 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) // gets the server component context as property of the office component factory Reference< XPropertySet > xPropSet( xInterface, UNO_QUERY ); - xPropSet->getPropertyValue( OUString::createFromAscii("DefaultContext") ) >>= xComponentContext; + xPropSet->getPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("DefaultContext")) ) >>= xComponentContext; // gets the service manager from the office Reference< XMultiComponentFactory > xMultiComponentFactoryServer( diff --git a/odk/examples/cpp/complextoolbarcontrols/MyJob.cxx b/odk/examples/cpp/complextoolbarcontrols/MyJob.cxx index c87f14195929..c4a6218d4c40 100644 --- a/odk/examples/cpp/complextoolbarcontrols/MyJob.cxx +++ b/odk/examples/cpp/complextoolbarcontrols/MyJob.cxx @@ -49,9 +49,9 @@ using com::sun::star::document::XEventBroadcaster; Any SAL_CALL MyJob::execute( const Sequence< NamedValue >& aArguments ) throw ( IllegalArgumentException, Exception, RuntimeException ) { - Reference < XEventBroadcaster > xBrd( mxMSF->createInstance(::rtl::OUString::createFromAscii("com.sun.star.frame.GlobalEventBroadcaster") ), UNO_QUERY ); + Reference < XEventBroadcaster > xBrd( mxMSF->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.GlobalEventBroadcaster")) ), UNO_QUERY ); Reference < com::sun::star::document::XEventListener > xLstner( mxMSF->createInstance( - ::rtl::OUString::createFromAscii("com.sun.star.comp.Office.MyListener" ) ), UNO_QUERY ); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.Office.MyListener")) ), UNO_QUERY ); if ( xBrd.is() ) xBrd->addEventListener( xLstner ); return Any(); diff --git a/odk/examples/cpp/complextoolbarcontrols/MyListener.cxx b/odk/examples/cpp/complextoolbarcontrols/MyListener.cxx index a780efcfba23..b620edf5829e 100644 --- a/odk/examples/cpp/complextoolbarcontrols/MyListener.cxx +++ b/odk/examples/cpp/complextoolbarcontrols/MyListener.cxx @@ -98,11 +98,11 @@ css::uno::Any SAL_CALL MyListener::execute(const css::uno::Sequence< css::beans: return css::uno::Any(); css::uno::Reference< css::lang::XServiceInfo > xInfo(xModel, css::uno::UNO_QUERY); - sal_Bool bCalc = xInfo->supportsService(::rtl::OUString::createFromAscii("com.sun.star.sheet.SpreadsheetDocument")); + sal_Bool bCalc = xInfo->supportsService(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sheet.SpreadsheetDocument"))); sal_Bool bWriter = ( - xInfo->supportsService(::rtl::OUString::createFromAscii("com.sun.star.text.TextDocument" )) && - !xInfo->supportsService(::rtl::OUString::createFromAscii("com.sun.star.text.WebDocument" )) && - !xInfo->supportsService(::rtl::OUString::createFromAscii("com.sun.star.text.GlobalDocument")) + xInfo->supportsService(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.TextDocument"))) && + !xInfo->supportsService(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.WebDocument"))) && + !xInfo->supportsService(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.GlobalDocument"))) ); // Wir interessieren uns nur fr Writer und Calc. Werden hier aber fr diff --git a/odk/examples/cpp/complextoolbarcontrols/MyProtocolHandler.cxx b/odk/examples/cpp/complextoolbarcontrols/MyProtocolHandler.cxx index d0fd2b200898..52fb110af2f7 100644 --- a/odk/examples/cpp/complextoolbarcontrols/MyProtocolHandler.cxx +++ b/odk/examples/cpp/complextoolbarcontrols/MyProtocolHandler.cxx @@ -269,9 +269,9 @@ void SAL_CALL BaseDispatch::dispatch( const URL& aURL, const Sequence < Property if ( !aURL.Path.compareToAscii("Command1" ) ) { // open the OpenOffice.org web page - ::rtl::OUString sURL(::rtl::OUString::createFromAscii("http://www.openoffice.org")); + ::rtl::OUString sURL(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("http://www.openoffice.org"))); Reference< XSystemShellExecute > xSystemShellExecute( mxMSF->createInstance( - ::rtl::OUString::createFromAscii( "com.sun.star.system.SystemShellExecute" )), UNO_QUERY ); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.system.SystemShellExecute"))), UNO_QUERY ); if ( xSystemShellExecute.is() ) { try @@ -291,7 +291,7 @@ void SAL_CALL BaseDispatch::dispatch( const URL& aURL, const Sequence < Property Sequence< NamedValue > aRemoveArgs( 1 ); aRemoveArgs[0].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Text" )); aRemoveArgs[0].Value <<= maComboBoxText; - SendCommand( aURL, ::rtl::OUString::createFromAscii( "RemoveEntryText" ), aRemoveArgs, sal_True ); + SendCommand( aURL, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("RemoveEntryText")), aRemoveArgs, sal_True ); // add the new text to the start of the list Sequence< NamedValue > aInsertArgs( 2 ); @@ -299,7 +299,7 @@ void SAL_CALL BaseDispatch::dispatch( const URL& aURL, const Sequence < Property aInsertArgs[0].Value <<= sal_Int32( 0 ); aInsertArgs[1].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Text" )); aInsertArgs[1].Value <<= maComboBoxText; - SendCommand( aURL, ::rtl::OUString::createFromAscii( "InsertEntry" ), aInsertArgs, sal_True ); + SendCommand( aURL, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("InsertEntry")), aInsertArgs, sal_True ); } else if ( !aURL.Path.compareToAscii("Command3" ) ) { @@ -316,15 +316,15 @@ void SAL_CALL BaseDispatch::dispatch( const URL& aURL, const Sequence < Property // create new URL to address the combox box URL aCmdURL; - aCmdURL.Path = rtl::OUString::createFromAscii( "Command2" ); - aCmdURL.Protocol = rtl::OUString::createFromAscii( "vnd.demo.complextoolbarcontrols.demoaddon:" ); + aCmdURL.Path = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Command2")); + aCmdURL.Protocol = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("vnd.demo.complextoolbarcontrols.demoaddon:")); aCmdURL.Complete = aCmdURL.Path + aCmdURL.Protocol; // set the selected item as text into the combobox Sequence< NamedValue > aArgs( 1 ); - aArgs[0].Name = rtl::OUString::createFromAscii( "Text" ); + aArgs[0].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Text")); aArgs[0].Value <<= aText; - SendCommand( aCmdURL, ::rtl::OUString::createFromAscii( "SetText" ), aArgs, sal_True ); + SendCommand( aCmdURL, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SetText")), aArgs, sal_True ); } else if ( !aURL.Path.compareToAscii("Command4" ) ) { @@ -349,8 +349,8 @@ void SAL_CALL BaseDispatch::dispatch( const URL& aURL, const Sequence < Property // create new URL to address the image button URL aCmdURL; - aCmdURL.Path = rtl::OUString::createFromAscii( "Command1" ); - aCmdURL.Protocol = rtl::OUString::createFromAscii( "vnd.demo.complextoolbarcontrols.demoaddon:" ); + aCmdURL.Path = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Command1")); + aCmdURL.Protocol = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("vnd.demo.complextoolbarcontrols.demoaddon:")); aCmdURL.Complete = aCmdURL.Path + aCmdURL.Protocol; // create and initialize FeatureStateEvent with IsEnabled @@ -406,18 +406,18 @@ void SAL_CALL BaseDispatch::addStatusListener( const Reference< XStatusListener // send command to set context menu content Sequence< rtl::OUString > aContextMenu( 3 ); - aContextMenu[0] = rtl::OUString::createFromAscii( "Command 1" ); - aContextMenu[1] = rtl::OUString::createFromAscii( "Command 2" ); - aContextMenu[2] = rtl::OUString::createFromAscii( "Command 3" ); + aContextMenu[0] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Command 1")); + aContextMenu[1] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Command 2")); + aContextMenu[2] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Command 3")); - aArgs[0].Name = rtl::OUString::createFromAscii( "List" ); + aArgs[0].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("List")); aArgs[0].Value <<= aContextMenu; - SendCommandTo( xControl, aURL, rtl::OUString::createFromAscii( "SetList" ), aArgs, sal_True ); + SendCommandTo( xControl, aURL, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SetList")), aArgs, sal_True ); // send command to check item on pos=0 aArgs[0].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Pos" )); aArgs[0].Value <<= sal_Int32( 0 ); - SendCommandTo( xControl, aURL, ::rtl::OUString::createFromAscii( "CheckItemPos" ), aArgs, sal_True ); + SendCommandTo( xControl, aURL, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CheckItemPos")), aArgs, sal_True ); } else if ( aURL.Path.equalsAscii("Command4" ) ) { @@ -428,12 +428,12 @@ void SAL_CALL BaseDispatch::addStatusListener( const Reference< XStatusListener // send command to set context menu content Sequence< rtl::OUString > aContextMenu( 2 ); - aContextMenu[0] = rtl::OUString::createFromAscii( "Button Enabled" ); - aContextMenu[1] = rtl::OUString::createFromAscii( "Button Disabled" ); + aContextMenu[0] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Button Enabled")); + aContextMenu[1] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Button Disabled")); - aArgs[0].Name = rtl::OUString::createFromAscii( "List" ); + aArgs[0].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("List")); aArgs[0].Value <<= aContextMenu; - SendCommandTo( xControl, aURL, rtl::OUString::createFromAscii( "SetList" ), aArgs, sal_True ); + SendCommandTo( xControl, aURL, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SetList")), aArgs, sal_True ); // set position according to enable/disable state of button sal_Int32 nPos( mbButtonEnabled ? 0 : 1 ); @@ -441,7 +441,7 @@ void SAL_CALL BaseDispatch::addStatusListener( const Reference< XStatusListener // send command to check item on pos=0 aArgs[0].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Pos" )); aArgs[0].Value <<= nPos; - SendCommandTo( xControl, aURL, ::rtl::OUString::createFromAscii( "CheckItemPos" ), aArgs, sal_True ); + SendCommandTo( xControl, aURL, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CheckItemPos")), aArgs, sal_True ); } else if ( aURL.Path.equalsAscii("Command5" ) ) { @@ -449,18 +449,18 @@ void SAL_CALL BaseDispatch::addStatusListener( const Reference< XStatusListener Sequence< NamedValue > aArgs( 5 ); // send command to initialize spin button - aArgs[0].Name = rtl::OUString::createFromAscii( "Value" ); + aArgs[0].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Value")); aArgs[0].Value <<= double( 0.0 ); - aArgs[1].Name = rtl::OUString::createFromAscii( "UpperLimit" ); + aArgs[1].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("UpperLimit")); aArgs[1].Value <<= double( 10.0 ); - aArgs[2].Name = rtl::OUString::createFromAscii( "LowerLimit" ); + aArgs[2].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("LowerLimit")); aArgs[2].Value <<= double( 0.0 ); - aArgs[3].Name = rtl::OUString::createFromAscii( "Step" ); + aArgs[3].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Step")); aArgs[3].Value <<= double( 0.1 ); - aArgs[4].Name = rtl::OUString::createFromAscii( "OutputFormat" ); - aArgs[4].Value <<= rtl::OUString::createFromAscii( "%.2f cm" ); + aArgs[4].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("OutputFormat")); + aArgs[4].Value <<= rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("%.2f cm")); - SendCommandTo( xControl, aURL, rtl::OUString::createFromAscii( "SetValues" ), aArgs, sal_True ); + SendCommandTo( xControl, aURL, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SetValues")), aArgs, sal_True ); } else if ( aURL.Path.equalsAscii("Command7" ) ) { @@ -470,20 +470,20 @@ void SAL_CALL BaseDispatch::addStatusListener( const Reference< XStatusListener // send command to set context menu content Sequence< rtl::OUString > aList( 10 ); - aList[0] = rtl::OUString::createFromAscii( "White" ); - aList[1] = rtl::OUString::createFromAscii( "Black" ); - aList[2] = rtl::OUString::createFromAscii( "Red" ); - aList[3] = rtl::OUString::createFromAscii( "Blue" ); - aList[4] = rtl::OUString::createFromAscii( "Green" ); - aList[5] = rtl::OUString::createFromAscii( "Grey" ); - aList[6] = rtl::OUString::createFromAscii( "Yellow" ); - aList[7] = rtl::OUString::createFromAscii( "Orange" ); - aList[8] = rtl::OUString::createFromAscii( "Brown" ); - aList[9] = rtl::OUString::createFromAscii( "Pink" ); - - aArgs[0].Name = rtl::OUString::createFromAscii( "List" ); + aList[0] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("White")); + aList[1] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Black")); + aList[2] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Red")); + aList[3] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Blue")); + aList[4] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Green")); + aList[5] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Grey")); + aList[6] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Yellow")); + aList[7] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Orange")); + aList[8] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Brown")); + aList[9] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Pink")); + + aArgs[0].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("List")); aArgs[0].Value <<= aList; - SendCommandTo( xControl, aURL, rtl::OUString::createFromAscii( "SetList" ), aArgs, sal_True ); + SendCommandTo( xControl, aURL, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SetList")), aArgs, sal_True ); } aListenerHelper.AddListener( mxFrame, xControl, aURL.Path ); diff --git a/odk/examples/cpp/counter/countermain.cxx b/odk/examples/cpp/counter/countermain.cxx index 9473ff01d1ae..2a64acec106f 100644 --- a/odk/examples/cpp/counter/countermain.cxx +++ b/odk/examples/cpp/counter/countermain.cxx @@ -72,7 +72,7 @@ SAL_IMPLEMENT_MAIN() Reference< XSimpleRegistry > xReg = createSimpleRegistry(); OSL_ENSURE( xReg.is(), "### cannot get service instance of \"com.sun.star.regiystry.SimpleRegistry\"!" ); - xReg->open(OUString::createFromAscii("counter.uno.rdb"), sal_False, sal_False); + xReg->open(OUString(RTL_CONSTASCII_USTRINGPARAM("counter.uno.rdb")), sal_False, sal_False); OSL_ENSURE( xReg->isValid(), "### cannot open test registry \"counter.uno.rdb\"!" ); Reference< XComponentContext > xContext = bootstrap_InitialComponentContext(xReg); @@ -83,21 +83,21 @@ SAL_IMPLEMENT_MAIN() // register my counter component Reference< XImplementationRegistration > xImplReg( - xMgr->createInstanceWithContext(OUString::createFromAscii("com.sun.star.registry.ImplementationRegistration"), xContext), UNO_QUERY); + xMgr->createInstanceWithContext(OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.registry.ImplementationRegistration")), xContext), UNO_QUERY); OSL_ENSURE( xImplReg.is(), "### cannot get service instance of \"com.sun.star.registry.ImplementationRegistration\"!" ); if (xImplReg.is()) { xImplReg->registerImplementation( - OUString::createFromAscii("com.sun.star.loader.SharedLibrary"), // loader for component + OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.loader.SharedLibrary")), // loader for component #ifdef UNX #ifdef MACOSX - OUString::createFromAscii("counter.uno.dylib"), // component location + OUString(RTL_CONSTASCII_USTRINGPARAM("counter.uno.dylib")), // component location #else - OUString::createFromAscii("counter.uno.so"), // component location + OUString(RTL_CONSTASCII_USTRINGPARAM("counter.uno.so")), // component location #endif #else - OUString::createFromAscii("counter.uno.dll"), // component location + OUString(RTL_CONSTASCII_USTRINGPARAM("counter.uno.dll")), // component location #endif Reference< XSimpleRegistry >() // registry omitted, // defaulting to service manager registry used @@ -105,7 +105,7 @@ SAL_IMPLEMENT_MAIN() // get a counter instance Reference< XInterface > xx ; - xx = xMgr->createInstanceWithContext(OUString::createFromAscii("foo.Counter"), xContext); + xx = xMgr->createInstanceWithContext(OUString(RTL_CONSTASCII_USTRINGPARAM("foo.Counter")), xContext); Reference< XCountable > xCount( xx, UNO_QUERY ); OSL_ENSURE( xCount.is(), "### cannot get service instance of \"foo.Counter\"!" ); diff --git a/odk/examples/cpp/remoteclient/remoteclient.cxx b/odk/examples/cpp/remoteclient/remoteclient.cxx index 47d83d1558f4..2e114d57c001 100644 --- a/odk/examples/cpp/remoteclient/remoteclient.cxx +++ b/odk/examples/cpp/remoteclient/remoteclient.cxx @@ -148,7 +148,7 @@ sal_Int32 PipeClientMain::run( const Sequence< OUString > & aArguments ) throw ( { try { Reference < XInterface > r = - m_xSMgr->createInstance( OUString::createFromAscii( "com.sun.star.bridge.UnoUrlResolver" ) ); + m_xSMgr->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.bridge.UnoUrlResolver")) ); Reference < XUnoUrlResolver > rResolver( r , UNO_QUERY ); // connect to the remote process and retrieve the initial object @@ -212,7 +212,7 @@ Sequence< OUString > getSupportedServiceNames() if( !pNames ) { static Sequence< OUString > seqNames(1); - seqNames.getArray()[0] = OUString::createFromAscii( "com.sun.star.bridge.example.RemoteClientSample" ); + seqNames.getArray()[0] = OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.bridge.example.RemoteClientSample")); pNames = &seqNames; } } |