MCPcopy Create free account
hub / github.com/altairwei/WizNotePlus / WizHTMLInsertTextBeforeBody

Function WizHTMLInsertTextBeforeBody

src/WizCombineNotesDialog.cpp:390–421  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

388}
389
390void WizHTMLInsertTextBeforeBody(QString lpszText, CString& strHTML)
391{
392 BOOL nInserted = FALSE;
393 //
394 ptrdiff_t nPos = WizStrStrI_Pos(strHTML, _T("<body"));
395 //
396 while (nPos >= 0 && nPos < strHTML.length())
397 {
398 if (!WizHTMLIsCommentedOutCode(nPos, strHTML))
399 break;
400 //
401 nPos = WizStrStrI_Pos(strHTML, _T("<body"), nPos + 1);
402 }
403 //
404 if (-1 != nPos)
405 {
406 nPos = WizStrStrI_Pos(strHTML, _T(">"), nPos);
407 if (nPos != -1)
408 {
409 nPos++;
410 //
411 strHTML.insert(int(nPos), lpszText);
412 //
413 nInserted = TRUE;
414 }
415 }
416 //
417 if (!nInserted)
418 {
419 strHTML = CString(lpszText) + strHTML;
420 }
421}
422
423bool WizKMCombineDocumentsToHtmlFile(WizDatabaseManager& dbMgr, const CWizDocumentDataArray& arrayDocument, QString splitter, bool addTitle, QString& strResultFileName, CWizDocumentAttachmentDataArray& arrayAttachment, QString& strError)
424{

Callers 1

Calls 4

WizStrStrI_PosFunction · 0.85
lengthMethod · 0.80
CStringClass · 0.50

Tested by

no test coverage detected