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