File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -47,22 +47,19 @@ - (bool)translate:(NSString *)inputPath into:(NSString *)outputPath with:(NSStri
4747 auto inputPathC = [inputPath cStringUsingEncoding: NSUTF8StringEncoding];
4848 auto inputPathCpp = std::string (inputPathC);
4949
50- odr::FileType fileType ;
50+ std::vector< odr::FileType> fileTypes ;
5151 try {
52- const auto types = odr::OpenDocumentReader::types (inputPathCpp);
52+ fileTypes = odr::OpenDocumentReader::types (inputPathCpp);
5353 if (types.empty ()) {
5454 _errorCode = @(-5 );
5555 return false ;
5656 }
57-
58- fileType = types.back ();
5957 } catch (odr::UnsupportedFileType &e) {
6058 _errorCode = @(-5 );
6159 return false ;
6260 }
6361
64- const auto extensionCpp = odr::OpenDocumentReader::type_to_string (fileType);
65- if (extensionCpp == " pdf" ) {
62+ if (fileTypes.find (odr::FileType::portable_document_format) != fileTypes.end ()) {
6663 _errorCode = @(-5 );
6764 return false ;
6865 }
You can’t perform that action at this time.
0 commit comments