https://bugs.documentfoundation.org/show_bug.cgi?id=157260

--- Comment #18 from Julien Nabet <[email protected]> ---
(In reply to Rob from comment #17)
> In python a regex as shown below "seemed to help"
> 
> import re
> var1 = re.sub('\\s*=\\s*','=','host = 10050')
> 
> I am not sure of the equivalent in c/c++

"rURL" is an OUString (a specific type defined in LO) and I don't think there's
regexp mechanism for them (but perhaps I'm wrong).
For just one space, we could also avoid regexp mechanism and use a dumb double
condition
if (pPortNumber && pPortNumber->GetValue() && (rURL.indexOf("port=") == -1) &&
(rURL.indexOf("port =") == -1))

since there's few chance people put more than 1 space and this part of code
doesn't need perf optim.


Also perhaps the right way would be to override "extractHostNamePort" so each
DB implementation (in subdirs connectivity/source/drivers/) would call the
ad-hoc function of DB API (Eg: in Postgresql, there's "PQconninfoParse" method)

I mean why trying to re-create a parser since DBs have already a function to do
it?

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to