tdf#100726 - Improve readability of OUString concatanations
Improved readability of OUString concatanations. Also removed unused OUStrings "sColor" and "sEntry" from the code. Change-Id: Ie9792f499cd880be72229f8a8c71f05ff8e258b6 Reviewed-on: https://gerrit.libreoffice.org/28375 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
This commit is contained in:
committed by
Michael Stahl
parent
4d6dc9b84b
commit
b7bf1ba213
@@ -280,10 +280,8 @@ static const char aResourceResolverPropName[] = "ResourceResolver";
|
||||
uriRef.set( xFac->parse( aURL ), UNO_QUERY );
|
||||
if ( !uriRef.is() )
|
||||
{
|
||||
OUString errorMsg("DialogProviderImpl::getDialogModel: failed to parse URI: ");
|
||||
errorMsg += aURL;
|
||||
throw IllegalArgumentException( errorMsg,
|
||||
Reference< XInterface >(), 1 );
|
||||
OUString errorMsg = "DialogProviderImpl::getDialogModel: failed to parse URI: " + aURL;
|
||||
throw IllegalArgumentException( errorMsg, Reference< XInterface >(), 1 );
|
||||
}
|
||||
Reference < uri::XVndSunStarExpandUrl > sxUri( uriRef, UNO_QUERY );
|
||||
if( !sxUri.is() )
|
||||
|
@@ -1429,23 +1429,23 @@ Any AnimationExporter::convertAnimateValue( const Any& rSourceValue, const OUStr
|
||||
OUString aP( "," );
|
||||
if ( rSourceValue >>= aHSL )
|
||||
{
|
||||
aDest += "hsl(";
|
||||
aDest += OUString::number( (sal_Int32)( aHSL[ 0 ] / ( 360.0 / 255 ) ) );
|
||||
aDest += aP;
|
||||
aDest += OUString::number( (sal_Int32)( aHSL[ 1 ] * 255.0 ) );
|
||||
aDest += aP;
|
||||
aDest += OUString::number( (sal_Int32)( aHSL[ 2 ] * 255.0 ) );
|
||||
aDest += ")";
|
||||
aDest += "hsl("
|
||||
+ OUString::number( (sal_Int32)( aHSL[ 0 ] / ( 360.0 / 255 ) ) )
|
||||
+ aP
|
||||
+ OUString::number( (sal_Int32)( aHSL[ 1 ] * 255.0 ) )
|
||||
+ aP
|
||||
+ OUString::number( (sal_Int32)( aHSL[ 2 ] * 255.0 ) )
|
||||
+ ")";
|
||||
}
|
||||
else if ( rSourceValue >>= nColor )
|
||||
{
|
||||
aDest += "rgb(";
|
||||
aDest += OUString::number( ( (sal_Int8)nColor ) );
|
||||
aDest += aP;
|
||||
aDest += OUString::number( ( (sal_Int8)( nColor >> 8 ) ) );
|
||||
aDest += aP;
|
||||
aDest += OUString::number( ( (sal_Int8)( nColor >> 16 ) ) );
|
||||
aDest += ")";
|
||||
aDest += "rgb("
|
||||
+ OUString::number( ( (sal_Int8)nColor ) )
|
||||
+ aP
|
||||
+ OUString::number( ( (sal_Int8)( nColor >> 8 ) ) )
|
||||
+ aP
|
||||
+ OUString::number( ( (sal_Int8)( nColor >> 16 ) ) )
|
||||
+ ")";
|
||||
}
|
||||
}
|
||||
else if ( rAttributeName == "FillStyle" )
|
||||
|
@@ -1912,8 +1912,8 @@ void SfxCommonTemplateDialog_Impl::DeleteHdl()
|
||||
SvTreeListEntry* pEntry = pTreeBox ? pTreeBox->FirstSelected() : aFmtLb->FirstSelected();
|
||||
const SfxStyleFamilyItem* pItem = GetFamilyItem_Impl();
|
||||
|
||||
OUString aMsg = SfxResId(STR_DELETE_STYLE_USED).toString();
|
||||
aMsg += SfxResId(STR_DELETE_STYLE).toString();
|
||||
OUString aMsg = SfxResId(STR_DELETE_STYLE_USED).toString()
|
||||
+ SfxResId(STR_DELETE_STYLE).toString();
|
||||
|
||||
while (pEntry)
|
||||
{
|
||||
|
@@ -286,14 +286,12 @@ void getINetPropsFromConfig(stoc_javavm::JVM * pjvm,
|
||||
// read ftp proxy name
|
||||
css::uno::Reference<css::registry::XRegistryKey> ftpProxy_name = xRegistryRootKey->openKey("Settings/ooInetFTPProxyName");
|
||||
if(ftpProxy_name.is() && !ftpProxy_name->getStringValue().isEmpty()) {
|
||||
OUString ftpHost = "ftp.proxyHost=";
|
||||
ftpHost += ftpProxy_name->getStringValue();
|
||||
OUString ftpHost = "ftp.proxyHost=" + ftpProxy_name->getStringValue();
|
||||
|
||||
// read ftp proxy port
|
||||
css::uno::Reference<css::registry::XRegistryKey> ftpProxy_port = xRegistryRootKey->openKey("Settings/ooInetFTPProxyPort");
|
||||
if(ftpProxy_port.is() && ftpProxy_port->getLongValue()) {
|
||||
OUString ftpPort = "ftp.proxyPort=";
|
||||
ftpPort += OUString::number(ftpProxy_port->getLongValue());
|
||||
OUString ftpPort = "ftp.proxyPort=" + OUString::number(ftpProxy_port->getLongValue());
|
||||
|
||||
pjvm->pushProp(ftpHost);
|
||||
pjvm->pushProp(ftpPort);
|
||||
@@ -303,14 +301,12 @@ void getINetPropsFromConfig(stoc_javavm::JVM * pjvm,
|
||||
// read http proxy name
|
||||
css::uno::Reference<css::registry::XRegistryKey> httpProxy_name = xRegistryRootKey->openKey("Settings/ooInetHTTPProxyName");
|
||||
if(httpProxy_name.is() && !httpProxy_name->getStringValue().isEmpty()) {
|
||||
OUString httpHost = "http.proxyHost=";
|
||||
httpHost += httpProxy_name->getStringValue();
|
||||
OUString httpHost = "http.proxyHost=" + httpProxy_name->getStringValue();
|
||||
|
||||
// read http proxy port
|
||||
css::uno::Reference<css::registry::XRegistryKey> httpProxy_port = xRegistryRootKey->openKey("Settings/ooInetHTTPProxyPort");
|
||||
if(httpProxy_port.is() && httpProxy_port->getLongValue()) {
|
||||
OUString httpPort = "http.proxyPort=";
|
||||
httpPort += OUString::number(httpProxy_port->getLongValue());
|
||||
OUString httpPort = "http.proxyPort=" + OUString::number(httpProxy_port->getLongValue());
|
||||
|
||||
pjvm->pushProp(httpHost);
|
||||
pjvm->pushProp(httpPort);
|
||||
@@ -320,14 +316,12 @@ void getINetPropsFromConfig(stoc_javavm::JVM * pjvm,
|
||||
// read https proxy name
|
||||
css::uno::Reference<css::registry::XRegistryKey> httpsProxy_name = xRegistryRootKey->openKey("Settings/ooInetHTTPSProxyName");
|
||||
if(httpsProxy_name.is() && !httpsProxy_name->getStringValue().isEmpty()) {
|
||||
OUString httpsHost = "https.proxyHost=";
|
||||
httpsHost += httpsProxy_name->getStringValue();
|
||||
OUString httpsHost = "https.proxyHost=" + httpsProxy_name->getStringValue();
|
||||
|
||||
// read https proxy port
|
||||
css::uno::Reference<css::registry::XRegistryKey> httpsProxy_port = xRegistryRootKey->openKey("Settings/ooInetHTTPSProxyPort");
|
||||
if(httpsProxy_port.is() && httpsProxy_port->getLongValue()) {
|
||||
OUString httpsPort = "https.proxyPort=";
|
||||
httpsPort += OUString::number(httpsProxy_port->getLongValue());
|
||||
OUString httpsPort = "https.proxyPort=" + OUString::number(httpsProxy_port->getLongValue());
|
||||
|
||||
pjvm->pushProp(httpsHost);
|
||||
pjvm->pushProp(httpsPort);
|
||||
@@ -337,14 +331,12 @@ void getINetPropsFromConfig(stoc_javavm::JVM * pjvm,
|
||||
// read nonProxyHosts
|
||||
css::uno::Reference<css::registry::XRegistryKey> nonProxies_name = xRegistryRootKey->openKey("Settings/ooInetNoProxy");
|
||||
if(nonProxies_name.is() && !nonProxies_name->getStringValue().isEmpty()) {
|
||||
OUString httpNonProxyHosts = "http.nonProxyHosts=";
|
||||
OUString ftpNonProxyHosts = "ftp.nonProxyHosts=";
|
||||
OUString value= nonProxies_name->getStringValue();
|
||||
OUString value = nonProxies_name->getStringValue();
|
||||
// replace the separator ";" by "|"
|
||||
value= value.replace((sal_Unicode)';', (sal_Unicode)'|');
|
||||
value = value.replace((sal_Unicode)';', (sal_Unicode)'|');
|
||||
|
||||
httpNonProxyHosts += value;
|
||||
ftpNonProxyHosts += value;
|
||||
OUString httpNonProxyHosts = "http.nonProxyHosts=" + value;
|
||||
OUString ftpNonProxyHosts = "ftp.nonProxyHosts=" + value;
|
||||
|
||||
pjvm->pushProp(httpNonProxyHosts);
|
||||
pjvm->pushProp(ftpNonProxyHosts);
|
||||
@@ -386,15 +378,15 @@ void getDefaultLocaleFromConfig(
|
||||
country = locale->getStringValue().copy(index + 1);
|
||||
|
||||
if(!language.isEmpty()) {
|
||||
OUString prop("user.language=");
|
||||
prop += language;
|
||||
OUString prop = "user.language="
|
||||
+ language;
|
||||
|
||||
pjvm->pushProp(prop);
|
||||
}
|
||||
|
||||
if(!country.isEmpty()) {
|
||||
OUString prop("user.country=");
|
||||
prop += country;
|
||||
OUString prop = "user.country="
|
||||
+ country;
|
||||
|
||||
pjvm->pushProp(prop);
|
||||
}
|
||||
|
@@ -50,10 +50,10 @@ ItemHolder2::ItemHolder2()
|
||||
if(bMessage)
|
||||
{
|
||||
bMessage = false;
|
||||
OString sMsg("CreateInstance with arguments exception: ");
|
||||
sMsg += OString(rEx.Message.getStr(),
|
||||
rEx.Message.getLength(),
|
||||
RTL_TEXTENCODING_ASCII_US);
|
||||
OString sMsg = "CreateInstance with arguments exception: "
|
||||
+ OString(rEx.Message.getStr(),
|
||||
rEx.Message.getLength(),
|
||||
RTL_TEXTENCODING_ASCII_US);
|
||||
OSL_FAIL(sMsg.getStr());
|
||||
}
|
||||
}
|
||||
|
@@ -166,17 +166,16 @@ uno::Sequence< OUString> GetPropertyNames(const OUString& rScheme)
|
||||
{ RTL_CONSTASCII_USTRINGPARAM("/SQLComment"), false }
|
||||
};
|
||||
int nIndex = 0;
|
||||
OUString sColor = cColor;
|
||||
OUString sBase(cColorSchemes);
|
||||
sBase += utl::wrapConfigurationElementName(rScheme);
|
||||
OUString sBase = cColorSchemes
|
||||
+ utl::wrapConfigurationElementName(rScheme);
|
||||
const int nCount = ColorConfigEntryCount;
|
||||
for(sal_Int32 i = 0; i < 4 * nCount; i+= 4)
|
||||
{
|
||||
OUString sBaseName(sBase);
|
||||
sal_Int32 nPos = i / 4;
|
||||
sBaseName += OUString(cNames[nPos].cName, cNames[nPos].nLength, cNames[nPos].eEncoding);
|
||||
OUString sBaseName = sBase
|
||||
+ OUString(cNames[nPos].cName, cNames[nPos].nLength, cNames[nPos].eEncoding);
|
||||
pNames[nIndex] += sBaseName;
|
||||
pNames[nIndex++] += sColor;
|
||||
pNames[nIndex++] += cColor;
|
||||
if(cNames[nPos].bCanBeVisible)
|
||||
{
|
||||
pNames[nIndex] += sBaseName;
|
||||
|
@@ -253,8 +253,8 @@ void ExtendedColorConfig_Impl::Load(const OUString& rScheme)
|
||||
for(sal_Int32 i = 0;pIter != pEnd;++pIter,++i)
|
||||
{
|
||||
uno::Sequence < OUString > aComponentDisplayNames(1);
|
||||
aComponentDisplayNames[0] = *pIter;
|
||||
aComponentDisplayNames[0] += sDisplayName;
|
||||
aComponentDisplayNames[0] = *pIter
|
||||
+ sDisplayName;
|
||||
uno::Sequence< uno::Any > aComponentDisplayNamesValue = GetProperties( aComponentDisplayNames );
|
||||
OUString sComponentDisplayName;
|
||||
if ( aComponentDisplayNamesValue.getLength() && (aComponentDisplayNamesValue[0] >>= sComponentDisplayName) )
|
||||
@@ -295,8 +295,8 @@ void ExtendedColorConfig_Impl::Load(const OUString& rScheme)
|
||||
} // if(!sScheme.getLength())
|
||||
|
||||
m_sLoadedScheme = sScheme;
|
||||
OUString sBase("ExtendedColorScheme/ColorSchemes/");
|
||||
sBase += sScheme;
|
||||
OUString sBase = "ExtendedColorScheme/ColorSchemes/"
|
||||
+ sScheme;
|
||||
|
||||
bool bFound = ExistsScheme(sScheme);
|
||||
if ( bFound )
|
||||
@@ -335,8 +335,8 @@ void ExtendedColorConfig_Impl::FillComponentColors(uno::Sequence < OUString >& _
|
||||
OUString sComponentName = pIter->copy(pIter->lastIndexOf('/')+1);
|
||||
if ( m_aConfigValues.find(sComponentName) == m_aConfigValues.end() )
|
||||
{
|
||||
OUString sEntry = *pIter;
|
||||
sEntry += sColorEntries;
|
||||
OUString sEntry = *pIter
|
||||
+ sColorEntries;
|
||||
|
||||
uno::Sequence < OUString > aColorNames = GetPropertyNames(sEntry);
|
||||
uno::Sequence < OUString > aDefaultColorNames = aColorNames;
|
||||
@@ -411,25 +411,22 @@ void ExtendedColorConfig_Impl::ImplCommit()
|
||||
return;
|
||||
const OUString sColorEntries("Entries");
|
||||
const OUString sColor("/Color");
|
||||
OUString sBase("ExtendedColorScheme/ColorSchemes/");
|
||||
OUString sBase = "ExtendedColorScheme/ColorSchemes/"
|
||||
+ m_sLoadedScheme;
|
||||
const OUString s_sSep("/");
|
||||
sBase += m_sLoadedScheme;
|
||||
|
||||
TComponents::iterator aIter = m_aConfigValues.begin();
|
||||
TComponents::iterator aEnd = m_aConfigValues.end();
|
||||
for( ;aIter != aEnd;++aIter )
|
||||
{
|
||||
OUString sEntry = aIter->first;
|
||||
sEntry += sColorEntries;
|
||||
|
||||
if ( ConfigItem::AddNode(sBase, aIter->first) )
|
||||
{
|
||||
OUString sNode = sBase;
|
||||
sNode += s_sSep;
|
||||
sNode += aIter->first;
|
||||
OUString sNode = sBase
|
||||
+ s_sSep
|
||||
+ aIter->first
|
||||
//ConfigItem::AddNode(sNode, sColorEntries);
|
||||
sNode += s_sSep;
|
||||
sNode += sColorEntries;
|
||||
+ s_sSep
|
||||
+ sColorEntries;
|
||||
|
||||
uno::Sequence < beans::PropertyValue > aPropValues(aIter->second.first.size());
|
||||
beans::PropertyValue* pPropValues = aPropValues.getArray();
|
||||
|
@@ -59,10 +59,10 @@ ItemHolder2::ItemHolder2()
|
||||
if(bMessage)
|
||||
{
|
||||
bMessage = false;
|
||||
OString sMsg("CreateInstance with arguments exception: ");
|
||||
sMsg += OString(rEx.Message.getStr(),
|
||||
rEx.Message.getLength(),
|
||||
RTL_TEXTENCODING_ASCII_US);
|
||||
OString sMsg = "CreateInstance with arguments exception: "
|
||||
+ OString(rEx.Message.getStr(),
|
||||
rEx.Message.getLength(),
|
||||
RTL_TEXTENCODING_ASCII_US);
|
||||
OSL_FAIL(sMsg.getStr());
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user