LCOV - code coverage report
Current view: top level - libreoffice/sw/inc - doc.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 85 116 73.3 %
Date: 2012-12-27 Functions: 66 89 74.2 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2             : /*
       3             :  * This file is part of the LibreOffice project.
       4             :  *
       5             :  * This Source Code Form is subject to the terms of the Mozilla Public
       6             :  * License, v. 2.0. If a copy of the MPL was not distributed with this
       7             :  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
       8             :  *
       9             :  * This file incorporates work covered by the following license notice:
      10             :  *
      11             :  *   Licensed to the Apache Software Foundation (ASF) under one or more
      12             :  *   contributor license agreements. See the NOTICE file distributed
      13             :  *   with this work for additional information regarding copyright
      14             :  *   ownership. The ASF licenses this file to you under the Apache
      15             :  *   License, Version 2.0 (the "License"); you may not use this file
      16             :  *   except in compliance with the License. You may obtain a copy of
      17             :  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
      18             :  */
      19             : #ifndef SW_DOC_HXX
      20             : #define SW_DOC_HXX
      21             : 
      22             : /** SwDoc interfaces */
      23             : 
      24             : #include <IInterface.hxx>
      25             : #include <IDocumentSettingAccess.hxx>
      26             : #include <IDocumentDeviceAccess.hxx>
      27             : #include <IDocumentMarkAccess.hxx>
      28             : #include <IDocumentRedlineAccess.hxx>
      29             : #include <IDocumentLinksAdministration.hxx>
      30             : #include <IDocumentFieldsAccess.hxx>
      31             : #include <IDocumentContentOperations.hxx>
      32             : #include <IDocumentStylePoolAccess.hxx>
      33             : #include <IDocumentLineNumberAccess.hxx>
      34             : #include <IDocumentStatistics.hxx>
      35             : #include <IDocumentState.hxx>
      36             : #include <IDocumentDrawModelAccess.hxx>
      37             : #include <IDocumentLayoutAccess.hxx>
      38             : #include <IDocumentTimerAccess.hxx>
      39             : #include <IDocumentChartDataProviderAccess.hxx>
      40             : #include <IDocumentOutlineNodes.hxx>
      41             : #include <IDocumentListItems.hxx>
      42             : 
      43             : #include <IDocumentListsAccess.hxx>
      44             : class SwList;
      45             : 
      46             : #include <IDocumentExternalData.hxx>
      47             : #include <com/sun/star/embed/XEmbeddedObject.hpp>
      48             : #include <com/sun/star/embed/XStorage.hpp>
      49             : #include <vcl/timer.hxx>
      50             : #include <sal/macros.h>
      51             : #include "swdllapi.h"
      52             : #include <swtypes.hxx>
      53             : #include <swatrset.hxx>
      54             : #include <toxe.hxx>             // enums
      55             : #include <flyenum.hxx>
      56             : #include <itabenum.hxx>
      57             : #include <swdbdata.hxx>
      58             : #include <chcmprse.hxx>
      59             : #include <com/sun/star/linguistic2/XSpellChecker1.hpp>
      60             : #include <com/sun/star/linguistic2/XHyphenatedWord.hpp>
      61             : #include <rtl/ref.hxx>
      62             : #include <svx/svdtypes.hxx>
      63             : #include <sfx2/objsh.hxx>
      64             : #include <svl/style.hxx>
      65             : #include <editeng/numitem.hxx>
      66             : #include "comphelper/implementationreference.hxx"
      67             : #include <com/sun/star/chart2/data/XDataProvider.hpp>
      68             : #include <com/sun/star/linguistic2/XProofreadingIterator.hpp>
      69             : #include <com/sun/star/script/vba/XVBAEventProcessor.hpp>
      70             : 
      71             : #include <boost/unordered_map.hpp>
      72             : #include <stringhash.hxx>
      73             : 
      74             : #include <svtools/embedhlp.hxx>
      75             : #include <vector>
      76             : #include <set>
      77             : #include <map>
      78             : #include <memory>
      79             : 
      80             : #include <boost/scoped_ptr.hpp>
      81             : #include <boost/shared_ptr.hpp>
      82             : #include <boost/ptr_container/ptr_vector.hpp>
      83             : 
      84             : namespace editeng { class SvxBorderLine; }
      85             : 
      86             : class SvxForbiddenCharactersTable;
      87             : class SwExtTextInput;
      88             : class DateTime;
      89             : class EditFieldInfo;
      90             : class JobSetup;
      91             : class Color;
      92             : class KeyCode;
      93             : class Outliner;
      94             : class OutputDevice;
      95             : class Point;
      96             : class SbxArray;
      97             : class SdrModel;
      98             : class SdrObject;
      99             : class SdrUndoAction;
     100             : class VirtualDevice;
     101             : class SfxPrinter;
     102             : class SvNumberFormatter;
     103             : class SvxMacro;
     104             : class SvxMacroTableDtor;
     105             : class SwAutoCompleteWord;
     106             : class SwAutoCorrExceptWord;
     107             : class SwCalc;
     108             : class SwCellFrm;
     109             : class SwCharFmt;
     110             : class SwCharFmts;
     111             : class SwConditionTxtFmtColl;
     112             : class SwCrsrShell;
     113             : class SwCursor;
     114             : class SwDBNameInfField;
     115             : class SwDocShell;
     116             : class SwDocUpdtFld;
     117             : class SwDrawFrmFmt;
     118             : class SwDrawView;
     119             : class SwEditShell;
     120             : class SwFieldType;
     121             : class SwField;
     122             : class SwTxtFld;
     123             : class SwFldTypes;
     124             : class SwFlyFrmFmt;
     125             : class SwFmtsBase;
     126             : class SwFmt;
     127             : class SwFmtINetFmt;
     128             : class SwFmtRefMark;
     129             : class SwFrmFmt;
     130             : class SwFrmFmts;
     131             : class SwFtnIdxs;
     132             : class SwFtnInfo;
     133             : class SwEndNoteInfo;
     134             : class GraphicObject;
     135             : class SwGrfFmtColl;
     136             : class SwGrfFmtColls;
     137             : class SwLineNumberInfo;
     138             : class SwNewDBMgr;
     139             : class SwNoTxtNode;
     140             : class SwNodeIndex;
     141             : class SwNodeRange;
     142             : class SwNodes;
     143             : class SwNumRule;
     144             : class SwNumRuleTbl;
     145             : class SwPageDesc;
     146             : class SwPosFlyFrms;
     147             : class SwPagePreViewPrtData;
     148             : class SwRedline;
     149             : class SwRedlineTbl;
     150             : class SwRootFrm;
     151             : class SwRubyList;
     152             : class SwRubyListEntry;
     153             : class SwSectionFmt;
     154             : class SwSectionFmts;
     155             : class SwSectionData;
     156             : class SwSelBoxes;
     157             : class SwTOXBase;
     158             : class SwTOXBaseSection;
     159             : class SwTOXMark;
     160             : class SwTOXMarks;
     161             : class SwTOXType;
     162             : class SwTOXTypes;
     163             : class SwTabCols;
     164             : class SwTable;
     165             : class SwTableAutoFmt;
     166             : class SwTableBox;
     167             : class SwTableBoxFmt;
     168             : class SwTableFmt;
     169             : class SwTableLineFmt;
     170             : class SwTableNode;
     171             : class SwTextBlocks;
     172             : class SwTxtFmtColl;
     173             : class SwTxtFmtColls;
     174             : class SwURLStateChanged;
     175             : class SwUnoCrsr;
     176             : class SwUnoCrsrTbl;
     177             : class ViewShell;
     178             : class _SetGetExpFld;
     179             : class SwDrawContact;
     180             : class SwLayouter;
     181             : class SdrView;
     182             : class SdrMarkList;
     183             : class SwAuthEntry;
     184             : class SwLayoutCache;
     185             : class IStyleAccess;
     186             : struct SwCallMouseEvent;
     187             : struct SwDocStat;
     188             : struct SwHash;
     189             : struct SwSortOptions;
     190             : struct SwDefTOXBase_Impl;
     191             : class SwPrintData;
     192             : class SwPrintUIOptions;
     193             : class SdrPageView;
     194             : struct SwConversionArgs;
     195             : class SwRewriter;
     196             : class SwMsgPoolItem;
     197             : class SwChartDataProvider;
     198             : class SwChartLockController_Helper;
     199             : class IGrammarContact;
     200             : class SwPrintData;
     201             : class SwRenderData;
     202             : class SwPageFrm;
     203             : class SwViewOption;
     204             : class IDocumentUndoRedo;
     205             : 
     206             : namespace sw { namespace mark {
     207             :     class MarkManager;
     208             : }}
     209             : namespace sw {
     210             :     class MetaFieldManager;
     211             :     class UndoManager;
     212             :     class IShellCursorSupplier;
     213             : }
     214             : 
     215             : namespace com { namespace sun { namespace star {
     216             : namespace i18n {
     217             :     struct ForbiddenCharacters;    ///< comes from the I18N UNO interface
     218             : }
     219             : namespace uno {
     220             :     template < class > class Sequence;
     221             : }
     222             : namespace container {
     223             :     class XNameContainer; ///< for getXForms()/isXForms()/initXForms() methods
     224             : }
     225             : }}}
     226             : 
     227             : namespace sfx2 {
     228             :     class SvLinkSource;
     229             :     class IXmlIdRegistry;
     230             :     class LinkManager;
     231             : }
     232             : 
     233             : /// PageDescriptor-interface, Array because of inlines.
     234         276 : class SwPageDescs : public std::vector<SwPageDesc*>
     235             : {
     236             : public:
     237             :     /// the destructor will free all objects still in the vector
     238             :     ~SwPageDescs();
     239             : };
     240             : 
     241             : /// forward declaration
     242             : void SetAllScriptItem( SfxItemSet& rSet, const SfxPoolItem& rItem );
     243             : 
     244             : /// global function to start grammar checking in the document
     245             : void StartGrammarChecking( SwDoc &rDoc );
     246             : 
     247             : /// Represents the model of a Writer document.
     248             : class SW_DLLPUBLIC SwDoc :
     249             :     public IInterface,
     250             :     public IDocumentSettingAccess,
     251             :     public IDocumentDeviceAccess,
     252             :     public IDocumentRedlineAccess,
     253             :     public IDocumentLinksAdministration,
     254             :     public IDocumentFieldsAccess,
     255             :     public IDocumentContentOperations,
     256             :     public IDocumentStylePoolAccess,
     257             :     public IDocumentLineNumberAccess,
     258             :     public IDocumentStatistics,
     259             :     public IDocumentState,
     260             :     public IDocumentDrawModelAccess,
     261             :     public IDocumentLayoutAccess,
     262             :     public IDocumentTimerAccess,
     263             :     public IDocumentChartDataProviderAccess,
     264             :     public IDocumentListItems,
     265             :     public IDocumentOutlineNodes,
     266             :     public IDocumentListsAccess,
     267             :     public IDocumentExternalData
     268             : {
     269             : 
     270             :     friend void _InitCore();
     271             :     friend void _FinitCore();
     272             : 
     273             :     //---------------- private Member --------------------------------
     274             : 
     275             :     // -------------------------------------------------------------------
     276             :     ::boost::scoped_ptr<SwNodes> m_pNodes;  ///< document content (Nodes Array)
     277             :     SwAttrPool* mpAttrPool;             ///< the attribute pool
     278             :     SwPageDescs aPageDescs;             ///< PageDescriptors
     279             :     Link        aOle2Link;              ///< OLE 2.0-notification
     280             :     /* @@@MAINTAINABILITY-HORROR@@@
     281             :        Timer should not be members of the model
     282             :     */
     283             :     Timer       aIdleTimer;             ///< Own IdleTimer
     284             :     Timer       aOLEModifiedTimer;      ///< Timer for update modified OLE-Objecs
     285             :     SwDBData    aDBData;                ///< database descriptor
     286             :     ::com::sun::star::uno::Sequence <sal_Int8 > aRedlinePasswd;
     287             :     String      sTOIAutoMarkURL;        ///< ::com::sun::star::util::URL of table of index AutoMark file
     288             :     boost::ptr_vector< boost::nullable<String> > aPatternNms;          // Array for names of document-templates
     289             :     com::sun::star::uno::Reference<com::sun::star::container::XNameContainer>
     290             :         xXForms;                        ///< container with XForms models
     291             :     mutable com::sun::star::uno::Reference< com::sun::star::linguistic2::XProofreadingIterator > m_xGCIterator;
     292             : 
     293             :     const ::boost::scoped_ptr< ::sw::mark::MarkManager> pMarkManager;
     294             :     const ::boost::scoped_ptr< ::sw::MetaFieldManager > m_pMetaFieldManager;
     295             :     const ::boost::scoped_ptr< ::sw::UndoManager > m_pUndoManager;
     296             : 
     297             :     // -------------------------------------------------------------------
     298             :     // Pointer
     299             : 
     300             :     SwFrmFmt        *pDfltFrmFmt;       ///< Default formats.
     301             :     SwFrmFmt       *pEmptyPageFmt;     ///< Format for the default empty page
     302             :     SwFrmFmt        *pColumnContFmt;    ///< Format for column container
     303             :     SwCharFmt       *pDfltCharFmt;
     304             :     SwTxtFmtColl    *pDfltTxtFmtColl;   ///< Defaultformatcollections
     305             :     SwGrfFmtColl    *pDfltGrfFmtColl;
     306             : 
     307             :     SwFrmFmts       *pFrmFmtTbl;        ///< Format table
     308             :     SwCharFmts      *pCharFmtTbl;
     309             :     SwFrmFmts       *pSpzFrmFmtTbl;
     310             :     SwSectionFmts   *pSectionFmtTbl;
     311             :     SwFrmFmts       *pTblFrmFmtTbl;     ///< For tables
     312             :     SwTxtFmtColls   *pTxtFmtCollTbl;    ///< FormatCollections
     313             :     SwGrfFmtColls   *pGrfFmtCollTbl;
     314             : 
     315             :     SwTOXTypes      *pTOXTypes;         ///< Tables/indices
     316             :     SwDefTOXBase_Impl * pDefTOXBases;   ///< defaults of SwTOXBase's
     317             : 
     318             :     ViewShell       *pCurrentView;  ///< SwDoc should get a new member pCurrentView//swmod 071225
     319             :     boost::shared_ptr<SwRootFrm> pLayoutPtr;
     320             :     SdrModel        *pDrawModel;        ///< StarView Drawing
     321             : 
     322             :     SwDocUpdtFld    *pUpdtFlds;         ///< Struct for updating fields
     323             :     SwFldTypes      *pFldTypes;
     324             :     SwNewDBMgr      *pNewDBMgr;         /**< Pointer to the new DBMgr for
     325             :                                          evaluation of DB-fields. */
     326             : 
     327             :     VirtualDevice   *pVirDev;           ///< can be used for formatting
     328             :     SfxPrinter      *pPrt;              ///< can be used for formatting
     329             :     SwPrintData     *pPrtData;          ///< Print configuration
     330             : 
     331             :     SwDoc           *pGlossaryDoc;      ///< Pointer to glossary-document.
     332             : 
     333             :     SwNumRule       *pOutlineRule;
     334             :     SwFtnInfo       *pFtnInfo;
     335             :     SwEndNoteInfo   *pEndNoteInfo;
     336             :     SwLineNumberInfo*pLineNumberInfo;
     337             :     SwFtnIdxs       *pFtnIdxs;
     338             :     SwDocStat       *pDocStat;          ///< Statistics information.
     339             : 
     340             :     SwDocShell      *pDocShell;         ///< Ptr to SfxDocShell of Doc.
     341             :     SfxObjectShellLock xTmpDocShell;    ///< A temporary shell that is used to copy OLE-Nodes
     342             : 
     343             : 
     344             :     sfx2::LinkManager   *pLinkMgr;      ///< List of linked stuff (graphics/DDE/OLE).
     345             : 
     346             :     SwAutoCorrExceptWord *pACEWord;     /**< For the automated takeover of
     347             :                                          auto-corrected words that are "re-corrected". */
     348             :     SwURLStateChanged *pURLStateChgd;   ///< SfxClient for changes in INetHistory
     349             :     SvNumberFormatter *pNumberFormatter;///< NumFormatter for tables / fields
     350             : 
     351             :     mutable SwNumRuleTbl    *pNumRuleTbl;   ///< List of all named NumRules.
     352             : 
     353             :     /// Hash map to find numrules by name
     354             :     mutable boost::unordered_map<String, SwNumRule *, StringHash> maNumRuleMap;
     355             : 
     356             :     typedef boost::unordered_map< String, SwList*, StringHash > tHashMapForLists;
     357             :     /// container to hold the lists of the text document
     358             :     tHashMapForLists maLists;
     359             :     /// relation between list style and its default list
     360             :     tHashMapForLists maListStyleLists;
     361             : 
     362             :     SwRedlineTbl    *pRedlineTbl;           ///< List of all Redlines.
     363             :     String          *pAutoFmtRedlnComment;  ///< Comment for Redlines inserted via AutoFormat.
     364             : 
     365             :     SwUnoCrsrTbl    *pUnoCrsrTbl;
     366             : 
     367             :     SwPagePreViewPrtData *pPgPViewPrtData;  ///< Indenting / spacing for printing of page view.
     368             :     SwPaM           *pExtInputRing;
     369             : 
     370             :     SwLayouter      *pLayouter;     /**< ::com::sun::star::frame::Controller for complex layout formatting
     371             :                                      like footnote/endnote in sections */
     372             :     IStyleAccess    *pStyleAccess;  ///< handling of automatic styles
     373             :     SwLayoutCache   *pLayoutCache;  /**< Layout cache to read and save with the
     374             :                                      document for a faster formatting */
     375             : 
     376             :     SwModify *pUnoCallBack;
     377             :     IGrammarContact *mpGrammarContact;   ///< for grammar checking in paragraphs during editing
     378             : 
     379             :     mutable  comphelper::ImplementationReference< SwChartDataProvider
     380             :         , ::com::sun::star::chart2::data::XDataProvider >
     381             :                                 aChartDataProviderImplRef;
     382             :     SwChartLockController_Helper  *pChartControllerHelper;
     383             : 
     384             :     /// table of forbidden characters of this document
     385             :     rtl::Reference<SvxForbiddenCharactersTable> xForbiddenCharsTable;
     386             :     com::sun::star::uno::Reference< com::sun::star::script::vba::XVBAEventProcessor > mxVbaEvents;
     387             :     com::sun::star::uno::Reference<com::sun::star::container::XNameContainer> m_xTemplateToProjectCache;
     388             : public:
     389             :     struct lessThanNodeNum
     390             :     {
     391             :         bool operator()( const SwNodeNum* pNodeNumOne,
     392             :                          const SwNodeNum* pNodeNumTwo ) const;
     393             :     };
     394             : 
     395             :     typedef ::std::set< const SwNodeNum*, lessThanNodeNum > tImplSortedNodeNumList;
     396             : private:
     397             :     tImplSortedNodeNumList* mpListItemsList;
     398             : 
     399             :     ::std::auto_ptr< ::sfx2::IXmlIdRegistry > m_pXmlIdRegistry;
     400             : 
     401             :     // -------------------------------------------------------------------
     402             :     // other
     403             : 
     404             :     sal_uInt16  nUndoCnt;           ///< Count of Undo Actions.
     405             :     sal_uInt16  nUndoSttEnd;        ///< != 0 -> within parentheses.
     406             : 
     407             :     sal_uInt16 nAutoFmtRedlnCommentNo;  /**< SeqNo for conjoining of AutoFmt-Redlines.
     408             :                                          by the UI. Managed by SwAutoFmt! */
     409             : 
     410             :     sal_uInt16  nLinkUpdMode;       ///< UpdateMode for links.
     411             :     SwFldUpdateFlags    eFldUpdMode;///< Automatically Update Mode for fields/charts.
     412             :     RedlineMode_t eRedlineMode;     ///< Current Redline Mode.
     413             :     SwCharCompressType eChrCmprType;///< for ASIAN: compress punctuation/kana
     414             : 
     415             :     sal_uInt32  nRsid;              ///< current session ID of the document
     416             :     sal_uInt32  nRsidRoot;          ///< session ID when the document was created
     417             : 
     418             :     sal_Int32   mReferenceCount;
     419             :     sal_Int32   mIdleBlockCount;
     420             :     sal_Int8    nLockExpFld;        ///< If != 0 UpdateExpFlds() has no effect!
     421             : 
     422             :     /** Draw Model Layer IDs
     423             :      * LayerIds, Heaven == above document
     424             :      *           Hell   == below document
     425             :      *         Controls == at the very top
     426             :      */
     427             :     SdrLayerID  nHeaven;
     428             :     SdrLayerID  nHell;
     429             :     SdrLayerID  nControls;
     430             :     SdrLayerID  nInvisibleHeaven;
     431             :     SdrLayerID  nInvisibleHell;
     432             :     SdrLayerID  nInvisibleControls;
     433             : 
     434             :     bool mbGlossDoc              : 1;    ///< TRUE: glossary document.
     435             :     bool mbModified              : 1;    ///< TRUE: document has changed.
     436             :     bool mbDtor                  : 1;    /**< TRUE: is in SwDoc DTOR.
     437             :                                                and unfortunately temorarily also in
     438             :                                                SwSwgReader::InLayout() when flawed
     439             :                                                frames need deletion. */
     440             :     bool mbPageNums              : 1;    ///< TRUE: There are virtual page numbers.
     441             :     bool mbLoaded                : 1;    ///< TRUE: Doc loaded.
     442             :     bool mbUpdateExpFld          : 1;    ///< TRUE: Update expression fields.
     443             :     bool mbNewDoc                : 1;    ///< TRUE: new Doc.
     444             :     bool mbNewFldLst             : 1;    ///< TRUE: Rebuild field-list.
     445             :     bool mbCopyIsMove            : 1;    ///< TRUE: Copy is a hidden Move.
     446             :     bool mbVisibleLinks          : 1;    ///< TRUE: Links are inserted visibly.
     447             :     bool mbInReading             : 1;    ///< TRUE: Document is in the process of being read.
     448             :     bool mbInXMLImport           : 1;    ///< TRUE: During xml import, attribute portion building is not necessary.
     449             :     bool mbUpdateTOX             : 1;    ///< TRUE: After loading document, update TOX.
     450             :     bool mbInLoadAsynchron       : 1;    ///< TRUE: Document is in the process of being loaded asynchronously.
     451             :     bool mbHTMLMode              : 1;    ///< TRUE: Document is in HTMLMode.
     452             :     bool mbInCallModified        : 1;    ///< TRUE: in Set/Reset-Modified link.
     453             :     bool mbIsGlobalDoc           : 1;    ///< TRUE: It's a global document.
     454             :     bool mbGlblDocSaveLinks      : 1;    ///< TRUE: Save sections linked in global document.
     455             :     bool mbIsLabelDoc            : 1;    ///< TRUE: It's a label document.
     456             :     bool mbIsAutoFmtRedline      : 1;    ///< TRUE: Redlines are recorded by Autoformat.
     457             :     bool mbOLEPrtNotifyPending   : 1;    /**< TRUE: Printer has changed. At creation of
     458             :                                                 ::com::sun::star::sdbcx::View
     459             :                                                 notification of OLE-Objects PrtOLENotify() is required. */
     460             :     bool mbAllOLENotify          : 1;    ///< True: Notification of all objects is required.
     461             :     bool mbIsRedlineMove         : 1;    ///< True: Redlines are moved into to / out of the section.
     462             :     bool mbInsOnlyTxtGlssry      : 1;    ///< True: insert 'only text' glossary into doc
     463             :     bool mbContains_MSVBasic     : 1;    ///< True: MS-VBasic exist is in our storage
     464             :     bool mbPurgeOLE              : 1;    ///< sal_True: Purge OLE-Objects
     465             :     bool mbKernAsianPunctuation  : 1;    ///< sal_True: kerning also for ASIAN punctuation
     466             :     bool mbReadlineChecked       : 1;    ///< sal_True: if the query was already shown
     467             :     bool mbLinksUpdated          : 1;    /**< #i38810#
     468             :                                           flag indicating, that the links have been updated. */
     469             :     bool mbClipBoard             : 1;    ///< TRUE: this document represents the clipboard
     470             :     bool mbColumnSelection       : 1;    /**< TRUE: this content has bee created by a column selection
     471             :                                                 (clipboard docs only) */
     472             : 
     473             : #ifdef DBG_UTIL
     474             :     bool mbXMLExport : 1;                ///< sal_True: during XML export
     475             : #endif
     476             : 
     477             :     //
     478             :     // COMPATIBILITY FLAGS START
     479             :     //
     480             :     //
     481             :     // HISTORY OF THE COMPATIBILITY FLAGS:
     482             :     //
     483             :     // SO5:
     484             :     // mbParaSpaceMax                        def = sal_False, sal_True since SO8
     485             :     // mbParaSpaceMaxAtPages                 def = sal_False, sal_True since SO8
     486             :     //
     487             :     // SO6:
     488             :     // mbTabCompat                           def = sal_False, sal_True since SO8
     489             :     //
     490             :     // SO7:
     491             :     // mbUseVirtualDevice                    def = sal_True
     492             :     // mbAddFlyOffsets                       def = sal_False, hidden
     493             :     //
     494             :     // SO7pp1:
     495             :     // bOldNumbering                        def = sal_False, hidden
     496             :     //
     497             :     // SO8:
     498             :     // mbAddExternalLeading                  def = sal_True
     499             :     // mbUseHiResolutionVirtualDevice        def = sal_True, hidden
     500             :     // mbOldLineSpacing                      def = sal_False
     501             :     // mbAddParaSpacingToTableCells          def = sal_True
     502             :     // mbUseFormerObjectPos                  def = sal_False
     503             :     // mbUseFormerTextWrapping               def = sal_False
     504             :     // mbConsiderWrapOnObjPos                def = sal_False
     505             :     //
     506             :     // SO8pp1:
     507             :     // mbIgnoreFirstLineIndentInNumbering    def = sal_False, hidden
     508             :     // mbDoNotJustifyLinesWithManualBreak    def = sal_False, hidden
     509             :     // mbDoNotResetParaAttrsForNumFont       def = sal_False, hidden
     510             :     //
     511             :     // SO8pp3
     512             :     // mbDoNotCaptureDrawObjsOnPage         def = sal_False, hidden
     513             :     // - Relevant for drawing objects, which don't follow the text flow, but
     514             :     //   whose position is outside the page area:
     515             :     //   sal_False: Such drawing objects are captured on the page area of its anchor.
     516             :     //   sal_True: Such drawing objects can leave the page area, they aren't captured.
     517             :     // mbTableRowKeep                            def = sal_False, hidden
     518             :     // mbIgnoreTabsAndBlanksForLineCalculation   def = sal_False, hidden
     519             :     // mbClipAsCharacterAnchoredWriterFlyFrame   def = sal_False, hidden
     520             :     // - Introduced in order to re-activate clipping of as-character anchored
     521             :     //   Writer fly frames in method <SwFlyInCntFrm::MakeAll()> for documents,
     522             :     //   which are created with version prior SO8/OOo 2.0
     523             :     //
     524             :     // SO8pp4
     525             :     // mbUnixForceZeroExtLeading                def = sal_False, hidden
     526             :     //
     527             :     // SO8pu8
     528             :     // mbOldPrinterMetrics                      def = sal_False, hidden
     529             :     //
     530             :     // SO9
     531             :     // #i24363# tab stops relative to indent
     532             :     // mbTabRelativeToIndent                    def = sal_True, hidden
     533             :     // #i89181# suppress tab stop at left indent for paragraphs in lists, whose
     534             :     // list level position and space mode equals LABEL_ALIGNMENT and whose list
     535             :     // label is followed by a tab character.
     536             :     // mbTabAtLeftIndentForParagraphsInList     def = sal_False, hidden
     537             : 
     538             :     bool mbParaSpaceMax                     : 1;
     539             :     bool mbParaSpaceMaxAtPages              : 1;
     540             :     bool mbTabCompat                        : 1;
     541             :     bool mbUseVirtualDevice                 : 1;
     542             :     bool mbAddFlyOffsets                    : 1;
     543             :     bool mbAddExternalLeading               : 1;
     544             :     bool mbUseHiResolutionVirtualDevice     : 1;
     545             :     bool mbOldLineSpacing                   : 1;    // #i11859#
     546             :     bool mbAddParaSpacingToTableCells       : 1;
     547             :     bool mbUseFormerObjectPos               : 1;    // #i11860#
     548             :     bool mbUseFormerTextWrapping            : 1;
     549             :     bool mbConsiderWrapOnObjPos             : 1;    // #i28701#
     550             :                                                     // sal_True: object positioning algorithm has consider the wrapping style of                                                    //       the floating screen objects as given by its attribute 'WrapInfluenceOnObjPos'
     551             :                                                     // floating screen objects as given by its
     552             :                                                     // attribute 'WrapInfluenceOnObjPos'.
     553             :     bool mbMathBaselineAlignment            : 1;    // TL  2010-10-29 #i972#
     554             :     bool mbStylesNoDefault                  : 1;
     555             :     bool mbFloattableNomargins              : 1; ///< If paragraph margins next to a floating table should be ignored.
     556             :     bool mEmbedFonts                        : 1;  ///< Whether to embed fonts used by the document when saving.
     557             :     bool mEmbedSystemFonts                  : 1;  ///< Whether to embed also system fonts.
     558             : 
     559             :     // non-ui-compatibility flags:
     560             :     bool mbOldNumbering                             : 1;
     561             :     bool mbIgnoreFirstLineIndentInNumbering         : 1;   // #i47448#
     562             :     bool mbDoNotJustifyLinesWithManualBreak         : 1;   // #i49277#
     563             :     bool mbDoNotResetParaAttrsForNumFont            : 1;   // #i53199#
     564             :     bool mbTableRowKeep                             : 1;
     565             :     bool mbIgnoreTabsAndBlanksForLineCalculation    : 1;   // #i3952#
     566             :     bool mbDoNotCaptureDrawObjsOnPage               : 1;   // #i62875#
     567             :     bool mbOutlineLevelYieldsOutlineRule            : 1;
     568             :     bool mbClipAsCharacterAnchoredWriterFlyFrames   : 1;
     569             :     bool mbUnixForceZeroExtLeading                  : 1;   // #i60945#
     570             :     bool mbOldPrinterMetrics                        : 1;
     571             :     bool mbTabRelativeToIndent                      : 1;   // #i24363# tab stops relative to indent
     572             :     bool mbProtectForm                              : 1;
     573             :     bool mbInvertBorderSpacing                      : 1;
     574             :     bool mbCollapseEmptyCellPara                    : 1;
     575             :     bool mbTabAtLeftIndentForParagraphsInList;             // #i89181# - see above
     576             :     bool mbSmallCapsPercentage66;
     577             :     bool mbTabOverflow;
     578             :     bool mbUnbreakableNumberings;
     579             :     bool mbClippedPictures;
     580             :     bool mbBackgroundParaOverDrawings;
     581             : 
     582             :     bool mbLastBrowseMode                           : 1;
     583             : 
     584             :     sal_uInt32  n32DummyCompatabilityOptions1;
     585             :     sal_uInt32  n32DummyCompatabilityOptions2;
     586             :     //
     587             :     // COMPATIBILITY FLAGS END
     588             :     //
     589             : 
     590             :     bool mbStartIdleTimer;                    ///< idle timer mode start/stop
     591             : 
     592             :     bool mbSetDrawDefaults;                   ///< set draw pool defaults for freshly created documents
     593             : 
     594             :     static SwAutoCompleteWord *pACmpltWords;  ///< List of all words for AutoComplete
     595             : 
     596             :     //---------------- private methods ------------------------------
     597             :     void checkRedlining(RedlineMode_t& _rReadlineMode);
     598             : 
     599             : 
     600             :     DECL_LINK( AddDrawUndo, SdrUndoAction * );
     601             :                                         // DrawModel
     602             :     void DrawNotifyUndoHdl();           // Because of CLOOKs
     603             : 
     604             :     /** Only for internal use and therefore private.
     605             :      Copy a range within the same or to another document.
     606             :      Position may not lie within range! */
     607             :     bool CopyImpl( SwPaM&, SwPosition&, const bool MakeNewFrms /*= true */,
     608             :             const bool bCopyAll, SwPaM *const pCpyRng /*= 0*/ ) const;
     609             : 
     610             :     SwFlyFrmFmt* _MakeFlySection( const SwPosition& rAnchPos,
     611             :                                 const SwCntntNode& rNode, RndStdIds eRequestId,
     612             :                                 const SfxItemSet* pFlyAttrSet,
     613             :                                 SwFrmFmt* = 0 );
     614             : 
     615             :     SwFlyFrmFmt* _InsNoTxtNode( const SwPosition&rPos, SwNoTxtNode*,
     616             :                                 const SfxItemSet* pFlyAttrSet,
     617             :                                 const SfxItemSet* pGrfAttrSet,
     618             :                                 SwFrmFmt* = 0 );
     619             : 
     620             :     void CopyFlyInFlyImpl(  const SwNodeRange& rRg,
     621             :                             const xub_StrLen nEndContentIndex,
     622             :                             const SwNodeIndex& rStartIdx,
     623             :                             const bool bCopyFlyAtFly = false ) const;
     624             :     sal_Int8 SetFlyFrmAnchor( SwFrmFmt& rFlyFmt, SfxItemSet& rSet, bool bNewFrms );
     625             : 
     626             :     typedef SwFmt* (SwDoc:: *FNCopyFmt)( const String&, SwFmt*, bool, bool );
     627             :     SwFmt* CopyFmt( const SwFmt& rFmt, const SwFmtsBase& rFmtArr,
     628             :                         FNCopyFmt fnCopyFmt, const SwFmt& rDfltFmt );
     629             :     void CopyFmtArr( const SwFmtsBase& rSourceArr, SwFmtsBase& rDestArr,
     630             :                         FNCopyFmt fnCopyFmt, SwFmt& rDfltFmt );
     631             :     void CopyPageDescHeaderFooterImpl( bool bCpyHeader,
     632             :                                 const SwFrmFmt& rSrcFmt, SwFrmFmt& rDestFmt );
     633             :     SwFmt* FindFmtByName( const SwFmtsBase& rFmtArr,
     634             :                                     const String& rName ) const;
     635             : 
     636             :     VirtualDevice& CreateVirtualDevice_() const;
     637             :     SfxPrinter& CreatePrinter_() const;
     638             :     void        PrtDataChanged();   /**< Printer or JobSetup altered.
     639             :                                      Care has to be taken of the necessary
     640             :                                      invalidations and notifications. */
     641             : 
     642             :     /// gcc: aFtnInfo::CopyCtor is private, therefore we too have to protect ourselves.
     643             :     SwDoc( const SwDoc &);
     644             : 
     645             :     // For fields:
     646             :     void _InitFieldTypes();     ///< Called by CTOR!!
     647             :     void _MakeFldList( int eMode );
     648             : 
     649             :     /// Database fields:
     650             :     void UpdateDBNumFlds( SwDBNameInfField& rDBFld, SwCalc& rCalc );
     651             :     void AddUsedDBToList( std::vector<String>& rDBNameList,
     652             :                           const std::vector<String>& rUsedDBNames );
     653             :     void AddUsedDBToList( std::vector<String>& rDBNameList, const String& rDBName );
     654             :     bool IsNameInArray( const std::vector<String>& rOldNames, const String& rName );
     655             :     void GetAllDBNames( std::vector<String>& rAllDBNames );
     656             :     void ReplaceUsedDBs( const std::vector<String>& rUsedDBNames,
     657             :                         const String& rNewName, String& rFormel );
     658             :     std::vector<String>& FindUsedDBs( const std::vector<String>& rAllDBNames,
     659             :                                 const String& rFormel,
     660             :                                 std::vector<String>& rUsedDBNames );
     661             : 
     662             :     void InitDrawModel();
     663             :     void ReleaseDrawModel();
     664             : 
     665             :     void _CreateNumberFormatter();
     666             : 
     667             :     sal_Bool _UnProtectTblCells( SwTable& rTbl );
     668             : 
     669             :     /** Create sub-documents according to the given collection.
     670             :      If no collection is given, take chapter style of the 1st level. */
     671             :     bool SplitDoc( sal_uInt16 eDocType, const String& rPath, bool bOutline,
     672             :                         const SwTxtFmtColl* pSplitColl, int nOutlineLevel = 0 );
     673             : 
     674             :     /// Update charts of given table.
     675             :     void _UpdateCharts( const SwTable& rTbl, ViewShell& rVSh ) const;
     676             : 
     677             :     sal_Bool _SelectNextRubyChars( SwPaM& rPam, SwRubyListEntry& rRubyEntry,
     678             :                                 sal_uInt16 nMode );
     679             : 
     680             :     /// Our own 'IdleTimer' calls the following method
     681             :     DECL_LINK( DoIdleJobs, Timer * );
     682             :     /// CharTimer calls this method.
     683             :     void DoUpdateAllCharts();
     684             :     DECL_LINK( DoUpdateModifiedOLE, Timer * );
     685             : 
     686             :      SwFmt *_MakeCharFmt(const String &, SwFmt *, bool, bool );
     687             :      SwFmt *_MakeFrmFmt(const String &, SwFmt *, bool, bool );
     688             :      SwFmt *_MakeTxtFmtColl(const String &, SwFmt *, bool, bool );
     689             : 
     690             :      void InitTOXTypes();
     691             :      void   Paste( const SwDoc& );
     692             :      bool DeleteAndJoinImpl(SwPaM&, const bool);
     693             :      bool DeleteAndJoinWithRedlineImpl(SwPaM&, const bool unused = false);
     694             :      bool DeleteRangeImpl(SwPaM&, const bool unused = false);
     695             :      bool DeleteRangeImplImpl(SwPaM &);
     696             :      bool ReplaceRangeImpl(SwPaM&, String const&, const bool);
     697             : 
     698             : public:
     699             : 
     700             :     /** Life cycle
     701             :     */
     702             :     SwDoc();
     703             :     ~SwDoc();
     704             : 
     705       73840 :     inline bool IsInDtor() const { return mbDtor; }
     706             : 
     707             :     /* @@@MAINTAINABILITY-HORROR@@@
     708             :        Implementation details made public.
     709             :     */
     710      207618 :     SwNodes      & GetNodes()       { return *m_pNodes; }
     711       12612 :     SwNodes const& GetNodes() const { return *m_pNodes; }
     712             : 
     713             :     /** IInterface
     714             :     */
     715             :     virtual sal_Int32 acquire();
     716             :     virtual sal_Int32 release();
     717             :     virtual sal_Int32 getReferenceCount() const;
     718             : 
     719             :     /** IDocumentSettingAccess
     720             :     */
     721             :     virtual bool get(/*[in]*/ DocumentSettingId id) const;
     722             :     virtual void set(/*[in]*/ DocumentSettingId id, /*[in]*/ bool value);
     723             :     virtual const com::sun::star::i18n::ForbiddenCharacters* getForbiddenCharacters(/*[in]*/ sal_uInt16 nLang, /*[in]*/ bool bLocaleData ) const;
     724             :     virtual void setForbiddenCharacters(/*[in]*/ sal_uInt16 nLang, /*[in]*/ const com::sun::star::i18n::ForbiddenCharacters& rForbiddenCharacters );
     725             :     virtual rtl::Reference<SvxForbiddenCharactersTable>& getForbiddenCharacterTable();
     726             :     virtual const rtl::Reference<SvxForbiddenCharactersTable>& getForbiddenCharacterTable() const;
     727             :     virtual sal_uInt16 getLinkUpdateMode( /*[in]*/bool bGlobalSettings ) const;
     728             :     virtual void setLinkUpdateMode( /*[in]*/ sal_uInt16 nMode );
     729             :     virtual SwFldUpdateFlags getFieldUpdateFlags( /*[in]*/bool bGlobalSettings ) const;
     730             :     virtual void setFieldUpdateFlags( /*[in]*/ SwFldUpdateFlags eMode );
     731             :     virtual SwCharCompressType getCharacterCompressionType() const;
     732             :     virtual void setCharacterCompressionType( /*[in]*/SwCharCompressType nType );
     733             :     virtual sal_uInt32 getRsid() const;
     734             :     virtual void setRsid( sal_uInt32 nVal );
     735             :     virtual sal_uInt32 getRsidRoot() const;
     736             :     virtual void setRsidRoot( sal_uInt32 nVal );
     737             : 
     738             :     /** IDocumentDeviceAccess
     739             :     */
     740             :     virtual SfxPrinter* getPrinter(/*[in]*/ bool bCreate ) const;
     741             :     virtual void setPrinter(/*[in]*/ SfxPrinter* pP,/*[in]*/ bool bDeleteOld,/*[in]*/ bool bCallPrtDataChanged );
     742             :     virtual VirtualDevice* getVirtualDevice(/*[in]*/ bool bCreate ) const;
     743             :     virtual void setVirtualDevice(/*[in]*/ VirtualDevice* pVd,/*[in]*/ bool bDeleteOld, /*[in]*/ bool bCallVirDevDataChanged );
     744             :     virtual OutputDevice* getReferenceDevice(/*[in]*/ bool bCreate ) const;
     745             :     virtual void setReferenceDeviceType(/*[in]*/ bool bNewVirtual,/*[in]*/ bool bNewHiRes );
     746             :     virtual const JobSetup* getJobsetup() const;
     747             :     virtual void setJobsetup(/*[in]*/ const JobSetup& rJobSetup );
     748             :     virtual const SwPrintData & getPrintData() const;
     749             :     virtual void setPrintData(/*[in]*/ const SwPrintData& rPrtData);
     750             : 
     751             :     /** IDocumentMarkAccess
     752             :     */
     753             :     IDocumentMarkAccess* getIDocumentMarkAccess();
     754             :     const IDocumentMarkAccess* getIDocumentMarkAccess() const;
     755             : 
     756             :     /** IDocumentRedlineAccess
     757             :     */
     758             :     virtual RedlineMode_t GetRedlineMode() const;
     759             :     virtual void SetRedlineMode_intern(/*[in]*/RedlineMode_t eMode);
     760             :     virtual void SetRedlineMode(/*[in]*/RedlineMode_t eMode);
     761             :     virtual bool IsRedlineOn() const;
     762             :     virtual bool IsIgnoreRedline() const;
     763             :     virtual bool IsInRedlines(const SwNode& rNode) const;
     764             :     virtual const SwRedlineTbl& GetRedlineTbl() const;
     765             :     virtual bool AppendRedline(/*[in]*/SwRedline* pPtr, /*[in]*/bool bCallDelete);
     766             :     virtual bool SplitRedline(const SwPaM& rPam);
     767             :     virtual bool DeleteRedline(/*[in]*/const SwPaM& rPam, /*[in]*/bool bSaveInUndo, /*[in]*/sal_uInt16 nDelType);
     768             :     virtual bool DeleteRedline(/*[in]*/const SwStartNode& rSection, /*[in]*/bool bSaveInUndo, /*[in]*/sal_uInt16 nDelType);
     769             :     virtual sal_uInt16 GetRedlinePos(/*[in]*/const SwNode& rNode, /*[in]*/sal_uInt16 nType) const;
     770             :     virtual void CompressRedlines();
     771             :     virtual const SwRedline* GetRedline(/*[in]*/const SwPosition& rPos, /*[in]*/sal_uInt16* pFndPos) const;
     772             :     virtual bool IsRedlineMove() const;
     773             :     virtual void SetRedlineMove(/*[in]*/bool bFlag);
     774             :     virtual bool AcceptRedline(/*[in]*/sal_uInt16 nPos, /*[in]*/bool bCallDelete);
     775             :     virtual bool AcceptRedline(/*[in]*/const SwPaM& rPam, /*[in]*/bool bCallDelete);
     776             :     virtual bool RejectRedline(/*[in]*/sal_uInt16 nPos, /*[in]*/bool bCallDelete);
     777             :     virtual bool RejectRedline(/*[in]*/const SwPaM& rPam, /*[in]*/bool bCallDelete);
     778             :     virtual const SwRedline* SelNextRedline(/*[in]*/SwPaM& rPam) const;
     779             :     virtual const SwRedline* SelPrevRedline(/*[in]*/SwPaM& rPam) const;
     780             :     virtual void UpdateRedlineAttr();
     781             :     virtual sal_uInt16 GetRedlineAuthor();
     782             :     virtual sal_uInt16 InsertRedlineAuthor(const String& rAuthor);
     783             :     virtual bool SetRedlineComment(/*[in]*/const SwPaM& rPam, /*[in]*/const String& rComment);
     784             :     virtual const ::com::sun::star::uno::Sequence <sal_Int8>& GetRedlinePassword() const;
     785             :     virtual void SetRedlinePassword(/*[in]*/const ::com::sun::star::uno::Sequence <sal_Int8>& rNewPassword);
     786             : 
     787             :     /** IDocumentUndoRedo
     788             :     */
     789             :     IDocumentUndoRedo      & GetIDocumentUndoRedo();
     790             :     IDocumentUndoRedo const& GetIDocumentUndoRedo() const;
     791             : 
     792             :     /** IDocumentLinksAdministration
     793             :     */
     794             :     virtual bool IsVisibleLinks() const;
     795             :     virtual void SetVisibleLinks(bool bFlag);
     796             :     virtual sfx2::LinkManager& GetLinkManager();
     797             :     virtual const sfx2::LinkManager& GetLinkManager() const;
     798             :     virtual void UpdateLinks(bool bUI);
     799             :     virtual bool GetData(const rtl::OUString& rItem, const String& rMimeType, ::com::sun::star::uno::Any& rValue) const;
     800             :     virtual bool SetData(const rtl::OUString& rItem, const String& rMimeType, const ::com::sun::star::uno::Any& rValue);
     801             :     virtual ::sfx2::SvLinkSource* CreateLinkSource(const rtl::OUString& rItem);
     802             :     virtual bool EmbedAllLinks();
     803             :     virtual void SetLinksUpdated(const bool bNewLinksUpdated);
     804             :     virtual bool LinksUpdated() const;
     805             : 
     806             :     /** IDocumentFieldsAccess
     807             :     */
     808             :     virtual const SwFldTypes *GetFldTypes() const;
     809             :     virtual SwFieldType *InsertFldType(const SwFieldType &);
     810             :     virtual SwFieldType *GetSysFldType( const sal_uInt16 eWhich ) const;
     811             :     virtual SwFieldType* GetFldType(sal_uInt16 nResId, const String& rName, bool bDbFieldMatching) const;
     812             :     virtual void RemoveFldType(sal_uInt16 nFld);
     813             :     virtual void UpdateFlds( SfxPoolItem* pNewHt, bool bCloseDB);
     814             :     virtual void InsDeletedFldType(SwFieldType &);
     815             :     virtual bool PutValueToField(const SwPosition & rPos, const com::sun::star::uno::Any& rVal, sal_uInt16 nWhich);
     816             :     virtual bool UpdateFld(SwTxtFld * rDstFmtFld, SwField & rSrcFld, SwMsgPoolItem * pMsgHnt, bool bUpdateTblFlds);
     817             :     virtual void UpdateRefFlds(SfxPoolItem* pHt);
     818             :     virtual void UpdateTblFlds(SfxPoolItem* pHt);
     819             :     virtual void UpdateExpFlds(SwTxtFld* pFld, bool bUpdateRefFlds);
     820             :     virtual void UpdateUsrFlds();
     821             :     virtual void UpdatePageFlds(SfxPoolItem*);
     822             :     virtual void LockExpFlds();
     823             :     virtual void UnlockExpFlds();
     824             :     virtual bool IsExpFldsLocked() const;
     825             :     virtual SwDocUpdtFld& GetUpdtFlds() const;
     826             :     virtual bool SetFieldsDirty(bool b, const SwNode* pChk, sal_uLong nLen);
     827             :     virtual void SetFixFields(bool bOnlyTimeDate, const DateTime* pNewDateTime);
     828             :     virtual void FldsToCalc(SwCalc& rCalc, sal_uLong nLastNd, sal_uInt16 nLastCnt);
     829             :     virtual void FldsToCalc(SwCalc& rCalc, const _SetGetExpFld& rToThisFld);
     830             :     virtual void FldsToExpand(SwHash**& ppTbl, sal_uInt16& rTblSize, const _SetGetExpFld& rToThisFld);
     831             :     virtual bool IsNewFldLst() const;
     832             :     virtual void SetNewFldLst( bool bFlag);
     833             :     virtual void InsDelFldInFldLst(bool bIns, const SwTxtFld& rFld);
     834             : 
     835             :     /** Returns the field at a certain position.
     836             :        @param rPos position to search at
     837             :        @return pointer to field at the given position or NULL in case no field is found
     838             :     */
     839             :     static SwField* GetField(const SwPosition& rPos);
     840             : 
     841             :     /** Returns the field at a certain position.
     842             :        @param rPos position to search at
     843             :        @return pointer to field at the given position or NULL in case no field is found
     844             :     */
     845             :     static SwTxtFld* GetTxtFld(const SwPosition& rPos);
     846             :     bool containsUpdatableFields();
     847             : 
     848             :     /** IDocumentContentOperations
     849             :     */
     850             :     virtual bool CopyRange(SwPaM&, SwPosition&, const bool bCopyAll) const;
     851             :     virtual void DeleteSection(SwNode* pNode);
     852             :     virtual bool DeleteRange(SwPaM&);
     853             :     virtual bool DelFullPara(SwPaM&);
     854             :     // Add optional parameter <bForceJoinNext>, default value <false>
     855             :     // Needed for hiding of deletion redlines
     856             :     virtual bool DeleteAndJoin( SwPaM&,
     857             :                                 const bool bForceJoinNext = false );
     858             : 
     859             :     virtual bool MoveRange(SwPaM&, SwPosition&, SwMoveFlags);
     860             :     virtual bool MoveNodeRange(SwNodeRange&, SwNodeIndex&, SwMoveFlags);
     861             :     virtual bool MoveAndJoin(SwPaM&, SwPosition&, SwMoveFlags);
     862             :     virtual bool Overwrite(const SwPaM &rRg, const String& rStr);
     863             :     virtual bool InsertString(const SwPaM &rRg, const String&,
     864             :               const enum InsertFlags nInsertMode = INS_EMPTYEXPAND );
     865             :     virtual bool UpdateRsid( SwTxtNode *pTxtNode, xub_StrLen nStt, xub_StrLen nEnd );
     866             :     virtual bool UpdateParRsid( SwTxtNode *pTxtNode, sal_uInt32 nVal = 0 );
     867             :     virtual bool UpdateRsid( const SwPaM &rRg, xub_StrLen nLen );
     868             :     virtual SwFlyFrmFmt* Insert(const SwPaM &rRg, const String& rGrfName, const String& rFltName, const Graphic* pGraphic,
     869             :                         const SfxItemSet* pFlyAttrSet, const SfxItemSet* pGrfAttrSet, SwFrmFmt*);
     870             :     virtual SwFlyFrmFmt* Insert(const SwPaM& rRg, const GraphicObject& rGrfObj, const SfxItemSet* pFlyAttrSet,
     871             :                         const SfxItemSet* pGrfAttrSet, SwFrmFmt*);
     872             :     virtual SwDrawFrmFmt* Insert(const SwPaM &rRg, SdrObject& rDrawObj, const SfxItemSet* pFlyAttrSet, SwFrmFmt*);
     873             :     virtual SwFlyFrmFmt* Insert(const SwPaM &rRg, const svt::EmbeddedObjectRef& xObj, const SfxItemSet* pFlyAttrSet,
     874             :                         const SfxItemSet* pGrfAttrSet, SwFrmFmt*);
     875             :     virtual bool InsertPoolItem(const SwPaM &rRg, const SfxPoolItem&,
     876             :                                 const SetAttrMode nFlags);
     877             :     virtual bool InsertItemSet (const SwPaM &rRg, const SfxItemSet&,
     878             :                                 const SetAttrMode nFlags);
     879             :     virtual void ReRead(SwPaM&, const String& rGrfName, const String& rFltName, const Graphic* pGraphic, const GraphicObject* pGrfObj);
     880             :     virtual void TransliterateText(const SwPaM& rPaM, utl::TransliterationWrapper&);
     881             :     virtual SwFlyFrmFmt* InsertOLE(const SwPaM &rRg, const String& rObjName, sal_Int64 nAspect, const SfxItemSet* pFlyAttrSet,
     882             :                            const SfxItemSet* pGrfAttrSet, SwFrmFmt*);
     883             :     virtual bool SplitNode(const SwPosition &rPos, bool bChkTableStart);
     884             :     virtual bool AppendTxtNode(SwPosition& rPos);
     885             :         virtual void SetModified(SwPaM &rPaM);
     886             :     virtual bool ReplaceRange(SwPaM& rPam, const String& rNewStr,
     887             :                               const bool bRegExReplace);
     888             :     virtual void RemoveLeadingWhiteSpace(const SwPosition & rPos );
     889             : 
     890             :     /** IDocumentStylePoolAccess
     891             :     */
     892             :     virtual SwTxtFmtColl* GetTxtCollFromPool( sal_uInt16 nId, bool bRegardLanguage = true );
     893             :     virtual SwFmt* GetFmtFromPool( sal_uInt16 nId );
     894             :     virtual SwFrmFmt* GetFrmFmtFromPool( sal_uInt16 nId );
     895             :     virtual SwCharFmt* GetCharFmtFromPool( sal_uInt16 nId );
     896             :     virtual SwPageDesc* GetPageDescFromPool( sal_uInt16 nId, bool bRegardLanguage = true );
     897             :     virtual SwNumRule* GetNumRuleFromPool( sal_uInt16 nId );
     898             :     virtual bool IsPoolTxtCollUsed( sal_uInt16 nId ) const;
     899             :     virtual bool IsPoolFmtUsed( sal_uInt16 nId ) const;
     900             :     virtual bool IsPoolPageDescUsed( sal_uInt16 nId ) const;
     901             : 
     902             :     /** IDocumentLineNumberAccess
     903             :     */
     904             :     virtual const SwLineNumberInfo& GetLineNumberInfo() const;
     905             :     virtual void SetLineNumberInfo(const SwLineNumberInfo& rInfo);
     906             : 
     907             :     /** IDocumentStatistics
     908             :     */
     909             :     virtual void DocInfoChgd();
     910             :     virtual const SwDocStat &GetDocStat() const;
     911             :     virtual const SwDocStat &GetUpdatedDocStat();
     912             :     virtual void SetDocStat(const SwDocStat& rStat);
     913             :     virtual void UpdateDocStat();
     914             : 
     915             :     /** IDocumentState
     916             :     */
     917             :     virtual void SetModified();
     918             :     virtual void ResetModified();
     919             :     virtual bool IsModified() const;
     920             :     virtual bool IsLoaded() const;
     921             :     virtual bool IsUpdateExpFld() const;
     922             :     virtual bool IsNewDoc() const;
     923             :     virtual bool IsPageNums() const;
     924             :     virtual void SetPageNums(bool b);
     925             :     virtual void SetNewDoc(bool b);
     926             :     virtual void SetUpdateExpFldStat(bool b);
     927             :     virtual void SetLoaded(bool b);
     928             : 
     929             :     /** IDocumentDrawModelAccess
     930             :     */
     931             :     virtual const SdrModel* GetDrawModel() const;
     932             :     virtual SdrModel* GetDrawModel();
     933             :     virtual SdrLayerID GetHeavenId() const;
     934             :     virtual SdrLayerID GetHellId() const;
     935             :     virtual SdrLayerID GetControlsId() const;
     936             :     virtual SdrLayerID GetInvisibleHeavenId() const;
     937             :     virtual SdrLayerID GetInvisibleHellId() const;
     938             :     virtual SdrLayerID GetInvisibleControlsId() const;
     939             :     virtual void NotifyInvisibleLayers( SdrPageView& _rSdrPageView );
     940             :     virtual bool IsVisibleLayerId( const SdrLayerID& _nLayerId ) const;
     941             :     virtual SdrLayerID GetVisibleLayerIdByInvisibleOne( const SdrLayerID& _nInvisibleLayerId );
     942             :     virtual SdrLayerID GetInvisibleLayerIdByVisibleOne( const SdrLayerID& _nVisibleLayerId );
     943             :     virtual SdrModel* _MakeDrawModel();
     944             :     virtual SdrModel* GetOrCreateDrawModel();
     945             : 
     946             :     /** IDocumentLayoutAccess
     947             :     */
     948             :     virtual void SetCurrentViewShell( ViewShell* pNew );//swmod 071225
     949             :     virtual SwLayouter* GetLayouter();
     950             :     virtual const SwLayouter* GetLayouter() const;
     951             :     virtual void SetLayouter( SwLayouter* pNew );
     952             :     virtual SwFrmFmt* MakeLayoutFmt( RndStdIds eRequest, const SfxItemSet* pSet );
     953             :     virtual void DelLayoutFmt( SwFrmFmt *pFmt );
     954             :     virtual SwFrmFmt* CopyLayoutFmt( const SwFrmFmt& rSrc, const SwFmtAnchor& rNewAnchor, bool bSetTxtFlyAtt, bool bMakeFrms );
     955             :     virtual const ViewShell *GetCurrentViewShell() const;   //swmod 080219
     956             :     virtual ViewShell *GetCurrentViewShell(); ///< swmod 080219 It must be able to communicate to a ViewShell.This is going to be removerd later.
     957             :     virtual const SwRootFrm *GetCurrentLayout() const;
     958             :     virtual SwRootFrm *GetCurrentLayout();//swmod 080219
     959             :     virtual bool HasLayout() const;
     960             :     void ClearSwLayouterEntries();
     961             : 
     962             :     /** IDocumentTimerAccess
     963             :     */
     964             :     virtual void StartIdling();
     965             :     virtual void StopIdling();
     966             :     virtual void BlockIdling();
     967             :     virtual void UnblockIdling();
     968             :     virtual void StartBackgroundJobs();
     969             : 
     970             :     /** IDocumentChartDataProviderAccess
     971             :     */
     972             :     virtual SwChartDataProvider * GetChartDataProvider( bool bCreate = false ) const;
     973             :     virtual void CreateChartInternalDataProviders( const SwTable *pTable );
     974             :     virtual SwChartLockController_Helper & GetChartControllerHelper();
     975             : 
     976             :     /** IDocumentListItems
     977             :     */
     978             :     virtual void addListItem( const SwNodeNum& rNodeNum );
     979             :     virtual void removeListItem( const SwNodeNum& rNodeNum );
     980             :     virtual String getListItemText( const SwNodeNum& rNodeNum,
     981             :                                     const bool bWithNumber = true,
     982             :                                     const bool bWithSpacesForLevel = false ) const;
     983             :     virtual void getListItems( IDocumentListItems::tSortedNodeNumList& orNodeNumList ) const;
     984             :     virtual void getNumItems( IDocumentListItems::tSortedNodeNumList& orNodeNumList ) const;
     985             : 
     986             :     /** IDocumentOutlineNodes
     987             :     */
     988             :     virtual sal_Int32 getOutlineNodesCount() const;
     989             :     virtual int getOutlineLevel( const sal_Int32 nIdx ) const;
     990             :     virtual String getOutlineText( const sal_Int32 nIdx,
     991             :                                    const bool bWithNumber,
     992             :                                    const bool bWithSpacesForLevel ) const;
     993             :     virtual SwTxtNode* getOutlineNode( const sal_Int32 nIdx ) const;
     994             :     virtual void getOutlineNodes( IDocumentOutlineNodes::tSortedOutlineNodeList& orOutlineNodeList ) const;
     995             : 
     996             :     /** IDocumentListsAccess
     997             :     */
     998             :     virtual SwList* createList( String sListId,
     999             :                                 const String sDefaultListStyleName );
    1000             :     virtual void deleteList( const String sListId );
    1001             :     virtual SwList* getListByName( const String sListId ) const;
    1002             :     virtual SwList* createListForListStyle( const String sListStyleName );
    1003             :     virtual SwList* getListForListStyle( const String sListStyleName ) const;
    1004             :     virtual void deleteListForListStyle( const String sListStyleName );
    1005             :     virtual void trackChangeOfListStyleName( const String sListStyleName,
    1006             :                                              const String sNewListStyleName );
    1007             : 
    1008             :     /** IDocumentExternalData */
    1009             :     virtual void setExternalData(::sw::tExternalDataType eType,
    1010             :                                  ::sw::tExternalDataPointer pPayload);
    1011             :     virtual ::sw::tExternalDataPointer getExternalData(::sw::tExternalDataType eType);
    1012             : 
    1013             :     /** INextInterface here
    1014             :     */
    1015             : 
    1016             :     DECL_STATIC_LINK( SwDoc, BackgroundDone, SvxBrushItem *);
    1017             :     DECL_LINK(CalcFieldValueHdl, EditFieldInfo*);
    1018             : 
    1019             :     /** OLE ???
    1020             :     */
    1021         576 :     bool IsOLEPrtNotifyPending() const  { return mbOLEPrtNotifyPending; }
    1022             :     inline void SetOLEPrtNotifyPending( bool bSet = true );
    1023             :     void PrtOLENotify( sal_Bool bAll ); //All or only marked
    1024             : 
    1025             : #ifdef DBG_UTIL
    1026             :     bool InXMLExport() const            { return mbXMLExport; }
    1027             :     void SetXMLExport( bool bFlag )     { mbXMLExport = bFlag; }
    1028             : #endif
    1029             : 
    1030             :     /** Returns positions of all FlyFrames in the document.
    1031             :      If a Pam-Pointer is passed the FlyFrames attached to paragraphes
    1032             :      have to be surrounded completely by ::com::sun::star::awt::Selection.
    1033             :      ( Start < Pos < End ) !!!
    1034             :      (Required for Writers.) */
    1035             :     void GetAllFlyFmts( SwPosFlyFrms& rPosFlyFmts, const SwPaM* = 0,
    1036             :                         bool bDrawAlso = false,
    1037             :                         bool bAsCharAlso = false ) const;
    1038             : 
    1039             :     /// Because swrtf.cxx and define private public here now.
    1040             :     SwFlyFrmFmt  *MakeFlyFrmFmt (const String &rFmtName, SwFrmFmt *pDerivedFrom);
    1041             :     SwDrawFrmFmt *MakeDrawFrmFmt(const String &rFmtName, SwFrmFmt *pDerivedFrom);
    1042             : 
    1043             :     // From now on this interface has to be used for Flys.
    1044             :     // pAnchorPos must be set, if they are not attached to pages AND
    1045             :     // ::com::sun::star::chaos::Anchor is not already set at valid CntntPos
    1046             :     // in FlySet/FrmFmt.
    1047             :     /* new parameter bCalledFromShell
    1048             : 
    1049             :        sal_True: An existing adjust item at pAnchorPos is propagated to
    1050             :        the content node of the new fly section. That propagation only
    1051             :        takes place if there is no adjust item in the paragraph style
    1052             :        for the new fly section.
    1053             : 
    1054             :        sal_False: no propagation
    1055             :     */
    1056             :     SwFlyFrmFmt* MakeFlySection( RndStdIds eAnchorType,
    1057             :                                  const SwPosition* pAnchorPos,
    1058             :                                  const SfxItemSet* pSet = 0,
    1059             :                                  SwFrmFmt *pParent = 0,
    1060             :                                  bool bCalledFromShell = false );
    1061             :     SwFlyFrmFmt* MakeFlyAndMove( const SwPaM& rPam, const SfxItemSet& rSet,
    1062             :                                 const SwSelBoxes* pSelBoxes = 0,
    1063             :                                 SwFrmFmt *pParent = 0 );
    1064             : 
    1065             :     void CopyWithFlyInFly( const SwNodeRange& rRg,
    1066             :                             const xub_StrLen nEndContentIndex,
    1067             :                             const SwNodeIndex& rInsPos,
    1068             :                             sal_Bool bMakeNewFrms = sal_True,
    1069             :                             sal_Bool bDelRedlines = sal_True,
    1070             :                             sal_Bool bCopyFlyAtFly = sal_False ) const;
    1071             : 
    1072             :     bool SetFlyFrmAttr( SwFrmFmt& rFlyFmt, SfxItemSet& rSet );
    1073             : 
    1074             :     bool SetFrmFmtToFly( SwFrmFmt& rFlyFmt, SwFrmFmt& rNewFmt,
    1075             :                         SfxItemSet* pSet = 0, bool bKeepOrient = false );
    1076             :     void SetFlyFrmTitle( SwFlyFrmFmt& rFlyFrmFmt,
    1077             :                          const String& sNewTitle );
    1078             :     void SetFlyFrmDescription( SwFlyFrmFmt& rFlyFrmFmt,
    1079             :                                const String& sNewDescription );
    1080             : 
    1081             :     /** Footnotes
    1082             :     */
    1083             :     // Footnote information
    1084        1108 :     const SwFtnInfo& GetFtnInfo() const         { return *pFtnInfo; }
    1085             :     void SetFtnInfo(const SwFtnInfo& rInfo);
    1086         471 :     const SwEndNoteInfo& GetEndNoteInfo() const { return *pEndNoteInfo; }
    1087             :     void SetEndNoteInfo(const SwEndNoteInfo& rInfo);
    1088        2448 :           SwFtnIdxs& GetFtnIdxs()       { return *pFtnIdxs; }
    1089           5 :     const SwFtnIdxs& GetFtnIdxs() const { return *pFtnIdxs; }
    1090             :     /// change footnotes in area
    1091             :     bool SetCurFtn( const SwPaM& rPam, const String& rNumStr,
    1092             :                     sal_uInt16 nNumber, bool bIsEndNote );
    1093             : 
    1094             :     /** Operations on the content of the document e.g.
    1095             :         spell-checking/hyphenating/word-counting
    1096             :     */
    1097             :     ::com::sun::star::uno::Any
    1098             :             Spell( SwPaM&, ::com::sun::star::uno::Reference<
    1099             :                             ::com::sun::star::linguistic2::XSpellChecker1 > &,
    1100             :                    sal_uInt16* pPageCnt, sal_uInt16* pPageSt, bool bGrammarCheck,
    1101             :                    SwConversionArgs *pConvArgs = 0 ) const;
    1102             : 
    1103             :     ::com::sun::star::uno::Reference<
    1104             :         ::com::sun::star::linguistic2::XHyphenatedWord >
    1105             :             Hyphenate( SwPaM *pPam, const Point &rCrsrPos,
    1106             :                          sal_uInt16* pPageCnt, sal_uInt16* pPageSt );
    1107             : 
    1108             :     /// count words in pam
    1109             :     void CountWords( const SwPaM& rPaM, SwDocStat& rStat ) const;
    1110             : 
    1111             :     /// Glossary Document
    1112             :     void SetGlossDoc( bool bGlssDc = true ) { mbGlossDoc = bGlssDc; }
    1113         229 :     bool IsInsOnlyTextGlossary() const      { return mbInsOnlyTxtGlssry; }
    1114             : 
    1115             :     void Summary( SwDoc* pExtDoc, sal_uInt8 nLevel, sal_uInt8 nPara, bool bImpress );
    1116             : 
    1117             :     void ChangeAuthorityData(const SwAuthEntry* pNewData);
    1118             : 
    1119        3303 :     bool IsInCallModified() const      { return mbInCallModified; }
    1120             :     bool IsInHeaderFooter( const SwNodeIndex& rIdx ) const;
    1121             :     short GetTextDirection( const SwPosition& rPos,
    1122             :                             const Point* pPt = 0 ) const;
    1123             :     bool IsInVerticalText( const SwPosition& rPos,
    1124             :                                const Point* pPt = 0 ) const;
    1125             : 
    1126             :     /** Database  and DB-Manager
    1127             :     */
    1128           0 :     void SetNewDBMgr( SwNewDBMgr* pNewMgr )     { pNewDBMgr = pNewMgr; }
    1129          94 :     SwNewDBMgr* GetNewDBMgr() const             { return pNewDBMgr; }
    1130             :     void ChangeDBFields( const std::vector<String>& rOldNames,
    1131             :                         const String& rNewName );
    1132             :     void SetInitDBFields(sal_Bool b);
    1133             : 
    1134             :     /// Find out which databases are used by fields.
    1135             :     void GetAllUsedDB( std::vector<String>& rDBNameList,
    1136             :                        const std::vector<String>* pAllDBNames = 0 );
    1137             : 
    1138             :     void ChgDBData( const SwDBData& rNewData );
    1139             :     SwDBData GetDBData();
    1140             :     const SwDBData& GetDBDesc();
    1141             :     const SwDBData& _GetDBDesc() const { return aDBData; }
    1142             : 
    1143             :     /** Some helper functions
    1144             :     */
    1145             :     String GetUniqueGrfName() const;
    1146             :     String GetUniqueOLEName() const;
    1147             :     String GetUniqueFrameName() const;
    1148             : 
    1149             :     std::set<SwRootFrm*> GetAllLayouts();//swmod 080225
    1150             : 
    1151             :     void SetFlyName( SwFlyFrmFmt& rFmt, const String& rName );
    1152             :     const SwFlyFrmFmt* FindFlyByName( const String& rName, sal_Int8 nNdTyp = 0 ) const;
    1153             : 
    1154             :     void GetGrfNms( const SwFlyFrmFmt& rFmt, String* pGrfName,
    1155             :                     String* pFltName ) const;
    1156             : 
    1157             :     /// Set a valid name for all Flys that have none (Called by Readers after reading).
    1158             :     void SetAllUniqueFlyNames();
    1159             : 
    1160             :     /** Reset attributes. All TxtHints and (if completely selected) all hard-
    1161             :      formated stuff (auto-formats) are removed.
    1162             :      Introduce new optional parameter <bSendDataChangedEvents> in order to
    1163             :      control, if the side effect "send data changed events" is triggered or not. */
    1164             :     void ResetAttrs( const SwPaM &rRg,
    1165             :                      bool bTxtAttr = true,
    1166             :                      const std::set<sal_uInt16> &rAttrs = std::set<sal_uInt16>(),
    1167             :                      const bool bSendDataChangedEvents = true );
    1168             :     void RstTxtAttrs(const SwPaM &rRg, bool bInclRefToxMark = false );
    1169             : 
    1170             :     /** Set attribute in given format.
    1171             :      If Undo is activated, the old one is listed in Undo-History. */
    1172             :     void SetAttr( const SfxPoolItem&, SwFmt& );
    1173             :     void SetAttr( const SfxItemSet&, SwFmt& );
    1174             : 
    1175             :     /// method to reset a certain attribute at the given format
    1176             :     void ResetAttrAtFormat( const sal_uInt16 nWhichId,
    1177             :                             SwFmt& rChangedFormat );
    1178             : 
    1179             :     /** Set attribute as new default attribute in current document.
    1180             :      If Undo is activated, the old one is listed in Undo-History. */
    1181             :     void SetDefault( const SfxPoolItem& );
    1182             :     void SetDefault( const SfxItemSet& );
    1183             : 
    1184             :     /// Query default attribute in this document.
    1185             :     const SfxPoolItem& GetDefault( sal_uInt16 nFmtHint ) const;
    1186             : 
    1187             :     /// Do not expand text attributes.
    1188             :     bool DontExpandFmt( const SwPosition& rPos, bool bFlag = true );
    1189             : 
    1190             :     /* Formats */
    1191           0 :     const SwFrmFmts* GetFrmFmts() const     { return pFrmFmtTbl; }
    1192          21 :           SwFrmFmts* GetFrmFmts()           { return pFrmFmtTbl; }
    1193        1509 :     const SwCharFmts* GetCharFmts() const   { return pCharFmtTbl;}
    1194             : 
    1195             :     /** LayoutFormats (frames, DrawObjects), sometimes const sometimes not */
    1196         563 :     const SwFrmFmts* GetSpzFrmFmts() const   { return pSpzFrmFmtTbl; }
    1197        5343 :           SwFrmFmts* GetSpzFrmFmts()         { return pSpzFrmFmtTbl; }
    1198             : 
    1199             :     const SwFrmFmt *GetDfltFrmFmt() const   { return pDfltFrmFmt; }
    1200        1583 :           SwFrmFmt *GetDfltFrmFmt()         { return pDfltFrmFmt; }
    1201             :     const SwFrmFmt *GetEmptyPageFmt() const { return pEmptyPageFmt; }
    1202         269 :           SwFrmFmt *GetEmptyPageFmt()       { return pEmptyPageFmt; }
    1203             :     const SwFrmFmt *GetColumnContFmt() const{ return pColumnContFmt; }
    1204           2 :           SwFrmFmt *GetColumnContFmt()      { return pColumnContFmt; }
    1205           0 :     const SwCharFmt *GetDfltCharFmt() const { return pDfltCharFmt;}
    1206       13722 :           SwCharFmt *GetDfltCharFmt()       { return pDfltCharFmt;}
    1207             : 
    1208             :     /// @return the interface of the management of (auto)styles
    1209       35136 :     IStyleAccess& GetIStyleAccess() { return *pStyleAccess; }
    1210             : 
    1211             :     /// Remove all language dependencies from all existing formats
    1212             :     void RemoveAllFmtLanguageDependencies();
    1213             : 
    1214             :     SwFrmFmt  *MakeFrmFmt(const String &rFmtName, SwFrmFmt *pDerivedFrom,
    1215             :                           bool bBroadcast = false, bool bAuto = true);
    1216             :     void       DelFrmFmt( SwFrmFmt *pFmt, bool bBroadcast = false );
    1217         338 :     SwFrmFmt* FindFrmFmtByName( const String& rName ) const
    1218         338 :         {   return (SwFrmFmt*)FindFmtByName( (SwFmtsBase&)*pFrmFmtTbl, rName ); }
    1219             : 
    1220             :     SwCharFmt *MakeCharFmt(const String &rFmtName, SwCharFmt *pDerivedFrom,
    1221             :                            bool bBroadcast = false,
    1222             :                            bool bAuto = true );
    1223             :     void       DelCharFmt(sal_uInt16 nFmt, bool bBroadcast = false);
    1224             :     void       DelCharFmt(SwCharFmt* pFmt, bool bBroadcast = false);
    1225        4727 :     SwCharFmt* FindCharFmtByName( const String& rName ) const
    1226        4727 :         {   return (SwCharFmt*)FindFmtByName( (SwFmtsBase&)*pCharFmtTbl, rName ); }
    1227             : 
    1228             :     /* Formatcollections (styles) */
    1229             :     // TXT
    1230         100 :     const SwTxtFmtColl* GetDfltTxtFmtColl() const { return pDfltTxtFmtColl; }
    1231        2742 :     const SwTxtFmtColls *GetTxtFmtColls() const { return pTxtFmtCollTbl; }
    1232             :     SwTxtFmtColl *MakeTxtFmtColl( const String &rFmtName,
    1233             :                                   SwTxtFmtColl *pDerivedFrom,
    1234             :                                   bool bBroadcast = false,
    1235             :                                   bool bAuto = true );
    1236             :     SwConditionTxtFmtColl* MakeCondTxtFmtColl( const String &rFmtName,
    1237             :                                                SwTxtFmtColl *pDerivedFrom,
    1238             :                                                bool bBroadcast = false);
    1239             :     void DelTxtFmtColl(sal_uInt16 nFmt, bool bBroadcast = false);
    1240             :     void DelTxtFmtColl( SwTxtFmtColl* pColl, bool bBroadcast = false );
    1241             :     /** Add 4th optional parameter <bResetListAttrs>.
    1242             :      'side effect' of <SetTxtFmtColl> with <bReset = true> is that the hard
    1243             :      attributes of the affected text nodes are cleared, except the break
    1244             :      attribute, the page description attribute and the list style attribute.
    1245             :      The new parameter <bResetListAttrs> indicates, if the list attributes
    1246             :      (list style, restart at and restart with) are cleared as well in case
    1247             :      that <bReset = true> and the paragraph style has a list style attribute set. */
    1248             :     bool SetTxtFmtColl( const SwPaM &rRg, SwTxtFmtColl *pFmt,
    1249             :                             bool bReset = true,
    1250             :                             bool bResetListAttrs = false );
    1251       28784 :     SwTxtFmtColl* FindTxtFmtCollByName( const String& rName ) const
    1252       28784 :         {   return (SwTxtFmtColl*)FindFmtByName( (SwFmtsBase&)*pTxtFmtCollTbl, rName ); }
    1253             : 
    1254             :     void ChkCondColls();
    1255             : 
    1256           4 :     const SwGrfFmtColl* GetDfltGrfFmtColl() const   { return pDfltGrfFmtColl; }
    1257           0 :     const SwGrfFmtColls *GetGrfFmtColls() const     { return pGrfFmtCollTbl; }
    1258             :     SwGrfFmtColl *MakeGrfFmtColl(const String &rFmtName,
    1259             :                                     SwGrfFmtColl *pDerivedFrom);
    1260           1 :     SwGrfFmtColl* FindGrfFmtCollByName( const String& rName ) const
    1261           1 :         {   return (SwGrfFmtColl*)FindFmtByName( (SwFmtsBase&)*pGrfFmtCollTbl, rName ); }
    1262             : 
    1263             :     /// Table formating
    1264             :     const SwFrmFmts* GetTblFrmFmts() const  { return pTblFrmFmtTbl; }
    1265         321 :           SwFrmFmts* GetTblFrmFmts()        { return pTblFrmFmtTbl; }
    1266             :     sal_uInt16 GetTblFrmFmtCount( bool bUsed ) const;
    1267             :     SwFrmFmt& GetTblFrmFmt(sal_uInt16 nFmt, bool bUsed ) const;
    1268             :     SwTableFmt* MakeTblFrmFmt(const String &rFmtName, SwFrmFmt *pDerivedFrom);
    1269             :     void        DelTblFrmFmt( SwTableFmt* pFmt );
    1270             :     SwTableFmt* FindTblFmtByName( const String& rName, sal_Bool bAll = sal_False ) const;
    1271             : 
    1272             :     /** Access to frames.
    1273             :     Iterate over Flys - forr Basic-Collections. */
    1274             :     sal_uInt16 GetFlyCount( FlyCntType eType = FLYCNTTYPE_ALL) const;
    1275             :     SwFrmFmt* GetFlyNum(sal_uInt16 nIdx, FlyCntType eType = FLYCNTTYPE_ALL);
    1276             : 
    1277             :     /// Copy formats in own arrays and return them.
    1278             :     SwFrmFmt  *CopyFrmFmt ( const SwFrmFmt& );
    1279             :     SwCharFmt *CopyCharFmt( const SwCharFmt& );
    1280             :     SwTxtFmtColl* CopyTxtColl( const SwTxtFmtColl& rColl );
    1281             :     SwGrfFmtColl* CopyGrfColl( const SwGrfFmtColl& rColl );
    1282             : 
    1283             :     /// Replace all styles with those from rSource.
    1284             :     void ReplaceStyles( const SwDoc& rSource, bool bIncludePageStyles = true );
    1285             : 
    1286             :     /// Replace all property defaults with those from rSource.
    1287             :     void ReplaceDefaults( const SwDoc& rSource );
    1288             : 
    1289             :     /// Replace all compatability options with those from rSource.
    1290             :     void ReplaceCompatabilityOptions(const SwDoc& rSource);
    1291             : 
    1292             :     /// Query if style (paragraph- / character- / frame- / page-) is used.
    1293             :     bool IsUsed( const SwModify& ) const;
    1294             :     bool IsUsed( const SwNumRule& ) const;
    1295             : 
    1296             :     /// Set name of newly loaded document template.
    1297             :     sal_uInt16 SetDocPattern( const String& rPatternName );
    1298             : 
    1299             :     /// @return name of document template. Can be 0!
    1300           0 :     const String* GetDocPattern( sal_uInt16 nPos ) const
    1301             :     {
    1302           0 :         if(nPos >= aPatternNms.size())
    1303           0 :             return NULL;
    1304           0 :         if(boost::is_null(aPatternNms.begin() + nPos))
    1305           0 :             return NULL;
    1306           0 :         return &(aPatternNms[nPos]);
    1307             :     }
    1308             : 
    1309             :     /// Delete all unreferenced field types.
    1310             :     void GCFieldTypes();    ///< impl. in docfld.cxx
    1311             : 
    1312             :     /// Query / connect current document with glossary document.
    1313             :     void SetGlossaryDoc( SwDoc* pDoc ) { pGlossaryDoc = pDoc; }
    1314             : 
    1315             :     /// travel over PaM Ring
    1316             :     bool InsertGlossary( SwTextBlocks& rBlock, const String& rEntry,
    1317             :                         SwPaM& rPaM, SwCrsrShell* pShell = 0);
    1318             : 
    1319             :     /** get the set of printable pages for the XRenderable API by
    1320             :      evaluating the respective settings (see implementation) */
    1321             :     void CalculatePagesForPrinting( const SwRootFrm& rLayout, SwRenderData &rData, const SwPrintUIOptions &rOptions, bool bIsPDFExport,
    1322             :             sal_Int32 nDocPageCount );
    1323             :     void UpdatePagesForPrintingWithPostItData( SwRenderData &rData, const SwPrintUIOptions &rOptions, bool bIsPDFExport,
    1324             :             sal_Int32 nDocPageCount );
    1325             :     void CalculatePagePairsForProspectPrinting( const SwRootFrm& rLayout, SwRenderData &rData, const SwPrintUIOptions &rOptions,
    1326             :             sal_Int32 nDocPageCount );
    1327             : 
    1328             :     /// PageDescriptor interface.
    1329        1363 :     sal_uInt16 GetPageDescCnt() const { return aPageDescs.size(); }
    1330           1 :     const SwPageDesc& GetPageDesc( const sal_uInt16 i ) const { return *aPageDescs[i]; }
    1331        2022 :     SwPageDesc& GetPageDesc( sal_uInt16 i ) { return *aPageDescs[i]; }
    1332             :     SwPageDesc* FindPageDescByName( const String& rName,
    1333             :                                     sal_uInt16* pPos = 0 ) const;
    1334             : 
    1335             :     /** Copy the complete PageDesc - beyond document and "deep"!
    1336             :      Optionally copying of PoolFmtId, -HlpId can be prevented. */
    1337             :     void CopyPageDesc( const SwPageDesc& rSrcDesc, SwPageDesc& rDstDesc,
    1338             :                         bool bCopyPoolIds = true );
    1339             : 
    1340             :     /** Copy header (with contents) from SrcFmt to DestFmt
    1341             :      (can also be copied into other document). */
    1342         455 :     void CopyHeader( const SwFrmFmt& rSrcFmt, SwFrmFmt& rDestFmt )
    1343         455 :         { CopyPageDescHeaderFooterImpl( true, rSrcFmt, rDestFmt ); }
    1344             : 
    1345             :     /** Copy footer (with contents) from SrcFmt to DestFmt.
    1346             :      (can also be copied into other document). */
    1347         447 :     void CopyFooter( const SwFrmFmt& rSrcFmt, SwFrmFmt& rDestFmt )
    1348         447 :         { CopyPageDescHeaderFooterImpl( false, rSrcFmt, rDestFmt ); }
    1349             : 
    1350             :     //For Reader.
    1351             : 
    1352             :     SwPageDesc * GetPageDesc( const String & rName );
    1353             :     void ChgPageDesc( const String & rName, const SwPageDesc& );
    1354             :     void ChgPageDesc( sal_uInt16 i, const SwPageDesc& );
    1355             :     bool FindPageDesc( const String & rName, sal_uInt16 * pFound );
    1356             :     void DelPageDesc( const String & rName, bool bBroadcast = false);
    1357             :     void DelPageDesc( sal_uInt16 i, bool bBroadcast = false );
    1358             :     void PreDelPageDesc(SwPageDesc * pDel);
    1359             :     sal_uInt16 MakePageDesc( const String &rName, const SwPageDesc* pCpy = 0,
    1360             :                              bool bRegardLanguage = true,
    1361             :                              bool bBroadcast = false);
    1362             :     void BroadcastStyleOperation(String rName, SfxStyleFamily eFamily,
    1363             :                                  sal_uInt16 nOp);
    1364             : 
    1365             :     /** The html import sometimes overwrites the
    1366             :      page sizes set in the page descriptions. This function is used to
    1367             :      correct this. */
    1368             :     void CheckDefaultPageFmt();
    1369             : 
    1370             :     /// Methods for tables/indices.
    1371             : 
    1372             :     sal_uInt16 GetCurTOXMark( const SwPosition& rPos, SwTOXMarks& ) const;
    1373             :     void DeleteTOXMark( const SwTOXMark* pTOXMark );
    1374             :     const SwTOXMark& GotoTOXMark( const SwTOXMark& rCurTOXMark,
    1375             :                                 SwTOXSearch eDir, sal_Bool bInReadOnly );
    1376             : 
    1377             :     /// Insert/Renew table/indes.
    1378             :     const SwTOXBaseSection* InsertTableOf( const SwPosition& rPos,
    1379             :                                             const SwTOXBase& rTOX,
    1380             :                                             const SfxItemSet* pSet = 0,
    1381             :                                             bool bExpand = false );
    1382             :     const SwTOXBaseSection* InsertTableOf( sal_uLong nSttNd, sal_uLong nEndNd,
    1383             :                                             const SwTOXBase& rTOX,
    1384             :                                             const SfxItemSet* pSet = 0                                          );
    1385             :     const SwTOXBase* GetCurTOX( const SwPosition& rPos ) const;
    1386             :     const SwAttrSet& GetTOXBaseAttrSet(const SwTOXBase& rTOX) const;
    1387             : 
    1388             :     bool DeleteTOX( const SwTOXBase& rTOXBase, bool bDelNodes = false );
    1389             :     String GetUniqueTOXBaseName( const SwTOXType& rType,
    1390             :                                 const String* pChkStr = 0 ) const;
    1391             : 
    1392             :     bool SetTOXBaseName(const SwTOXBase& rTOXBase, const String& rName);
    1393             :     void SetTOXBaseProtection(const SwTOXBase& rTOXBase, sal_Bool bProtect);
    1394             : 
    1395             :     /// After reading file update all tables/indices.
    1396           0 :     void SetUpdateTOX( bool bFlag = true )     { mbUpdateTOX = bFlag; }
    1397         236 :     bool IsUpdateTOX() const                   { return mbUpdateTOX; }
    1398             : 
    1399           2 :     const String&   GetTOIAutoMarkURL() const {return sTOIAutoMarkURL;}
    1400           0 :     void            SetTOIAutoMarkURL(const String& rSet)  {sTOIAutoMarkURL = rSet;}
    1401             :     void            ApplyAutoMark();
    1402             : 
    1403       14554 :     bool IsInReading() const                    { return mbInReading; }
    1404         534 :     void SetInReading( bool bNew )              { mbInReading = bNew; }
    1405             : 
    1406        1676 :     bool IsClipBoard() const                    { return mbClipBoard; }
    1407             :     /// N.B.: must be called right after constructor! (@see GetXmlIdRegistry)
    1408           0 :     void SetClipBoard( bool bNew )              { mbClipBoard = bNew; }
    1409             : 
    1410           0 :     bool IsColumnSelection() const              { return mbColumnSelection; }
    1411           0 :     void SetColumnSelection( bool bNew )        { mbColumnSelection = bNew; }
    1412             : 
    1413       10077 :     bool IsInXMLImport() const { return mbInXMLImport; }
    1414         174 :     void SetInXMLImport( bool bNew ) { mbInXMLImport = bNew; }
    1415             : 
    1416             :     /// Manage types of tables/indices.
    1417             :     sal_uInt16 GetTOXTypeCount( TOXTypes eTyp ) const;
    1418             :     const SwTOXType* GetTOXType( TOXTypes eTyp, sal_uInt16 nId ) const;
    1419             :     sal_Bool DeleteTOXType( TOXTypes eTyp, sal_uInt16 nId );
    1420             :     const SwTOXType* InsertTOXType( const SwTOXType& rTyp );
    1421           0 :     const SwTOXTypes& GetTOXTypes() const { return *pTOXTypes; }
    1422             : 
    1423             :     const SwTOXBase*    GetDefaultTOXBase( TOXTypes eTyp, bool bCreate = false );
    1424             :     void                SetDefaultTOXBase(const SwTOXBase& rBase);
    1425             : 
    1426             :     /// Key for management of index.
    1427             :     sal_uInt16 GetTOIKeys( SwTOIKeyType eTyp, std::vector<String>& rArr ) const;
    1428             : 
    1429             :     /// Sort table text.
    1430             :     bool SortTbl(const SwSelBoxes& rBoxes, const SwSortOptions&);
    1431             :     bool SortText(const SwPaM&, const SwSortOptions&);
    1432             : 
    1433             :     // Correct the SwPosition-Objects that are registered with the document
    1434             :     // e. g. ::com::sun::star::text::Bookmarks or tables/indices.
    1435             :     // If bMoveCrsr is set move Crsr too.
    1436             : 
    1437             :     /// Set everything in rOldNode on rNewPos + Offset.
    1438             :     void CorrAbs( const SwNodeIndex& rOldNode, const SwPosition& rNewPos,
    1439             :                     const xub_StrLen nOffset = 0, sal_Bool bMoveCrsr = sal_False );
    1440             : 
    1441             :     /// Set everything in the range of [rStartNode, rEndNode] to rNewPos.
    1442             :     void CorrAbs( const SwNodeIndex& rStartNode, const SwNodeIndex& rEndNode,
    1443             :                     const SwPosition& rNewPos, sal_Bool bMoveCrsr = sal_False );
    1444             : 
    1445             :     /// Set everything in this range from rRange to rNewPos.
    1446             :     void CorrAbs( const SwPaM& rRange, const SwPosition& rNewPos,
    1447             :                     sal_Bool bMoveCrsr = sal_False );
    1448             : 
    1449             :     /// Set everything in rOldNode to relative Pos.
    1450             :     void CorrRel( const SwNodeIndex& rOldNode, const SwPosition& rNewPos,
    1451             :                     const xub_StrLen nOffset = 0, sal_Bool bMoveCrsr = sal_False );
    1452             : 
    1453             :     /// Query / set rules for Outline.
    1454       12816 :     inline SwNumRule* GetOutlineNumRule() const
    1455             :     {
    1456       12816 :         return pOutlineRule;
    1457             :     }
    1458             :     void SetOutlineNumRule( const SwNumRule& rRule );
    1459             :     void PropagateOutlineRule();
    1460             : 
    1461             :     /// Outline - promote / demote.
    1462             :     bool OutlineUpDown( const SwPaM& rPam, short nOffset = 1 );
    1463             : 
    1464             :     /// Ountline - move up / move down.
    1465             :     bool MoveOutlinePara( const SwPaM& rPam, short nOffset = 1);
    1466             : 
    1467             :     bool GotoOutline( SwPosition& rPos, const String& rName ) const;
    1468             : 
    1469             :     /** Accept changes of outline styles for OUtlineRule.
    1470             :      re-use unused 3rd parameter
    1471             :      Add optional parameter <bResetIndentAttrs> - default value sal_False.
    1472             :      If <bResetIndentAttrs> equals true, the indent attributes "before text"
    1473             :      and "first line indent" are additionally reset at the provided PaM, if
    1474             :      the list style makes use of the new list level attributes.
    1475             :      introduce parameters <bCreateNewList> and <sContinuedListId>
    1476             :      <bCreateNewList> indicates, if a new list is created by applying the
    1477             :      given list style. */
    1478             :     void SetNumRule( const SwPaM&,
    1479             :                      const SwNumRule&,
    1480             :                      const bool bCreateNewList,
    1481             :                      const String sContinuedListId = String(),
    1482             :                      bool bSetItem = true,
    1483             :                      const bool bResetIndentAttrs = false );
    1484             :     void SetCounted( const SwPaM&, bool bCounted);
    1485             : 
    1486             :     void MakeUniqueNumRules(const SwPaM & rPaM);
    1487             : 
    1488             :     void SetNumRuleStart( const SwPosition& rPos, sal_Bool bFlag = sal_True );
    1489             :     void SetNodeNumStart( const SwPosition& rPos, sal_uInt16 nStt );
    1490             : 
    1491             :     SwNumRule* GetCurrNumRule( const SwPosition& rPos ) const;
    1492             : 
    1493        3747 :     const SwNumRuleTbl& GetNumRuleTbl() const { return *pNumRuleTbl; }
    1494             : 
    1495             :     /**
    1496             :        Add numbering rule to document.
    1497             : 
    1498             :        @param pRule    rule to add
    1499             :     */
    1500             :     void AddNumRule(SwNumRule * pRule);
    1501             : 
    1502             :     /// add optional parameter <eDefaultNumberFormatPositionAndSpaceMode>
    1503             :     sal_uInt16 MakeNumRule( const String &rName,
    1504             :         const SwNumRule* pCpy = 0,
    1505             :         bool bBroadcast = false,
    1506             :         const SvxNumberFormat::SvxNumPositionAndSpaceMode eDefaultNumberFormatPositionAndSpaceMode =
    1507             :             SvxNumberFormat::LABEL_WIDTH_AND_POSITION );
    1508             :     sal_uInt16 FindNumRule( const String& rName ) const;
    1509             :     SwNumRule* FindNumRulePtr( const String& rName ) const;
    1510             : 
    1511             :     /// Deletion only possible if ::com::sun::star::chaos::Rule is not used!
    1512             :     bool RenameNumRule(const String & aOldName, const String & aNewName,
    1513             :                            bool bBroadcast = false);
    1514             :     bool DelNumRule( const String& rName, bool bBroadCast = false );
    1515             :     String GetUniqueNumRuleName( const String* pChkStr = 0, bool bAutoNum = true ) const;
    1516             : 
    1517             :     void UpdateNumRule();   /// Update all invalids.
    1518             :     void ChgNumRuleFmts( const SwNumRule& rRule, const String * pOldName = 0 );
    1519             :     bool ReplaceNumRule( const SwPosition& rPos, const String& rOldRule,
    1520             :                         const String& rNewRule );
    1521             : 
    1522             :     /// Goto next/previous on same level.
    1523             :     bool GotoNextNum( SwPosition&, bool bOverUpper = true,
    1524             :                         sal_uInt8* pUpper = 0, sal_uInt8* pLower = 0 );
    1525             :     bool GotoPrevNum( SwPosition&, bool bOverUpper = true,
    1526             :                         sal_uInt8* pUpper = 0, sal_uInt8* pLower = 0 );
    1527             : 
    1528             :     /** Searches for a text node with a numbering rule.
    1529             : 
    1530             :        add optional parameter <bInvestigateStartNode>
    1531             :        add output parameter <sListId>
    1532             : 
    1533             :        \param rPos         position to start search
    1534             :        \param bForward     - sal_True:  search forward
    1535             :                            - sal_False: search backward
    1536             :        \param bNum         - sal_True:  search for enumeration
    1537             :                            - sal_False: search for itemize
    1538             :        \param bOutline     - sal_True:  search for outline numbering rule
    1539             :                            - sal_False: search for non-outline numbering rule
    1540             :        \param nNonEmptyAllowed   number of non-empty paragraphs allowed between
    1541             :                                  rPos and found paragraph
    1542             : 
    1543             :         @param sListId
    1544             :         output parameter - in case a list style is found, <sListId> holds the
    1545             :         list id, to which the text node belongs, which applies the found list style.
    1546             : 
    1547             :         @param bInvestigateStartNode
    1548             :         input parameter - boolean, indicating, if start node, determined by given
    1549             :         start position has to be investigated or not.
    1550             :      */
    1551             :     const SwNumRule * SearchNumRule(const SwPosition & rPos,
    1552             :                                     const bool bForward,
    1553             :                                     const bool bNum,
    1554             :                                     const bool bOutline,
    1555             :                                     int nNonEmptyAllowed,
    1556             :                                     String& sListId,
    1557             :                                     const bool bInvestigateStartNode = false );
    1558             : 
    1559             :     /// Paragraphs without numbering but with indents.
    1560             :     bool NoNum( const SwPaM& );
    1561             : 
    1562             :     /// Delete, splitting of numbering list.
    1563             :     void DelNumRules( const SwPaM& );
    1564             : 
    1565             :     /// Invalidates all numrules
    1566             :     void InvalidateNumRules();
    1567             : 
    1568             :     bool NumUpDown( const SwPaM&, bool bDown = true );
    1569             : 
    1570             :     /** Move selected paragraphes (not only numberings)
    1571             :      according to offsets. (if negative: go to doc start). */
    1572             :     bool MoveParagraph( const SwPaM&, long nOffset = 1, bool bIsOutlMv = false );
    1573             : 
    1574             :     bool NumOrNoNum( const SwNodeIndex& rIdx, sal_Bool bDel = sal_False);
    1575             : 
    1576             :     void StopNumRuleAnimations( OutputDevice* );
    1577             : 
    1578             :     /** Insert new table at position @param rPos (will be inserted before Node!).
    1579             :      For AutoFormat at input: columns have to be set at predefined width.
    1580             :      The array holds the positions of the columns (not their widths).
    1581             :      new @param bCalledFromShell:
    1582             :        sal_True: called from shell -> propagate existing adjust item at
    1583             :        rPos to every new cell. A existing adjust item in the table
    1584             :        heading or table contents paragraph style prevent that
    1585             :        propagation.
    1586             :        sal_False: do not propagate
    1587             :     */
    1588             :     const SwTable* InsertTable( const SwInsertTableOptions& rInsTblOpts,  // HEADLINE_NO_BORDER
    1589             :                                 const SwPosition& rPos, sal_uInt16 nRows,
    1590             :                                 sal_uInt16 nCols, short eAdjust,
    1591             :                                 const SwTableAutoFmt* pTAFmt = 0,
    1592             :                                 const std::vector<sal_uInt16> *pColArr = 0,
    1593             :                                 sal_Bool bCalledFromShell = sal_False,
    1594             :                                 sal_Bool bNewModel = sal_True );
    1595             : 
    1596             :     /// If index is in a table, return TableNode, else 0.
    1597             :                  SwTableNode* IsIdxInTbl( const SwNodeIndex& rIdx );
    1598             :     inline const SwTableNode* IsIdxInTbl( const SwNodeIndex& rIdx ) const;
    1599             : 
    1600             :     /// Create a balanced table out of the selected range.
    1601             :     const SwTable* TextToTable( const SwInsertTableOptions& rInsTblOpts, // HEADLINE_NO_BORDER,
    1602             :                                 const SwPaM& rRange, sal_Unicode cCh,
    1603             :                                 short eAdjust,
    1604             :                                 const SwTableAutoFmt* = 0 );
    1605             : 
    1606             :     /// text to table conversion - API support
    1607             :     const SwTable* TextToTable( const std::vector< std::vector<SwNodeRange> >& rTableNodes );
    1608             : 
    1609             :     sal_Bool TableToText( const SwTableNode* pTblNd, sal_Unicode cCh );
    1610             : 
    1611             :     /// Create columns / rows in table.
    1612             :     bool InsertCol( const SwCursor& rCursor,
    1613             :                     sal_uInt16 nCnt = 1, bool bBehind = true );
    1614             :     bool InsertCol( const SwSelBoxes& rBoxes,
    1615             :                     sal_uInt16 nCnt = 1, bool bBehind = true );
    1616             :     bool InsertRow( const SwCursor& rCursor,
    1617             :                     sal_uInt16 nCnt = 1, bool bBehind = true );
    1618             :     bool InsertRow( const SwSelBoxes& rBoxes,
    1619             :                     sal_uInt16 nCnt = 1, bool bBehind = true );
    1620             : 
    1621             :     /// Delete Colums/Rows in table.
    1622             :     sal_Bool DeleteRowCol( const SwSelBoxes& rBoxes, bool bColumn = false );
    1623             :     sal_Bool DeleteRow( const SwCursor& rCursor );
    1624             :     sal_Bool DeleteCol( const SwCursor& rCursor );
    1625             : 
    1626             :     /// Split / concatenate boxes in table.
    1627             :     sal_Bool SplitTbl( const SwSelBoxes& rBoxes, sal_Bool bVert = sal_True,
    1628             :                        sal_uInt16 nCnt = 1, sal_Bool bSameHeight = sal_False );
    1629             : 
    1630             :     /// @return enum TableMergeErr.
    1631             :     sal_uInt16 MergeTbl( SwPaM& rPam );
    1632             :     String GetUniqueTblName() const;
    1633             :     sal_Bool IsInsTblFormatNum() const;
    1634             :     sal_Bool IsInsTblChangeNumFormat() const;
    1635             :     sal_Bool IsInsTblAlignNum() const;
    1636             : 
    1637             :     /// From FEShell (for Undo and BModified).
    1638             :     void GetTabCols( SwTabCols &rFill, const SwCursor* pCrsr,
    1639             :                     const SwCellFrm* pBoxFrm = 0 ) const;
    1640             :     void SetTabCols( const SwTabCols &rNew, sal_Bool bCurRowOnly,
    1641             :                     const SwCursor* pCrsr, const SwCellFrm* pBoxFrm = 0 );
    1642             :     void GetTabRows( SwTabCols &rFill, const SwCursor* pCrsr,
    1643             :                     const SwCellFrm* pBoxFrm = 0 ) const;
    1644             :     void SetTabRows( const SwTabCols &rNew, sal_Bool bCurColOnly, const SwCursor* pCrsr,
    1645             :                      const SwCellFrm* pBoxFrm = 0 );
    1646             : 
    1647             :     /// Direct access for UNO.
    1648             :     void SetTabCols(SwTable& rTab, const SwTabCols &rNew, const SwTabCols &rOld,
    1649             :                                     const SwTableBox *pStart, sal_Bool bCurRowOnly);
    1650             : 
    1651             :     void SetRowsToRepeat( SwTable &rTable, sal_uInt16 nSet );
    1652             : 
    1653             :     /// AutoFormat for table/table selection.
    1654             :     sal_Bool SetTableAutoFmt( const SwSelBoxes& rBoxes, const SwTableAutoFmt& rNew );
    1655             : 
    1656             :     /// Query attributes.
    1657             :     sal_Bool GetTableAutoFmt( const SwSelBoxes& rBoxes, SwTableAutoFmt& rGet );
    1658             : 
    1659             :     void AppendUndoForInsertFromDB( const SwPaM& rPam, sal_Bool bIsTable );
    1660             : 
    1661             :     sal_Bool SetColRowWidthHeight( SwTableBox& rAktBox, sal_uInt16 eType,
    1662             :                                 SwTwips nAbsDiff, SwTwips nRelDiff );
    1663             :     SwTableBoxFmt* MakeTableBoxFmt();
    1664             :     SwTableLineFmt* MakeTableLineFmt();
    1665             : 
    1666             :     /// Check if box has numerical valule. Change format of box if required.
    1667             :     void ChkBoxNumFmt( SwTableBox& rAktBox, sal_Bool bCallUpdate );
    1668             :     void SetTblBoxFormulaAttrs( SwTableBox& rBox, const SfxItemSet& rSet );
    1669             :     void ClearBoxNumAttrs( const SwNodeIndex& rNode );
    1670             :     void ClearLineNumAttrs( SwPosition & rPos );
    1671             : 
    1672             :     sal_Bool InsCopyOfTbl( SwPosition& rInsPos, const SwSelBoxes& rBoxes,
    1673             :                         const SwTable* pCpyTbl = 0, sal_Bool bCpyName = sal_False,
    1674             :                         sal_Bool bCorrPos = sal_False );
    1675             : 
    1676             :     sal_Bool UnProtectCells( const String& rTblName );
    1677             :     sal_Bool UnProtectCells( const SwSelBoxes& rBoxes );
    1678             :     sal_Bool UnProtectTbls( const SwPaM& rPam );
    1679             :     sal_Bool HasTblAnyProtection( const SwPosition* pPos,
    1680             :                               const String* pTblName = 0,
    1681             :                               sal_Bool* pFullTblProtection = 0 );
    1682             : 
    1683             :     /// Split table at baseline position, i.e. create a new table.
    1684             :     sal_Bool SplitTable( const SwPosition& rPos, sal_uInt16 eMode = 0,
    1685             :                         sal_Bool bCalcNewSize = sal_False );
    1686             : 
    1687             :     /** And vice versa: rPos must be in the table that remains. The flag indicates
    1688             :      whether the current table is merged with the one before or behind it. */
    1689             :     sal_Bool MergeTable( const SwPosition& rPos, sal_Bool bWithPrev = sal_True,
    1690             :                         sal_uInt16 nMode = 0 );
    1691             : 
    1692             :     /// Make charts of given table update.
    1693             :     void UpdateCharts( const String &rName ) const;
    1694             : 
    1695             :     /// Update all charts, for that exists any table.
    1696           0 :     void UpdateAllCharts()          { DoUpdateAllCharts(); }
    1697             : 
    1698             :     /// Table is renamed and refreshes charts.
    1699             :     void SetTableName( SwFrmFmt& rTblFmt, const String &rNewName );
    1700             : 
    1701             :     /// @return the reference in document that is set for name.
    1702             :     const SwFmtRefMark* GetRefMark( const String& rName ) const;
    1703             : 
    1704             :     /// @return RefMark via index - for UNO.
    1705             :     const SwFmtRefMark* GetRefMark( sal_uInt16 nIndex ) const;
    1706             : 
    1707             :     /** @return names of all references that are set in document.
    1708             :      If array pointer is 0 return only whether a RefMark is set in document. */
    1709             :     sal_uInt16 GetRefMarks( std::vector<rtl::OUString>* = 0 ) const;
    1710             : 
    1711             :     /// Insert label. If a FlyFormat is created, return it.
    1712             :     SwFlyFrmFmt* InsertLabel( const SwLabelType eType, const String &rTxt, const String& rSeparator,
    1713             :                     const String& rNumberingSeparator,
    1714             :                     const sal_Bool bBefore, const sal_uInt16 nId, const sal_uLong nIdx,
    1715             :                     const String& rCharacterStyle,
    1716             :                     const sal_Bool bCpyBrd = sal_True );
    1717             :     SwFlyFrmFmt* InsertDrawLabel(
    1718             :         const String &rTxt, const String& rSeparator, const String& rNumberSeparator,
    1719             :         const sal_uInt16 nId, const String& rCharacterStyle, SdrObject& rObj );
    1720             : 
    1721             :     /// Query attribute pool.
    1722        7112 :     const SwAttrPool& GetAttrPool() const   { return *mpAttrPool; }
    1723      152391 :           SwAttrPool& GetAttrPool()         { return *mpAttrPool; }
    1724             : 
    1725             :     /// Search an EditShell or, if appropriate, a ViewShell via layout.
    1726             :     SwEditShell* GetEditShell( ViewShell** ppSh = 0 ) const;
    1727             :     ::sw::IShellCursorSupplier * GetIShellCursorSupplier();
    1728             : 
    1729             :     /// OLE 2.0-notification.
    1730         691 :     inline       void  SetOle2Link(const Link& rLink) {aOle2Link = rLink;}
    1731         161 :     inline const Link& GetOle2Link() const {return aOle2Link;}
    1732             : 
    1733             :     /// insert section (the ODF kind of section, not the nodesarray kind)
    1734             :     SwSection * InsertSwSection(SwPaM const& rRange, SwSectionData &,
    1735             :             SwTOXBase const*const pTOXBase = 0,
    1736             :             SfxItemSet const*const pAttr = 0, bool const bUpdate = true);
    1737             :     sal_uInt16 IsInsRegionAvailable( const SwPaM& rRange,
    1738             :                                 const SwNode** ppSttNd = 0 ) const;
    1739             :     SwSection* GetCurrSection( const SwPosition& rPos ) const;
    1740         228 :     SwSectionFmts& GetSections() { return *pSectionFmtTbl; }
    1741           0 :     const SwSectionFmts& GetSections() const { return *pSectionFmtTbl; }
    1742             :     SwSectionFmt *MakeSectionFmt( SwSectionFmt *pDerivedFrom );
    1743             :     void DelSectionFmt( SwSectionFmt *pFmt, bool bDelNodes = false );
    1744             :     void UpdateSection(sal_uInt16 const nSect, SwSectionData &,
    1745             :             SfxItemSet const*const = 0, bool const bPreventLinkUpdate = false);
    1746             :     String GetUniqueSectionName( const String* pChkStr = 0 ) const;
    1747             : 
    1748             :     /* @@@MAINTAINABILITY-HORROR@@@
    1749             :        The model should not have anything to do with a shell.
    1750             :        Unnecessary compile/link time dependency.
    1751             :     */
    1752             : 
    1753             :     // Pointer to SfxDocShell from Doc. Can be 0!!
    1754       23445 :           SwDocShell* GetDocShell()         { return pDocShell; }
    1755         626 :     const SwDocShell* GetDocShell() const   { return pDocShell; }
    1756             :     void SetDocShell( SwDocShell* pDSh );
    1757             : 
    1758             :     void ShareLayout( boost::shared_ptr<SwRootFrm>& rPtr);
    1759             : 
    1760             :     /** in case during copying of embedded object a new shell is created,
    1761             :      it should be set here and cleaned later */
    1762           0 :     void SetTmpDocShell( SfxObjectShellLock rLock )    { xTmpDocShell = rLock; }
    1763           0 :     SfxObjectShellLock GetTmpDocShell()    { return xTmpDocShell; }
    1764             : 
    1765             :     /// For Autotexts? (text modules) They have only one SVPersist at their disposal.
    1766             :     SfxObjectShell* GetPersist() const;
    1767             : 
    1768             :     /// Pointer to storage of SfxDocShells. Can be 0!!!
    1769             :     ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > GetDocStorage();
    1770             : 
    1771             :     /// Query / set flag indicating if document is loaded asynchronously at this moment.
    1772          51 :     bool IsInLoadAsynchron() const             { return mbInLoadAsynchron; }
    1773           0 :     void SetInLoadAsynchron( bool bFlag )       { mbInLoadAsynchron = bFlag; }
    1774             : 
    1775             :     bool SelectServerObj( const String& rStr, SwPaM*& rpPam,
    1776             :                             SwNodeRange*& rpRange ) const;
    1777             : 
    1778             :     /// For Drag&Move: (e.g. allow "moving" of RefMarks)
    1779           3 :     bool IsCopyIsMove() const              { return mbCopyIsMove; }
    1780           2 :     void SetCopyIsMove( bool bFlag )        { mbCopyIsMove = bFlag; }
    1781             : 
    1782             :     SwDrawContact* GroupSelection( SdrView& );
    1783             :     void UnGroupSelection( SdrView& );
    1784             :     bool DeleteSelection( SwDrawView& );
    1785             : 
    1786             :     /// Invalidates OnlineSpell-WrongLists.
    1787             :     void SpellItAgainSam( bool bInvalid, bool bOnlyWrong, bool bSmartTags );
    1788             :     void InvalidateAutoCompleteFlag();
    1789             : 
    1790             :     void SetCalcFieldValueHdl(Outliner* pOutliner);
    1791             : 
    1792             :     // Query if ::com::sun::star::util::URL was visited.
    1793             :     // Query via Doc, if only a ::com::sun::star::text::Bookmark has been given.
    1794             :     // In this case the document name has to be set in front.
    1795             :     bool IsVisitedURL( const String& rURL ) const;
    1796             : 
    1797             :     /// Save current values for automatic registration of exceptions in Autocorrection.
    1798             :     void SetAutoCorrExceptWord( SwAutoCorrExceptWord* pNew );
    1799           0 :     SwAutoCorrExceptWord* GetAutoCorrExceptWord()       { return pACEWord; }
    1800             : 
    1801             :     const SwFmtINetFmt* FindINetAttr( const String& rName ) const;
    1802             : 
    1803             :     /// Call into intransparent Basic; expect possible Return String.
    1804             :     bool ExecMacro( const SvxMacro& rMacro, String* pRet = 0, SbxArray* pArgs = 0 );
    1805             : 
    1806             :     /// Call into intransparent Basic / JavaScript.
    1807             :     sal_uInt16 CallEvent( sal_uInt16 nEvent, const SwCallMouseEvent& rCallEvent,
    1808             :                         bool bChkPtr = false, SbxArray* pArgs = 0,
    1809             :                         const Link* pCallBack = 0 );
    1810             : 
    1811             :     /** Adjust left margin via object bar (similar to adjustment of numerations).
    1812             :      One can either change the margin "by" adding or substracting a given
    1813             :      offset or set it "to" this position (bModulus = true). */
    1814             :     void MoveLeftMargin( const SwPaM& rPam, bool bRight = true,
    1815             :                         bool bModulus = true );
    1816             : 
    1817             :     /// Query NumberFormatter.
    1818             :     inline       SvNumberFormatter* GetNumberFormatter( sal_Bool bCreate = sal_True );
    1819             :     inline const SvNumberFormatter* GetNumberFormatter( sal_Bool bCreate = sal_True ) const;
    1820             : 
    1821             :     bool HasInvisibleContent() const;
    1822             :     /// delete invisible content, like hidden sections and paragraphs
    1823             :     bool RemoveInvisibleContent();
    1824             :     /// restore the invisible content if it's available on the undo stack
    1825             :     bool RestoreInvisibleContent();
    1826             : 
    1827             :     bool ConvertFieldsToText();
    1828             : 
    1829             :     /// Create sub-documents according to given collection.
    1830             :     /// If no collection is given, use chapter styles for 1st level.
    1831             :     sal_Bool GenerateGlobalDoc( const String& rPath,
    1832             :                                 const SwTxtFmtColl* pSplitColl = 0 );
    1833             :     sal_Bool GenerateGlobalDoc( const String& rPath, int nOutlineLevel = 0 );
    1834             :     sal_Bool GenerateHTMLDoc( const String& rPath,
    1835             :                                 const SwTxtFmtColl* pSplitColl = 0 );
    1836             :     sal_Bool GenerateHTMLDoc( const String& rPath, int nOutlineLevel = 0 );
    1837             : 
    1838             :     ///  Compare two documents.
    1839             :     long CompareDoc( const SwDoc& rDoc );
    1840             : 
    1841             :     /// Merge two documents.
    1842             :     long MergeDoc( const SwDoc& rDoc );
    1843             : 
    1844             :     /** Set comment-text for Redline. It then comes in via AppendRedLine.
    1845             :      Used by AutoFormat. 0-pointer resets mode.
    1846             :      Sequence number is for conjoining of Redlines by the UI. */
    1847             :     void SetAutoFmtRedlineComment( const String* pTxt, sal_uInt16 nSeqNo = 0 );
    1848             : 
    1849           0 :     bool IsAutoFmtRedline() const           { return mbIsAutoFmtRedline; }
    1850           0 :     void SetAutoFmtRedline( bool bFlag )    { mbIsAutoFmtRedline = bFlag; }
    1851             : 
    1852             :     /// For AutoFormat: with Undo/Redlining.
    1853             :     void SetTxtFmtCollByAutoFmt( const SwPosition& rPos, sal_uInt16 nPoolId,
    1854             :                                 const SfxItemSet* pSet = 0 );
    1855             :     void SetFmtItemByAutoFmt( const SwPaM& rPam, const SfxItemSet& );
    1856             : 
    1857             :     /// Only for SW-textbloxks! Does not pay any attention to layout!
    1858             :     void ClearDoc();        // Deletes all content!
    1859             : 
    1860             :     /// Query /set data for PagePreView.
    1861           0 :     const SwPagePreViewPrtData* GetPreViewPrtData() const { return pPgPViewPrtData; }
    1862             : 
    1863             :     // If pointer == 0 destroy pointer in document.
    1864             :     // Else copy object.
    1865             :     // Pointer is not transferred to ownership by document!
    1866             :     void SetPreViewPrtData( const SwPagePreViewPrtData* pData );
    1867             : 
    1868             :     /** update all modified OLE-Objects. The modification is called over the
    1869             :      StarOne - Interface */
    1870           0 :     void SetOLEObjModified()
    1871           0 :     {   if( GetCurrentViewShell() ) aOLEModifiedTimer.Start(); }    //swmod 071107//swmod 071225
    1872             : 
    1873             :     // -------------------- Uno - Interfaces ---------------------------
    1874        7240 :     const SwUnoCrsrTbl& GetUnoCrsrTbl() const       { return *pUnoCrsrTbl; }
    1875             :     SwUnoCrsr* CreateUnoCrsr( const SwPosition& rPos, bool bTblCrsr = false );
    1876             : 
    1877             :     // -------------------- FeShell - Interfaces -----------------------
    1878             :     // !!! These assume always an existing layout !!!
    1879             :     bool ChgAnchor( const SdrMarkList& _rMrkList,
    1880             :                         RndStdIds _eAnchorType,
    1881             :                         const bool _bSameOnly,
    1882             :                         const bool _bPosCorr );
    1883             : 
    1884             :     void SetRowHeight( const SwCursor& rCursor, const SwFmtFrmSize &rNew );
    1885             :     void GetRowHeight( const SwCursor& rCursor, SwFmtFrmSize *& rpSz ) const;
    1886             :     void SetRowSplit( const SwCursor& rCursor, const SwFmtRowSplit &rNew );
    1887             :     void GetRowSplit( const SwCursor& rCursor, SwFmtRowSplit *& rpSz ) const;
    1888             :     sal_Bool BalanceRowHeight( const SwCursor& rCursor, sal_Bool bTstOnly = sal_True );
    1889             :     void SetRowBackground( const SwCursor& rCursor, const SvxBrushItem &rNew );
    1890             :     sal_Bool GetRowBackground( const SwCursor& rCursor, SvxBrushItem &rToFill ) const;
    1891             :     void SetTabBorders( const SwCursor& rCursor, const SfxItemSet& rSet );
    1892             :     void SetTabLineStyle( const SwCursor& rCursor,
    1893             :                           const Color* pColor, sal_Bool bSetLine,
    1894             :                           const editeng::SvxBorderLine* pBorderLine );
    1895             :     void GetTabBorders( const SwCursor& rCursor, SfxItemSet& rSet ) const;
    1896             :     void SetBoxAttr( const SwCursor& rCursor, const SfxPoolItem &rNew );
    1897             :     /**
    1898             :     Retrieves a box attribute from the given cursor.
    1899             : 
    1900             :     @return Whether the property is set over the current box selection.
    1901             : 
    1902             :     @remarks A property is 'set' if it's set to the same value over all boxes in the current selection.
    1903             :     The property value is retrieved from the first box in the current selection. It is then compared to
    1904             :     the values of the same property over any other boxes in the selection; if any value is different from
    1905             :     that of the first box, the property is unset (and sal_False is returned).
    1906             :     */
    1907             :     sal_Bool GetBoxAttr( const SwCursor& rCursor, SfxPoolItem &rToFill ) const;
    1908             :     void SetBoxAlign( const SwCursor& rCursor, sal_uInt16 nAlign );
    1909             :     sal_uInt16 GetBoxAlign( const SwCursor& rCursor ) const;
    1910             :     void AdjustCellWidth( const SwCursor& rCursor, sal_Bool bBalance = sal_False );
    1911             : 
    1912             :     int Chainable( const SwFrmFmt &rSource, const SwFrmFmt &rDest );
    1913             :     int Chain( SwFrmFmt &rSource, const SwFrmFmt &rDest );
    1914             :     void Unchain( SwFrmFmt &rFmt );
    1915             : 
    1916             :     // For Copy/Move from FrmShell.
    1917             :     SdrObject* CloneSdrObj( const SdrObject&, bool bMoveWithinDoc = false,
    1918             :                             bool bInsInPage = true );
    1919             : 
    1920             :     //
    1921             :     // -------------------- FeShell - Interface end ------------------
    1922             : 
    1923             :     /// Interface for TextInputData - for text input of Chinese and Japanese.
    1924             :     SwExtTextInput* CreateExtTextInput( const SwPaM& rPam );
    1925             :     void DeleteExtTextInput( SwExtTextInput* pDel );
    1926             :     SwExtTextInput* GetExtTextInput( const SwNode& rNd,
    1927             :                                 xub_StrLen nCntntPos = STRING_NOTFOUND) const;
    1928             :     SwExtTextInput* GetExtTextInput() const;
    1929             : 
    1930             :     /// Interface for access to AutoComplete-List.
    1931         970 :     static SwAutoCompleteWord& GetAutoCompleteWords() { return *pACmpltWords; }
    1932             : 
    1933           5 :     bool ContainsMSVBasic() const          { return mbContains_MSVBasic; }
    1934           0 :     void SetContainsMSVBasic( bool bFlag )  { mbContains_MSVBasic = bFlag; }
    1935             : 
    1936             :     /// Interface for the list of Ruby - texts/attributes
    1937             :     sal_uInt16 FillRubyList( const SwPaM& rPam, SwRubyList& rList,
    1938             :                         sal_uInt16 nMode );
    1939             :     sal_uInt16 SetRubyList( const SwPaM& rPam, const SwRubyList& rList,
    1940             :                         sal_uInt16 nMode );
    1941             : 
    1942             :     void ReadLayoutCache( SvStream& rStream );
    1943             :     void WriteLayoutCache( SvStream& rStream );
    1944         760 :     SwLayoutCache* GetLayoutCache() const { return pLayoutCache; }
    1945             : 
    1946             :     /** Checks if any of the text node contains hidden characters.
    1947             :         Used for optimization. Changing the view option 'view hidden text'
    1948             :         has to trigger a reformatting only if some of the text is hidden.
    1949             :     */
    1950             :     bool ContainsHiddenChars() const;
    1951             : 
    1952             :     /// call back for API wrapper
    1953             :     SwModify*   GetUnoCallBack() const;
    1954             : 
    1955        1765 :     IGrammarContact* getGrammarContact() const { return mpGrammarContact; }
    1956             : 
    1957             :     /** Marks/Unmarks a list level of a certain list
    1958             : 
    1959             :         levels of a certain lists are marked now
    1960             : 
    1961             :         @param sListId    list Id of the list whose level has to be marked/unmarked
    1962             :         @param nListLevel level to mark
    1963             :         @param bValue     - true  mark the level
    1964             :                           - false unmark the level
    1965             :     */
    1966             :     void MarkListLevel( const String& sListId,
    1967             :                         const int nListLevel,
    1968             :                         const bool bValue );
    1969             : 
    1970             :     /** Marks/Unmarks a list level of a certain list
    1971             : 
    1972             :         levels of a certain lists are marked now
    1973             : 
    1974             :         @param rList      list whose level has to be marked/unmarked
    1975             :         @param nListLevel level to mark
    1976             :         @param bValue     - true  mark the level
    1977             :                           - false unmark the level
    1978             :      */
    1979             :     void MarkListLevel( SwList& rList,
    1980             :                         const int nListLevel,
    1981             :                         const bool bValue );
    1982             : 
    1983             :     /// Change a format undoable.
    1984             :     void ChgFmt(SwFmt & rFmt, const SfxItemSet & rSet);
    1985             : 
    1986             :     void RenameFmt(SwFmt & rFmt, const String & sNewName,
    1987             :                    bool bBroadcast = false);
    1988             : 
    1989             :     /// Change a TOX undoable.
    1990             :     void ChgTOX(SwTOXBase & rTOX, const SwTOXBase & rNew);
    1991             : 
    1992             :     /**
    1993             :        Returns a textual description of a PaM.
    1994             : 
    1995             :        @param rPaM     the PaM to describe
    1996             : 
    1997             :        If rPaM only spans one paragraph the result is:
    1998             : 
    1999             :             '<text in the PaM>'
    2000             : 
    2001             :        <text in the PaM> is shortened to nUndoStringLength characters.
    2002             : 
    2003             :        If rPaM spans more than one paragraph the result is:
    2004             : 
    2005             :             paragraphs                               (STR_PARAGRAPHS)
    2006             : 
    2007             :        @return the textual description of rPaM
    2008             :      */
    2009             :     String GetPaMDescr(const SwPaM & rPaM) const;
    2010             : 
    2011             :     bool IsFirstOfNumRule(SwPosition & rPos);
    2012             : 
    2013             :     // access methods for XForms model(s)
    2014             : 
    2015             :     /// access container for XForms model; will be NULL if !isXForms()
    2016             :     com::sun::star::uno::Reference<com::sun::star::container::XNameContainer>
    2017             :         getXForms() const;
    2018             : 
    2019             :     com::sun::star::uno::Reference< com::sun::star::linguistic2::XProofreadingIterator > GetGCIterator() const;
    2020             : 
    2021             :     /// is this an XForms document?
    2022             :     bool isXForms() const;
    2023             : 
    2024             :     /// initialize XForms models; turn this into an XForms document
    2025             :     void initXForms( bool bCreateDefaultModel );
    2026             :     // access methods for XForms model(s)
    2027             : 
    2028             :     //Update all the page masters
    2029             :     void SetDefaultPageMode(bool bSquaredPageMode);
    2030             :     sal_Bool IsSquaredPageMode() const;
    2031             : 
    2032          37 :     void Setn32DummyCompatabilityOptions1( sal_uInt32 CompatabilityOptions1 )
    2033             :     {
    2034          37 :         n32DummyCompatabilityOptions1 = CompatabilityOptions1;
    2035          37 :     }
    2036           4 :     sal_uInt32 Getn32DummyCompatabilityOptions1( )
    2037             :     {
    2038           4 :         return n32DummyCompatabilityOptions1;
    2039             :     }
    2040          37 :     void Setn32DummyCompatabilityOptions2( sal_uInt32 CompatabilityOptions2 )
    2041             :     {
    2042          37 :         n32DummyCompatabilityOptions2 = CompatabilityOptions2;
    2043          37 :     }
    2044           4 :     sal_uInt32 Getn32DummyCompatabilityOptions2( )
    2045             :     {
    2046           4 :         return n32DummyCompatabilityOptions2;
    2047             :     }
    2048             :     com::sun::star::uno::Reference< com::sun::star::script::vba::XVBAEventProcessor > GetVbaEventProcessor();
    2049           8 :     void SetVBATemplateToProjectCache( com::sun::star::uno::Reference< com::sun::star::container::XNameContainer >& xCache ) { m_xTemplateToProjectCache = xCache; };
    2050          31 :         com::sun::star::uno::Reference< com::sun::star::container::XNameContainer > GetVBATemplateToProjectCache() { return m_xTemplateToProjectCache; };
    2051             :     ::sfx2::IXmlIdRegistry& GetXmlIdRegistry();
    2052             :     ::sw::MetaFieldManager & GetMetaFieldManager();
    2053             :     ::sw::UndoManager      & GetUndoManager();
    2054             :     ::sw::UndoManager const& GetUndoManager() const;
    2055             :     SfxObjectShell* CreateCopy(bool bCallInitNew) const;
    2056             : 
    2057             :     /**
    2058             :      * Dumps the entire nodes structure to the given destination (file nodes.xml in the current directory by default)
    2059             :      * @since 3.5
    2060             :      */
    2061             :     void dumpAsXml( xmlTextWriterPtr writer = NULL );
    2062             : 
    2063             :     /// must be called only in SwDocShell::InitNew, causes UpdateDrawDefaults to be called when drawing layer is created
    2064             :     void SetDrawDefaults();
    2065             : 
    2066             : private:
    2067             :     /// method to set new graphics pool defaults, must only be called by SetDrawDefaults!
    2068             :     void UpdateDrawDefaults();
    2069             :     /// Copies master header to left / first one, if necessary - used by ChgPageDesc().
    2070             :     void CopyMasterHeader(const SwPageDesc &rChged, const SwFmtHeader &rHead, SwPageDesc *pDesc, bool bLeft);
    2071             :     /// Copies master footer to left / first one, if necessary - used by ChgPageDesc().
    2072             :     void CopyMasterFooter(const SwPageDesc &rChged, const SwFmtFooter &rFoot, SwPageDesc *pDesc, bool bLeft);
    2073             : };
    2074             : 
    2075             : // This method is called in Dtor of SwDoc and deletes cache of ContourObjects.
    2076             : void ClrContourCache();
    2077             : 
    2078             : inline const SwTableNode* SwDoc::IsIdxInTbl( const SwNodeIndex& rIdx ) const
    2079             : {
    2080             :     return ((SwDoc*)this)->IsIdxInTbl( rIdx );
    2081             : }
    2082             : 
    2083         255 : inline SvNumberFormatter* SwDoc::GetNumberFormatter( sal_Bool bCreate )
    2084             : {
    2085         255 :     if( bCreate && !pNumberFormatter )
    2086         237 :         _CreateNumberFormatter();
    2087         255 :     return pNumberFormatter;
    2088             : }
    2089             : 
    2090           0 : inline const SvNumberFormatter* SwDoc::GetNumberFormatter( sal_Bool bCreate ) const
    2091             : {
    2092           0 :     return ((SwDoc*)this)->GetNumberFormatter( bCreate );
    2093             : }
    2094             : 
    2095           2 : inline void SwDoc::SetOLEPrtNotifyPending( bool bSet )
    2096             : {
    2097           2 :     mbOLEPrtNotifyPending = bSet;
    2098           2 :     if( !bSet )
    2099           0 :         mbAllOLENotify = sal_False;
    2100           2 : }
    2101             : 
    2102             : // namespace <docfunc> for functions and procedures working on a Writer document.
    2103             : namespace docfunc
    2104             : {
    2105             :     /** method to check, if given Writer document contains at least one drawing object
    2106             : 
    2107             :         @author OD
    2108             : 
    2109             :         @param p_rDoc
    2110             :         input parameter - reference to the Writer document, which is investigated.
    2111             :     */
    2112             :     bool ExistsDrawObjs( SwDoc& p_rDoc );
    2113             : 
    2114             :     /** method to check, if given Writer document contains only drawing objects,
    2115             :         which are completely on its page.
    2116             : 
    2117             :         @author OD
    2118             : 
    2119             :         @param p_rDoc
    2120             :         input parameter - reference to the Writer document, which is investigated.
    2121             :     */
    2122             :     bool AllDrawObjsOnPage( SwDoc& p_rDoc );
    2123             : 
    2124             :     /** method to check, if the outline style has to written as a normal list style
    2125             : 
    2126             :         #i69627#
    2127             :         The outline style has to written as a normal list style, if a parent
    2128             :         paragraph style of one of the paragraph styles, which are assigned to
    2129             :         the list levels of the outline style, has a list style set or inherits
    2130             :         a list style from its parent paragraphs style.
    2131             :         This information is needed for the OpenDocument file format export.
    2132             : 
    2133             :         @author OD
    2134             : 
    2135             :         @param rDoc
    2136             :         input parameter - reference to the text document, which is investigated.
    2137             : 
    2138             :         @return boolean
    2139             :         indicating, if the outline style has to written as a normal list style
    2140             :     */
    2141             :     bool HasOutlineStyleToBeWrittenAsNormalListStyle( SwDoc& rDoc );
    2142             : }
    2143             : #endif  //_DOC_HXX
    2144             : 
    2145             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10