summaryrefslogtreecommitdiff
path: root/binfilter/bf_sc/source/core/data/sc_documen9.cxx
blob: 0a2bdfffaf950f4eb0b80226ca3d761632b0696a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
 *
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 * 
 * Copyright 2000, 2010 Oracle and/or its affiliates.
 *
 * OpenOffice.org - a multi-platform office productivity suite
 *
 * This file is part of OpenOffice.org.
 *
 * OpenOffice.org is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License version 3
 * only, as published by the Free Software Foundation.
 *
 * OpenOffice.org is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License version 3 for more details
 * (a copy is included in the LICENSE file that accompanied this code).
 *
 * You should have received a copy of the GNU Lesser General Public License
 * version 3 along with OpenOffice.org.  If not, see
 * <http://www.openoffice.org/license.html>
 * for a copy of the LGPLv3 License.
 *
 ************************************************************************/

#ifdef _MSC_VER
#pragma hdrstop
#endif

// INCLUDE ---------------------------------------------------------------

#include "scitems.hxx"
#include <bf_svx/eeitem.hxx>
#define ITEMID_FIELD EE_FEATURE_FIELD

#include <bf_svx/fontitem.hxx>
#include <bf_svx/forbiddencharacterstable.hxx>
#include <bf_svx/langitem.hxx>
#include <bf_svx/svditer.hxx>
#include <bf_svx/svdocapt.hxx>
#include <bf_svx/svdoole2.hxx>
#include <bf_svx/svdouno.hxx>
#include <bf_svx/svdpage.hxx>
#include <bf_svx/xtable.hxx>
#include <bf_sfx2/objsh.hxx>
#include <bf_sfx2/printer.hxx>
#include <bf_svtools/saveopt.hxx>
#include <bf_svtools/pathoptions.hxx>
#include <bf_sch/schdll.hxx>
#include <bf_sch/schdll0.hxx>

#include "document.hxx"
#include "docoptio.hxx"
#include "drwlayer.hxx"
#include "userdat.hxx"
#include "patattr.hxx"
#include "rechead.hxx"
#include "poolhelp.hxx"
#include "docpool.hxx"
#include "detfunc.hxx"		// for UpdateAllComments
#include "editutil.hxx"
namespace binfilter {


// -----------------------------------------------------------------------

/*N*/ XColorTable* ScDocument::GetColorTable()
/*N*/ {
/*N*/ 	if (pDrawLayer)
/*N*/ 		return pDrawLayer->GetColorTable();
/*N*/ 	else
/*N*/ 	{
/*N*/ 		if (!pColorTable)
/*N*/ 		{
/*N*/ 			SvtPathOptions aPathOpt;
/*N*/ 			pColorTable = new XColorTable( aPathOpt.GetPalettePath() );
/*N*/ 		}
/*N*/
/*N*/ 		return pColorTable;
/*N*/ 	}
/*N*/ }

/*N*/ void ScDocument::TransferDrawPage(ScDocument* pSrcDoc, USHORT nSrcPos, USHORT nDestPos)
/*N*/ {
/*N*/ 	if (pDrawLayer && pSrcDoc->pDrawLayer)
/*N*/ 	{
/*?*/ 		SdrPage* pOldPage = pSrcDoc->pDrawLayer->GetPage(nSrcPos);
/*?*/ 		SdrPage* pNewPage = pDrawLayer->GetPage(nDestPos);
/*?*/
/*?*/ 		if (pOldPage && pNewPage)
/*?*/ 		{
/*?*/ 			SdrObjListIter aIter( *pOldPage, IM_FLAT );
/*?*/ 			SdrObject* pOldObject = aIter.Next();
/*?*/ 			while (pOldObject)
/*?*/ 			{DBG_BF_ASSERT(0, "STRIP"); //STRIP001
/*?*/ 			}
/*?*/ 		}
/*N*/ 	}
/*N*/ }


/*N*/ void ScDocument::InitDrawLayer( SfxObjectShell* pDocShell )
/*N*/ {
/*N*/ 	if (pDocShell && !pShell)
/*N*/ 		pShell = pDocShell;
/*N*/
/*N*/ //	DBG_ASSERT(pShell,"InitDrawLayer ohne Shell");
/*N*/
/*N*/ 	if (!pDrawLayer)
/*N*/ 	{
/*N*/ 		String aName;
/*N*/ 		if ( pShell && !pShell->IsLoading() )		// #88438# don't call GetTitle while loading
/*N*/ 			aName = pShell->GetTitle();
/*N*/ 		pDrawLayer = new ScDrawLayer( this, aName );
/*N*/ 		if (pLinkManager)
/*N*/ 			pDrawLayer->SetLinkManager( pLinkManager );
/*N*/
/*N*/ 		//	Drawing pages are accessed by table number, so they must also be present
/*N*/ 		//	for preceding table numbers, even if the tables aren't allocated
/*N*/ 		//	(important for clipboard documents).
/*N*/
/*N*/ 		USHORT nDrawPages = 0;
/*N*/ 		USHORT nTab;
/*N*/ 		for (nTab=0; nTab<=MAXTAB; nTab++)
/*N*/ 			if (pTab[nTab])
/*N*/ 				nDrawPages = nTab + 1;			// needed number of pages
/*N*/
/*N*/ 		for (nTab=0; nTab<nDrawPages; nTab++)
/*N*/ 		{
/*N*/ 			pDrawLayer->ScAddPage( nTab );		// always add page, with or without the table
/*N*/ 			if (pTab[nTab])
/*N*/ 			{
/*N*/ 				String aName;
/*N*/ 				pTab[nTab]->GetName(aName);
/*N*/ 				pDrawLayer->ScRenamePage( nTab, aName );
/*N*/
/*N*/ 				pTab[nTab]->SetDrawPageSize();	// #54782# sofort die richtige Groesse
/*N*/ #if 0
/*N*/ 				ULONG nx = (ULONG) ((double) (MAXCOL+1) * STD_COL_WIDTH			  * HMM_PER_TWIPS );
/*N*/ 				ULONG ny = (ULONG) ((double) (MAXROW+1) * ScGlobal::nStdRowHeight * HMM_PER_TWIPS );
/*N*/ 				pDrawLayer->SetPageSize( nTab, Size( nx, ny ) );
/*N*/ #endif
/*N*/ 			}
/*N*/ 		}
/*N*/
/*N*/ 		pDrawLayer->SetDefaultTabulator( GetDocOptions().GetTabDistance() );
/*N*/
/*N*/ 		UpdateDrawPrinter();
/*N*/ 		UpdateDrawLanguages();
/*N*/ 		if (bImportingXML)
/*?*/ 			pDrawLayer->EnableAdjust(FALSE);
/*N*/
/*N*/ 		pDrawLayer->SetForbiddenCharsTable( xForbiddenCharacters );
/*N*/ 		pDrawLayer->SetCharCompressType( GetAsianCompression() );
/*N*/ 		pDrawLayer->SetKernAsianPunctuation( GetAsianKerning() );
/*N*/ 	}
/*N*/ }

/*N*/ void ScDocument::UpdateDrawLanguages()
/*N*/ {
/*N*/ 	if (pDrawLayer)
/*N*/ 	{
/*N*/ 		SfxItemPool& rDrawPool = pDrawLayer->GetItemPool();
/*N*/ 		rDrawPool.SetPoolDefaultItem( SvxLanguageItem( eLanguage, EE_CHAR_LANGUAGE ) );
/*N*/ 		rDrawPool.SetPoolDefaultItem( SvxLanguageItem( eCjkLanguage, EE_CHAR_LANGUAGE_CJK ) );
/*N*/ 		rDrawPool.SetPoolDefaultItem( SvxLanguageItem( eCtlLanguage, EE_CHAR_LANGUAGE_CTL ) );
/*N*/ 	}
/*N*/ }

/*N*/ void ScDocument::UpdateDrawPrinter()
/*N*/ {
/*N*/ 	if (pDrawLayer)
/*N*/ 	{
/*N*/ 		// use the printer even if IsValid is false
/*N*/ 		// Application::GetDefaultDevice causes trouble with changing MapModes
/*N*/
/*N*/ 		OutputDevice* pRefDev = GetPrinter();
/*N*/ 		pRefDev->SetMapMode( MAP_100TH_MM );
/*N*/ 		pDrawLayer->SetRefDevice(pRefDev);
/*N*/ 	}
/*N*/ }

/*N*/ BOOL ScDocument::IsChart( SdrObject* pObject )
/*N*/ {
/*N*/ 	if ( pObject->GetObjIdentifier() == OBJ_OLE2 )
/*N*/ 	{
/*N*/ 		SvInPlaceObjectRef aIPObj = ((SdrOle2Obj*)pObject)->GetObjRef();
/*N*/ 		if (aIPObj.Is())
/*N*/ 		{
/*N*/ 			SvGlobalName aObjClsId = *aIPObj->GetSvFactory();
/*N*/ 			if (SchModuleDummy::HasID( aObjClsId ))
/*N*/ 				return TRUE;
/*N*/ 		}
/*N*/ 	}
/*N*/ 	return FALSE;
/*N*/ }

/*N*/ IMPL_LINK_INLINE_START( ScDocument, GetUserDefinedColor, USHORT *, pColorIndex )
/*N*/ {
/*N*/ 	return (long) &((GetColorTable()->Get(*pColorIndex))->GetColor());
/*N*/ }
/*N*/ IMPL_LINK_INLINE_END( ScDocument, GetUserDefinedColor, USHORT *, pColorIndex )

/*N*/ void ScDocument::DeleteDrawLayer()
/*N*/ {
/*N*/ 	delete pDrawLayer;
/*N*/ }

/*N*/ void ScDocument::DeleteColorTable()
/*N*/ {
/*N*/ 	delete pColorTable;
/*N*/ }

/*N*/ void ScDocument::LoadDrawLayer(SvStream& rStream)
/*N*/ {
/*N*/ 	InitDrawLayer();						// anlegen
/*N*/ 	pDrawLayer->Load(rStream);
/*N*/
/*N*/ 	//	nMaxTableNumber ist noch nicht initialisiert
/*N*/
/*N*/ 	USHORT nTableCount = 0;
/*N*/ 	while ( nTableCount <= MAXTAB && pTab[nTableCount] )
/*N*/ 		++nTableCount;
/*N*/
/*N*/ 	USHORT nPageCount = pDrawLayer->GetPageCount();
/*N*/ 	if ( nPageCount > nTableCount && nTableCount != 0 )
/*N*/ 	{
/*?*/ 		//	Manchmal sind beim Kopieren/Verschieben/Undo von Tabellen zuviele
/*?*/ 		//	(leere) Pages in der Tabelle stehengeblieben. Weg damit!
/*?*/
/*?*/ 		DBG_ERROR("zuviele Draw-Pages in der Datei");
/*?*/
/*?*/ 		for (USHORT i=nTableCount; i<nPageCount; i++)
/*?*/ 			pDrawLayer->DeletePage(nTableCount);
/*N*/ 	}
/*N*/
/*N*/ 	//	Controls auf richtigen Layer setzen
/*N*/ 	//	(zumindest in Dateien aus der 502 koennen sie falsch sein,
/*N*/ 	//	 wegen des fehlenden Layers in alten Dateien)
/*N*/
/*N*/ 	nPageCount = pDrawLayer->GetPageCount();
/*N*/ 	for (USHORT i=0; i<nPageCount; i++)
/*N*/ 	{
/*N*/ 		SdrPage* pPage = pDrawLayer->GetPage(i);
/*N*/ 		SdrObjListIter aIter( *pPage, IM_DEEPNOGROUPS );
/*N*/ 		SdrObject* pObject = aIter.Next();
/*N*/ 		while (pObject)
/*N*/ 		{
/*N*/ 			if ( pObject->ISA(SdrUnoObj) && pObject->GetLayer() != SC_LAYER_CONTROLS )
/*N*/ 			{
/*?*/ 				pObject->NbcSetLayer(SC_LAYER_CONTROLS);
/*?*/ 				DBG_ERROR("Control war auf falschem Layer");
/*N*/ 			}
/*N*/ 			pObject = aIter.Next();
/*N*/ 		}
/*N*/ 	}
/*N*/ }

/*N*/ void ScDocument::StoreDrawLayer(SvStream& rStream) const
/*N*/ {
/*N*/ 	if (pDrawLayer)
/*N*/ 	{
/*N*/ 		//	SetSavePortable wird mit VCL nicht mehr gebraucht
/*N*/ 		//BOOL bIndep = SFX_APP()->GetOptions().IsIndepGrfFmt();
/*N*/ 		//pDrawLayer->SetSavePortable( bIndep );
/*N*/
/*N*/       pDrawLayer->SetSaveCompressed( FALSE );
/*N*/       pDrawLayer->SetSaveNative( FALSE );
/*N*/
/*N*/ 		pDrawLayer->GetItemPool().SetFileFormatVersion( (USHORT)rStream.GetVersion() );
/*N*/ 		pDrawLayer->Store(rStream);
/*N*/ 	}
/*N*/ }

/*N*/ BOOL ScDocument::DrawGetPrintArea( ScRange& rRange, BOOL bSetHor, BOOL bSetVer ) const
/*N*/ {
/*N*/ 	return pDrawLayer->GetPrintArea( rRange, bSetHor, bSetVer );
/*N*/ }










/*N*/ BOOL ScDocument::HasNoteObject( USHORT nCol, USHORT nRow, USHORT nTab ) const
/*N*/ {
/*N*/ 	if (!pDrawLayer)
/*N*/ 		return FALSE;
/*N*/ 	SdrPage* pPage = pDrawLayer->GetPage(nTab);
/*N*/ 	DBG_ASSERT(pPage,"Page ?");
/*N*/ 	if (!pPage)
/*N*/ 		return FALSE;
/*N*/
/*N*/ 	BOOL bFound = FALSE;
/*N*/
/*N*/ 	SdrObjListIter aIter( *pPage, IM_FLAT );
/*N*/ 	SdrObject* pObject = aIter.Next();
/*N*/ 	while (pObject && !bFound)
/*N*/ 	{
/*N*/ 		if ( pObject->GetLayer() == SC_LAYER_INTERN && pObject->ISA( SdrCaptionObj ) )
/*N*/ 		{
/*N*/ 			ScDrawObjData* pData = ScDrawLayer::GetObjData( pObject );
/*N*/ 			if ( pData && nCol == pData->aStt.nCol && nRow == pData->aStt.nRow )
/*N*/ 				bFound = TRUE;
/*N*/ 		}
/*N*/ 		pObject = aIter.Next();
/*N*/ 	}
/*N*/
/*N*/ 	return bFound;
/*N*/ }

/*N*/ void ScDocument::RefreshNoteFlags()
/*N*/ {
/*N*/ 	if (!pDrawLayer)
/*N*/ 		return;
/*N*/
/*N*/ 	BOOL bAnyIntObj = FALSE;
/*N*/ 	USHORT nTab;
/*N*/ 	ScPostIt aNote;
/*N*/ 	for (nTab=0; nTab<=MAXTAB && pTab[nTab]; nTab++)
/*N*/ 	{
/*N*/ 		SdrPage* pPage = pDrawLayer->GetPage(nTab);
/*N*/ 		DBG_ASSERT(pPage,"Page ?");
/*N*/ 		if (pPage)
/*N*/ 		{
/*N*/ 			SdrObjListIter aIter( *pPage, IM_FLAT );
/*N*/ 			SdrObject* pObject = aIter.Next();
/*N*/ 			while (pObject)
/*N*/ 			{
/*N*/ 				if ( pObject->GetLayer() == SC_LAYER_INTERN )
/*N*/ 				{
/*?*/ 					bAnyIntObj = TRUE;	// for all internal objects, including detective
/*?*/
/*?*/ 					if ( pObject->ISA( SdrCaptionObj ) )
/*?*/ 					{
/*?*/ 						ScDrawObjData* pData = ScDrawLayer::GetObjData( pObject );
/*?*/ 						if ( pData )
/*?*/ 						{
/*?*/ 							if ( GetNote( pData->aStt.nCol, pData->aStt.nRow, nTab, aNote ) )
/*?*/ 								if ( !aNote.IsShown() )
/*?*/ 								{
/*?*/ 									aNote.SetShown(TRUE);
/*?*/ 									SetNote( pData->aStt.nCol, pData->aStt.nRow, nTab, aNote );
/*?*/ 								}
/*?*/ 						}
/*?*/ 					}
/*N*/ 				}
/*N*/ 				pObject = aIter.Next();
/*N*/ 			}
/*N*/ 		}
/*N*/ 	}
/*N*/
/*N*/ 	if (bAnyIntObj)
/*N*/ 	{
/*?*/ 		//	update attributes for all note objects and the colors of detective objects
/*?*/ 		//	(we don't know with which settings the file was created)
/*?*/
/*N*/ 	ScDetectiveFunc aFunc( this, 0 ); // detective.sdc
/*N*/ /*?*/ 		aFunc.UpdateAllComments();
/*N*/ /*?*/ 		aFunc.UpdateAllArrowColors();
/*N*/ 	}
/*N*/ }

/*N*/ BOOL ScDocument::IsPrintEmpty( USHORT nTab, USHORT nStartCol, USHORT nStartRow,
/*N*/ 								USHORT nEndCol, USHORT nEndRow, BOOL bLeftIsEmpty,
/*N*/ 								ScRange* pLastRange, Rectangle* pLastMM ) const
/*N*/ {
    DBG_BF_ASSERT(0, "STRIP"); //STRIP001 	if (!IsBlockEmpty( nTab, nStartCol, nStartRow, nEndCol, nEndRow ))
/*N*/  	return TRUE;
/*N*/ }

/*N*/ void ScDocument::Clear()
/*N*/ {
/*N*/ 	for (USHORT i=0; i<=MAXTAB; i++)
/*N*/ 		if (pTab[i])
/*N*/ 		{
/*N*/ 			delete pTab[i];
/*N*/ 			pTab[i]=NULL;
/*N*/ 		}
/*N*/ 	delete pSelectionAttr;
/*N*/ 	pSelectionAttr = NULL;
/*N*/
/*N*/ 	if (pDrawLayer)
/*N*/ 		pDrawLayer->Clear();
/*N*/ }

/*N*/ BOOL ScDocument::HasDetectiveObjects(USHORT nTab) const
/*N*/ {
/*N*/ 	//	looks for detective objects, annotations don't count
/*N*/ 	//	(used to adjust scale so detective objects hit their cells better)
/*N*/
/*N*/ 	BOOL bFound = FALSE;
/*N*/
/*N*/ 	if (pDrawLayer)
/*N*/ 	{
/*N*/ 		SdrPage* pPage = pDrawLayer->GetPage(nTab);
/*N*/ 		DBG_ASSERT(pPage,"Page ?");
/*N*/ 		if (pPage)
/*N*/ 		{
/*N*/ 			SdrObjListIter aIter( *pPage, IM_DEEPNOGROUPS );
/*N*/ 			SdrObject* pObject = aIter.Next();
/*N*/ 			while (pObject && !bFound)
/*N*/ 			{
/*N*/ 				// anything on the internal layer except captions (annotations)
/*N*/ 				if ( pObject->GetLayer() == SC_LAYER_INTERN && !pObject->ISA( SdrCaptionObj ) )
/*N*/ 					bFound = TRUE;
/*N*/
/*N*/ 				pObject = aIter.Next();
/*N*/ 			}
/*N*/ 		}
/*N*/ 	}
/*N*/
/*N*/ 	return bFound;
/*N*/ }

/*N*/ void ScDocument::UpdateFontCharSet()
/*N*/ {
/*N*/ 	//	In alten Versionen (bis incl. 4.0 ohne SP) wurden beim Austausch zwischen
/*N*/ 	//	Systemen die CharSets in den Font-Attributen nicht angepasst.
/*N*/ 	//	Das muss fuer Dokumente bis incl SP2 nun nachgeholt werden:
/*N*/ 	//	Alles, was nicht SYMBOL ist, wird auf den System-CharSet umgesetzt.
/*N*/ 	//	Bei neuen Dokumenten (Version SC_FONTCHARSET) sollte der CharSet stimmen.
/*N*/
/*N*/ 	BOOL bUpdateOld = ( nSrcVer < SC_FONTCHARSET );
/*N*/
/*N*/ 	CharSet eSysSet = gsl_getSystemTextEncoding();
/*N*/ 	if ( eSrcSet != eSysSet || bUpdateOld )
/*N*/ 	{
/*N*/ 		USHORT nCount,i;
/*N*/ 		SvxFontItem* pItem;
/*N*/
/*N*/ 		ScDocumentPool* pPool = xPoolHelper->GetDocPool();
/*N*/ 		nCount = pPool->GetItemCount(ATTR_FONT);
/*N*/ 		for (i=0; i<nCount; i++)
/*N*/ 		{
/*N*/ 			pItem = (SvxFontItem*)pPool->GetItem(ATTR_FONT, i);
/*N*/ 			if ( pItem && ( pItem->GetCharSet() == eSrcSet ||
/*N*/ 							( bUpdateOld && pItem->GetCharSet() != RTL_TEXTENCODING_SYMBOL ) ) )
/*N*/ 				pItem->GetCharSet() = eSysSet;
/*N*/ 		}
/*N*/
/*N*/ 		if ( pDrawLayer )
/*N*/ 		{
/*N*/ 			SfxItemPool& rDrawPool = pDrawLayer->GetItemPool();
/*N*/ 			nCount = rDrawPool.GetItemCount(EE_CHAR_FONTINFO);
/*N*/ 			for (i=0; i<nCount; i++)
/*N*/ 			{
/*N*/ 				pItem = (SvxFontItem*)rDrawPool.GetItem(EE_CHAR_FONTINFO, i);
/*N*/ 				if ( pItem && ( pItem->GetCharSet() == eSrcSet ||
/*N*/ 								( bUpdateOld && pItem->GetCharSet() != RTL_TEXTENCODING_SYMBOL ) ) )
/*?*/ 					pItem->GetCharSet() = eSysSet;
/*N*/ 			}
/*N*/ 		}
/*N*/ 	}
/*N*/ }

/*N*/ void ScDocument::SetImportingXML( BOOL bVal )
/*N*/ {
/*N*/ 	bImportingXML = bVal;
/*N*/ 	if (pDrawLayer)
/*N*/ 		pDrawLayer->EnableAdjust(!bImportingXML);
/*N*/ }

/*N*/ rtl::Reference<SvxForbiddenCharactersTable> ScDocument::GetForbiddenCharacters()
/*N*/ {
/*N*/ 	return xForbiddenCharacters;
/*N*/ }

/*N*/ void ScDocument::SetForbiddenCharacters( const rtl::Reference<SvxForbiddenCharactersTable> xNew )
/*N*/ {
/*N*/ 	xForbiddenCharacters = xNew;
/*N*/ 	if ( pEditEngine )
/*?*/ 		pEditEngine->SetForbiddenCharsTable( xForbiddenCharacters );
/*N*/ 	if ( pDrawLayer )
/*N*/ 		pDrawLayer->SetForbiddenCharsTable( xForbiddenCharacters );
/*N*/ }

/*N*/ BOOL ScDocument::IsValidAsianCompression() const
/*N*/ {
/*N*/ 	return ( nAsianCompression != SC_ASIANCOMPRESSION_INVALID );
/*N*/ }

/*N*/ BYTE ScDocument::GetAsianCompression() const
/*N*/ {
/*N*/ 	if ( nAsianCompression == SC_ASIANCOMPRESSION_INVALID )
/*N*/ 		return 0;
/*N*/ 	else
/*N*/ 		return nAsianCompression;
/*N*/ }

/*N*/ void ScDocument::SetAsianCompression(BYTE nNew)
/*N*/ {
/*N*/ 	nAsianCompression = nNew;
/*N*/ 	if ( pEditEngine )
/*?*/ 		pEditEngine->SetAsianCompressionMode( nAsianCompression );
/*N*/ 	if ( pDrawLayer )
/*N*/ 		pDrawLayer->SetCharCompressType( nAsianCompression );
/*N*/ }

/*N*/ BOOL ScDocument::IsValidAsianKerning() const
/*N*/ {
/*N*/ 	return ( nAsianKerning != SC_ASIANKERNING_INVALID );
/*N*/ }

/*N*/ BOOL ScDocument::GetAsianKerning() const
/*N*/ {
/*N*/ 	if ( nAsianKerning == SC_ASIANKERNING_INVALID )
/*N*/ 		return FALSE;
/*N*/ 	else
/*N*/ 		return (BOOL)nAsianKerning;
/*N*/ }

/*N*/ void ScDocument::SetAsianKerning(BOOL bNew)
/*N*/ {
/*N*/ 	nAsianKerning = (BYTE)bNew;
/*N*/ 	if ( pEditEngine )
/*?*/ 		pEditEngine->SetKernAsianPunctuation( (BOOL)nAsianKerning );
/*N*/ 	if ( pDrawLayer )
/*N*/ 		pDrawLayer->SetKernAsianPunctuation( (BOOL)nAsianKerning );
/*N*/ }

}

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */