~ubuntu-branches/ubuntu/breezy/koffice/breezy-security

« back to all changes in this revision

Viewing changes to kspread/kspread_dlg_formula.h

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2005-10-11 14:49:50 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051011144950-lwpngbifzp8nk0ds
Tags: 1:1.4.1-0ubuntu7
* SECURITY UPDATE: fix heap based buffer overflow in the RTF importer of KWord
* Opening specially crafted RTF files in KWord can cause
  execution of abitrary code.
* Add kubuntu_01_rtfimport_heap_overflow.diff
* References:
  CAN-2005-2971
  CESA-2005-005
  http://www.koffice.org/security/advisory-20051011-1.txt

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* This file is part of the KDE project
2
 
   Copyright (C) 1998, 1999 Torben Weis <weis@kde.org>
3
 
   Copyright (C) 1999 Montel Laurent <montell@club-internet.fr>
4
 
 
5
 
   This library is free software; you can redistribute it and/or
6
 
   modify it under the terms of the GNU Library General Public
7
 
   License as published by the Free Software Foundation; either
8
 
   version 2 of the License, or (at your option) any later version.
9
 
 
10
 
   This library is distributed in the hope that it will be useful,
11
 
   but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13
 
   Library General Public License for more details.
14
 
 
15
 
   You should have received a copy of the GNU Library General Public License
16
 
   along with this library; see the file COPYING.LIB.  If not, write to
17
 
   the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18
 
   Boston, MA 02111-1307, USA.
19
 
*/
20
 
 
21
 
#ifndef __kspread_dlg_formula__
22
 
#define __kspread_dlg_formula__
23
 
 
24
 
#include <qframe.h>
25
 
#include <kdialogbase.h>
26
 
 
27
 
#include <kcompletion.h>
28
 
 
29
 
class QTextBrowser;
30
 
class QTabWidget;
31
 
 
32
 
class KSpreadView;
33
 
class KSpreadSheet;
34
 
class KSpreadCell;
35
 
class QLineEdit;
36
 
class QLabel;
37
 
class QListBox;
38
 
class QComboBox;
39
 
class QPushButton;
40
 
class KLineEdit;
41
 
 
42
 
#include "kspread_functions.h"
43
 
 
44
 
class KSpreadDlgFormula : public KDialogBase
45
 
{
46
 
    Q_OBJECT
47
 
public:
48
 
    KSpreadDlgFormula( KSpreadView* parent, const char* name,const QString& formulaName=0);
49
 
    ~KSpreadDlgFormula();
50
 
private:
51
 
    /**
52
 
     * Turns the @p text into a parameter that koscript can understand. The type
53
 
     * of this parameter is extracted by looking at parameter number @p param in @ref #m_desc.
54
 
     */
55
 
    QString createParameter( const QString& _text, int param );
56
 
    /**
57
 
     * Reads the text out of @ref #firstElement and friends and creates a parameter
58
 
     * list for the function.
59
 
     */
60
 
    QString createFormula();
61
 
 
62
 
private slots:
63
 
    /**
64
 
     * Called by the Ok button.
65
 
     */
66
 
    void slotOk();
67
 
    /**
68
 
     * Called by the Close button.
69
 
     */
70
 
    void slotClose();
71
 
    /**
72
 
     * Called if a function name was selected but not double clicked.
73
 
     * This will just show the help page for the function.
74
 
     */
75
 
    void slotSelected( const QString& function );
76
 
    /**
77
 
     * Called if the user clicked on one of the "related function"
78
 
     * This will switch the active function and show help page
79
 
     * of the function as well.
80
 
     */
81
 
    void slotShowFunction( const QString& function );
82
 
    /**
83
 
     * Called if the user double clicked on some method name.
84
 
     * That will switch into editing mode, allowing the user
85
 
     * to enter the parameters for the function.
86
 
     */
87
 
    void slotDoubleClicked( QListBoxItem* item );
88
 
    /**
89
 
     * Called if a category of methods has been selected.
90
 
     */
91
 
    void slotActivated(const QString& category );
92
 
    /**
93
 
     * Called if the text of @ref #firstElement, @ref #secondElement etc. changes.
94
 
     */
95
 
    void slotChangeText(const QString& text );
96
 
    /**
97
 
     * Connected to @ref KSpreadView to get notified if the selection in the
98
 
     * table changes.
99
 
     */
100
 
    void slotSelectionChanged( KSpreadSheet* _table, const QRect& _selection );
101
 
    /**
102
 
     * Called if the button @ref #selectFunction was clicked. That
103
 
     * insertes a new function call to the result.
104
 
     */
105
 
    void slotSelectButton();
106
 
    /**
107
 
     * Called if the user changes some character in @ref #searchFunct.
108
 
     */
109
 
    void slotSearchText(const QString& text );
110
 
    /**
111
 
     * Called if the user pressed return in @ref #searchFunct.
112
 
     */
113
 
    void slotPressReturn();
114
 
 
115
 
public:
116
 
    /**
117
 
     * Find out which widget got focus.
118
 
     */
119
 
    bool eventFilter( QObject* obj, QEvent* ev );
120
 
protected:
121
 
       virtual void closeEvent ( QCloseEvent * );
122
 
private:
123
 
    KSpreadView* m_pView;
124
 
 
125
 
    QTabWidget* m_tabwidget;
126
 
    QTextBrowser* m_browser;
127
 
    QWidget* m_input;
128
 
 
129
 
    QPushButton *selectFunction;
130
 
    QComboBox *typeFunction;
131
 
    QListBox *functions;
132
 
    QLineEdit *result;
133
 
 
134
 
    KLineEdit *searchFunct;
135
 
    KCompletion listFunct;
136
 
 
137
 
    QLabel* label1;
138
 
    QLabel* label2;
139
 
    QLabel* label3;
140
 
    QLabel* label4;
141
 
    QLabel* label5;
142
 
    QLineEdit *firstElement;
143
 
    QLineEdit *secondElement;
144
 
    QLineEdit *thirdElement;
145
 
    QLineEdit *fourElement;
146
 
    QLineEdit *fiveElement;
147
 
    /**
148
 
     * Tells which of the lineedits has the logical focus currently.
149
 
     * It may happen that a lineedit does not have qt focus but
150
 
     * logical focus but not the other way round.
151
 
     */
152
 
    QLineEdit* m_focus;
153
 
 
154
 
    int m_column;
155
 
    int m_row;
156
 
    QString m_oldText;
157
 
 
158
 
    QString m_funcName;
159
 
    QString m_tableName;
160
 
 
161
 
    QString m_rightText;
162
 
    QString m_leftText;
163
 
    /**
164
 
     * A lock for @ref #slotChangeText.
165
 
     */
166
 
    bool refresh_result;
167
 
 
168
 
    KSpreadFunctionDescription* m_desc;
169
 
};
170
 
 
171
 
#endif