Changeset View
Changeset View
Standalone View
Standalone View
core/document.cpp
Show First 20 Lines • Show All 3942 Lines • ▼ Show 20 Line(s) | 3942 | void Document::editFormText( int pageNumber, | |||
---|---|---|---|---|---|
3943 | Okular::FormFieldText* form, | 3943 | Okular::FormFieldText* form, | ||
3944 | const QString & newContents, | 3944 | const QString & newContents, | ||
3945 | int newCursorPos, | 3945 | int newCursorPos, | ||
3946 | int prevCursorPos, | 3946 | int prevCursorPos, | ||
3947 | int prevAnchorPos ) | 3947 | int prevAnchorPos ) | ||
3948 | { | 3948 | { | ||
3949 | QUndoCommand *uc = new EditFormTextCommand( this->d, form, pageNumber, newContents, newCursorPos, form->text(), prevCursorPos, prevAnchorPos ); | 3949 | QUndoCommand *uc = new EditFormTextCommand( this->d, form, pageNumber, newContents, newCursorPos, form->text(), prevCursorPos, prevAnchorPos ); | ||
3950 | d->m_undoStack->push( uc ); | 3950 | d->m_undoStack->push( uc ); | ||
3951 | | ||||
3952 | d->recalculateForms(); | | |||
3953 | } | 3951 | } | ||
3954 | 3952 | | |||
3955 | void Document::editFormList( int pageNumber, | 3953 | void Document::editFormList( int pageNumber, | ||
3956 | FormFieldChoice* form, | 3954 | FormFieldChoice* form, | ||
3957 | const QList< int > & newChoices ) | 3955 | const QList< int > & newChoices ) | ||
3958 | { | 3956 | { | ||
3959 | const QList< int > prevChoices = form->currentChoices(); | 3957 | const QList< int > prevChoices = form->currentChoices(); | ||
3960 | QUndoCommand *uc = new EditFormListCommand( this->d, form, pageNumber, newChoices, prevChoices ); | 3958 | QUndoCommand *uc = new EditFormListCommand( this->d, form, pageNumber, newChoices, prevChoices ); | ||
3961 | d->m_undoStack->push( uc ); | 3959 | d->m_undoStack->push( uc ); | ||
3962 | | ||||
3963 | d->recalculateForms(); | | |||
3964 | } | 3960 | } | ||
3965 | 3961 | | |||
3966 | void Document::editFormCombo( int pageNumber, | 3962 | void Document::editFormCombo( int pageNumber, | ||
3967 | FormFieldChoice* form, | 3963 | FormFieldChoice* form, | ||
3968 | const QString & newText, | 3964 | const QString & newText, | ||
3969 | int newCursorPos, | 3965 | int newCursorPos, | ||
3970 | int prevCursorPos, | 3966 | int prevCursorPos, | ||
3971 | int prevAnchorPos ) | 3967 | int prevAnchorPos ) | ||
3972 | { | 3968 | { | ||
3973 | 3969 | | |||
3974 | QString prevText; | 3970 | QString prevText; | ||
3975 | if ( form->currentChoices().isEmpty() ) | 3971 | if ( form->currentChoices().isEmpty() ) | ||
3976 | { | 3972 | { | ||
3977 | prevText = form->editChoice(); | 3973 | prevText = form->editChoice(); | ||
3978 | } | 3974 | } | ||
3979 | else | 3975 | else | ||
3980 | { | 3976 | { | ||
3981 | prevText = form->choices()[form->currentChoices().constFirst()]; | 3977 | prevText = form->choices()[form->currentChoices().constFirst()]; | ||
3982 | } | 3978 | } | ||
3983 | 3979 | | |||
3984 | QUndoCommand *uc = new EditFormComboCommand( this->d, form, pageNumber, newText, newCursorPos, prevText, prevCursorPos, prevAnchorPos ); | 3980 | QUndoCommand *uc = new EditFormComboCommand( this->d, form, pageNumber, newText, newCursorPos, prevText, prevCursorPos, prevAnchorPos ); | ||
3985 | d->m_undoStack->push( uc ); | 3981 | d->m_undoStack->push( uc ); | ||
3986 | | ||||
3987 | d->recalculateForms(); | | |||
3988 | } | 3982 | } | ||
3989 | 3983 | | |||
3990 | void Document::editFormButtons( int pageNumber, const QList< FormFieldButton* >& formButtons, const QList< bool >& newButtonStates ) | 3984 | void Document::editFormButtons( int pageNumber, const QList< FormFieldButton* >& formButtons, const QList< bool >& newButtonStates ) | ||
3991 | { | 3985 | { | ||
3992 | QUndoCommand *uc = new EditFormButtonsCommand( this->d, pageNumber, formButtons, newButtonStates ); | 3986 | QUndoCommand *uc = new EditFormButtonsCommand( this->d, pageNumber, formButtons, newButtonStates ); | ||
3993 | d->m_undoStack->push( uc ); | 3987 | d->m_undoStack->push( uc ); | ||
3994 | } | 3988 | } | ||
3995 | 3989 | | |||
▲ Show 20 Lines • Show All 1617 Lines • Show Last 20 Lines |