diff options
author | Jean-Noël Rouvignac <jn.rouvignac@gmail.com> | 2013-01-30 11:44:23 +0100 |
---|---|---|
committer | Luboš Luňák <l.lunak@suse.cz> | 2013-01-30 12:54:40 +0000 |
commit | 97eb8a6e0eb830f37dcba64a51d725aab4c5ff53 (patch) | |
tree | a1a95b8249052d846a997ad1729758168d6a3b24 /svtools/source | |
parent | f8569cd9a28a3a8856dba4ad53218aa6cc073521 (diff) |
Removed several useless macros: A2OU, A2S, C2U, C2S, OUSTR, OUSTRING
Change-Id: Ie859cb2dfdc7103c379fce56be88eef8fe390afd
Reviewed-on: https://gerrit.libreoffice.org/1924
Tested-by: Luboš Luňák <l.lunak@suse.cz>
Reviewed-by: Luboš Luňák <l.lunak@suse.cz>
Diffstat (limited to 'svtools/source')
-rw-r--r-- | svtools/source/config/colorcfg.cxx | 22 | ||||
-rw-r--r-- | svtools/source/config/fontsubstconfig.cxx | 30 | ||||
-rw-r--r-- | svtools/source/config/htmlcfg.cxx | 6 | ||||
-rw-r--r-- | svtools/source/misc/bindablecontrolhelper.cxx | 26 |
4 files changed, 40 insertions, 44 deletions
diff --git a/svtools/source/config/colorcfg.cxx b/svtools/source/config/colorcfg.cxx index 5389f10e528f..c75a61bb6cc2 100644 --- a/svtools/source/config/colorcfg.cxx +++ b/svtools/source/config/colorcfg.cxx @@ -48,7 +48,7 @@ using ::rtl::OUString; namespace svtools { -#define C2U(cChar) OUString::createFromAscii(cChar) +#define cChar OUString::createFromAscii(cChar) static const sal_Char cColor[] = "/Color"; static const sal_Char cColorSchemes[] = "ColorSchemes/"; sal_Int32 nColorRefCount_Impl = 0; @@ -161,8 +161,8 @@ uno::Sequence< OUString> ColorConfig_Impl::GetPropertyNames(const rtl::OUString& { RTL_CONSTASCII_USTRINGPARAM("/SQLComment"), sal_False } }; int nIndex = 0; - OUString sColor = C2U(cColor); - OUString sBase(C2U(cColorSchemes)); + OUString sColor = cColor; + OUString sBase(cColorSchemes); sBase += utl::wrapConfigurationElementName(rScheme); const int nCount = ColorConfigEntryCount; for(sal_Int32 i = 0; i < 4 * nCount; i+= 4) @@ -183,9 +183,9 @@ uno::Sequence< OUString> ColorConfig_Impl::GetPropertyNames(const rtl::OUString& } ColorConfig_Impl::ColorConfig_Impl(sal_Bool bEditMode) : - ConfigItem(C2U("Office.UI/ColorScheme")), + ConfigItem("Office.UI/ColorScheme"), m_bEditMode(bEditMode), - m_sIsVisible(C2U("/IsVisible")) + m_sIsVisible("/IsVisible") { if(!m_bEditMode) { @@ -215,7 +215,7 @@ void ColorConfig_Impl::Load(const rtl::OUString& rScheme) { //detect current scheme name uno::Sequence < ::rtl::OUString > aCurrent(1); - aCurrent.getArray()[0] = C2U("CurrentColorScheme"); + aCurrent.getArray()[0] = "CurrentColorScheme"; uno::Sequence< uno::Any > aCurrentVal = GetProperties( aCurrent ); aCurrentVal.getConstArray()[0] >>= sScheme; } @@ -274,7 +274,7 @@ void ColorConfig_Impl::Commit() nIndex++; } } - rtl::OUString sNode(C2U("ColorSchemes")); + rtl::OUString sNode("ColorSchemes"); SetSetProperties(sNode, aPropValues); CommitCurrentSchemeName(); @@ -284,7 +284,7 @@ void ColorConfig_Impl::CommitCurrentSchemeName() { //save current scheme name uno::Sequence < ::rtl::OUString > aCurrent(1); - aCurrent.getArray()[0] = C2U("CurrentColorScheme"); + aCurrent.getArray()[0] = "CurrentColorScheme"; uno::Sequence< uno::Any > aCurrentVal(1); aCurrentVal.getArray()[0] <<= m_sLoadedScheme; PutProperties(aCurrent, aCurrentVal); @@ -301,12 +301,12 @@ void ColorConfig_Impl::SetColorConfigValue(ColorConfigEntry eValue, const ColorC uno::Sequence< ::rtl::OUString> ColorConfig_Impl::GetSchemeNames() { - return GetNodeNames(C2U("ColorSchemes")); + return GetNodeNames("ColorSchemes"); } sal_Bool ColorConfig_Impl::AddScheme(const rtl::OUString& rScheme) { - if(ConfigItem::AddNode(C2U("ColorSchemes"), rScheme)) + if(ConfigItem::AddNode("ColorSchemes", rScheme)) { m_sLoadedScheme = rScheme; Commit(); @@ -319,7 +319,7 @@ sal_Bool ColorConfig_Impl::RemoveScheme(const rtl::OUString& rScheme) { uno::Sequence< rtl::OUString > aElements(1); aElements.getArray()[0] = rScheme; - return ClearNodeElements(C2U("ColorSchemes"), aElements); + return ClearNodeElements("ColorSchemes", aElements); } void ColorConfig_Impl::SettingsChanged() diff --git a/svtools/source/config/fontsubstconfig.cxx b/svtools/source/config/fontsubstconfig.cxx index 8f3cc2d7f18a..b70ebffea546 100644 --- a/svtools/source/config/fontsubstconfig.cxx +++ b/svtools/source/config/fontsubstconfig.cxx @@ -34,7 +34,7 @@ using namespace com::sun::star::beans; using ::rtl::OUString; -#define C2U(cChar) OUString::createFromAscii(cChar) +#define cChar OUString::createFromAscii(cChar) const sal_Char cReplacement[] = "Replacement"; const sal_Char cFontPairs[] = "FontPairs"; @@ -59,13 +59,13 @@ SvtFontSubstConfig::SvtFontSubstConfig() : RTL_LOGFILE_CONTEXT(aLog, "svtools SvtFontSubstConfig::SvtFontSubstConfig()"); Sequence<OUString> aNames(1); - aNames.getArray()[0] = C2U(cReplacement); + aNames.getArray()[0] = cReplacement; Sequence<Any> aValues = GetProperties(aNames); DBG_ASSERT(aValues.getConstArray()[0].hasValue(), "no value available"); if(aValues.getConstArray()[0].hasValue()) bIsEnabled = *(sal_Bool*)aValues.getConstArray()[0].getValue(); - OUString sPropPrefix(C2U(cFontPairs)); + OUString sPropPrefix(cFontPairs); Sequence<OUString> aNodeNames = GetNodeNames(sPropPrefix, CONFIG_NAME_LOCAL_PATH); const OUString* pNodeNames = aNodeNames.getConstArray(); Sequence<OUString> aPropNames(aNodeNames.getLength() * 4); @@ -78,10 +78,10 @@ SvtFontSubstConfig::SvtFontSubstConfig() : OUString sStart(sPropPrefix); sStart += pNodeNames[nNode]; sStart += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")); - pNames[nName] = sStart; pNames[nName++] += C2U(cReplaceFont); - pNames[nName] = sStart; pNames[nName++] += C2U(cSubstituteFont); - pNames[nName] = sStart; pNames[nName++] += C2U(cAlways); - pNames[nName] = sStart; pNames[nName++] += C2U(cOnScreenOnly); + pNames[nName] = sStart; pNames[nName++] += cReplaceFont; + pNames[nName] = sStart; pNames[nName++] += cSubstituteFont; + pNames[nName] = sStart; pNames[nName++] += cAlways; + pNames[nName] = sStart; pNames[nName++] += cOnScreenOnly; } Sequence<Any> aNodeValues = GetProperties(aPropNames); const Any* pNodeValues = aNodeValues.getConstArray(); @@ -109,12 +109,12 @@ void SvtFontSubstConfig::Notify( const com::sun::star::uno::Sequence< rtl::OUStr void SvtFontSubstConfig::Commit() { Sequence<OUString> aNames(1); - aNames.getArray()[0] = C2U(cReplacement); + aNames.getArray()[0] = cReplacement; Sequence<Any> aValues(1); aValues.getArray()[0].setValue(&bIsEnabled, ::getBooleanCppuType()); PutProperties(aNames, aValues); - OUString sNode(C2U(cFontPairs)); + OUString sNode(cFontPairs); if(pImpl->aSubstArr.empty()) ClearNodeSet(sNode); else @@ -123,18 +123,18 @@ void SvtFontSubstConfig::Commit() PropertyValue* pSetValues = aSetValues.getArray(); sal_Int32 nSetValue = 0; - const OUString sReplaceFont(C2U(cReplaceFont)); - const OUString sSubstituteFont(C2U(cSubstituteFont)); - const OUString sAlways(C2U(cAlways)); - const OUString sOnScreenOnly(C2U(cOnScreenOnly)); + const OUString sReplaceFont(cReplaceFont); + const OUString sSubstituteFont(cSubstituteFont); + const OUString sAlways(cAlways); + const OUString sOnScreenOnly(cOnScreenOnly); const uno::Type& rBoolType = ::getBooleanCppuType(); for(size_t i = 0; i < pImpl->aSubstArr.size(); i++) { OUString sPrefix(sNode); - sPrefix += C2U("/_"); + sPrefix += "/_"; sPrefix += OUString::valueOf((sal_Int32)i); - sPrefix += C2U("/"); + sPrefix += "/"; SubstitutionStruct& pSubst = pImpl->aSubstArr[i]; pSetValues[nSetValue].Name = sPrefix; pSetValues[nSetValue].Name += sReplaceFont; diff --git a/svtools/source/config/htmlcfg.cxx b/svtools/source/config/htmlcfg.cxx index 1002ccc9cfc6..de0232010d29 100644 --- a/svtools/source/config/htmlcfg.cxx +++ b/svtools/source/config/htmlcfg.cxx @@ -43,7 +43,7 @@ using namespace com::sun::star::uno; using ::rtl::OUString; -#define C2U(cChar) OUString::createFromAscii(cChar) +#define cChar OUString::createFromAscii(cChar) struct HtmlOptions_Impl { @@ -98,13 +98,13 @@ const Sequence<OUString>& SvxHtmlOptions::GetPropertyNames() aNames.realloc(nCount); OUString* pNames = aNames.getArray(); for(int i = 0; i < nCount; i++) - pNames[i] = C2U(aPropNames[i]); + pNames[i] = OUString::createFromAscii(aPropNames[i]); } return aNames; } // ----------------------------------------------------------------------- SvxHtmlOptions::SvxHtmlOptions() : - ConfigItem(C2U("Office.Common/Filter/HTML")) + ConfigItem("Office.Common/Filter/HTML") { pImp = new HtmlOptions_Impl; Load( GetPropertyNames() ); diff --git a/svtools/source/misc/bindablecontrolhelper.cxx b/svtools/source/misc/bindablecontrolhelper.cxx index 9c577477aad7..217272d24477 100644 --- a/svtools/source/misc/bindablecontrolhelper.cxx +++ b/svtools/source/misc/bindablecontrolhelper.cxx @@ -36,11 +36,7 @@ namespace svt { //........................................................................ -#ifndef C2U -#define C2U(cChar) rtl::OUString::createFromAscii(cChar) -#endif - - using namespace ::com::sun::star; +using namespace ::com::sun::star; bool lcl_isNamedRange( const rtl::OUString& sAddress, const uno::Reference< frame::XModel >& xModel, table::CellRangeAddress& aAddress ) { @@ -85,24 +81,24 @@ BindableControlHelper::ApplyListSourceAndBindableData( const com::sun::star::uno // RefCell - convert from XL // pretend we converted the imported string address into the // appropriate address structure - uno::Reference< beans::XPropertySet > xConvertor( xFac->createInstance( C2U( "com.sun.star.table.CellAddressConversion" )), uno::UNO_QUERY ); + uno::Reference< beans::XPropertySet > xConvertor( xFac->createInstance( "com.sun.star.table.CellAddressConversion"), uno::UNO_QUERY ); table::CellAddress aAddress; if ( xConvertor.is() ) { // we need this service to properly convert XL notation also // Should be easy to extend - xConvertor->setPropertyValue( C2U( "XL_A1_Representation" ), uno::makeAny( rsCtrlSource ) ); - xConvertor->getPropertyValue( C2U( "Address" ) ) >>= aAddress; + xConvertor->setPropertyValue( "XL_A1_Representation", uno::makeAny( rsCtrlSource ) ); + xConvertor->getPropertyValue( "Address" ) >>= aAddress; } beans::NamedValue aArg1; - aArg1.Name = C2U("BoundCell"); + aArg1.Name = "BoundCell"; aArg1.Value <<= aAddress; uno::Sequence< uno::Any > aArgs(1); aArgs[ 0 ] <<= aArg1; - uno::Reference< form::binding::XValueBinding > xBinding( xFac->createInstanceWithArguments( C2U("com.sun.star.table.CellValueBinding" ), aArgs ), uno::UNO_QUERY ); + uno::Reference< form::binding::XValueBinding > xBinding( xFac->createInstanceWithArguments( "com.sun.star.table.CellValueBinding", aArgs ), uno::UNO_QUERY ); xBindable->setValueBinding( xBinding ); } else if ( xBindable.is() ) // reset it @@ -115,7 +111,7 @@ BindableControlHelper::ApplyListSourceAndBindableData( const com::sun::star::uno // RefCell - convert from XL // pretend we converted the imported string address into the // appropriate address structure - uno::Reference< beans::XPropertySet > xConvertor( xFac->createInstance( C2U( "com.sun.star.table.CellRangeAddressConversion" )), uno::UNO_QUERY ); + uno::Reference< beans::XPropertySet > xConvertor( xFac->createInstance( "com.sun.star.table.CellRangeAddressConversion"), uno::UNO_QUERY ); table::CellRangeAddress aAddress; if ( xConvertor.is() ) { @@ -123,19 +119,19 @@ BindableControlHelper::ApplyListSourceAndBindableData( const com::sun::star::uno { // we need this service to properly convert XL notation also // Should be easy to extend - xConvertor->setPropertyValue( C2U( "XL_A1_Representation" ), uno::makeAny( rsRowSource ) ); - xConvertor->getPropertyValue( C2U( "Address" ) ) >>= aAddress; + xConvertor->setPropertyValue( "XL_A1_Representation", uno::makeAny( rsRowSource ) ); + xConvertor->getPropertyValue( "Address" ) >>= aAddress; } } beans::NamedValue aArg1; - aArg1.Name = C2U("CellRange"); + aArg1.Name = "CellRange"; aArg1.Value <<= aAddress; uno::Sequence< uno::Any > aArgs(1); aArgs[ 0 ] <<= aArg1; - uno::Reference< form::binding::XListEntrySource > xSource( xFac->createInstanceWithArguments( C2U("com.sun.star.table.CellRangeListSource" ), aArgs ), uno::UNO_QUERY ); + uno::Reference< form::binding::XListEntrySource > xSource( xFac->createInstanceWithArguments( "com.sun.star.table.CellRangeListSource", aArgs ), uno::UNO_QUERY ); xListEntrySink->setListEntrySource( xSource ); } else if ( xListEntrySink.is() ) // reset |