Browse Source

Fix inability to go to a higher page in a book than the next after what has already been displayed.

Fixes books on the Relto bookshelf not remembering their last open page beyond the second.
gotopage
Christian Walther 13 years ago
parent
commit
dd55856ea2
  1. 8
      MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/FeatureLib/pfJournalBook/pfJournalBook.cpp

8
MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/FeatureLib/pfJournalBook/pfJournalBook.cpp

@ -1742,10 +1742,8 @@ void pfJournalBook::IHandleCheckClick( UInt32 idx, pfBookData::WhichSide which )
void pfJournalBook::GoToPage( UInt32 pageNumber ) void pfJournalBook::GoToPage( UInt32 pageNumber )
{ {
// Put us here, but only on an even page (odd pages go on the right, y'know) // Put us here, but only on an even page (odd pages go on the right, y'know)
if (pageNumber < fPageStarts.Count()) // (no need for a range check, going past the end simply puts you on a blank page, able to go backward but not forward)
fCurrentPage = pageNumber & ~0x00000001; fCurrentPage = pageNumber & ~0x00000001;
else
fCurrentPage = 0;
fVisibleLinks.Reset(); fVisibleLinks.Reset();
IRenderPage( fCurrentPage, pfJournalDlgProc::kTagLeftDTMap ); IRenderPage( fCurrentPage, pfJournalDlgProc::kTagLeftDTMap );
IRenderPage( fCurrentPage + 1, pfJournalDlgProc::kTagRightDTMap ); IRenderPage( fCurrentPage + 1, pfJournalDlgProc::kTagRightDTMap );
@ -2602,7 +2600,7 @@ void pfJournalBook::IRenderPage( UInt32 page, UInt32 whichDTMap, hsBool suppress
} }
} }
hsAssert(page < fPageStarts.GetCount(), "UnInitialized page start!"); hsAssert(page < fPageStarts.GetCount() || page > fLastPage, "UnInitialized page start!");
if( page <= fLastPage if( page <= fLastPage
&& page < fPageStarts.GetCount()) // Added this as a crash-prevention bandaid - MT && page < fPageStarts.GetCount()) // Added this as a crash-prevention bandaid - MT
{ {

Loading…
Cancel
Save