xref: /aoo41x/main/sw/inc/doc.hxx (revision 1396af09)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 #ifndef SW_DOC_HXX
24 #define SW_DOC_HXX
25 
26 /** SwDoc interfaces */
27 
28 #include <IInterface.hxx>
29 #include <IDocumentSettingAccess.hxx>
30 #include <IDocumentDeviceAccess.hxx>
31 #include <IDocumentMarkAccess.hxx>
32 #include <IDocumentRedlineAccess.hxx>
33 #include <IDocumentLinksAdministration.hxx>
34 #include <IDocumentFieldsAccess.hxx>
35 #include <IDocumentContentOperations.hxx>
36 #include <IDocumentStylePoolAccess.hxx>
37 #include <IDocumentLineNumberAccess.hxx>
38 #include <IDocumentStatistics.hxx>
39 #include <IDocumentState.hxx>
40 #include <IDocumentDrawModelAccess.hxx>
41 #include <IDocumentLayoutAccess.hxx>
42 #include <IDocumentTimerAccess.hxx>
43 #include <IDocumentChartDataProviderAccess.hxx>
44 // --> OD 2007-10-26 #i83479#
45 #include <IDocumentOutlineNodes.hxx>
46 #include <IDocumentListItems.hxx>
47 #include <set>
48 // <--
49 // --> OD 2008-03-12 #refactorlists#
50 #include <IDocumentListsAccess.hxx>
51 class SwList;
52 // <--
53 #include <IDocumentExternalData.hxx>
54 #define _SVSTDARR_STRINGSDTOR
55 #include <svl/svstdarr.hxx>
56 #include <com/sun/star/embed/XEmbeddedObject.hpp>
57 #include <com/sun/star/embed/XStorage.hpp>
58 #include <vcl/timer.hxx>
59 #include "swdllapi.h"
60 #include <swtypes.hxx>
61 #include <swatrset.hxx>
62 #include <toxe.hxx>   	  		// enums
63 #include <flyenum.hxx>
64 #include <itabenum.hxx>
65 #include <swdbdata.hxx>
66 #include <chcmprse.hxx>
67 #include <com/sun/star/linguistic2/XSpellChecker1.hpp>
68 #include <com/sun/star/linguistic2/XHyphenatedWord.hpp>
69 #include <vos/ref.hxx>
70 #include <svx/svdtypes.hxx>
71 #include <sfx2/objsh.hxx>
72 #include <svl/style.hxx>
73 #include <editeng/numitem.hxx>
74 #include "comphelper/implementationreference.hxx"
75 #include <com/sun/star/chart2/data/XDataProvider.hpp>
76 #include <com/sun/star/linguistic2/XProofreadingIterator.hpp>
77 #ifdef FUTURE_VBA
78 #include <com/sun/star/script/vba/XVBAEventProcessor.hpp>
79 #endif
80 
81 #include <hash_map>
82 #include <stringhash.hxx>
83 
84 #include <svtools/embedhlp.hxx>
85 #include <vector>
86 #include <set>
87 #include <map>
88 #include <memory>
89 
90 #include <boost/scoped_ptr.hpp>
91 #include <boost/shared_ptr.hpp>
92 #include <flypos.hxx>
93 
94 class SvxForbiddenCharactersTable;
95 class SwExtTextInput;
96 class DateTime;
97 class EditFieldInfo;
98 class JobSetup;
99 class Color;
100 class KeyCode;
101 class Outliner;
102 class OutputDevice;
103 class Point;
104 class SbxArray;
105 class SdrModel;
106 class SdrObject;
107 class SdrUndoAction;
108 class VirtualDevice;
109 class SfxPrinter;
110 class SvNumberFormatter;
111 class SvStringsSort;
112 class SvUShorts;
113 class SvUShortsSort;
114 class SvxMacro;
115 class SvxMacroTableDtor;
116 class SvxBorderLine;
117 class SwAutoCompleteWord;
118 class SwAutoCorrExceptWord;
119 class SwCalc;
120 class SwCellFrm;
121 class SwCharFmt;
122 class SwCharFmts;
123 class SwConditionTxtFmtColl;
124 class SwCrsrShell;
125 class SwCursor;
126 class SwDBNameInfField;
127 class SwDocShell;
128 class SwDocUpdtFld;
129 class SwDrawFrmFmt;
130 class SwDrawView;
131 class SwEditShell;
132 class SwFieldType;
133 class SwField;
134 class SwTxtFld;
135 class SwFldTypes;
136 class SwFlyFrmFmt;
137 class SwFmt;
138 class SwFmtINetFmt;
139 class SwFmtRefMark;
140 class SwFrmFmt;
141 class SwFrmFmts;
142 class SwFtnIdxs;
143 class SwFtnInfo;
144 class SwEndNoteInfo;
145 class GraphicObject;
146 class SwGrfFmtColl;
147 class SwGrfFmtColls;
148 class SwLineNumberInfo;
149 class SwNewDBMgr;
150 class SwNoTxtNode;
151 class SwNodeIndex;
152 class SwNodeRange;
153 class SwNodes;
154 class SwNumRule;
155 class SwNumRuleTbl;
156 class SwPageDesc;
157 class SwPagePreViewPrtData;
158 class SwRedline;
159 class SwRedlineTbl;
160 class SwRootFrm;
161 class SwRubyList;
162 class SwRubyListEntry;
163 class SwSectionFmt;
164 class SwSectionFmts;
165 class SwSectionData;
166 class SwSelBoxes;
167 class SwSpzFrmFmts;
168 class SwTOXBase;
169 class SwTOXBaseSection;
170 class SwTOXMark;
171 class SwTOXMarks;
172 class SwTOXType;
173 class SwTOXTypes;
174 class SwTabCols;
175 class SwTable;
176 class SwTableAutoFmt;
177 class SwTableBox;
178 class SwTableBoxFmt;
179 class SwTableFmt;
180 class SwTableLineFmt;
181 class SwTableNode;
182 class SwTextBlocks;
183 class SwTxtFmtColl;
184 class SwTxtFmtColls;
185 class SwURLStateChanged;
186 class SwUnoCrsr;
187 class SwUnoCrsrTbl;
188 class ViewShell;
189 class _SetGetExpFld;
190 class SwDrawContact;
191 class SwLayouter;
192 class SdrView;
193 class SdrMarkList;
194 class SwAuthEntry;
195 class SwLayoutCache;
196 class IStyleAccess;
197 struct SwCallMouseEvent;
198 struct SwDocStat;
199 struct SwHash;
200 struct SwSortOptions;
201 struct SwDefTOXBase_Impl;
202 class SwPrintData;
203 class SwPrintUIOptions;
204 class SdrPageView;
205 struct SwConversionArgs;
206 class SwRewriter;
207 class SwMsgPoolItem;
208 class SwChartDataProvider;
209 class SwChartLockController_Helper;
210 class IGrammarContact;
211 class SwPrintData;
212 class SwRenderData;
213 class SwPageFrm;
214 class SwViewOption;
215 class IDocumentUndoRedo;
216 
217 namespace sw { namespace mark {
218     class MarkManager;
219 }}
220 namespace sw {
221     class MetaFieldManager;
222     class UndoManager;
223     class IShellCursorSupplier;
224 }
225 
226 namespace com { namespace sun { namespace star {
227 namespace i18n {
228 	struct ForbiddenCharacters;    // comes from the I18N UNO interface
229 }
230 namespace uno {
231 	template < class > class Sequence;
232 }
233 namespace container {
234 	class XNameContainer; // for getXForms()/isXForms()/initXForms() methods
235 }
236 }}}
237 
238 namespace sfx2 {
239 	class SvLinkSource;
240     class IXmlIdRegistry;
241     class LinkManager;
242 }
243 
244 //PageDescriptor-Schnittstelle, Array hier wegen inlines.
245 typedef SwPageDesc* SwPageDescPtr;
246 SV_DECL_PTRARR_DEL( SwPageDescs, SwPageDescPtr, 4, 4 )
247 
248 // forward declartion
249 void SetAllScriptItem( SfxItemSet& rSet, const SfxPoolItem& rItem );
250 
251 // global function to start grammar checking in the document
252 void StartGrammarChecking( SwDoc &rDoc );
253 
254 class SW_DLLPUBLIC SwDoc :
255     public IInterface,
256     public IDocumentSettingAccess,
257     public IDocumentDeviceAccess,
258     public IDocumentRedlineAccess,
259     public IDocumentLinksAdministration,
260     public IDocumentFieldsAccess,
261     public IDocumentContentOperations,
262     public IDocumentStylePoolAccess,
263     public IDocumentLineNumberAccess,
264     public IDocumentStatistics,
265     public IDocumentState,
266     public IDocumentDrawModelAccess,
267     public IDocumentLayoutAccess,
268     public IDocumentTimerAccess,
269     public IDocumentChartDataProviderAccess,
270     // --> OD 2007-10-26 #i83479#
271     public IDocumentListItems,
272     public IDocumentOutlineNodes,
273     // <--
274     // --> OD 2008-03-12 #refactorlists#
275     public IDocumentListsAccess,
276     // <--
277     public IDocumentExternalData
278 {
279 
280 	friend void _InitCore();
281 	friend void _FinitCore();
282 
283     //---------------- private Member --------------------------------
284 
285 	// -------------------------------------------------------------------
286     ::boost::scoped_ptr<SwNodes> m_pNodes;  /// document content (Nodes Array)
287 	SwAttrPool*	mpAttrPool;				// der Attribut Pool
288 	SwPageDescs	aPageDescs;				// PageDescriptoren
289 	Link 		aOle2Link;				// OLE 2.0-Benachrichtigung
290     /* @@@MAINTAINABILITY-HORROR@@@
291        Timer should not be members of the model
292     */
293     Timer       aIdleTimer;             // der eigene IdleTimer
294 	Timer		aOLEModifiedTimer; 		// Timer for update modified OLE-Objecs
295 	SwDBData	aDBData;				// database descriptor
296 	::com::sun::star::uno::Sequence <sal_Int8 > aRedlinePasswd;
297 	String		sTOIAutoMarkURL; 		// ::com::sun::star::util::URL of table of index AutoMark file
298 	SvStringsDtor aPatternNms;			// Array fuer die Namen der Dokument-Vorlagen
299 	com::sun::star::uno::Reference<com::sun::star::container::XNameContainer>
300         xXForms;                        // container with XForms models
301     mutable com::sun::star::uno::Reference< com::sun::star::linguistic2::XProofreadingIterator > m_xGCIterator;
302 
303     const ::boost::scoped_ptr< ::sw::mark::MarkManager> pMarkManager;
304     const ::boost::scoped_ptr< ::sw::MetaFieldManager > m_pMetaFieldManager;
305     const ::boost::scoped_ptr< ::sw::UndoManager > m_pUndoManager;
306 
307 	// -------------------------------------------------------------------
308 	// die Pointer
309 								//Defaultformate
310 	SwFrmFmt		*pDfltFrmFmt;
311  	SwFrmFmt		*pEmptyPageFmt;		// Format fuer die Default-Leerseite.
312 	SwFrmFmt		*pColumnContFmt; 	// Format fuer Spaltencontainer
313 	SwCharFmt		*pDfltCharFmt;
314 	SwTxtFmtColl	*pDfltTxtFmtColl;	// Defaultformatcollections
315 	SwGrfFmtColl	*pDfltGrfFmtColl;
316 
317 	SwFrmFmts		*pFrmFmtTbl;		// Formattabellen
318 	SwCharFmts		*pCharFmtTbl;
319 	SwSpzFrmFmts	*pSpzFrmFmtTbl;
320 	SwSectionFmts	*pSectionFmtTbl;
321 	SwFrmFmts		*pTblFrmFmtTbl;		// spz. fuer Tabellen
322 	SwTxtFmtColls	*pTxtFmtCollTbl;	// FormatCollections
323 	SwGrfFmtColls	*pGrfFmtCollTbl;
324 
325 	SwTOXTypes		*pTOXTypes;			// Verzeichnisse
326 	SwDefTOXBase_Impl * pDefTOXBases;	// defaults of SwTOXBase's
327 
328 	ViewShell		*pCurrentView;	// SwDoc should get a new member pCurrentView//swmod 071225
329 	boost::shared_ptr<SwRootFrm> pLayoutPtr;
330 	SdrModel		*pDrawModel;		// StarView Drawing
331 
332 	SwDocUpdtFld 	*pUpdtFlds;			// Struktur zum Field-Update
333 	SwFldTypes		*pFldTypes;			// Feldtypen
334 	SwNewDBMgr 		*pNewDBMgr;			// Pointer auf den neuen DBMgr fuer
335 										// Evaluierung der DB-Fields
336 
337     VirtualDevice   *pVirDev;           // can be used for formatting
338     SfxPrinter      *pPrt;              // can be used for formatting
339     SwPrintData     *pPrtData;          // Print configuration
340 
341 	SwDoc			*pGlossaryDoc;		// Pointer auf das Glossary-Dokument. Dieses
342 
343 	SwNumRule		*pOutlineRule;
344 	SwFtnInfo		*pFtnInfo;
345 	SwEndNoteInfo 	*pEndNoteInfo;
346     SwLineNumberInfo*pLineNumberInfo;
347 	SwFtnIdxs		*pFtnIdxs;
348 	SwDocStat		*pDocStat;			// Statistic Informationen
349 	SvxMacroTableDtor *pMacroTable; 	// Tabelle der dokumentglobalen Macros
350 
351 	SwDocShell		*pDocShell;			// Ptr auf die SfxDocShell vom Doc
352     SfxObjectShellLock xTmpDocShell;    // A temporary shell that is used to copy OLE-Nodes
353 
354 	sfx2::LinkManager	*pLinkMgr;			// Liste von Verknuepften (Grafiken/DDE/OLE)
355 
356 	SwAutoCorrExceptWord *pACEWord;		// fuer die automatische Uebernahme von
357 										// autokorrigierten Woertern, die "zurueck"
358 										// verbessert werden
359 	SwURLStateChanged *pURLStateChgd;	// SfxClient fuer Aenderungen in der
360 										// INetHistory
361 	SvNumberFormatter *pNumberFormatter;	// NumFormatter fuer die Tabellen/Felder
362 
363     mutable SwNumRuleTbl    *pNumRuleTbl;           // Liste aller benannten NumRules
364 
365     // Hash map to find numrules by name
366     mutable std::hash_map<String, SwNumRule *, StringHash> maNumRuleMap;
367 
368     // --> OD 2008-03-12 #refactorlists#
369     typedef std::hash_map< String, SwList*, StringHash > tHashMapForLists;
370     // container to hold the lists of the text document
371     tHashMapForLists maLists;
372     // relation between list style and its default list
373     tHashMapForLists maListStyleLists;
374     // <--
375 
376 	SwRedlineTbl	*pRedlineTbl;			// Liste aller Redlines
377 	String			*pAutoFmtRedlnComment;	// Kommentar fuer Redlines, die
378 										// uebers Autoformat eingefuegt werden
379 	SwUnoCrsrTbl	*pUnoCrsrTbl;
380 
381 	SwPagePreViewPrtData *pPgPViewPrtData;		// Einzuege/Abstaende fuers
382 										// Drucken der Seitenansicht
383 	SwPaM			*pExtInputRing;
384 
385 	SwLayouter		*pLayouter;		// ::com::sun::star::frame::Controller for complex layout formatting
386 									// like footnote/endnote in sections
387     IStyleAccess    *pStyleAccess;  // handling of automatic styles
388     SwLayoutCache   *pLayoutCache;  // Layout cache to read and save with the
389                                     // document for a faster formatting
390 
391     SwModify *pUnoCallBack;
392     IGrammarContact *mpGrammarContact;   // for grammar checking in paragraphs during editing
393 
394     mutable  comphelper::ImplementationReference< SwChartDataProvider
395         , ::com::sun::star::chart2::data::XDataProvider >
396                                 aChartDataProviderImplRef;
397     SwChartLockController_Helper  *pChartControllerHelper;
398 
399 	// table of forbidden characters of this document
400 	vos::ORef<SvxForbiddenCharactersTable>	xForbiddenCharsTable;
401 #ifdef FUTURE_VBA
402     com::sun::star::uno::Reference< com::sun::star::script::vba::XVBAEventProcessor > mxVbaEvents;
403 #endif
404     // --> OD 2007-10-26 #i83479#
405 public:
406     struct lessThanNodeNum
407     {
408         bool operator()( const SwNodeNum* pNodeNumOne,
409                          const SwNodeNum* pNodeNumTwo ) const;
410     };
411 
412     typedef ::std::set< const SwNodeNum*, lessThanNodeNum > tImplSortedNodeNumList;
413 private:
414     tImplSortedNodeNumList* mpListItemsList;
415     // <--
416 
417     ::std::auto_ptr< ::sfx2::IXmlIdRegistry > m_pXmlIdRegistry;
418 
419 	// -------------------------------------------------------------------
420 	// sonstige
421 
422 	sal_uInt16 nAutoFmtRedlnCommentNo;	// SeqNo fuers UI-seitige zusammenfassen
423 									// von AutoFmt-Redlines. Wird vom SwAutoFmt
424 									// verwaltet!
425 	sal_uInt16	nLinkUpdMode;		// UpdateMode fuer Links
426     SwFldUpdateFlags    eFldUpdMode;        // Mode fuer Felder/Charts automatisch aktualisieren
427 	RedlineMode_t eRedlineMode;		// aktueller Redline Modus
428 	SwCharCompressType eChrCmprType;	// for ASIAN: compress punctuation/kana
429 
430     sal_Int32   mReferenceCount;
431     sal_Int32   mIdleBlockCount;
432 	sal_Int8	nLockExpFld;		// Wenn != 0 hat UpdateExpFlds() keine Wirkung
433 
434     /* Draw Model Layer IDs
435      * LayerIds, Heaven == ueber dem Dokument
436      * Hell   == unter dem Dokument
437      * Controls == ganz oben
438      */
439     SdrLayerID  nHeaven;
440     SdrLayerID  nHell;
441     SdrLayerID  nControls;
442     SdrLayerID  nInvisibleHeaven;
443     SdrLayerID  nInvisibleHell;
444     SdrLayerID  nInvisibleControls;
445 
446     bool mbGlossDoc              : 1;    //sal_True: ist ein Textbaustein Dokument
447     bool mbModified              : 1;    //sal_True: Dokument ist veraendert
448     bool mbDtor                  : 1;    //sal_True: ist im SwDoc DTOR
449                                          //      leider auch temporaer von
450                                          //      SwSwgReader::InLayout(), wenn fehlerhafte
451                                          //      Frames geloescht werden muessen
452     bool mbPageNums              : 1;    // TRUE: es gibt virtuelle Seitennummern
453     bool mbLoaded                : 1;    // TRUE: ein geladenes Doc
454     bool mbUpdateExpFld          : 1;    // TRUE: Expression-Felder updaten
455     bool mbNewDoc                : 1;    // TRUE: neues Doc
456     bool mbNewFldLst             : 1;    // TRUE: Felder-Liste neu aufbauen
457     bool mbCopyIsMove            : 1;    // TRUE: Copy ist ein verstecktes Move
458     bool mbVisibleLinks          : 1;    // TRUE: Links werden sichtbar eingefuegt
459     bool mbInReading             : 1;    // TRUE: Dokument wird gerade gelesen
460     bool mbInXMLImport           : 1;    // TRUE: During xml import, attribute portion building is not necessary
461     bool mbUpdateTOX             : 1;    // TRUE: nach Dokument laden die TOX Updaten
462     bool mbInLoadAsynchron       : 1;    // TRUE: Dokument wird gerade asynchron geladen
463     bool mbHTMLMode              : 1;    // TRUE: Dokument ist im HTMLMode
464     bool mbInCallModified        : 1;    // TRUE: im Set/Reset-Modified Link
465     bool mbIsGlobalDoc           : 1;    // TRUE: es ist ein GlobalDokument
466     bool mbGlblDocSaveLinks      : 1;    // TRUE: im GlobalDoc. gelinkte Sect. mit speichern
467     bool mbIsLabelDoc            : 1;    // TRUE: es ist ein Etiketten-Dokument
468     bool mbIsAutoFmtRedline      : 1;    // TRUE: die Redlines werden vom Autoformat aufgezeichnet
469     bool mbOLEPrtNotifyPending   : 1;    // TRUE: Printer  ist geaendert und beim
470                                          //       Erzeugen der ::com::sun::star::sdbcx::View ist eine Benachrichtigung
471                                          //       der OLE-Objekte PrtOLENotify() notwendig.
472     bool mbAllOLENotify          : 1;    // True: Benachrichtigung aller Objekte ist notwendig
473     bool mbIsRedlineMove         : 1;    // True: die Redlines werden in/aus der Section verschoben
474     bool mbInsOnlyTxtGlssry      : 1;    // True: insert 'only text' glossary into doc
475     bool mbContains_MSVBasic     : 1;    // True: MS-VBasic exist is in our storage
476     bool mbPurgeOLE              : 1;    // sal_True: Purge OLE-Objects
477     bool mbKernAsianPunctuation  : 1;    // sal_True: kerning also for ASIAN punctuation
478     bool mbReadlineChecked       : 1;    // sal_True: if the query was already shown
479     bool mbLinksUpdated          : 1;    // OD 2005-02-11 #i38810#
480                                          // flag indicating, that the links have been updated.
481     bool mbClipBoard             : 1;    // true: this document represents the clipboard
482     bool mbColumnSelection       : 1;    // true: this content has bee created by a column selection
483                                          //       (clipboard docs only)
484 
485 #ifdef DBG_UTIL
486     bool mbXMLExport : 1;                // sal_True: during XML export
487 #endif
488 
489     // --> OD 2006-03-21 #b6375613#
490     // Document flag to trigger conversion, which applys the workaround for documents,
491     // which uses a certain layout defect in OOo 1.x to layout the documents.
492     // This conversion is performed, when the frames for the layout are created.
493     // Thus, this document flag has to be set after load a document and before
494     // creating the document view.
495     bool mbApplyWorkaroundForB6375613 : 1;
496     // <--
497 
498     // true: Document contains at least one anchored object, which is anchored AT_PAGE with a content position.
499     //       Thus, certain adjustment needed during formatting for these kind of anchored objects.
500     bool mbContainsAtPageObjWithContentAnchor : 1;
501 
502     //
503     // COMPATIBILITY FLAGS START
504     //
505     //
506     // HISTORY OF THE COMPATIBILITY FLAGS:
507     //
508     // SO5:
509     // mbParaSpaceMax                        def = sal_False, sal_True since SO8
510     // mbParaSpaceMaxAtPages                 def = sal_False, sal_True since SO8
511     //
512     // SO6:
513     // mbTabCompat                           def = sal_False, sal_True since SO8
514     //
515     // SO7:
516     // mbUseVirtualDevice                    def = sal_True
517     // mbAddFlyOffsets                       def = sal_False, hidden
518     //
519     // SO7pp1:
520     // bOldNumbering                        def = sal_False, hidden
521     //
522     // SO8:
523     // mbAddExternalLeading                  def = sal_True
524     // mbUseHiResolutionVirtualDevice        def = sal_True, hidden
525     // mbOldLineSpacing                      def = sal_False
526     // mbAddParaSpacingToTableCells          def = sal_True
527     // mbUseFormerObjectPos                  def = sal_False
528     // mbUseFormerTextWrapping               def = sal_False
529     // mbConsiderWrapOnObjPos                def = sal_False
530     //
531     // SO8pp1:
532     // mbIgnoreFirstLineIndentInNumbering    def = sal_False, hidden
533     // mbDoNotJustifyLinesWithManualBreak    def = sal_False, hidden
534     // mbDoNotResetParaAttrsForNumFont       def = sal_False, hidden
535     //
536     // SO8pp3
537     // mbDoNotCaptureDrawObjsOnPage         def = sal_False, hidden
538     // - Relevant for drawing objects, which don't follow the text flow, but
539     //   whose position is outside the page area:
540     //   sal_False: Such drawing objects are captured on the page area of its anchor.
541     //   sal_True: Such drawing objects can leave the page area, they aren't captured.
542     // mbTableRowKeep                            def = sal_False, hidden
543     // mbIgnoreTabsAndBlanksForLineCalculation   def = sal_False, hidden
544     // mbClipAsCharacterAnchoredWriterFlyFrame   def = sal_False, hidden
545     // - Introduced in order to re-activate clipping of as-character anchored
546     //   Writer fly frames in method <SwFlyInCntFrm::MakeAll()> for documents,
547     //   which are created with version prior SO8/OOo 2.0
548     //
549     // SO8pp4
550     // mbUnixForceZeroExtLeading                def = sal_False, hidden
551     //
552     // SO8pu8
553     // mbOldPrinterMetrics                      def = sal_False, hidden
554     //
555     // SO9
556     // #i24363# tab stops relative to indent
557     // mbTabRelativeToIndent                    def = sal_True, hidden
558     // #i89181# suppress tab stop at left indent for paragraphs in lists, whose
559     // list level position and space mode equals LABEL_ALIGNMENT and whose list
560     // label is followed by a tab character.
561     // mbTabAtLeftIndentForParagraphsInList     def = sal_False, hidden
562 
563     bool mbParaSpaceMax                     : 1;
564     bool mbParaSpaceMaxAtPages              : 1;
565     bool mbTabCompat                        : 1;
566     bool mbUseVirtualDevice                 : 1;
567     bool mbAddFlyOffsets                    : 1;
568     bool mbAddExternalLeading               : 1;
569     bool mbUseHiResolutionVirtualDevice     : 1;
570     bool mbOldLineSpacing                   : 1;    // OD  2004-01-06 #i11859#
571     bool mbAddParaSpacingToTableCells       : 1;    // OD  2004-02-16 #106629#
572     bool mbUseFormerObjectPos               : 1;    // OD  2004-03-12 #i11860#
573     bool mbUseFormerTextWrapping            : 1;    // FME 2005-05-11 #108724#
574     bool mbConsiderWrapOnObjPos             : 1;    // OD  2004-05-05 #i28701#
575                                                     // sal_True: object positioning algorithm has consider the wrapping style of                                                    //       the floating screen objects as given by its attribute 'WrapInfluenceOnObjPos'
576     bool mbMathBaselineAlignment            : 1;    // TL  2010-10-29 #i972#
577 
578     // non-ui-compatibility flags:
579     bool mbOldNumbering                             : 1;   // HBRINKM #111955#
580     bool mbIgnoreFirstLineIndentInNumbering         : 1;   // FME 2005-05-30# i47448#
581     bool mbDoNotJustifyLinesWithManualBreak         : 1;   // FME 2005-06-08 #i49277#
582     bool mbDoNotResetParaAttrsForNumFont            : 1;   // FME 2005-08-11 #i53199#
583     bool mbTableRowKeep                             : 1;   // FME 2006-02-10 #131283#
584     bool mbIgnoreTabsAndBlanksForLineCalculation    : 1;   // FME 2006-03-01 #i3952#
585     bool mbDoNotCaptureDrawObjsOnPage               : 1;   // OD 2006-03-14 #i62875#
586     bool mbOutlineLevelYieldsOutlineRule            : 1;
587     bool mbClipAsCharacterAnchoredWriterFlyFrames   : 1;   // OD 2006-04-13 #b6402800#
588     bool mbUnixForceZeroExtLeading                  : 1;   // FME 2006-10-09 #i60945#
589     bool mbOldPrinterMetrics                        : 1;   // FME 2007-05-14 #147385#
590     bool mbTabRelativeToIndent                      : 1;   // #i24363# tab stops relative to indent
591     bool mbProtectForm                              : 1;
592     bool mbTabAtLeftIndentForParagraphsInList;             // OD 2008-06-05 #i89181# - see above
593 
594     bool mbLastBrowseMode                           : 1;
595 
596 	// #i78591#
597 	sal_uInt32  n32DummyCompatabilityOptions1;
598 	sal_uInt32  n32DummyCompatabilityOptions2;
599     //
600     // COMPATIBILITY FLAGS END
601     //
602 
603     sal_Bool    mbStartIdleTimer                 ;    // idle timer mode start/stop
604 
605 	static SwAutoCompleteWord *pACmpltWords;	// Liste aller Worte fuers AutoComplete
606 
607 	//---------------- private Methoden ------------------------------
608 	void checkRedlining(RedlineMode_t& _rReadlineMode);
609 
610 	DECL_LINK( AddDrawUndo, SdrUndoAction * );
611 										// DrawModel
612 	void DrawNotifyUndoHdl();	// wegen CLOOKs
613 
614 		// nur fuer den internen Gebrauch deshalb privat.
615 		// Kopieren eines Bereiches im oder in ein anderes Dokument !
616 		// Die Position darf nicht im Bereich liegen !!
617     bool CopyImpl( SwPaM&, SwPosition&, const bool MakeNewFrms /*= true */,
618             const bool bCopyAll, SwPaM *const pCpyRng /*= 0*/ ) const;
619 
620 	SwFlyFrmFmt* _MakeFlySection( const SwPosition& rAnchPos,
621 								const SwCntntNode& rNode, RndStdIds eRequestId,
622 								const SfxItemSet* pFlyAttrSet,
623 								SwFrmFmt* = 0 );
624 
625 	SwFlyFrmFmt* _InsNoTxtNode( const SwPosition&rPos, SwNoTxtNode*,
626 								const SfxItemSet* pFlyAttrSet,
627 								const SfxItemSet* pGrfAttrSet,
628 								SwFrmFmt* = 0 );
629 
630     void CopyFlyInFlyImpl(  const SwNodeRange& rRg,
631                             const xub_StrLen nEndContentIndex,
632                             const SwNodeIndex& rStartIdx,
633                             const bool bCopyFlyAtFly = false ) const;
634     sal_Int8 SetFlyFrmAnchor( SwFrmFmt& rFlyFmt, SfxItemSet& rSet, sal_Bool bNewFrms );
635 
636     // --> OD 2005-01-13 #i40550#
637     typedef SwFmt* (SwDoc:: *FNCopyFmt)( const String&, SwFmt*, sal_Bool, sal_Bool );
638     // <--
639 	SwFmt* CopyFmt( const SwFmt& rFmt, const SvPtrarr& rFmtArr,
640 						FNCopyFmt fnCopyFmt, const SwFmt& rDfltFmt );
641 	void CopyFmtArr( const SvPtrarr& rSourceArr, SvPtrarr& rDestArr,
642 						FNCopyFmt fnCopyFmt, SwFmt& rDfltFmt );
643     void CopyPageDescHeaderFooterImpl( bool bCpyHeader,
644 								const SwFrmFmt& rSrcFmt, SwFrmFmt& rDestFmt );
645 	SwFmt* FindFmtByName( const SvPtrarr& rFmtArr,
646 									const String& rName ) const;
647 
648     VirtualDevice& CreateVirtualDevice_() const;
649     SfxPrinter& CreatePrinter_() const;
650 	void		PrtDataChanged();	//Printer oder JobSetup geandert, es muss
651 									//fuer entsprechende Invalidierungen und
652 									//Benachrichtigungen gesorgt werden.
653 
654 	// gcc: aFtnInfo::CopyCtor ist private, also muessen wir uns auch schuetzen
655 	SwDoc( const SwDoc &);
656 
657     // fuer Felder:
658 	void _InitFieldTypes(); 	// wird vom CTOR gerufen!!
659 	void _MakeFldList( int eMode );
660 
661 	// Datenbankfelder:
662 	void UpdateDBNumFlds( SwDBNameInfField& rDBFld, SwCalc& rCalc );
663 	void AddUsedDBToList( SvStringsDtor& rDBNameList,
664 						  const SvStringsDtor& rUsedDBNames );
665 	void AddUsedDBToList( SvStringsDtor& rDBNameList, const String& rDBName );
666 	sal_Bool IsNameInArray( const SvStringsDtor& rOldNames, const String& rName );
667 	void GetAllDBNames( SvStringsDtor& rAllDBNames );
668 	void ReplaceUsedDBs( const SvStringsDtor& rUsedDBNames,
669 						const String& rNewName, String& rFormel );
670 	SvStringsDtor& FindUsedDBs( const SvStringsDtor& rAllDBNames,
671 								const String& rFormel,
672 								SvStringsDtor& rUsedDBNames );
673 
674 	void InitDrawModel();
675 	void ReleaseDrawModel();
676 
677 	void _CreateNumberFormatter();
678 
679 	sal_Bool _UnProtectTblCells( SwTable& rTbl );
680 
681 	// erzeuge Anhand der vorgebenen Collection Teildokumente
682 	// falls keine angegeben ist, nehme die Kapitelvorlage der 1. Ebene
683 	sal_Bool SplitDoc( sal_uInt16 eDocType, const String& rPath,
684 						const SwTxtFmtColl* pSplitColl );
685 	sal_Bool SplitDoc( sal_uInt16 eDocType, const String& rPath, int nOutlineLevel = 0 ); //#outline level,add by zhaijianwei.
686 
687 
688 	// Charts der angegebenen Tabelle updaten
689 	void _UpdateCharts( const SwTable& rTbl, ViewShell& rVSh ) const;
690 
691 	sal_Bool _SelectNextRubyChars( SwPaM& rPam, SwRubyListEntry& rRubyEntry,
692 								sal_uInt16 nMode );
693 
694 	// unser eigener 'IdlTimer' ruft folgende Methode
695 	DECL_LINK( DoIdleJobs, Timer * );
696 	// der CharTimer ruft diese Methode
697 	DECL_LINK( DoUpdateAllCharts, Timer * );
698 	DECL_LINK( DoUpdateModifiedOLE, Timer * );
699 
700      SwFmt *_MakeCharFmt(const String &, SwFmt *, sal_Bool, sal_Bool );
701      SwFmt *_MakeFrmFmt(const String &, SwFmt *, sal_Bool, sal_Bool );
702      SwFmt *_MakeTxtFmtColl(const String &, SwFmt *, sal_Bool, sal_Bool );
703 
704      void InitTOXTypes();
705      void   Paste( const SwDoc& );
706      bool DeleteAndJoinImpl(SwPaM&, const bool);
707      bool DeleteAndJoinWithRedlineImpl(SwPaM&, const bool unused = false);
708      bool DeleteRangeImpl(SwPaM&, const bool unused = false);
709      bool DeleteRangeImplImpl(SwPaM &);
710      bool ReplaceRangeImpl(SwPaM&, String const&, const bool);
711 
712 public:
713 	enum DocumentType {
714 		DOCTYPE_NATIVE,
715 		DOCTYPE_MSWORD				//This doc medul is come from Ms Word
716 		};
717 	DocumentType	meDocType;
718 	DocumentType	GetDocumentType(){ return meDocType; }
719 	void			SetDocumentType( DocumentType eDocType ) { meDocType = eDocType; }
720 
721     /** Life cycle
722     */
723 	SwDoc();
724 	~SwDoc();
725 
726     inline bool IsInDtor() const { return mbDtor; }
727 
728     /* @@@MAINTAINABILITY-HORROR@@@
729 	   Implementation details made public.
730 	*/
731     SwNodes      & GetNodes()       { return *m_pNodes; }
732     SwNodes const& GetNodes() const { return *m_pNodes; }
733 
734     /** IInterface
735     */
736     virtual sal_Int32 acquire();
737     virtual sal_Int32 release();
738     virtual sal_Int32 getReferenceCount() const;
739 
740     /** IDocumentSettingAccess
741     */
742     virtual bool get(/*[in]*/ DocumentSettingId id) const;
743     virtual void set(/*[in]*/ DocumentSettingId id, /*[in]*/ bool value);
744     virtual const com::sun::star::i18n::ForbiddenCharacters* getForbiddenCharacters(/*[in]*/ sal_uInt16 nLang, /*[in]*/ bool bLocaleData ) const;
745     virtual void setForbiddenCharacters(/*[in]*/ sal_uInt16 nLang, /*[in]*/ const com::sun::star::i18n::ForbiddenCharacters& rForbiddenCharacters );
746     virtual vos::ORef<SvxForbiddenCharactersTable>& getForbiddenCharacterTable();
747     virtual const vos::ORef<SvxForbiddenCharactersTable>& getForbiddenCharacterTable() const;
748     virtual sal_uInt16 getLinkUpdateMode( /*[in]*/bool bGlobalSettings ) const;
749     virtual void setLinkUpdateMode( /*[in]*/ sal_uInt16 nMode );
750     virtual SwFldUpdateFlags getFieldUpdateFlags( /*[in]*/bool bGlobalSettings ) const;
751     virtual void setFieldUpdateFlags( /*[in]*/ SwFldUpdateFlags eMode );
752     virtual SwCharCompressType getCharacterCompressionType() const;
753     virtual void setCharacterCompressionType( /*[in]*/SwCharCompressType nType );
754 
755     /** IDocumentDeviceAccess
756     */
757     virtual SfxPrinter* getPrinter(/*[in]*/ bool bCreate ) const;
758     virtual void setPrinter(/*[in]*/ SfxPrinter* pP,/*[in]*/ bool bDeleteOld,/*[in]*/ bool bCallPrtDataChanged );
759     virtual VirtualDevice* getVirtualDevice(/*[in]*/ bool bCreate ) const;
760     virtual void setVirtualDevice(/*[in]*/ VirtualDevice* pVd,/*[in]*/ bool bDeleteOld, /*[in]*/ bool bCallVirDevDataChanged );
761     virtual OutputDevice* getReferenceDevice(/*[in]*/ bool bCreate ) const;
762     virtual void setReferenceDeviceType(/*[in]*/ bool bNewVirtual,/*[in]*/ bool bNewHiRes );
763     virtual const JobSetup* getJobsetup() const;
764     virtual void setJobsetup(/*[in]*/ const JobSetup& rJobSetup );
765     virtual const SwPrintData & getPrintData() const;
766     virtual void setPrintData(/*[in]*/ const SwPrintData& rPrtData);
767 
768     /** IDocumentMarkAccess
769     */
770     IDocumentMarkAccess* getIDocumentMarkAccess();
771     const IDocumentMarkAccess* getIDocumentMarkAccess() const;
772 
773     /** IDocumentRedlineAccess
774     */
775     virtual RedlineMode_t GetRedlineMode() const;
776 	virtual void SetRedlineMode_intern(/*[in]*/RedlineMode_t eMode);
777 	virtual void SetRedlineMode(/*[in]*/RedlineMode_t eMode);
778 	virtual bool IsRedlineOn() const;
779 	virtual bool IsIgnoreRedline() const;
780     virtual bool IsInRedlines(const SwNode& rNode) const;
781 	virtual const SwRedlineTbl& GetRedlineTbl() const;
782 	virtual bool AppendRedline(/*[in]*/SwRedline* pPtr, /*[in]*/bool bCallDelete);
783 	virtual bool SplitRedline(const SwPaM& rPam);
784 	virtual bool DeleteRedline(/*[in]*/const SwPaM& rPam, /*[in]*/bool bSaveInUndo, /*[in]*/sal_uInt16 nDelType);
785 	virtual bool DeleteRedline(/*[in]*/const SwStartNode& rSection, /*[in]*/bool bSaveInUndo, /*[in]*/sal_uInt16 nDelType);
786     virtual sal_uInt16 GetRedlinePos(/*[in]*/const SwNode& rNode, /*[in]*/sal_uInt16 nType) const;
787 	virtual void CompressRedlines();
788     virtual const SwRedline* GetRedline(/*[in]*/const SwPosition& rPos, /*[in]*/sal_uInt16* pFndPos) const;
789 	virtual bool IsRedlineMove() const;
790 	virtual void SetRedlineMove(/*[in]*/bool bFlag);
791 	virtual bool AcceptRedline(/*[in]*/sal_uInt16 nPos, /*[in]*/bool bCallDelete);
792     virtual bool AcceptRedline(/*[in]*/const SwPaM& rPam, /*[in]*/bool bCallDelete);
793 	virtual bool RejectRedline(/*[in]*/sal_uInt16 nPos, /*[in]*/bool bCallDelete);
794     virtual bool RejectRedline(/*[in]*/const SwPaM& rPam, /*[in]*/bool bCallDelete);
795     virtual const SwRedline* SelNextRedline(/*[in]*/SwPaM& rPam) const;
796 	virtual const SwRedline* SelPrevRedline(/*[in]*/SwPaM& rPam) const;
797 	virtual void UpdateRedlineAttr();
798     virtual sal_uInt16 GetRedlineAuthor();
799 	virtual sal_uInt16 InsertRedlineAuthor(const String& rAuthor);
800 	virtual bool SetRedlineComment(/*[in]*/const SwPaM& rPam, /*[in]*/const String& rComment);
801 	virtual const ::com::sun::star::uno::Sequence <sal_Int8>& GetRedlinePassword() const;
802 	virtual void SetRedlinePassword(/*[in]*/const ::com::sun::star::uno::Sequence <sal_Int8>& rNewPassword);
803 
804     /** IDocumentUndoRedo
805     */
806     IDocumentUndoRedo      & GetIDocumentUndoRedo();
807     IDocumentUndoRedo const& GetIDocumentUndoRedo() const;
808 
809     /** IDocumentLinksAdministration
810     */
811     virtual bool IsVisibleLinks() const;
812 	virtual void SetVisibleLinks(bool bFlag);
813     virtual sfx2::LinkManager& GetLinkManager();
814 	virtual const sfx2::LinkManager& GetLinkManager() const;
815     virtual void UpdateLinks(sal_Bool bUI);
816 	virtual bool GetData(const String& rItem, const String& rMimeType, ::com::sun::star::uno::Any& rValue) const;
817 	virtual bool SetData(const String& rItem, const String& rMimeType, const ::com::sun::star::uno::Any& rValue);
818     virtual ::sfx2::SvLinkSource* CreateLinkSource(const String& rItem);
819 	virtual bool EmbedAllLinks();
820     virtual void SetLinksUpdated(const bool bNewLinksUpdated);
821     virtual bool LinksUpdated() const;
822 
823     /** IDocumentFieldsAccess
824     */
825     virtual const SwFldTypes *GetFldTypes() const;
826 	virtual SwFieldType *InsertFldType(const SwFieldType &);
827 	virtual SwFieldType *GetSysFldType( const sal_uInt16 eWhich ) const;
828 	virtual SwFieldType* GetFldType(sal_uInt16 nResId, const String& rName, bool bDbFieldMatching) const;
829     virtual void RemoveFldType(sal_uInt16 nFld);
830     virtual void UpdateFlds( SfxPoolItem* pNewHt, bool bCloseDB);
831     virtual void InsDeletedFldType(SwFieldType &);
832     virtual bool PutValueToField(const SwPosition & rPos, const com::sun::star::uno::Any& rVal, sal_uInt16 nWhich);
833     virtual bool UpdateFld(SwTxtFld * rDstFmtFld, SwField & rSrcFld, SwMsgPoolItem * pMsgHnt, bool bUpdateTblFlds);
834 	virtual void UpdateRefFlds(SfxPoolItem* pHt);
835     virtual void UpdateTblFlds(SfxPoolItem* pHt);
836     virtual void UpdateExpFlds(SwTxtFld* pFld, bool bUpdateRefFlds);
837     virtual void UpdateUsrFlds();
838     virtual void UpdatePageFlds(SfxPoolItem*);
839     virtual void LockExpFlds();
840     virtual void UnlockExpFlds();
841     virtual bool IsExpFldsLocked() const;
842     virtual SwDocUpdtFld& GetUpdtFlds() const;
843 	virtual bool SetFieldsDirty(bool b, const SwNode* pChk, sal_uLong nLen);
844 	virtual void SetFixFields(bool bOnlyTimeDate, const DateTime* pNewDateTime);
845 	virtual void FldsToCalc(SwCalc& rCalc, sal_uLong nLastNd, sal_uInt16 nLastCnt);
846 	virtual void FldsToCalc(SwCalc& rCalc, const _SetGetExpFld& rToThisFld);
847 	virtual void FldsToExpand(SwHash**& ppTbl, sal_uInt16& rTblSize, const _SetGetExpFld& rToThisFld);
848 	virtual bool IsNewFldLst() const;
849 	virtual void SetNewFldLst( bool bFlag);
850 	virtual void InsDelFldInFldLst(bool bIns, const SwTxtFld& rFld);
851 
852     /** Returns the field at a certain position.
853        @param rPos position to search at
854        @return pointer to field at the given position or NULL in case no field is found
855     */
856     static SwField* GetField(const SwPosition& rPos);
857 
858     /** Returns the field at a certain position.
859        @param rPos position to search at
860        @return pointer to field at the given position or NULL in case no field is found
861     */
862     static SwTxtFld* GetTxtFld(const SwPosition& rPos);
863 
864     /** IDocumentContentOperations
865     */
866     virtual bool CopyRange(SwPaM&, SwPosition&, const bool bCopyAll) const;
867 	virtual void DeleteSection(SwNode* pNode);
868     virtual bool DeleteRange(SwPaM&);
869 	virtual bool DelFullPara(SwPaM&);
870     // --> OD 2009-08-20 #i100466#
871     // Add optional parameter <bForceJoinNext>, default value <false>
872     // Needed for hiding of deletion redlines
873     virtual bool DeleteAndJoin( SwPaM&,
874                                 const bool bForceJoinNext = false );
875     // <--
876     virtual bool MoveRange(SwPaM&, SwPosition&, SwMoveFlags);
877     virtual bool MoveNodeRange(SwNodeRange&, SwNodeIndex&, SwMoveFlags);
878 	virtual bool MoveAndJoin(SwPaM&, SwPosition&, SwMoveFlags);
879 	virtual bool Overwrite(const SwPaM &rRg, const String& rStr);
880     virtual bool InsertString(const SwPaM &rRg, const String&,
881               const enum InsertFlags nInsertMode = INS_EMPTYEXPAND );
882 	virtual SwFlyFrmFmt* Insert(const SwPaM &rRg, const String& rGrfName, const String& rFltName, const Graphic* pGraphic,
883 						const SfxItemSet* pFlyAttrSet, const SfxItemSet* pGrfAttrSet, SwFrmFmt*);
884 	virtual SwFlyFrmFmt* Insert(const SwPaM& rRg, const GraphicObject& rGrfObj,	const SfxItemSet* pFlyAttrSet,
885 						const SfxItemSet* pGrfAttrSet, SwFrmFmt*);
886     virtual SwDrawFrmFmt* Insert(const SwPaM &rRg, SdrObject& rDrawObj, const SfxItemSet* pFlyAttrSet, SwFrmFmt*);
887     virtual SwFlyFrmFmt* Insert(const SwPaM &rRg, const svt::EmbeddedObjectRef& xObj, const SfxItemSet* pFlyAttrSet,
888 						const SfxItemSet* pGrfAttrSet, SwFrmFmt*);
889 	//Modify here for #119405, by chengjh, 2012-08-16
890 	//Add a para for the char attribute exp...
891     virtual bool InsertPoolItem(const SwPaM &rRg, const SfxPoolItem&,
892                                 const SetAttrMode nFlags,bool bExpandCharToPara=false);
893 	//End
894     virtual bool InsertItemSet (const SwPaM &rRg, const SfxItemSet&,
895                                 const SetAttrMode nFlags);
896 	virtual void ReRead(SwPaM&, const String& rGrfName, const String& rFltName, const Graphic* pGraphic, const GraphicObject* pGrfObj);
897     virtual void TransliterateText(const SwPaM& rPaM, utl::TransliterationWrapper&);
898 	virtual SwFlyFrmFmt* InsertOLE(const SwPaM &rRg, const String& rObjName, sal_Int64 nAspect, const SfxItemSet* pFlyAttrSet,
899                            const SfxItemSet* pGrfAttrSet, SwFrmFmt*);
900 	virtual bool SplitNode(const SwPosition &rPos, bool bChkTableStart);
901 	virtual bool AppendTxtNode(SwPosition& rPos);
902         virtual void SetModified(SwPaM &rPaM);
903     virtual bool ReplaceRange(SwPaM& rPam, const String& rNewStr,
904                               const bool bRegExReplace);
905     virtual void RemoveLeadingWhiteSpace(const SwPosition & rPos );
906 
907     /** IDocumentStylePoolAccess
908     */
909     virtual SwTxtFmtColl* GetTxtCollFromPool( sal_uInt16 nId, bool bRegardLanguage = true );
910     virtual SwFmt* GetFmtFromPool( sal_uInt16 nId );
911     virtual SwFrmFmt* GetFrmFmtFromPool( sal_uInt16 nId );
912     virtual SwCharFmt* GetCharFmtFromPool( sal_uInt16 nId );
913     virtual SwPageDesc* GetPageDescFromPool( sal_uInt16 nId, bool bRegardLanguage = true );
914     virtual SwNumRule* GetNumRuleFromPool( sal_uInt16 nId );
915     virtual bool IsPoolTxtCollUsed( sal_uInt16 nId ) const;
916     virtual bool IsPoolFmtUsed( sal_uInt16 nId ) const;
917     virtual bool IsPoolPageDescUsed( sal_uInt16 nId ) const;
918 
919     /** IDocumentLineNumberAccess
920     */
921     virtual const SwLineNumberInfo& GetLineNumberInfo() const;
922     virtual void SetLineNumberInfo(const SwLineNumberInfo& rInfo);
923 
924 	/** IDocumentStatistics
925 	*/
926 	virtual void DocInfoChgd();
927 	virtual const SwDocStat	&GetDocStat() const;
928 	virtual void SetDocStat(const SwDocStat& rStat);
929 	virtual void UpdateDocStat(SwDocStat& rStat);
930 
931 	/** IDocumentState
932 	*/
933 	virtual void SetModified();
934 	virtual void ResetModified();
935 	virtual bool IsModified() const;
936 	virtual bool IsLoaded() const;
937     virtual bool IsUpdateExpFld() const;
938 	virtual bool IsNewDoc() const;
939     virtual bool IsPageNums() const;
940     virtual void SetPageNums(bool b);
941 	virtual void SetNewDoc(bool b);
942 	virtual void SetUpdateExpFldStat(bool b);
943 	virtual void SetLoaded(bool b);
944 
945     /** IDocumentDrawModelAccess
946     */
947     virtual const SdrModel* GetDrawModel() const;
948     virtual SdrModel* GetDrawModel();
949     virtual SdrLayerID GetHeavenId() const;
950     virtual SdrLayerID GetHellId() const;
951     virtual SdrLayerID GetControlsId() const;
952     virtual SdrLayerID GetInvisibleHeavenId() const;
953     virtual SdrLayerID GetInvisibleHellId() const;
954     virtual SdrLayerID GetInvisibleControlsId() const;
955     virtual void NotifyInvisibleLayers( SdrPageView& _rSdrPageView );
956     virtual bool IsVisibleLayerId( const SdrLayerID& _nLayerId ) const;
957     virtual SdrLayerID GetVisibleLayerIdByInvisibleOne( const SdrLayerID& _nInvisibleLayerId );
958     virtual SdrLayerID GetInvisibleLayerIdByVisibleOne( const SdrLayerID& _nVisibleLayerId );
959     virtual SdrModel* _MakeDrawModel();
960     virtual SdrModel* GetOrCreateDrawModel();
961 
962     /** IDocumentLayoutAccess
963     */
964 	virtual void SetCurrentViewShell( ViewShell* pNew );//swmod 071225
965     virtual SwLayouter* GetLayouter();
966     virtual const SwLayouter* GetLayouter() const;
967     virtual void SetLayouter( SwLayouter* pNew );
968     virtual SwFrmFmt* MakeLayoutFmt( RndStdIds eRequest, const SfxItemSet* pSet );
969     virtual void DelLayoutFmt( SwFrmFmt *pFmt );
970     virtual SwFrmFmt* CopyLayoutFmt( const SwFrmFmt& rSrc, const SwFmtAnchor& rNewAnchor, bool bSetTxtFlyAtt, bool bMakeFrms );
971 	virtual const ViewShell *GetCurrentViewShell() const;	//swmod 080219
972 	virtual ViewShell *GetCurrentViewShell();//swmod 080219 It must be able to communicate to a ViewShell.This is going to be removerd later.
973 	virtual const SwRootFrm *GetCurrentLayout() const;
974 	virtual SwRootFrm *GetCurrentLayout();//swmod 080219
975     virtual bool HasLayout() const;
976 
977     /** IDocumentTimerAccess
978     */
979 	virtual void StartIdling();
980 	virtual void StopIdling();
981 	virtual void BlockIdling();
982 	virtual void UnblockIdling();
983 
984     /** IDocumentChartDataProviderAccess
985     */
986     virtual SwChartDataProvider * GetChartDataProvider( bool bCreate = false ) const;
987     virtual void CreateChartInternalDataProviders( const SwTable *pTable );
988     virtual SwChartLockController_Helper & GetChartControllerHelper();
989 
990     /** IDocumentListItems
991 
992         OD 2007-10-26 #i83479#
993     */
994     virtual void addListItem( const SwNodeNum& rNodeNum );
995     virtual void removeListItem( const SwNodeNum& rNodeNum );
996     virtual String getListItemText( const SwNodeNum& rNodeNum,
997                                     const bool bWithNumber = true,
998                                     const bool bWithSpacesForLevel = false ) const;
999     virtual void getListItems( IDocumentListItems::tSortedNodeNumList& orNodeNumList ) const;
1000     virtual void getNumItems( IDocumentListItems::tSortedNodeNumList& orNodeNumList ) const;
1001 
1002     /** IDocumentOutlineNodes
1003 
1004         OD 2007-11-15 #i83479#
1005     */
1006     virtual sal_Int32 getOutlineNodesCount() const;
1007     virtual int getOutlineLevel( const sal_Int32 nIdx ) const;
1008     virtual String getOutlineText( const sal_Int32 nIdx,
1009                                    const bool bWithNumber,
1010                                    const bool bWithSpacesForLevel ) const;
1011     virtual SwTxtNode* getOutlineNode( const sal_Int32 nIdx ) const;
1012     virtual void getOutlineNodes( IDocumentOutlineNodes::tSortedOutlineNodeList& orOutlineNodeList ) const;
1013 
1014     /** IDocumentListsAccess
1015 
1016         OD 2008-03-26 #refactorlists#
1017     */
1018     virtual SwList* createList( String sListId,
1019                                 const String sDefaultListStyleName );
1020     virtual void deleteList( const String sListId );
1021     virtual SwList* getListByName( const String sListId ) const;
1022     virtual SwList* createListForListStyle( const String sListStyleName );
1023     virtual SwList* getListForListStyle( const String sListStyleName ) const;
1024     virtual void deleteListForListStyle( const String sListStyleName );
1025     // --> OD 2008-07-08 #i91400#
1026     virtual void trackChangeOfListStyleName( const String sListStyleName,
1027                                              const String sNewListStyleName );
1028     // <--
1029 
1030     /** IDocumentExternalData */
1031     virtual void setExternalData(::sw::tExternalDataType eType,
1032                                  ::sw::tExternalDataPointer pPayload);
1033     virtual ::sw::tExternalDataPointer getExternalData(::sw::tExternalDataType eType);
1034 
1035 
1036     /** INextInterface here
1037     */
1038 
1039     DECL_STATIC_LINK( SwDoc, BackgroundDone, SvxBrushItem *);
1040     DECL_LINK(CalcFieldValueHdl, EditFieldInfo*);
1041 
1042     /** OLE ???
1043     */
1044     bool IsOLEPrtNotifyPending() const  { return mbOLEPrtNotifyPending; }
1045     inline void SetOLEPrtNotifyPending( bool bSet = true );
1046 	void PrtOLENotify( sal_Bool bAll );	//Alle oder nur Markierte
1047 
1048 #ifdef DBG_UTIL
1049     bool InXMLExport() const            { return mbXMLExport; }
1050     void SetXMLExport( bool bFlag )     { mbXMLExport = bFlag; }
1051 #endif
1052 
1053     void SetContainsAtPageObjWithContentAnchor( const bool bFlag )
1054     {
1055         mbContainsAtPageObjWithContentAnchor = bFlag;
1056     }
1057     bool DoesContainAtPageObjWithContentAnchor()
1058     {
1059         return mbContainsAtPageObjWithContentAnchor;
1060     }
1061 
1062 	// liefert zu allen fliegenden Rahmen die Position im Dokument.
1063 	// Wird ein Pam-Pointer uebergeben, muessen die absatzgebundenen
1064 	// FlyFrames von der ::com::sun::star::awt::Selection vollstaendig umschlossen sein
1065 	// ( Start < Pos < End ) !!!
1066 	// (wird fuer die Writer benoetigt)
1067 	SwPosFlyFrms GetAllFlyFmts( const SwPaM* = 0, sal_Bool bDrawAlso = sal_False ) const;
1068 
1069     // wegen swrtf.cxx und define private public, jetzt hier
1070 	SwFlyFrmFmt  *MakeFlyFrmFmt (const String &rFmtName, SwFrmFmt *pDerivedFrom);
1071 	SwDrawFrmFmt *MakeDrawFrmFmt(const String &rFmtName, SwFrmFmt *pDerivedFrom);
1072 
1073     // JP 08.05.98: fuer Flys muss jetzt diese Schnittstelle benutzt
1074 	//				werden. pAnchorPos muss gesetzt sein, wenn keine
1075 	//				Seitenbindung vorliegt UND der ::com::sun::star::chaos::Anchor nicht schon
1076 	//				im FlySet/FrmFmt mit gueltiger CntntPos gesetzt ist
1077     /* #109161# new parameter bCalledFromShell
1078 
1079        sal_True: An existing adjust item at pAnchorPos is propagated to
1080        the content node of the new fly section. That propagation only
1081        takes place if there is no adjust item in the paragraph style
1082        for the new fly section.
1083 
1084        sal_False: no propagation
1085     */
1086 	SwFlyFrmFmt* MakeFlySection( RndStdIds eAnchorType,
1087                                  const SwPosition* pAnchorPos,
1088                                  const SfxItemSet* pSet = 0,
1089                                  SwFrmFmt *pParent = 0,
1090                                  sal_Bool bCalledFromShell = sal_False );
1091 	SwFlyFrmFmt* MakeFlyAndMove( const SwPaM& rPam, const SfxItemSet& rSet,
1092 								const SwSelBoxes* pSelBoxes = 0,
1093 								SwFrmFmt *pParent = 0 );
1094 
1095 	void CopyWithFlyInFly( const SwNodeRange& rRg,
1096                             const xub_StrLen nEndContentIndex,
1097 							const SwNodeIndex& rInsPos,
1098 							sal_Bool bMakeNewFrms = sal_True,
1099 							sal_Bool bDelRedlines = sal_True,
1100 							sal_Bool bCopyFlyAtFly = sal_False ) const;
1101 
1102     sal_Bool SetFlyFrmAttr( SwFrmFmt& rFlyFmt, SfxItemSet& rSet );
1103 
1104     sal_Bool SetFrmFmtToFly( SwFrmFmt& rFlyFmt, SwFrmFmt& rNewFmt,
1105 						SfxItemSet* pSet = 0, sal_Bool bKeepOrient = sal_False );
1106     // --> OD 2009-07-20 #i73249#
1107     void SetFlyFrmTitle( SwFlyFrmFmt& rFlyFrmFmt,
1108                          const String& sNewTitle );
1109     void SetFlyFrmDescription( SwFlyFrmFmt& rFlyFrmFmt,
1110                                const String& sNewDescription );
1111     // <--
1112 
1113     /** Footnotes
1114     */
1115 	// Fussnoten Informationen
1116 	const SwFtnInfo& GetFtnInfo() const			{ return *pFtnInfo; }
1117 	void SetFtnInfo(const SwFtnInfo& rInfo);
1118 	const SwEndNoteInfo& GetEndNoteInfo() const { return *pEndNoteInfo; }
1119 	void SetEndNoteInfo(const SwEndNoteInfo& rInfo);
1120 		  SwFtnIdxs& GetFtnIdxs() 		{ return *pFtnIdxs; }
1121 	const SwFtnIdxs& GetFtnIdxs() const { return *pFtnIdxs; }
1122     // change footnotes in area
1123     bool SetCurFtn( const SwPaM& rPam, const String& rNumStr,
1124                     sal_uInt16 nNumber, bool bIsEndNote );
1125 
1126     /** Operations on the content of the document e.g.
1127         spell-checking/hyphenating/word-counting
1128     */
1129     ::com::sun::star::uno::Any
1130 			Spell( SwPaM&, ::com::sun::star::uno::Reference<
1131 							::com::sun::star::linguistic2::XSpellChecker1 > &,
1132                    sal_uInt16* pPageCnt, sal_uInt16* pPageSt, bool bGrammarCheck,
1133                    SwConversionArgs *pConvArgs = 0 ) const;
1134 
1135 	::com::sun::star::uno::Reference<
1136 		::com::sun::star::linguistic2::XHyphenatedWord >
1137 			Hyphenate( SwPaM *pPam, const Point &rCrsrPos,
1138 			  		   sal_uInt16* pPageCnt, sal_uInt16* pPageSt );
1139 
1140     // count words in pam
1141     void CountWords( const SwPaM& rPaM, SwDocStat& rStat ) const;
1142 
1143 
1144     /** ???
1145     */
1146     // Textbaustein Dokument?
1147     void SetGlossDoc( bool bGlssDc = true ) { mbGlossDoc = bGlssDc; }
1148     bool IsInsOnlyTextGlossary() const      { return mbInsOnlyTxtGlssry; }
1149 
1150 	// Abstakt fuellen
1151 	void Summary( SwDoc* pExtDoc, sal_uInt8 nLevel, sal_uInt8 nPara, sal_Bool bImpress );
1152 
1153     void ChangeAuthorityData(const SwAuthEntry* pNewData);
1154 
1155     bool IsInCallModified() const      { return mbInCallModified; }
1156 	sal_Bool IsInHeaderFooter( const SwNodeIndex& rIdx ) const;
1157     short GetTextDirection( const SwPosition& rPos,
1158                             const Point* pPt = 0 ) const;
1159     sal_Bool IsInVerticalText( const SwPosition& rPos,
1160 							   const Point* pPt = 0 ) const;
1161     /** Database ???
1162     */
1163 
1164 	/*	Datenbank &&  DB-Manager */
1165 	void SetNewDBMgr( SwNewDBMgr* pNewMgr )		{ pNewDBMgr = pNewMgr; }
1166 	SwNewDBMgr* GetNewDBMgr() const 			{ return pNewDBMgr; }
1167 	void ChangeDBFields( const SvStringsDtor& rOldNames,
1168 						const String& rNewName );
1169 	void SetInitDBFields(sal_Bool b);
1170 	// Von Feldern verwendete Datenbanken herausfinden
1171 	void GetAllUsedDB( SvStringsDtor& rDBNameList,
1172 					   const SvStringsDtor* pAllDBNames = 0 );
1173 
1174 	void ChgDBData( const SwDBData& rNewData );
1175 	SwDBData GetDBData();
1176 	const SwDBData& GetDBDesc();
1177 	const SwDBData& _GetDBDesc() const { return aDBData; }
1178 
1179     /** Some helper functions
1180     */
1181     String GetUniqueGrfName() const;
1182     String GetUniqueOLEName() const;
1183 	String GetUniqueFrameName() const;
1184 
1185 	std::set<SwRootFrm*> GetAllLayouts();//swmod 080225
1186 
1187 	void SetFlyName( SwFlyFrmFmt& rFmt, const String& rName );
1188 	const SwFlyFrmFmt* FindFlyByName( const String& rName, sal_Int8 nNdTyp = 0 ) const;
1189 
1190 	void GetGrfNms( const SwFlyFrmFmt& rFmt, String* pGrfName,
1191 					String* pFltName ) const;
1192 
1193 	// setze bei allen Flys ohne Namen einen gueltigen (Wird von den Readern
1194 	// nach dem Einlesen gerufen )
1195 	void SetAllUniqueFlyNames();
1196 
1197 		//Zuruecksetzen der Attribute; es werden alle TxtHints und bei
1198 		//vollstaendiger Selektion harte Formatierung (AUTO-Formate) entfernt
1199     // --> OD 2008-11-28 #i96644#
1200     // introduce new optional parameter <bSendDataChangedEvents> in order to
1201     // control, if the side effect "send data changed events" is triggered or not.
1202     void ResetAttrs( const SwPaM &rRg,
1203                      sal_Bool bTxtAttr = sal_True,
1204                      const SvUShortsSort* = 0,
1205                      const bool bSendDataChangedEvents = true );
1206     // <--
1207     void RstTxtAttrs(const SwPaM &rRg, sal_Bool bInclRefToxMark = sal_False );
1208 
1209 		// Setze das Attribut im angegebenen Format. Ist Undo aktiv, wird
1210 		// das alte in die Undo-History aufgenommen
1211 	void SetAttr( const SfxPoolItem&, SwFmt& );
1212 	void SetAttr( const SfxItemSet&, SwFmt& );
1213 
1214     // --> OD 2008-02-12 #newlistlevelattrs#
1215     // method to reset a certain attribute at the given format
1216     void ResetAttrAtFormat( const sal_uInt16 nWhichId,
1217                             SwFmt& rChangedFormat );
1218     // <--
1219 
1220 		// Setze das Attribut als neues default Attribut in diesem Dokument.
1221 		// Ist Undo aktiv, wird das alte in die Undo-History aufgenommen
1222 	void SetDefault( const SfxPoolItem& );
1223 	void SetDefault( const SfxItemSet& );
1224 
1225 	// Erfrage das Default Attribut in diesem Dokument.
1226 	const SfxPoolItem& GetDefault( sal_uInt16 nFmtHint ) const;
1227 	// TextAttribute nicht mehr aufspannen lassen
1228 	sal_Bool DontExpandFmt( const SwPosition& rPos, sal_Bool bFlag = sal_True );
1229 
1230 	/* Formate */
1231 	const SwFrmFmts* GetFrmFmts() const 	{ return pFrmFmtTbl; }
1232 		  SwFrmFmts* GetFrmFmts()			{ return pFrmFmtTbl; }
1233 	const SwCharFmts* GetCharFmts() const	{ return pCharFmtTbl;}
1234 
1235 	/* LayoutFormate (Rahmen, DrawObjecte), mal const mal nicht */
1236 	const SwSpzFrmFmts* GetSpzFrmFmts() const	{ return pSpzFrmFmtTbl; }
1237 		  SwSpzFrmFmts* GetSpzFrmFmts() 		{ return pSpzFrmFmtTbl; }
1238 
1239 	const SwFrmFmt *GetDfltFrmFmt() const	{ return pDfltFrmFmt; }
1240 		  SwFrmFmt *GetDfltFrmFmt() 		{ return pDfltFrmFmt; }
1241 	const SwFrmFmt *GetEmptyPageFmt() const { return pEmptyPageFmt; }
1242 		  SwFrmFmt *GetEmptyPageFmt()		{ return pEmptyPageFmt; }
1243 	const SwFrmFmt *GetColumnContFmt() const{ return pColumnContFmt; }
1244 		  SwFrmFmt *GetColumnContFmt()		{ return pColumnContFmt; }
1245 	const SwCharFmt *GetDfltCharFmt() const { return pDfltCharFmt;}
1246 		  SwCharFmt *GetDfltCharFmt()		{ return pDfltCharFmt;}
1247 
1248     // Returns the interface of the management of (auto)styles
1249     IStyleAccess& GetIStyleAccess() { return *pStyleAccess; }
1250 
1251 	// Remove all language dependencies from all existing formats
1252 	void RemoveAllFmtLanguageDependencies();
1253 
1254 	SwFrmFmt  *MakeFrmFmt(const String &rFmtName, SwFrmFmt *pDerivedFrom,
1255                           sal_Bool bBroadcast = sal_False, sal_Bool bAuto = sal_True);
1256 	void	   DelFrmFmt( SwFrmFmt *pFmt, sal_Bool bBroadcast = sal_False );
1257 	SwFrmFmt* FindFrmFmtByName( const String& rName ) const
1258 		{	return (SwFrmFmt*)FindFmtByName( (SvPtrarr&)*pFrmFmtTbl, rName ); }
1259 
1260     // --> OD 2005-01-13 #i40550#
1261     SwCharFmt *MakeCharFmt(const String &rFmtName, SwCharFmt *pDerivedFrom,
1262                            sal_Bool bBroadcast = sal_False,
1263                            sal_Bool bAuto = sal_True );
1264     // <--
1265 	void	   DelCharFmt(sal_uInt16 nFmt, sal_Bool bBroadcast = sal_False);
1266 	void	   DelCharFmt(SwCharFmt* pFmt, sal_Bool bBroadcast = sal_False);
1267 	SwCharFmt* FindCharFmtByName( const String& rName ) const
1268 		{	return (SwCharFmt*)FindFmtByName( (SvPtrarr&)*pCharFmtTbl, rName ); }
1269 
1270 	/* Formatcollections (Vorlagen) */
1271 	// TXT
1272 	const SwTxtFmtColl* GetDfltTxtFmtColl() const { return pDfltTxtFmtColl; }
1273 	const SwTxtFmtColls *GetTxtFmtColls() const { return pTxtFmtCollTbl; }
1274     // --> OD 2005-01-13 #i40550#
1275     SwTxtFmtColl *MakeTxtFmtColl( const String &rFmtName,
1276 								  SwTxtFmtColl *pDerivedFrom,
1277                                   sal_Bool bBroadcast = sal_False,
1278                                   sal_Bool bAuto = sal_True );
1279     // <--
1280 	SwConditionTxtFmtColl* MakeCondTxtFmtColl( const String &rFmtName,
1281 											   SwTxtFmtColl *pDerivedFrom,
1282                                                sal_Bool bBroadcast = sal_False);
1283 	void DelTxtFmtColl(sal_uInt16 nFmt, sal_Bool bBroadcast = sal_False);
1284 	void DelTxtFmtColl( SwTxtFmtColl* pColl, sal_Bool bBroadcast = sal_False );
1285     // --> OD 2007-11-06 #i62675#
1286     // Add 4th optional parameter <bResetListAttrs>.
1287     // 'side effect' of <SetTxtFmtColl> with <bReset = true> is that the hard
1288     // attributes of the affected text nodes are cleared, except the break
1289     // attribute, the page description attribute and the list style attribute.
1290     // The new parameter <bResetListAttrs> indicates, if the list attributes
1291     // (list style, restart at and restart with) are cleared as well in case
1292     // that <bReset = true> and the paragraph style has a list style attribute set.
1293     sal_Bool SetTxtFmtColl( const SwPaM &rRg, SwTxtFmtColl *pFmt,
1294                             bool bReset = true,
1295                             bool bResetListAttrs = false );
1296     // <--
1297 	SwTxtFmtColl* FindTxtFmtCollByName( const String& rName ) const
1298 		{	return (SwTxtFmtColl*)FindFmtByName( (SvPtrarr&)*pTxtFmtCollTbl, rName ); }
1299 
1300     void ChkCondColls();
1301 
1302 		// GRF
1303 	const SwGrfFmtColl* GetDfltGrfFmtColl() const	{ return pDfltGrfFmtColl; }
1304 	const SwGrfFmtColls *GetGrfFmtColls() const		{ return pGrfFmtCollTbl; }
1305 	SwGrfFmtColl *MakeGrfFmtColl(const String &rFmtName,
1306 									SwGrfFmtColl *pDerivedFrom);
1307 	SwGrfFmtColl* FindGrfFmtCollByName( const String& rName ) const
1308 		{	return (SwGrfFmtColl*)FindFmtByName( (SvPtrarr&)*pGrfFmtCollTbl, rName ); }
1309 
1310 		// Tabellen-Formate
1311 	const SwFrmFmts* GetTblFrmFmts() const	{ return pTblFrmFmtTbl; }
1312 		  SwFrmFmts* GetTblFrmFmts()		{ return pTblFrmFmtTbl; }
1313 	sal_uInt16 GetTblFrmFmtCount( sal_Bool bUsed ) const;
1314 	SwFrmFmt& GetTblFrmFmt(sal_uInt16 nFmt, sal_Bool bUsed ) const;
1315 	SwTableFmt* MakeTblFrmFmt(const String &rFmtName, SwFrmFmt *pDerivedFrom);
1316 	void	    DelTblFrmFmt( SwTableFmt* pFmt );
1317 	SwTableFmt* FindTblFmtByName( const String& rName, sal_Bool bAll = sal_False ) const;
1318 
1319 	//Rahmenzugriff
1320 	//iterieren ueber Flys - fuer Basic-Collections
1321 	sal_uInt16 GetFlyCount( FlyCntType eType = FLYCNTTYPE_ALL) const;
1322 	SwFrmFmt* GetFlyNum(sal_uInt16 nIdx, FlyCntType eType = FLYCNTTYPE_ALL);
1323 
1324 
1325 	// kopiere die Formate in die eigenen Arrays und returne diese
1326 	SwFrmFmt  *CopyFrmFmt ( const SwFrmFmt& );
1327 	SwCharFmt *CopyCharFmt( const SwCharFmt& );
1328 	SwTxtFmtColl* CopyTxtColl( const SwTxtFmtColl& rColl );
1329 	SwGrfFmtColl* CopyGrfColl( const SwGrfFmtColl& rColl );
1330 
1331 		// ersetze alle Formate mit denen aus rSource
1332 	void ReplaceStyles( SwDoc& rSource );
1333 
1334 	// erfrage ob die Absatz-/Zeichen-/Rahmen-/Seiten - Vorlage benutzt wird
1335 	sal_Bool IsUsed( const SwModify& ) const;
1336 	sal_Bool IsUsed( const SwNumRule& ) const;
1337 
1338 		// setze den Namen der neu geladenen Dokument-Vorlage
1339 	sal_uInt16 SetDocPattern( const String& rPatternName );
1340         // gebe den Dok-VorlagenNamen zurueck. !!! Kann auch 0 sein !!!
1341 	String* GetDocPattern( sal_uInt16 nPos ) const { return aPatternNms[nPos]; }
1342 
1343 		// Loesche alle nicht referenzierten FeldTypen
1344 	void GCFieldTypes();				// impl. in docfld.cxx
1345 
1346 		// akt. Dokument mit Textbausteindokument verbinden/erfragen
1347 	void SetGlossaryDoc( SwDoc* pDoc ) { pGlossaryDoc = pDoc; }
1348 
1349 	// travel over PaM Ring
1350 	sal_Bool InsertGlossary( SwTextBlocks& rBlock, const String& rEntry,
1351 						SwPaM& rPaM, SwCrsrShell* pShell = 0);
1352 
1353     // get the set of printable pages for the XRenderable API by
1354     // evaluating the respective settings (see implementation)
1355     void CalculatePagesForPrinting( const SwRootFrm& rLayout, SwRenderData &rData, const SwPrintUIOptions &rOptions, bool bIsPDFExport,
1356             sal_Int32 nDocPageCount );
1357     void UpdatePagesForPrintingWithPostItData( SwRenderData &rData, const SwPrintUIOptions &rOptions, bool bIsPDFExport,
1358             sal_Int32 nDocPageCount );
1359     void CalculatePagePairsForProspectPrinting( const SwRootFrm& rLayout, SwRenderData &rData, const SwPrintUIOptions &rOptions,
1360             sal_Int32 nDocPageCount );
1361 
1362 		//PageDescriptor-Schnittstelle
1363 	sal_uInt16 GetPageDescCnt() const { return aPageDescs.Count(); }
1364 	const SwPageDesc& GetPageDesc( const sal_uInt16 i ) const { return *aPageDescs[i]; }
1365 	SwPageDesc* FindPageDescByName( const String& rName,
1366 									sal_uInt16* pPos = 0 ) const;
1367 
1368 		// kopiere den gesamten PageDesc - ueber Dokumentgrenzen und "tief"!
1369 		// optional kann das kopieren der PoolFmtId, -HlpId verhindert werden
1370 	void CopyPageDesc( const SwPageDesc& rSrcDesc, SwPageDesc& rDstDesc,
1371 						sal_Bool bCopyPoolIds = sal_True );
1372 
1373 		// kopiere die Kopzeile (mit dem Inhalt!) aus dem SrcFmt
1374 		// ins DestFmt ( auch ueber Doc grenzen hinaus!)
1375 	void CopyHeader( const SwFrmFmt& rSrcFmt, SwFrmFmt& rDestFmt )
1376         { CopyPageDescHeaderFooterImpl( true, rSrcFmt, rDestFmt ); }
1377 		// kopiere die Fusszeile (mit dem Inhalt!) aus dem SrcFmt
1378 		// ins DestFmt ( auch ueber Doc grenzen hinaus!)
1379 	void CopyFooter( const SwFrmFmt& rSrcFmt, SwFrmFmt& rDestFmt )
1380         { CopyPageDescHeaderFooterImpl( false, rSrcFmt, rDestFmt ); }
1381 
1382 		//fuer Reader
1383 
1384     SwPageDesc * GetPageDesc( const String & rName );
1385 	SwPageDesc& _GetPageDesc( sal_uInt16 i ) const { return *aPageDescs[i]; }
1386 	void ChgPageDesc( const String & rName, const SwPageDesc& );
1387 	void ChgPageDesc( sal_uInt16 i, const SwPageDesc& );
1388     sal_Bool FindPageDesc( const String & rName, sal_uInt16 * pFound );
1389     // -> #116530#
1390     void DelPageDesc( const String & rName, sal_Bool bBroadcast = sal_False);
1391 	void DelPageDesc( sal_uInt16 i, sal_Bool bBroadcast = sal_False );
1392     // <- #116530#
1393     void PreDelPageDesc(SwPageDesc * pDel); // #i7983#
1394     // -> #116530#
1395 	sal_uInt16 MakePageDesc( const String &rName, const SwPageDesc* pCpy = 0,
1396                              sal_Bool bRegardLanguage = sal_True,
1397                              sal_Bool bBroadcast = sal_False);
1398     void BroadcastStyleOperation(String rName, SfxStyleFamily eFamily,
1399                                  sal_uInt16 nOp);
1400     // <- #116530#
1401 
1402 
1403     // --> FME 2005-03-16 #i44963# The html import sometimes overwrites the
1404     // page sizes set in the page descriptions. This function is used to
1405     // correct this.
1406     void CheckDefaultPageFmt();
1407     // <--
1408 
1409 		// Methoden fuer die Verzeichnisse:
1410 		// - Verzeichnismarke einfuegen loeschen travel
1411 	sal_uInt16 GetCurTOXMark( const SwPosition& rPos, SwTOXMarks& ) const;
1412     void DeleteTOXMark( const SwTOXMark* pTOXMark );
1413 	const SwTOXMark& GotoTOXMark( const SwTOXMark& rCurTOXMark,
1414 								SwTOXSearch eDir, sal_Bool bInReadOnly );
1415 
1416 		// - Verzeichnis einfuegen, und bei Bedarf erneuern
1417 	const SwTOXBaseSection* InsertTableOf( const SwPosition& rPos,
1418 											const SwTOXBase& rTOX,
1419 											const SfxItemSet* pSet = 0,
1420 											sal_Bool bExpand = sal_False );
1421 	const SwTOXBaseSection* InsertTableOf( sal_uLong nSttNd, sal_uLong nEndNd,
1422 											const SwTOXBase& rTOX,
1423 											const SfxItemSet* pSet = 0											);
1424 	const SwTOXBase* GetCurTOX( const SwPosition& rPos ) const;
1425 	const SwAttrSet& GetTOXBaseAttrSet(const SwTOXBase& rTOX) const;
1426 
1427 	sal_Bool DeleteTOX( const SwTOXBase& rTOXBase, sal_Bool bDelNodes = sal_False );
1428 	String GetUniqueTOXBaseName( const SwTOXType& rType,
1429 								const String* pChkStr = 0 ) const;
1430 
1431 	sal_Bool SetTOXBaseName(const SwTOXBase& rTOXBase, const String& rName);
1432 	void SetTOXBaseProtection(const SwTOXBase& rTOXBase, sal_Bool bProtect);
1433 
1434 	// nach einlesen einer Datei alle Verzeichnisse updaten
1435     void SetUpdateTOX( bool bFlag = true )     { mbUpdateTOX = bFlag; }
1436     bool IsUpdateTOX() const                   { return mbUpdateTOX; }
1437 
1438 	const String&	GetTOIAutoMarkURL() const {return sTOIAutoMarkURL;}
1439 	void			SetTOIAutoMarkURL(const String& rSet)  {sTOIAutoMarkURL = rSet;}
1440 	void 			ApplyAutoMark();
1441 
1442     bool IsInReading() const                    { return mbInReading; }
1443     void SetInReading( bool bNew )              { mbInReading = bNew; }
1444 
1445     bool IsClipBoard() const                    { return mbClipBoard; }
1446     // N.B.: must be called right after constructor! (@see GetXmlIdRegistry)
1447     void SetClipBoard( bool bNew )              { mbClipBoard = bNew; }
1448 
1449     bool IsColumnSelection() const              { return mbColumnSelection; }
1450     void SetColumnSelection( bool bNew )        { mbColumnSelection = bNew; }
1451 
1452     bool IsInXMLImport() const { return mbInXMLImport; }
1453     void SetInXMLImport( bool bNew ) { mbInXMLImport = bNew; }
1454 
1455 	// - Verzeichnis-Typen verwalten
1456 	sal_uInt16 GetTOXTypeCount( TOXTypes eTyp ) const;
1457 	const SwTOXType* GetTOXType( TOXTypes eTyp, sal_uInt16 nId ) const;
1458 	sal_Bool DeleteTOXType( TOXTypes eTyp, sal_uInt16 nId );
1459 	const SwTOXType* InsertTOXType( const SwTOXType& rTyp );
1460 	const SwTOXTypes& GetTOXTypes() const { return *pTOXTypes; }
1461 
1462 	const SwTOXBase* 	GetDefaultTOXBase( TOXTypes eTyp, sal_Bool bCreate = sal_False );
1463 	void				SetDefaultTOXBase(const SwTOXBase& rBase);
1464 
1465 	// - Schluessel fuer die Indexverwaltung
1466 	sal_uInt16 GetTOIKeys( SwTOIKeyType eTyp, SvStringsSort& rArr ) const;
1467 
1468 	// Sortieren Tabellen Text
1469 	sal_Bool SortTbl(const SwSelBoxes& rBoxes, const SwSortOptions&);
1470 	sal_Bool SortText(const SwPaM&, const SwSortOptions&);
1471 
1472 		// korrigiere die im Dokument angemeldeten SwPosition-Objecte,
1473 		// wie z.B. die ::com::sun::star::text::Bookmarks oder die Verzeichnisse.
1474 		// JP 22.06.95: ist bMoveCrsr gesetzt, verschiebe auch die Crsr
1475 
1476 		// Setzt alles in rOldNode auf rNewPos + Offset
1477 	void CorrAbs( const SwNodeIndex& rOldNode, const SwPosition& rNewPos,
1478 					const xub_StrLen nOffset = 0, sal_Bool bMoveCrsr = sal_False );
1479 		// Setzt alles im Bereich von [rStartNode, rEndNode] nach rNewPos
1480 	void CorrAbs( const SwNodeIndex& rStartNode, const SwNodeIndex& rEndNode,
1481 					const SwPosition& rNewPos, sal_Bool bMoveCrsr = sal_False );
1482 		// Setzt alles im Bereich von rRange nach rNewPos
1483 	void CorrAbs( const SwPaM& rRange, const SwPosition& rNewPos,
1484 					sal_Bool bMoveCrsr = sal_False );
1485 		// Setzt alles in rOldNode auf relative Pos
1486 	void CorrRel( const SwNodeIndex& rOldNode, const SwPosition& rNewPos,
1487 					const xub_StrLen nOffset = 0, sal_Bool bMoveCrsr = sal_False );
1488 
1489 		// GliederungsRegeln erfragen / setzen
1490     // --> OD 2005-11-02 #i51089 - TUNING#
1491     inline SwNumRule* GetOutlineNumRule() const
1492     {
1493         return pOutlineRule;
1494     }
1495     // <--
1496 	void SetOutlineNumRule( const SwNumRule& rRule );
1497     void PropagateOutlineRule();
1498 
1499 	// Gliederung - hoch-/runterstufen
1500 	sal_Bool OutlineUpDown( const SwPaM& rPam, short nOffset = 1 );
1501 	// Gliederung - hoch-/runtermoven
1502 	sal_Bool MoveOutlinePara( const SwPaM& rPam, short nOffset = 1);
1503 		// zu diesem Gliederungspunkt
1504 	sal_Bool GotoOutline( SwPosition& rPos, const String& rName ) const;
1505 	// die Aenderungen an den Gliederungsvorlagen in die OutlineRule uebernehmen
1506 
1507 		// setzt, wenn noch keine Numerierung, sonst wird geaendert
1508 		// arbeitet mit alten und neuen Regeln, nur Differenzen aktualisieren
1509     // --> OD 2005-02-18 #i42921# - re-use unused 3rd parameter
1510     // --> OD 2008-02-08 #newlistlevelattrs#
1511     // Add optional parameter <bResetIndentAttrs> - default value sal_False.
1512     // If <bResetIndentAttrs> equals true, the indent attributes "before text"
1513     // and "first line indent" are additionally reset at the provided PaM, if
1514     // the list style makes use of the new list level attributes.
1515     // --> OD 2008-03-17 #refactorlists#
1516     // introduce parameters <bCreateNewList> and <sContinuedListId>
1517     // <bCreateNewList> indicates, if a new list is created by applying the
1518     // given list style.
1519     void SetNumRule( const SwPaM&,
1520                      const SwNumRule&,
1521                      const bool bCreateNewList,
1522                      const String sContinuedListId = String(),
1523                      sal_Bool bSetItem = sal_True,
1524                      const bool bResetIndentAttrs = false );
1525     // <--
1526     void SetCounted( const SwPaM&, bool bCounted);
1527 
1528     // --> OD 2009-08-25 #i86492#
1529     // no longer needed.
1530     // SwDoc::SetNumRule( rPaM, rNumRule, false, <ListId>, sal_True, true ) have to be used instead.
1531 //    /**
1532 //       Replace numbering rules in a PaM by another numbering rule.
1533 
1534 //       \param rPaM         PaM to replace the numbering rules in
1535 //       \param rNumRule     numbering rule to replace the present numbering rules
1536 //     */
1537 //    void ReplaceNumRule(const SwPaM & rPaM, const SwNumRule & rNumRule);
1538 
1539     void MakeUniqueNumRules(const SwPaM & rPaM);
1540 
1541 	void SetNumRuleStart( const SwPosition& rPos, sal_Bool bFlag = sal_True );
1542     void SetNodeNumStart( const SwPosition& rPos, sal_uInt16 nStt );
1543 
1544 	SwNumRule* GetCurrNumRule( const SwPosition& rPos ) const;
1545 
1546     const SwNumRuleTbl& GetNumRuleTbl() const { return *pNumRuleTbl; }
1547 
1548     // #i36749#
1549     /**
1550        Add numbering rule to document.
1551 
1552        @param pRule    rule to add
1553     */
1554     void AddNumRule(SwNumRule * pRule);
1555 
1556     // --> OD 2008-02-11 #newlistlevelattrs#
1557     // add optional parameter <eDefaultNumberFormatPositionAndSpaceMode>
1558     sal_uInt16 MakeNumRule( const String &rName,
1559         const SwNumRule* pCpy = 0,
1560         sal_Bool bBroadcast = sal_False,
1561         const SvxNumberFormat::SvxNumPositionAndSpaceMode eDefaultNumberFormatPositionAndSpaceMode =
1562             SvxNumberFormat::LABEL_WIDTH_AND_POSITION );
1563     // <--
1564 	sal_uInt16 FindNumRule( const String& rName ) const;
1565 	SwNumRule* FindNumRulePtr( const String& rName ) const;
1566 
1567 	// loeschen geht nur, wenn die ::com::sun::star::chaos::Rule niemand benutzt!
1568     // #106897#
1569     sal_Bool RenameNumRule(const String & aOldName, const String & aNewName,
1570                            sal_Bool bBroadcast = sal_False);
1571 	sal_Bool DelNumRule( const String& rName, sal_Bool bBroadCast = sal_False );
1572 	String GetUniqueNumRuleName( const String* pChkStr = 0, sal_Bool bAutoNum = sal_True ) const;
1573 
1574 	void UpdateNumRule();	// alle invaliden Updaten
1575     // #106897#
1576 	void ChgNumRuleFmts( const SwNumRule& rRule, const String * pOldName = 0 );
1577 	sal_Bool ReplaceNumRule( const SwPosition& rPos, const String& rOldRule,
1578 						const String& rNewRule );
1579 
1580 		// zum naechsten/vorhergehenden Punkt auf gleicher Ebene
1581 	sal_Bool GotoNextNum( SwPosition&, sal_Bool bOverUpper = sal_True,
1582 						sal_uInt8* pUpper = 0, sal_uInt8* pLower = 0 );
1583 	sal_Bool GotoPrevNum( SwPosition&, sal_Bool bOverUpper = sal_True,
1584 						sal_uInt8* pUpper = 0, sal_uInt8* pLower = 0 );
1585 
1586     // #i23731#
1587     /** Searches for a text node with a numbering rule.
1588 
1589        OD 2005-10-24 #i55391# - add optional parameter <bInvestigateStartNode>
1590        OD 2008-03-18 #refactorlists# - add output parameter <sListId>
1591 
1592        \param rPos         position to start search
1593        \param bForward     - sal_True:  search forward
1594                            - sal_False: search backward
1595 	   \param bNum		   - sal_True:  search for enumeration
1596 		                   - sal_False: search for itemize
1597        \param bOutline     - sal_True:  search for outline numbering rule
1598                            - sal_False: search for non-outline numbering rule
1599        \param nNonEmptyAllowed   number of non-empty paragraphs allowed between
1600                                  rPos and found paragraph
1601 
1602         @param sListId
1603         output parameter - in case a list style is found, <sListId> holds the
1604         list id, to which the text node belongs, which applies the found list style.
1605 
1606         @param bInvestigateStartNode
1607         input parameter - boolean, indicating, if start node, determined by given
1608         start position has to be investigated or not.
1609      */
1610     const SwNumRule * SearchNumRule(const SwPosition & rPos,
1611                                     const bool bForward,
1612                                     const bool bNum,
1613                                     const bool bOutline,
1614                                     int nNonEmptyAllowed,
1615                                     String& sListId,
1616                                     const bool bInvestigateStartNode = false );
1617 
1618 		// Absaetze ohne Numerierung, aber mit Einzuegen
1619 	sal_Bool NoNum( const SwPaM& );
1620 		// Loeschen, Splitten der Aufzaehlungsliste
1621     void DelNumRules( const SwPaM& );
1622 
1623     // Invalidates all numrules
1624     void InvalidateNumRules();
1625 
1626 		// Hoch-/Runterstufen
1627 	sal_Bool NumUpDown( const SwPaM&, sal_Bool bDown = sal_True );
1628 		// Bewegt selektierte Absaetze (nicht nur Numerierungen)
1629 		// entsprechend des Offsets. (negativ: zum Doc-Anf.)
1630 	sal_Bool MoveParagraph( const SwPaM&, long nOffset = 1, sal_Bool bIsOutlMv = sal_False );
1631 		// No-/Numerierung ueber Delete/Backspace ein/abschalten #115901#
1632 	sal_Bool NumOrNoNum( const SwNodeIndex& rIdx, sal_Bool bDel = sal_False);
1633 		// Animation der Grafiken stoppen
1634 	void StopNumRuleAnimations( OutputDevice* );
1635 
1636 		// fuege eine neue Tabelle auf der Position rPos ein. (es
1637 		// wird vor dem Node eingefuegt !!)
1638 		//JP 28.10.96:
1639 		// 	fuer AutoFormat bei der Eingabe: dann muessen die Spalten
1640 		//	auf die vordefinierten Breite gesetzt werden. Im Array stehen die
1641 		// 	Positionen der Spalten!! (nicht deren Breite!)
1642     /* #109161# new parameter bCalledFromShell:
1643 
1644        sal_True: called from shell -> propagate existing adjust item at
1645        rPos to every new cell. A existing adjust item in the table
1646        heading or table contents paragraph style prevent that
1647        propagation.
1648 
1649        sal_False: do not propagate
1650     */
1651     const SwTable* InsertTable( const SwInsertTableOptions& rInsTblOpts,  // HEADLINE_NO_BORDER
1652                                 const SwPosition& rPos, sal_uInt16 nRows,
1653                                 sal_uInt16 nCols, short eAdjust,
1654                                 const SwTableAutoFmt* pTAFmt = 0,
1655                                 const SvUShorts* pColArr = 0,
1656                                 sal_Bool bCalledFromShell = sal_False,
1657                                 sal_Bool bNewModel = sal_True );
1658 
1659     // steht der Index in einer Tabelle, dann returne den TableNode sonst 0
1660 				 SwTableNode* IsIdxInTbl( const SwNodeIndex& rIdx );
1661 	inline const SwTableNode* IsIdxInTbl( const SwNodeIndex& rIdx ) const;
1662 
1663 		// erzeuge aus dem makierten Bereich eine ausgeglichene Tabelle
1664     const SwTable* TextToTable( const SwInsertTableOptions& rInsTblOpts, // HEADLINE_NO_BORDER,
1665                                 const SwPaM& rRange, sal_Unicode cCh,
1666                                 short eAdjust,
1667                                 const SwTableAutoFmt* = 0 );
1668     // text to table conversion - API support
1669     const SwTable* TextToTable( const std::vector< std::vector<SwNodeRange> >& rTableNodes );
1670 		// erzeuge aus der Tabelle wieder normalen Text
1671 	sal_Bool TableToText( const SwTableNode* pTblNd, sal_Unicode cCh );
1672 		// einfuegen von Spalten/Zeilen in der Tabelle
1673 	sal_Bool InsertCol( const SwCursor& rCursor,
1674 					sal_uInt16 nCnt = 1, sal_Bool bBehind = sal_True );
1675 	sal_Bool InsertCol( const SwSelBoxes& rBoxes,
1676 					sal_uInt16 nCnt = 1, sal_Bool bBehind = sal_True );
1677 	sal_Bool InsertRow( const SwCursor& rCursor,
1678 					sal_uInt16 nCnt = 1, sal_Bool bBehind = sal_True );
1679 	sal_Bool InsertRow( const SwSelBoxes& rBoxes,
1680 					sal_uInt16 nCnt = 1, sal_Bool bBehind = sal_True );
1681 		// loeschen von Spalten/Zeilen in der Tabelle
1682 	sal_Bool DeleteRowCol( const SwSelBoxes& rBoxes, bool bColumn = false );
1683 	sal_Bool DeleteRow( const SwCursor& rCursor );
1684 	sal_Bool DeleteCol( const SwCursor& rCursor );
1685 		// teilen / zusammenfassen von Boxen in der Tabelle
1686     sal_Bool SplitTbl( const SwSelBoxes& rBoxes, sal_Bool bVert = sal_True,
1687                        sal_uInt16 nCnt = 1, sal_Bool bSameHeight = sal_False );
1688 		// returnt den enum TableMergeErr
1689 	sal_uInt16 MergeTbl( SwPaM& rPam );
1690 	String GetUniqueTblName() const;
1691 	sal_Bool IsInsTblFormatNum() const;
1692 	sal_Bool IsInsTblChangeNumFormat() const;
1693 	sal_Bool IsInsTblAlignNum() const;
1694 
1695 		// aus der FEShell wg.. Undo und bModified
1696     void GetTabCols( SwTabCols &rFill, const SwCursor* pCrsr,
1697 					const SwCellFrm* pBoxFrm = 0 ) const;
1698 	void SetTabCols( const SwTabCols &rNew, sal_Bool bCurRowOnly,
1699 					const SwCursor* pCrsr, const SwCellFrm* pBoxFrm = 0 );
1700     void GetTabRows( SwTabCols &rFill, const SwCursor* pCrsr,
1701                     const SwCellFrm* pBoxFrm = 0 ) const;
1702     void SetTabRows( const SwTabCols &rNew, sal_Bool bCurColOnly, const SwCursor* pCrsr,
1703                      const SwCellFrm* pBoxFrm = 0 );
1704 
1705 
1706 	// Direktzugriff fuer Uno
1707     void SetTabCols(SwTable& rTab, const SwTabCols &rNew, const SwTabCols &rOld,
1708 									const SwTableBox *pStart, sal_Bool bCurRowOnly);
1709 
1710     void SetRowsToRepeat( SwTable &rTable, sal_uInt16 nSet );
1711 
1712 		// AutoFormat fuer die Tabelle/TabellenSelection
1713 	sal_Bool SetTableAutoFmt( const SwSelBoxes& rBoxes, const SwTableAutoFmt& rNew );
1714 		// Erfrage wie attributiert ist
1715 	sal_Bool GetTableAutoFmt( const SwSelBoxes& rBoxes, SwTableAutoFmt& rGet );
1716 		// setze das InsertDB als Tabelle Undo auf:
1717 	void AppendUndoForInsertFromDB( const SwPaM& rPam, sal_Bool bIsTable );
1718 		// setze die Spalten/Zeilen/ZTellen Breite/Hoehe
1719 	sal_Bool SetColRowWidthHeight( SwTableBox& rAktBox, sal_uInt16 eType,
1720 								SwTwips nAbsDiff, SwTwips nRelDiff );
1721 	SwTableBoxFmt* MakeTableBoxFmt();
1722 	SwTableLineFmt* MakeTableLineFmt();
1723 	// teste ob die Box ein numerischen Wert darstellt und aender dann ggfs.
1724 	// das Format der Box
1725 	void ChkBoxNumFmt( SwTableBox& rAktBox, sal_Bool bCallUpdate );
1726 	void SetTblBoxFormulaAttrs( SwTableBox& rBox, const SfxItemSet& rSet );
1727 	void ClearBoxNumAttrs( const SwNodeIndex& rNode );
1728 
1729 	sal_Bool InsCopyOfTbl( SwPosition& rInsPos, const SwSelBoxes& rBoxes,
1730 						const SwTable* pCpyTbl = 0, sal_Bool bCpyName = sal_False,
1731 						sal_Bool bCorrPos = sal_False );
1732 
1733 	sal_Bool UnProtectCells( const String& rTblName );
1734 	sal_Bool UnProtectCells( const SwSelBoxes& rBoxes );
1735 	sal_Bool UnProtectTbls( const SwPaM& rPam );
1736 	sal_Bool HasTblAnyProtection( const SwPosition* pPos,
1737 							  const String* pTblName = 0,
1738 							  sal_Bool* pFullTblProtection = 0 );
1739 
1740 	// Tabelle an der Position in der GrundLine aufsplitten, sprich eine
1741 	// neue Tabelle erzeugen.
1742 	sal_Bool SplitTable( const SwPosition& rPos, sal_uInt16 eMode = 0,
1743 						sal_Bool bCalcNewSize = sal_False );
1744 	// und die Umkehrung davon. rPos muss in der Tabelle stehen, die bestehen
1745 	// bleibt. Das Flag besagt ob die aktuelle mit der davor oder dahinter
1746 	// stehenden vereint wird.
1747 	sal_Bool MergeTable( const SwPosition& rPos, sal_Bool bWithPrev = sal_True,
1748 						sal_uInt16 nMode = 0 );
1749 
1750 	// Charts der angegebenen Tabelle zum Update bewegen
1751 	void UpdateCharts( const String &rName ) const;
1752 	// update all charts, for that exists any table
1753     void UpdateAllCharts()          { DoUpdateAllCharts( 0 ); }
1754 	// Tabelle wird umbenannt und aktualisiert die Charts
1755 	void SetTableName( SwFrmFmt& rTblFmt, const String &rNewName );
1756 
1757 	// returne zum Namen die im Doc gesetzte Referenz
1758 	const SwFmtRefMark* GetRefMark( const String& rName ) const;
1759 	// returne die RefMark per Index - fuer Uno
1760 	const SwFmtRefMark* GetRefMark( sal_uInt16 nIndex ) const;
1761 	// returne die Namen aller im Doc gesetzten Referenzen.
1762 	// 	Ist der ArrayPointer 0 dann returne nur, ob im Doc. eine RefMark
1763 	//	gesetzt ist
1764 	sal_uInt16 GetRefMarks( SvStringsDtor* = 0 ) const;
1765 
1766 	//Einfuegen einer Beschriftung - falls ein FlyFormat erzeugt wird, so
1767 	// returne dieses.
1768     SwFlyFrmFmt* InsertLabel( const SwLabelType eType, const String &rTxt, const String& rSeparator,
1769                     const String& rNumberingSeparator,
1770 					const sal_Bool bBefore, const sal_uInt16 nId, const sal_uLong nIdx,
1771                     const String& rCharacterStyle,
1772 					const sal_Bool bCpyBrd = sal_True );
1773     SwFlyFrmFmt* InsertDrawLabel(
1774         const String &rTxt, const String& rSeparator, const String& rNumberSeparator,
1775         const sal_uInt16 nId, const String& rCharacterStyle, SdrObject& rObj );
1776 
1777 	// erfrage den Attribut Pool
1778 	const SwAttrPool& GetAttrPool() const	{ return *mpAttrPool; }
1779 		  SwAttrPool& GetAttrPool() 		{ return *mpAttrPool; }
1780 
1781 	// suche ueber das Layout eine EditShell und ggfs. eine ViewShell
1782 	SwEditShell* GetEditShell( ViewShell** ppSh = 0 ) const;
1783     ::sw::IShellCursorSupplier * GetIShellCursorSupplier();
1784 
1785 	// OLE 2.0-Benachrichtung
1786 	inline		 void  SetOle2Link(const Link& rLink) {aOle2Link = rLink;}
1787 	inline const Link& GetOle2Link() const {return aOle2Link;}
1788 
1789     // insert section (the ODF kind of section, not the nodesarray kind)
1790     SwSection * InsertSwSection(SwPaM const& rRange, SwSectionData &,
1791             SwTOXBase const*const pTOXBase = 0,
1792             SfxItemSet const*const pAttr = 0, bool const bUpdate = true);
1793 	sal_uInt16 IsInsRegionAvailable( const SwPaM& rRange,
1794 								const SwNode** ppSttNd = 0 ) const;
1795 	SwSection* GetCurrSection( const SwPosition& rPos ) const;
1796 	SwSectionFmts& GetSections() { return *pSectionFmtTbl; }
1797 	const SwSectionFmts& GetSections() const { return *pSectionFmtTbl; }
1798 	SwSectionFmt *MakeSectionFmt( SwSectionFmt *pDerivedFrom );
1799 	void DelSectionFmt( SwSectionFmt *pFmt, sal_Bool bDelNodes = sal_False );
1800     void UpdateSection(sal_uInt16 const nSect, SwSectionData &,
1801             SfxItemSet const*const = 0, bool const bPreventLinkUpdate = false);
1802 	String GetUniqueSectionName( const String* pChkStr = 0 ) const;
1803 
1804     /* @@@MAINTAINABILITY-HORROR@@@
1805        The model should not have anything to do with a shell.
1806        Unnecessary compile/link time dependency.
1807     */
1808 	// Pointer auf die SfxDocShell vom Doc, kann 0 sein !!!
1809 		  SwDocShell* GetDocShell() 		{ return pDocShell; }
1810 	const SwDocShell* GetDocShell() const	{ return pDocShell; }
1811 	void SetDocShell( SwDocShell* pDSh );
1812 
1813 	void ShareLayout( boost::shared_ptr<SwRootFrm>& rPtr);
1814 
1815 	// in case during copying of embedded object a new shell is created,
1816     // it should be set here and cleaned later
1817     void SetTmpDocShell( SfxObjectShellLock rLock )    { xTmpDocShell = rLock; }
1818     SfxObjectShellLock GetTmpDocShell()    { return xTmpDocShell; }
1819 
1820     // fuer die TextBausteine - diese habe nur ein SvPersist zur
1821     // Verfuegung
1822     SfxObjectShell* GetPersist() const;
1823 
1824 	// Pointer auf den Storage des SfxDocShells, kann 0 sein !!!
1825     ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > GetDocStorage();
1826 
1827 		// abfrage/setze Flag, ob das Dokument im asynchronen Laden ist
1828     bool IsInLoadAsynchron() const             { return mbInLoadAsynchron; }
1829     void SetInLoadAsynchron( bool bFlag )       { mbInLoadAsynchron = bFlag; }
1830 
1831 	// erzeuge um das zu Servende Object eine Selektion
1832 	sal_Bool SelectServerObj( const String& rStr, SwPaM*& rpPam,
1833 							SwNodeRange*& rpRange ) const;
1834 
1835 	// fuer Drag&Move: ( z.B. RefMarks "verschieben" erlauben )
1836     bool IsCopyIsMove() const              { return mbCopyIsMove; }
1837     void SetCopyIsMove( bool bFlag )        { mbCopyIsMove = bFlag; }
1838 
1839 	SwDrawContact* GroupSelection( SdrView& );
1840 	void UnGroupSelection( SdrView& );
1841 	sal_Bool DeleteSelection( SwDrawView& );
1842 
1843 	// Invalidiert OnlineSpell-WrongListen
1844 	void SpellItAgainSam( sal_Bool bInvalid, sal_Bool bOnlyWrong, sal_Bool bSmartTags );
1845 	void InvalidateAutoCompleteFlag();
1846 
1847     // <--
1848 	void SetCalcFieldValueHdl(Outliner* pOutliner);
1849 
1850 	// erfrage ob die ::com::sun::star::util::URL besucht war. Uebers Doc, falls nur ein ::com::sun::star::text::Bookmark
1851 	// angegeben ist. Dann muss der Doc. Name davor gesetzt werden!
1852 	sal_Bool IsVisitedURL( const String& rURL ) const;
1853 
1854 	// speicher die akt. Werte fuer die automatische Aufnahme von Ausnahmen
1855 	// in die Autokorrektur
1856 	void SetAutoCorrExceptWord( SwAutoCorrExceptWord* pNew );
1857 	SwAutoCorrExceptWord* GetAutoCorrExceptWord()		{ return pACEWord; }
1858 
1859 	const SwFmtINetFmt* FindINetAttr( const String& rName ) const;
1860 
1861 	// rufe ins dunkle Basic, mit evt. Return String
1862 	sal_Bool ExecMacro( const SvxMacro& rMacro, String* pRet = 0, SbxArray* pArgs = 0 );
1863 	// rufe ins dunkle Basic/JavaScript
1864 	sal_uInt16 CallEvent( sal_uInt16 nEvent, const SwCallMouseEvent& rCallEvent,
1865 						sal_Bool bChkPtr = sal_False, SbxArray* pArgs = 0,
1866 						const Link* pCallBack = 0 );
1867 
1868 	// linken Rand ueber Objectleiste einstellen (aenhlich dem Stufen von
1869 	// Numerierungen), optional kann man "um" den Offset stufen oder "auf"
1870 	// die Position gestuft werden (bModulus = sal_True)
1871 	void MoveLeftMargin( const SwPaM& rPam, sal_Bool bRight = sal_True,
1872 						sal_Bool bModulus = sal_True );
1873 
1874 	// Numberformatter erfragen
1875 	inline	  	 SvNumberFormatter* GetNumberFormatter( sal_Bool bCreate = sal_True );
1876 	inline const SvNumberFormatter* GetNumberFormatter( sal_Bool bCreate = sal_True ) const;
1877 
1878     bool HasInvisibleContent() const;
1879     /// delete invisible content, like hidden sections and paragraphs
1880     bool RemoveInvisibleContent();
1881     /// restore the invisible content if it's available on the undo stack
1882     bool RestoreInvisibleContent();
1883     // replace fields by text - mailmerge support
1884     sal_Bool ConvertFieldsToText();
1885 
1886 	// erzeuge Anhand der vorgebenen Collection Teildokumente
1887 	// falls keine angegeben ist, nehme die Kapitelvorlage der 1. Ebene
1888 	sal_Bool GenerateGlobalDoc( const String& rPath,
1889 								const SwTxtFmtColl* pSplitColl = 0 );
1890 	sal_Bool GenerateGlobalDoc( const String& rPath, int nOutlineLevel = 0 );	//#outline level,add by zhaojianwei
1891 	sal_Bool GenerateHTMLDoc( const String& rPath,
1892 								const SwTxtFmtColl* pSplitColl = 0 );
1893 	sal_Bool GenerateHTMLDoc( const String& rPath, int nOutlineLevel = 0 );	//#outline level,add by zhaojianwei
1894 
1895 	//  vergleiche zwei Dokument miteinander
1896 	long CompareDoc( const SwDoc& rDoc );
1897 	// merge zweier Dokumente
1898 	long MergeDoc( const SwDoc& rDoc );
1899 	// setze Kommentar-Text fuers Redline, das dann per AppendRedline
1900 	// hereinkommt. Wird vom Autoformat benutzt. 0-Pointer setzt den Modus
1901 	// wieder zurueck. Die SequenceNummer ist fuers UI-seitige zusammen-
1902 	// fassen von Redlines.
1903 	void SetAutoFmtRedlineComment( const String* pTxt, sal_uInt16 nSeqNo = 0 );
1904 
1905     bool IsAutoFmtRedline() const           { return mbIsAutoFmtRedline; }
1906     void SetAutoFmtRedline( bool bFlag )    { mbIsAutoFmtRedline = bFlag; }
1907 
1908 	// fuer AutoFormat: mit Undo/Redlining - Behandlung
1909 	void SetTxtFmtCollByAutoFmt( const SwPosition& rPos, sal_uInt16 nPoolId,
1910 								const SfxItemSet* pSet = 0 );
1911 	void SetFmtItemByAutoFmt( const SwPaM& rPam, const SfxItemSet& );
1912 
1913 	// !!!NUR fuer die SW-Textblocks!! beachtet kein LAYOUT!!!
1914 	void ClearDoc(); 		// loescht den gesamten Inhalt.
1915 
1916 	// erfrage / setze die Daten fuer die PagePreView
1917 	const SwPagePreViewPrtData* GetPreViewPrtData() const { return pPgPViewPrtData; }
1918 	// wenn der Pointer == 0 ist, dann wird im Doc der Pointer zerstoert,
1919 	// ansonsten wird das Object kopiert.
1920 	// Der Pointer geht NICHT in den Besitz des Doc's!!
1921 	void SetPreViewPrtData( const SwPagePreViewPrtData* pData );
1922 
1923 	// update all modified OLE-Objects. The modification is called over the
1924 	// StarOne - Interface				--> Bug 67026
1925 	void SetOLEObjModified()
1926 	{	if( GetCurrentViewShell() ) aOLEModifiedTimer.Start(); }	//swmod 071107//swmod 071225
1927 
1928 	// -------------------- Uno - Schnittstellen ---------------------------
1929 	const SwUnoCrsrTbl& GetUnoCrsrTbl() const 		{ return *pUnoCrsrTbl; }
1930 	SwUnoCrsr* CreateUnoCrsr( const SwPosition& rPos, sal_Bool bTblCrsr = sal_False );
1931 	// -------------------- Uno - Schnittstellen ---------------------------
1932 
1933 	// -------------------- FeShell - Schnittstellen -----------------------
1934 	// !!!!! diese gehen immer davon aus, das ein Layout existiert  !!!!
1935     sal_Bool ChgAnchor( const SdrMarkList& _rMrkList,
1936                         RndStdIds _eAnchorType,
1937                         const sal_Bool _bSameOnly,
1938                         const sal_Bool _bPosCorr );
1939 
1940 	void SetRowHeight( const SwCursor& rCursor, const SwFmtFrmSize &rNew );
1941 	void GetRowHeight( const SwCursor& rCursor, SwFmtFrmSize *& rpSz ) const;
1942     void SetRowSplit( const SwCursor& rCursor, const SwFmtRowSplit &rNew );
1943     void GetRowSplit( const SwCursor& rCursor, SwFmtRowSplit *& rpSz ) const;
1944 	sal_Bool BalanceRowHeight( const SwCursor& rCursor, sal_Bool bTstOnly = sal_True );
1945 	void SetRowBackground( const SwCursor& rCursor, const SvxBrushItem &rNew );
1946 	sal_Bool GetRowBackground( const SwCursor& rCursor, SvxBrushItem &rToFill ) const;
1947 	void SetTabBorders( const SwCursor& rCursor, const SfxItemSet& rSet );
1948 	void SetTabLineStyle( const SwCursor& rCursor,
1949 						  const Color* pColor, sal_Bool bSetLine,
1950 						  const SvxBorderLine* pBorderLine );
1951 	void GetTabBorders( const SwCursor& rCursor, SfxItemSet& rSet ) const;
1952 	void SetBoxAttr( const SwCursor& rCursor, const SfxPoolItem &rNew );
1953     sal_Bool GetBoxAttr( const SwCursor& rCursor, SfxPoolItem &rToFill ) const;
1954     void SetBoxAlign( const SwCursor& rCursor, sal_uInt16 nAlign );
1955 	sal_uInt16 GetBoxAlign( const SwCursor& rCursor ) const;
1956 	void AdjustCellWidth( const SwCursor& rCursor, sal_Bool bBalance = sal_False );
1957 
1958 	int Chainable( const SwFrmFmt &rSource, const SwFrmFmt &rDest );
1959 	int Chain( SwFrmFmt &rSource, const SwFrmFmt &rDest );
1960 	void Unchain( SwFrmFmt &rFmt );
1961 
1962 	// fuers Copy/Move aus der FrmShell
1963 	SdrObject* CloneSdrObj( const SdrObject&, sal_Bool bMoveWithinDoc = sal_False,
1964 							sal_Bool bInsInPage = sal_True );
1965 
1966 	//
1967 	// -------------------- FeShell - Schnittstellen Ende ------------------
1968 
1969 
1970 	// Schnittstelle fuer die TextInputDaten - ( fuer die Texteingabe
1971 	// von japanischen/chinesischen Zeichen)
1972 	SwExtTextInput* CreateExtTextInput( const SwPaM& rPam );
1973 	void DeleteExtTextInput( SwExtTextInput* pDel );
1974 	SwExtTextInput* GetExtTextInput( const SwNode& rNd,
1975 								xub_StrLen nCntntPos = STRING_NOTFOUND) const;
1976 	SwExtTextInput* GetExtTextInput() const;
1977 
1978 	// Schnistelle fuer den Zugriff auf die AutoComplete-Liste
1979 	static SwAutoCompleteWord& GetAutoCompleteWords() { return *pACmpltWords; }
1980 
1981     bool ContainsMSVBasic() const          { return mbContains_MSVBasic; }
1982     void SetContainsMSVBasic( bool bFlag )  { mbContains_MSVBasic = bFlag; }
1983 
1984     // Interface for the list of Ruby - texts/attributes
1985 	sal_uInt16 FillRubyList( const SwPaM& rPam, SwRubyList& rList,
1986 						sal_uInt16 nMode );
1987 	sal_uInt16 SetRubyList( const SwPaM& rPam, const SwRubyList& rList,
1988 						sal_uInt16 nMode );
1989 
1990     void ReadLayoutCache( SvStream& rStream );
1991     void WriteLayoutCache( SvStream& rStream );
1992     SwLayoutCache* GetLayoutCache() const { return pLayoutCache; }
1993 
1994     /** Checks if any of the text node contains hidden characters.
1995         Used for optimization. Changing the view option 'view hidden text'
1996         has to trigger a reformatting only if some of the text is hidden.
1997     */
1998     bool ContainsHiddenChars() const;
1999 
2000 	// call back for API wrapper
2001 	SwModify*	GetUnoCallBack() const;
2002 
2003     IGrammarContact* getGrammarContact() const { return mpGrammarContact; }
2004 
2005     // -> #i27615#
2006     /** Marks/Unmarks a list level of a certain list
2007 
2008         OD 2008-04-02 #refactorlists#
2009         levels of a certain lists are marked now
2010 
2011         @param sListId    list Id of the list whose level has to be marked/unmarked
2012         @param nListLevel level to mark
2013         @param bValue     - sal_True  mark the level
2014                           - sal_False unmark the level
2015     */
2016     void MarkListLevel( const String& sListId,
2017                         const int nListLevel,
2018                         const sal_Bool bValue );
2019 
2020     /** Marks/Unmarks a list level of a certain list
2021 
2022         OD 2008-04-02 #refactorlists#
2023         levels of a certain lists are marked now
2024 
2025         @param rList      list whose level has to be marked/unmarked
2026         @param nListLevel level to mark
2027         @param bValue     - sal_True  mark the level
2028                           - sal_False unmark the level
2029      */
2030     void MarkListLevel( SwList& rList,
2031                         const int nListLevel,
2032                         const sal_Bool bValue );
2033     // <- #i27615#
2034 
2035     // Change a format undoable.
2036     void ChgFmt(SwFmt & rFmt, const SfxItemSet & rSet);
2037 
2038     void RenameFmt(SwFmt & rFmt, const String & sNewName,
2039                    sal_Bool bBroadcast = sal_False);
2040 
2041     // Change a TOX undoable.
2042     void ChgTOX(SwTOXBase & rTOX, const SwTOXBase & rNew);
2043 
2044     // #111827#
2045     /**
2046        Returns a textual description of a PaM.
2047 
2048        @param rPaM     the PaM to describe
2049 
2050        If rPaM only spans one paragraph the result is:
2051 
2052             '<text in the PaM>'
2053 
2054        <text in the PaM> is shortened to nUndoStringLength characters.
2055 
2056        If rPaM spans more than one paragraph the result is:
2057 
2058             paragraphs                               (STR_PARAGRAPHS)
2059 
2060        @return the textual description of rPaM
2061      */
2062     String GetPaMDescr(const SwPaM & rPaM) const;
2063 
2064     // -> #i23726#
2065     sal_Bool IsFirstOfNumRule(SwPosition & rPos);
2066     // <- #i23726#
2067 
2068     // --> #i31958# access methods for XForms model(s)
2069 
2070     /// access container for XForms model; will be NULL if !isXForms()
2071 	com::sun::star::uno::Reference<com::sun::star::container::XNameContainer>
2072         getXForms() const;
2073 
2074     com::sun::star::uno::Reference< com::sun::star::linguistic2::XProofreadingIterator > GetGCIterator() const;
2075 
2076     /// is this an XForms document?
2077     bool isXForms() const;
2078 
2079     /// initialize XForms models; turn this into an XForms document
2080     void initXForms( bool bCreateDefaultModel );
2081     // <-- #i31958# access methods for XForms model(s)
2082 
2083     void disposeXForms( );  // #i113606#, for disposing XForms
2084 
2085     // --> OD 2006-03-21 #b6375613#
2086     inline bool ApplyWorkaroundForB6375613() const
2087     {
2088         return mbApplyWorkaroundForB6375613;
2089     }
2090     void SetApplyWorkaroundForB6375613( bool p_bApplyWorkaroundForB6375613 );
2091     // <--
2092 
2093     //Update all the page masters
2094     void SetDefaultPageMode(bool bSquaredPageMode);
2095     sal_Bool IsSquaredPageMode() const;
2096 
2097 	// i#78591#
2098 	void Setn32DummyCompatabilityOptions1( sal_uInt32 CompatabilityOptions1 )
2099 	{
2100 		n32DummyCompatabilityOptions1 = CompatabilityOptions1;
2101 	}
2102 	sal_uInt32 Getn32DummyCompatabilityOptions1( )
2103 	{
2104 		return n32DummyCompatabilityOptions1;
2105 	}
2106 	void Setn32DummyCompatabilityOptions2( sal_uInt32 CompatabilityOptions2 )
2107 	{
2108 		n32DummyCompatabilityOptions2 = CompatabilityOptions2;
2109 	}
2110 	sal_uInt32 Getn32DummyCompatabilityOptions2( )
2111 	{
2112 		return n32DummyCompatabilityOptions2;
2113 	}
2114 #ifdef FUTURE_VBA
2115     com::sun::star::uno::Reference< com::sun::star::script::vba::XVBAEventProcessor > GetVbaEventProcessor();
2116 #endif
2117     ::sfx2::IXmlIdRegistry& GetXmlIdRegistry();
2118     ::sw::MetaFieldManager & GetMetaFieldManager();
2119     ::sw::UndoManager      & GetUndoManager();
2120     ::sw::UndoManager const& GetUndoManager() const;
2121     SfxObjectShell* CreateCopy(bool bCallInitNew) const;
2122 };
2123 
2124 
2125 // Diese Methode wird im Dtor vom SwDoc gerufen und loescht den Cache
2126 // der Konturobjekte
2127 void ClrContourCache();
2128 
2129 
2130 //------------------ inline impl. ---------------------------------
2131 
2132 inline const SwTableNode* SwDoc::IsIdxInTbl( const SwNodeIndex& rIdx ) const
2133 {
2134 	return ((SwDoc*)this)->IsIdxInTbl( rIdx );
2135 }
2136 
2137 inline SvNumberFormatter* SwDoc::GetNumberFormatter( sal_Bool bCreate )
2138 {
2139 	if( bCreate && !pNumberFormatter )
2140 		_CreateNumberFormatter();
2141 	return pNumberFormatter;
2142 }
2143 
2144 inline const SvNumberFormatter* SwDoc::GetNumberFormatter( sal_Bool bCreate ) const
2145 {
2146 	return ((SwDoc*)this)->GetNumberFormatter( bCreate );
2147 }
2148 
2149 inline void SwDoc::SetOLEPrtNotifyPending( bool bSet )
2150 {
2151 	mbOLEPrtNotifyPending = bSet;
2152 	if( !bSet )
2153 		mbAllOLENotify = sal_False;
2154 }
2155 
2156 // --> OD 2006-03-14 #i62875#
2157 // namespace <docfunc> for functions and procedures working on a Writer document.
2158 namespace docfunc
2159 {
2160     /** method to check, if given Writer document contains at least one drawing object
2161 
2162         OD 2006-03-17 #i62875#
2163 
2164         @author OD
2165 
2166         @param p_rDoc
2167         input parameter - reference to the Writer document, which is investigated.
2168     */
2169     bool ExistsDrawObjs( SwDoc& p_rDoc );
2170 
2171     /** method to check, if given Writer document contains only drawing objects,
2172         which are completely on its page.
2173 
2174         OD 2006-03-17 #i62875#
2175 
2176         @author OD
2177 
2178         @param p_rDoc
2179         input parameter - reference to the Writer document, which is investigated.
2180     */
2181     bool AllDrawObjsOnPage( SwDoc& p_rDoc );
2182 
2183     /** method to check, if the outline style has to written as a normal list style
2184 
2185         OD 2006-09-27 #i69627#
2186         The outline style has to written as a normal list style, if a parent
2187         paragraph style of one of the paragraph styles, which are assigned to
2188         the list levels of the outline style, has a list style set or inherits
2189         a list style from its parent paragraphs style.
2190         This information is needed for the OpenDocument file format export.
2191 
2192         @author OD
2193 
2194         @param rDoc
2195         input parameter - reference to the text document, which is investigated.
2196 
2197         @return boolean
2198         indicating, if the outline style has to written as a normal list style
2199     */
2200     bool HasOutlineStyleToBeWrittenAsNormalListStyle( SwDoc& rDoc );
2201 }
2202 // <--
2203 #endif	//_DOC_HXX
2204