Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions OpenDocumentReader.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,7 @@
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 40;
CURRENT_PROJECT_VERSION = 42;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = 5LS6X97G6J;
ENABLE_BITCODE = NO;
Expand All @@ -616,7 +616,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.33;
MARKETING_VERSION = 1.34;
ONLY_ACTIVE_ARCH = YES;
PRODUCT_BUNDLE_IDENTIFIER = at.tomtasche.reader.lite1;
PRODUCT_NAME = "$(BUNDLE_DISPLAY_NAME)";
Expand Down Expand Up @@ -695,7 +695,7 @@
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 40;
CURRENT_PROJECT_VERSION = 42;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = 5LS6X97G6J;
ENABLE_BITCODE = NO;
Expand All @@ -707,7 +707,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.33;
MARKETING_VERSION = 1.34;
PRODUCT_BUNDLE_IDENTIFIER = at.tomtasche.reader.lite1;
PRODUCT_NAME = "$(BUNDLE_DISPLAY_NAME)";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
Expand Down Expand Up @@ -930,7 +930,7 @@
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 40;
CURRENT_PROJECT_VERSION = 42;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = 5LS6X97G6J;
ENABLE_BITCODE = NO;
Expand All @@ -942,7 +942,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.33;
MARKETING_VERSION = 1.34;
ONLY_ACTIVE_ARCH = YES;
PRODUCT_BUNDLE_IDENTIFIER = "at.tomtasche.reader$(BUNDLE_ID_SUFFIX)";
PRODUCT_NAME = "$(BUNDLE_DISPLAY_NAME)";
Expand All @@ -965,7 +965,7 @@
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 40;
CURRENT_PROJECT_VERSION = 42;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = 5LS6X97G6J;
ENABLE_BITCODE = NO;
Expand All @@ -977,7 +977,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.33;
MARKETING_VERSION = 1.34;
PRODUCT_BUNDLE_IDENTIFIER = "at.tomtasche.reader$(BUNDLE_ID_SUFFIX)";
PRODUCT_NAME = "$(BUNDLE_DISPLAY_NAME)";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
Expand Down
17 changes: 17 additions & 0 deletions OpenDocumentReader/CoreWrapper.mm
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,23 @@ - (bool)translate:(NSString *)inputPath into:(NSString *)outputPath with:(NSStri
auto inputPathC = [inputPath cStringUsingEncoding:NSUTF8StringEncoding];
auto inputPathCpp = std::string(inputPathC);

std::vector<odr::FileType> fileTypes;
try {
fileTypes = odr::OpenDocumentReader::types(inputPathCpp);
if (fileTypes.empty()) {
_errorCode = @(-5);
return false;
}
} catch (odr::UnsupportedFileType &e) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should never throw but it might be a good idea to protect against it

_errorCode = @(-5);
return false;
}

if (std::find(fileTypes.begin(), fileTypes.end(), odr::FileType::portable_document_format) != fileTypes.end()) {
_errorCode = @(-5);
return false;
}

auto outputPathC = [outputPath cStringUsingEncoding:NSUTF8StringEncoding];
auto outputPathCpp = std::string(outputPathC);

Expand Down
118 changes: 59 additions & 59 deletions Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,93 +1,93 @@
PODS:
- Firebase/Analytics (11.2.0):
- Firebase/Analytics (11.7.0):
- Firebase/Core
- Firebase/Core (11.2.0):
- Firebase/Core (11.7.0):
- Firebase/CoreOnly
- FirebaseAnalytics (~> 11.2.0)
- Firebase/CoreOnly (11.2.0):
- FirebaseCore (= 11.2.0)
- Firebase/Crashlytics (11.2.0):
- FirebaseAnalytics (~> 11.7.0)
- Firebase/CoreOnly (11.7.0):
- FirebaseCore (~> 11.7.0)
- Firebase/Crashlytics (11.7.0):
- Firebase/CoreOnly
- FirebaseCrashlytics (~> 11.2.0)
- Firebase/Storage (11.2.0):
- FirebaseCrashlytics (~> 11.7.0)
- Firebase/Storage (11.7.0):
- Firebase/CoreOnly
- FirebaseStorage (~> 11.2.0)
- FirebaseAnalytics (11.2.0):
- FirebaseAnalytics/AdIdSupport (= 11.2.0)
- FirebaseCore (~> 11.0)
- FirebaseStorage (~> 11.7.0)
- FirebaseAnalytics (11.7.0):
- FirebaseAnalytics/AdIdSupport (= 11.7.0)
- FirebaseCore (~> 11.7.0)
- FirebaseInstallations (~> 11.0)
- GoogleUtilities/AppDelegateSwizzler (~> 8.0)
- GoogleUtilities/MethodSwizzler (~> 8.0)
- GoogleUtilities/Network (~> 8.0)
- "GoogleUtilities/NSData+zlib (~> 8.0)"
- nanopb (~> 3.30910.0)
- FirebaseAnalytics/AdIdSupport (11.2.0):
- FirebaseCore (~> 11.0)
- FirebaseAnalytics/AdIdSupport (11.7.0):
- FirebaseCore (~> 11.7.0)
- FirebaseInstallations (~> 11.0)
- GoogleAppMeasurement (= 11.2.0)
- GoogleAppMeasurement (= 11.7.0)
- GoogleUtilities/AppDelegateSwizzler (~> 8.0)
- GoogleUtilities/MethodSwizzler (~> 8.0)
- GoogleUtilities/Network (~> 8.0)
- "GoogleUtilities/NSData+zlib (~> 8.0)"
- nanopb (~> 3.30910.0)
- FirebaseAppCheckInterop (11.2.0)
- FirebaseAuthInterop (11.2.0)
- FirebaseCore (11.2.0):
- FirebaseCoreInternal (~> 11.0)
- FirebaseAppCheckInterop (11.7.0)
- FirebaseAuthInterop (11.7.0)
- FirebaseCore (11.7.0):
- FirebaseCoreInternal (~> 11.7.0)
- GoogleUtilities/Environment (~> 8.0)
- GoogleUtilities/Logger (~> 8.0)
- FirebaseCoreExtension (11.2.0):
- FirebaseCore (~> 11.0)
- FirebaseCoreInternal (11.2.0):
- FirebaseCoreExtension (11.7.0):
- FirebaseCore (~> 11.7.0)
- FirebaseCoreInternal (11.7.0):
- "GoogleUtilities/NSData+zlib (~> 8.0)"
- FirebaseCrashlytics (11.2.0):
- FirebaseCore (~> 11.0)
- FirebaseCrashlytics (11.7.0):
- FirebaseCore (~> 11.7.0)
- FirebaseInstallations (~> 11.0)
- FirebaseRemoteConfigInterop (~> 11.0)
- FirebaseSessions (~> 11.0)
- GoogleDataTransport (~> 10.0)
- GoogleUtilities/Environment (~> 8.0)
- nanopb (~> 3.30910.0)
- PromisesObjC (~> 2.4)
- FirebaseInstallations (11.2.0):
- FirebaseCore (~> 11.0)
- FirebaseInstallations (11.7.0):
- FirebaseCore (~> 11.7.0)
- GoogleUtilities/Environment (~> 8.0)
- GoogleUtilities/UserDefaults (~> 8.0)
- PromisesObjC (~> 2.4)
- FirebaseRemoteConfigInterop (11.2.0)
- FirebaseSessions (11.2.0):
- FirebaseCore (~> 11.0)
- FirebaseCoreExtension (~> 11.0)
- FirebaseRemoteConfigInterop (11.7.0)
- FirebaseSessions (11.7.0):
- FirebaseCore (~> 11.7.0)
- FirebaseCoreExtension (~> 11.7.0)
- FirebaseInstallations (~> 11.0)
- GoogleDataTransport (~> 10.0)
- GoogleUtilities/Environment (~> 8.0)
- GoogleUtilities/UserDefaults (~> 8.0)
- nanopb (~> 3.30910.0)
- PromisesSwift (~> 2.1)
- FirebaseStorage (11.2.0):
- FirebaseStorage (11.7.0):
- FirebaseAppCheckInterop (~> 11.0)
- FirebaseAuthInterop (~> 11.0)
- FirebaseCore (~> 11.0)
- FirebaseCoreExtension (~> 11.0)
- FirebaseCore (~> 11.7.0)
- FirebaseCoreExtension (~> 11.7.0)
- GoogleUtilities/Environment (~> 8.0)
- GTMSessionFetcher/Core (~> 3.4)
- Google-Mobile-Ads-SDK (11.9.0):
- GTMSessionFetcher/Core (< 5.0, >= 3.4)
- Google-Mobile-Ads-SDK (11.13.0):
- GoogleUserMessagingPlatform (>= 1.1)
- GoogleAppMeasurement (11.2.0):
- GoogleAppMeasurement/AdIdSupport (= 11.2.0)
- GoogleAppMeasurement (11.7.0):
- GoogleAppMeasurement/AdIdSupport (= 11.7.0)
- GoogleUtilities/AppDelegateSwizzler (~> 8.0)
- GoogleUtilities/MethodSwizzler (~> 8.0)
- GoogleUtilities/Network (~> 8.0)
- "GoogleUtilities/NSData+zlib (~> 8.0)"
- nanopb (~> 3.30910.0)
- GoogleAppMeasurement/AdIdSupport (11.2.0):
- GoogleAppMeasurement/WithoutAdIdSupport (= 11.2.0)
- GoogleAppMeasurement/AdIdSupport (11.7.0):
- GoogleAppMeasurement/WithoutAdIdSupport (= 11.7.0)
- GoogleUtilities/AppDelegateSwizzler (~> 8.0)
- GoogleUtilities/MethodSwizzler (~> 8.0)
- GoogleUtilities/Network (~> 8.0)
- "GoogleUtilities/NSData+zlib (~> 8.0)"
- nanopb (~> 3.30910.0)
- GoogleAppMeasurement/WithoutAdIdSupport (11.2.0):
- GoogleAppMeasurement/WithoutAdIdSupport (11.7.0):
- GoogleUtilities/AppDelegateSwizzler (~> 8.0)
- GoogleUtilities/MethodSwizzler (~> 8.0)
- GoogleUtilities/Network (~> 8.0)
Expand All @@ -96,7 +96,7 @@ PODS:
- GoogleDataTransport (10.1.0):
- nanopb (~> 3.30910.0)
- PromisesObjC (~> 2.4)
- GoogleUserMessagingPlatform (2.6.0)
- GoogleUserMessagingPlatform (2.7.0)
- GoogleUtilities/AppDelegateSwizzler (8.0.2):
- GoogleUtilities/Environment
- GoogleUtilities/Logger
Expand Down Expand Up @@ -124,7 +124,7 @@ PODS:
- GoogleUtilities/UserDefaults (8.0.2):
- GoogleUtilities/Logger
- GoogleUtilities/Privacy
- GTMSessionFetcher/Core (3.5.0)
- GTMSessionFetcher/Core (4.3.0)
- nanopb (3.30910.0):
- nanopb/decode (= 3.30910.0)
- nanopb/encode (= 3.30910.0)
Expand Down Expand Up @@ -169,29 +169,29 @@ SPEC REPOS:
- ScrollableSegmentedControl

SPEC CHECKSUMS:
Firebase: 98e6bf5278170668a7983e12971a66b2cd57fc8c
FirebaseAnalytics: c36efd5710c60c17558650fa58c2066eca7e9265
FirebaseAppCheckInterop: ea21450529cf0ebd132788dd8916a0269abc684f
FirebaseAuthInterop: 47c09558af5d1b31f16fb352387c72d4804f4a24
FirebaseCore: a282032ae9295c795714ded2ec9c522fc237f8da
FirebaseCoreExtension: cda74ddfb001224bd8fd1d6e74698b4ed07803de
FirebaseCoreInternal: 0c569513412da9f3b31bd0b340013bbee8f295c5
FirebaseCrashlytics: cfc69af5b53565dc6a5e563788809b5778ac4eac
FirebaseInstallations: 771177d89d6c451dc6e50085ec82e2fc77ed0a4a
FirebaseRemoteConfigInterop: 477b26fdeb8fb5fbaf22fa9db5343b42289dc7db
FirebaseSessions: adcec8b72d0066a385e3affcd1bcb1ebb3908ce6
FirebaseStorage: 9353f926690b2329957860abfcbc8b4074fe45e8
Google-Mobile-Ads-SDK: 6a3cdd892fd87c8b2a388c1cc74d2b7df2570f0b
GoogleAppMeasurement: 76d4f8b36b03bd8381fa9a7fe2cc7f99c0a2e93a
Firebase: a64bf6a8546e6eab54f1c715cd6151f39d2329f4
FirebaseAnalytics: bc9e565af9044ba8d6c6e4157e4edca8e5fdf7ec
FirebaseAppCheckInterop: 2376d3ec5cb4267facad4fe754ab4f301a5a519b
FirebaseAuthInterop: a6973d72aa242ea88ffb6be9c9b06c65455071da
FirebaseCore: 3227e35f4197a924206fbcdc0349325baf4f5de4
FirebaseCoreExtension: 206c1b399f0d103055207c16f299b28e3dbd1949
FirebaseCoreInternal: d6c17dafc8dc33614733a8b52df78fcb4394c881
FirebaseCrashlytics: 785a73b624715bbc09a40bb56cdc3829a801cc98
FirebaseInstallations: 9347e719c3d52d8d7b9074b2c32407dd027305e9
FirebaseRemoteConfigInterop: ca12abf9da0003efd3a476b2dff4f7a04fd31b4f
FirebaseSessions: 32ed7a9387ae71efe3a35a7f20f3a7292950957b
FirebaseStorage: d35da127dd49edcbd07b8c07cf651a70161558b2
Google-Mobile-Ads-SDK: 14f57f2dc33532a24db288897e26494640810407
GoogleAppMeasurement: 0471a5b5bff51f3a91b1e76df22c952d04c63967
GoogleDataTransport: aae35b7ea0c09004c3797d53c8c41f66f219d6a7
GoogleUserMessagingPlatform: 0c3a08353e53ce8c2feab7addd0b652cde522450
GoogleUserMessagingPlatform: a8b56893477f67212fbc8411c139e61d463349f5
GoogleUtilities: 26a3abef001b6533cf678d3eb38fd3f614b7872d
GTMSessionFetcher: 5aea5ba6bd522a239e236100971f10cb71b96ab6
GTMSessionFetcher: 257ead9ba8e15a2d389d79496e02b9cc5dd0c62c
nanopb: fad817b59e0457d11a5dfbde799381cd727c1275
PromisesObjC: f5707f49cb48b9636751c5b2e7d227e43fba9f47
PromisesSwift: 9d77319bbe72ebf6d872900551f7eeba9bce2851
ScrollableSegmentedControl: 2e64bbe8968a7fcd8aae5014434481464fcdfe60

PODFILE CHECKSUM: 35cd182dc790891ebc7626066c33a6e947e7167e

COCOAPODS: 1.15.2
COCOAPODS: 1.16.2
Loading