diff --git a/uppsrc/RichText/EncodeHTML.cpp b/uppsrc/RichText/EncodeHTML.cpp index badbd431a..3e77ee02e 100644 --- a/uppsrc/RichText/EncodeHTML.cpp +++ b/uppsrc/RichText/EncodeHTML.cpp @@ -97,7 +97,7 @@ String HtmlParaStyle(const RichPara::Format& f, Zoom z) String FormatClass(Index& css, const String& fmt) { - return " CLASS=" + FormatIntAlpha(css.FindAdd(fmt) + 1); + return " class=\"" + FormatIntAlpha(css.FindAdd(fmt) + 1) + "\""; } void TabBorder(String& style, const char *txt, int border, Color bordercolor, const RichTable::Format& tf, Zoom z) @@ -122,29 +122,30 @@ String AsHtml(const RichTxt& text, const RichStyles& styles, Index& css, int nx = t.format.column.GetCount(); int ny = t.cell.GetCount(); const RichTable::Format& tf = t.format; - html << ""; + html << "
"; if(tf.before > 0) - html << ""; - html << ""; + html << ""; + html << ""; if (tf.lm > 0) - html << "\r\n"; - html << "\r\n"; + html << "\r\n"; + html << "
"; + html << "
"; String style; style << "border-collapse:collapse;table-layout:auto;" << "border:" << HtmlDotl(tf.frame, z) << " solid " << ColorToHtml(tf.framecolor) << ';'; - html << ""; + html << "
"; int sum = 0; for(int i = 0; i < nx; i++) sum += t.format.column[i]; - html << ""; + html << ""; for(int i = 0; i < nx; i++) - html << ""; + html << ""; + html << ""; html << "\r\n"; for(int i = 0; i < ny; i++) { const Array& r = t.cell[i]; - html << ""; + html << ""; for(int j = 0; j < r.GetCount(); j++) { if(t(i, j)) { const RichCell& c = r[j]; @@ -164,7 +165,7 @@ String AsHtml(const RichTxt& text, const RichStyles& styles, Index& css, case ALIGN_BOTTOM: style << "bottom"; break; } style << ';'; - html << "\r\n"; + html << "\r\n"; } } - html << "\r\n"; + html << "\r\n"; } - html << "
\r\n"; if (tf.rm > 0) - html << "
"; + html << "
"; if(tf.after > 0) - html << ""; - html << "\r\n"; + html << ""; + html << "\r\n"; } else if(text.IsPara(i)) { RichPara p = text.Get(i, styles); if(p.format.ruler) - html << "
"; + html << "
"; String lbl; if(!IsNull(p.format.label)) { lbl = labels.Get(p.format.label, Null); if(lbl.GetCount()) - html << ""; + html << ""; } bool bultext = false; if(p.format.bullet == RichPara::BULLET_TEXT) @@ -205,17 +206,17 @@ String AsHtml(const RichTxt& text, const RichStyles& styles, Index& css, } } if(bultext) { - html << "" - ""; + html << "
" + ""; int q = z * p.format.lm - 8; if(q > 0) - html << Format("", q); - html << Format("", q); + html << Format("\r\n\r\n
\r\n", + html << Format("\r\n", max(z * p.format.indent, 0)); p.format.ruler = p.format.after = p.format.before = p.format.indent = p.format.lm = 0; } - String par = ""; + String par = ""; html << par; for(int i = 0; i < p.part.GetCount(); i++) { const RichPara::Part& part = p.part[i]; @@ -232,10 +233,10 @@ String AsHtml(const RichTxt& text, const RichStyles& styles, Index& css, PNGEncoder png; png.SaveFile(AppendFileName(outdir, name), part.object.ToImage(sz)); if(psz.cx * psz.cy) - html << ""; - html << "\"\""; + html << ""; + html << "\"\""; if(psz.cx * psz.cy) { - html << ""; + html << ""; PNGEncoder png; png.SaveFile(AppendFileName(outdir, lname), part.object.ToImage(psz)); } @@ -260,31 +261,31 @@ String AsHtml(const RichTxt& text, const RichStyles& styles, Index& css, } String endtag; if(!lnk.IsEmpty() && lnk[0] != ':') { - html << ""; - endtag = ""; + html << ""; + endtag = ""; } String cs; if(part.text[0] != 9) cs = HtmlCharStyle(part.format, p.format); if(!cs.IsEmpty()) { - html << ""; - endtag = "" + endtag; + html << ""; + endtag = "" + endtag; } if(part.format.sscript == 1) { - html << ""; - endtag = "" + endtag; + html << ""; + endtag = "" + endtag; } if(part.format.sscript == 2) { - html << ""; - endtag = "" + endtag; + html << ""; + endtag = "" + endtag; } if(part.format.IsStrikeout()) { - html << ""; - endtag = "" + endtag; + html << ""; + endtag = "" + endtag; } if(part.format.capitals) { - html << ""; - endtag << ""; + html << ""; + endtag << ""; } bool spc = false; const wchar *end = part.text.End(); @@ -308,14 +309,14 @@ String AsHtml(const RichTxt& text, const RichStyles& styles, Index& css, if(*s == 9) { if(bultext) { if(!cs.IsEmpty() && part.text[0] != 9) - html << ""; - html << "

"; - html << "
\r\n"; + html << ""; + html << "

"; + html << "
\r\n"; html << par; if(s[1]) { cs = HtmlCharStyle(part.format, p.format); if(!cs.IsEmpty()) - html << ""; + html << ""; } } else @@ -330,11 +331,11 @@ String AsHtml(const RichTxt& text, const RichStyles& styles, Index& css, } if(p.part.GetCount() == 0) html << " "; - html << "

"; + html << "

"; if(bultext) - html << "
"; + html << ""; if(lbl.GetCount()) - html << "
"; + html << ""; html << "\r\n"; } } diff --git a/uppsrc/ide/idebar.cpp b/uppsrc/ide/idebar.cpp index d180babc3..538ae38d8 100644 --- a/uppsrc/ide/idebar.cpp +++ b/uppsrc/ide/idebar.cpp @@ -342,10 +342,10 @@ void Ide::FilePropertiesMenu(Bar& menu) .Help("File properties stored in package"); menu.Add(IsActiveFile(), AK_SAVEENCODING, THISBACK(ChangeCharset)) .Help("Convert actual file to different encoding"); - menu.AddMenu(IsActiveFile(), AK_DIFF, IdeImg::Diff(), THISBACK(Diff)) + menu.AddMenu(IsActiveFile() && !IsFolder(editfile), AK_DIFF, IdeImg::Diff(), THISBACK(Diff)) .Help("Show differences between the project and arbitrary files"); if(IsSvnDir(GetFileFolder(editfile))) - menu.AddMenu(IsActiveFile(), AK_SVNDIFF, IdeImg::Diff(), THISBACK(SvnHistory)) + menu.AddMenu(IsActiveFile() && !IsFolder(editfile), AK_SVNDIFF, IdeImg::Diff(), THISBACK(SvnHistory)) .Help("Show svn history of file"); }