Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 157227 Details for
Bug 244579
kdebase: cannot overwrite/delete marked text in input field of wordpress composer
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Patch provided upstream
textarea-sync.diff (text/plain), 6.45 KB, created by
Roland Wolters
on 2007-06-17 16:41:05 UTC
(
hide
)
Description:
Patch provided upstream
Filename:
MIME Type:
Creator:
Roland Wolters
Created:
2007-06-17 16:41:05 UTC
Size:
6.45 KB
patch
obsolete
>Index: rendering/render_form.cpp >=================================================================== >--- rendering/render_form.cpp (revision 671589) >+++ rendering/render_form.cpp (working copy) >@@ -1603,23 +1603,18 @@ > edit->setTabChangesFocus( ! settings->allowTabulation() ); > > connect(edit,SIGNAL(textChanged()),this,SLOT(slotTextChanged())); >+ >+ setText(element->value().string()); > } > > RenderTextArea::~RenderTextArea() > { >- if ( element()->m_dirtyvalue ) { >- element()->m_value = text(); >- element()->m_dirtyvalue = false; >- } >+ element()->m_value = text(); > } > > void RenderTextArea::handleFocusOut() > { > TextAreaWidget* w = static_cast<TextAreaWidget*>(m_widget); >- if ( w && element()->m_dirtyvalue ) { >- element()->m_value = text(); >- element()->m_dirtyvalue = false; >- } > > if ( w && element()->m_changed ) { > element()->m_changed = false; >@@ -1677,38 +1672,35 @@ > } > } > >-void RenderTextArea::updateFromElement() >+void RenderTextArea::setText(const QString& newText) > { > TextAreaWidget* w = static_cast<TextAreaWidget*>(m_widget); >- w->setReadOnly(element()->readOnly()); >- QString elementText = element()->value().string(); >- if ( elementText != text() ) >- { >+ // When this is called, m_value in the element must have just >+ // been set to new value --- see if we have any work to do >+ if ( newText != text() ) { > w->blockSignals(true); > int line, col; > w->getCursorPosition( &line, &col ); > int cx = w->contentsX(); > int cy = w->contentsY(); >- w->setText( elementText ); >+ w->setText( newText ); > w->setCursorPosition( line, col ); > w->scrollBy( cx, cy ); > w->blockSignals(false); > } >- element()->m_dirtyvalue = false; >- >- RenderFormElement::updateFromElement(); > } > >-void RenderTextArea::close( ) >+void RenderTextArea::updateFromElement() > { >- element()->setValue( element()->defaultValue() ); >- >- RenderFormElement::close(); >+ TextAreaWidget* w = static_cast<TextAreaWidget*>(m_widget); >+ w->setReadOnly(element()->readOnly()); >+ RenderFormElement::updateFromElement(); > } > >- > QString RenderTextArea::text() > { >+ // ### We may want to cache this when physical, since value() no longer caches, >+ // but seeing how text() has always been called on textChanged(), it's probably not needed > QString txt; > TextAreaWidget* w = static_cast<TextAreaWidget*>(m_widget); > >@@ -1833,7 +1825,6 @@ > > void RenderTextArea::slotTextChanged() > { >- element()->m_dirtyvalue = true; > element()->m_changed = true; > if (element()->m_value != text()) > element()->m_unsubmittedFormChange = true; >Index: rendering/render_form.h >=================================================================== >--- rendering/render_form.h (revision 671589) >+++ rendering/render_form.h (working copy) >@@ -460,7 +460,6 @@ > virtual void layout(); > virtual void setStyle(RenderStyle *style); > >- virtual void close ( ); > virtual void updateFromElement(); > > // don't even think about making this method virtual! >@@ -469,6 +468,8 @@ > { return static_cast<DOM::HTMLTextAreaElementImpl*>(RenderObject::element()); } > > QString text(); >+ void setText(const QString& text); >+ > void highLightWord( unsigned int length, unsigned int pos ); > > void select(); >Index: html/html_formimpl.h >=================================================================== >--- html/html_formimpl.h (revision 671589) >+++ html/html_formimpl.h (working copy) >@@ -536,6 +536,7 @@ > ~HTMLTextAreaElementImpl(); > > virtual Id id() const; >+ virtual void childrenChanged(); > > long cols() const { return m_cols; } > >@@ -580,7 +581,6 @@ > WrapMethod m_wrap; > QString m_value; > bool m_changed: 1; //States whether the contents has been editted >- bool m_dirtyvalue: 1; //States whether m_value is out-of-date compared to the renderer or default > bool m_unsubmittedFormChange: 1; > bool m_initialized: 1; > }; >Index: html/html_formimpl.cpp >=================================================================== >--- html/html_formimpl.cpp (revision 671589) >+++ html/html_formimpl.cpp (working copy) >@@ -2638,6 +2638,17 @@ > > // ------------------------------------------------------------------------- > >+/* >+ The rules for storing the value are simple: >+ >+ If there is no renderer, either m_value or defaultValue() is definitive, >+ depending on whether m_initialized is true or not. >+ If there is a renderer, m_render->text() is definitive. During its construction, >+ m_value is initialized if needed, so there is no longer any need to worry >+ about default values or not. >+*/ >+ >+ > HTMLTextAreaElementImpl::HTMLTextAreaElementImpl(DocumentImpl *doc, HTMLFormElementImpl *f) > : HTMLGenericFormElementImpl(doc, f) > { >@@ -2646,7 +2657,6 @@ > m_cols = 20; > m_wrap = ta_Virtual; > m_changed = false; >- m_dirtyvalue = true; > m_initialized = false; > m_unsubmittedFormChange = false; > } >@@ -2675,7 +2685,6 @@ > { > setDefaultValue(state.left(state.length()-1)); > m_unsubmittedFormChange = state.endsWith("M"); >- // the close() in the rendertree will take care of transferring defaultvalue to 'value' > } > > void HTMLTextAreaElementImpl::select( ) >@@ -2685,6 +2694,11 @@ > onSelect(); > } > >+void HTMLTextAreaElementImpl::childrenChanged() >+{ >+ setValue(defaultValue()); >+} >+ > void HTMLTextAreaElementImpl::parseAttribute(AttributeImpl *attr) > { > switch(attr->id()) >@@ -2804,15 +2818,13 @@ > > DOMString HTMLTextAreaElementImpl::value() > { >- if ( m_dirtyvalue) { >- if ( m_render && m_initialized ) { >- RenderTextArea* renderArea = static_cast<RenderTextArea*>( m_render ); >- m_value = renderArea->text(); >- m_dirtyvalue = false; >- } else { >+ if (m_render) { >+ RenderTextArea* renderArea = static_cast<RenderTextArea*>( m_render ); >+ m_value = renderArea->text(); >+ } else { >+ if (!m_initialized) { > m_value = defaultValue().string(); > m_initialized = true; >- m_dirtyvalue = false; > } > } > >@@ -2826,8 +2838,13 @@ > // \r\n -> \n, \r -> \n > QString str = _value.string().replace( "\r\n", "\n" ); > m_value = str.replace( '\r', '\n' ); >- m_dirtyvalue = false; > m_initialized = true; >+ >+ if (m_render) { >+ RenderTextArea* renderArea = static_cast<RenderTextArea*>( m_render ); >+ renderArea->setText( m_value ); >+ } >+ > setChanged(true); > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 244579
: 157227