Commit 6975c67a authored by Joao Oliveira's avatar Joao Oliveira Committed by Albert Astals Cid

Changed nomenclature and add format action now sets the AP stream text

parent 53a8acf8
Pipeline #6461 passed with stage
in 27 minutes and 18 seconds
......@@ -4326,7 +4326,7 @@ void Document::processFormatAction( const Action * action, Okular::FormFieldText
return;
}
const QString oldVal = fft->text();
const QString unformattedText = fft->text();
std::shared_ptr< Event > event = Event::createFormatEvent( fft, d->m_pagesVector[foundPage] );
......@@ -4341,17 +4341,18 @@ void Document::processFormatAction( const Action * action, Okular::FormFieldText
// Clear out the event after execution
d->m_scripter->setEvent( nullptr );
const QString newVal = event->value().toString();
if ( newVal != oldVal )
const QString formattedText = event->value().toString();
if ( formattedText != unformattedText )
{
// We set the newVal, because when we call refreshFormWidget
// It will set the QLineEdit to this newVal
fft->setText( newVal );
// We set the formattedText, because when we call refreshFormWidget
// It will set the QLineEdit to this formattedText
fft->setText( formattedText );
fft->setAppearanceText( formattedText );
emit refreshFormWidget( fft );
d->refreshPixmaps( foundPage );
// Then we make the form have the unformatted text, to use
// in calculations and other things.
fft->setText( oldVal );
fft->setText( unformattedText );
}
else if ( fft->additionalAction( FormField::CalculateField ) )
{
......
......@@ -556,13 +556,13 @@ void FormLineEdit::slotChanged()
if( form->additionalAction( Okular::FormField::FieldModified ) && m_editing && !form->isReadOnly() )
{
bool ok = false;
QString oldText = form->text();
QString oldInputText = form->text();
form->setText( text() );
emit m_controller->keystrokeAction( form->additionalAction( Okular::FormField::FieldModified ), form, ok );
form->setText( oldText );
form->setText( oldInputText );
if(!ok)
{
setText( oldText );
setText( oldInputText );
return;
}
}
......@@ -743,13 +743,13 @@ void TextAreaEdit::slotChanged()
if( form->additionalAction( Okular::FormField::FieldModified ) && m_editing && !form->isReadOnly() )
{
bool ok = false;
QString oldText = form->text();
QString oldInputText = form->text();
form->setText( toPlainText() );
emit m_controller->keystrokeAction( form->additionalAction( Okular::FormField::FieldModified ), form, ok );
form->setText( oldText );
form->setText( oldInputText );
if(!ok)
{
setText( oldText );
setText( oldInputText );
return;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment