mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-31 01:11:06 +02:00
CComponentsForm: fix init value of getPageCount()
value is always 1
Origin commit data
------------------
Commit: 52f7c79db8
Author: Thilo Graf <dbt@novatux.de>
Date: 2014-11-07 (Fri, 07 Nov 2014)
This commit is contained in:
@@ -549,14 +549,14 @@ void CComponentsForm::setPageCount(const u_int8_t& pageCount)
|
||||
|
||||
u_int8_t CComponentsForm::getPageCount()
|
||||
{
|
||||
u_int8_t num = 0;
|
||||
u_int8_t num = 1;
|
||||
for(size_t i=0; i<v_cc_items.size(); i++){
|
||||
u_int8_t item_num = v_cc_items[i]->getPageNumber();
|
||||
num = max(item_num, num);
|
||||
}
|
||||
|
||||
//convert type, possible -Wconversion warnings!
|
||||
page_count = static_cast<u_int8_t>(num + 1);
|
||||
page_count = static_cast<u_int8_t>(num);
|
||||
|
||||
return page_count;
|
||||
}
|
||||
|
Reference in New Issue
Block a user