summaryrefslogtreecommitdiff
path: root/sw/source/core/tox
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2014-12-17 15:47:01 +0100
committerStephan Bergmann <sbergman@redhat.com>2014-12-17 16:39:33 +0100
commit0f5e9170248df98ef7c7c6d475ff7d2bb9fa2214 (patch)
tree484d55e20e414c16202163b766fdd87777ebb46d /sw/source/core/tox
parent0ba6360363fb73b5b200bbc486ed8eeac5f3d337 (diff)
Introduce rtl::OUStringLiteral1
...to use single ASCII character literals "more directly" in the OUString API (instead of having to go via an intermediary OUString ctor call). Especially useful for character literals that are defined as const variables or via macros ("direct" uses of character literals in the OUString API can often simply be replaced with single-character string literals, for improved readability). (The functions overloaded for OUStringLiteral1 are those that are actually used by the existing LO code; more could potentially be added. The asymmetry in the operator ==/!= parameter types is by design, though---writing code like 'x' == s is an abomination that shall not be abetted.) Change-Id: Ic5264714be7439eed56b5dfca6ccaee277306f1f
Diffstat (limited to 'sw/source/core/tox')
-rw-r--r--sw/source/core/tox/tox.cxx4
-rw-r--r--sw/source/core/tox/txmsrt.cxx6
2 files changed, 5 insertions, 5 deletions
diff --git a/sw/source/core/tox/tox.cxx b/sw/source/core/tox/tox.cxx
index 3e13274be437..146ce53b974c 100644
--- a/sw/source/core/tox/tox.cxx
+++ b/sw/source/core/tox/tox.cxx
@@ -626,9 +626,9 @@ OUString SwFormToken::GetString() const
+ OUString::number( nOutlineLevel );
break;
case TOKEN_TEXT:
- sData += OUString(TOX_STYLE_DELIMITER)
+ sData += OUStringLiteral1<TOX_STYLE_DELIMITER>()
+ sText.replaceAll(OUString(TOX_STYLE_DELIMITER), OUString())
- + OUString(TOX_STYLE_DELIMITER);
+ + OUStringLiteral1<TOX_STYLE_DELIMITER>();
break;
case TOKEN_AUTHORITY:
if (nAuthorityField<10)
diff --git a/sw/source/core/tox/txmsrt.cxx b/sw/source/core/tox/txmsrt.cxx
index 9dd601411c0f..ce75ce98950b 100644
--- a/sw/source/core/tox/txmsrt.cxx
+++ b/sw/source/core/tox/txmsrt.cxx
@@ -586,7 +586,7 @@ OUString SwTOXPara::GetURL() const
SwFrmFmt* pFly = pNd->GetFlyFmt();
if( pFly )
{
- aTxt = "#" + pFly->GetName() + OUString(cMarkSeparator);
+ aTxt = "#" + pFly->GetName() + OUStringLiteral1<cMarkSeparator>();
const sal_Char* pStr;
switch( eType )
{
@@ -602,7 +602,7 @@ OUString SwTOXPara::GetURL() const
break;
case nsSwTOXElement::TOX_SEQUENCE:
{
- aTxt = "#" + m_sSequenceName + OUString(cMarkSeparator)
+ aTxt = "#" + m_sSequenceName + OUStringLiteral1<cMarkSeparator>()
+ "sequence";
}
break;
@@ -654,7 +654,7 @@ OUString SwTOXTable::GetURL() const
if ( sName.isEmpty() )
return OUString();
- return "#" + sName + OUString(cMarkSeparator) + "table";
+ return "#" + sName + OUStringLiteral1<cMarkSeparator>() + "table";
}
SwTOXAuthority::SwTOXAuthority( const SwCntntNode& rNd,