Strip the contents from the current webview in preparation for printing.
| 230 | |
| 231 | // Strip the contents from the current webview in preparation for printing. |
| 232 | QString EmailNote::stripContentsForPrint(QString contents) { |
| 233 | int pos = contents.indexOf("<object"); |
| 234 | while (pos != -1) { |
| 235 | int endPos = contents.indexOf(">", pos); |
| 236 | QString lidString = contents.mid(contents.indexOf("lid=", pos)+5); |
| 237 | lidString = lidString.mid(0,lidString.indexOf("\" ")); |
| 238 | contents = contents.mid(0,pos) + "<img src=\"file://" + |
| 239 | global.fileManager.getTmpDirPath() + lidString + |
| 240 | QString("-print.png\" width=\"10%\" height=\"10%\"></img>")+contents.mid(endPos+1); |
| 241 | |
| 242 | pos = contents.indexOf("<object", endPos); |
| 243 | } |
| 244 | return contents.replace("src=\"file:////", "src=\"/"); |
| 245 | } |
| 246 | |
| 247 | |
| 248 |
no test coverage detected