fix 2 glitches in pdf page numer handling
This commit is contained in:
parent
99f36613e8
commit
580615da28
2 changed files with 20 additions and 12 deletions
|
@ -105,7 +105,7 @@ void SnippetsW::init()
|
|||
|
||||
void SnippetsW::linkWasClicked(const QUrl &url)
|
||||
{
|
||||
string ascurl = (const char *)url.toString().toAscii();;
|
||||
string ascurl = (const char *)url.toString().toAscii();
|
||||
LOGDEB(("Snippets::linkWasClicked: [%s]\n", ascurl.c_str()));
|
||||
|
||||
if (ascurl.size() > 3) {
|
||||
|
@ -113,7 +113,10 @@ void SnippetsW::linkWasClicked(const QUrl &url)
|
|||
switch (what) {
|
||||
case 'P':
|
||||
{
|
||||
int page = atoi(ascurl.c_str()+2);
|
||||
string::size_type numpos = ascurl.find_first_of("0123456789");
|
||||
if (numpos == string::npos)
|
||||
return;
|
||||
int page = atoi(ascurl.c_str() + numpos);
|
||||
emit startNativeViewer(m_doc, page);
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue