File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1717@implementation CoreWrapper
1818- (bool )translate : (NSString *)inputPath into : (NSString *)outputPath at : (NSNumber *)page with : (NSString *)password {
1919 try {
20- auto translator = odr::TranslationHelper () ;
21- bool opened = translator.open ([inputPath cStringUsingEncoding: NSUTF8StringEncoding]);
20+ odr::TranslationHelper translator ;
21+ bool opened = translator.openOpenDocument ([inputPath cStringUsingEncoding: NSUTF8StringEncoding]);
2222 if (!opened) {
2323 _errorCode = @(-1 );
2424 return false ;
2525 }
2626
27- const odr::FileMeta& meta = translator.getMeta ();
27+ const auto meta = translator.getMeta ();
2828
29- bool decrypted = !meta. encrypted ;
29+ bool decrypted = !meta-> encrypted ;
3030 if (password != nil ) {
3131 decrypted = translator.decrypt ([password cStringUsingEncoding: NSUTF8StringEncoding]);
3232 }
@@ -41,10 +41,10 @@ - (bool)translate:(NSString *)inputPath into:(NSString *)outputPath at:(NSNumber
4141 config.entryCount = 1 ;
4242
4343 NSMutableArray *pageNames = [[NSMutableArray alloc ] init ];
44- if (meta. type == odr::FileType::OPENDOCUMENT_TEXT) {
44+ if (meta-> type == odr::FileType::OPENDOCUMENT_TEXT) {
4545 [pageNames addObject: @" Text document" ];
4646 } else {
47- for (auto page = meta. entries .begin (); page != meta. entries .end (); page++) {
47+ for (auto page = meta-> entries .begin (); page != meta-> entries .end (); page++) {
4848 auto pageName = page->name ;
4949
5050 [pageNames addObject: [NSString stringWithCString: pageName.c_str () encoding: [NSString defaultCStringEncoding ]]];
You can’t perform that action at this time.
0 commit comments