[Libreoffice-commits] .: 2 commits - cui/source sal/inc tools/inc
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Tue Jan 22 03:27:34 PST 2013
cui/source/dialogs/scriptdlg.cxx | 5 +--
sal/inc/sal/log.hxx | 3 +-
tools/inc/tools/string.hxx | 52 +++++++++++++++++++++++++++++++++++++++
3 files changed, 56 insertions(+), 4 deletions(-)
New commits:
commit b9c21b972ee044e2cfe5e8271ef232738669c7fa
Author: LuboÅ¡ LuÅák <l.lunak at suse.cz>
Date: Tue Jan 22 12:24:54 2013 +0100
refer more explicitly to sal/inc/sal/log-areas.dox for adding new areas
Change-Id: If9eecbf69a4486dcd84d475719aa66f480faea0b
diff --git a/sal/inc/sal/log.hxx b/sal/inc/sal/log.hxx
index bd8d476..71e2d52 100644
--- a/sal/inc/sal/log.hxx
+++ b/sal/inc/sal/log.hxx
@@ -218,7 +218,8 @@ inline char const * unwrapStream(SAL_UNUSED_PARAMETER StreamIgnore const &) {
<segment> ::= [0-9a-z]+
- For a list of areas used see @ref sal_log_areas "SAL debug areas".
+ For a list of areas used see @ref sal_log_areas "SAL debug areas". Whenever
+ you use a new log area, add it to the file sal/inc/sal/log-areas.dox .
Whether these macros generate any log output is controlled in a two-stage
process.
commit 98e90120119360a2b3e92310f98931fce5c12271
Author: LuboÅ¡ LuÅák <l.lunak at suse.cz>
Date: Tue Jan 22 12:24:04 2013 +0100
make fast string concat comparisons non-ambiguous
Follow-up to https://gerrit.libreoffice.org/#/c/1803/ .
Change-Id: I9131854a579ef57e38dfef7faa539bec98fc305b
diff --git a/cui/source/dialogs/scriptdlg.cxx b/cui/source/dialogs/scriptdlg.cxx
index 944ca6f..959f3a1 100644
--- a/cui/source/dialogs/scriptdlg.cxx
+++ b/cui/source/dialogs/scriptdlg.cxx
@@ -910,7 +910,7 @@ void SvxScriptOrgDialog::createEntry( SvTreeListEntry* pEntry )
}
for( sal_Int32 index = 0; index < childNodes.getLength(); index++ )
{
- if (OUString(aNewName+extn) == childNodes[index]->getName())
+ if (aNewName+extn == childNodes[index]->getName())
{
bFound = sal_True;
break;
@@ -939,8 +939,7 @@ void SvxScriptOrgDialog::createEntry( SvTreeListEntry* pEntry )
bValid = sal_True;
for( sal_Int32 index = 0; index < childNodes.getLength(); index++ )
{
- if (OUString(aUserSuppliedName+extn)
- == childNodes[index]->getName())
+ if (aUserSuppliedName+extn == childNodes[index]->getName())
{
bValid = sal_False;
String aError( m_createErrStr );
diff --git a/tools/inc/tools/string.hxx b/tools/inc/tools/string.hxx
index 0adf08c..ce81a61 100644
--- a/tools/inc/tools/string.hxx
+++ b/tools/inc/tools/string.hxx
@@ -355,6 +355,58 @@ inline bool operator!=(::rtl::OUString const& rLeft, UniString const& rRight)
return rLeft != ::rtl::OUString(rRight);
}
+#ifdef RTL_FAST_STRING
+// The above operators make comparisons involving fast string concatenation ambiguous, so provide explicit overloads.
+template< typename T1, typename T2 >
+inline bool operator==( const rtl::OUStringConcat< T1, T2 >& concat, const OUString& str )
+{
+ return OUString( concat ) == str;
+}
+
+template< typename T1, typename T2 >
+inline bool operator!=( const rtl::OUStringConcat< T1, T2 >& concat, const OUString& str )
+{
+ return OUString( concat ) == str;
+}
+
+template< typename T1, typename T2 >
+inline bool operator==( const OUString& str, const rtl::OUStringConcat< T1, T2 >& concat )
+{
+ return str == OUString( concat );
+}
+
+template< typename T1, typename T2 >
+inline bool operator!=( const OUString& str, const rtl::OUStringConcat< T1, T2 >& concat )
+{
+ return str != OUString( concat );
+}
+
+template< typename T1, typename T2 >
+inline bool operator==( const rtl::OUStringConcat< T1, T2 >& concat, const UniString& str )
+{
+ return UniString( concat ) == str;
+}
+
+template< typename T1, typename T2 >
+inline bool operator!=( const rtl::OUStringConcat< T1, T2 >& concat, const UniString& str )
+{
+ return UniString( concat ) == str;
+}
+
+template< typename T1, typename T2 >
+inline bool operator==( const UniString& str, const rtl::OUStringConcat< T1, T2 >& concat )
+{
+ return str == UniString( concat );
+}
+
+template< typename T1, typename T2 >
+inline bool operator!=( const UniString& str, const rtl::OUStringConcat< T1, T2 >& concat )
+{
+ return str != UniString( concat );
+}
+
+#endif
+
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
More information about the Libreoffice-commits
mailing list