Changeset View
Changeset View
Standalone View
Standalone View
generators/epub/converter.cpp
Show First 20 Lines • Show All 375 Lines • ▼ Show 20 Line(s) | 373 | if (epub_tit_curr_valid(tit)) { | |||
---|---|---|---|---|---|
376 | char *label = epub_tit_get_curr_label(tit); | 376 | char *label = epub_tit_get_curr_label(tit); | ||
377 | QTextBlock block = mTextDocument->begin(); // must point somewhere | 377 | QTextBlock block = mTextDocument->begin(); // must point somewhere | ||
378 | 378 | | |||
379 | if (mSectionMap.contains(link)) { | 379 | if (mSectionMap.contains(link)) { | ||
380 | block = mSectionMap.value(link); | 380 | block = mSectionMap.value(link); | ||
381 | } else { // load missing resource | 381 | } else { // load missing resource | ||
382 | char *data = 0; | 382 | char *data = 0; | ||
383 | //epub_get_data can't handle whitespace url encodings | 383 | //epub_get_data can't handle whitespace url encodings | ||
384 | QByteArray ba = link.replace("%20", " ").toLatin1(); | 384 | QByteArray ba = link.replace(QLatin1String("%20"), QLatin1String(" ")).toLatin1(); | ||
385 | const char *clinkClean = ba.data(); | 385 | const char *clinkClean = ba.data(); | ||
386 | int size = epub_get_data(mTextDocument->getEpub(), clinkClean, &data); | 386 | int size = epub_get_data(mTextDocument->getEpub(), clinkClean, &data); | ||
387 | 387 | | |||
388 | if (data) { | 388 | if (data) { | ||
389 | _cursor->insertBlock(); | 389 | _cursor->insertBlock(); | ||
390 | 390 | | |||
391 | // try to load as image and if not load as html | 391 | // try to load as image and if not load as html | ||
392 | block = _cursor->block(); | 392 | block = _cursor->block(); | ||
▲ Show 20 Lines • Show All 66 Lines • Show Last 20 Lines |