disable_spelling_3.5.patch

来自「konqueror3 embedded版本, KDE环境下的当家浏览器的嵌入式版」· PATCH 代码 · 共 214 行

PATCH
214
字号
--- rendering/render_form.cpp.orig	2005-11-07 09:58:31.000000000 +0100+++ rendering/render_form.cpp	2005-11-30 12:09:39.000000000 +0100@@ -310,18 +310,23 @@ LineEditWidget::LineEditWidget(DOM::HTML     : KLineEdit(parent, "__khtml"), m_input(input), m_view(view), m_spell(0) {     setMouseTracking(true);+#ifndef KHTML_NO_SPELLING     KActionCollection *ac = new KActionCollection(this);     m_spellAction = KStdAction::spelling( this, SLOT( slotCheckSpelling() ), ac );+#endif // KHTML_NO_SPELLING }  LineEditWidget::~LineEditWidget() {+#ifndef KHTML_NO_SPELLING     delete m_spell;     m_spell = 0L;+#endif // KHTML_NO_SPELLING }  void LineEditWidget::slotCheckSpelling() {+#ifndef KHTML_NO_SPELLING     if ( text().isEmpty() ) {         return;     }@@ -332,6 +337,7 @@ void LineEditWidget::slotCheckSpelling()     connect( m_spell, SIGNAL( death() ),this, SLOT( spellCheckerFinished() ) );     connect( m_spell, SIGNAL( misspelling( const QString &, const QStringList &, unsigned int ) ),this, SLOT( spellCheckerMisspelling( const QString &, const QStringList &, unsigned int ) ) );     connect( m_spell, SIGNAL( corrected( const QString &, const QString &, unsigned int ) ),this, SLOT( spellCheckerCorrected( const QString &, const QString &, unsigned int ) ) );+#endif // KHTML_NO_SPELLING }  void LineEditWidget::spellCheckerMisspelling( const QString &_text, const QStringList &, unsigned int pos)@@ -360,8 +366,10 @@ void LineEditWidget::spellCheckerFinishe  void LineEditWidget::slotSpellCheckReady( KSpell *s ) {+#ifndef KHTML_NO_SPELLING     s->check( text() );     connect( s, SIGNAL( done( const QString & ) ), this, SLOT( slotSpellCheckDone( const QString & ) ) );+#endif // KHTML_NO_SPELLING }  void LineEditWidget::slotSpellCheckDone( const QString &s )@@ -387,7 +395,7 @@ QPopupMenu *LineEditWidget::createPopupM         int id = popup->insertItem( SmallIconSet("history_clear"), i18n("Clear &History"), ClearHistory );         popup->setItemEnabled( id, (compObj() && !compObj()->isEmpty()) );     }-+#ifndef KHTML_NO_SPELLING     if (echoMode() == QLineEdit::Normal &&         !isReadOnly()) {         popup->insertSeparator();@@ -395,6 +403,7 @@ QPopupMenu *LineEditWidget::createPopupM         m_spellAction->plug(popup);         m_spellAction->setEnabled( !text().isEmpty() );     }+#endif // KHTML_NO_SPELLING      return popup; }@@ -1228,10 +1237,12 @@ TextAreaWidget::TextAreaWidget(int wrap,     setAutoMask(true);     setMouseTracking(true); +#ifndef KHTML_NO_SPELLING     KActionCollection *ac = new KActionCollection(this);     m_findAction = KStdAction::find( this, SLOT( slotFind() ), ac );     m_findNextAction = KStdAction::findNext( this, SLOT( slotFindNext() ), ac );     m_replaceAction = KStdAction::replace( this, SLOT( slotReplace() ), ac );+#endif // KHTML_NO_SPELLING }  @@ -1256,6 +1267,7 @@ QPopupMenu *TextAreaWidget::createPopupM         return 0L;     } +#ifndef KHTML_NO_SPELLING     if (!isReadOnly()) {         popup->insertSeparator(); @@ -1268,6 +1280,7 @@ QPopupMenu *TextAreaWidget::createPopupM         m_replaceAction->plug(popup);         m_replaceAction->setEnabled( !text().isEmpty() );     }+#endif      return popup; }@@ -1289,6 +1302,7 @@ void TextAreaWidget::slotFindHighlight(c   void TextAreaWidget::slotReplaceText(const QString &text, int replacementIndex, int /*replacedLength*/, int matchedLength) {+#ifndef KHTML_NO_SPELLING     Q_UNUSED(text)     //kdDebug() << "Replace: [" << text << "] ri:" << replacementIndex << " rl:" << replacedLength << " ml:" << matchedLength << endl;     setSelection(m_repPara, replacementIndex, m_repPara, replacementIndex + matchedLength);@@ -1297,11 +1311,13 @@ void TextAreaWidget::slotReplaceText(con     if (m_replace->options() & KReplaceDialog::PromptOnReplace) {         ensureCursorVisible();     }+#endif // KHTML_NO_SPELLING }   void TextAreaWidget::slotDoReplace() {+#ifndef KHTML_NO_SPELLING     if (!m_repDlg) {         // Should really assert()         return;@@ -1329,11 +1345,13 @@ void TextAreaWidget::slotDoReplace()      m_repDlg->close();     slotReplaceNext();+#endif // KHTML_NO_SPELLING }   void TextAreaWidget::slotReplaceNext() {+#ifndef KHTML_NO_SPELLING     if (!m_replace) {         // assert?         return;@@ -1396,11 +1414,13 @@ void TextAreaWidget::slotReplaceNext()     } else {         //m_replace->closeReplaceNextDialog();     }+#endif // KHTML_NO_SPELLING }   void TextAreaWidget::slotDoFind() {+#ifndef KHTML_NO_SPELLING     if (!m_findDlg) {         // Should really assert()         return;@@ -1427,11 +1447,13 @@ void TextAreaWidget::slotDoFind()     m_findDlg->close();     m_find->closeFindNextDialog();     slotFindNext();+#endif // KHTML_NO_SPELLING }   void TextAreaWidget::slotFindNext() {+#ifndef KHTML_NO_SPELLING     if (!m_find) {         // assert?         return;@@ -1484,11 +1506,13 @@ void TextAreaWidget::slotFindNext()     } else {         //m_find->closeFindNextDialog();     }+#endif // KHTML_NO_SPELLING }   void TextAreaWidget::slotFind() {+#ifndef KHTML_NO_SPELLING     if( text().isEmpty() )  // saves having to track the text changes         return; @@ -1499,11 +1523,13 @@ void TextAreaWidget::slotFind()       connect( m_findDlg, SIGNAL(okClicked()), this, SLOT(slotDoFind()) );     }     m_findDlg->show();+#endif // KHTML_NO_SPELLING }   void TextAreaWidget::slotReplace() {+#ifndef KHTML_NO_SPELLING     if( text().isEmpty() )  // saves having to track the text changes         return; @@ -1515,6 +1541,7 @@ void TextAreaWidget::slotReplace()       connect( m_repDlg, SIGNAL(okClicked()), this, SLOT(slotDoReplace()) );     }     m_repDlg->show();+#endif // KHTML_NO_SPELLING }  @@ -1549,7 +1576,9 @@ RenderTextArea::RenderTextArea(HTMLTextA     TextAreaWidget *edit = new TextAreaWidget(element->wrap(), view());     setQWidget(edit);     const KHTMLSettings *settings = view()->part()->settings();+#ifndef KHTML_NO_SPELLING     edit->setCheckSpellingEnabled( settings->autoSpellCheck() );+#endif     edit->setTabChangesFocus( ! settings->allowTabulation() );      connect(edit,SIGNAL(textChanged()),this,SLOT(slotTextChanged()));@@ -1717,9 +1746,11 @@ QString RenderTextArea::text()  void RenderTextArea::highLightWord( unsigned int length, unsigned int pos ) {+#ifndef KHTML_NO_SPELLING     TextAreaWidget* w = static_cast<TextAreaWidget*>(m_widget);     if ( w )         w->highLightWord( length, pos );+#endif // KHTML_NO_SPELLING }  

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?