View | Details | Raw Unified | Return to issue 12666
Collapse All | Expand All

(-)sc/inc/dbcolect.hxx (+5 lines)
Lines 136-141 Link Here
136
			void		GetArea(SCTAB& rTab, SCCOL& rCol1, SCROW& rRow1, SCCOL& rCol2, SCROW& rRow2) const;
136
			void		GetArea(SCTAB& rTab, SCCOL& rCol1, SCROW& rRow1, SCCOL& rCol2, SCROW& rRow2) const;
137
			SC_DLLPUBLIC void		GetArea(ScRange& rRange) const;
137
			SC_DLLPUBLIC void		GetArea(ScRange& rRange) const;
138
			void		SetArea(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2);
138
			void		SetArea(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2);
139
            //If the name of DBData is started with "unnamed", it will be recognized as build in DBData
140
            sal_Bool        IsBuildin();
139
			void		MoveTo(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2);
141
			void		MoveTo(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2);
140
			sal_Bool		IsByRow() const 				{ return bByRow; }
142
			sal_Bool		IsByRow() const 				{ return bByRow; }
141
			void		SetByRow(sal_Bool bByR) 			{ bByRow = bByR; }
143
			void		SetByRow(sal_Bool bByR) 			{ bByRow = bByR; }
Lines 216-221 Link Here
216
			ScDBData*	GetDBAtCursor(SCCOL nCol, SCROW nRow, SCTAB nTab, sal_Bool bStartOnly) const;
218
			ScDBData*	GetDBAtCursor(SCCOL nCol, SCROW nRow, SCTAB nTab, sal_Bool bStartOnly) const;
217
			ScDBData*	GetDBAtArea(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2) const;
219
			ScDBData*	GetDBAtArea(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2) const;
218
			ScDBData*       GetFilterDBAtTable(SCTAB nTab) const;
220
			ScDBData*       GetFilterDBAtTable(SCTAB nTab) const;
221
            ScDBData*	GetDBAtTable(SCTAB nTab, ScGetDBMode eMode) const;
219
222
220
	sal_Bool	SearchName( const String& rName, sal_uInt16& rIndex ) const;
223
	sal_Bool	SearchName( const String& rName, sal_uInt16& rIndex ) const;
221
224
Lines 234-239 Link Here
234
	void			SetRefreshHandler( const Link& rLink )
237
	void			SetRefreshHandler( const Link& rLink )
235
						{ aRefreshHandler = rLink; }
238
						{ aRefreshHandler = rLink; }
236
	const Link&		GetRefreshHandler() const	{ return aRefreshHandler; }
239
	const Link&		GetRefreshHandler() const	{ return aRefreshHandler; }
240
    String      GetNewDefaultDBName();
241
    /*sal_Bool        IsFiltered(SCTAB nTab, SCROW nRow);*/
237
};
242
};
238
243
239
#endif
244
#endif
(-)sc/inc/document.hxx (+1 lines)
Lines 505-510 Link Here
505
//UNUSED2008-05  ScRangeData*	GetRangeAtCursor(SCCOL nCol, SCROW nRow, SCTAB nTab,
505
//UNUSED2008-05  ScRangeData*	GetRangeAtCursor(SCCOL nCol, SCROW nRow, SCTAB nTab,
506
//UNUSED2008-05                                      sal_Bool bStartOnly = sal_False) const;
506
//UNUSED2008-05                                      sal_Bool bStartOnly = sal_False) const;
507
	SC_DLLPUBLIC ScRangeData*	GetRangeAtBlock( const ScRange& rBlock, String* pName=NULL ) const;
507
	SC_DLLPUBLIC ScRangeData*	GetRangeAtBlock( const ScRange& rBlock, String* pName=NULL ) const;
508
    ScDBData*       GetDBAtTable(SCTAB nTab, ScGetDBMode eMode) const;
508
509
509
	SC_DLLPUBLIC ScDPCollection*		GetDPCollection();
510
	SC_DLLPUBLIC ScDPCollection*		GetDPCollection();
510
	ScDPObject*			GetDPAtCursor(SCCOL nCol, SCROW nRow, SCTAB nTab) const;
511
	ScDPObject*			GetDPAtCursor(SCCOL nCol, SCROW nRow, SCTAB nTab) const;
Lines 955-960 Link Here
955
										SCROW& rEndRow, sal_Bool bNotes = sal_True ) const;
956
										SCROW& rEndRow, sal_Bool bNotes = sal_True ) const;
956
	void			InvalidateTableArea();
957
	void			InvalidateTableArea();
957
958
958
959
959
    SC_DLLPUBLIC sal_Bool			GetDataStart( SCTAB nTab, SCCOL& rStartCol, SCROW& rStartRow ) const;
960
    SC_DLLPUBLIC sal_Bool			GetDataStart( SCTAB nTab, SCCOL& rStartCol, SCROW& rStartRow ) const;
960
961
(-)sc/inc/global.hxx (-886 / +890 lines)
Lines 1-886 Link Here
1
/**************************************************************
1
/**************************************************************
2
 * 
2
 * 
3
 * Licensed to the Apache Software Foundation (ASF) under one
3
 * Licensed to the Apache Software Foundation (ASF) under one
4
 * or more contributor license agreements.  See the NOTICE file
4
 * or more contributor license agreements.  See the NOTICE file
5
 * distributed with this work for additional information
5
 * distributed with this work for additional information
6
 * regarding copyright ownership.  The ASF licenses this file
6
 * regarding copyright ownership.  The ASF licenses this file
7
 * to you under the Apache License, Version 2.0 (the
7
 * to you under the Apache License, Version 2.0 (the
8
 * "License"); you may not use this file except in compliance
8
 * "License"); you may not use this file except in compliance
9
 * with the License.  You may obtain a copy of the License at
9
 * with the License.  You may obtain a copy of the License at
10
 * 
10
 * 
11
 *   http://www.apache.org/licenses/LICENSE-2.0
11
 *   http://www.apache.org/licenses/LICENSE-2.0
12
 * 
12
 * 
13
 * Unless required by applicable law or agreed to in writing,
13
 * Unless required by applicable law or agreed to in writing,
14
 * software distributed under the License is distributed on an
14
 * software distributed under the License is distributed on an
15
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16
 * KIND, either express or implied.  See the License for the
16
 * KIND, either express or implied.  See the License for the
17
 * specific language governing permissions and limitations
17
 * specific language governing permissions and limitations
18
 * under the License.
18
 * under the License.
19
 * 
19
 * 
20
 *************************************************************/
20
 *************************************************************/
21
21
22
22
23
23
24
#ifndef SC_SCGLOB_HXX
24
#ifndef SC_SCGLOB_HXX
25
#define SC_SCGLOB_HXX
25
#define SC_SCGLOB_HXX
26
26
27
#include "address.hxx"
27
#include "address.hxx"
28
#include <i18npool/lang.h>
28
#include <i18npool/lang.h>
29
#include <tools/stream.hxx>
29
#include <tools/stream.hxx>
30
#include <osl/endian.h>
30
#include <osl/endian.h>
31
#include <com/sun/star/uno/Reference.hxx>
31
#include <com/sun/star/uno/Reference.hxx>
32
#include "scdllapi.h"
32
#include "scdllapi.h"
33
33
34
#include <hash_map>
34
#include <hash_map>
35
35
36
class ImageList;
36
class ImageList;
37
class Bitmap;
37
class Bitmap;
38
class SfxItemSet;
38
class SfxItemSet;
39
class Color;
39
class Color;
40
40
41
// Macro fuer den Call-Profiler unter WinNT
41
// Macro fuer den Call-Profiler unter WinNT
42
// mit S_CAP kann eine Messung gestarted, mit E_CAP wieder gestoppt werden
42
// mit S_CAP kann eine Messung gestarted, mit E_CAP wieder gestoppt werden
43
#if defined( WNT ) && defined( PROFILE )
43
#if defined( WNT ) && defined( PROFILE )
44
44
45
extern "C" {
45
extern "C" {
46
	void StartCAP();
46
	void StartCAP();
47
	void StopCAP();
47
	void StopCAP();
48
	void DumpCAP();
48
	void DumpCAP();
49
};
49
};
50
50
51
#define S_CAP	StartCAP();
51
#define S_CAP	StartCAP();
52
#define E_CAP	StopCAP(); DumpCAP();
52
#define E_CAP	StopCAP(); DumpCAP();
53
53
54
#endif
54
#endif
55
55
56
#if 0
56
#if 0
57
// I18N doesn't get this right, can't specify more than one to ignore
57
// I18N doesn't get this right, can't specify more than one to ignore
58
#define SC_COLLATOR_IGNORES ( \
58
#define SC_COLLATOR_IGNORES ( \
59
	::com::sun::star::i18n::CollatorOptions::CollatorOptions_IGNORE_CASE | \
59
	::com::sun::star::i18n::CollatorOptions::CollatorOptions_IGNORE_CASE | \
60
	::com::sun::star::i18n::CollatorOptions::CollatorOptions_IGNORE_KANA | \
60
	::com::sun::star::i18n::CollatorOptions::CollatorOptions_IGNORE_KANA | \
61
	::com::sun::star::i18n::CollatorOptions::CollatorOptions_IGNORE_WIDTH )
61
	::com::sun::star::i18n::CollatorOptions::CollatorOptions_IGNORE_WIDTH )
62
#else
62
#else
63
#define SC_COLLATOR_IGNORES ( \
63
#define SC_COLLATOR_IGNORES ( \
64
	::com::sun::star::i18n::CollatorOptions::CollatorOptions_IGNORE_CASE )
64
	::com::sun::star::i18n::CollatorOptions::CollatorOptions_IGNORE_CASE )
65
#endif
65
#endif
66
#if 0
66
#if 0
67
// #107998# Don't ignore Width and Kana. The issue was mainly with AutoInput,
67
// #107998# Don't ignore Width and Kana. The issue was mainly with AutoInput,
68
// but affects also comparison of names in general.
68
// but affects also comparison of names in general.
69
#define SC_TRANSLITERATION_IGNORECASE ( \
69
#define SC_TRANSLITERATION_IGNORECASE ( \
70
    ::com::sun::star::i18n::TransliterationModules_IGNORE_CASE | \
70
    ::com::sun::star::i18n::TransliterationModules_IGNORE_CASE | \
71
    ::com::sun::star::i18n::TransliterationModules_IGNORE_KANA | \
71
    ::com::sun::star::i18n::TransliterationModules_IGNORE_KANA | \
72
    ::com::sun::star::i18n::TransliterationModules_IGNORE_WIDTH )
72
    ::com::sun::star::i18n::TransliterationModules_IGNORE_WIDTH )
73
#define SC_TRANSLITERATION_CASESENSE ( \
73
#define SC_TRANSLITERATION_CASESENSE ( \
74
    ::com::sun::star::i18n::TransliterationModules_IGNORE_KANA | \
74
    ::com::sun::star::i18n::TransliterationModules_IGNORE_KANA | \
75
    ::com::sun::star::i18n::TransliterationModules_IGNORE_WIDTH )
75
    ::com::sun::star::i18n::TransliterationModules_IGNORE_WIDTH )
76
#else
76
#else
77
#define SC_TRANSLITERATION_IGNORECASE ( \
77
#define SC_TRANSLITERATION_IGNORECASE ( \
78
    ::com::sun::star::i18n::TransliterationModules_IGNORE_CASE )
78
    ::com::sun::star::i18n::TransliterationModules_IGNORE_CASE )
79
#define SC_TRANSLITERATION_CASESENSE 0
79
#define SC_TRANSLITERATION_CASESENSE 0
80
#endif
80
#endif
81
81
82
//------------------------------------------------------------------------
82
//------------------------------------------------------------------------
83
83
84
//	die 1000 Namen des Calc...
84
//	die 1000 Namen des Calc...
85
//	Clipboard-Namen sind jetzt in so3/soapp.hxx
85
//	Clipboard-Namen sind jetzt in so3/soapp.hxx
86
//	STRING_SCAPP war "scalc3", "scalc4", jetzt nur noch "scalc"
86
//	STRING_SCAPP war "scalc3", "scalc4", jetzt nur noch "scalc"
87
87
88
#define STRING_SCAPP	"scalc"
88
#define STRING_SCAPP	"scalc"
89
#define	STRING_SCSTREAM	"StarCalcDocument"
89
#define	STRING_SCSTREAM	"StarCalcDocument"
90
90
91
#define	STRING_STANDARD	"Standard"
91
#define	STRING_STANDARD	"Standard"
92
92
93
// characters -----------------------------------------------------------------
93
// characters -----------------------------------------------------------------
94
94
95
//	'\r' geht auf'm Mac nicht...
95
//	'\r' geht auf'm Mac nicht...
96
#define CHAR_CR		char(13)
96
#define CHAR_CR		char(13)
97
97
98
const sal_Unicode CHAR_NBSP     = 0x00A0;
98
const sal_Unicode CHAR_NBSP     = 0x00A0;
99
const sal_Unicode CHAR_SHY      = 0x00AD;
99
const sal_Unicode CHAR_SHY      = 0x00AD;
100
const sal_Unicode CHAR_ZWSP     = 0x200B;
100
const sal_Unicode CHAR_ZWSP     = 0x200B;
101
const sal_Unicode CHAR_LRM      = 0x200E;
101
const sal_Unicode CHAR_LRM      = 0x200E;
102
const sal_Unicode CHAR_RLM      = 0x200F;
102
const sal_Unicode CHAR_RLM      = 0x200F;
103
const sal_Unicode CHAR_NBHY     = 0x2011;
103
const sal_Unicode CHAR_NBHY     = 0x2011;
104
const sal_Unicode CHAR_ZWNBSP   = 0x2060;
104
const sal_Unicode CHAR_ZWNBSP   = 0x2060;
105
105
106
// ----------------------------------------------------------------------------
106
// ----------------------------------------------------------------------------
107
107
108
#define	MINDOUBLE	1.7e-307
108
#define	MINDOUBLE	1.7e-307
109
#define	MAXDOUBLE	1.7e307
109
#define	MAXDOUBLE	1.7e307
110
110
111
#define MINZOOM 	20
111
#define MINZOOM 	20
112
#define MAXZOOM 	400
112
#define MAXZOOM 	400
113
113
114
#ifdef SC_ROWLIMIT_TYPECONVERSION_NOCONVPASS
114
#ifdef SC_ROWLIMIT_TYPECONVERSION_NOCONVPASS
115
const size_t MAXSUBTOTAL        = 3;
115
const size_t MAXSUBTOTAL        = 3;
116
const size_t MAXQUERY           = 8;
116
const size_t MAXQUERY           = 8;
117
#else
117
#else
118
const SCSIZE MAXSUBTOTAL        = 3;
118
const SCSIZE MAXSUBTOTAL        = 3;
119
const SCSIZE MAXQUERY           = 8;
119
const SCSIZE MAXQUERY           = 8;
120
#endif
120
#endif
121
121
122
#define SC_START_INDEX_DB_COLL 50000
122
#define SC_START_INDEX_DB_COLL 50000
123
										// Oberhalb dieser Grenze liegen
123
										// Oberhalb dieser Grenze liegen
124
										// die Indizes fuer DBBereiche
124
										// die Indizes fuer DBBereiche
125
125
126
/*
126
/*
127
#ifdef OS2
127
#ifdef OS2
128
#define PIXEL_PER_INCH      72.0
128
#define PIXEL_PER_INCH      72.0
129
#else
129
#else
130
#define PIXEL_PER_INCH      96.0
130
#define PIXEL_PER_INCH      96.0
131
#endif
131
#endif
132
*/
132
*/
133
133
134
#define PIXEL_PER_INCH      96.0
134
#define PIXEL_PER_INCH      96.0
135
135
136
#define CM_PER_INCH         2.54
136
#define CM_PER_INCH         2.54
137
#define POINTS_PER_INCH		72.27
137
#define POINTS_PER_INCH		72.27
138
#define PIXEL_PER_POINT		(PIXEL_PER_INCH / POINTS_PER_INCH)
138
#define PIXEL_PER_POINT		(PIXEL_PER_INCH / POINTS_PER_INCH)
139
#define INCHT_PER_CM		(1.0 / CM_PER_INCH)
139
#define INCHT_PER_CM		(1.0 / CM_PER_INCH)
140
#define POINTS_PER_CM		(POINTS_PER_INCH / CM_PER_INCH)
140
#define POINTS_PER_CM		(POINTS_PER_INCH / CM_PER_INCH)
141
#define TWIPS_PER_POINT		20.0
141
#define TWIPS_PER_POINT		20.0
142
#define TWIPS_PER_INCH		(TWIPS_PER_POINT * POINTS_PER_INCH)
142
#define TWIPS_PER_INCH		(TWIPS_PER_POINT * POINTS_PER_INCH)
143
#define TWIPS_PER_CM		(TWIPS_PER_INCH / CM_PER_INCH)
143
#define TWIPS_PER_CM		(TWIPS_PER_INCH / CM_PER_INCH)
144
#define CM_PER_TWIPS		(CM_PER_INCH / TWIPS_PER_INCH)
144
#define CM_PER_TWIPS		(CM_PER_INCH / TWIPS_PER_INCH)
145
#define TWIPS_PER_PIXEL		(TWIPS_PER_INCH / PIXEL_PER_INCH)
145
#define TWIPS_PER_PIXEL		(TWIPS_PER_INCH / PIXEL_PER_INCH)
146
#define TWIPS_PER_CHAR		(TWIPS_PER_INCH / 13.6)
146
#define TWIPS_PER_CHAR		(TWIPS_PER_INCH / 13.6)
147
#define PIXEL_PER_TWIPS		(PIXEL_PER_INCH / TWIPS_PER_INCH)
147
#define PIXEL_PER_TWIPS		(PIXEL_PER_INCH / TWIPS_PER_INCH)
148
#define HMM_PER_TWIPS		(CM_PER_TWIPS * 1000.0)
148
#define HMM_PER_TWIPS		(CM_PER_TWIPS * 1000.0)
149
149
150
#define STD_COL_WIDTH		1285
150
#define STD_COL_WIDTH		1285
151
#define STD_EXTRA_WIDTH		113		// 2mm Extra fuer optimale Breite
151
#define STD_EXTRA_WIDTH		113		// 2mm Extra fuer optimale Breite
152
									// Standard Zeilenhoehe: Text + Rand - STD_ROWHEIGHT_DIFF
152
									// Standard Zeilenhoehe: Text + Rand - STD_ROWHEIGHT_DIFF
153
153
154
154
155
#define MAX_EXTRA_WIDTH  	23811	// 42cm in TWIPS
155
#define MAX_EXTRA_WIDTH  	23811	// 42cm in TWIPS
156
#define MAX_EXTRA_HEIGHT	23811
156
#define MAX_EXTRA_HEIGHT	23811
157
#define MAX_COL_WIDTH		56693	// 1m in TWIPS
157
#define MAX_COL_WIDTH		56693	// 1m in TWIPS
158
#define MAX_COL_HEIGHT		56693
158
#define MAX_COL_HEIGHT		56693
159
159
160
#define STD_ROWHEIGHT_DIFF	23
160
#define STD_ROWHEIGHT_DIFF	23
161
#define STD_FONT_HEIGHT		200 	// entspricht 10 Punkt
161
#define STD_FONT_HEIGHT		200 	// entspricht 10 Punkt
162
162
163
//!		statt STD_ROW_HEIGHT ScGlobal::nStdRowHeight benutzen !
163
//!		statt STD_ROW_HEIGHT ScGlobal::nStdRowHeight benutzen !
164
164
165
#define STD_ROW_HEIGHT		(12.8 * TWIPS_PER_POINT) 			// 256 Twips, 0.45 cm
165
#define STD_ROW_HEIGHT		(12.8 * TWIPS_PER_POINT) 			// 256 Twips, 0.45 cm
166
166
167
									// Standardgroesse als Ole-Server (Zellen)
167
									// Standardgroesse als Ole-Server (Zellen)
168
#define OLE_STD_CELLS_X		4
168
#define OLE_STD_CELLS_X		4
169
#define OLE_STD_CELLS_Y		5
169
#define OLE_STD_CELLS_Y		5
170
170
171
#define SC_SIZE_OPTIMUM		0xFFFF
171
#define SC_SIZE_OPTIMUM		0xFFFF
172
172
173
									// Update-Flags
173
									// Update-Flags
174
#define UF_SCROLL_LEFT		1
174
#define UF_SCROLL_LEFT		1
175
#define UF_SCROLL_RIGHT		2
175
#define UF_SCROLL_RIGHT		2
176
#define UF_SCROLL_UP		4
176
#define UF_SCROLL_UP		4
177
#define UF_SCROLL_DOWN		8
177
#define UF_SCROLL_DOWN		8
178
#define UF_ROW				16
178
#define UF_ROW				16
179
#define UF_VIEW				32
179
#define UF_VIEW				32
180
180
181
									// Repaint-Flags (fuer Messages)
181
									// Repaint-Flags (fuer Messages)
182
#define PAINT_GRID			1
182
#define PAINT_GRID			1
183
#define PAINT_TOP			2
183
#define PAINT_TOP			2
184
#define PAINT_LEFT			4
184
#define PAINT_LEFT			4
185
#define PAINT_EXTRAS		8
185
#define PAINT_EXTRAS		8
186
#define PAINT_INVERT		16
186
#define PAINT_INVERT		16
187
#define PAINT_MARKS			32
187
#define PAINT_MARKS			32
188
#define PAINT_OBJECTS		64
188
#define PAINT_OBJECTS		64
189
#define PAINT_SIZE			128
189
#define PAINT_SIZE			128
190
#define PAINT_ALL			( PAINT_GRID | PAINT_TOP | PAINT_LEFT | PAINT_EXTRAS | PAINT_OBJECTS | PAINT_SIZE )
190
#define PAINT_ALL			( PAINT_GRID | PAINT_TOP | PAINT_LEFT | PAINT_EXTRAS | PAINT_OBJECTS | PAINT_SIZE )
191
191
192
192
193
									// Flags fuer Spalten / Zeilen
193
									// Flags fuer Spalten / Zeilen
194
									// FILTERED immer zusammen mit HIDDEN
194
									// FILTERED immer zusammen mit HIDDEN
195
									// FILTERED und MANUALSIZE nur fuer Zeilen moeglich
195
									// FILTERED und MANUALSIZE nur fuer Zeilen moeglich
196
const sal_uInt8   CR_HIDDEN      = 1;
196
const sal_uInt8   CR_HIDDEN      = 1;
197
//const sal_uInt8 CR_MARKED      = 2;
197
//const sal_uInt8 CR_MARKED      = 2;
198
//const sal_uInt8 CR_PAGEBREAK   = 4;
198
//const sal_uInt8 CR_PAGEBREAK   = 4;
199
const sal_uInt8   CR_MANUALBREAK = 8;
199
const sal_uInt8   CR_MANUALBREAK = 8;
200
const sal_uInt8   CR_FILTERED    = 16;
200
const sal_uInt8   CR_FILTERED    = 16;
201
const sal_uInt8   CR_MANUALSIZE  = 32;
201
const sal_uInt8   CR_MANUALSIZE  = 32;
202
const sal_uInt8   CR_ALL         = (CR_HIDDEN | CR_MANUALBREAK | CR_FILTERED | CR_MANUALSIZE);
202
const sal_uInt8   CR_ALL         = (CR_HIDDEN | CR_MANUALBREAK | CR_FILTERED | CR_MANUALSIZE);
203
203
204
typedef sal_uInt8 ScBreakType;
204
typedef sal_uInt8 ScBreakType;
205
const ScBreakType BREAK_NONE   = 0;
205
const ScBreakType BREAK_NONE   = 0;
206
const ScBreakType BREAK_PAGE   = 1;
206
const ScBreakType BREAK_PAGE   = 1;
207
const ScBreakType BREAK_MANUAL = 2;
207
const ScBreakType BREAK_MANUAL = 2;
208
208
209
// Insert-/Delete-Flags
209
// Insert-/Delete-Flags
210
const sal_uInt16 IDF_NONE       = 0x0000;
210
const sal_uInt16 IDF_NONE       = 0x0000;
211
const sal_uInt16 IDF_VALUE      = 0x0001;   /// Numeric values (and numeric results if IDF_FORMULA is not set).
211
const sal_uInt16 IDF_VALUE      = 0x0001;   /// Numeric values (and numeric results if IDF_FORMULA is not set).
212
const sal_uInt16 IDF_DATETIME   = 0x0002;   /// Dates, times, datetime values.
212
const sal_uInt16 IDF_DATETIME   = 0x0002;   /// Dates, times, datetime values.
213
const sal_uInt16 IDF_STRING     = 0x0004;   /// Strings (and string results if IDF_FORMULA is not set).
213
const sal_uInt16 IDF_STRING     = 0x0004;   /// Strings (and string results if IDF_FORMULA is not set).
214
const sal_uInt16 IDF_NOTE       = 0x0008;   /// Cell notes.
214
const sal_uInt16 IDF_NOTE       = 0x0008;   /// Cell notes.
215
const sal_uInt16 IDF_FORMULA    = 0x0010;   /// Formula cells.
215
const sal_uInt16 IDF_FORMULA    = 0x0010;   /// Formula cells.
216
const sal_uInt16 IDF_HARDATTR   = 0x0020;   /// Hard cell attributes.
216
const sal_uInt16 IDF_HARDATTR   = 0x0020;   /// Hard cell attributes.
217
const sal_uInt16 IDF_STYLES     = 0x0040;   /// Cell styles.
217
const sal_uInt16 IDF_STYLES     = 0x0040;   /// Cell styles.
218
const sal_uInt16 IDF_OBJECTS    = 0x0080;   /// Drawing objects.
218
const sal_uInt16 IDF_OBJECTS    = 0x0080;   /// Drawing objects.
219
const sal_uInt16 IDF_EDITATTR   = 0x0100;   /// Rich-text attributes.
219
const sal_uInt16 IDF_EDITATTR   = 0x0100;   /// Rich-text attributes.
220
const sal_uInt16 IDF_ATTRIB     = IDF_HARDATTR | IDF_STYLES;
220
const sal_uInt16 IDF_ATTRIB     = IDF_HARDATTR | IDF_STYLES;
221
const sal_uInt16 IDF_CONTENTS   = IDF_VALUE | IDF_DATETIME | IDF_STRING | IDF_NOTE | IDF_FORMULA;
221
const sal_uInt16 IDF_CONTENTS   = IDF_VALUE | IDF_DATETIME | IDF_STRING | IDF_NOTE | IDF_FORMULA;
222
const sal_uInt16 IDF_ALL        = IDF_CONTENTS | IDF_ATTRIB | IDF_OBJECTS;
222
const sal_uInt16 IDF_ALL        = IDF_CONTENTS | IDF_ATTRIB | IDF_OBJECTS;
223
const sal_uInt16 IDF_NOCAPTIONS = 0x0200;   /// Internal use only (undo etc.): do not copy/delete caption objects of cell notes.
223
const sal_uInt16 IDF_NOCAPTIONS = 0x0200;   /// Internal use only (undo etc.): do not copy/delete caption objects of cell notes.
224
const sal_uInt16 IDF_ADDNOTES   = 0x0400;   /// Internal use only (copy from clip): do not delete existing cell contents when pasting notes.
224
const sal_uInt16 IDF_ADDNOTES   = 0x0400;   /// Internal use only (copy from clip): do not delete existing cell contents when pasting notes.
225
225
226
/// Copy flags for auto/series fill functions: do not touch notes and drawing objects.
226
/// Copy flags for auto/series fill functions: do not touch notes and drawing objects.
227
const sal_uInt16 IDF_AUTOFILL   = IDF_ALL & ~(IDF_NOTE | IDF_OBJECTS);
227
const sal_uInt16 IDF_AUTOFILL   = IDF_ALL & ~(IDF_NOTE | IDF_OBJECTS);
228
228
229
#define PASTE_NOFUNC		0
229
#define PASTE_NOFUNC		0
230
#define PASTE_ADD			1
230
#define PASTE_ADD			1
231
#define PASTE_SUB			2
231
#define PASTE_SUB			2
232
#define PASTE_MUL			3
232
#define PASTE_MUL			3
233
#define PASTE_DIV			4
233
#define PASTE_DIV			4
234
234
235
#define PASTE_NONEMPTY		5
235
#define PASTE_NONEMPTY		5
236
236
237
										// Bits fuer HasAttr
237
										// Bits fuer HasAttr
238
#define HASATTR_LINES			1
238
#define HASATTR_LINES			1
239
#define HASATTR_MERGED			2
239
#define HASATTR_MERGED			2
240
#define HASATTR_OVERLAPPED		4
240
#define HASATTR_OVERLAPPED		4
241
#define HASATTR_PROTECTED		8
241
#define HASATTR_PROTECTED		8
242
#define HASATTR_SHADOW			16
242
#define HASATTR_SHADOW			16
243
#define HASATTR_NEEDHEIGHT		32
243
#define HASATTR_NEEDHEIGHT		32
244
#define HASATTR_SHADOW_RIGHT	64
244
#define HASATTR_SHADOW_RIGHT	64
245
#define HASATTR_SHADOW_DOWN		128
245
#define HASATTR_SHADOW_DOWN		128
246
#define HASATTR_AUTOFILTER		256
246
#define HASATTR_AUTOFILTER		256
247
#define HASATTR_CONDITIONAL		512
247
#define HASATTR_CONDITIONAL		512
248
#define HASATTR_ROTATE			1024
248
#define HASATTR_ROTATE			1024
249
#define HASATTR_NOTOVERLAPPED	2048
249
#define HASATTR_NOTOVERLAPPED	2048
250
#define HASATTR_RTL				4096
250
#define HASATTR_RTL				4096
251
#define HASATTR_RIGHTORCENTER   8192    // right or centered logical alignment
251
#define HASATTR_RIGHTORCENTER   8192    // right or centered logical alignment
252
252
253
#define HASATTR_PAINTEXT		( HASATTR_LINES | HASATTR_SHADOW | HASATTR_CONDITIONAL )
253
#define HASATTR_PAINTEXT		( HASATTR_LINES | HASATTR_SHADOW | HASATTR_CONDITIONAL )
254
254
255
255
256
#define EMPTY_STRING ScGlobal::GetEmptyString()
256
#define EMPTY_STRING ScGlobal::GetEmptyString()
257
257
258
										//	Layer-ID's fuer Drawing
258
										//	Layer-ID's fuer Drawing
259
#define SC_LAYER_FRONT		0
259
#define SC_LAYER_FRONT		0
260
#define SC_LAYER_BACK		1
260
#define SC_LAYER_BACK		1
261
#define SC_LAYER_INTERN		2
261
#define SC_LAYER_INTERN		2
262
#define SC_LAYER_CONTROLS	3
262
#define SC_LAYER_CONTROLS	3
263
#define SC_LAYER_HIDDEN     4
263
#define SC_LAYER_HIDDEN     4
264
264
265
										//	Tabellen linken
265
										//	Tabellen linken
266
#define SC_LINK_NONE		0
266
#define SC_LINK_NONE		0
267
#define SC_LINK_NORMAL		1
267
#define SC_LINK_NORMAL		1
268
#define SC_LINK_VALUE		2
268
#define SC_LINK_VALUE		2
269
269
270
										//	Eingabe
270
										//	Eingabe
271
#define SC_ENTER_NORMAL		0
271
#define SC_ENTER_NORMAL		0
272
#define SC_ENTER_BLOCK		1
272
#define SC_ENTER_BLOCK		1
273
#define SC_ENTER_MATRIX		2
273
#define SC_ENTER_MATRIX		2
274
274
275
										//	Step = 10pt, max. Einzug = 100 Schritte
275
										//	Step = 10pt, max. Einzug = 100 Schritte
276
#define SC_INDENT_STEP		200
276
#define SC_INDENT_STEP		200
277
#define SC_MAX_INDENT		20000
277
#define SC_MAX_INDENT		20000
278
278
279
										//	Szenario-Flags
279
										//	Szenario-Flags
280
#define SC_SCENARIO_COPYALL		1
280
#define SC_SCENARIO_COPYALL		1
281
#define SC_SCENARIO_SHOWFRAME	2
281
#define SC_SCENARIO_SHOWFRAME	2
282
#define SC_SCENARIO_PRINTFRAME	4
282
#define SC_SCENARIO_PRINTFRAME	4
283
#define SC_SCENARIO_TWOWAY		8
283
#define SC_SCENARIO_TWOWAY		8
284
#define SC_SCENARIO_ATTRIB		16
284
#define SC_SCENARIO_ATTRIB		16
285
#define SC_SCENARIO_VALUE		32
285
#define SC_SCENARIO_VALUE		32
286
#define SC_SCENARIO_PROTECT		64
286
#define SC_SCENARIO_PROTECT		64
287
287
288
288
289
#ifndef DELETEZ
289
#ifndef DELETEZ
290
#define DELETEZ(pPtr) { delete pPtr; pPtr = 0; }
290
#define DELETEZ(pPtr) { delete pPtr; pPtr = 0; }
291
#endif
291
#endif
292
292
293
									// Ist Bit in Set gesetzt?
293
									// Ist Bit in Set gesetzt?
294
#define IS_SET(bit,set)(((set)&(bit))==(bit))
294
#define IS_SET(bit,set)(((set)&(bit))==(bit))
295
295
296
#define SEL_ALL			-1	// Eingabezeile: alles Selektieren
296
#define SEL_ALL			-1	// Eingabezeile: alles Selektieren
297
#define RES_CANCEL		0	// Resultate der Funk.AutoPilot-Seiten
297
#define RES_CANCEL		0	// Resultate der Funk.AutoPilot-Seiten
298
#define RES_BACKWARD	1
298
#define RES_BACKWARD	1
299
#define RES_END			2
299
#define RES_END			2
300
300
301
enum CellType
301
enum CellType
302
	{
302
	{
303
		CELLTYPE_NONE,
303
		CELLTYPE_NONE,
304
		CELLTYPE_VALUE,
304
		CELLTYPE_VALUE,
305
		CELLTYPE_STRING,
305
		CELLTYPE_STRING,
306
		CELLTYPE_FORMULA,
306
		CELLTYPE_FORMULA,
307
		CELLTYPE_NOTE,
307
		CELLTYPE_NOTE,
308
		CELLTYPE_EDIT,
308
		CELLTYPE_EDIT,
309
		CELLTYPE_SYMBOLS 		// fuer Laden/Speichern
309
		CELLTYPE_SYMBOLS 		// fuer Laden/Speichern
310
#if DBG_UTIL
310
#if DBG_UTIL
311
   		,CELLTYPE_DESTROYED
311
   		,CELLTYPE_DESTROYED
312
#endif
312
#endif
313
	};
313
	};
314
314
315
enum DelCellCmd
315
enum DelCellCmd
316
	{
316
	{
317
		DEL_CELLSUP,
317
		DEL_CELLSUP,
318
		DEL_CELLSLEFT,
318
		DEL_CELLSLEFT,
319
		DEL_DELROWS,
319
		DEL_DELROWS,
320
		DEL_DELCOLS,
320
		DEL_DELCOLS,
321
		DEL_NONE
321
		DEL_NONE
322
	};
322
	};
323
323
324
enum InsCellCmd
324
enum InsCellCmd
325
	{
325
	{
326
		INS_CELLSDOWN,
326
		INS_CELLSDOWN,
327
		INS_CELLSRIGHT,
327
		INS_CELLSRIGHT,
328
		INS_INSROWS,
328
		INS_INSROWS,
329
		INS_INSCOLS,
329
		INS_INSCOLS,
330
		INS_NONE
330
		INS_NONE
331
	};
331
	};
332
332
333
enum UpdateRefMode
333
enum UpdateRefMode
334
	{
334
	{
335
		URM_INSDEL,
335
		URM_INSDEL,
336
		URM_COPY,
336
		URM_COPY,
337
		URM_MOVE,
337
		URM_MOVE,
338
		URM_REORDER
338
		URM_REORDER
339
	};
339
	};
340
340
341
enum FillDir
341
enum FillDir
342
	{
342
	{
343
		FILL_TO_BOTTOM,
343
		FILL_TO_BOTTOM,
344
		FILL_TO_RIGHT,
344
		FILL_TO_RIGHT,
345
		FILL_TO_TOP,
345
		FILL_TO_TOP,
346
		FILL_TO_LEFT
346
		FILL_TO_LEFT
347
	};
347
	};
348
348
349
enum FillCmd
349
enum FillCmd
350
	{
350
	{
351
		FILL_SIMPLE,
351
		FILL_SIMPLE,
352
		FILL_LINEAR,
352
		FILL_LINEAR,
353
		FILL_GROWTH,
353
		FILL_GROWTH,
354
		FILL_DATE,
354
		FILL_DATE,
355
		FILL_AUTO
355
		FILL_AUTO
356
	};
356
	};
357
357
358
enum FillDateCmd
358
enum FillDateCmd
359
	{
359
	{
360
		FILL_DAY,
360
		FILL_DAY,
361
		FILL_WEEKDAY,
361
		FILL_WEEKDAY,
362
		FILL_MONTH,
362
		FILL_MONTH,
363
		FILL_YEAR
363
		FILL_YEAR
364
	};
364
	};
365
365
366
enum ScDirection
366
enum ScDirection
367
	{
367
	{
368
		DIR_BOTTOM,
368
		DIR_BOTTOM,
369
		DIR_RIGHT,
369
		DIR_RIGHT,
370
		DIR_TOP,
370
		DIR_TOP,
371
		DIR_LEFT
371
		DIR_LEFT
372
	};
372
	};
373
373
374
enum ScSizeMode
374
enum ScSizeMode
375
	{
375
	{
376
		SC_SIZE_DIRECT,				// set size or hide if value is 0
376
		SC_SIZE_DIRECT,				// set size or hide if value is 0
377
		SC_SIZE_OPTIMAL,			// set optimal size for everything
377
		SC_SIZE_OPTIMAL,			// set optimal size for everything
378
		SC_SIZE_SHOW,				// show with original size
378
		SC_SIZE_SHOW,				// show with original size
379
		SC_SIZE_VISOPT,				// set optimal size only if visible
379
		SC_SIZE_VISOPT,				// set optimal size only if visible
380
		SC_SIZE_ORIGINAL			// only set size, don't change visible flag
380
		SC_SIZE_ORIGINAL			// only set size, don't change visible flag
381
	};
381
	};
382
382
383
enum ScInputMode
383
enum ScInputMode
384
	{
384
	{
385
		SC_INPUT_NONE,
385
		SC_INPUT_NONE,
386
		SC_INPUT_TYPE,				// Eingabe, ohne im Inplace-Modus zu sein
386
		SC_INPUT_TYPE,				// Eingabe, ohne im Inplace-Modus zu sein
387
		SC_INPUT_TABLE,				// Textcursor in der Tabelle
387
		SC_INPUT_TABLE,				// Textcursor in der Tabelle
388
		SC_INPUT_TOP				// Textcursor in der Eingabezeile
388
		SC_INPUT_TOP				// Textcursor in der Eingabezeile
389
	};
389
	};
390
390
391
enum ScVObjMode						// Ausgabemodi von Objekten auf einer Seite
391
enum ScVObjMode						// Ausgabemodi von Objekten auf einer Seite
392
{
392
{
393
	VOBJ_MODE_SHOW,
393
	VOBJ_MODE_SHOW,
394
	VOBJ_MODE_HIDE
394
	VOBJ_MODE_HIDE
395
	// #i80528# VOBJ_MODE_DUMMY removed, no longer supported
395
	// #i80528# VOBJ_MODE_DUMMY removed, no longer supported
396
};
396
};
397
397
398
enum ScAnchorType 					// Verankerung eines Zeichenobjekts
398
enum ScAnchorType 					// Verankerung eines Zeichenobjekts
399
{
399
{
400
	SCA_CELL,
400
	SCA_CELL,
401
	SCA_PAGE,
401
	SCA_PAGE,
402
	SCA_DONTKNOW 					// bei Mehrfachselektion
402
	SCA_DONTKNOW 					// bei Mehrfachselektion
403
};
403
};
404
404
405
enum ScGetDBMode
405
enum ScGetDBMode
406
{
406
{
407
	SC_DB_MAKE,		// wenn noetig, "unbenannt" anlegen
407
	SC_DB_MAKE,		// wenn noetig, "unbenannt" anlegen
408
	SC_DB_IMPORT,	// wenn noetig, "Importx" anlegen
408
	SC_DB_IMPORT,	// wenn noetig, "Importx" anlegen
409
	SC_DB_OLD		// nicht neu anlegen
409
	SC_DB_OLD,		// nicht neu anlegen
410
};
410
	SC_DB_MAKE_FILTER,   // to create a new filter/sort/subtotal
411
411
	SC_DB_MAKE_SORT,
412
/// For ScDBFunc::GetDBData()
412
	SC_DB_MAKE_SUBTOTAL,
413
enum ScGetDBSelection
413
    SC_DB_OLD_FILTER   //to find a existed filter
414
{
414
};
415
    /** Keep selection as is, expand to used data area if no selection. */
415
416
    SC_DBSEL_KEEP,
416
/// For ScDBFunc::GetDBData()
417
417
enum ScGetDBSelection
418
    /** Shrink selection to sheet's data area. */
418
{
419
    SC_DBSEL_SHRINK_TO_SHEET_DATA,
419
    /** Keep selection as is, expand to used data area if no selection. */
420
420
    SC_DBSEL_KEEP,
421
    /** Shrink selection to actually used data area within the selection. */
421
422
    SC_DBSEL_SHRINK_TO_USED_DATA,
422
    /** Shrink selection to sheet's data area. */
423
423
    SC_DBSEL_SHRINK_TO_SHEET_DATA,
424
    /** If only one row or portion thereof is selected, shrink row to used data 
424
425
        columns and select further rows down until end of data. If an area is 
425
    /** Shrink selection to actually used data area within the selection. */
426
        selected, shrink rows to actually used columns. Else, no selection, 
426
    SC_DBSEL_SHRINK_TO_USED_DATA,
427
        expand to used data area. */
427
428
    SC_DBSEL_ROW_DOWN,
428
    /** If only one row or portion thereof is selected, shrink row to used data 
429
429
        columns and select further rows down until end of data. If an area is 
430
    /** Behave as if the range corresponding to a ScDBData area was selected, 
430
        selected, shrink rows to actually used columns. Else, no selection, 
431
        for API use. */
431
        expand to used data area. */
432
    SC_DBSEL_FORCE_MARK
432
    SC_DBSEL_ROW_DOWN,
433
};
433
434
434
    /** Behave as if the range corresponding to a ScDBData area was selected, 
435
enum ScLkUpdMode
435
        for API use. */
436
{					//Verknuepfungen
436
    SC_DBSEL_FORCE_MARK
437
	LM_ALWAYS,		//immer aktualisieren
437
};
438
	LM_NEVER,		//niemals
438
439
	LM_ON_DEMAND,	//auf nachfrage
439
enum ScLkUpdMode
440
	LM_UNKNOWN		//Shit happens
440
{					//Verknuepfungen
441
};
441
	LM_ALWAYS,		//immer aktualisieren
442
442
	LM_NEVER,		//niemals
443
443
	LM_ON_DEMAND,	//auf nachfrage
444
// -----------------------------------------------------------------------
444
	LM_UNKNOWN		//Shit happens
445
445
};
446
//==================================================================
446
447
447
448
// -----------------------------------------------------------------------
448
// -----------------------------------------------------------------------
449
449
450
// enum with values equal to old DBObject enum from sdb
450
//==================================================================
451
enum ScDBObject
451
452
{
452
// -----------------------------------------------------------------------
453
	ScDbTable,
453
454
	ScDbQuery
454
// enum with values equal to old DBObject enum from sdb
455
};
455
enum ScDBObject
456
456
{
457
struct ScImportParam
457
	ScDbTable,
458
{
458
	ScDbQuery
459
	SCCOL			nCol1;
459
};
460
	SCROW			nRow1;
460
461
	SCCOL			nCol2;
461
struct ScImportParam
462
	SCROW			nRow2;
462
{
463
	sal_Bool			bImport;
463
	SCCOL			nCol1;
464
	String			aDBName;					// Alias der Datenbank
464
	SCROW			nRow1;
465
	String			aStatement;
465
	SCCOL			nCol2;
466
	sal_Bool			bNative;
466
	SCROW			nRow2;
467
	sal_Bool			bSql;						// Statement oder Name?
467
	sal_Bool			bImport;
468
	sal_uInt8			nType;						// enum DBObject
468
	String			aDBName;					// Alias der Datenbank
469
469
	String			aStatement;
470
	ScImportParam();
470
	sal_Bool			bNative;
471
	ScImportParam( const ScImportParam& r );
471
	sal_Bool			bSql;						// Statement oder Name?
472
	~ScImportParam();
472
	sal_uInt8			nType;						// enum DBObject
473
473
474
	ScImportParam&	operator=	( const ScImportParam& r );
474
	ScImportParam();
475
	sal_Bool			operator==	( const ScImportParam& r ) const;
475
	ScImportParam( const ScImportParam& r );
476
//UNUSED2009-05 void			Clear		();
476
	~ScImportParam();
477
};
477
478
478
	ScImportParam&	operator=	( const ScImportParam& r );
479
struct ScStringHashCode
479
	sal_Bool			operator==	( const ScImportParam& r ) const;
480
{
480
//UNUSED2009-05 void			Clear		();
481
    size_t operator()( const String& rStr ) const
481
};
482
    {
482
483
        return rtl_ustr_hashCode_WithLength( rStr.GetBuffer(), rStr.Len() );
483
struct ScStringHashCode
484
    }
484
{
485
};
485
    size_t operator()( const String& rStr ) const
486
486
    {
487
// -----------------------------------------------------------------------
487
        return rtl_ustr_hashCode_WithLength( rStr.GetBuffer(), rStr.Len() );
488
488
    }
489
class ScDocument;
489
};
490
class ScDocShell;
490
491
class ScDocShellRef;
491
// -----------------------------------------------------------------------
492
class SvxSearchItem;
492
493
class ScAutoFormat;
493
class ScDocument;
494
class FuncCollection;
494
class ScDocShell;
495
class ScUnoAddInCollection;
495
class ScDocShellRef;
496
class ScUserList;
496
class SvxSearchItem;
497
class SvxBrushItem;
497
class ScAutoFormat;
498
class ScFunctionList;
498
class FuncCollection;
499
class ScFunctionMgr;
499
class ScUnoAddInCollection;
500
class SfxItemPool;
500
class ScUserList;
501
class SdrModel;
501
class SvxBrushItem;
502
class EditTextObject;
502
class ScFunctionList;
503
class SfxObjectShell;
503
class ScFunctionMgr;
504
class SvNumberFormatter;
504
class SfxItemPool;
505
class ScUnitConverter;
505
class SdrModel;
506
class CharClass;
506
class EditTextObject;
507
class LocaleDataWrapper;
507
class SfxObjectShell;
508
class SvtSysLocale;
508
class SvNumberFormatter;
509
class CalendarWrapper;
509
class ScUnitConverter;
510
class CollatorWrapper;
510
class CharClass;
511
class IntlWrapper;
511
class LocaleDataWrapper;
512
class OutputDevice;
512
class SvtSysLocale;
513
513
class CalendarWrapper;
514
namespace com { namespace sun { namespace star {
514
class CollatorWrapper;
515
    namespace lang {
515
class IntlWrapper;
516
        struct Locale;
516
class OutputDevice;
517
    }
517
518
    namespace i18n {
518
namespace com { namespace sun { namespace star {
519
        class XOrdinalSuffix;
519
    namespace lang {
520
    }
520
        struct Locale;
521
}}}
521
    }
522
namespace utl {
522
    namespace i18n {
523
    class TransliterationWrapper;
523
        class XOrdinalSuffix;
524
}
524
    }
525
525
}}}
526
#ifndef _SCALC_EXE
526
namespace utl {
527
class ScGlobal
527
    class TransliterationWrapper;
528
{
528
}
529
	static SvxSearchItem*	pSearchItem;
529
530
	static ScAutoFormat*	pAutoFormat;
530
#ifndef _SCALC_EXE
531
	static FuncCollection*	pFuncCollection;
531
class ScGlobal
532
	static ScUnoAddInCollection* pAddInCollection;
532
{
533
	static ScUserList*		pUserList;
533
	static SvxSearchItem*	pSearchItem;
534
	static String**			ppRscString;
534
	static ScAutoFormat*	pAutoFormat;
535
	static String* 			pStrScDoc;
535
	static FuncCollection*	pFuncCollection;
536
	static String*          pEmptyString;
536
	static ScUnoAddInCollection* pAddInCollection;
537
	static String*			pStrClipDocName;
537
	static ScUserList*		pUserList;
538
	static SvxBrushItem*    pEmptyBrushItem;
538
	static String**			ppRscString;
539
	static SvxBrushItem*	pButtonBrushItem;
539
	static String* 			pStrScDoc;
540
	static SvxBrushItem*	pEmbeddedBrushItem;
540
	static String*          pEmptyString;
541
	static SvxBrushItem*	pProtectedBrushItem;
541
	static String*			pStrClipDocName;
542
542
	static SvxBrushItem*    pEmptyBrushItem;
543
    static ImageList*       pOutlineBitmaps;
543
	static SvxBrushItem*	pButtonBrushItem;
544
    static ImageList*       pOutlineBitmapsHC;
544
	static SvxBrushItem*	pEmbeddedBrushItem;
545
545
	static SvxBrushItem*	pProtectedBrushItem;
546
//	static Bitmap*			pAnchorBitmap;
546
547
//	static Bitmap*			pGrayAnchorBitmap;
547
    static ImageList*       pOutlineBitmaps;
548
548
    static ImageList*       pOutlineBitmapsHC;
549
	static ScFunctionList*	pStarCalcFunctionList;
549
550
	static ScFunctionMgr*	pStarCalcFunctionMgr;
550
//	static Bitmap*			pAnchorBitmap;
551
551
//	static Bitmap*			pGrayAnchorBitmap;
552
	static ScUnitConverter*	pUnitConverter;
552
553
553
	static ScFunctionList*	pStarCalcFunctionList;
554
    static  SvNumberFormatter*  pEnglishFormatter;          // for UNO / XML export
554
	static ScFunctionMgr*	pStarCalcFunctionMgr;
555
555
556
    static ::com::sun::star::uno::Reference< ::com::sun::star::i18n::XOrdinalSuffix> xOrdinalSuffix;
556
	static ScUnitConverter*	pUnitConverter;
557
    static CalendarWrapper*		pCalendar;
557
558
    static CollatorWrapper*		pCaseCollator;
558
    static  SvNumberFormatter*  pEnglishFormatter;          // for UNO / XML export
559
    static CollatorWrapper*		pCollator;
559
560
    static ::utl::TransliterationWrapper* pTransliteration;
560
    static ::com::sun::star::uno::Reference< ::com::sun::star::i18n::XOrdinalSuffix> xOrdinalSuffix;
561
    static ::utl::TransliterationWrapper* pCaseTransliteration;
561
    static CalendarWrapper*		pCalendar;
562
    static IntlWrapper*         pScIntlWrapper;
562
    static CollatorWrapper*		pCaseCollator;
563
    static ::com::sun::star::lang::Locale*		pLocale;
563
    static CollatorWrapper*		pCollator;
564
564
    static ::utl::TransliterationWrapper* pTransliteration;
565
public:	
565
    static ::utl::TransliterationWrapper* pCaseTransliteration;
566
    static SvtSysLocale*        pSysLocale;
566
    static IntlWrapper*         pScIntlWrapper;
567
    // for faster access a pointer to the single instance provided by SvtSysLocale
567
    static ::com::sun::star::lang::Locale*		pLocale;
568
    SC_DLLPUBLIC static const CharClass*     pCharClass;
568
569
    // for faster access a pointer to the single instance provided by SvtSysLocale
569
public:	
570
    SC_DLLPUBLIC static const LocaleDataWrapper* pLocaleData;
570
    static SvtSysLocale*        pSysLocale;
571
    SC_DLLPUBLIC static const LocaleDataWrapper* GetpLocaleData();
571
    // for faster access a pointer to the single instance provided by SvtSysLocale
572
572
    SC_DLLPUBLIC static const CharClass*     pCharClass;
573
    static CalendarWrapper*     GetCalendar();
573
    // for faster access a pointer to the single instance provided by SvtSysLocale
574
    SC_DLLPUBLIC static CollatorWrapper*		GetCollator();
574
    SC_DLLPUBLIC static const LocaleDataWrapper* pLocaleData;
575
    static CollatorWrapper*		GetCaseCollator();
575
    SC_DLLPUBLIC static const LocaleDataWrapper* GetpLocaleData();
576
    static IntlWrapper*         GetScIntlWrapper();
576
577
    static ::com::sun::star::lang::Locale*		GetLocale();
577
    static CalendarWrapper*     GetCalendar();
578
    
578
    SC_DLLPUBLIC static CollatorWrapper*		GetCollator();
579
    SC_DLLPUBLIC static ::utl::TransliterationWrapper* GetpTransliteration(); //CHINA001
579
    static CollatorWrapper*		GetCaseCollator();
580
    static ::utl::TransliterationWrapper* GetCaseTransliteration();
580
    static IntlWrapper*         GetScIntlWrapper();
581
    
581
    static ::com::sun::star::lang::Locale*		GetLocale();
582
    SC_DLLPUBLIC static LanguageType	   		eLnge;
582
    
583
	static sal_Unicode			cListDelimiter;
583
    SC_DLLPUBLIC static ::utl::TransliterationWrapper* GetpTransliteration(); //CHINA001
584
584
    static ::utl::TransliterationWrapper* GetCaseTransliteration();
585
	static const String&	 	GetClipDocName();
585
    
586
	static void 			 	SetClipDocName( const String& rNew );
586
    SC_DLLPUBLIC static LanguageType	   		eLnge;
587
	SC_DLLPUBLIC static const SvxSearchItem&	GetSearchItem();
587
	static sal_Unicode			cListDelimiter;
588
	SC_DLLPUBLIC static void					SetSearchItem( const SvxSearchItem& rNew );
588
589
    SC_DLLPUBLIC static ScAutoFormat*		GetAutoFormat();
589
	static const String&	 	GetClipDocName();
590
	static void					ClearAutoFormat(); //BugId 54209
590
	static void 			 	SetClipDocName( const String& rNew );
591
	static FuncCollection*		GetFuncCollection();
591
	SC_DLLPUBLIC static const SvxSearchItem&	GetSearchItem();
592
    SC_DLLPUBLIC static ScUnoAddInCollection* GetAddInCollection();
592
	SC_DLLPUBLIC static void					SetSearchItem( const SvxSearchItem& rNew );
593
    SC_DLLPUBLIC static ScUserList*			GetUserList();
593
    SC_DLLPUBLIC static ScAutoFormat*		GetAutoFormat();
594
	static void					SetUserList( const ScUserList* pNewList );
594
	static void					ClearAutoFormat(); //BugId 54209
595
    SC_DLLPUBLIC static const String&		GetRscString( sal_uInt16 nIndex );
595
	static FuncCollection*		GetFuncCollection();
596
	static void					OpenURL( const String& rURL, const String& rTarget );
596
    SC_DLLPUBLIC static ScUnoAddInCollection* GetAddInCollection();
597
    SC_DLLPUBLIC static String				GetAbsDocName( const String& rFileName,
597
    SC_DLLPUBLIC static ScUserList*			GetUserList();
598
												SfxObjectShell* pShell );
598
	static void					SetUserList( const ScUserList* pNewList );
599
    SC_DLLPUBLIC static String				GetDocTabName( const String& rFileName,
599
    SC_DLLPUBLIC static const String&		GetRscString( sal_uInt16 nIndex );
600
												const String& rTabName );
600
	static void					OpenURL( const String& rURL, const String& rTarget );
601
    SC_DLLPUBLIC static sal_uLong				GetStandardFormat( SvNumberFormatter&,
601
    SC_DLLPUBLIC static String				GetAbsDocName( const String& rFileName,
602
									sal_uLong nFormat, short nType );
602
												SfxObjectShell* pShell );
603
    SC_DLLPUBLIC static sal_uLong				GetStandardFormat( double, SvNumberFormatter&,
603
    SC_DLLPUBLIC static String				GetDocTabName( const String& rFileName,
604
									sal_uLong nFormat, short nType );
604
												const String& rTabName );
605
605
    SC_DLLPUBLIC static sal_uLong				GetStandardFormat( SvNumberFormatter&,
606
    SC_DLLPUBLIC static double				nScreenPPTX;
606
									sal_uLong nFormat, short nType );
607
    SC_DLLPUBLIC static double				nScreenPPTY;
607
    SC_DLLPUBLIC static sal_uLong				GetStandardFormat( double, SvNumberFormatter&,
608
608
									sal_uLong nFormat, short nType );
609
	static ScDocShellRef*	pDrawClipDocShellRef;
609
610
610
    SC_DLLPUBLIC static double				nScreenPPTX;
611
	static sal_uInt16			nDefFontHeight;
611
    SC_DLLPUBLIC static double				nScreenPPTY;
612
	static sal_uInt16			nStdRowHeight;
612
613
613
	static ScDocShellRef*	pDrawClipDocShellRef;
614
    SC_DLLPUBLIC static long				nLastRowHeightExtra;
614
615
	static long				nLastColWidthExtra;
615
	static sal_uInt16			nDefFontHeight;
616
616
	static sal_uInt16			nStdRowHeight;
617
	static void             Init();						// am Anfang
617
618
	static void             InitAddIns();
618
    SC_DLLPUBLIC static long				nLastRowHeightExtra;
619
	static void				Clear();					// bei Programmende
619
	static long				nLastColWidthExtra;
620
620
621
	static void				UpdatePPT(OutputDevice* pDev);
621
	static void             Init();						// am Anfang
622
622
	static void             InitAddIns();
623
	static void             InitTextHeight(SfxItemPool* pPool);
623
	static void				Clear();					// bei Programmende
624
	static SvxBrushItem*	GetEmptyBrushItem()	{ return pEmptyBrushItem; }
624
625
    static SvxBrushItem*    GetButtonBrushItem();
625
	static void				UpdatePPT(OutputDevice* pDev);
626
	static SvxBrushItem*	GetEmbeddedBrushItem()	{ return pEmbeddedBrushItem; }
626
627
	static SvxBrushItem*	GetProtectedBrushItem()	{ return pProtectedBrushItem; }
627
	static void             InitTextHeight(SfxItemPool* pPool);
628
    SC_DLLPUBLIC    static const String&	GetEmptyString();
628
	static SvxBrushItem*	GetEmptyBrushItem()	{ return pEmptyBrushItem; }
629
	static const String& 	GetScDocString();
629
    static SvxBrushItem*    GetButtonBrushItem();
630
630
	static SvxBrushItem*	GetEmbeddedBrushItem()	{ return pEmbeddedBrushItem; }
631
    /** Returns the specified image list with outline symbols.
631
	static SvxBrushItem*	GetProtectedBrushItem()	{ return pProtectedBrushItem; }
632
        @param bHC  false = standard symbols; true = high contrast symbols. */
632
    SC_DLLPUBLIC    static const String&	GetEmptyString();
633
    static ImageList*       GetOutlineSymbols( bool bHC );
633
	static const String& 	GetScDocString();
634
634
635
//	static const Bitmap&	GetAnchorBitmap();
635
    /** Returns the specified image list with outline symbols.
636
//	static const Bitmap&	GetGrayAnchorBitmap();
636
        @param bHC  false = standard symbols; true = high contrast symbols. */
637
637
    static ImageList*       GetOutlineSymbols( bool bHC );
638
    static bool             HasStarCalcFunctionList();
638
639
	static ScFunctionList*	GetStarCalcFunctionList();
639
//	static const Bitmap&	GetAnchorBitmap();
640
	static ScFunctionMgr*	GetStarCalcFunctionMgr();
640
//	static const Bitmap&	GetGrayAnchorBitmap();
641
    static void             ResetFunctionList();
641
642
642
    static bool             HasStarCalcFunctionList();
643
	static String			GetErrorString(sal_uInt16 nErrNumber);
643
	static ScFunctionList*	GetStarCalcFunctionList();
644
	static String			GetLongErrorString(sal_uInt16 nErrNumber);
644
	static ScFunctionMgr*	GetStarCalcFunctionMgr();
645
	static sal_Bool				EETextObjEqual( const EditTextObject* pObj1,
645
    static void             ResetFunctionList();
646
											const EditTextObject* pObj2 );
646
647
	static sal_Bool				CheckWidthInvalidate( sal_Bool& bNumFormatChanged,
647
	static String			GetErrorString(sal_uInt16 nErrNumber);
648
												  const SfxItemSet& rNewAttrs,
648
	static String			GetLongErrorString(sal_uInt16 nErrNumber);
649
												  const SfxItemSet& rOldAttrs );
649
	static sal_Bool				EETextObjEqual( const EditTextObject* pObj1,
650
	static sal_Bool				HasAttrChanged( const SfxItemSet& rNewAttrs,
650
											const EditTextObject* pObj2 );
651
											const SfxItemSet& rOldAttrs,
651
	static sal_Bool				CheckWidthInvalidate( sal_Bool& bNumFormatChanged,
652
											const sal_uInt16	  nWhich );
652
												  const SfxItemSet& rNewAttrs,
653
653
												  const SfxItemSet& rOldAttrs );
654
	static ScUnitConverter*	GetUnitConverter();
654
	static sal_Bool				HasAttrChanged( const SfxItemSet& rNewAttrs,
655
655
											const SfxItemSet& rOldAttrs,
656
	/// strchr() functionality on unicode, as long as we need it for ScToken etc.
656
											const sal_uInt16	  nWhich );
657
	static const sal_Unicode* UnicodeStrChr( const sal_Unicode* pStr, sal_Unicode c );
657
658
658
	static ScUnitConverter*	GetUnitConverter();
659
	static inline sal_Unicode ToUpperAlpha( sal_Unicode c )
659
660
		{ return ( c >= 'a' && c <= 'z' ) ? ( c-'a'+'A' ) : c; }
660
	/// strchr() functionality on unicode, as long as we need it for ScToken etc.
661
661
	static const sal_Unicode* UnicodeStrChr( const sal_Unicode* pStr, sal_Unicode c );
662
    /** Adds the string rToken to rTokenList, using a list separator character.
662
663
        @param rTokenList  The string list where the token will be appended to.
663
	static inline sal_Unicode ToUpperAlpha( sal_Unicode c )
664
        @param rToken  The token string to append to the token list.
664
		{ return ( c >= 'a' && c <= 'z' ) ? ( c-'a'+'A' ) : c; }
665
        @param cSep  The character to separate the tokens.
665
666
        @param nSepCount  Specifies how often cSep is inserted between two tokens.
666
    /** Adds the string rToken to rTokenList, using a list separator character.
667
        @param bForceSep  true = Always insert separator; false = Only, if not at begin or end. */
667
        @param rTokenList  The string list where the token will be appended to.
668
    SC_DLLPUBLIC static void             AddToken(
668
        @param rToken  The token string to append to the token list.
669
                                String& rTokenList, const String& rToken,
669
        @param cSep  The character to separate the tokens.
670
                                sal_Unicode cSep, xub_StrLen nSepCount = 1,
670
        @param nSepCount  Specifies how often cSep is inserted between two tokens.
671
                                bool bForceSep = false );
671
        @param bForceSep  true = Always insert separator; false = Only, if not at begin or end. */
672
672
    SC_DLLPUBLIC static void             AddToken(
673
    /** Returns true, if the first and last character of the string is cQuote. */
673
                                String& rTokenList, const String& rToken,
674
    SC_DLLPUBLIC static bool             IsQuoted( const String& rString, sal_Unicode cQuote = '\'' );
674
                                sal_Unicode cSep, xub_StrLen nSepCount = 1,
675
675
                                bool bForceSep = false );
676
    /** Inserts the character cQuote at beginning and end of rString.
676
677
        @param bEscapeEmbedded      If <TRUE/>, embedded quote characters are
677
    /** Returns true, if the first and last character of the string is cQuote. */
678
                                    escaped by doubling them.
678
    SC_DLLPUBLIC static bool             IsQuoted( const String& rString, sal_Unicode cQuote = '\'' );
679
     */
679
680
SC_DLLPUBLIC    static void             AddQuotes( String& rString, sal_Unicode cQuote = '\'', bool bEscapeEmbedded = true );
680
    /** Inserts the character cQuote at beginning and end of rString.
681
681
        @param bEscapeEmbedded      If <TRUE/>, embedded quote characters are
682
    /** Erases the character cQuote from rString, if it exists at beginning AND end.
682
                                    escaped by doubling them.
683
        @param bUnescapeEmbedded    If <TRUE/>, embedded doubled quote characters
683
     */
684
                                    are unescaped by replacing them with a
684
SC_DLLPUBLIC    static void             AddQuotes( String& rString, sal_Unicode cQuote = '\'', bool bEscapeEmbedded = true );
685
                                    single instance.
685
686
     */
686
    /** Erases the character cQuote from rString, if it exists at beginning AND end.
687
SC_DLLPUBLIC    static void             EraseQuotes( String& rString, sal_Unicode cQuote = '\'', bool bUnescapeEmbedded = true );
687
        @param bUnescapeEmbedded    If <TRUE/>, embedded doubled quote characters
688
688
                                    are unescaped by replacing them with a
689
    /** Finds an unquoted instance of cChar in rString, starting at
689
                                    single instance.
690
        offset nStart. Unquoted instances may occur when concatenating two
690
     */
691
        quoted strings with a separator, for example, 's1':'s2'. Embedded
691
SC_DLLPUBLIC    static void             EraseQuotes( String& rString, sal_Unicode cQuote = '\'', bool bUnescapeEmbedded = true );
692
        quotes have to be escaped by being doubled. Caller must ensure that
692
693
        nStart points into an unquoted range or the opening quote. Specialty:
693
    /** Finds an unquoted instance of cChar in rString, starting at
694
        if cChar==cQuote the first cQuote character from nStart on is found.
694
        offset nStart. Unquoted instances may occur when concatenating two
695
        @returns offset if found, else STRING_NOTFOUND
695
        quoted strings with a separator, for example, 's1':'s2'. Embedded
696
     */
696
        quotes have to be escaped by being doubled. Caller must ensure that
697
SC_DLLPUBLIC    static xub_StrLen       FindUnquoted( const String& rString, sal_Unicode cChar, xub_StrLen nStart = 0, sal_Unicode cQuote = '\'' );
697
        nStart points into an unquoted range or the opening quote. Specialty:
698
698
        if cChar==cQuote the first cQuote character from nStart on is found.
699
    /** Finds an unquoted instance of cChar in null-terminated pString. Same
699
        @returns offset if found, else STRING_NOTFOUND
700
        semantics as FindUnquoted( const String&, ...)
700
     */
701
        @returns: pointer to cChar if found, else NULL
701
SC_DLLPUBLIC    static xub_StrLen       FindUnquoted( const String& rString, sal_Unicode cChar, xub_StrLen nStart = 0, sal_Unicode cQuote = '\'' );
702
     */
702
703
SC_DLLPUBLIC    static const sal_Unicode* FindUnquoted( const sal_Unicode* pString, sal_Unicode cChar, sal_Unicode cQuote = '\'' );
703
    /** Finds an unquoted instance of cChar in null-terminated pString. Same
704
704
        semantics as FindUnquoted( const String&, ...)
705
705
        @returns: pointer to cChar if found, else NULL
706
	static	CharSet			GetCharsetValue( const String& rCharSet );
706
     */
707
	static	String			GetCharsetString( CharSet eVal );
707
SC_DLLPUBLIC    static const sal_Unicode* FindUnquoted( const sal_Unicode* pString, sal_Unicode cChar, sal_Unicode cQuote = '\'' );
708
708
709
    /// a "ReadOnly" formatter for UNO/XML export
709
710
    static  SvNumberFormatter*  GetEnglishFormatter();
710
	static	CharSet			GetCharsetValue( const String& rCharSet );
711
711
	static	String			GetCharsetString( CharSet eVal );
712
	static sal_Bool IsSystemRTL();						// depending on system language
712
713
	static LanguageType GetEditDefaultLanguage();	// for EditEngine::SetDefaultLanguage
713
    /// a "ReadOnly" formatter for UNO/XML export
714
    SC_DLLPUBLIC static sal_uInt8	GetDefaultScriptType();				// for all WEAK characters
714
    static  SvNumberFormatter*  GetEnglishFormatter();
715
    /** Map ATTR_((CJK|CTL)_)?FONT_... to proper WhichIDs.
715
716
        If more than one SCRIPTTYPE_... values are or'ed together, prefers
716
	static sal_Bool IsSystemRTL();						// depending on system language
717
        first COMPLEX, then ASIAN */
717
	static LanguageType GetEditDefaultLanguage();	// for EditEngine::SetDefaultLanguage
718
    SC_DLLPUBLIC static sal_uInt16 GetScriptedWhichID( sal_uInt8 nScriptType, sal_uInt16 nWhich );
718
    SC_DLLPUBLIC static sal_uInt8	GetDefaultScriptType();				// for all WEAK characters
719
719
    /** Map ATTR_((CJK|CTL)_)?FONT_... to proper WhichIDs.
720
    /** Adds a language item to the item set, if the number format item contains
720
        If more than one SCRIPTTYPE_... values are or'ed together, prefers
721
        a language that differs from its parent's language. */
721
        first COMPLEX, then ASIAN */
722
    SC_DLLPUBLIC static void             AddLanguage( SfxItemSet& rSet, SvNumberFormatter& rFormatter );
722
    SC_DLLPUBLIC static sal_uInt16 GetScriptedWhichID( sal_uInt8 nScriptType, sal_uInt16 nWhich );
723
723
724
    /** Obtain the ordinal suffix for a number according to the system locale */
724
    /** Adds a language item to the item set, if the number format item contains
725
    static String           GetOrdinalSuffix( sal_Int32 nNumber);
725
        a language that differs from its parent's language. */
726
};
726
    SC_DLLPUBLIC static void             AddLanguage( SfxItemSet& rSet, SvNumberFormatter& rFormatter );
727
#endif
727
728
728
    /** Obtain the ordinal suffix for a number according to the system locale */
729
//==================================================================
729
    static String           GetOrdinalSuffix( sal_Int32 nNumber);
730
// evtl. in dbdata.hxx auslagern (?):
730
};
731
731
#endif
732
enum ScQueryOp
732
733
	{
733
//==================================================================
734
		SC_EQUAL,
734
// evtl. in dbdata.hxx auslagern (?):
735
		SC_LESS,
735
736
		SC_GREATER,
736
enum ScQueryOp
737
		SC_LESS_EQUAL,
737
	{
738
		SC_GREATER_EQUAL,
738
		SC_EQUAL,
739
		SC_NOT_EQUAL,
739
		SC_LESS,
740
		SC_TOPVAL,
740
		SC_GREATER,
741
		SC_BOTVAL,
741
		SC_LESS_EQUAL,
742
		SC_TOPPERC,
742
		SC_GREATER_EQUAL,
743
        SC_BOTPERC,
743
		SC_NOT_EQUAL,
744
        SC_CONTAINS,
744
		SC_TOPVAL,
745
        SC_DOES_NOT_CONTAIN,
745
		SC_BOTVAL,
746
        SC_BEGINS_WITH,
746
		SC_TOPPERC,
747
        SC_DOES_NOT_BEGIN_WITH,
747
        SC_BOTPERC,
748
        SC_ENDS_WITH,
748
        SC_CONTAINS,
749
        SC_DOES_NOT_END_WITH
749
        SC_DOES_NOT_CONTAIN,
750
	};
750
        SC_BEGINS_WITH,
751
751
        SC_DOES_NOT_BEGIN_WITH,
752
// -----------------------------------------------------------------------
752
        SC_ENDS_WITH,
753
753
        SC_DOES_NOT_END_WITH
754
enum ScQueryConnect
754
	};
755
	{
755
756
		SC_AND,
756
// -----------------------------------------------------------------------
757
		SC_OR
757
758
	};
758
enum ScQueryConnect
759
759
	{
760
// -----------------------------------------------------------------------
760
		SC_AND,
761
761
		SC_OR
762
enum ScSubTotalFunc
762
	};
763
	{
763
764
		SUBTOTAL_FUNC_NONE	= 0,
764
// -----------------------------------------------------------------------
765
		SUBTOTAL_FUNC_AVE	= 1,
765
766
		SUBTOTAL_FUNC_CNT	= 2,
766
enum ScSubTotalFunc
767
		SUBTOTAL_FUNC_CNT2	= 3,
767
	{
768
		SUBTOTAL_FUNC_MAX	= 4,
768
		SUBTOTAL_FUNC_NONE	= 0,
769
		SUBTOTAL_FUNC_MIN	= 5,
769
		SUBTOTAL_FUNC_AVE	= 1,
770
		SUBTOTAL_FUNC_PROD	= 6,
770
		SUBTOTAL_FUNC_CNT	= 2,
771
		SUBTOTAL_FUNC_STD	= 7,
771
		SUBTOTAL_FUNC_CNT2	= 3,
772
		SUBTOTAL_FUNC_STDP	= 8,
772
		SUBTOTAL_FUNC_MAX	= 4,
773
		SUBTOTAL_FUNC_SUM	= 9,
773
		SUBTOTAL_FUNC_MIN	= 5,
774
		SUBTOTAL_FUNC_VAR	= 10,
774
		SUBTOTAL_FUNC_PROD	= 6,
775
		SUBTOTAL_FUNC_VARP	= 11
775
		SUBTOTAL_FUNC_STD	= 7,
776
	};
776
		SUBTOTAL_FUNC_STDP	= 8,
777
777
		SUBTOTAL_FUNC_SUM	= 9,
778
778
		SUBTOTAL_FUNC_VAR	= 10,
779
// -----------------------------------------------------------------------
779
		SUBTOTAL_FUNC_VARP	= 11
780
780
	};
781
/*
781
782
 * Dialog liefert die ausgezeichneten Feldwerte "leer"/"nicht leer"
782
783
 * als Konstanten SC_EMPTYFIELDS bzw. SC_NONEMPTYFIELDS in nVal in
783
// -----------------------------------------------------------------------
784
 * Verbindung mit dem Schalter bQueryByString auf FALSE.
784
785
 */
785
/*
786
786
 * Dialog liefert die ausgezeichneten Feldwerte "leer"/"nicht leer"
787
#define SC_EMPTYFIELDS		((double)0x0042)
787
 * als Konstanten SC_EMPTYFIELDS bzw. SC_NONEMPTYFIELDS in nVal in
788
#define SC_NONEMPTYFIELDS	((double)0x0043)
788
 * Verbindung mit dem Schalter bQueryByString auf FALSE.
789
789
 */
790
namespace utl
790
791
{
791
#define SC_EMPTYFIELDS		((double)0x0042)
792
	class SearchParam;
792
#define SC_NONEMPTYFIELDS	((double)0x0043)
793
	class TextSearch;
793
794
}
794
namespace utl
795
795
{
796
struct ScQueryEntry
796
	class SearchParam;
797
{
797
	class TextSearch;
798
	sal_Bool			bDoQuery;
798
}
799
	sal_Bool			bQueryByString;
799
800
    bool            bQueryByDate;
800
struct ScQueryEntry
801
	SCCOLROW		nField;
801
{
802
	ScQueryOp		eOp;
802
	sal_Bool			bDoQuery;
803
	ScQueryConnect  eConnect;
803
	sal_Bool			bQueryByString;
804
	String*			pStr;
804
    bool            bQueryByDate;
805
	double			nVal;
805
	SCCOLROW		nField;
806
	utl::SearchParam*	pSearchParam;		// falls RegExp, nicht gespeichert
806
	ScQueryOp		eOp;
807
	utl::TextSearch*	pSearchText;		// falls RegExp, nicht gespeichert
807
	ScQueryConnect  eConnect;
808
808
	String*			pStr;
809
	ScQueryEntry();
809
	double			nVal;
810
	ScQueryEntry(const ScQueryEntry& r);
810
	utl::SearchParam*	pSearchParam;		// falls RegExp, nicht gespeichert
811
	~ScQueryEntry();
811
	utl::TextSearch*	pSearchText;		// falls RegExp, nicht gespeichert
812
812
813
	// legt ggbf. pSearchParam und pSearchText an, immer RegExp!
813
	ScQueryEntry();
814
	utl::TextSearch*	GetSearchTextPtr( sal_Bool bCaseSens );
814
	ScQueryEntry(const ScQueryEntry& r);
815
815
	~ScQueryEntry();
816
	void			Clear();
816
817
	ScQueryEntry&	operator=( const ScQueryEntry& r );
817
	// legt ggbf. pSearchParam und pSearchText an, immer RegExp!
818
	sal_Bool			operator==( const ScQueryEntry& r ) const;
818
	utl::TextSearch*	GetSearchTextPtr( sal_Bool bCaseSens );
819
};
819
820
820
	void			Clear();
821
// -----------------------------------------------------------------------
821
	ScQueryEntry&	operator=( const ScQueryEntry& r );
822
822
	sal_Bool			operator==( const ScQueryEntry& r ) const;
823
struct SC_DLLPUBLIC ScSubTotalParam
823
};
824
{
824
825
	SCCOL			nCol1;			// Selektierter Bereich
825
// -----------------------------------------------------------------------
826
	SCROW			nRow1;
826
827
	SCCOL			nCol2;
827
struct SC_DLLPUBLIC ScSubTotalParam
828
	SCROW			nRow2;
828
{
829
	sal_Bool			bRemoveOnly;
829
	SCCOL			nCol1;			// Selektierter Bereich
830
	sal_Bool			bReplace;					// vorhandene Ergebnisse ersetzen
830
	SCROW			nRow1;
831
	sal_Bool			bPagebreak;					// Seitenumbruch bei Gruppenwechsel
831
	SCCOL			nCol2;
832
	sal_Bool			bCaseSens;					// Gross-/Kleinschreibung
832
	SCROW			nRow2;
833
	sal_Bool			bDoSort;					// vorher sortieren
833
	sal_Bool			bRemoveOnly;
834
	sal_Bool			bAscending;					// aufsteigend sortieren
834
	sal_Bool			bReplace;					// vorhandene Ergebnisse ersetzen
835
	sal_Bool			bUserDef;					// Benutzer-def. Sort.Reihenfolge
835
	sal_Bool			bPagebreak;					// Seitenumbruch bei Gruppenwechsel
836
	sal_uInt16			nUserIndex;                 // Index auf Liste
836
	sal_Bool			bCaseSens;					// Gross-/Kleinschreibung
837
	sal_Bool			bIncludePattern;			// Formate mit sortieren
837
	sal_Bool			bDoSort;					// vorher sortieren
838
	sal_Bool			bGroupActive[MAXSUBTOTAL];	// aktive Gruppen
838
	sal_Bool			bAscending;					// aufsteigend sortieren
839
	SCCOL			nField[MAXSUBTOTAL];		// zugehoeriges Feld
839
	sal_Bool			bUserDef;					// Benutzer-def. Sort.Reihenfolge
840
	SCCOL			nSubTotals[MAXSUBTOTAL];	// Anzahl der SubTotals
840
	sal_uInt16			nUserIndex;                 // Index auf Liste
841
	SCCOL*			pSubTotals[MAXSUBTOTAL];	// Array der zu berechnenden Spalten
841
	sal_Bool			bIncludePattern;			// Formate mit sortieren
842
	ScSubTotalFunc*	pFunctions[MAXSUBTOTAL];	// Array der zugehoerige Funktionen
842
	sal_Bool			bGroupActive[MAXSUBTOTAL];	// aktive Gruppen
843
843
	SCCOL			nField[MAXSUBTOTAL];		// zugehoeriges Feld
844
	ScSubTotalParam();
844
	SCCOL			nSubTotals[MAXSUBTOTAL];	// Anzahl der SubTotals
845
	ScSubTotalParam( const ScSubTotalParam& r );
845
	SCCOL*			pSubTotals[MAXSUBTOTAL];	// Array der zu berechnenden Spalten
846
846
	ScSubTotalFunc*	pFunctions[MAXSUBTOTAL];	// Array der zugehoerige Funktionen
847
	ScSubTotalParam&	operator=		( const ScSubTotalParam& r );
847
848
	sal_Bool				operator==		( const ScSubTotalParam& r ) const;
848
	ScSubTotalParam();
849
	void				Clear			();
849
	ScSubTotalParam( const ScSubTotalParam& r );
850
	void 				SetSubTotals	( sal_uInt16				nGroup,
850
851
										  const SCCOL*			ptrSubTotals,
851
	ScSubTotalParam&	operator=		( const ScSubTotalParam& r );
852
										  const ScSubTotalFunc*	ptrFuncions,
852
	sal_Bool				operator==		( const ScSubTotalParam& r ) const;
853
										  sal_uInt16				nCount );
853
	void				Clear			();
854
};
854
	void 				SetSubTotals	( sal_uInt16				nGroup,
855
855
										  const SCCOL*			ptrSubTotals,
856
// -----------------------------------------------------------------------
856
										  const ScSubTotalFunc*	ptrFuncions,
857
class ScArea;
857
										  sal_uInt16				nCount );
858
858
};
859
struct ScConsolidateParam
859
860
{
860
// -----------------------------------------------------------------------
861
	SCCOL			nCol;					// Cursor Position /
861
class ScArea;
862
	SCROW			nRow;					// bzw. Anfang des Zielbereiches
862
863
	SCTAB			nTab;
863
struct ScConsolidateParam
864
	ScSubTotalFunc	eFunction;				// Berechnungsvorschrift
864
{
865
	sal_uInt16			nDataAreaCount;			// Anzahl der Datenbereiche
865
	SCCOL			nCol;					// Cursor Position /
866
	ScArea**		ppDataAreas;			// Zeiger-Array auf Datenbereiche
866
	SCROW			nRow;					// bzw. Anfang des Zielbereiches
867
	sal_Bool			bByCol;					// nach Spalten
867
	SCTAB			nTab;
868
	sal_Bool			bByRow;					// nach Zeilen
868
	ScSubTotalFunc	eFunction;				// Berechnungsvorschrift
869
	sal_Bool			bReferenceData;			// Quelldaten referenzieren
869
	sal_uInt16			nDataAreaCount;			// Anzahl der Datenbereiche
870
870
	ScArea**		ppDataAreas;			// Zeiger-Array auf Datenbereiche
871
	ScConsolidateParam();
871
	sal_Bool			bByCol;					// nach Spalten
872
	ScConsolidateParam( const ScConsolidateParam& r );
872
	sal_Bool			bByRow;					// nach Zeilen
873
	~ScConsolidateParam();
873
	sal_Bool			bReferenceData;			// Quelldaten referenzieren
874
874
875
	ScConsolidateParam&	operator=		( const ScConsolidateParam& r );
875
	ScConsolidateParam();
876
	sal_Bool				operator==		( const ScConsolidateParam& r ) const;
876
	ScConsolidateParam( const ScConsolidateParam& r );
877
	void				Clear			(); // = ClearDataAreas()+Members
877
	~ScConsolidateParam();
878
	void				ClearDataAreas	();
878
879
	void				SetAreas		( ScArea* const* ppAreas, sal_uInt16 nCount );
879
	ScConsolidateParam&	operator=		( const ScConsolidateParam& r );
880
};
880
	sal_Bool				operator==		( const ScConsolidateParam& r ) const;
881
881
	void				Clear			(); // = ClearDataAreas()+Members
882
// -----------------------------------------------------------------------
882
	void				ClearDataAreas	();
883
extern ::utl::TransliterationWrapper* GetScGlobalpTransliteration();//CHINA001
883
	void				SetAreas		( ScArea* const* ppAreas, sal_uInt16 nCount );
884
extern const LocaleDataWrapper* GetScGlobalpLocaleData();
884
};
885
885
886
#endif
886
// -----------------------------------------------------------------------
887
extern ::utl::TransliterationWrapper* GetScGlobalpTransliteration();//CHINA001
888
extern const LocaleDataWrapper* GetScGlobalpLocaleData();
889
890
#endif
(-)sc/source/core/data/documen3.cxx (-1 / +9 lines)
Lines 192-197 Link Here
192
	else
192
	else
193
		return NULL;
193
		return NULL;
194
}
194
}
195
ScDBData* ScDocument::GetDBAtTable(SCTAB nTab, ScGetDBMode eMode) const
196
{
197
	if (pDBCollection)
198
		return pDBCollection->GetDBAtTable(nTab, eMode);
199
	else
200
		return NULL;
201
}
195
202
196
ScDBData* ScDocument::GetFilterDBAtTable(SCTAB nTab) const
203
ScDBData* ScDocument::GetFilterDBAtTable(SCTAB nTab) const
197
{
204
{
Lines 1291-1297 Link Here
1291
1298
1292
sal_Bool ScDocument::HasAutoFilter( SCCOL nCurCol, SCROW nCurRow, SCTAB nCurTab )
1299
sal_Bool ScDocument::HasAutoFilter( SCCOL nCurCol, SCROW nCurRow, SCTAB nCurTab )
1293
{
1300
{
1294
	ScDBData*		pDBData			= GetDBAtCursor( nCurCol, nCurRow, nCurTab );
1301
	//ScDBData*		pDBData			= GetDBAtCursor( nCurCol, nCurRow, nCurTab );
1302
	ScDBData*		pDBData			= GetDBAtTable(nCurTab, SC_DB_OLD_FILTER);
1295
	sal_Bool			bHasAutoFilter	= ( pDBData != NULL );
1303
	sal_Bool			bHasAutoFilter	= ( pDBData != NULL );
1296
1304
1297
	if ( pDBData )
1305
	if ( pDBData )
(-)sc/source/core/tool/dbcolect.cxx (-6 / +71 lines)
Lines 36-41 Link Here
36
#include "queryparam.hxx"
36
#include "queryparam.hxx"
37
#include "globstr.hrc"
37
#include "globstr.hrc"
38
38
39
#define SC_DBNAME_UNNAMED "__Anonymous_Sheet_DB__"
39
40
40
//---------------------------------------------------------------------------------------
41
//---------------------------------------------------------------------------------------
41
42
Lines 690-697 Link Here
690
{
691
{
691
	return new ScDBData(*this);
692
	return new ScDBData(*this);
692
}
693
}
694
sal_Bool    ScDBData::IsBuildin()
695
{
696
    String  aNoName = String::CreateFromAscii(SC_DBNAME_UNNAMED);
697
    String  aBeginName = aName.Copy(0,22);
698
    return  (sal_Bool)(!ScGlobal::GetpTransliteration()->compareString( aNoName, aBeginName ));
699
}
693
700
694
695
//---------------------------------------------------------------------------------------
701
//---------------------------------------------------------------------------------------
696
//	Compare zum Sortieren
702
//	Compare zum Sortieren
697
703
Lines 714-726 Link Here
714
	ScDBData* pNoNameData = NULL;
720
	ScDBData* pNoNameData = NULL;
715
	if (pItems)
721
	if (pItems)
716
	{
722
	{
717
		const String& rNoName = ScGlobal::GetRscString( STR_DB_NONAME );
718
723
719
		for (sal_uInt16 i = 0; i < nCount; i++)
724
		for (sal_uInt16 i = 0; i < nCount; i++)
720
			if (((ScDBData*)pItems[i])->IsDBAtCursor(nCol, nRow, nTab, bStartOnly))
725
			if (((ScDBData*)pItems[i])->IsDBAtCursor(nCol, nRow, nTab, bStartOnly))
721
			{
726
			{
722
				ScDBData* pDB = (ScDBData*)pItems[i];
727
				ScDBData* pDB = (ScDBData*)pItems[i];
723
				if ( pDB->GetName() == rNoName )
728
                if ( pDB->IsBuildin() )
724
					pNoNameData = pDB;
729
					pNoNameData = pDB;
725
				else
730
				else
726
					return pDB;
731
					return pDB;
Lines 734-746 Link Here
734
	ScDBData* pNoNameData = NULL;
739
	ScDBData* pNoNameData = NULL;
735
	if (pItems)
740
	if (pItems)
736
	{
741
	{
737
		const String& rNoName = ScGlobal::GetRscString( STR_DB_NONAME );
738
742
739
		for (sal_uInt16 i = 0; i < nCount; i++)
743
		for (sal_uInt16 i = 0; i < nCount; i++)
740
			if (((ScDBData*)pItems[i])->IsDBAtArea(nTab, nCol1, nRow1, nCol2, nRow2))
744
			if (((ScDBData*)pItems[i])->IsDBAtArea(nTab, nCol1, nRow1, nCol2, nRow2))
741
			{
745
			{
742
				ScDBData* pDB = (ScDBData*)pItems[i];
746
				ScDBData* pDB = (ScDBData*)pItems[i];
743
				if ( pDB->GetName() == rNoName )
747
				if ( pDB->IsBuildin() )
744
					pNoNameData = pDB;
748
					pNoNameData = pDB;
745
				else
749
				else
746
					return pDB;
750
					return pDB;
Lines 903-908 Link Here
903
	return bInserted;
907
	return bInserted;
904
}
908
}
905
909
910
String ScDBCollection::GetNewDefaultDBName()
911
{
912
    String  aNoName = String::CreateFromAscii(SC_DBNAME_UNNAMED);
913
    String  aNewName;
914
    unsigned short  nDummy;
915
    int     i = 1;
916
    do
917
    {
918
        aNewName = aNoName;
919
        aNewName += String::CreateFromInt32( i++ );
920
    }while(SearchName(aNewName,nDummy));
921
    return  aNewName;
922
}
923
/*
924
sal_Bool ScDBCollection::IsFiltered(SCTAB nTab, SCROW nRow)
925
{
926
    SCCOL	nLastCol;
927
    SCROW	nLastRow;
928
    pDoc->GetLastAttrCellArea(nTab, nLastCol, nLastRow);
906
929
930
    if ( pItems )
931
    {
932
        for (unsigned short i = 0; i < nCount; i++)
933
        {
934
            ScDBData*   pData = (ScDBData*)pItems[i];
935
            if ( pData->nTable == nTab && pData->HasQueryParam() && pData->bQueryInplace )
936
                if ( nRow >= (pData->nStartRow + (pData->HasHeader()?1:0)) && nRow <= pData->nEndRow && nRow <= nLastRow )
937
                    return sal_True;
938
        }
939
    }
940
    return sal_False;
941
}
942
*/
943
ScDBData* ScDBCollection::GetDBAtTable(SCTAB nTab, ScGetDBMode eMode) const
944
{
945
    ScDBData* pDataEmpty = NULL;
946
    if (pItems)
947
    {
948
        for (unsigned short i = 0; i < nCount; i++)
949
        {
950
            ScDBData* pDBTemp = (ScDBData*)pItems[i];
951
            if ( pDBTemp->nTable == nTab )						//Sym2_7885 mod
952
            {
953
                sal_Bool bImport = pDBTemp->HasImportParam();
954
                sal_Bool bFilter = pDBTemp->HasAutoFilter() || pDBTemp->HasQueryParam();
955
                sal_Bool bSort = pDBTemp->HasSortParam();
956
                sal_Bool bSubtotal = pDBTemp->HasSubTotalParam();
957
                sal_Bool bAnyParam = bImport || bFilter || bSort || bSubtotal;
958
                if ( ((eMode == SC_DB_MAKE_SORT)    && bSort && !bFilter) ||      //Sym2_7334 mod 20100420
959
                    ((eMode == SC_DB_MAKE_SUBTOTAL) && bSubtotal && !bFilter ) ||
960
                    ((eMode == SC_DB_MAKE_FILTER || eMode == SC_DB_OLD_FILTER) && bFilter ) )
961
                {
962
                    return pDBTemp;
963
                }
964
                else if ( pDBTemp->IsBuildin() && !bAnyParam )	//Sym2_7885 mod
965
                {
966
                    pDataEmpty = pDBTemp;
967
                }
968
            }
969
        }
970
    }
907
971
908
972
    return pDataEmpty;
973
}
(-)sc/source/core/tool/rangeutl.cxx (-1 / +2 lines)
Lines 1032-1038 Link Here
1032
			if ( pDBCollection && nPos < pDBCollection->GetCount() )
1032
			if ( pDBCollection && nPos < pDBCollection->GetCount() )
1033
			{
1033
			{
1034
				ScDBData* pData = (*pDBCollection)[nPos++];
1034
				ScDBData* pData = (*pDBCollection)[nPos++];
1035
				if (pData && pData->GetName() != aStrNoName)
1035
//				if (pData && pData->GetName() != aStrNoName)
1036
				if (pData && !pData->IsBuildin())
1036
				{
1037
				{
1037
					pData->GetArea( rRange );
1038
					pData->GetArea( rRange );
1038
					rName = pData->GetName();
1039
					rName = pData->GetName();
(-)sc/source/ui/dbgui/dbnamdlg.cxx (-2 / +4 lines)
Lines 266-272 Link Here
266
					&& (rEnd.Col()   == nCol2) && (rEnd.Row()   == nRow2 ) )
266
					&& (rEnd.Col()   == nCol2) && (rEnd.Row()   == nRow2 ) )
267
				{
267
				{
268
					pDBData->GetName( theDbName );
268
					pDBData->GetName( theDbName );
269
					if ( theDbName != aStrNoName )
269
					//if ( theDbName != aStrNoName )
270
					if ( !pDBData->IsBuildin() )
270
						aEdName.SetText( theDbName );
271
						aEdName.SetText( theDbName );
271
					else
272
					else
272
						aEdName.SetText( EMPTY_STRING );
273
						aEdName.SetText( EMPTY_STRING );
Lines 378-384 Link Here
378
			if ( pDbData )
379
			if ( pDbData )
379
			{
380
			{
380
				pDbData->GetName( aString );
381
				pDbData->GetName( aString );
381
				if ( aString != aStrNoName )
382
				//if ( aString != aStrNoName )
383
				if ( !pDbData->IsBuildin() )
382
					aEdName.InsertEntry( aString );
384
					aEdName.InsertEntry( aString );
383
			}
385
			}
384
		}
386
		}
(-)sc/source/ui/dbgui/foptmgr.cxx (-1 / +1 lines)
Lines 186-192 Link Here
186
				rBtnHeader.Check( pDBData->HasHeader() );
186
				rBtnHeader.Check( pDBData->HasHeader() );
187
				pDBData->GetName( theDbName );
187
				pDBData->GetName( theDbName );
188
188
189
				if ( theDbName != rStrNoName )
189
                if ( !pDBData->IsBuildin() )
190
				{
190
				{
191
					rBtnHeader.Disable();
191
					rBtnHeader.Disable();
192
				}
192
				}
(-)sc/source/ui/docshell/dbdocfun.cxx (-2 / +2 lines)
Lines 592-598 Link Here
592
		if (pDestData)
592
		if (pDestData)
593
			pNewData = pDestData;				// Bereich vorhanden -> anpassen
593
			pNewData = pDestData;				// Bereich vorhanden -> anpassen
594
		else									// Bereich ab Cursor/Markierung wird angelegt
594
		else									// Bereich ab Cursor/Markierung wird angelegt
595
			pNewData = rDocShell.GetDBData(aDestPos, SC_DB_MAKE, SC_DBSEL_FORCE_MARK );
595
			pNewData = rDocShell.GetDBData(aDestPos, SC_DB_MAKE_SORT, SC_DBSEL_FORCE_MARK );
596
		if (pNewData)
596
		if (pNewData)
597
		{
597
		{
598
			pNewData->SetArea( nTab,
598
			pNewData->SetArea( nTab,
Lines 919-925 Link Here
919
			pNewData = rDocShell.GetDBData(
919
			pNewData = rDocShell.GetDBData(
920
							ScRange( aLocalParam.nCol1, aLocalParam.nRow1, nDestTab,
920
							ScRange( aLocalParam.nCol1, aLocalParam.nRow1, nDestTab,
921
									 aLocalParam.nCol2, aLocalParam.nRow2, nDestTab ),
921
									 aLocalParam.nCol2, aLocalParam.nRow2, nDestTab ),
922
							SC_DB_MAKE, SC_DBSEL_FORCE_MARK );
922
							SC_DB_MAKE_FILTER, SC_DBSEL_FORCE_MARK );
923
923
924
		if (pNewData)
924
		if (pNewData)
925
		{
925
		{
(-)sc/source/ui/docshell/docsh5.cxx (-2 / +171 lines)
Lines 150-155 Link Here
150
150
151
ScDBData* ScDocShell::GetDBData( const ScRange& rMarked, ScGetDBMode eMode, ScGetDBSelection eSel )
151
ScDBData* ScDocShell::GetDBData( const ScRange& rMarked, ScGetDBMode eMode, ScGetDBSelection eSel )
152
{
152
{
153
    if ( eMode == SC_DB_MAKE_FILTER || eMode == SC_DB_MAKE_SORT || eMode == SC_DB_MAKE_SUBTOTAL || eMode == SC_DB_OLD_FILTER )
154
        return GetDBDataAdd(rMarked, eMode, eSel);
153
	SCCOL nCol = rMarked.aStart.Col();
155
	SCCOL nCol = rMarked.aStart.Col();
154
	SCROW nRow = rMarked.aStart.Row();
156
	SCROW nRow = rMarked.aStart.Row();
155
	SCTAB nTab = rMarked.aStart.Tab();
157
	SCTAB nTab = rMarked.aStart.Tab();
Lines 184-190 Link Here
184
		SCCOL nOldCol2;
186
		SCCOL nOldCol2;
185
		SCROW nOldRow2;
187
		SCROW nOldRow2;
186
		pData->GetArea( nDummy, nOldCol1,nOldRow1, nOldCol2,nOldRow2 );
188
		pData->GetArea( nDummy, nOldCol1,nOldRow1, nOldCol2,nOldRow2 );
187
		sal_Bool bIsNoName = ( pData->GetName() == ScGlobal::GetRscString( STR_DB_NONAME ) );
189
//		sal_Bool bIsNoName = ( pData->GetName() == ScGlobal::GetRscString( STR_DB_NONAME ) );
190
		sal_Bool bIsNoName = pData->IsBuildin();
188
191
189
		if (!bSelected)
192
		if (!bSelected)
190
		{
193
		{
Lines 322-328 Link Here
322
				while (pColl->SearchName( aNewName, nDummy ));
325
				while (pColl->SearchName( aNewName, nDummy ));
323
			}
326
			}
324
			else
327
			else
325
				aNewName = ScGlobal::GetRscString( STR_DB_NONAME );
328
				//aNewName = ScGlobal::GetRscString( STR_DB_NONAME );
329
				aNewName = pColl->GetNewDefaultDBName();
330
326
			pNoNameData = new ScDBData( aNewName, nTab,
331
			pNoNameData = new ScDBData( aNewName, nTab,
327
								nStartCol,nStartRow, nEndCol,nEndRow,
332
								nStartCol,nStartRow, nEndCol,nEndRow,
328
								sal_True, bHasHeader );
333
								sal_True, bHasHeader );
Lines 351-356 Link Here
351
	return pData;
356
	return pData;
352
}
357
}
353
358
359
ScDBData* ScDocShell::GetDBDataAdd( const ScRange& rMarked, ScGetDBMode eMode, ScGetDBSelection eSel )
360
{
361
    SCCOL nCol = rMarked.aStart.Col();
362
    SCROW nRow = rMarked.aStart.Row();
363
    SCTAB nTab = rMarked.aStart.Tab();
364
365
    SCCOL nStartCol = nCol;
366
    SCROW nStartRow = nRow;
367
    SCTAB nStartTab = nTab;
368
    SCCOL nEndCol = rMarked.aEnd.Col();
369
    SCROW nEndRow = rMarked.aEnd.Row();
370
    SCTAB nEndTab = rMarked.aEnd.Tab();
371
372
    ScDBData* pData = NULL;
373
    ScDBData* pCursorData;
374
    pCursorData = aDocument.GetDBAtArea( nTab, nStartCol, nStartRow, nEndCol, nEndRow );
375
    if ( !pCursorData )
376
        pCursorData = aDocument.GetDBAtCursor( nStartCol, nStartRow, nTab );
377
378
    //Get DBData at current table
379
    ScDBData* pTableData = aDocument.GetDBAtTable( nTab, eMode );
380
381
    if ( eMode == SC_DB_OLD_FILTER )
382
        return pTableData;
383
384
    sal_Bool bSelected = ( eSel == SC_DBSEL_FORCE_MARK || rMarked.aStart != rMarked.aEnd ); 
385
    bool bOnlyDown = (!bSelected && eSel == SC_DBSEL_ROW_DOWN && rMarked.aStart.Row() == rMarked.aEnd.Row());
386
387
	sal_Bool bUseThis = sal_False;
388
    if (pCursorData)
389
    {
390
        SCTAB nDummy;
391
        SCCOL nOldCol1;
392
        SCROW nOldRow1;
393
        SCCOL nOldCol2;
394
        SCROW nOldRow2;
395
        pCursorData->GetArea( nDummy, nOldCol1,nOldRow1, nOldCol2,nOldRow2 );
396
        if ( !bSelected )
397
        {    
398
              ScRange tmpRange;
399
              if ( !pCursorData->IsBuildin() && pCursorData->GetAdvancedQuerySource(tmpRange))	 
400
                   bUseThis = sal_True;			   
401
              else
402
             {  
403
                 nStartCol = nCol;
404
                 nStartRow = nRow;
405
                 nEndCol = nStartCol;
406
                 nEndRow = nStartRow;
407
				aDocument.GetDataArea( nTab, nStartCol, nStartRow, nEndCol, nEndRow, sal_False, bOnlyDown );
408
                 if ( nOldCol1 != nStartCol || nOldCol2 != nEndCol || nOldRow1 != nStartRow )
409
                     bUseThis = sal_False;
410
                 else
411
                 {
412
                     bUseThis = sal_True;
413
                     if ( nOldRow2 != nEndRow )// Range of new end-line expand
414
                     pCursorData->SetArea( nTab, nOldCol1,nOldRow1, nOldCol2,nEndRow );
415
                 }
416
            }
417
418
        }
419
        else
420
        {
421
            if ( nOldCol1 == nStartCol && nOldRow1 == nStartRow && nOldCol2 == nEndCol && nOldRow2 == nEndRow )
422
				bUseThis = sal_True;
423
            else
424
				bUseThis = sal_False;			// Always take mark (Bug 11964)
425
        }
426
    }
427
428
    if ( bUseThis )
429
    {
430
        pData = pCursorData;
431
        if ( pTableData && eMode == SC_DB_MAKE_FILTER && !(*pTableData == *pCursorData ) )
432
        {
433
            if ( !pOldAutoDBRange )
434
                pOldAutoDBRange = new ScDBData(*pTableData);
435
            SCCOL nOldX1;
436
            SCROW nOldY1;
437
            SCCOL nOldX2;
438
            SCROW nOldY2;
439
            SCTAB nOldTab;
440
            pTableData->GetArea( nOldTab, nOldX1, nOldY1, nOldX2, nOldY2 );
441
442
            if (pTableData->HasQueryParam())
443
            {
444
                ScQueryParam    aParam;
445
                pTableData->GetQueryParam(aParam);
446
                SCSIZE nEC = aParam.GetEntryCount();
447
                for (SCSIZE i=0; i<nEC; i++)
448
                    aParam.GetEntry(i).bDoQuery = sal_False;
449
                aParam.bDuplicate = sal_True;
450
                ScDBDocFunc aDBDocFunc( *this );
451
                aDBDocFunc.Query( nTab, aParam, NULL, sal_False, sal_False );
452
            }
453
454
            DBAreaDeleted( nOldTab, nOldX1, nOldY1, nOldX2, nOldY2 );
455
            pTableData->SetQueryParam( ScQueryParam() );
456
            pTableData->SetAutoFilter( sal_False );
457
        }
458
459
    }
460
    else
461
    {
462
        if ( bSelected )
463
        {
464
//			bMark = sal_False;
465
        }
466
        else
467
        {
468
            nStartCol = nCol;
469
            nStartRow = nRow;
470
            nEndCol = nStartCol;
471
            nEndRow = nStartRow;
472
			aDocument.GetDataArea( nTab, nStartCol, nStartRow, nEndCol, nEndRow, sal_False, bOnlyDown );
473
        }
474
        sal_Bool bHasHeader = aDocument.HasColHeader( nStartCol,nStartRow, nEndCol,nEndRow, nTab );
475
        ScDBCollection* pColl = aDocument.GetDBCollection();
476
        if ( pTableData )
477
        {
478
            if ( !pOldAutoDBRange )
479
                pOldAutoDBRange = new ScDBData(*pTableData);
480
            SCCOL nOldX1;
481
            SCROW nOldY1;
482
            SCCOL nOldX2;
483
            SCROW nOldY2;
484
            SCTAB nOldTab;
485
            pTableData->GetArea( nOldTab, nOldX1, nOldY1, nOldX2, nOldY2 );
486
487
            if (pTableData->HasQueryParam())
488
            {
489
                ScQueryParam    aParam;
490
                pTableData->GetQueryParam(aParam);
491
                SCSIZE nEC = aParam.GetEntryCount();
492
                for (SCSIZE i=0; i<nEC; i++)
493
                    aParam.GetEntry(i).bDoQuery = sal_False;
494
                aParam.bDuplicate = sal_True;
495
                ScDBDocFunc aDBDocFunc( *this );
496
                aDBDocFunc.Query( nTab, aParam, NULL, sal_False, sal_False );
497
            }
498
499
                DBAreaDeleted( nOldTab, nOldX1, nOldY1, nOldX2, nOldY2 );
500
501
            pTableData->SetSortParam( ScSortParam() );
502
            pTableData->SetQueryParam( ScQueryParam() );
503
            pTableData->SetSubTotalParam( ScSubTotalParam() );
504
505
            pTableData->SetArea( nTab, nStartCol, nStartRow, nEndCol, nEndRow );
506
            pTableData->SetByRow( sal_True );
507
            pTableData->SetHeader( bHasHeader );
508
            pTableData->SetAutoFilter( sal_False );
509
        }
510
        else
511
        {
512
            String aNewName = pColl->GetNewDefaultDBName();
513
            pTableData = new ScDBData( aNewName, nTab, nStartCol,nStartRow, nEndCol,nEndRow, sal_True, bHasHeader );
514
            pColl->Insert( pTableData );
515
        }
516
        pData = pTableData;
517
    }
518
519
    return pData;
520
}
521
522
354
ScDBData* ScDocShell::GetOldAutoDBRange()
523
ScDBData* ScDocShell::GetOldAutoDBRange()
355
{
524
{
356
    ScDBData* pRet = pOldAutoDBRange;
525
    ScDBData* pRet = pOldAutoDBRange;
(-)sc/source/ui/inc/dbfunc.hxx (+1 lines)
Lines 75-80 Link Here
75
					// DB-Bereich vom Cursor
75
					// DB-Bereich vom Cursor
76
	ScDBData* 		GetDBData( sal_Bool bMarkArea = sal_True, ScGetDBMode eMode = SC_DB_MAKE, ScGetDBSelection eSel = SC_DBSEL_KEEP );
76
	ScDBData* 		GetDBData( sal_Bool bMarkArea = sal_True, ScGetDBMode eMode = SC_DB_MAKE, ScGetDBSelection eSel = SC_DBSEL_KEEP );
77
77
78
    //ScRange         GetDBRange( BOOL bMark, bool bIgnoreNotes );
78
	void			NotifyCloseDbNameDlg( const ScDBCollection& rNewColl, const List& rDelAreaList );
79
	void			NotifyCloseDbNameDlg( const ScDBCollection& rNewColl, const List& rDelAreaList );
79
80
80
	void			Consolidate( const ScConsolidateParam& rParam, sal_Bool bRecord = sal_True );
81
	void			Consolidate( const ScConsolidateParam& rParam, sal_Bool bRecord = sal_True );
(-)sc/source/ui/inc/docsh.hxx (-459 / +461 lines)
Lines 1-459 Link Here
1
/**************************************************************
1
/**************************************************************
2
 * 
2
 * 
3
 * Licensed to the Apache Software Foundation (ASF) under one
3
 * Licensed to the Apache Software Foundation (ASF) under one
4
 * or more contributor license agreements.  See the NOTICE file
4
 * or more contributor license agreements.  See the NOTICE file
5
 * distributed with this work for additional information
5
 * distributed with this work for additional information
6
 * regarding copyright ownership.  The ASF licenses this file
6
 * regarding copyright ownership.  The ASF licenses this file
7
 * to you under the Apache License, Version 2.0 (the
7
 * to you under the Apache License, Version 2.0 (the
8
 * "License"); you may not use this file except in compliance
8
 * "License"); you may not use this file except in compliance
9
 * with the License.  You may obtain a copy of the License at
9
 * with the License.  You may obtain a copy of the License at
10
 * 
10
 * 
11
 *   http://www.apache.org/licenses/LICENSE-2.0
11
 *   http://www.apache.org/licenses/LICENSE-2.0
12
 * 
12
 * 
13
 * Unless required by applicable law or agreed to in writing,
13
 * Unless required by applicable law or agreed to in writing,
14
 * software distributed under the License is distributed on an
14
 * software distributed under the License is distributed on an
15
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16
 * KIND, either express or implied.  See the License for the
16
 * KIND, either express or implied.  See the License for the
17
 * specific language governing permissions and limitations
17
 * specific language governing permissions and limitations
18
 * under the License.
18
 * under the License.
19
 * 
19
 * 
20
 *************************************************************/
20
 *************************************************************/
21
21
22
22
23
23
24
#ifndef SC_DOCSHELL_HXX
24
#ifndef SC_DOCSHELL_HXX
25
#define SC_DOCSHELL_HXX
25
#define SC_DOCSHELL_HXX
26
26
27
27
28
#include <sfx2/objsh.hxx>
28
#include <sfx2/objsh.hxx>
29
29
30
#include <sfx2/docfac.hxx>
30
#include <sfx2/docfac.hxx>
31
#include <sfx2/sfxmodelfactory.hxx>
31
#include <sfx2/sfxmodelfactory.hxx>
32
#include <sfx2/viewsh.hxx>
32
#include <sfx2/viewsh.hxx>
33
33
34
#include "scdllapi.h"
34
#include "scdllapi.h"
35
#include "scdll.hxx"
35
#include "scdll.hxx"
36
#include "document.hxx"
36
#include "document.hxx"
37
#include "shellids.hxx"
37
#include "shellids.hxx"
38
#include "refreshtimer.hxx"
38
#include "refreshtimer.hxx"
39
39
40
#include <hash_map>
40
#include <hash_map>
41
41
42
class ScEditEngineDefaulter;
42
class ScEditEngineDefaulter;
43
class FontList;
43
class FontList;
44
class SfxStyleSheetBasePool;
44
class SfxStyleSheetBasePool;
45
class SfxStyleSheetHint;
45
class SfxStyleSheetHint;
46
struct ChartSelectionInfo;
46
struct ChartSelectionInfo;
47
class INetURLObject;
47
class INetURLObject;
48
48
49
class ScPaintItem;
49
class ScPaintItem;
50
class ScViewData;
50
class ScViewData;
51
class ScDocFunc;
51
class ScDocFunc;
52
class ScDrawLayer;
52
class ScDrawLayer;
53
class ScTabViewShell;
53
class ScTabViewShell;
54
class ScSbxDocHelper;
54
class ScSbxDocHelper;
55
class ScAutoStyleList;
55
class ScAutoStyleList;
56
class ScRange;
56
class ScRange;
57
class ScMarkData;
57
class ScMarkData;
58
class ScPaintLockData;
58
class ScPaintLockData;
59
class ScJobSetup;
59
class ScJobSetup;
60
class ScChangeAction;
60
class ScChangeAction;
61
class VirtualDevice;
61
class VirtualDevice;
62
class ScImportOptions;
62
class ScImportOptions;
63
class ScDocShellModificator;
63
class ScDocShellModificator;
64
class ScOptSolverSave;
64
class ScOptSolverSave;
65
class ScSheetSaveData;
65
class ScSheetSaveData;
66
66
67
namespace sfx2 { class FileDialogHelper; }
67
namespace sfx2 { class FileDialogHelper; }
68
struct DocShell_Impl;
68
struct DocShell_Impl;
69
69
70
typedef ::std::hash_map< sal_uLong, sal_uLong > ScChangeActionMergeMap;
70
typedef ::std::hash_map< sal_uLong, sal_uLong > ScChangeActionMergeMap;
71
71
72
//==================================================================
72
//==================================================================
73
73
74
//enum ScDBFormat { SC_FORMAT_SDF, SC_FORMAT_DBF };
74
//enum ScDBFormat { SC_FORMAT_SDF, SC_FORMAT_DBF };
75
75
76
									// Extra-Flags fuer Repaint
76
									// Extra-Flags fuer Repaint
77
#define SC_PF_LINES         1
77
#define SC_PF_LINES         1
78
#define SC_PF_TESTMERGE     2
78
#define SC_PF_TESTMERGE     2
79
#define SC_PF_WHOLEROWS     4
79
#define SC_PF_WHOLEROWS     4
80
80
81
class SC_DLLPUBLIC ScDocShell: public SfxObjectShell, public SfxListener
81
class SC_DLLPUBLIC ScDocShell: public SfxObjectShell, public SfxListener
82
{
82
{
83
	static const sal_Char __FAR_DATA pStarCalcDoc[];
83
	static const sal_Char __FAR_DATA pStarCalcDoc[];
84
	static const sal_Char __FAR_DATA pStyleName[];
84
	static const sal_Char __FAR_DATA pStyleName[];
85
85
86
	ScDocument          aDocument;
86
	ScDocument          aDocument;
87
87
88
	String				aDdeTextFmt;
88
	String				aDdeTextFmt;
89
	String				aConvFilterName; //@ #BugId	54198
89
	String				aConvFilterName; //@ #BugId	54198
90
90
91
	double				nPrtToScreenFactor;
91
	double				nPrtToScreenFactor;
92
//!   FontList*           pFontList;
92
//!   FontList*           pFontList;
93
    DocShell_Impl*      pImpl;
93
    DocShell_Impl*      pImpl;
94
	ScDocFunc*			pDocFunc;
94
	ScDocFunc*			pDocFunc;
95
95
96
	//SfxObjectCreateMode	eShellMode;
96
	//SfxObjectCreateMode	eShellMode;
97
97
98
	sal_Bool				bIsInplace;			// wird von der View gesetzt
98
	sal_Bool				bIsInplace;			// wird von der View gesetzt
99
	sal_Bool				bHeaderOn;
99
	sal_Bool				bHeaderOn;
100
	sal_Bool				bFooterOn;
100
	sal_Bool				bFooterOn;
101
	sal_Bool				bNoInformLost;
101
	sal_Bool				bNoInformLost;
102
	sal_Bool				bIsEmpty;
102
	sal_Bool				bIsEmpty;
103
	sal_Bool				bIsInUndo;
103
	sal_Bool				bIsInUndo;
104
	sal_Bool				bDocumentModifiedPending;
104
	sal_Bool				bDocumentModifiedPending;
105
	sal_uInt16				nDocumentLock;
105
	sal_uInt16				nDocumentLock;
106
    sal_Int16           nCanUpdate;  // stores the UpdateDocMode from loading a document till update links
106
    sal_Int16           nCanUpdate;  // stores the UpdateDocMode from loading a document till update links
107
    sal_Bool                bUpdateEnabled;
107
    sal_Bool                bUpdateEnabled;
108
108
109
    ScDBData*           pOldAutoDBRange;
109
    ScDBData*           pOldAutoDBRange;
110
110
111
	ScSbxDocHelper* 	pDocHelper;
111
	ScSbxDocHelper* 	pDocHelper;
112
112
113
	ScAutoStyleList*	pAutoStyleList;
113
	ScAutoStyleList*	pAutoStyleList;
114
	ScPaintLockData*	pPaintLockData;
114
	ScPaintLockData*	pPaintLockData;
115
	ScJobSetup*			pOldJobSetup;
115
	ScJobSetup*			pOldJobSetup;
116
    ScOptSolverSave*    pSolverSaveData;
116
    ScOptSolverSave*    pSolverSaveData;
117
    ScSheetSaveData*    pSheetSaveData;
117
    ScSheetSaveData*    pSheetSaveData;
118
118
119
    ScDocShellModificator* pModificator; // #109979#; is used to load XML (created in BeforeXMLLoading and destroyed in AfterXMLLoading)
119
    ScDocShellModificator* pModificator; // #109979#; is used to load XML (created in BeforeXMLLoading and destroyed in AfterXMLLoading)
120
120
121
	SC_DLLPRIVATE void			InitItems();
121
	SC_DLLPRIVATE void			InitItems();
122
	SC_DLLPRIVATE void			DoEnterHandler();
122
	SC_DLLPRIVATE void			DoEnterHandler();
123
    SC_DLLPRIVATE void          InitOptions(bool bForLoading);
123
    SC_DLLPRIVATE void          InitOptions(bool bForLoading);
124
	SC_DLLPRIVATE void			ResetDrawObjectShell();
124
	SC_DLLPRIVATE void			ResetDrawObjectShell();
125
125
126
    // SUNWS needs a forward declared friend, otherwise types and members
126
    // SUNWS needs a forward declared friend, otherwise types and members
127
    // of the outer class are not accessible.
127
    // of the outer class are not accessible.
128
    class PrepareSaveGuard;
128
    class PrepareSaveGuard;
129
    friend class ScDocShell::PrepareSaveGuard;
129
    friend class ScDocShell::PrepareSaveGuard;
130
    /** Do things that need to be done before saving to our own format and 
130
    /** Do things that need to be done before saving to our own format and 
131
        necessary clean ups in dtor. */
131
        necessary clean ups in dtor. */
132
    class PrepareSaveGuard
132
    class PrepareSaveGuard
133
    {
133
    {
134
        public:
134
        public:
135
            explicit    PrepareSaveGuard( ScDocShell & rDocShell );
135
            explicit    PrepareSaveGuard( ScDocShell & rDocShell );
136
                        ~PrepareSaveGuard();
136
                        ~PrepareSaveGuard();
137
        private:
137
        private:
138
                        ScDocShell & mrDocShell;
138
                        ScDocShell & mrDocShell;
139
    };
139
    };
140
140
141
    SC_DLLPRIVATE sal_Bool            LoadXML( SfxMedium* pMedium, const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& );
141
    SC_DLLPRIVATE sal_Bool            LoadXML( SfxMedium* pMedium, const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& );
142
    SC_DLLPRIVATE sal_Bool            SaveXML( SfxMedium* pMedium, const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& );
142
    SC_DLLPRIVATE sal_Bool            SaveXML( SfxMedium* pMedium, const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& );
143
	SC_DLLPRIVATE SCTAB			GetSaveTab();
143
	SC_DLLPRIVATE SCTAB			GetSaveTab();
144
144
145
	SC_DLLPRIVATE sal_uLong			DBaseImport( const String& rFullFileName, CharSet eCharSet,
145
	SC_DLLPRIVATE sal_uLong			DBaseImport( const String& rFullFileName, CharSet eCharSet,
146
								 sal_Bool bSimpleColWidth[MAXCOLCOUNT] );
146
								 sal_Bool bSimpleColWidth[MAXCOLCOUNT] );
147
	SC_DLLPRIVATE sal_uLong			DBaseExport( const String& rFullFileName, CharSet eCharSet,
147
	SC_DLLPRIVATE sal_uLong			DBaseExport( const String& rFullFileName, CharSet eCharSet,
148
								 sal_Bool& bHasMemo );
148
								 sal_Bool& bHasMemo );
149
149
150
	SC_DLLPRIVATE static sal_Bool		MoveFile( const INetURLObject& rSource, const INetURLObject& rDest );
150
	SC_DLLPRIVATE static sal_Bool		MoveFile( const INetURLObject& rSource, const INetURLObject& rDest );
151
	SC_DLLPRIVATE static sal_Bool		KillFile( const INetURLObject& rURL );
151
	SC_DLLPRIVATE static sal_Bool		KillFile( const INetURLObject& rURL );
152
	SC_DLLPRIVATE static sal_Bool		IsDocument( const INetURLObject& rURL );
152
	SC_DLLPRIVATE static sal_Bool		IsDocument( const INetURLObject& rURL );
153
153
154
	SC_DLLPRIVATE void			LockPaint_Impl(sal_Bool bDoc);
154
	SC_DLLPRIVATE void			LockPaint_Impl(sal_Bool bDoc);
155
	SC_DLLPRIVATE void			UnlockPaint_Impl(sal_Bool bDoc);
155
	SC_DLLPRIVATE void			UnlockPaint_Impl(sal_Bool bDoc);
156
	SC_DLLPRIVATE void			LockDocument_Impl(sal_uInt16 nNew);
156
	SC_DLLPRIVATE void			LockDocument_Impl(sal_uInt16 nNew);
157
	SC_DLLPRIVATE void			UnlockDocument_Impl(sal_uInt16 nNew);
157
	SC_DLLPRIVATE void			UnlockDocument_Impl(sal_uInt16 nNew);
158
158
159
    SC_DLLPRIVATE void          EnableSharedSettings( bool bEnable );
159
    SC_DLLPRIVATE void          EnableSharedSettings( bool bEnable );
160
    SC_DLLPRIVATE ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > LoadSharedDocument();
160
    SC_DLLPRIVATE ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > LoadSharedDocument();
161
161
	ScDBData*		GetDBDataAdd( const ScRange& rMarked, ScGetDBMode eMode, ScGetDBSelection eSel );
162
    SC_DLLPRIVATE void          UseSheetSaveEntries();
162
163
163
    SC_DLLPRIVATE void          UseSheetSaveEntries();
164
protected:
164
165
165
protected:
166
	virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
166
167
167
	virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
168
public:
168
169
					TYPEINFO();
169
public:
170
170
					TYPEINFO();
171
					SFX_DECL_INTERFACE(SCID_DOC_SHELL)
171
172
					SFX_DECL_OBJECTFACTORY();
172
					SFX_DECL_INTERFACE(SCID_DOC_SHELL)
173
173
					SFX_DECL_OBJECTFACTORY();
174
					ScDocShell( const ScDocShell& rDocShell );
174
175
					ScDocShell( const sal_uInt64 i_nSfxCreationFlags = SFXMODEL_EMBEDDED_OBJECT );
175
					ScDocShell( const ScDocShell& rDocShell );
176
					~ScDocShell();
176
					ScDocShell( const sal_uInt64 i_nSfxCreationFlags = SFXMODEL_EMBEDDED_OBJECT );
177
177
					~ScDocShell();
178
    using SotObject::GetInterface;
178
179
    using SfxShell::Activate;           // with sal_Bool bMDI
179
    using SotObject::GetInterface;
180
    using SfxShell::Deactivate;         // with sal_Bool bMDI
180
    using SfxShell::Activate;           // with sal_Bool bMDI
181
    using SfxObjectShell::Print;        // print styles
181
    using SfxShell::Deactivate;         // with sal_Bool bMDI
182
182
    using SfxObjectShell::Print;        // print styles
183
	virtual void    Activate();
183
184
	virtual void    Deactivate();
184
	virtual void    Activate();
185
185
	virtual void    Deactivate();
186
    virtual ::svl::IUndoManager*
186
187
                    GetUndoManager();
187
    virtual ::svl::IUndoManager*
188
188
                    GetUndoManager();
189
	virtual void	FillClass( SvGlobalName * pClassName,
189
190
							   sal_uInt32 * pFormat,
190
	virtual void	FillClass( SvGlobalName * pClassName,
191
							   String * pAppName,
191
							   sal_uInt32 * pFormat,
192
							   String * pFullTypeName,
192
							   String * pAppName,
193
							   String * pShortTypeName,
193
							   String * pFullTypeName,
194
							   sal_Int32 nFileFormat,
194
							   String * pShortTypeName,
195
                               sal_Bool bTemplate = sal_False ) const;
195
							   sal_Int32 nFileFormat,
196
196
                               sal_Bool bTemplate = sal_False ) const;
197
    virtual sal_Bool    InitNew( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& );
197
198
    virtual sal_Bool    Load( SfxMedium& rMedium );
198
    virtual sal_Bool    InitNew( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& );
199
    virtual sal_Bool    LoadFrom( SfxMedium& rMedium );
199
    virtual sal_Bool    Load( SfxMedium& rMedium );
200
	virtual sal_Bool    ConvertFrom( SfxMedium &rMedium );
200
    virtual sal_Bool    LoadFrom( SfxMedium& rMedium );
201
	virtual sal_Bool    Save();
201
	virtual sal_Bool    ConvertFrom( SfxMedium &rMedium );
202
    virtual sal_Bool    SaveAs( SfxMedium& rMedium );
202
	virtual sal_Bool    Save();
203
	virtual sal_Bool    ConvertTo( SfxMedium &rMedium );
203
    virtual sal_Bool    SaveAs( SfxMedium& rMedium );
204
	virtual sal_uInt16	PrepareClose( sal_Bool bUI = sal_True, sal_Bool bForBrowsing = sal_False );
204
	virtual sal_Bool    ConvertTo( SfxMedium &rMedium );
205
	virtual void	PrepareReload();
205
	virtual sal_uInt16	PrepareClose( sal_Bool bUI = sal_True, sal_Bool bForBrowsing = sal_False );
206
	virtual sal_Bool	IsInformationLost();
206
	virtual void	PrepareReload();
207
	virtual void	LoadStyles( SfxObjectShell &rSource );
207
	virtual sal_Bool	IsInformationLost();
208
	virtual sal_Bool	Insert( SfxObjectShell &rSource,
208
	virtual void	LoadStyles( SfxObjectShell &rSource );
209
								sal_uInt16 nSourceIdx1, sal_uInt16 nSourceIdx2, sal_uInt16 nSourceIdx3,
209
	virtual sal_Bool	Insert( SfxObjectShell &rSource,
210
								sal_uInt16 &nIdx1, sal_uInt16 &nIdx2, sal_uInt16 &nIdx3, sal_uInt16 &rIdxDeleted );
210
								sal_uInt16 nSourceIdx1, sal_uInt16 nSourceIdx2, sal_uInt16 nSourceIdx3,
211
211
								sal_uInt16 &nIdx1, sal_uInt16 &nIdx2, sal_uInt16 &nIdx3, sal_uInt16 &rIdxDeleted );
212
    virtual sal_Bool    SaveCompleted( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& );      // SfxInPlaceObject
212
213
	virtual sal_Bool	DoSaveCompleted( SfxMedium * pNewStor);		// SfxObjectShell
213
    virtual sal_Bool    SaveCompleted( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& );      // SfxInPlaceObject
214
    virtual sal_Bool QuerySlotExecutable( sal_uInt16 nSlotId );
214
	virtual sal_Bool	DoSaveCompleted( SfxMedium * pNewStor);		// SfxObjectShell
215
215
    virtual sal_Bool QuerySlotExecutable( sal_uInt16 nSlotId );
216
	virtual void	Draw( OutputDevice *, const JobSetup & rSetup,
216
217
								sal_uInt16 nAspect = ASPECT_CONTENT );
217
	virtual void	Draw( OutputDevice *, const JobSetup & rSetup,
218
218
								sal_uInt16 nAspect = ASPECT_CONTENT );
219
	virtual void    SetVisArea( const Rectangle & rVisArea );
219
220
220
	virtual void    SetVisArea( const Rectangle & rVisArea );
221
    using SfxObjectShell::GetVisArea;
221
222
	virtual Rectangle GetVisArea( sal_uInt16 nAspect ) const;
222
    using SfxObjectShell::GetVisArea;
223
223
	virtual Rectangle GetVisArea( sal_uInt16 nAspect ) const;
224
	virtual Printer* GetDocumentPrinter();
224
225
225
	virtual Printer* GetDocumentPrinter();
226
	virtual void	SetModified( sal_Bool = sal_True );
226
227
227
	virtual void	SetModified( sal_Bool = sal_True );
228
	void			SetVisAreaOrSize( const Rectangle& rVisArea, sal_Bool bModifyStart );
228
229
229
	void			SetVisAreaOrSize( const Rectangle& rVisArea, sal_Bool bModifyStart );
230
	virtual SfxDocumentInfoDialog*  CreateDocumentInfoDialog( Window *pParent,
230
231
															  const SfxItemSet &rSet );
231
	virtual SfxDocumentInfoDialog*  CreateDocumentInfoDialog( Window *pParent,
232
232
															  const SfxItemSet &rSet );
233
	void	GetDocStat( ScDocStat& rDocStat );
233
234
234
	void	GetDocStat( ScDocStat& rDocStat );
235
	ScDocument*     GetDocument()	{ return &aDocument; }
235
236
	ScDocFunc&		GetDocFunc()	{ return *pDocFunc; }
236
	ScDocument*     GetDocument()	{ return &aDocument; }
237
237
	ScDocFunc&		GetDocFunc()	{ return *pDocFunc; }
238
	SfxPrinter*		GetPrinter( sal_Bool bCreateIfNotExist = sal_True );
238
239
	sal_uInt16			SetPrinter( SfxPrinter* pNewPrinter, sal_uInt16 nDiffFlags = SFX_PRINTER_ALL );
239
	SfxPrinter*		GetPrinter( sal_Bool bCreateIfNotExist = sal_True );
240
240
	sal_uInt16			SetPrinter( SfxPrinter* pNewPrinter, sal_uInt16 nDiffFlags = SFX_PRINTER_ALL );
241
	void			UpdateFontList();
241
242
242
	void			UpdateFontList();
243
	String			CreateObjectName( const String& rPrefix );
243
244
244
	String			CreateObjectName( const String& rPrefix );
245
	ScDrawLayer*	MakeDrawLayer();
245
246
246
	ScDrawLayer*	MakeDrawLayer();
247
	void 			AsciiSave( SvStream& rStream, const ScImportOptions& rOpt );
247
248
248
	void 			AsciiSave( SvStream& rStream, const ScImportOptions& rOpt );
249
	void			GetSbxState( SfxItemSet &rSet );
249
250
	void			GetDrawObjState( SfxItemSet &rSet );
250
	void			GetSbxState( SfxItemSet &rSet );
251
251
	void			GetDrawObjState( SfxItemSet &rSet );
252
	void            Execute( SfxRequest& rReq );
252
253
	void            GetState( SfxItemSet &rSet );
253
	void            Execute( SfxRequest& rReq );
254
	void			ExecutePageStyle ( SfxViewShell& rCaller, SfxRequest& rReq, SCTAB nCurTab );
254
	void            GetState( SfxItemSet &rSet );
255
	void			GetStatePageStyle( SfxViewShell& rCaller, SfxItemSet& rSet, SCTAB nCurTab );
255
	void			ExecutePageStyle ( SfxViewShell& rCaller, SfxRequest& rReq, SCTAB nCurTab );
256
256
	void			GetStatePageStyle( SfxViewShell& rCaller, SfxItemSet& rSet, SCTAB nCurTab );
257
	void			CompareDocument( ScDocument& rOtherDoc );
257
258
    void            MergeDocument( ScDocument& rOtherDoc, bool bShared = false, bool bCheckDuplicates = false, sal_uLong nOffset = 0, ScChangeActionMergeMap* pMergeMap = NULL, bool bInverseMap = false );
258
	void			CompareDocument( ScDocument& rOtherDoc );
259
    bool            MergeSharedDocument( ScDocShell* pSharedDocShell );
259
    void            MergeDocument( ScDocument& rOtherDoc, bool bShared = false, bool bCheckDuplicates = false, sal_uLong nOffset = 0, ScChangeActionMergeMap* pMergeMap = NULL, bool bInverseMap = false );
260
260
    bool            MergeSharedDocument( ScDocShell* pSharedDocShell );
261
	ScChangeAction*	GetChangeAction( const ScAddress& rPos );
261
262
	void			SetChangeComment( ScChangeAction* pAction, const String& rComment );
262
	ScChangeAction*	GetChangeAction( const ScAddress& rPos );
263
	void			ExecuteChangeCommentDialog( ScChangeAction* pAction, Window* pParent,sal_Bool bPrevNext=sal_True );
263
	void			SetChangeComment( ScChangeAction* pAction, const String& rComment );
264
                    /// Protect/unprotect ChangeTrack and return <TRUE/> if
264
	void			ExecuteChangeCommentDialog( ScChangeAction* pAction, Window* pParent,sal_Bool bPrevNext=sal_True );
265
                    /// protection was successfully changed.
265
                    /// Protect/unprotect ChangeTrack and return <TRUE/> if
266
                    /// If bJustQueryIfProtected==sal_True protection is not
266
                    /// protection was successfully changed.
267
                    /// changed and <TRUE/> is returned if not protected or
267
                    /// If bJustQueryIfProtected==sal_True protection is not
268
                    /// password was entered correctly.
268
                    /// changed and <TRUE/> is returned if not protected or
269
    sal_Bool            ExecuteChangeProtectionDialog( Window* _pParent, sal_Bool bJustQueryIfProtected = sal_False );
269
                    /// password was entered correctly.
270
270
    sal_Bool            ExecuteChangeProtectionDialog( Window* _pParent, sal_Bool bJustQueryIfProtected = sal_False );
271
	void			SetPrintZoom( SCTAB nTab, sal_uInt16 nScale, sal_uInt16 nPages );
271
272
	sal_Bool			AdjustPrintZoom( const ScRange& rRange );
272
	void			SetPrintZoom( SCTAB nTab, sal_uInt16 nScale, sal_uInt16 nPages );
273
273
	sal_Bool			AdjustPrintZoom( const ScRange& rRange );
274
	void			LoadStylesArgs( ScDocShell& rSource, sal_Bool bReplace, sal_Bool bCellStyles, sal_Bool bPageStyles );
274
275
275
	void			LoadStylesArgs( ScDocShell& rSource, sal_Bool bReplace, sal_Bool bCellStyles, sal_Bool bPageStyles );
276
	void			PageStyleModified( const String& rStyleName, sal_Bool bApi );
276
277
277
	void			PageStyleModified( const String& rStyleName, sal_Bool bApi );
278
	void			NotifyStyle( const SfxStyleSheetHint& rHint );
278
279
	void			DoAutoStyle( const ScRange& rRange, const String& rStyle );
279
	void			NotifyStyle( const SfxStyleSheetHint& rHint );
280
280
	void			DoAutoStyle( const ScRange& rRange, const String& rStyle );
281
	Window*			GetActiveDialogParent();
281
282
	void			ErrorMessage( sal_uInt16 nGlobStrId );
282
	Window*			GetActiveDialogParent();
283
	sal_Bool			IsEditable() const;
283
	void			ErrorMessage( sal_uInt16 nGlobStrId );
284
284
	sal_Bool			IsEditable() const;
285
	sal_Bool			AdjustRowHeight( SCROW nStartRow, SCROW nEndRow, SCTAB nTab );
285
286
    void            UpdateAllRowHeights( const ScMarkData* pTabMark = NULL );
286
	sal_Bool			AdjustRowHeight( SCROW nStartRow, SCROW nEndRow, SCTAB nTab );
287
    void            UpdatePendingRowHeights( SCTAB nUpdateTab, bool bBefore = false );
287
    void            UpdateAllRowHeights( const ScMarkData* pTabMark = NULL );
288
288
    void            UpdatePendingRowHeights( SCTAB nUpdateTab, bool bBefore = false );
289
	void			RefreshPivotTables( const ScRange& rSource );
289
290
	void			DoConsolidate( const ScConsolidateParam& rParam, sal_Bool bRecord = sal_True );
290
	void			RefreshPivotTables( const ScRange& rSource );
291
	void			UseScenario( SCTAB nTab, const String& rName, sal_Bool bRecord = sal_True );
291
	void			DoConsolidate( const ScConsolidateParam& rParam, sal_Bool bRecord = sal_True );
292
	SCTAB			MakeScenario( SCTAB nTab, const String& rName, const String& rComment,
292
	void			UseScenario( SCTAB nTab, const String& rName, sal_Bool bRecord = sal_True );
293
									const Color& rColor, sal_uInt16 nFlags,
293
	SCTAB			MakeScenario( SCTAB nTab, const String& rName, const String& rComment,
294
									ScMarkData& rMark, sal_Bool bRecord = sal_True );
294
									const Color& rColor, sal_uInt16 nFlags,
295
	void			ModifyScenario( SCTAB nTab, const String& rName, const String& rComment,
295
									ScMarkData& rMark, sal_Bool bRecord = sal_True );
296
									const Color& rColor, sal_uInt16 nFlags );
296
	void			ModifyScenario( SCTAB nTab, const String& rName, const String& rComment,
297
	sal_Bool			MoveTable( SCTAB nSrcTab, SCTAB nDestTab, sal_Bool bCopy, sal_Bool bRecord );
297
									const Color& rColor, sal_uInt16 nFlags );
298
298
	sal_Bool			MoveTable( SCTAB nSrcTab, SCTAB nDestTab, sal_Bool bCopy, sal_Bool bRecord );
299
	void			DoRecalc( sal_Bool bApi );
299
300
	void			DoHardRecalc( sal_Bool bApi );
300
	void			DoRecalc( sal_Bool bApi );
301
301
	void			DoHardRecalc( sal_Bool bApi );
302
	void			UpdateOle( const ScViewData* pViewData, sal_Bool bSnapSize = sal_False);
302
303
	sal_Bool		IsOle();
303
	void			UpdateOle( const ScViewData* pViewData, sal_Bool bSnapSize = sal_False);
304
304
	sal_Bool		IsOle();
305
	void			DBAreaDeleted( SCTAB nTab, SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2 );
305
306
	ScDBData*		GetDBData( const ScRange& rMarked, ScGetDBMode eMode, ScGetDBSelection eSel );
306
	void			DBAreaDeleted( SCTAB nTab, SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2 );
307
    ScDBData*       GetOldAutoDBRange();    // has to be deleted by caller!
307
	ScDBData*		GetDBData( const ScRange& rMarked, ScGetDBMode eMode, ScGetDBSelection eSel );
308
    void            CancelAutoDBRange();    // called when dialog is cancelled
308
    ScDBData*       GetOldAutoDBRange();    // has to be deleted by caller!
309
309
    void            CancelAutoDBRange();    // called when dialog is cancelled
310
	void			UpdateLinks();			// Link-Eintraege aktuallisieren
310
	ScDBCollection* GetDBCollection(){ return aDocument.GetDBCollection();}
311
	sal_Bool			ReloadTabLinks();		// Links ausfuehren (Inhalt aktualisieren)
311
312
312
	void			UpdateLinks();			// Link-Eintraege aktuallisieren
313
	void            PostEditView( ScEditEngineDefaulter* pEditEngine, const ScAddress& rCursorPos );
313
	sal_Bool			ReloadTabLinks();		// Links ausfuehren (Inhalt aktualisieren)
314
314
315
	void            PostPaint( SCCOL nStartCol, SCROW nStartRow, SCTAB nStartTab,
315
	void            PostEditView( ScEditEngineDefaulter* pEditEngine, const ScAddress& rCursorPos );
316
							SCCOL nEndCol, SCROW nEndRow, SCTAB nEndTab, sal_uInt16 nPart,
316
317
							sal_uInt16 nExtFlags = 0 );
317
	void            PostPaint( SCCOL nStartCol, SCROW nStartRow, SCTAB nStartTab,
318
	void            PostPaint( const ScRange& rRange, sal_uInt16 nPart, sal_uInt16 nExtFlags = 0 );
318
							SCCOL nEndCol, SCROW nEndRow, SCTAB nEndTab, sal_uInt16 nPart,
319
319
							sal_uInt16 nExtFlags = 0 );
320
	void            PostPaintCell( SCCOL nCol, SCROW nRow, SCTAB nTab );
320
	void            PostPaint( const ScRange& rRange, sal_uInt16 nPart, sal_uInt16 nExtFlags = 0 );
321
	void            PostPaintCell( const ScAddress& rPos );
321
322
	void            PostPaintGridAll();
322
	void            PostPaintCell( SCCOL nCol, SCROW nRow, SCTAB nTab );
323
	void            PostPaintExtras();
323
	void            PostPaintCell( const ScAddress& rPos );
324
324
	void            PostPaintGridAll();
325
    bool            IsPaintLocked() const { return pPaintLockData != NULL; }
325
	void            PostPaintExtras();
326
326
327
	void            PostDataChanged();
327
    bool            IsPaintLocked() const { return pPaintLockData != NULL; }
328
328
329
	void			UpdatePaintExt( sal_uInt16& rExtFlags, SCCOL nStartCol, SCROW nStartRow, SCTAB nStartTab,
329
	void            PostDataChanged();
330
													   SCCOL nEndCol, SCROW nEndRow, SCTAB nEndTab );
330
331
	void			UpdatePaintExt( sal_uInt16& rExtFlags, const ScRange& rRange );
331
	void			UpdatePaintExt( sal_uInt16& rExtFlags, SCCOL nStartCol, SCROW nStartRow, SCTAB nStartTab,
332
332
													   SCCOL nEndCol, SCROW nEndRow, SCTAB nEndTab );
333
	void			SetDocumentModified( sal_Bool bIsModified = sal_True );
333
	void			UpdatePaintExt( sal_uInt16& rExtFlags, const ScRange& rRange );
334
	void			SetDrawModified( sal_Bool bIsModified = sal_True );
334
335
335
	void			SetDocumentModified( sal_Bool bIsModified = sal_True );
336
	void			LockPaint();
336
	void			SetDrawModified( sal_Bool bIsModified = sal_True );
337
	void			UnlockPaint();
337
338
	sal_uInt16			GetLockCount() const;
338
	void			LockPaint();
339
	void			SetLockCount(sal_uInt16 nNew);
339
	void			UnlockPaint();
340
340
	sal_uInt16			GetLockCount() const;
341
	void			LockDocument();
341
	void			SetLockCount(sal_uInt16 nNew);
342
	void			UnlockDocument();
342
343
343
	void			LockDocument();
344
    DECL_LINK( DialogClosedHdl, sfx2::FileDialogHelper* );
344
	void			UnlockDocument();
345
345
346
	virtual SfxStyleSheetBasePool*	GetStyleSheetPool();
346
    DECL_LINK( DialogClosedHdl, sfx2::FileDialogHelper* );
347
347
348
	void			SetInplace( sal_Bool bInplace );
348
	virtual SfxStyleSheetBasePool*	GetStyleSheetPool();
349
	sal_Bool			IsEmpty() const;
349
350
	void			SetEmpty(sal_Bool bSet);
350
	void			SetInplace( sal_Bool bInplace );
351
351
	sal_Bool			IsEmpty() const;
352
	sal_Bool			IsInUndo() const				{ return bIsInUndo; }
352
	void			SetEmpty(sal_Bool bSet);
353
	void			SetInUndo(sal_Bool bSet);
353
354
354
	sal_Bool			IsInUndo() const				{ return bIsInUndo; }
355
	void			CalcOutputFactor();
355
	void			SetInUndo(sal_Bool bSet);
356
	double			GetOutputFactor() const;
356
357
	void			GetPageOnFromPageStyleSet( const SfxItemSet* pStyleSet,
357
	void			CalcOutputFactor();
358
											   SCTAB			 nCurTab,
358
	double			GetOutputFactor() const;
359
											   sal_Bool&			 rbHeader,
359
	void			GetPageOnFromPageStyleSet( const SfxItemSet* pStyleSet,
360
											   sal_Bool&			 rbFooter );
360
											   SCTAB			 nCurTab,
361
361
											   sal_Bool&			 rbHeader,
362
	virtual long DdeGetData( const String& rItem, const String& rMimeType,
362
											   sal_Bool&			 rbFooter );
363
								::com::sun::star::uno::Any & rValue );
363
364
	virtual long DdeSetData( const String& rItem, const String& rMimeType,
364
	virtual long DdeGetData( const String& rItem, const String& rMimeType,
365
								const ::com::sun::star::uno::Any & rValue );
365
								::com::sun::star::uno::Any & rValue );
366
	virtual ::sfx2::SvLinkSource* DdeCreateLinkSource( const String& rItem );
366
	virtual long DdeSetData( const String& rItem, const String& rMimeType,
367
367
								const ::com::sun::star::uno::Any & rValue );
368
	const String& GetDdeTextFmt() const { return aDdeTextFmt; }
368
	virtual ::sfx2::SvLinkSource* DdeCreateLinkSource( const String& rItem );
369
369
370
	SfxBindings*	GetViewBindings();
370
	const String& GetDdeTextFmt() const { return aDdeTextFmt; }
371
371
372
	ScTabViewShell* GetBestViewShell( sal_Bool bOnlyVisible = sal_True );
372
	SfxBindings*	GetViewBindings();
373
	ScSbxDocHelper* GetDocHelperObject() { return pDocHelper; }
373
374
374
	ScTabViewShell* GetBestViewShell( sal_Bool bOnlyVisible = sal_True );
375
	void			SetDocumentModifiedPending( sal_Bool bVal )
375
	ScSbxDocHelper* GetDocHelperObject() { return pDocHelper; }
376
						{ bDocumentModifiedPending = bVal; }
376
377
	sal_Bool			IsDocumentModifiedPending() const
377
	void			SetDocumentModifiedPending( sal_Bool bVal )
378
						{ return bDocumentModifiedPending; }
378
						{ bDocumentModifiedPending = bVal; }
379
379
	sal_Bool			IsDocumentModifiedPending() const
380
    sal_Bool            IsUpdateEnabled() const
380
						{ return bDocumentModifiedPending; }
381
                        { return bUpdateEnabled; }
381
382
    void            SetUpdateEnabled(sal_Bool bValue)
382
    sal_Bool            IsUpdateEnabled() const
383
                        { bUpdateEnabled = bValue; }
383
                        { return bUpdateEnabled; }
384
384
    void            SetUpdateEnabled(sal_Bool bValue)
385
	OutputDevice*	GetRefDevice();	// WYSIWYG: Printer, otherwise VirtualDevice...
385
                        { bUpdateEnabled = bValue; }
386
386
387
	static ScViewData* GetViewData();
387
	OutputDevice*	GetRefDevice();	// WYSIWYG: Printer, otherwise VirtualDevice...
388
	static SCTAB	   GetCurTab();
388
389
389
	static ScViewData* GetViewData();
390
	static ScDocShell* GetShellByNum( sal_uInt16 nDocNo );
390
	static SCTAB	   GetCurTab();
391
	static String	GetOwnFilterName();
391
392
        static String   GetHtmlFilterName();
392
	static ScDocShell* GetShellByNum( sal_uInt16 nDocNo );
393
	static String	GetWebQueryFilterName();
393
	static String	GetOwnFilterName();
394
	static String	GetAsciiFilterName();
394
        static String   GetHtmlFilterName();
395
	static String	GetLotusFilterName();
395
	static String	GetWebQueryFilterName();
396
	static String	GetDBaseFilterName();
396
	static String	GetAsciiFilterName();
397
	static String	GetDifFilterName();
397
	static String	GetLotusFilterName();
398
	static sal_Bool		HasAutomaticTableName( const String& rFilter );
398
	static String	GetDBaseFilterName();
399
399
	static String	GetDifFilterName();
400
	DECL_LINK( RefreshDBDataHdl, ScRefreshTimer* );
400
	static sal_Bool		HasAutomaticTableName( const String& rFilter );
401
401
402
    void            BeforeXMLLoading();
402
	DECL_LINK( RefreshDBDataHdl, ScRefreshTimer* );
403
    void            AfterXMLLoading(sal_Bool bRet);
403
404
404
    void            BeforeXMLLoading();
405
    virtual sal_uInt16 GetHiddenInformationState( sal_uInt16 nStates );
405
    void            AfterXMLLoading(sal_Bool bRet);
406
406
407
    const ScOptSolverSave* GetSolverSaveData() const    { return pSolverSaveData; }     // may be null
407
    virtual sal_uInt16 GetHiddenInformationState( sal_uInt16 nStates );
408
    void            SetSolverSaveData( const ScOptSolverSave& rData );
408
409
	//<!--Added by PengYunQuan for Validity Cell Range Picker
409
    const ScOptSolverSave* GetSolverSaveData() const    { return pSolverSaveData; }     // may be null
410
	sal_Bool		AcceptStateUpdate() const;
410
    void            SetSolverSaveData( const ScOptSolverSave& rData );
411
	//-->Added by PengYunQuan for Validity Cell Range Picker
411
	//<!--Added by PengYunQuan for Validity Cell Range Picker
412
    ScSheetSaveData* GetSheetSaveData();
412
	sal_Bool		AcceptStateUpdate() const;
413
413
	//-->Added by PengYunQuan for Validity Cell Range Picker
414
    // passwword protection for Calc (derived from SfxObjectShell)
414
    ScSheetSaveData* GetSheetSaveData();
415
    // see also:    FID_CHG_RECORD, SID_CHG_PROTECT
415
416
    virtual bool    IsChangeRecording() const;
416
    // passwword protection for Calc (derived from SfxObjectShell)
417
    virtual bool    HasChangeRecordProtection() const;
417
    // see also:    FID_CHG_RECORD, SID_CHG_PROTECT
418
    virtual void    SetChangeRecording( bool bActivate );
418
    virtual bool    IsChangeRecording() const;
419
    virtual bool    SetProtectionPassword( const String &rPassword );
419
    virtual bool    HasChangeRecordProtection() const;
420
    virtual bool    GetProtectionHash( /*out*/ ::com::sun::star::uno::Sequence< sal_Int8 > &rPasswordHash );
420
    virtual void    SetChangeRecording( bool bActivate );
421
};
421
    virtual bool    SetProtectionPassword( const String &rPassword );
422
422
    virtual bool    GetProtectionHash( /*out*/ ::com::sun::star::uno::Sequence< sal_Int8 > &rPasswordHash );
423
423
};
424
void UpdateAcceptChangesDialog();
424
425
425
426
426
void UpdateAcceptChangesDialog();
427
SO2_DECL_REF(ScDocShell)
427
428
SO2_IMPL_REF(ScDocShell)
428
429
429
SO2_DECL_REF(ScDocShell)
430
430
SO2_IMPL_REF(ScDocShell)
431
// Vor Modifizierungen des Dokuments anlegen und danach zerstoeren.
431
432
// Merkt sich im Ctor AutoCalcShellDisabled und IdleDisabled, schaltet sie ab
432
433
// und stellt sie im Dtor wieder her, AutoCalcShellDisabled ggbf. auch vor
433
// Vor Modifizierungen des Dokuments anlegen und danach zerstoeren.
434
// einem ScDocShell SetDocumentModified.
434
// Merkt sich im Ctor AutoCalcShellDisabled und IdleDisabled, schaltet sie ab
435
// SetDocumentModified hierdran aufrufen statt an der ScDocShell.
435
// und stellt sie im Dtor wieder her, AutoCalcShellDisabled ggbf. auch vor
436
// Im Dtor wird wenn ScDocShell bDocumentModifiedPending gesetzt ist und
436
// einem ScDocShell SetDocumentModified.
437
// bAutoCalcShellDisabled nicht gesetzt ist ein SetDocumentModified gerufen.
437
// SetDocumentModified hierdran aufrufen statt an der ScDocShell.
438
class SC_DLLPUBLIC ScDocShellModificator
438
// Im Dtor wird wenn ScDocShell bDocumentModifiedPending gesetzt ist und
439
{
439
// bAutoCalcShellDisabled nicht gesetzt ist ein SetDocumentModified gerufen.
440
			ScDocShell&		rDocShell;
440
class SC_DLLPUBLIC ScDocShellModificator
441
	ScRefreshTimerProtector	aProtector;
441
{
442
			sal_Bool			bAutoCalcShellDisabled;
442
			ScDocShell&		rDocShell;
443
			sal_Bool			bIdleDisabled;
443
	ScRefreshTimerProtector	aProtector;
444
444
			sal_Bool			bAutoCalcShellDisabled;
445
							// not implemented
445
			sal_Bool			bIdleDisabled;
446
							ScDocShellModificator( const ScDocShellModificator& );
446
447
	ScDocShellModificator&	operator=( const ScDocShellModificator& );
447
							// not implemented
448
448
							ScDocShellModificator( const ScDocShellModificator& );
449
public:
449
	ScDocShellModificator&	operator=( const ScDocShellModificator& );
450
							ScDocShellModificator( ScDocShell& );
450
451
							~ScDocShellModificator();
451
public:
452
			void			SetDocumentModified();
452
							ScDocShellModificator( ScDocShell& );
453
};
453
							~ScDocShellModificator();
454
454
			void			SetDocumentModified();
455
455
};
456
456
457
#endif
457
458
458
459
459
#endif
460
461
(-)sc/source/ui/navipi/content.cxx (-1 / +2 lines)
Lines 734-740 Link Here
734
		{
734
		{
735
			ScDBData* pData = (*pDbNames)[i];
735
			ScDBData* pData = (*pDbNames)[i];
736
			String aStrName = pData->GetName();
736
			String aStrName = pData->GetName();
737
			if ( aStrName != aStrNoName )
737
			//if ( aStrName != aStrNoName )
738
			if ( !pData->IsBuildin() )
738
				InsertContent( SC_CONTENT_DBAREA, aStrName );
739
				InsertContent( SC_CONTENT_DBAREA, aStrName );
739
		}
740
		}
740
	}
741
	}
(-)sc/source/ui/undo/undobase.cxx (-2 / +21 lines)
Lines 33-38 Link Here
33
#include "undobase.hxx"
33
#include "undobase.hxx"
34
#include "refundo.hxx"
34
#include "refundo.hxx"
35
#include "docsh.hxx"
35
#include "docsh.hxx"
36
#include "dbdocfun.hxx"
36
#include "tabvwsh.hxx"
37
#include "tabvwsh.hxx"
37
#include "undoolk.hxx"
38
#include "undoolk.hxx"
38
#include "undodraw.hxx"
39
#include "undodraw.hxx"
Lines 390-396 Link Here
390
        sal_uInt16 nNoNameIndex;
391
        sal_uInt16 nNoNameIndex;
391
        ScDocument* pDoc = pDocShell->GetDocument();
392
        ScDocument* pDoc = pDocShell->GetDocument();
392
        ScDBCollection* pColl = pDoc->GetDBCollection();
393
        ScDBCollection* pColl = pDoc->GetDBCollection();
393
        if ( pColl->SearchName( ScGlobal::GetRscString( STR_DB_NONAME ), nNoNameIndex ) )
394
        if ( pColl->SearchName( pAutoDBRange->GetName(), nNoNameIndex ) )
394
        {
395
        {
395
            ScDBData* pNoNameData = (*pColl)[nNoNameIndex];
396
            ScDBData* pNoNameData = (*pColl)[nNoNameIndex];
396
397
Lines 403-408 Link Here
403
            pDocShell->DBAreaDeleted( nRangeTab, nRangeX1, nRangeY1, nRangeX2, nRangeY2 );
404
            pDocShell->DBAreaDeleted( nRangeTab, nRangeX1, nRangeY1, nRangeX2, nRangeY2 );
404
405
405
            *pNoNameData = *pAutoDBRange;
406
            *pNoNameData = *pAutoDBRange;
407
            /*if (pAutoDBRange->HasQueryParam())   //maybe conflict with AOO
408
            {
409
                ScQueryParam    aParam;
410
                pAutoDBRange->GetQueryParam(aParam);
411
                ScDBDocFunc aDBDocFunc( *pDocShell );
412
                aDBDocFunc.Query( nRangeTab, aParam, NULL, sal_False, sal_False );
413
            }*/
406
414
407
            if ( pAutoDBRange->HasAutoFilter() )
415
            if ( pAutoDBRange->HasAutoFilter() )
408
            {
416
            {
Lines 425-431 Link Here
425
        sal_uInt16 nNoNameIndex;
433
        sal_uInt16 nNoNameIndex;
426
        ScDocument* pDoc = pDocShell->GetDocument();
434
        ScDocument* pDoc = pDocShell->GetDocument();
427
        ScDBCollection* pColl = pDoc->GetDBCollection();
435
        ScDBCollection* pColl = pDoc->GetDBCollection();
428
        if ( pColl->SearchName( ScGlobal::GetRscString( STR_DB_NONAME ), nNoNameIndex ) )
436
        if ( pColl->SearchName( pAutoDBRange->GetName(), nNoNameIndex ) )
429
        {
437
        {
430
            ScDBData* pNoNameData = (*pColl)[nNoNameIndex];
438
            ScDBData* pNoNameData = (*pColl)[nNoNameIndex];
431
439
Lines 435-440 Link Here
435
            SCROW nRangeY2;
443
            SCROW nRangeY2;
436
            SCTAB nRangeTab;
444
            SCTAB nRangeTab;
437
            pNoNameData->GetArea( nRangeTab, nRangeX1, nRangeY1, nRangeX2, nRangeY2 );
445
            pNoNameData->GetArea( nRangeTab, nRangeX1, nRangeY1, nRangeX2, nRangeY2 );
446
            /*if (pAutoDBRange->HasQueryParam())
447
            {
448
                ScQueryParam    aParam;
449
                pAutoDBRange->GetQueryParam(aParam);
450
                SCSIZE nEC = aParam.GetEntryCount();
451
                for (SCSIZE i=0; i<nEC; i++)
452
                    aParam.GetEntry(i).bDoQuery = sal_False;
453
                aParam.bDuplicate = sal_True;
454
                ScDBDocFunc aDBDocFunc( *pDocShell );
455
                aDBDocFunc.Query( nRangeTab, aParam, NULL, sal_False, sal_False );
456
            }*/
438
            pDocShell->DBAreaDeleted( nRangeTab, nRangeX1, nRangeY1, nRangeX2, nRangeY2 );
457
            pDocShell->DBAreaDeleted( nRangeTab, nRangeX1, nRangeY1, nRangeX2, nRangeY2 );
439
458
440
            pNoNameData->SetSortParam( ScSortParam() );
459
            pNoNameData->SetSortParam( ScSortParam() );
(-)sc/source/ui/undo/undoutil.cxx (-2 / +4 lines)
Lines 93-99 Link Here
93
		{
93
		{
94
			String aName;
94
			String aName;
95
			pUndoData->GetName( aName );
95
			pUndoData->GetName( aName );
96
			if ( aName == ScGlobal::GetRscString( STR_DB_NONAME ) )
96
//			if ( aName == ScGlobal::GetRscString( STR_DB_NONAME ) )
97
			if (pUndoData->IsBuildin())
97
				bWasTemp = sal_True;
98
				bWasTemp = sal_True;
98
		}
99
		}
99
        DBG_ASSERT(bWasTemp, "Undo: didn't find database range");
100
        DBG_ASSERT(bWasTemp, "Undo: didn't find database range");
Lines 104-110 Link Here
104
			pRet = (*pColl)[nIndex];
105
			pRet = (*pColl)[nIndex];
105
		else
106
		else
106
		{
107
		{
107
			pRet = new ScDBData( ScGlobal::GetRscString( STR_DB_NONAME ), nTab,
108
            String	aNoNamed = pColl->GetNewDefaultDBName();
109
			pRet = new ScDBData( aNoNamed/*ScGlobal::GetRscString( STR_DB_NONAME )*/, nTab,
108
								nCol1,nRow1, nCol2,nRow2, sal_True,
110
								nCol1,nRow1, nCol2,nRow2, sal_True,
109
								pDoc->HasColHeader( nCol1,nRow1,nCol2,nRow2,nTab ) );
111
								pDoc->HasColHeader( nCol1,nRow1,nCol2,nRow2,nTab ) );
110
			pColl->Insert( pRet );
112
			pColl->Insert( pRet );
(-)sc/source/ui/view/cellsh2.cxx (-5 / +6 lines)
Lines 357-363 Link Here
357
					ScSubTotalParam aSubTotalParam;
357
					ScSubTotalParam aSubTotalParam;
358
					SfxItemSet		aArgSet( GetPool(), SCITEM_SUBTDATA, SCITEM_SUBTDATA );
358
					SfxItemSet		aArgSet( GetPool(), SCITEM_SUBTDATA, SCITEM_SUBTDATA );
359
359
360
					ScDBData* pDBData = pTabViewShell->GetDBData();
360
					//ScDBData* pDBData = pTabViewShell->GetDBData();
361
                    ScDBData* pDBData = pTabViewShell->GetDBData(sal_True, SC_DB_MAKE_SUBTOTAL);
361
					pDBData->GetSubTotalParam( aSubTotalParam );
362
					pDBData->GetSubTotalParam( aSubTotalParam );
362
					aSubTotalParam.bRemoveOnly = sal_False;
363
					aSubTotalParam.bRemoveOnly = sal_False;
363
364
Lines 411-417 Link Here
411
                //#i60401 ux-ctest: Calc does not support all users' strategies regarding sorting data
412
                //#i60401 ux-ctest: Calc does not support all users' strategies regarding sorting data
412
                //the patch comes from maoyg
413
                //the patch comes from maoyg
413
                ScSortParam aSortParam;
414
                ScSortParam aSortParam;
414
                ScDBData*	pDBData = pTabViewShell->GetDBData();
415
                ScDBData*	pDBData = pTabViewShell->GetDBData(sal_True, SC_DB_MAKE_SORT);
415
                ScViewData* pData   = GetViewData();
416
                ScViewData* pData   = GetViewData();
416
417
417
                pDBData->GetSortParam( aSortParam );
418
                pDBData->GetSortParam( aSortParam );
Lines 462-468 Link Here
462
                if ( pArgs )		// Basic
463
                if ( pArgs )		// Basic
463
                {
464
                {
464
                    ScSortParam aSortParam;
465
                    ScSortParam aSortParam;
465
                    ScDBData*	pDBData = pTabViewShell->GetDBData();
466
                    ScDBData*	pDBData = pTabViewShell->GetDBData(sal_True, SC_DB_MAKE_SORT);
466
                    ScViewData* pData   = GetViewData();
467
                    ScViewData* pData   = GetViewData();
467
468
468
                    pDBData->GetSortParam( aSortParam );
469
                    pDBData->GetSortParam( aSortParam );
Lines 525-531 Link Here
525
                else
526
                else
526
                {
527
                {
527
                    ScSortParam aSortParam;
528
                    ScSortParam aSortParam;
528
                    ScDBData*	pDBData = pTabViewShell->GetDBData();
529
                    ScDBData*	pDBData = pTabViewShell->GetDBData(sal_True, SC_DB_MAKE_SORT);
529
                    ScViewData* pData   = GetViewData();
530
                    ScViewData* pData   = GetViewData();
530
531
531
                    pDBData->GetSortParam( aSortParam );
532
                    pDBData->GetSortParam( aSortParam );
Lines 680-686 Link Here
680
		case SID_UNFILTER:
681
		case SID_UNFILTER:
681
			{
682
			{
682
				ScQueryParam aParam;
683
				ScQueryParam aParam;
683
				ScDBData*	 pDBData = pTabViewShell->GetDBData();
684
				ScDBData*	 pDBData = pTabViewShell->GetDBData(sal_True, SC_DB_OLD_FILTER);
684
685
685
				pDBData->GetQueryParam( aParam );
686
				pDBData->GetQueryParam( aParam );
686
				SCSIZE nEC = aParam.GetEntryCount();
687
				SCSIZE nEC = aParam.GetEntryCount();
(-)sc/source/ui/view/dbfunc.cxx (-11 / +20 lines)
Lines 334-368 Link Here
334
334
335
	ScQueryParam	aParam;
335
	ScQueryParam	aParam;
336
	ScDocument*		pDoc	= GetViewData()->GetDocument();
336
	ScDocument*		pDoc	= GetViewData()->GetDocument();
337
	ScDBData*		pDBData = GetDBData( sal_False, SC_DB_MAKE, SC_DBSEL_ROW_DOWN );
337
	ScDBData*		pDBData = GetDBData( sal_False, SC_DB_OLD_FILTER, SC_DBSEL_ROW_DOWN );
338
338
339
	pDBData->SetByRow( sal_True );				//! Undo, vorher abfragen ??
339
	
340
	pDBData->GetQueryParam( aParam );
341
340
342
341
343
	SCCOL  nCol;
342
	SCCOL  nCol;
344
	SCROW  nRow = aParam.nRow1;
343
	SCROW  nRow;
345
	SCTAB  nTab = GetViewData()->GetTabNo();
344
	SCTAB  nTab = GetViewData()->GetTabNo();
346
	sal_Int16   nFlag;
345
	sal_Int16   nFlag;
347
	sal_Bool	bHasAuto = sal_True;
346
	//sal_Bool	bHasAuto = sal_True;
348
	sal_Bool	bHeader  = pDBData->HasHeader();
347
	sal_Bool	bHeader;
349
	sal_Bool	bPaint   = sal_False;
348
	sal_Bool	bPaint   = sal_False;
350
349
351
	//!		stattdessen aus DB-Bereich abfragen?
350
	//!		stattdessen aus DB-Bereich abfragen?
352
351
353
	for (nCol=aParam.nCol1; nCol<=aParam.nCol2 && bHasAuto; nCol++)
352
	/*for (nCol=aParam.nCol1; nCol<=aParam.nCol2 && bHasAuto; nCol++)
354
	{
353
	{
355
		nFlag = ((ScMergeFlagAttr*) pDoc->
354
		nFlag = ((ScMergeFlagAttr*) pDoc->
356
				GetAttr( nCol, nRow, nTab, ATTR_MERGE_FLAG ))->GetValue();
355
				GetAttr( nCol, nRow, nTab, ATTR_MERGE_FLAG ))->GetValue();
357
356
358
		if ( (nFlag & SC_MF_AUTO) == 0 )
357
		if ( (nFlag & SC_MF_AUTO) == 0 )
359
			bHasAuto = sal_False;
358
			bHasAuto = sal_False;
360
	}
359
	}*/
361
360
362
	if (bHasAuto)								// aufheben
361
	if (pDBData && pDBData->HasAutoFilter())								// aufheben
363
	{
362
	{
364
		//	Filterknoepfe ausblenden
363
		//	Filterknoepfe ausblenden
365
364
		pDBData->SetByRow( sal_True );				//! Undo, vorher abfragen ??
365
		pDBData->GetQueryParam( aParam );
366
		nRow = aParam.nRow1;
367
        bHeader = pDBData->HasHeader();
366
		for (nCol=aParam.nCol1; nCol<=aParam.nCol2; nCol++)
368
		for (nCol=aParam.nCol1; nCol<=aParam.nCol2; nCol++)
367
		{
369
		{
368
			nFlag = ((ScMergeFlagAttr*) pDoc->
370
			nFlag = ((ScMergeFlagAttr*) pDoc->
Lines 396-401 Link Here
396
	}
398
	}
397
	else									// Filterknoepfe einblenden
399
	else									// Filterknoepfe einblenden
398
	{
400
	{
401
        pDBData = GetDBData(sal_False, SC_DB_MAKE_FILTER);
402
        pDBData->SetByRow(sal_True);
403
        pDBData->GetQueryParam(aParam);
404
        nRow = aParam.nRow1;
405
        bHeader = pDBData->HasHeader();
406
	
399
		if ( !pDoc->IsBlockEmpty( nTab,
407
		if ( !pDoc->IsBlockEmpty( nTab,
400
								  aParam.nCol1, aParam.nRow1,
408
								  aParam.nCol1, aParam.nRow1,
401
								  aParam.nCol2, aParam.nRow2 ) )
409
								  aParam.nCol2, aParam.nRow2 ) )
Lines 457-463 Link Here
457
	ScDocument* pDoc = pDocSh->GetDocument();
465
	ScDocument* pDoc = pDocSh->GetDocument();
458
466
459
	ScQueryParam aParam;
467
	ScQueryParam aParam;
460
	ScDBData* pDBData = GetDBData( sal_False );
468
	//ScDBData* pDBData = GetDBData( FALSE );
469
    ScDBData* pDBData = GetDBData(sal_False, SC_DB_OLD_FILTER);
461
470
462
	SCTAB nTab;
471
	SCTAB nTab;
463
	SCCOL nCol1, nCol2;
472
	SCCOL nCol1, nCol2;
(-)sc/source/ui/view/tabvwshc.cxx (-2 / +2 lines)
Lines 171-177 Link Here
171
									 SCITEM_QUERYDATA,
171
									 SCITEM_QUERYDATA,
172
									 SCITEM_QUERYDATA );
172
									 SCITEM_QUERYDATA );
173
173
174
			ScDBData* pDBData = GetDBData( sal_True, SC_DB_MAKE, SC_DBSEL_ROW_DOWN);
174
			ScDBData* pDBData = GetDBData( sal_True, SC_DB_MAKE_FILTER, SC_DBSEL_ROW_DOWN);
175
			pDBData->GetQueryParam( aQueryParam );
175
			pDBData->GetQueryParam( aQueryParam );
176
176
177
			ScQueryItem aItem( SCITEM_QUERYDATA, GetViewData(), &aQueryParam );
177
			ScQueryItem aItem( SCITEM_QUERYDATA, GetViewData(), &aQueryParam );
Lines 196-202 Link Here
196
									 SCITEM_QUERYDATA,
196
									 SCITEM_QUERYDATA,
197
									 SCITEM_QUERYDATA );
197
									 SCITEM_QUERYDATA );
198
198
199
			ScDBData* pDBData = GetDBData( sal_True, SC_DB_MAKE, SC_DBSEL_ROW_DOWN);
199
			ScDBData* pDBData = GetDBData( sal_True, SC_DB_MAKE_FILTER, SC_DBSEL_ROW_DOWN);
200
			pDBData->GetQueryParam( aQueryParam );
200
			pDBData->GetQueryParam( aQueryParam );
201
201
202
			aArgSet.Put( ScQueryItem( SCITEM_QUERYDATA,
202
			aArgSet.Put( ScQueryItem( SCITEM_QUERYDATA,

Return to issue 12666