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

« back to all changes in this revision

Viewing changes to kspread/plugins/insertcalendar/kspread_plugininsertcalendar.cc

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2006-04-20 21:38:53 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20060420213853-j5lxluqvymxt2zny
Tags: 1:1.5.0-0ubuntu2
UbuntuĀ uploadĀ 

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
 
29
29
#include "../../kspread_view.h"
30
30
#include "../../kspread_doc.h"
31
 
#include "../../kspread_selection.h"
 
31
#include "../../selection.h"
32
32
#include "../../kspread_sheet.h"
33
33
 
34
34
#include <kcalendarsystem.h>
50
50
K_EXPORT_COMPONENT_FACTORY( libkspreadinsertcalendar,  InsertCalendarFactory("kspreadinsertcalendar"))
51
51
 
52
52
 
53
 
PluginInsertCalendar::PluginInsertCalendar( QObject *parent, const char *name, const QStringList& args )
 
53
PluginInsertCalendar::PluginInsertCalendar( QObject *parent, const char *name, const QStringList& /*args*/ )
54
54
: Plugin(parent,name)
55
55
{
56
56
    this->m_kspreadView = NULL;
57
57
    if (parent)
58
58
    {
59
 
      if (parent->inherits("KSpreadView"))
 
59
      if (parent->inherits("KSpread::View"))
60
60
      {
61
 
        this->m_kspreadView = (KSpreadView*)parent;
 
61
        this->m_kspreadView = (View*)parent;
62
62
      }
63
63
      else
64
64
      {
65
 
        kdWarning() << "Parent does not inherit KSpreadView!!!" << endl;
 
65
        kdWarning() << "Parent does not inherit View!!!" << endl;
66
66
      }
67
67
    }
68
68
    else
122
122
  //@todo implement
123
123
  kdDebug() << "slotInsert... still to be implemented" << endl;
124
124
 
125
 
  KSpreadDoc* document = m_kspreadView->doc();
 
125
  Doc* document = m_kspreadView->doc();
126
126
 
127
127
  if (!document)
128
128
  {
154
154
      return;
155
155
  }
156
156
 
157
 
  KSpreadSelection* selection_info = m_kspreadView->selectionInfo();
 
157
  Selection* selection_info = m_kspreadView->selectionInfo();
158
158
 
159
159
  Q_ASSERT(selection_info);
160
160
 
161
161
  QPoint selection = selection_info->selection().topLeft();
162
162
  
163
 
  KSpreadSheet* sheet = m_kspreadView->activeSheet();
 
163
  Sheet* sheet = m_kspreadView->activeSheet();
164
164
  
165
165
  Q_ASSERT(sheet);
166
166
  
180
180
    if (KMessageBox::No == KMessageBox::warningYesNo(NULL,i18n("The area where the calendar is inserted is NOT empty, are you sure you want to continue, overwriting existing data? If you choose No the area that would be required for the desired calendar will be selected so you can see what data would be overwritten."),i18n("Warning")))
181
181
    {
182
182
      //select the area so the user knows what's in the way
183
 
      selection_info->setSelection(selection,QPoint(selection.x()+sizeX,selection.y()+sizeY),sheet);
 
183
      selection_info->initialize(QRect(selection.x(),selection.y(),sizeX,sizeY));//,sheet);
184
184
      return;
185
185
    }
186
186
  }