|
a/src/internfile/mh_html.cpp |
|
b/src/internfile/mh_html.cpp |
|
... |
|
... |
32 |
#ifndef NO_NAMESPACES
|
32 |
#ifndef NO_NAMESPACES
|
33 |
using namespace std;
|
33 |
using namespace std;
|
34 |
#endif /* NO_NAMESPACES */
|
34 |
#endif /* NO_NAMESPACES */
|
35 |
|
35 |
|
36 |
|
36 |
|
37 |
bool MimeHandlerHtml::set_document_file(const string &fn)
|
37 |
bool MimeHandlerHtml::set_document_file(const string& mt, const string &fn)
|
38 |
{
|
38 |
{
|
39 |
LOGDEB0(("textHtmlToDoc: %s\n", fn.c_str()));
|
39 |
LOGDEB0(("textHtmlToDoc: %s\n", fn.c_str()));
|
40 |
RecollFilter::set_document_file(fn);
|
40 |
RecollFilter::set_document_file(mt, fn);
|
41 |
string otext;
|
41 |
string otext;
|
42 |
if (!file_to_string(fn, otext)) {
|
42 |
if (!file_to_string(fn, otext)) {
|
43 |
LOGINFO(("textHtmlToDoc: cant read: %s\n", fn.c_str()));
|
43 |
LOGINFO(("textHtmlToDoc: cant read: %s\n", fn.c_str()));
|
44 |
return false;
|
44 |
return false;
|
45 |
}
|
45 |
}
|
46 |
m_filename = fn;
|
46 |
m_filename = fn;
|
47 |
return set_document_string(otext);
|
47 |
return set_document_string(mt, otext);
|
48 |
}
|
48 |
}
|
49 |
|
49 |
|
50 |
bool MimeHandlerHtml::set_document_string(const string& htext)
|
50 |
bool MimeHandlerHtml::set_document_string(const string& mt,
|
|
|
51 |
const string& htext)
|
51 |
{
|
52 |
{
|
|
|
53 |
RecollFilter::set_document_string(mt, htext);
|
52 |
m_html = htext;
|
54 |
m_html = htext;
|
53 |
m_havedoc = true;
|
55 |
m_havedoc = true;
|
54 |
|
56 |
|
55 |
if (!m_forPreview) {
|
57 |
if (!m_forPreview) {
|
56 |
// We want to compute the md5 now because we may modify m_html later
|
58 |
// We want to compute the md5 now because we may modify m_html later
|