commit c69436f7b76237f2b99a29737dc897fb0a86bfd7
Author: Marcos Paulo de Souza <marcos.souza.org@gmail.com>
Date: Sat Jan 19 10:08:21 2013 -0200
fdo#57950: Remove some chained appends in connectivity and..
... remove some RTL* macros.
Change-Id: I919d17e14334c9220b47775355512df8dfa00bca
Reviewed-on: https://gerrit.libreoffice.org/1768
Reviewed-by: Olivier Hallot <olivier.hallot@alta.org.br>
Tested-by: Olivier Hallot <olivier.hallot@alta.org.br>
diff --git a/connectivity/source/drivers/postgresql/pq_xkeys.cxx
b/connectivity/source/drivers/postgresql/pq_xkeys.cxx
index 314924d..2a8d521 100644
--- a/connectivity/source/drivers/postgresql/pq_xkeys.cxx
+++ b/connectivity/source/drivers/postgresql/pq_xkeys.cxx
@@ -127,58 +126,17 @@ static sal_Int32 string2keytype( const rtl::OUString &type )
static sal_Int32 string2keyrule( const rtl::OUString & rule )
{
sal_Int32 ret = com::sun::star::sdbc::KeyRule::NO_ACTION;
- if( rule.compareToAscii( RTL_CONSTASCII_STRINGPARAM( "r" ) ) == 0 )
+ if( rule == "r" )
ret = com::sun::star::sdbc::KeyRule::RESTRICT;
- else if( rule.compareToAscii( RTL_CONSTASCII_STRINGPARAM( "c" ) ) == 0 )
+ else if( rule == "c" )
ret = com::sun::star::sdbc::KeyRule::CASCADE;
- else if( rule.compareToAscii( RTL_CONSTASCII_STRINGPARAM( "n" ) ) == 0 )
+ else if( rule == "n" )
ret = com::sun::star::sdbc::KeyRule::SET_NULL;
- else if( rule.compareToAscii( RTL_CONSTASCII_STRINGPARAM( "d" ) ) == 0 )
+ else if( rule == "d" )
ret = com::sun::star::sdbc::KeyRule::SET_DEFAULT;
return ret;
}
smells like an incorrect conversion from
rtl::OUString::compareToAscii(asciiStr,maxLength) to operator== rather
than rtl::OUString::startsWith, but then again, given the preceeding
static sal_Int32 string2keytype( const rtl::OUString &type )
{
sal_Int32 ret = com::sun::star::sdbcx::KeyType::UNIQUE;
if ( type == "p" )
ret = com::sun::star::sdbcx::KeyType::PRIMARY;
else if ( type == "f" )
ret = com::sun::star::sdbcx::KeyType::FOREIGN;
return ret;
}
I'm not really sure.
Stephan
Context
- connectivity/source/drivers/postgresql/pq_xkeys.cxx: compareToAscii -> operator== sound? · Stephan Bergmann
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.