Date: prev next · Thread: first prev next last
2013 Archives by date, by thread · List index


Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/3615

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/15/3615/1

Rewrite as a static table of keywords and loop over them

This patch implements a TODO so that new keywords can simply be added to
a static array rather than new "else if" blocks being added one per
keyword

Change-Id: I8aa4ff0f39166014c299783203eb646817b1399c
---
M connectivity/source/drivers/postgresql/pq_connection.cxx
1 file changed, 3 insertions(+), 2 deletions(-)



diff --git a/connectivity/source/drivers/postgresql/pq_connection.cxx 
b/connectivity/source/drivers/postgresql/pq_connection.cxx
index b17ad9f..f0d9e03 100644
--- a/connectivity/source/drivers/postgresql/pq_connection.cxx
+++ b/connectivity/source/drivers/postgresql/pq_connection.cxx
@@ -496,9 +496,10 @@
     for( int i = 0; i < args.getLength() ; ++i )
     {
         bool append = false;
-        for( int j = 0; j < (int) ( sizeof( keyword_list ) / sizeof( char * )); j++)
+//        for( int j = 0; j < (int) ( sizeof( keyword_list ) / sizeof( char * )); j++)
+        for( int j = 0; j < (int) SAL_N_ELEMENTS( keyword_list ); j++)
         {
-            if( args[i].Name.matchIgnoreAsciiCaseAsciiL( keyword_list[j] ))
+            if( args[i].Name.equalsIgnoreAsciiCaseAscii( keyword_list[j] ))
             {
                 keywords.push_back( keyword_list[j], SAL_NO_ACQUIRE );
                 append = true;

-- 
To view, visit https://gerrit.libreoffice.org/3615
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8aa4ff0f39166014c299783203eb646817b1399c
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Anthony Youngman <anthony@youngman.org.uk>


Context


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.