author | paule <paule> | 2007-07-08 08:37:52 (UTC) |
---|---|---|
committer | paule <paule> | 2007-07-08 08:37:52 (UTC) |
commit | b07e25cd398620dafb9ce01982267588645d99a9 (patch) (unidiff) | |
tree | 41e01245b65ff07efce13743a45eefac7923fdcf | |
parent | 4fb748a55cdd77f4bab8dc692ab8ebae62609abe (diff) | |
download | opie-b07e25cd398620dafb9ce01982267588645d99a9.zip opie-b07e25cd398620dafb9ce01982267588645d99a9.tar.gz opie-b07e25cd398620dafb9ce01982267588645d99a9.tar.bz2 |
Fix copying unicode block to clipboard. See bug #1766. Patch from polyonymous.
-rw-r--r-- | noncore/apps/opie-reader/QTReaderApp.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/noncore/apps/opie-reader/QTReaderApp.cpp b/noncore/apps/opie-reader/QTReaderApp.cpp index b985094..4f0f0a1 100644 --- a/noncore/apps/opie-reader/QTReaderApp.cpp +++ b/noncore/apps/opie-reader/QTReaderApp.cpp | |||
@@ -2465,193 +2465,193 @@ bool QTReaderApp::findNextBookmark(size_t start) | |||
2465 | m_anno = iter.pContent(); | 2465 | m_anno = iter.pContent(); |
2466 | } | 2466 | } |
2467 | break; | 2467 | break; |
2468 | } | 2468 | } |
2469 | } | 2469 | } |
2470 | return found; | 2470 | return found; |
2471 | } | 2471 | } |
2472 | 2472 | ||
2473 | void QTReaderApp::addanno() | 2473 | void QTReaderApp::addanno() |
2474 | { | 2474 | { |
2475 | if (reader->empty()) | 2475 | if (reader->empty()) |
2476 | { | 2476 | { |
2477 | QMessageBox::information(this, PROGNAME, "No file loaded", 1); | 2477 | QMessageBox::information(this, PROGNAME, "No file loaded", 1); |
2478 | } | 2478 | } |
2479 | else | 2479 | else |
2480 | { | 2480 | { |
2481 | m_annoWin->setName(""); | 2481 | m_annoWin->setName(""); |
2482 | m_annoWin->setAnno(""); | 2482 | m_annoWin->setAnno(""); |
2483 | m_annoWin->setPosn(reader->pagelocate()); | 2483 | m_annoWin->setPosn(reader->pagelocate()); |
2484 | m_annoIsEditing = true; | 2484 | m_annoIsEditing = true; |
2485 | editorStack->raiseWidget( m_annoWin ); | 2485 | editorStack->raiseWidget( m_annoWin ); |
2486 | hidetoolbars(); | 2486 | hidetoolbars(); |
2487 | #ifdef USEQPE | 2487 | #ifdef USEQPE |
2488 | Global::showInputMethod(); | 2488 | Global::showInputMethod(); |
2489 | #endif | 2489 | #endif |
2490 | m_annoWin->setFocus(); | 2490 | m_annoWin->setFocus(); |
2491 | } | 2491 | } |
2492 | } | 2492 | } |
2493 | 2493 | ||
2494 | void QTReaderApp::infoClose() | 2494 | void QTReaderApp::infoClose() |
2495 | { | 2495 | { |
2496 | m_debounce = m_buttonprefs->Debounce(); | 2496 | m_debounce = m_buttonprefs->Debounce(); |
2497 | if (m_kmapchanged) | 2497 | if (m_kmapchanged) |
2498 | { | 2498 | { |
2499 | m_kmapchanged = false; | 2499 | m_kmapchanged = false; |
2500 | #ifndef USEQPE | 2500 | #ifndef USEQPE |
2501 | QDir d = QDir::home(); // "/" | 2501 | QDir d = QDir::home(); // "/" |
2502 | d.cd(APPDIR); | 2502 | d.cd(APPDIR); |
2503 | QFileInfo fi(d, ".keymap"); | 2503 | QFileInfo fi(d, ".keymap"); |
2504 | FILE* f = fopen((const char *)fi.absFilePath(), "w"); | 2504 | FILE* f = fopen((const char *)fi.absFilePath(), "w"); |
2505 | #else /* USEQPE */ | 2505 | #else /* USEQPE */ |
2506 | FILE* f = fopen((const char *)Global::applicationFileName(APPDIR,".keymap"), "w"); | 2506 | FILE* f = fopen((const char *)Global::applicationFileName(APPDIR,".keymap"), "w"); |
2507 | #endif /* USEQPE */ | 2507 | #endif /* USEQPE */ |
2508 | if (f != NULL) | 2508 | if (f != NULL) |
2509 | { | 2509 | { |
2510 | uint cnt = KEYMAPVERSION; | 2510 | uint cnt = KEYMAPVERSION; |
2511 | fwrite(&cnt, sizeof(cnt), 1, f); | 2511 | fwrite(&cnt, sizeof(cnt), 1, f); |
2512 | cnt = kmap.count(); | 2512 | cnt = kmap.count(); |
2513 | fwrite(&cnt, sizeof(cnt), 1, f); | 2513 | fwrite(&cnt, sizeof(cnt), 1, f); |
2514 | for (QMap<orKey,int>::Iterator i = kmap.begin(); i != kmap.end(); i++) | 2514 | for (QMap<orKey,int>::Iterator i = kmap.begin(); i != kmap.end(); i++) |
2515 | { | 2515 | { |
2516 | orKey key = i.key(); | 2516 | orKey key = i.key(); |
2517 | int data = i.data(); | 2517 | int data = i.data(); |
2518 | fwrite(&key, sizeof(key), 1, f); | 2518 | fwrite(&key, sizeof(key), 1, f); |
2519 | fwrite(&data, sizeof(data), 1, f); | 2519 | fwrite(&data, sizeof(data), 1, f); |
2520 | qDebug("Saved %s as %u", (const char*)key.text(), data); | 2520 | qDebug("Saved %s as %u", (const char*)key.text(), data); |
2521 | } | 2521 | } |
2522 | fclose(f); | 2522 | fclose(f); |
2523 | } | 2523 | } |
2524 | } | 2524 | } |
2525 | showEditTools(); | 2525 | showEditTools(); |
2526 | } | 2526 | } |
2527 | 2527 | ||
2528 | /* | 2528 | /* |
2529 | void QTReaderApp::fileRevert() | 2529 | void QTReaderApp::fileRevert() |
2530 | { | 2530 | { |
2531 | clear(); | 2531 | clear(); |
2532 | fileOpen(); | 2532 | fileOpen(); |
2533 | } | 2533 | } |
2534 | 2534 | ||
2535 | void QTReaderApp::editCut() | 2535 | void QTReaderApp::editCut() |
2536 | { | 2536 | { |
2537 | #ifndef QT_NO_CLIPBOARD | 2537 | #ifndef QT_NO_CLIPBOARD |
2538 | editor->cut(); | 2538 | editor->cut(); |
2539 | #endif | 2539 | #endif |
2540 | } | 2540 | } |
2541 | */ | 2541 | */ |
2542 | void QTReaderApp::editMark() | 2542 | void QTReaderApp::editMark() |
2543 | { | 2543 | { |
2544 | m_savedpos = reader->pagelocate(); | 2544 | m_savedpos = reader->pagelocate(); |
2545 | } | 2545 | } |
2546 | 2546 | ||
2547 | void QTReaderApp::editCopy() | 2547 | void QTReaderApp::editCopy() |
2548 | { | 2548 | { |
2549 | QClipboard* cb = QApplication::clipboard(); | 2549 | QClipboard* cb = QApplication::clipboard(); |
2550 | QString text; | 2550 | QString text; |
2551 | int ch; | 2551 | int ch; |
2552 | unsigned long currentpos = reader->pagelocate(); | 2552 | unsigned long currentpos = reader->pagelocate(); |
2553 | unsigned long endpos = reader->locate(); | 2553 | unsigned long endpos = reader->locate(); |
2554 | if (m_savedpos == 0xffffffff) | 2554 | if (m_savedpos == 0xffffffff) |
2555 | { | 2555 | { |
2556 | m_savedpos = currentpos; | 2556 | m_savedpos = currentpos; |
2557 | } | 2557 | } |
2558 | reader->jumpto(m_savedpos); | 2558 | reader->jumpto(m_savedpos); |
2559 | while (reader->explocate() < endpos && (ch = reader->getch()) != UEOF) | 2559 | while (reader->explocate() < endpos && (ch = reader->getch()) != UEOF) |
2560 | { | 2560 | { |
2561 | text += ch; | 2561 | text += QChar(ch); |
2562 | } | 2562 | } |
2563 | cb->setText(text); | 2563 | cb->setText(text); |
2564 | reader->locate(currentpos); | 2564 | reader->locate(currentpos); |
2565 | m_savedpos = 0xffffffff; | 2565 | m_savedpos = 0xffffffff; |
2566 | } | 2566 | } |
2567 | 2567 | ||
2568 | void QTReaderApp::gotoStart() | 2568 | void QTReaderApp::gotoStart() |
2569 | { | 2569 | { |
2570 | reader->locate(reader->buffdoc.startSection()); | 2570 | reader->locate(reader->buffdoc.startSection()); |
2571 | } | 2571 | } |
2572 | 2572 | ||
2573 | void QTReaderApp::gotoEnd() | 2573 | void QTReaderApp::gotoEnd() |
2574 | { | 2574 | { |
2575 | reader->dopageup(reader->buffdoc.endSection()); | 2575 | reader->dopageup(reader->buffdoc.endSection()); |
2576 | } | 2576 | } |
2577 | 2577 | ||
2578 | void QTReaderApp::pageup() | 2578 | void QTReaderApp::pageup() |
2579 | { | 2579 | { |
2580 | reader->NavUp(); | 2580 | reader->NavUp(); |
2581 | } | 2581 | } |
2582 | 2582 | ||
2583 | void QTReaderApp::pagedn() | 2583 | void QTReaderApp::pagedn() |
2584 | { | 2584 | { |
2585 | reader->NavDown(); | 2585 | reader->NavDown(); |
2586 | } | 2586 | } |
2587 | 2587 | ||
2588 | void QTReaderApp::pagemode(bool _b) | 2588 | void QTReaderApp::pagemode(bool _b) |
2589 | { | 2589 | { |
2590 | reader->setpagemode(_b); | 2590 | reader->setpagemode(_b); |
2591 | } | 2591 | } |
2592 | 2592 | ||
2593 | /* | 2593 | /* |
2594 | void QTReaderApp::setspacing() | 2594 | void QTReaderApp::setspacing() |
2595 | { | 2595 | { |
2596 | m_nRegAction = cMonoSpace; | 2596 | m_nRegAction = cMonoSpace; |
2597 | char lcn[20]; | 2597 | char lcn[20]; |
2598 | sprintf(lcn, "%lu", reader->m_charpc); | 2598 | sprintf(lcn, "%lu", reader->m_charpc); |
2599 | regEdit->setText(lcn); | 2599 | regEdit->setText(lcn); |
2600 | do_regedit(); | 2600 | do_regedit(); |
2601 | } | 2601 | } |
2602 | */ | 2602 | */ |
2603 | void QTReaderApp::settarget() | 2603 | void QTReaderApp::settarget() |
2604 | { | 2604 | { |
2605 | m_nRegAction = cSetTarget; | 2605 | m_nRegAction = cSetTarget; |
2606 | QString text = ((m_targetapp.isEmpty()) ? QString("") : m_targetapp) | 2606 | QString text = ((m_targetapp.isEmpty()) ? QString("") : m_targetapp) |
2607 | + "/" | 2607 | + "/" |
2608 | + ((m_targetmsg.isEmpty()) ? QString("") : m_targetmsg); | 2608 | + ((m_targetmsg.isEmpty()) ? QString("") : m_targetmsg); |
2609 | regEdit->setText(text); | 2609 | regEdit->setText(text); |
2610 | do_regedit(); | 2610 | do_regedit(); |
2611 | } | 2611 | } |
2612 | 2612 | ||
2613 | /* | 2613 | /* |
2614 | void QTReaderApp::do_mono(const QString& lcn) | 2614 | void QTReaderApp::do_mono(const QString& lcn) |
2615 | { | 2615 | { |
2616 | bool ok; | 2616 | bool ok; |
2617 | unsigned long ulcn = lcn.toULong(&ok); | 2617 | unsigned long ulcn = lcn.toULong(&ok); |
2618 | if (ok) | 2618 | if (ok) |
2619 | { | 2619 | { |
2620 | reader->m_charpc = ulcn; | 2620 | reader->m_charpc = ulcn; |
2621 | reader->setfont(); | 2621 | reader->setfont(); |
2622 | reader->refresh(); | 2622 | reader->refresh(); |
2623 | //reader->setmono(true); | 2623 | //reader->setmono(true); |
2624 | } | 2624 | } |
2625 | else | 2625 | else |
2626 | QMessageBox::information(this, PROGNAME, "Must be a number"); | 2626 | QMessageBox::information(this, PROGNAME, "Must be a number"); |
2627 | } | 2627 | } |
2628 | */ | 2628 | */ |
2629 | /* | 2629 | /* |
2630 | void QTReaderApp::editPaste() | 2630 | void QTReaderApp::editPaste() |
2631 | { | 2631 | { |
2632 | #ifndef QT_NO_CLIPBOARD | 2632 | #ifndef QT_NO_CLIPBOARD |
2633 | editor->paste(); | 2633 | editor->paste(); |
2634 | #endif | 2634 | #endif |
2635 | } | 2635 | } |
2636 | */ | 2636 | */ |
2637 | 2637 | ||
2638 | void QTReaderApp::editFind() | 2638 | void QTReaderApp::editFind() |
2639 | { | 2639 | { |
2640 | searchStart = reader->pagelocate(); | 2640 | searchStart = reader->pagelocate(); |
2641 | #ifdef __ISEARCH | 2641 | #ifdef __ISEARCH |
2642 | searchStack = new QStack<searchrecord>; | 2642 | searchStack = new QStack<searchrecord>; |
2643 | #endif | 2643 | #endif |
2644 | #ifdef USEQPE | 2644 | #ifdef USEQPE |
2645 | Global::showInputMethod(); | 2645 | Global::showInputMethod(); |
2646 | #endif | 2646 | #endif |
2647 | searchBar->show(); | 2647 | searchBar->show(); |
2648 | searchVisible = TRUE; | 2648 | searchVisible = TRUE; |
2649 | searchEdit->setFocus(); | 2649 | searchEdit->setFocus(); |
2650 | #ifdef __ISEARCH | 2650 | #ifdef __ISEARCH |
2651 | searchStack->push(new searchrecord("",reader->pagelocate())); | 2651 | searchStack->push(new searchrecord("",reader->pagelocate())); |
2652 | #endif | 2652 | #endif |
2653 | } | 2653 | } |
2654 | 2654 | ||
2655 | void QTReaderApp::findNext() | 2655 | void QTReaderApp::findNext() |
2656 | { | 2656 | { |
2657 | // // qDebug("findNext called\n"); | 2657 | // // qDebug("findNext called\n"); |