Skip to content
This repository was archived by the owner on May 6, 2025. It is now read-only.
Closed
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
28 changes: 17 additions & 11 deletions LauncherOSX/LOXSpineItem.mm
Original file line number Diff line number Diff line change
Expand Up @@ -52,34 +52,40 @@ - (id)initWithSdkSpineItem:(ePub3::SpineItemPtr)sdkSpineItem fromPackage:(LOXPac

auto manifestItem = sdkSpineItem->ManifestItem();
_href = [NSString stringWithUTF8String:manifestItem->BaseHref().c_str()];

_media_type = [NSString stringWithUTF8String:manifestItem->MediaType().c_str()];

_media_overlay_id = [[NSString alloc] initWithUTF8String: manifestItem->MediaOverlayID().c_str()];

_idref = [NSString stringWithUTF8String:str];
_sdkSpineItem = sdkSpineItem;

_page_spread = [self findProperty:@"page-spread-left" withPrefix:@"rendition"];
if([_page_spread length] == 0) {
_page_spread = [self findProperty:@"page-spread-right" withPrefix:@"rendition"];
if([_page_spread length] == 0) {
_page_spread = [self findProperty:@"page-spread-center" withPrefix:@"rendition"];
}
}
_page_spread = [self findProperty:@"page-spread" withOptionalPrefix:@"rendition"];

_rendition_spread = [self findProperty:@"spread" withPrefix:@"rendition"];

_rendition_layout = [self findProperty:@"layout" withPrefix:@"rendition"];

_rendition_flow = [self findProperty:@"flow" withPrefix:@"rendition"];

}

return self;

}

- (NSString *) findProperty:(NSString *)propName withOptionalPrefix:(NSString *)prefix
{
NSString* value = [self findProperty:propName withPrefix:prefix];

if([value length] == 0) {
value = [self findProperty:propName withPrefix:@""];
}

return value;

}

- (NSString *) findProperty:(NSString *)propName withPrefix:(NSString *)prefix
{
auto prop = _sdkSpineItem->PropertyMatching([propName UTF8String], [prefix UTF8String]);
Expand Down
2 changes: 1 addition & 1 deletion readium-sdk