diff --git a/ctl/ctlSQLBox.cpp b/ctl/ctlSQLBox.cpp index 26c8eae..15b3b2b 100644 --- a/ctl/ctlSQLBox.cpp +++ b/ctl/ctlSQLBox.cpp @@ -1843,23 +1843,21 @@ wxString ctlSQLBox::TextToHtml(int start, int end,bool isAddNewLine, const std:: prevColor = tColor; } //str.append(str[k].GetValue()); - l = 1; wxUniChar c = selText[k]; - - if (!c.IsAscii()) l++; + startp=PositionRelative(startp,1); int s = 0; //wxUniChar c = selText[k].GetValue(); - if (c == '\r') { startp = startp + l; k++; continue; }; + if (c == '\r') { k++; continue; }; - if (c == '\n') { lstr += newline; startp = startp + l; k++; continue; }; + if (c == '\n') { lstr += newline; k++; continue; }; if (c == 9) s = 5; if (c == 32) s = 1; - if (c == '<') { lstr+="<"; startp = startp + l; k++; continue; }; - if (c == '>') { lstr+=">"; startp = startp + l; k++; continue; }; - if (c == '&') { lstr+="&"; startp = startp + l; k++; continue; }; + if (c == '<') { lstr+="<"; k++; continue; }; + if (c == '>') { lstr+=">"; k++; continue; }; + if (c == '&') { lstr+="&"; k++; continue; }; if (s > 0) for (int tt = 0; tt < s; tt++) lstr += " "; else lstr += c; - startp = startp + l; k++; + k++; if ((k-1)>=pos) { lenobj--; if (lenobj==0) { diff --git a/ctl/ctlSQLResult.cpp b/ctl/ctlSQLResult.cpp index 99ea7c6..37a9007 100644 --- a/ctl/ctlSQLResult.cpp +++ b/ctl/ctlSQLResult.cpp @@ -343,6 +343,7 @@ struct type_temp_flag { uint8_t colvalue:1; uint8_t colname:1; uint8_t indexrow:1; +uint8_t no_quote:1; }; struct ElementTempl { wxString txt; @@ -366,12 +367,17 @@ wxString ctlSQLResult::GenerateTemplate(wxString &templ,int action) ElementTempl e; bool isvar=false; wxString col; + int startvarpos=0; while (posAppend(MNU_COPY_TABLEHTML, _("Copy table html format"), _("Copy table html format.")); if (body_template.Count()>0) { //MNU_GENERATE_TEMPLATE - wxMenu *submenu = new wxMenu(); + wxMenu *submenu = NULL; //wxString t="begin @obj_id@ end"; int cnt=0; for(int i=0;iGenerateTemplate(body_template[i],1); - if (s=="OK") + wxString s=sqlResult->GenerateTemplate(body_template[i],1); + if (s=="OK") { - cnt++; - submenu->Append(MNU_GENERATESQL+cnt,title_template[i],body_template[i]); - } + if (submenu==NULL) submenu = new wxMenu(); + cnt++; + submenu->Append(MNU_GENERATESQL+cnt,title_template[i],body_template[i]); + } else + SetStatusText(s, STATUSPOS_MSGS); } + if (cnt>0) xmenu->Append(MNU_GENERATESQL,"Generate",submenu); } xmenu->AppendSeparator(); diff --git a/x64/Release/pgAdmin3.exe b/x64/Release/pgAdmin3.exe index 4e0d43c..db73c52 100644 Binary files a/x64/Release/pgAdmin3.exe and b/x64/Release/pgAdmin3.exe differ