Kaydet (Commit) 793f2404 authored tarafından Olivier Hallot's avatar Olivier Hallot

targeted string re-work (ii)

Further simplification of d8e3eb23

Change-Id: I2fa695e236cb6dc3be66fc57e7fae167cc368904
üst 590140e6
......@@ -95,8 +95,7 @@ void ReadThroughDic( const String &rMainURL, ConvDicXMLImport &rImport )
uno::Reference< io::XInputStream > xIn;
try
{
uno::Reference< ucb::XSimpleFileAccess > xAccess( xServiceFactory->createInstance(
A2OU( "com.sun.star.ucb.SimpleFileAccess" ) ), uno::UNO_QUERY_THROW );
uno::Reference< ucb::XSimpleFileAccess > xAccess( xServiceFactory->createInstance( "com.sun.star.ucb.SimpleFileAccess" ), uno::UNO_QUERY_THROW );
xIn = xAccess->openFileRead( rMainURL );
}
catch (const uno::Exception &)
......@@ -116,8 +115,7 @@ void ReadThroughDic( const String &rMainURL, ConvDicXMLImport &rImport )
uno::Reference< xml::sax::XParser > xParser;
try
{
xParser = uno::Reference< xml::sax::XParser >( xServiceFactory->createInstance(
A2OU( "com.sun.star.xml.sax.Parser" ) ), UNO_QUERY );
xParser = uno::Reference< xml::sax::XParser >( xServiceFactory->createInstance( "com.sun.star.xml.sax.Parser" ), UNO_QUERY );
}
catch (uno::Exception &)
{
......@@ -269,8 +267,7 @@ void ConvDic::Save()
uno::Reference< io::XStream > xStream;
try
{
uno::Reference< ucb::XSimpleFileAccess > xAccess( xServiceFactory->createInstance(
A2OU( "com.sun.star.ucb.SimpleFileAccess" ) ), uno::UNO_QUERY_THROW );
uno::Reference< ucb::XSimpleFileAccess > xAccess( xServiceFactory->createInstance( "com.sun.star.ucb.SimpleFileAccess" ), uno::UNO_QUERY_THROW );
xStream = xAccess->openFileReadWrite( aMainURL );
}
catch (const uno::Exception &)
......@@ -289,8 +286,7 @@ void ConvDic::Save()
try
{
xSaxWriter = uno::Reference< io::XActiveDataSource >(
xServiceFactory->createInstance(
OUString("com.sun.star.xml.sax.Writer") ), UNO_QUERY );
xServiceFactory->createInstance( "com.sun.star.xml.sax.Writer" ), UNO_QUERY );
}
catch (uno::Exception &)
{
......@@ -721,7 +717,7 @@ uno::Sequence< OUString > ConvDic::getSupportedServiceNames_Static()
throw()
{
uno::Sequence< OUString > aSNS( 1 );
aSNS.getArray()[0] = A2OU( SN_CONV_DICTIONARY );
aSNS.getArray()[0] = SN_CONV_DICTIONARY ;
return aSNS;
}
......
......@@ -315,7 +315,7 @@ void SAL_CALL ConvDicNameContainer::removeByName( const OUString& rName )
{
::ucbhelper::Content aCnt( aObj.GetMainURL( INetURLObject::NO_DECODE ),
uno::Reference< ::com::sun::star::ucb::XCommandEnvironment > () );
aCnt.executeCommand( OUString("delete"), makeAny( sal_Bool( sal_True ) ) );
aCnt.executeCommand( "delete", makeAny( sal_Bool( sal_True ) ) );
}
catch( ::com::sun::star::ucb::CommandAbortedException& )
{
......@@ -442,8 +442,7 @@ ConvDicNameContainer & ConvDicList::GetNameContainer()
if (!pNameContainer)
{
pNameContainer = new ConvDicNameContainer( *this );
pNameContainer->AddConvDics( GetDictionaryWriteablePath(),
A2OU( CONV_DIC_EXT ) );
pNameContainer->AddConvDics( GetDictionaryWriteablePath(), ::rtl::OUString(CONV_DIC_EXT) );
xNameContainer = pNameContainer;
// access list of text conversion dictionaries to activate
......@@ -462,9 +461,9 @@ ConvDicNameContainer & ConvDicList::GetNameContainer()
// since there is no UI to active/deactivate the dictionaries
// for chinese text conversion they should be activated by default
uno::Reference< XConversionDictionary > xS2TDic(
pNameContainer->GetByName( A2OU("ChineseS2T") ), UNO_QUERY );
pNameContainer->GetByName( "ChineseS2T" ), UNO_QUERY );
uno::Reference< XConversionDictionary > xT2SDic(
pNameContainer->GetByName( A2OU("ChineseT2S") ), UNO_QUERY );
pNameContainer->GetByName( "ChineseT2S" ), UNO_QUERY );
if (xS2TDic.is())
xS2TDic->setActive( sal_True );
if (xT2SDic.is())
......@@ -666,7 +665,7 @@ uno::Sequence< OUString > ConvDicList::getSupportedServiceNames_Static()
throw()
{
uno::Sequence< OUString > aSNS( 1 );
aSNS.getArray()[0] = A2OU( SN_CONV_DICTIONARY_LIST );
aSNS.getArray()[0] = SN_CONV_DICTIONARY_LIST;
return aSNS;
}
......
......@@ -764,7 +764,7 @@ sal_Int32 GrammarCheckingIterator::GetSuggestedEndOfSentence(
uno::Reference< lang::XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory();
if ( xMSF.is() )
xBreakIterator = uno::Reference < i18n::XBreakIterator >( xMSF->createInstance(
::rtl::OUString("com.sun.star.i18n.BreakIterator") ), uno::UNO_QUERY );
"com.sun.star.i18n.BreakIterator" ), uno::UNO_QUERY );
}
sal_Int32 nTextLen = rText.getLength();
sal_Int32 nEndPosition = nTextLen;
......@@ -987,19 +987,19 @@ uno::Reference< util::XChangesBatch > GrammarCheckingIterator::GetUpdateAccess()
if (xMgr.is())
{
xConfigurationProvider = uno::Reference< lang::XMultiServiceFactory > (
xMgr->createInstance( OUString( "com.sun.star.configuration.ConfigurationProvider" ) ),
xMgr->createInstance( "com.sun.star.configuration.ConfigurationProvider" ),
uno::UNO_QUERY_THROW ) ;
}
// get configuration update access
beans::PropertyValue aValue;
aValue.Name = A2OU( "nodepath" );
aValue.Value = uno::makeAny( A2OU("org.openoffice.Office.Linguistic/ServiceManager") );
aValue.Name = "nodepath";
aValue.Value = uno::makeAny( ::rtl::OUString("org.openoffice.Office.Linguistic/ServiceManager") );
uno::Sequence< uno::Any > aProps(1);
aProps[0] <<= aValue;
m_xUpdateAccess = uno::Reference< util::XChangesBatch >(
xConfigurationProvider->createInstanceWithArguments(
A2OU( "com.sun.star.configuration.ConfigurationUpdateAccess" ), aProps ),
"com.sun.star.configuration.ConfigurationUpdateAccess", aProps ),
uno::UNO_QUERY_THROW );
}
catch (uno::Exception &)
......@@ -1019,7 +1019,7 @@ void GrammarCheckingIterator::GetConfiguredGCSvcs_Impl()
{
// get node names (locale iso strings) for configured grammar checkers
uno::Reference< container::XNameAccess > xNA( GetUpdateAccess(), uno::UNO_QUERY_THROW );
xNA.set( xNA->getByName( A2OU("GrammarCheckerList") ), uno::UNO_QUERY_THROW );
xNA.set( xNA->getByName( "GrammarCheckerList" ), uno::UNO_QUERY_THROW );
const uno::Sequence< OUString > aElementNames( xNA->getElementNames() );
const OUString *pElementNames = aElementNames.getConstArray();
......@@ -1138,14 +1138,14 @@ LinguDispatcher::DspType GrammarCheckingIterator::GetDspType() const
static OUString GrammarCheckingIterator_getImplementationName() throw()
{
return A2OU( "com.sun.star.lingu2.ProofreadingIterator" );
return ::rtl::OUString( "com.sun.star.lingu2.ProofreadingIterator" );
}
static uno::Sequence< OUString > GrammarCheckingIterator_getSupportedServiceNames() throw()
{
uno::Sequence< OUString > aSNS( 1 );
aSNS.getArray()[0] = A2OU( SN_GRAMMARCHECKINGITERATOR );
aSNS.getArray()[0] = SN_GRAMMARCHECKINGITERATOR ;
return aSNS;
}
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment