~ubuntu-branches/ubuntu/precise/koffice/precise

« back to all changes in this revision

Viewing changes to kspread/dialogs/SpecialPasteDialog.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2010-09-21 15:36:35 UTC
  • mfrom: (1.4.1 upstream) (60.2.11 maverick)
  • Revision ID: james.westby@ubuntu.com-20100921153635-6tejqkiro2u21ydi
Tags: 1:2.2.2-0ubuntu3
Add kubuntu_03_fix-crash-on-closing-sqlite-connection-2.2.2.diff and
kubuntu_04_support-large-memo-values-for-msaccess-2.2.2.diff as
recommended by upstream http://kexi-
project.org/wiki/wikiview/index.php@Kexi2.2_Patches.html#sqlite_stab
ility

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
using namespace KSpread;
34
34
 
35
35
SpecialPasteDialog::SpecialPasteDialog(QWidget* parent, Selection* selection)
36
 
  : KDialog( parent ),
37
 
    m_selection(selection)
 
36
        : KDialog(parent),
 
37
        m_selection(selection)
38
38
{
39
 
  setButtons( Ok|Cancel );
40
 
  setCaption( i18n( "Special Paste" ) );
41
 
  QWidget* widget = new QWidget( this );
42
 
  setupUi( widget );
43
 
  setMainWidget( widget );
 
39
    setButtons(Ok | Cancel);
 
40
    setCaption(i18n("Special Paste"));
 
41
    QWidget* widget = new QWidget(this);
 
42
    setupUi(widget);
 
43
    setMainWidget(widget);
44
44
 
45
 
  connect( this, SIGNAL( okClicked() ),
46
 
           this, SLOT( slotOk() ) );
47
 
  connect( formatButton, SIGNAL( toggled( bool ) ),
48
 
           this, SLOT( slotToggled( bool ) ) );
49
 
  connect( commentButton, SIGNAL( toggled( bool ) ),
50
 
           this, SLOT( slotToggled( bool ) ) );
 
45
    connect(this, SIGNAL(okClicked()),
 
46
            this, SLOT(slotOk()));
 
47
    connect(formatButton, SIGNAL(toggled(bool)),
 
48
            this, SLOT(slotToggled(bool)));
 
49
    connect(commentButton, SIGNAL(toggled(bool)),
 
50
            this, SLOT(slotToggled(bool)));
51
51
}
52
52
 
53
53
void SpecialPasteDialog::slotOk()
54
54
{
55
 
  Paste::Mode sp = Paste::Normal;
56
 
  Paste::Operation op = Paste::OverWrite;
 
55
    Paste::Mode sp = Paste::Normal;
 
56
    Paste::Operation op = Paste::OverWrite;
57
57
 
58
58
    /* if( everythingButton->isChecked() )
59
 
        sp = cb->isChecked() ? NormalAndTranspose : Normal;
 
59
    sp = cb->isChecked() ? NormalAndTranspose : Normal;
60
60
    else if( textButton->isChecked() )
61
 
        sp = cb->isChecked() ? TextAndTranspose : Text;
 
61
    sp = cb->isChecked() ? TextAndTranspose : Text;
62
62
    else if( formatButton->isChecked() )
63
 
        sp = cb->isChecked() ? FormatAndTranspose : Format;
 
63
    sp = cb->isChecked() ? FormatAndTranspose : Format;
64
64
    else if( noBorderButton->isChecked() )
65
65
    sp = cb->isChecked() ? NoBorderAndTranspose : NoBorder; */
66
66
 
67
 
    if( everythingButton->isChecked() )
68
 
      sp = Paste::Normal;
69
 
    else if( textButton->isChecked() )
70
 
      sp = Paste::Text;
71
 
    else if( formatButton->isChecked() )
72
 
      sp = Paste::Format;
73
 
    else if( noBorderButton->isChecked() )
74
 
      sp = Paste::NoBorder;
75
 
    else if( commentButton->isChecked() )
76
 
      sp = Paste::Comment;
77
 
    else if( resultButton->isChecked() )
78
 
      sp = Paste::Result;
79
 
 
80
 
    if( overwriteButton->isChecked() )
81
 
      op = Paste::OverWrite;
82
 
    if( additionButton->isChecked() )
83
 
      op = Paste::Add;
84
 
    if( substractionButton->isChecked() )
85
 
      op = Paste::Sub;
86
 
    if( multiplicationButton->isChecked() )
87
 
      op = Paste::Mul;
88
 
    if( divisionButton->isChecked() )
89
 
      op = Paste::Div;
90
 
 
91
 
    m_selection->activeSheet()->paste( m_selection->lastRange(), true, sp, op );
 
67
    if (everythingButton->isChecked())
 
68
        sp = Paste::Normal;
 
69
    else if (textButton->isChecked())
 
70
        sp = Paste::Text;
 
71
    else if (formatButton->isChecked())
 
72
        sp = Paste::Format;
 
73
    else if (noBorderButton->isChecked())
 
74
        sp = Paste::NoBorder;
 
75
    else if (commentButton->isChecked())
 
76
        sp = Paste::Comment;
 
77
    else if (resultButton->isChecked())
 
78
        sp = Paste::Result;
 
79
 
 
80
    if (overwriteButton->isChecked())
 
81
        op = Paste::OverWrite;
 
82
    if (additionButton->isChecked())
 
83
        op = Paste::Add;
 
84
    if (substractionButton->isChecked())
 
85
        op = Paste::Sub;
 
86
    if (multiplicationButton->isChecked())
 
87
        op = Paste::Mul;
 
88
    if (divisionButton->isChecked())
 
89
        op = Paste::Div;
 
90
 
 
91
    m_selection->activeSheet()->paste(m_selection->lastRange(), true, sp, op);
92
92
    m_selection->emitModified();
93
93
    accept();
94
94
}
95
95
 
96
 
void SpecialPasteDialog::slotToggled( bool b )
 
96
void SpecialPasteDialog::slotToggled(bool b)
97
97
{
98
 
    overwriteButton->setEnabled( !b );
99
 
    additionButton->setEnabled( !b );
100
 
    substractionButton->setEnabled( !b );
101
 
    multiplicationButton->setEnabled( !b );
102
 
    divisionButton->setEnabled( !b );
 
98
    overwriteButton->setEnabled(!b);
 
99
    additionButton->setEnabled(!b);
 
100
    substractionButton->setEnabled(!b);
 
101
    multiplicationButton->setEnabled(!b);
 
102
    divisionButton->setEnabled(!b);
103
103
}
104
104
 
105
105
#include "SpecialPasteDialog.moc"