/** * Handle the mimetype file */ UT_Error IE_Imp_OpenDocument::_handleMimetype () { GsfInput* pInput = gsf_infile_child_by_name(m_pGsfInfile, "mimetype"); if (!pInput) { UT_DEBUGMSG(("Error: didn't get a mimetype. Assuming that it's a" " application/vnd.oasis.opendocument.text document\n")); return UT_OK; } UT_UTF8String mimetype; if (gsf_input_size (pInput) > 0) { mimetype.append( (const char *)gsf_input_read(pInput, gsf_input_size (pInput), NULL), gsf_input_size (pInput)); } UT_Error err = UT_OK; if ((strcmp("application/vnd.oasis.opendocument.text", mimetype.utf8_str()) != 0) && (strcmp("application/vnd.oasis.opendocument.text-template", mimetype.utf8_str()) != 0) && (strcmp("application/vnd.oasis.opendocument.text-web", mimetype.utf8_str()) != 0)) { UT_DEBUGMSG(("*** Unknown mimetype '%s'\n", mimetype.utf8_str())); err = UT_IE_BOGUSDOCUMENT; } g_object_unref (G_OBJECT (pInput)); return err; }
void ODe_AbiDocListenerImpl::_printSpacesOffset(UT_UTF8String& rOutput) { UT_uint8 i; for (i=0; i<m_spacesOffset; i++) { rOutput.append(" ", 1); // Append a space character } }