kdelibs/kdelibs-4.6.95-khtml-kde#277457.patch
2011-07-25 23:22:02 +02:00

60 lines
2.5 KiB
Diff

diff -ur kdelibs-4.6.95/khtml/rendering/render_form.cpp kdelibs-4.6.95-khtml-kde#277457/khtml/rendering/render_form.cpp
--- kdelibs-4.6.95/khtml/rendering/render_form.cpp 2011-05-20 22:24:54.000000000 +0200
+++ kdelibs-4.6.95-khtml-kde#277457/khtml/rendering/render_form.cpp 2011-07-25 22:15:51.000000000 +0200
@@ -1012,11 +1012,11 @@
// -----------------------------------------------------------------------------
RenderLineEdit::RenderLineEdit(HTMLInputElementImpl *element)
- : RenderFormElement(element)
+ : RenderFormElement(element), m_blockElementUpdates(false)
{
LineEditWidget *edit = new LineEditWidget(element, view(), view()->widget());
connect(edit,SIGNAL(returnPressed()), this, SLOT(slotReturnPressed()));
- connect(edit,SIGNAL(textEdited(QString)),this,SLOT(slotTextEdited(QString)));
+ connect(edit,SIGNAL(textChanged(QString)),this,SLOT(slotTextChanged(QString)));
if(element->inputType() == HTMLInputElementImpl::PASSWORD)
edit->setEchoMode( QLineEdit::Password );
@@ -1142,9 +1142,11 @@
}
if (element()->value().string() != widget()->text()) {
+ m_blockElementUpdates = true;
int pos = widget()->cursorPosition();
widget()->setText(element()->value().string());
widget()->setCursorPosition(pos);
+ m_blockElementUpdates = false;
}
widget()->setReadOnly(element()->readOnly());
@@ -1153,8 +1155,10 @@
RenderFormElement::updateFromElement();
}
-void RenderLineEdit::slotTextEdited(const QString &string)
+void RenderLineEdit::slotTextChanged(const QString &string)
{
+ if (m_blockElementUpdates) return;
+
// don't use setValue here!
element()->m_value = string;
element()->m_unsubmittedFormChange = true;
diff -ur kdelibs-4.6.95/khtml/rendering/render_form.h kdelibs-4.6.95-khtml-kde#277457/khtml/rendering/render_form.h
--- kdelibs-4.6.95/khtml/rendering/render_form.h 2011-05-20 22:24:54.000000000 +0200
+++ kdelibs-4.6.95-khtml-kde#277457/khtml/rendering/render_form.h 2011-07-25 22:13:41.000000000 +0200
@@ -282,12 +282,13 @@
void setSelectionRange(long start, long end);
public Q_SLOTS:
void slotReturnPressed();
- void slotTextEdited(const QString &string);
+ void slotTextChanged(const QString &string);
protected:
private:
virtual bool isEditable() const { return true; }
virtual bool canHaveBorder() const { return true; }
+ bool m_blockElementUpdates;
};
// -------------------------------------------------------------------------