Skip to content

Commit

Permalink
Merge pull request #14 from bibliolabs/develop
Browse files Browse the repository at this point in the history
Fix off by 1 error on CFI generation.  First element is 2 not zero.
  • Loading branch information
AlanQuatermain committed Aug 2, 2013
2 parents a01a58d + 838e80d commit ff45d4c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ePub3/ePub/package.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -869,14 +869,14 @@ const CFI Package::CFIForManifestItem(shared_ptr<ManifestItem> item) const
{
CFI result;
result._components.emplace_back(_spineCFIIndex);
result._components.emplace_back(_Str(IndexOfSpineItemWithIDRef(item->Identifier())*2, "[", item->Identifier(), "]!"));
result._components.emplace_back(_Str((IndexOfSpineItemWithIDRef(item->Identifier())+1)*2, "[", item->Identifier(), "]!"));
return result;
}
const CFI Package::CFIForSpineItem(shared_ptr<SpineItem> item) const
{
CFI result;
result._components.emplace_back(_spineCFIIndex);
result._components.emplace_back(_Str(item->Index()*2, "[", item->Idref(), "]!"));
result._components.emplace_back(_Str((item->Index()+1)*2, "[", item->Idref(), "]!"));
return result;
}
shared_ptr<ManifestItem> Package::ManifestItemForCFI(ePub3::CFI &cfi, CFI* pRemainingCFI) const
Expand Down

0 comments on commit ff45d4c

Please sign in to comment.