<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Well, as I know for HSQL -- and // are equal, so // is like one line
comment in C++. Well,thanks for your work on the other hand :)<br>
<br>
Gabor<br>
<br>
2011. 09. 01. 20:15 keltezéssel, Eike Rathke írta:
<blockquote cite="mid:20110901181500.GL29051@kulungile.erack.de"
type="cite">
<pre wrap="">Hi Jenei,
On Wednesday, 2011-08-31 12:59:06 +0200, Jenei Gábor wrote:
</pre>
<blockquote type="cite">
<pre wrap="">Hello Eike,
I made the changes you said, and I resolved the no linefeed issue
also, I hope it is ok now, and can be pushed, actually for me worked
fine with all types of comments. Also I tried to follow the
principals you said. So, push it if you think there is no need to
correct something.
</pre>
</blockquote>
<pre wrap="">
You're on the right track :-)
First, I have a question because I'm by no means an SQL expert:
</pre>
<blockquote type="cite">
<pre wrap="">+::rtl::OUString delComment(const ::rtl::OUString& sQuery){
[...]
+ for(size_t i=0;i<nQueryLen;i++){
+ if(sCopy[i]=='\"' && !bIsText2 && !bComment) bIsText1=!bIsText1;
+ if(sCopy[i]=='\'' && !bIsText1 && !bComment) bIsText2=!bIsText2;
+ if(sCopy[i]=='\n' && bComment) bComment=false;
+ if(!bIsText1 && !bIsText2 && (i+1)<nQueryLen && sCopy[i]=='-' && sCopy[i+1]=='-') bComment=true;
+ if(!bIsText1 && !bIsText2 && (i+1)<nQueryLen && sCopy[i]=='/' && sCopy[i+1]=='/') bComment=true;
+ if(!bComment) sTemp.append(&sCopy[i],1);
</pre>
</blockquote>
<pre wrap="">
This and the similar loop in getComment() treats also // as comment
leader, I thought only -- is used for "comment until end of line"?
A short web search didn't come up with anything different.
Second, I erred earlier when I talked about the struct with nPos,
I overlooked that doSaveAsDoc() reconstructs the query string with
sTranslatedStmt = m_xComposer->getComposedQuery();
so actually the resulting sTranslatedStmt may be different from the
original m_sStatement and the positions may not match and your previous
approach with searching for LFs would be needed instead. Sorry for
confusion. Just tell me about the // leader and I'll fix things up for
you.
Eike
</pre>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
LibreOffice mailing list
<a class="moz-txt-link-abbreviated" href="mailto:LibreOffice@lists.freedesktop.org">LibreOffice@lists.freedesktop.org</a>
<a class="moz-txt-link-freetext" href="http://lists.freedesktop.org/mailman/listinfo/libreoffice">http://lists.freedesktop.org/mailman/listinfo/libreoffice</a>
</pre>
</blockquote>
<br>
</body>
</html>