diff options
author | Juergen Schmidt <jsc@openoffice.org> | 2007-01-02 13:28:56 +0000 |
---|---|---|
committer | Juergen Schmidt <jsc@openoffice.org> | 2007-01-02 13:28:56 +0000 |
commit | 8593aef8b53c868b70be03f23e2856c09c608aa7 (patch) | |
tree | 20438ee8fccb531e6d38d592e5a31e1e9090cd76 /cpputools | |
parent | 94328c4047f623deebde8c4f581c86ea14369971 (diff) |
#i72993# remove some lines of code which does some unnecessary quote checking
Diffstat (limited to 'cpputools')
-rw-r--r-- | cpputools/source/registercomponent/registercomponent.cxx | 53 |
1 files changed, 8 insertions, 45 deletions
diff --git a/cpputools/source/registercomponent/registercomponent.cxx b/cpputools/source/registercomponent/registercomponent.cxx index e7209b1066b7..4ae1d413aa4f 100644 --- a/cpputools/source/registercomponent/registercomponent.cxx +++ b/cpputools/source/registercomponent/registercomponent.cxx @@ -4,9 +4,9 @@ * * $RCSfile: registercomponent.cxx,v $ * - * $Revision: 1.18 $ + * $Revision: 1.19 $ * - * last change: $Author: ihi $ $Date: 2006-12-20 12:21:36 $ + * last change: $Author: jsc $ $Date: 2007-01-02 14:28:56 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -793,53 +793,16 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) if (xImplRegistration.is()) { - const OUString bSlash(OUString(RTL_CONSTASCII_USTRINGPARAM("\\"))); - const OUString tuedle(OUString(RTL_CONSTASCII_USTRINGPARAM("\""))); - const OUString semikolon(OUString(RTL_CONSTASCII_USTRINGPARAM(";"))); - const OUString emptyString(OUString(RTL_CONSTASCII_USTRINGPARAM(""))); - const OUString space(OUString(RTL_CONSTASCII_USTRINGPARAM(" "))); - sal_Int32 index = 0; - sal_Bool quote = sal_False; - sal_Bool inString = sal_False; - - const sal_Unicode * raw_urls = aOptions.sComponentUrls.getStr(); - - OUString tmp_url; - vector<OUString> urls; - // go over the string and parse it, chars can be quoted in strings or with back slash - while(index < aOptions.sComponentUrls.getLength()) - { - if((raw_urls[index] == semikolon.getStr()[0] || - raw_urls[index] == space.getStr()[0]) && !quote && !inString) // a semikolon or space? - { - tmp_url = tmp_url.trim(); - if(tmp_url.getLength()) - urls.push_back(tmp_url); - - tmp_url = emptyString; - } - else if(raw_urls[index] == bSlash.getStr()[0] && !quote) // a back slash? - { - quote = sal_True; - } - else if(raw_urls[index] == tuedle.getStr()[0] && !quote) // begin or end of string? - inString = !inString; - - else // no special handling - { - tmp_url += OUString(raw_urls + index, 1); - quote = sal_False; - } - - ++ index; - } + OUString urlListWithSemikolon = aOptions.sComponentUrls; + do { + OUString aToken = urlListWithSemikolon.getToken( 0, ';', index); + fprintf(stderr, "%s\n", OUStringToOString(aToken, osl_getThreadTextEncoding()).getStr()); + urls.push_back(aToken); + } while ( index >= 0 ); - tmp_url = tmp_url.trim(); - if(tmp_url.getLength()) - urls.push_back(tmp_url); OString sRegName = OUStringToOString( aOptions.sRegName, osl_getThreadTextEncoding() ); if(aOptions.bRegister || aOptions.bRevoke) |