Switch to unified view

a/src/internfile/internfile.cpp b/src/internfile/internfile.cpp
...
...
285
    result = df->set_document_string(m_mimetype, data);
285
    result = df->set_document_string(m_mimetype, data);
286
    } else if (df->is_data_input_ok(Dijon::Filter::DOCUMENT_DATA)) {
286
    } else if (df->is_data_input_ok(Dijon::Filter::DOCUMENT_DATA)) {
287
    result = df->set_document_data(m_mimetype, data.c_str(), data.length());
287
    result = df->set_document_data(m_mimetype, data.c_str(), data.length());
288
    } else if (df->is_data_input_ok(Dijon::Filter::DOCUMENT_FILE_NAME)) {
288
    } else if (df->is_data_input_ok(Dijon::Filter::DOCUMENT_FILE_NAME)) {
289
    TempFile temp = dataToTempFile(data, m_mimetype);
289
    TempFile temp = dataToTempFile(data, m_mimetype);
290
  if (temp.isNotNull() && 
290
  if (temp && 
291
        (result = df->set_document_file(m_mimetype, temp->filename()))) {
291
        (result = df->set_document_file(m_mimetype, temp->filename()))) {
292
        m_tmpflgs[m_handlers.size()] = true;
292
        m_tmpflgs[m_handlers.size()] = true;
293
        m_tempfiles.push_back(temp);
293
        m_tempfiles.push_back(temp);
294
    }
294
    }
295
    }
295
    }
...
...
699
    setres = newflt->set_document_string(mimetype, *txt);
699
    setres = newflt->set_document_string(mimetype, *txt);
700
    } else if (newflt->is_data_input_ok(Dijon::Filter::DOCUMENT_DATA)) {
700
    } else if (newflt->is_data_input_ok(Dijon::Filter::DOCUMENT_DATA)) {
701
    setres = newflt->set_document_data(mimetype,txt->c_str(),txt->length());
701
    setres = newflt->set_document_data(mimetype,txt->c_str(),txt->length());
702
    } else if (newflt->is_data_input_ok(Dijon::Filter::DOCUMENT_FILE_NAME)) {
702
    } else if (newflt->is_data_input_ok(Dijon::Filter::DOCUMENT_FILE_NAME)) {
703
    TempFile temp = dataToTempFile(*txt, mimetype);
703
    TempFile temp = dataToTempFile(*txt, mimetype);
704
  if (temp.isNotNull() && 
704
  if (temp && 
705
        (setres = newflt->set_document_file(mimetype, temp->filename()))) {
705
        (setres = newflt->set_document_file(mimetype, temp->filename()))) {
706
        m_tmpflgs[m_handlers.size()] = true;
706
        m_tmpflgs[m_handlers.size()] = true;
707
        m_tempfiles.push_back(temp);
707
        m_tempfiles.push_back(temp);
708
        // Hack here, but really helps perfs: if we happen to
708
        // Hack here, but really helps perfs: if we happen to
709
        // create a temp file for, ie, an image attachment, keep
709
        // create a temp file for, ie, an image attachment, keep
...
...
741
FileInterner::Status FileInterner::internfile(Rcl::Doc& doc, const string& ipath)
741
FileInterner::Status FileInterner::internfile(Rcl::Doc& doc, const string& ipath)
742
{
742
{
743
    LOGDEB(("FileInterner::internfile. ipath [%s]\n", ipath.c_str()));
743
    LOGDEB(("FileInterner::internfile. ipath [%s]\n", ipath.c_str()));
744
744
745
    // Get rid of possible image tempfile from older call
745
    // Get rid of possible image tempfile from older call
746
    m_imgtmp.release();
746
    m_imgtmp.reset();
747
747
748
    if (m_handlers.size() < 1) {
748
    if (m_handlers.size() < 1) {
749
    // Just means the constructor failed
749
    // Just means the constructor failed
750
    LOGDEB(("FileInterner::internfile: no handler: constructor failed\n"));
750
    LOGDEB(("FileInterner::internfile: no handler: constructor failed\n"));
751
    return FIError;
751
    return FIError;