comparison src/converter.cpp @ 80:2f81925b0eee

Make html valid and add title
author Andre Heinecke <andre.heinecke@intevation.de>
date Wed, 05 Oct 2016 14:26:03 +0200
parents a8cd9b27e3d5
children f3481e9e44b2
comparison
equal deleted inserted replaced
79:a8cd9b27e3d5 80:2f81925b0eee
240 240
241 /* For the merged cell wordwrap trick. */ 241 /* For the merged cell wordwrap trick. */
242 xlsx.setColumnWidth(26, sum + 1); 242 xlsx.setColumnWidth(26, sum + 1);
243 xlsx.setColumnHidden(26, true); 243 xlsx.setColumnHidden(26, true);
244 244
245 const QString title = mTitle.isEmpty() ? DEFAULT_TITLE : mTitle;
246
245 int row = 1; 247 int row = 1;
246 html << "<html><head><meta http-equiv=\"Content-Type\" content=\"text/html;charset=UTF-8\"/>" 248 html << QStringLiteral("<!DOCTYPE html><html xmlns=\"http://www.w3.org/1999/xhtml\">"
247 "</head><body><table border=\"0\" width:\"100%\">"; 249 "<head><meta http-equiv=\"Content-Type\" content=\"text/html;charset=UTF-8\"/>"
250 "<title>%1</title>"
251 "</head><body><table border=\"0\" width=\"100%\">").arg(title.toHtmlEscaped());
248 html << QStringLiteral("<tr><th width=\"%1%\"></th>").arg(HTML_COL1_PERCENT); 252 html << QStringLiteral("<tr><th width=\"%1%\"></th>").arg(HTML_COL1_PERCENT);
249 html << QStringLiteral("<th width=\"%1%\"></th>").arg(HTML_COL2_PERCENT); 253 html << QStringLiteral("<th width=\"%1%\"></th>").arg(HTML_COL2_PERCENT);
250 html << QStringLiteral("<th width=\"%1%\"></th>").arg(HTML_COL3_PERCENT); 254 html << QStringLiteral("<th width=\"%1%\"></th>").arg(HTML_COL3_PERCENT);
251 255
252 const QString title = mTitle.isEmpty() ? DEFAULT_TITLE : mTitle;
253 // Set the title of the Questionaire 256 // Set the title of the Questionaire
254 xlsx.write(row++, 1, title, mTitleFmt); 257 xlsx.write(row++, 1, title, mTitleFmt);
255 html << mTitleStyle.arg(title.toHtmlEscaped()); 258 html << mTitleStyle.arg(title.toHtmlEscaped());
256 xlsx.mergeCells("A1:C1"); 259 xlsx.mergeCells("A1:C1");
257 xlsx.setRowHeight(1, TITLE_ROW_HEIGHT); 260 xlsx.setRowHeight(1, TITLE_ROW_HEIGHT);
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)