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


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 :)

Gabor

2011. 09. 01. 20:15 keltezéssel, Eike Rathke írta:
Hi Jenei,

On Wednesday, 2011-08-31 12:59:06 +0200, Jenei Gábor wrote:

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.
You're on the right track :-)

First, I have a question because I'm by no means an SQL expert:

+::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);
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



_______________________________________________
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


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.