mirror of
https://github.com/geometer/FBReaderJ.git
synced 2025-10-03 01:39:18 +02:00
Merge branch 'master' into 2.6-master
This commit is contained in:
commit
efe93ebb52
1 changed files with 6 additions and 1 deletions
|
@ -237,8 +237,13 @@ static jobject createTextModel(JNIEnv *env, jobject javaModel, ZLTextModel &mode
|
|||
return env->PopLocalFrame(textModel);
|
||||
}
|
||||
|
||||
static bool ct_compare(const shared_ptr<ContentsTree> &first, const shared_ptr<ContentsTree> &second) {
|
||||
return first->reference() < second->reference();
|
||||
}
|
||||
|
||||
static void initTOC(JNIEnv *env, jobject javaModel, const ContentsTree &tree) {
|
||||
const std::vector<shared_ptr<ContentsTree> > &children = tree.children();
|
||||
std::vector<shared_ptr<ContentsTree> > children = tree.children();
|
||||
std::sort(children.begin(), children.end(), ct_compare);
|
||||
for (std::vector<shared_ptr<ContentsTree> >::const_iterator it = children.begin(); it != children.end(); ++it) {
|
||||
const ContentsTree &child = **it;
|
||||
JString text(env, child.text());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue