~ubuntu-branches/ubuntu/precise/okular/precise-proposed

« back to all changes in this revision

Viewing changes to core/document.cpp

  • Committer: Package Import Robot
  • Author(s): Philip Muškovac
  • Date: 2011-12-23 22:53:33 UTC
  • mfrom: (1.1.6)
  • Revision ID: package-import@ubuntu.com-20111223225333-l6ekbg2vq4pcsvwg
Tags: 4:4.7.95-0ubuntu1
* New upstream release candidate
* Enable DebianABIManager and bump ABI of libokularcore1

Show diffs side-by-side

added added

removed removed

Lines of Context:
78
78
#include "utils_p.h"
79
79
#include "view.h"
80
80
#include "view_p.h"
81
 
#include "form.h"
82
81
 
83
82
#include <memory>
84
83
 
3003
3002
            //const MovieAction * movie = static_cast< const MovieAction * >( action );
3004
3003
            // TODO this (Movie action)
3005
3004
            break;
3006
 
 
3007
 
        case Action::ResetForm: {
3008
 
            const ResetFormAction *resetFormAction = static_cast< const ResetFormAction * >( action );
3009
 
            foreach( Page *page, d->m_pagesVector )
3010
 
            {
3011
 
                foreach( FormField* ff, page->formFields() )
3012
 
                {
3013
 
                    bool reset = false;
3014
 
                    switch (resetFormAction->behaviour())
3015
 
                    {
3016
 
                        case ResetFormAction::ResetAllForms: 
3017
 
                            reset = true;
3018
 
                        break;
3019
 
                        case ResetFormAction::ResetFormsInFieldList: 
3020
 
                            reset = resetFormAction->fieldList().contains(ff->fullyQualifiedName());
3021
 
                        break;
3022
 
                        case ResetFormAction::ResetAllFormsExceptFieldList: 
3023
 
                            reset = !resetFormAction->fieldList().contains(ff->fullyQualifiedName());
3024
 
                        break;
3025
 
                    }
3026
 
                    
3027
 
                    if (reset)
3028
 
                    {
3029
 
                        switch (ff->type()) {
3030
 
                            case Okular::FormField::FormText: {
3031
 
                                Okular::FormFieldText* fft = static_cast<Okular::FormFieldText *>(ff);
3032
 
                                if (!fft->isReadOnly()) {
3033
 
                                    fft->setText( fft->defaultValue() );
3034
 
                                    emit formFieldChanged(fft);
3035
 
                                }
3036
 
                            } break;
3037
 
        
3038
 
                            case Okular::FormField::FormButton: {
3039
 
                                Okular::FormFieldButton* ffb = static_cast<Okular::FormFieldButton *>(ff);
3040
 
 
3041
 
                                if (!ffb->isReadOnly()) {
3042
 
                                    ffb->setState( "true" == ffb->defaultValue() );
3043
 
                                    emit formFieldChanged(ffb);
3044
 
                                }
3045
 
                            } break;
3046
 
                            
3047
 
                            default:
3048
 
                                kDebug() << "Unhandled form field: " << ff->name() << ff->defaultValue();
3049
 
                            break;
3050
 
                        }
3051
 
                    }
3052
 
                }
3053
 
            }
3054
 
            } break;
3055
3005
    }
3056
3006
}
3057
3007