summaryrefslogtreecommitdiff
path: root/linguistic
diff options
context:
space:
mode:
authorOlivier Hallot <olivier.hallot@alta.org.br>2012-06-03 21:00:18 -0300
committerOlivier Hallot <olivier.hallot@alta.org.br>2012-06-03 21:00:18 -0300
commit793f2404409a5c3a707fa5d0731e034b12f0b431 (patch)
tree0d0ba0484a1371a7685b9a4a0fa416d9b19939ab /linguistic
parent590140e61d159bdc392670cbc303f1ac1a67e8a4 (diff)
targeted string re-work (ii)
Further simplification of d8e3eb234b729e9b3d9b8d81abd27f228fd06687 Change-Id: I2fa695e236cb6dc3be66fc57e7fae167cc368904
Diffstat (limited to 'linguistic')
-rw-r--r--linguistic/source/convdic.cxx14
-rw-r--r--linguistic/source/convdiclist.cxx11
-rw-r--r--linguistic/source/gciterator.cxx16
-rw-r--r--linguistic/source/lngsvcmgr.cxx63
4 files changed, 48 insertions, 56 deletions
diff --git a/linguistic/source/convdic.cxx b/linguistic/source/convdic.cxx
index d5599b058448..5827d1f88985 100644
--- a/linguistic/source/convdic.cxx
+++ b/linguistic/source/convdic.cxx
@@ -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;
}
diff --git a/linguistic/source/convdiclist.cxx b/linguistic/source/convdiclist.cxx
index 39cc442ece9a..101d5830f565 100644
--- a/linguistic/source/convdiclist.cxx
+++ b/linguistic/source/convdiclist.cxx
@@ -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;
}
diff --git a/linguistic/source/gciterator.cxx b/linguistic/source/gciterator.cxx
index 9e4e3dca9eb0..d2c960812451 100644
--- a/linguistic/source/gciterator.cxx
+++ b/linguistic/source/gciterator.cxx
@@ -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;
}
diff --git a/linguistic/source/lngsvcmgr.cxx b/linguistic/source/lngsvcmgr.cxx
index b41dc22f5ae3..b1c8055e8ca9 100644
--- a/linguistic/source/lngsvcmgr.cxx
+++ b/linguistic/source/lngsvcmgr.cxx
@@ -459,7 +459,7 @@ sal_Bool LngSvcMgrListenerHelper::RemoveLngSvcEvtBroadcaster(
LngSvcMgr::LngSvcMgr()
- : utl::ConfigItem(OUString("Office.Linguistic"))
+ : utl::ConfigItem("Office.Linguistic")
, aEvtListeners(GetLinguMutex())
{
bDisposing = sal_False;
@@ -478,10 +478,10 @@ LngSvcMgr::LngSvcMgr()
// request notify events when properties (i.e. something in the subtree) changes
uno::Sequence< OUString > aNames(4);
OUString *pNames = aNames.getArray();
- pNames[0] = A2OU( "ServiceManager/SpellCheckerList" );
- pNames[1] = A2OU( "ServiceManager/GrammarCheckerList" );
- pNames[2] = A2OU( "ServiceManager/HyphenatorList" );
- pNames[3] = A2OU( "ServiceManager/ThesaurusList" );
+ pNames[0] = "ServiceManager/SpellCheckerList";
+ pNames[1] = "ServiceManager/GrammarCheckerList";
+ pNames[2] = "ServiceManager/HyphenatorList";
+ pNames[3] = "ServiceManager/ThesaurusList";
EnableNotification( aNames );
}
@@ -501,10 +501,10 @@ LngSvcMgr::~LngSvcMgr()
void LngSvcMgr::Notify( const uno::Sequence< OUString > &rPropertyNames )
{
- const OUString aSpellCheckerList( A2OU("ServiceManager/SpellCheckerList") );
- const OUString aGrammarCheckerList( A2OU("ServiceManager/GrammarCheckerList") );
- const OUString aHyphenatorList( A2OU("ServiceManager/HyphenatorList") );
- const OUString aThesaurusList( A2OU("ServiceManager/ThesaurusList") );
+ const OUString aSpellCheckerList( "ServiceManager/SpellCheckerList" );
+ const OUString aGrammarCheckerList( "ServiceManager/GrammarCheckerList" );
+ const OUString aHyphenatorList( "ServiceManager/HyphenatorList" );
+ const OUString aThesaurusList( "ServiceManager/ThesaurusList" );
const uno::Sequence< OUString > aSpellCheckerListEntries( GetNodeNames( aSpellCheckerList ) );
const uno::Sequence< OUString > aGrammarCheckerListEntries( GetNodeNames( aGrammarCheckerList ) );
@@ -682,7 +682,7 @@ void LngSvcMgr::GetGrammarCheckerDsp_Impl( sal_Bool bSetSvcList )
uno::Reference< lang::XMultiServiceFactory > xMgr(
comphelper::getProcessServiceFactory(), uno::UNO_QUERY_THROW );
xGCI = uno::Reference< linguistic2::XProofreadingIterator >(
- xMgr->createInstance( A2OU( SN_GRAMMARCHECKINGITERATOR ) ), uno::UNO_QUERY_THROW );
+ xMgr->createInstance( SN_GRAMMARCHECKINGITERATOR ), uno::UNO_QUERY_THROW );
}
catch (uno::Exception &)
{
@@ -737,8 +737,7 @@ void LngSvcMgr::GetAvailableSpellSvcs_Impl()
uno::Reference< container::XContentEnumerationAccess > xEnumAccess( xFac, uno::UNO_QUERY );
uno::Reference< container::XEnumeration > xEnum;
if (xEnumAccess.is())
- xEnum = xEnumAccess->createContentEnumeration(
- A2OU( SN_SPELLCHECKER ) );
+ xEnum = xEnumAccess->createContentEnumeration( SN_SPELLCHECKER );
if (xEnum.is())
{
@@ -756,7 +755,7 @@ void LngSvcMgr::GetAvailableSpellSvcs_Impl()
uno::Reference < uno::XComponentContext > xContext;
uno::Reference< beans::XPropertySet > xProps( xFac, uno::UNO_QUERY );
- xProps->getPropertyValue( OUString( "DefaultContext" )) >>= xContext;
+ xProps->getPropertyValue( "DefaultContext" ) >>= xContext;
xSvc = uno::Reference< linguistic2::XSpellChecker >( ( xCompFactory.is() ? xCompFactory->createInstanceWithContext( xContext ) : xFactory->createInstance() ), uno::UNO_QUERY );
}
catch (const uno::Exception &)
@@ -802,8 +801,7 @@ void LngSvcMgr::GetAvailableGrammarSvcs_Impl()
uno::Reference< container::XContentEnumerationAccess > xEnumAccess( xFac, uno::UNO_QUERY );
uno::Reference< container::XEnumeration > xEnum;
if (xEnumAccess.is())
- xEnum = xEnumAccess->createContentEnumeration(
- A2OU( SN_GRAMMARCHECKER ) );
+ xEnum = xEnumAccess->createContentEnumeration( SN_GRAMMARCHECKER );
if (xEnum.is())
{
@@ -821,7 +819,7 @@ void LngSvcMgr::GetAvailableGrammarSvcs_Impl()
uno::Reference < uno::XComponentContext > xContext;
uno::Reference< beans::XPropertySet > xProps( xFac, uno::UNO_QUERY );
- xProps->getPropertyValue( OUString( "DefaultContext" )) >>= xContext;
+ xProps->getPropertyValue( "DefaultContext" ) >>= xContext;
xSvc = uno::Reference< linguistic2::XProofreader >( ( xCompFactory.is() ? xCompFactory->createInstanceWithContext( xContext ) : xFactory->createInstance() ), uno::UNO_QUERY );
}
catch (const uno::Exception &)
@@ -866,7 +864,7 @@ void LngSvcMgr::GetAvailableHyphSvcs_Impl()
uno::Reference< container::XContentEnumerationAccess > xEnumAccess( xFac, uno::UNO_QUERY );
uno::Reference< container::XEnumeration > xEnum;
if (xEnumAccess.is())
- xEnum = xEnumAccess->createContentEnumeration( A2OU( SN_HYPHENATOR ) );
+ xEnum = xEnumAccess->createContentEnumeration( SN_HYPHENATOR );
if (xEnum.is())
{
@@ -884,7 +882,7 @@ void LngSvcMgr::GetAvailableHyphSvcs_Impl()
uno::Reference < uno::XComponentContext > xContext;
uno::Reference< beans::XPropertySet > xProps( xFac, uno::UNO_QUERY );
- xProps->getPropertyValue( OUString( "DefaultContext" )) >>= xContext;
+ xProps->getPropertyValue( "DefaultContext" ) >>= xContext;
xSvc = uno::Reference< linguistic2::XHyphenator >( ( xCompFactory.is() ? xCompFactory->createInstanceWithContext( xContext ) : xFactory->createInstance() ), uno::UNO_QUERY );
}
@@ -931,8 +929,7 @@ void LngSvcMgr::GetAvailableThesSvcs_Impl()
uno::Reference< container::XContentEnumerationAccess > xEnumAccess( xFac, uno::UNO_QUERY );
uno::Reference< container::XEnumeration > xEnum;
if (xEnumAccess.is())
- xEnum = xEnumAccess->createContentEnumeration(
- A2OU( SN_THESAURUS ) );
+ xEnum = xEnumAccess->createContentEnumeration( SN_THESAURUS );
if (xEnum.is())
{
@@ -951,7 +948,7 @@ void LngSvcMgr::GetAvailableThesSvcs_Impl()
uno::Reference < uno::XComponentContext > xContext;
uno::Reference< beans::XPropertySet > xProps( xFac, uno::UNO_QUERY );
- xProps->getPropertyValue( OUString( "DefaultContext" )) >>= xContext;
+ xProps->getPropertyValue( "DefaultContext" ) >>= xContext;
xSvc = uno::Reference< linguistic2::XThesaurus >( ( xCompFactory.is() ? xCompFactory->createInstanceWithContext( xContext ) : xFactory->createInstance() ), uno::UNO_QUERY );
}
catch (const uno::Exception &)
@@ -1155,7 +1152,7 @@ uno::Reference< linguistic2::XSpellChecker > SAL_CALL
{
osl::MutexGuard aGuard( GetLinguMutex() );
#if OSL_DEBUG_LEVEL > 1
- getAvailableLocales( A2OU( SN_SPELLCHECKER ));
+ getAvailableLocales( SN_SPELLCHECKER );
#endif
uno::Reference< linguistic2::XSpellChecker > xRes;
@@ -1175,7 +1172,7 @@ uno::Reference< linguistic2::XHyphenator > SAL_CALL
{
osl::MutexGuard aGuard( GetLinguMutex() );
#if OSL_DEBUG_LEVEL > 1
- getAvailableLocales( A2OU( SN_HYPHENATOR ));
+ getAvailableLocales( SN_HYPHENATOR );
#endif
uno::Reference< linguistic2::XHyphenator > xRes;
@@ -1195,7 +1192,7 @@ uno::Reference< linguistic2::XThesaurus > SAL_CALL
{
osl::MutexGuard aGuard( GetLinguMutex() );
#if OSL_DEBUG_LEVEL > 1
- getAvailableLocales( A2OU( SN_THESAURUS ));
+ getAvailableLocales( SN_THESAURUS );
#endif
uno::Reference< linguistic2::XThesaurus > xRes;
@@ -1396,7 +1393,7 @@ void SAL_CALL
if (bChanged)
{
pSpellDsp->SetServiceList( rLocale, rServiceImplNames );
- SaveCfgSvcs( A2OU( SN_SPELLCHECKER ) );
+ SaveCfgSvcs( rtl::OUString(SN_SPELLCHECKER) );
if (pListenerHelper && bChanged)
pListenerHelper->AddLngSvcEvt(
@@ -1413,7 +1410,7 @@ void SAL_CALL
if (bChanged)
{
pGrammarDsp->SetServiceList( rLocale, rServiceImplNames );
- SaveCfgSvcs( A2OU( SN_GRAMMARCHECKER ) );
+ SaveCfgSvcs( rtl::OUString(SN_GRAMMARCHECKER) );
if (pListenerHelper && bChanged)
pListenerHelper->AddLngSvcEvt(
@@ -1429,7 +1426,7 @@ void SAL_CALL
if (bChanged)
{
pHyphDsp->SetServiceList( rLocale, rServiceImplNames );
- SaveCfgSvcs( A2OU( SN_HYPHENATOR ) );
+ SaveCfgSvcs( rtl::OUString(SN_HYPHENATOR) );
if (pListenerHelper && bChanged)
pListenerHelper->AddLngSvcEvt(
@@ -1445,7 +1442,7 @@ void SAL_CALL
if (bChanged)
{
pThesDsp->SetServiceList( rLocale, rServiceImplNames );
- SaveCfgSvcs( A2OU( SN_THESAURUS ) );
+ SaveCfgSvcs( rtl::OUString(SN_THESAURUS) );
}
}
}
@@ -1466,28 +1463,28 @@ sal_Bool LngSvcMgr::SaveCfgSvcs( const String &rServiceName )
if (!pSpellDsp)
GetSpellCheckerDsp_Impl();
pDsp = pSpellDsp;
- aLocales = getAvailableLocales( A2OU( SN_SPELLCHECKER ) );
+ aLocales = getAvailableLocales( SN_SPELLCHECKER );
}
else if (0 == rServiceName.CompareToAscii( SN_GRAMMARCHECKER ))
{
if (!pGrammarDsp)
GetGrammarCheckerDsp_Impl();
pDsp = pGrammarDsp;
- aLocales = getAvailableLocales( A2OU( SN_GRAMMARCHECKER ) );
+ aLocales = getAvailableLocales( SN_GRAMMARCHECKER );
}
else if (0 == rServiceName.CompareToAscii( SN_HYPHENATOR ))
{
if (!pHyphDsp)
GetHyphenatorDsp_Impl();
pDsp = pHyphDsp;
- aLocales = getAvailableLocales( A2OU( SN_HYPHENATOR ) );
+ aLocales = getAvailableLocales( SN_HYPHENATOR );
}
else if (0 == rServiceName.CompareToAscii( SN_THESAURUS ))
{
if (!pThesDsp)
GetThesaurusDsp_Impl();
pDsp = pThesDsp;
- aLocales = getAvailableLocales( A2OU( SN_THESAURUS ) );
+ aLocales = getAvailableLocales( SN_THESAURUS );
}
if (pDsp && aLocales.getLength())
@@ -1800,7 +1797,7 @@ uno::Sequence< OUString > LngSvcMgr::getSupportedServiceNames_Static()
osl::MutexGuard aGuard( GetLinguMutex() );
uno::Sequence< OUString > aSNS( 1 ); // more than 1 service possible
- aSNS.getArray()[0] = A2OU( SN_LINGU_SERVCICE_MANAGER );
+ aSNS.getArray()[0] = SN_LINGU_SERVCICE_MANAGER;
return aSNS;
}