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

« back to all changes in this revision

Viewing changes to kspread/commands/AutoFormatCommand.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Alessandro Ghersi
  • Date: 2010-10-27 17:52:57 UTC
  • mfrom: (0.12.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20101027175257-s04zqqk5bs8ckm9o
Tags: 1:2.2.83-0ubuntu1
* Merge with Debian git remaining changes:
 - Add build-deps on librcps-dev, opengtl-dev, libqtgtl-dev, freetds-dev,
   create-resources, libspnav-dev
 - Remove needless build-dep on libwv2-dev
 - koffice-libs recommends create-resources
 - krita recommends pstoedit
 - Keep our patches
* New upstream release 2.3 beta 3
  - Remove debian/patches fixed by upstream
  - Update install files

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
 
29
29
#include <QPen>
30
30
 
31
 
#include "CellStorage_p.h"
32
 
 
33
31
using namespace KSpread;
34
32
 
35
33
AutoFormatCommand::AutoFormatCommand()
39
37
 
40
38
AutoFormatCommand::~AutoFormatCommand()
41
39
{
42
 
    delete m_undoData;
43
40
}
44
41
 
45
42
void AutoFormatCommand::setStyles(const QList<Style>& styles)
58
55
    for (Region::ConstIterator it = constBegin(); it != end; ++it)
59
56
        m_sheet->cellStorage()->setStyle(Region((*it)->rect()), defaultStyle);
60
57
    if (m_firstrun)
61
 
        m_undoData = m_sheet->cellStorage()->stopUndoRecording();
 
58
        m_sheet->cellStorage()->stopUndoRecording(this);
62
59
    return true;
63
60
}
64
61
 
65
62
bool AutoFormatCommand::mainProcessing()
66
63
{
67
64
    if (m_reverse) {
68
 
        m_sheet->cellStorage()->undo(m_undoData);
 
65
        QUndoCommand::undo(); // undo child commands
69
66
        return true;
70
67
    }
71
68
    return AbstractRegionCommand::mainProcessing();