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 558 : 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 151565 : inline bool IsInDtor() const { return mbDtor; }
706 :
707 : /* @@@MAINTAINABILITY-HORROR@@@
708 : Implementation details made public.
709 : */
710 425219 : SwNodes & GetNodes() { return *m_pNodes; }
711 28635 : 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 :
969 : /** IDocumentChartDataProviderAccess
970 : */
971 : virtual SwChartDataProvider * GetChartDataProvider( bool bCreate = false ) const;
972 : virtual void CreateChartInternalDataProviders( const SwTable *pTable );
973 : virtual SwChartLockController_Helper & GetChartControllerHelper();
974 :
975 : /** IDocumentListItems
976 : */
977 : virtual void addListItem( const SwNodeNum& rNodeNum );
978 : virtual void removeListItem( const SwNodeNum& rNodeNum );
979 : virtual String getListItemText( const SwNodeNum& rNodeNum,
980 : const bool bWithNumber = true,
981 : const bool bWithSpacesForLevel = false ) const;
982 : virtual void getListItems( IDocumentListItems::tSortedNodeNumList& orNodeNumList ) const;
983 : virtual void getNumItems( IDocumentListItems::tSortedNodeNumList& orNodeNumList ) const;
984 :
985 : /** IDocumentOutlineNodes
986 : */
987 : virtual sal_Int32 getOutlineNodesCount() const;
988 : virtual int getOutlineLevel( const sal_Int32 nIdx ) const;
989 : virtual String getOutlineText( const sal_Int32 nIdx,
990 : const bool bWithNumber,
991 : const bool bWithSpacesForLevel ) const;
992 : virtual SwTxtNode* getOutlineNode( const sal_Int32 nIdx ) const;
993 : virtual void getOutlineNodes( IDocumentOutlineNodes::tSortedOutlineNodeList& orOutlineNodeList ) const;
994 :
995 : /** IDocumentListsAccess
996 : */
997 : virtual SwList* createList( String sListId,
998 : const String sDefaultListStyleName );
999 : virtual void deleteList( const String sListId );
1000 : virtual SwList* getListByName( const String sListId ) const;
1001 : virtual SwList* createListForListStyle( const String sListStyleName );
1002 : virtual SwList* getListForListStyle( const String sListStyleName ) const;
1003 : virtual void deleteListForListStyle( const String sListStyleName );
1004 : virtual void trackChangeOfListStyleName( const String sListStyleName,
1005 : const String sNewListStyleName );
1006 :
1007 : /** IDocumentExternalData */
1008 : virtual void setExternalData(::sw::tExternalDataType eType,
1009 : ::sw::tExternalDataPointer pPayload);
1010 : virtual ::sw::tExternalDataPointer getExternalData(::sw::tExternalDataType eType);
1011 :
1012 : /** INextInterface here
1013 : */
1014 :
1015 : DECL_STATIC_LINK( SwDoc, BackgroundDone, SvxBrushItem *);
1016 : DECL_LINK(CalcFieldValueHdl, EditFieldInfo*);
1017 :
1018 : /** OLE ???
1019 : */
1020 1182 : bool IsOLEPrtNotifyPending() const { return mbOLEPrtNotifyPending; }
1021 : inline void SetOLEPrtNotifyPending( bool bSet = true );
1022 : void PrtOLENotify( sal_Bool bAll ); //All or only marked
1023 :
1024 : #ifdef DBG_UTIL
1025 : bool InXMLExport() const { return mbXMLExport; }
1026 : void SetXMLExport( bool bFlag ) { mbXMLExport = bFlag; }
1027 : #endif
1028 :
1029 : /** Returns positions of all FlyFrames in the document.
1030 : If a Pam-Pointer is passed the FlyFrames attached to paragraphes
1031 : have to be surrounded completely by ::com::sun::star::awt::Selection.
1032 : ( Start < Pos < End ) !!!
1033 : (Required for Writers.) */
1034 : void GetAllFlyFmts( SwPosFlyFrms& rPosFlyFmts, const SwPaM* = 0,
1035 : bool bDrawAlso = false,
1036 : bool bAsCharAlso = false ) const;
1037 :
1038 : /// Because swrtf.cxx and define private public here now.
1039 : SwFlyFrmFmt *MakeFlyFrmFmt (const String &rFmtName, SwFrmFmt *pDerivedFrom);
1040 : SwDrawFrmFmt *MakeDrawFrmFmt(const String &rFmtName, SwFrmFmt *pDerivedFrom);
1041 :
1042 : // From now on this interface has to be used for Flys.
1043 : // pAnchorPos must be set, if they are not attached to pages AND
1044 : // ::com::sun::star::chaos::Anchor is not already set at valid CntntPos
1045 : // in FlySet/FrmFmt.
1046 : /* new parameter bCalledFromShell
1047 :
1048 : sal_True: An existing adjust item at pAnchorPos is propagated to
1049 : the content node of the new fly section. That propagation only
1050 : takes place if there is no adjust item in the paragraph style
1051 : for the new fly section.
1052 :
1053 : sal_False: no propagation
1054 : */
1055 : SwFlyFrmFmt* MakeFlySection( RndStdIds eAnchorType,
1056 : const SwPosition* pAnchorPos,
1057 : const SfxItemSet* pSet = 0,
1058 : SwFrmFmt *pParent = 0,
1059 : bool bCalledFromShell = false );
1060 : SwFlyFrmFmt* MakeFlyAndMove( const SwPaM& rPam, const SfxItemSet& rSet,
1061 : const SwSelBoxes* pSelBoxes = 0,
1062 : SwFrmFmt *pParent = 0 );
1063 :
1064 : void CopyWithFlyInFly( const SwNodeRange& rRg,
1065 : const xub_StrLen nEndContentIndex,
1066 : const SwNodeIndex& rInsPos,
1067 : sal_Bool bMakeNewFrms = sal_True,
1068 : sal_Bool bDelRedlines = sal_True,
1069 : sal_Bool bCopyFlyAtFly = sal_False ) const;
1070 :
1071 : bool SetFlyFrmAttr( SwFrmFmt& rFlyFmt, SfxItemSet& rSet );
1072 :
1073 : bool SetFrmFmtToFly( SwFrmFmt& rFlyFmt, SwFrmFmt& rNewFmt,
1074 : SfxItemSet* pSet = 0, bool bKeepOrient = false );
1075 : void SetFlyFrmTitle( SwFlyFrmFmt& rFlyFrmFmt,
1076 : const String& sNewTitle );
1077 : void SetFlyFrmDescription( SwFlyFrmFmt& rFlyFrmFmt,
1078 : const String& sNewDescription );
1079 :
1080 : /** Footnotes
1081 : */
1082 : // Footnote information
1083 2287 : const SwFtnInfo& GetFtnInfo() const { return *pFtnInfo; }
1084 : void SetFtnInfo(const SwFtnInfo& rInfo);
1085 972 : const SwEndNoteInfo& GetEndNoteInfo() const { return *pEndNoteInfo; }
1086 : void SetEndNoteInfo(const SwEndNoteInfo& rInfo);
1087 5013 : SwFtnIdxs& GetFtnIdxs() { return *pFtnIdxs; }
1088 10 : const SwFtnIdxs& GetFtnIdxs() const { return *pFtnIdxs; }
1089 : /// change footnotes in area
1090 : bool SetCurFtn( const SwPaM& rPam, const String& rNumStr,
1091 : sal_uInt16 nNumber, bool bIsEndNote );
1092 :
1093 : /** Operations on the content of the document e.g.
1094 : spell-checking/hyphenating/word-counting
1095 : */
1096 : ::com::sun::star::uno::Any
1097 : Spell( SwPaM&, ::com::sun::star::uno::Reference<
1098 : ::com::sun::star::linguistic2::XSpellChecker1 > &,
1099 : sal_uInt16* pPageCnt, sal_uInt16* pPageSt, bool bGrammarCheck,
1100 : SwConversionArgs *pConvArgs = 0 ) const;
1101 :
1102 : ::com::sun::star::uno::Reference<
1103 : ::com::sun::star::linguistic2::XHyphenatedWord >
1104 : Hyphenate( SwPaM *pPam, const Point &rCrsrPos,
1105 : sal_uInt16* pPageCnt, sal_uInt16* pPageSt );
1106 :
1107 : /// count words in pam
1108 : void CountWords( const SwPaM& rPaM, SwDocStat& rStat ) const;
1109 :
1110 : /// Glossary Document
1111 : void SetGlossDoc( bool bGlssDc = true ) { mbGlossDoc = bGlssDc; }
1112 458 : bool IsInsOnlyTextGlossary() const { return mbInsOnlyTxtGlssry; }
1113 :
1114 : void Summary( SwDoc* pExtDoc, sal_uInt8 nLevel, sal_uInt8 nPara, bool bImpress );
1115 :
1116 : void ChangeAuthorityData(const SwAuthEntry* pNewData);
1117 :
1118 6773 : bool IsInCallModified() const { return mbInCallModified; }
1119 : bool IsInHeaderFooter( const SwNodeIndex& rIdx ) const;
1120 : short GetTextDirection( const SwPosition& rPos,
1121 : const Point* pPt = 0 ) const;
1122 : bool IsInVerticalText( const SwPosition& rPos,
1123 : const Point* pPt = 0 ) const;
1124 :
1125 : /** Database and DB-Manager
1126 : */
1127 0 : void SetNewDBMgr( SwNewDBMgr* pNewMgr ) { pNewDBMgr = pNewMgr; }
1128 221 : SwNewDBMgr* GetNewDBMgr() const { return pNewDBMgr; }
1129 : void ChangeDBFields( const std::vector<String>& rOldNames,
1130 : const String& rNewName );
1131 : void SetInitDBFields(sal_Bool b);
1132 :
1133 : /// Find out which databases are used by fields.
1134 : void GetAllUsedDB( std::vector<String>& rDBNameList,
1135 : const std::vector<String>* pAllDBNames = 0 );
1136 :
1137 : void ChgDBData( const SwDBData& rNewData );
1138 : SwDBData GetDBData();
1139 : const SwDBData& GetDBDesc();
1140 : const SwDBData& _GetDBDesc() const { return aDBData; }
1141 :
1142 : /** Some helper functions
1143 : */
1144 : String GetUniqueGrfName() const;
1145 : String GetUniqueOLEName() const;
1146 : String GetUniqueFrameName() const;
1147 :
1148 : std::set<SwRootFrm*> GetAllLayouts();//swmod 080225
1149 :
1150 : void SetFlyName( SwFlyFrmFmt& rFmt, const String& rName );
1151 : const SwFlyFrmFmt* FindFlyByName( const String& rName, sal_Int8 nNdTyp = 0 ) const;
1152 :
1153 : void GetGrfNms( const SwFlyFrmFmt& rFmt, String* pGrfName,
1154 : String* pFltName ) const;
1155 :
1156 : /// Set a valid name for all Flys that have none (Called by Readers after reading).
1157 : void SetAllUniqueFlyNames();
1158 :
1159 : /** Reset attributes. All TxtHints and (if completely selected) all hard-
1160 : formated stuff (auto-formats) are removed.
1161 : Introduce new optional parameter <bSendDataChangedEvents> in order to
1162 : control, if the side effect "send data changed events" is triggered or not. */
1163 : void ResetAttrs( const SwPaM &rRg,
1164 : bool bTxtAttr = true,
1165 : const std::set<sal_uInt16> &rAttrs = std::set<sal_uInt16>(),
1166 : const bool bSendDataChangedEvents = true );
1167 : void RstTxtAttrs(const SwPaM &rRg, bool bInclRefToxMark = false );
1168 :
1169 : /** Set attribute in given format.
1170 : If Undo is activated, the old one is listed in Undo-History. */
1171 : void SetAttr( const SfxPoolItem&, SwFmt& );
1172 : void SetAttr( const SfxItemSet&, SwFmt& );
1173 :
1174 : /// method to reset a certain attribute at the given format
1175 : void ResetAttrAtFormat( const sal_uInt16 nWhichId,
1176 : SwFmt& rChangedFormat );
1177 :
1178 : /** Set attribute as new default attribute in current document.
1179 : If Undo is activated, the old one is listed in Undo-History. */
1180 : void SetDefault( const SfxPoolItem& );
1181 : void SetDefault( const SfxItemSet& );
1182 :
1183 : /// Query default attribute in this document.
1184 : const SfxPoolItem& GetDefault( sal_uInt16 nFmtHint ) const;
1185 :
1186 : /// Do not expand text attributes.
1187 : bool DontExpandFmt( const SwPosition& rPos, bool bFlag = true );
1188 :
1189 : /* Formats */
1190 0 : const SwFrmFmts* GetFrmFmts() const { return pFrmFmtTbl; }
1191 84 : SwFrmFmts* GetFrmFmts() { return pFrmFmtTbl; }
1192 4675 : const SwCharFmts* GetCharFmts() const { return pCharFmtTbl;}
1193 :
1194 : /** LayoutFormats (frames, DrawObjects), sometimes const sometimes not */
1195 1140 : const SwFrmFmts* GetSpzFrmFmts() const { return pSpzFrmFmtTbl; }
1196 10944 : SwFrmFmts* GetSpzFrmFmts() { return pSpzFrmFmtTbl; }
1197 :
1198 : const SwFrmFmt *GetDfltFrmFmt() const { return pDfltFrmFmt; }
1199 3319 : SwFrmFmt *GetDfltFrmFmt() { return pDfltFrmFmt; }
1200 : const SwFrmFmt *GetEmptyPageFmt() const { return pEmptyPageFmt; }
1201 565 : SwFrmFmt *GetEmptyPageFmt() { return pEmptyPageFmt; }
1202 : const SwFrmFmt *GetColumnContFmt() const{ return pColumnContFmt; }
1203 4 : SwFrmFmt *GetColumnContFmt() { return pColumnContFmt; }
1204 0 : const SwCharFmt *GetDfltCharFmt() const { return pDfltCharFmt;}
1205 31928 : SwCharFmt *GetDfltCharFmt() { return pDfltCharFmt;}
1206 :
1207 : /// @return the interface of the management of (auto)styles
1208 71397 : IStyleAccess& GetIStyleAccess() { return *pStyleAccess; }
1209 :
1210 : /// Remove all language dependencies from all existing formats
1211 : void RemoveAllFmtLanguageDependencies();
1212 :
1213 : SwFrmFmt *MakeFrmFmt(const String &rFmtName, SwFrmFmt *pDerivedFrom,
1214 : bool bBroadcast = false, bool bAuto = true);
1215 : void DelFrmFmt( SwFrmFmt *pFmt, bool bBroadcast = false );
1216 796 : SwFrmFmt* FindFrmFmtByName( const String& rName ) const
1217 796 : { return (SwFrmFmt*)FindFmtByName( (SwFmtsBase&)*pFrmFmtTbl, rName ); }
1218 :
1219 : SwCharFmt *MakeCharFmt(const String &rFmtName, SwCharFmt *pDerivedFrom,
1220 : bool bBroadcast = false,
1221 : bool bAuto = true );
1222 : void DelCharFmt(sal_uInt16 nFmt, bool bBroadcast = false);
1223 : void DelCharFmt(SwCharFmt* pFmt, bool bBroadcast = false);
1224 11350 : SwCharFmt* FindCharFmtByName( const String& rName ) const
1225 11350 : { return (SwCharFmt*)FindFmtByName( (SwFmtsBase&)*pCharFmtTbl, rName ); }
1226 :
1227 : /* Formatcollections (styles) */
1228 : // TXT
1229 200 : const SwTxtFmtColl* GetDfltTxtFmtColl() const { return pDfltTxtFmtColl; }
1230 7693 : const SwTxtFmtColls *GetTxtFmtColls() const { return pTxtFmtCollTbl; }
1231 : SwTxtFmtColl *MakeTxtFmtColl( const String &rFmtName,
1232 : SwTxtFmtColl *pDerivedFrom,
1233 : bool bBroadcast = false,
1234 : bool bAuto = true );
1235 : SwConditionTxtFmtColl* MakeCondTxtFmtColl( const String &rFmtName,
1236 : SwTxtFmtColl *pDerivedFrom,
1237 : bool bBroadcast = false);
1238 : void DelTxtFmtColl(sal_uInt16 nFmt, bool bBroadcast = false);
1239 : void DelTxtFmtColl( SwTxtFmtColl* pColl, bool bBroadcast = false );
1240 : /** Add 4th optional parameter <bResetListAttrs>.
1241 : 'side effect' of <SetTxtFmtColl> with <bReset = true> is that the hard
1242 : attributes of the affected text nodes are cleared, except the break
1243 : attribute, the page description attribute and the list style attribute.
1244 : The new parameter <bResetListAttrs> indicates, if the list attributes
1245 : (list style, restart at and restart with) are cleared as well in case
1246 : that <bReset = true> and the paragraph style has a list style attribute set. */
1247 : bool SetTxtFmtColl( const SwPaM &rRg, SwTxtFmtColl *pFmt,
1248 : bool bReset = true,
1249 : bool bResetListAttrs = false );
1250 65133 : SwTxtFmtColl* FindTxtFmtCollByName( const String& rName ) const
1251 65133 : { return (SwTxtFmtColl*)FindFmtByName( (SwFmtsBase&)*pTxtFmtCollTbl, rName ); }
1252 :
1253 : void ChkCondColls();
1254 :
1255 16 : const SwGrfFmtColl* GetDfltGrfFmtColl() const { return pDfltGrfFmtColl; }
1256 0 : const SwGrfFmtColls *GetGrfFmtColls() const { return pGrfFmtCollTbl; }
1257 : SwGrfFmtColl *MakeGrfFmtColl(const String &rFmtName,
1258 : SwGrfFmtColl *pDerivedFrom);
1259 2 : SwGrfFmtColl* FindGrfFmtCollByName( const String& rName ) const
1260 2 : { return (SwGrfFmtColl*)FindFmtByName( (SwFmtsBase&)*pGrfFmtCollTbl, rName ); }
1261 :
1262 : /// Table formating
1263 : const SwFrmFmts* GetTblFrmFmts() const { return pTblFrmFmtTbl; }
1264 589 : SwFrmFmts* GetTblFrmFmts() { return pTblFrmFmtTbl; }
1265 : sal_uInt16 GetTblFrmFmtCount( bool bUsed ) const;
1266 : SwFrmFmt& GetTblFrmFmt(sal_uInt16 nFmt, bool bUsed ) const;
1267 : SwTableFmt* MakeTblFrmFmt(const String &rFmtName, SwFrmFmt *pDerivedFrom);
1268 : void DelTblFrmFmt( SwTableFmt* pFmt );
1269 : SwTableFmt* FindTblFmtByName( const String& rName, sal_Bool bAll = sal_False ) const;
1270 :
1271 : /** Access to frames.
1272 : Iterate over Flys - forr Basic-Collections. */
1273 : sal_uInt16 GetFlyCount( FlyCntType eType = FLYCNTTYPE_ALL) const;
1274 : SwFrmFmt* GetFlyNum(sal_uInt16 nIdx, FlyCntType eType = FLYCNTTYPE_ALL);
1275 :
1276 : /// Copy formats in own arrays and return them.
1277 : SwFrmFmt *CopyFrmFmt ( const SwFrmFmt& );
1278 : SwCharFmt *CopyCharFmt( const SwCharFmt& );
1279 : SwTxtFmtColl* CopyTxtColl( const SwTxtFmtColl& rColl );
1280 : SwGrfFmtColl* CopyGrfColl( const SwGrfFmtColl& rColl );
1281 :
1282 : /// Replace all styles with those from rSource.
1283 : void ReplaceStyles( const SwDoc& rSource, bool bIncludePageStyles = true );
1284 :
1285 : /// Replace all property defaults with those from rSource.
1286 : void ReplaceDefaults( const SwDoc& rSource );
1287 :
1288 : /// Replace all compatability options with those from rSource.
1289 : void ReplaceCompatabilityOptions(const SwDoc& rSource);
1290 :
1291 : /// Query if style (paragraph- / character- / frame- / page-) is used.
1292 : bool IsUsed( const SwModify& ) const;
1293 : bool IsUsed( const SwNumRule& ) const;
1294 :
1295 : /// Set name of newly loaded document template.
1296 : sal_uInt16 SetDocPattern( const String& rPatternName );
1297 :
1298 : /// @return name of document template. Can be 0!
1299 0 : const String* GetDocPattern( sal_uInt16 nPos ) const
1300 : {
1301 0 : if(nPos >= aPatternNms.size())
1302 0 : return NULL;
1303 0 : if(boost::is_null(aPatternNms.begin() + nPos))
1304 0 : return NULL;
1305 0 : return &(aPatternNms[nPos]);
1306 : }
1307 :
1308 : /// Delete all unreferenced field types.
1309 : void GCFieldTypes(); ///< impl. in docfld.cxx
1310 :
1311 : /// Query / connect current document with glossary document.
1312 : void SetGlossaryDoc( SwDoc* pDoc ) { pGlossaryDoc = pDoc; }
1313 :
1314 : /// travel over PaM Ring
1315 : bool InsertGlossary( SwTextBlocks& rBlock, const String& rEntry,
1316 : SwPaM& rPaM, SwCrsrShell* pShell = 0);
1317 :
1318 : /** get the set of printable pages for the XRenderable API by
1319 : evaluating the respective settings (see implementation) */
1320 : void CalculatePagesForPrinting( const SwRootFrm& rLayout, SwRenderData &rData, const SwPrintUIOptions &rOptions, bool bIsPDFExport,
1321 : sal_Int32 nDocPageCount );
1322 : void UpdatePagesForPrintingWithPostItData( SwRenderData &rData, const SwPrintUIOptions &rOptions, bool bIsPDFExport,
1323 : sal_Int32 nDocPageCount );
1324 : void CalculatePagePairsForProspectPrinting( const SwRootFrm& rLayout, SwRenderData &rData, const SwPrintUIOptions &rOptions,
1325 : sal_Int32 nDocPageCount );
1326 :
1327 : /// PageDescriptor interface.
1328 2952 : sal_uInt16 GetPageDescCnt() const { return aPageDescs.size(); }
1329 0 : const SwPageDesc& GetPageDesc( const sal_uInt16 i ) const { return *aPageDescs[i]; }
1330 4566 : SwPageDesc& GetPageDesc( sal_uInt16 i ) { return *aPageDescs[i]; }
1331 : SwPageDesc* FindPageDescByName( const String& rName,
1332 : sal_uInt16* pPos = 0 ) const;
1333 :
1334 : /** Copy the complete PageDesc - beyond document and "deep"!
1335 : Optionally copying of PoolFmtId, -HlpId can be prevented. */
1336 : void CopyPageDesc( const SwPageDesc& rSrcDesc, SwPageDesc& rDstDesc,
1337 : bool bCopyPoolIds = true );
1338 :
1339 : /** Copy header (with contents) from SrcFmt to DestFmt
1340 : (can also be copied into other document). */
1341 902 : void CopyHeader( const SwFrmFmt& rSrcFmt, SwFrmFmt& rDestFmt )
1342 902 : { CopyPageDescHeaderFooterImpl( true, rSrcFmt, rDestFmt ); }
1343 :
1344 : /** Copy footer (with contents) from SrcFmt to DestFmt.
1345 : (can also be copied into other document). */
1346 886 : void CopyFooter( const SwFrmFmt& rSrcFmt, SwFrmFmt& rDestFmt )
1347 886 : { CopyPageDescHeaderFooterImpl( false, rSrcFmt, rDestFmt ); }
1348 :
1349 : //For Reader.
1350 :
1351 : SwPageDesc * GetPageDesc( const String & rName );
1352 : void ChgPageDesc( const String & rName, const SwPageDesc& );
1353 : void ChgPageDesc( sal_uInt16 i, const SwPageDesc& );
1354 : bool FindPageDesc( const String & rName, sal_uInt16 * pFound );
1355 : void DelPageDesc( const String & rName, bool bBroadcast = false);
1356 : void DelPageDesc( sal_uInt16 i, bool bBroadcast = false );
1357 : void PreDelPageDesc(SwPageDesc * pDel);
1358 : sal_uInt16 MakePageDesc( const String &rName, const SwPageDesc* pCpy = 0,
1359 : bool bRegardLanguage = true,
1360 : bool bBroadcast = false);
1361 : void BroadcastStyleOperation(String rName, SfxStyleFamily eFamily,
1362 : sal_uInt16 nOp);
1363 :
1364 : /** The html import sometimes overwrites the
1365 : page sizes set in the page descriptions. This function is used to
1366 : correct this. */
1367 : void CheckDefaultPageFmt();
1368 :
1369 : /// Methods for tables/indices.
1370 :
1371 : sal_uInt16 GetCurTOXMark( const SwPosition& rPos, SwTOXMarks& ) const;
1372 : void DeleteTOXMark( const SwTOXMark* pTOXMark );
1373 : const SwTOXMark& GotoTOXMark( const SwTOXMark& rCurTOXMark,
1374 : SwTOXSearch eDir, sal_Bool bInReadOnly );
1375 :
1376 : /// Insert/Renew table/indes.
1377 : const SwTOXBaseSection* InsertTableOf( const SwPosition& rPos,
1378 : const SwTOXBase& rTOX,
1379 : const SfxItemSet* pSet = 0,
1380 : bool bExpand = false );
1381 : const SwTOXBaseSection* InsertTableOf( sal_uLong nSttNd, sal_uLong nEndNd,
1382 : const SwTOXBase& rTOX,
1383 : const SfxItemSet* pSet = 0 );
1384 : const SwTOXBase* GetCurTOX( const SwPosition& rPos ) const;
1385 : const SwAttrSet& GetTOXBaseAttrSet(const SwTOXBase& rTOX) const;
1386 :
1387 : bool DeleteTOX( const SwTOXBase& rTOXBase, bool bDelNodes = false );
1388 : String GetUniqueTOXBaseName( const SwTOXType& rType,
1389 : const String* pChkStr = 0 ) const;
1390 :
1391 : bool SetTOXBaseName(const SwTOXBase& rTOXBase, const String& rName);
1392 : void SetTOXBaseProtection(const SwTOXBase& rTOXBase, sal_Bool bProtect);
1393 :
1394 : /// After reading file update all tables/indices.
1395 0 : void SetUpdateTOX( bool bFlag = true ) { mbUpdateTOX = bFlag; }
1396 478 : bool IsUpdateTOX() const { return mbUpdateTOX; }
1397 :
1398 4 : const String& GetTOIAutoMarkURL() const {return sTOIAutoMarkURL;}
1399 0 : void SetTOIAutoMarkURL(const String& rSet) {sTOIAutoMarkURL = rSet;}
1400 : void ApplyAutoMark();
1401 :
1402 29282 : bool IsInReading() const { return mbInReading; }
1403 1078 : void SetInReading( bool bNew ) { mbInReading = bNew; }
1404 :
1405 4550 : bool IsClipBoard() const { return mbClipBoard; }
1406 : /// N.B.: must be called right after constructor! (@see GetXmlIdRegistry)
1407 0 : void SetClipBoard( bool bNew ) { mbClipBoard = bNew; }
1408 :
1409 0 : bool IsColumnSelection() const { return mbColumnSelection; }
1410 0 : void SetColumnSelection( bool bNew ) { mbColumnSelection = bNew; }
1411 :
1412 20427 : bool IsInXMLImport() const { return mbInXMLImport; }
1413 376 : void SetInXMLImport( bool bNew ) { mbInXMLImport = bNew; }
1414 :
1415 : /// Manage types of tables/indices.
1416 : sal_uInt16 GetTOXTypeCount( TOXTypes eTyp ) const;
1417 : const SwTOXType* GetTOXType( TOXTypes eTyp, sal_uInt16 nId ) const;
1418 : sal_Bool DeleteTOXType( TOXTypes eTyp, sal_uInt16 nId );
1419 : const SwTOXType* InsertTOXType( const SwTOXType& rTyp );
1420 0 : const SwTOXTypes& GetTOXTypes() const { return *pTOXTypes; }
1421 :
1422 : const SwTOXBase* GetDefaultTOXBase( TOXTypes eTyp, bool bCreate = false );
1423 : void SetDefaultTOXBase(const SwTOXBase& rBase);
1424 :
1425 : /// Key for management of index.
1426 : sal_uInt16 GetTOIKeys( SwTOIKeyType eTyp, std::vector<String>& rArr ) const;
1427 :
1428 : /// Sort table text.
1429 : bool SortTbl(const SwSelBoxes& rBoxes, const SwSortOptions&);
1430 : bool SortText(const SwPaM&, const SwSortOptions&);
1431 :
1432 : // Correct the SwPosition-Objects that are registered with the document
1433 : // e. g. ::com::sun::star::text::Bookmarks or tables/indices.
1434 : // If bMoveCrsr is set move Crsr too.
1435 :
1436 : /// Set everything in rOldNode on rNewPos + Offset.
1437 : void CorrAbs( const SwNodeIndex& rOldNode, const SwPosition& rNewPos,
1438 : const xub_StrLen nOffset = 0, sal_Bool bMoveCrsr = sal_False );
1439 :
1440 : /// Set everything in the range of [rStartNode, rEndNode] to rNewPos.
1441 : void CorrAbs( const SwNodeIndex& rStartNode, const SwNodeIndex& rEndNode,
1442 : const SwPosition& rNewPos, sal_Bool bMoveCrsr = sal_False );
1443 :
1444 : /// Set everything in this range from rRange to rNewPos.
1445 : void CorrAbs( const SwPaM& rRange, const SwPosition& rNewPos,
1446 : sal_Bool bMoveCrsr = sal_False );
1447 :
1448 : /// Set everything in rOldNode to relative Pos.
1449 : void CorrRel( const SwNodeIndex& rOldNode, const SwPosition& rNewPos,
1450 : const xub_StrLen nOffset = 0, sal_Bool bMoveCrsr = sal_False );
1451 :
1452 : /// Query / set rules for Outline.
1453 26337 : inline SwNumRule* GetOutlineNumRule() const
1454 : {
1455 26337 : return pOutlineRule;
1456 : }
1457 : void SetOutlineNumRule( const SwNumRule& rRule );
1458 : void PropagateOutlineRule();
1459 :
1460 : /// Outline - promote / demote.
1461 : bool OutlineUpDown( const SwPaM& rPam, short nOffset = 1 );
1462 :
1463 : /// Ountline - move up / move down.
1464 : bool MoveOutlinePara( const SwPaM& rPam, short nOffset = 1);
1465 :
1466 : bool GotoOutline( SwPosition& rPos, const String& rName ) const;
1467 :
1468 : /** Accept changes of outline styles for OUtlineRule.
1469 : re-use unused 3rd parameter
1470 : Add optional parameter <bResetIndentAttrs> - default value sal_False.
1471 : If <bResetIndentAttrs> equals true, the indent attributes "before text"
1472 : and "first line indent" are additionally reset at the provided PaM, if
1473 : the list style makes use of the new list level attributes.
1474 : introduce parameters <bCreateNewList> and <sContinuedListId>
1475 : <bCreateNewList> indicates, if a new list is created by applying the
1476 : given list style. */
1477 : void SetNumRule( const SwPaM&,
1478 : const SwNumRule&,
1479 : const bool bCreateNewList,
1480 : const String sContinuedListId = String(),
1481 : bool bSetItem = true,
1482 : const bool bResetIndentAttrs = false );
1483 : void SetCounted( const SwPaM&, bool bCounted);
1484 :
1485 : void MakeUniqueNumRules(const SwPaM & rPaM);
1486 :
1487 : void SetNumRuleStart( const SwPosition& rPos, sal_Bool bFlag = sal_True );
1488 : void SetNodeNumStart( const SwPosition& rPos, sal_uInt16 nStt );
1489 :
1490 : SwNumRule* GetCurrNumRule( const SwPosition& rPos ) const;
1491 :
1492 7571 : const SwNumRuleTbl& GetNumRuleTbl() const { return *pNumRuleTbl; }
1493 :
1494 : /**
1495 : Add numbering rule to document.
1496 :
1497 : @param pRule rule to add
1498 : */
1499 : void AddNumRule(SwNumRule * pRule);
1500 :
1501 : /// add optional parameter <eDefaultNumberFormatPositionAndSpaceMode>
1502 : sal_uInt16 MakeNumRule( const String &rName,
1503 : const SwNumRule* pCpy = 0,
1504 : bool bBroadcast = false,
1505 : const SvxNumberFormat::SvxNumPositionAndSpaceMode eDefaultNumberFormatPositionAndSpaceMode =
1506 : SvxNumberFormat::LABEL_WIDTH_AND_POSITION );
1507 : sal_uInt16 FindNumRule( const String& rName ) const;
1508 : SwNumRule* FindNumRulePtr( const String& rName ) const;
1509 :
1510 : /// Deletion only possible if ::com::sun::star::chaos::Rule is not used!
1511 : bool RenameNumRule(const String & aOldName, const String & aNewName,
1512 : bool bBroadcast = false);
1513 : bool DelNumRule( const String& rName, bool bBroadCast = false );
1514 : String GetUniqueNumRuleName( const String* pChkStr = 0, bool bAutoNum = true ) const;
1515 :
1516 : void UpdateNumRule(); /// Update all invalids.
1517 : void ChgNumRuleFmts( const SwNumRule& rRule, const String * pOldName = 0 );
1518 : bool ReplaceNumRule( const SwPosition& rPos, const String& rOldRule,
1519 : const String& rNewRule );
1520 :
1521 : /// Goto next/previous on same level.
1522 : bool GotoNextNum( SwPosition&, bool bOverUpper = true,
1523 : sal_uInt8* pUpper = 0, sal_uInt8* pLower = 0 );
1524 : bool GotoPrevNum( SwPosition&, bool bOverUpper = true,
1525 : sal_uInt8* pUpper = 0, sal_uInt8* pLower = 0 );
1526 :
1527 : /** Searches for a text node with a numbering rule.
1528 :
1529 : add optional parameter <bInvestigateStartNode>
1530 : add output parameter <sListId>
1531 :
1532 : \param rPos position to start search
1533 : \param bForward - sal_True: search forward
1534 : - sal_False: search backward
1535 : \param bNum - sal_True: search for enumeration
1536 : - sal_False: search for itemize
1537 : \param bOutline - sal_True: search for outline numbering rule
1538 : - sal_False: search for non-outline numbering rule
1539 : \param nNonEmptyAllowed number of non-empty paragraphs allowed between
1540 : rPos and found paragraph
1541 :
1542 : @param sListId
1543 : output parameter - in case a list style is found, <sListId> holds the
1544 : list id, to which the text node belongs, which applies the found list style.
1545 :
1546 : @param bInvestigateStartNode
1547 : input parameter - boolean, indicating, if start node, determined by given
1548 : start position has to be investigated or not.
1549 : */
1550 : const SwNumRule * SearchNumRule(const SwPosition & rPos,
1551 : const bool bForward,
1552 : const bool bNum,
1553 : const bool bOutline,
1554 : int nNonEmptyAllowed,
1555 : String& sListId,
1556 : const bool bInvestigateStartNode = false );
1557 :
1558 : /// Paragraphs without numbering but with indents.
1559 : bool NoNum( const SwPaM& );
1560 :
1561 : /// Delete, splitting of numbering list.
1562 : void DelNumRules( const SwPaM& );
1563 :
1564 : /// Invalidates all numrules
1565 : void InvalidateNumRules();
1566 :
1567 : bool NumUpDown( const SwPaM&, bool bDown = true );
1568 :
1569 : /** Move selected paragraphes (not only numberings)
1570 : according to offsets. (if negative: go to doc start). */
1571 : bool MoveParagraph( const SwPaM&, long nOffset = 1, bool bIsOutlMv = false );
1572 :
1573 : bool NumOrNoNum( const SwNodeIndex& rIdx, sal_Bool bDel = sal_False);
1574 :
1575 : void StopNumRuleAnimations( OutputDevice* );
1576 :
1577 : /** Insert new table at position @param rPos (will be inserted before Node!).
1578 : For AutoFormat at input: columns have to be set at predefined width.
1579 : The array holds the positions of the columns (not their widths).
1580 : new @param bCalledFromShell:
1581 : sal_True: called from shell -> propagate existing adjust item at
1582 : rPos to every new cell. A existing adjust item in the table
1583 : heading or table contents paragraph style prevent that
1584 : propagation.
1585 : sal_False: do not propagate
1586 : */
1587 : const SwTable* InsertTable( const SwInsertTableOptions& rInsTblOpts, // HEADLINE_NO_BORDER
1588 : const SwPosition& rPos, sal_uInt16 nRows,
1589 : sal_uInt16 nCols, short eAdjust,
1590 : const SwTableAutoFmt* pTAFmt = 0,
1591 : const std::vector<sal_uInt16> *pColArr = 0,
1592 : sal_Bool bCalledFromShell = sal_False,
1593 : sal_Bool bNewModel = sal_True );
1594 :
1595 : /// If index is in a table, return TableNode, else 0.
1596 : SwTableNode* IsIdxInTbl( const SwNodeIndex& rIdx );
1597 : inline const SwTableNode* IsIdxInTbl( const SwNodeIndex& rIdx ) const;
1598 :
1599 : /// Create a balanced table out of the selected range.
1600 : const SwTable* TextToTable( const SwInsertTableOptions& rInsTblOpts, // HEADLINE_NO_BORDER,
1601 : const SwPaM& rRange, sal_Unicode cCh,
1602 : short eAdjust,
1603 : const SwTableAutoFmt* = 0 );
1604 :
1605 : /// text to table conversion - API support
1606 : const SwTable* TextToTable( const std::vector< std::vector<SwNodeRange> >& rTableNodes );
1607 :
1608 : sal_Bool TableToText( const SwTableNode* pTblNd, sal_Unicode cCh );
1609 :
1610 : /// Create columns / rows in table.
1611 : bool InsertCol( const SwCursor& rCursor,
1612 : sal_uInt16 nCnt = 1, bool bBehind = true );
1613 : bool InsertCol( const SwSelBoxes& rBoxes,
1614 : sal_uInt16 nCnt = 1, bool bBehind = true );
1615 : bool InsertRow( const SwCursor& rCursor,
1616 : sal_uInt16 nCnt = 1, bool bBehind = true );
1617 : bool InsertRow( const SwSelBoxes& rBoxes,
1618 : sal_uInt16 nCnt = 1, bool bBehind = true );
1619 :
1620 : /// Delete Colums/Rows in table.
1621 : sal_Bool DeleteRowCol( const SwSelBoxes& rBoxes, bool bColumn = false );
1622 : sal_Bool DeleteRow( const SwCursor& rCursor );
1623 : sal_Bool DeleteCol( const SwCursor& rCursor );
1624 :
1625 : /// Split / concatenate boxes in table.
1626 : sal_Bool SplitTbl( const SwSelBoxes& rBoxes, sal_Bool bVert = sal_True,
1627 : sal_uInt16 nCnt = 1, sal_Bool bSameHeight = sal_False );
1628 :
1629 : /// @return enum TableMergeErr.
1630 : sal_uInt16 MergeTbl( SwPaM& rPam );
1631 : String GetUniqueTblName() const;
1632 : sal_Bool IsInsTblFormatNum() const;
1633 : sal_Bool IsInsTblChangeNumFormat() const;
1634 : sal_Bool IsInsTblAlignNum() const;
1635 :
1636 : /// From FEShell (for Undo and BModified).
1637 : void GetTabCols( SwTabCols &rFill, const SwCursor* pCrsr,
1638 : const SwCellFrm* pBoxFrm = 0 ) const;
1639 : void SetTabCols( const SwTabCols &rNew, sal_Bool bCurRowOnly,
1640 : const SwCursor* pCrsr, const SwCellFrm* pBoxFrm = 0 );
1641 : void GetTabRows( SwTabCols &rFill, const SwCursor* pCrsr,
1642 : const SwCellFrm* pBoxFrm = 0 ) const;
1643 : void SetTabRows( const SwTabCols &rNew, sal_Bool bCurColOnly, const SwCursor* pCrsr,
1644 : const SwCellFrm* pBoxFrm = 0 );
1645 :
1646 : /// Direct access for UNO.
1647 : void SetTabCols(SwTable& rTab, const SwTabCols &rNew, const SwTabCols &rOld,
1648 : const SwTableBox *pStart, sal_Bool bCurRowOnly);
1649 :
1650 : void SetRowsToRepeat( SwTable &rTable, sal_uInt16 nSet );
1651 :
1652 : /// AutoFormat for table/table selection.
1653 : sal_Bool SetTableAutoFmt( const SwSelBoxes& rBoxes, const SwTableAutoFmt& rNew );
1654 :
1655 : /// Query attributes.
1656 : sal_Bool GetTableAutoFmt( const SwSelBoxes& rBoxes, SwTableAutoFmt& rGet );
1657 :
1658 : void AppendUndoForInsertFromDB( const SwPaM& rPam, sal_Bool bIsTable );
1659 :
1660 : sal_Bool SetColRowWidthHeight( SwTableBox& rAktBox, sal_uInt16 eType,
1661 : SwTwips nAbsDiff, SwTwips nRelDiff );
1662 : SwTableBoxFmt* MakeTableBoxFmt();
1663 : SwTableLineFmt* MakeTableLineFmt();
1664 :
1665 : /// Check if box has numerical valule. Change format of box if required.
1666 : void ChkBoxNumFmt( SwTableBox& rAktBox, sal_Bool bCallUpdate );
1667 : void SetTblBoxFormulaAttrs( SwTableBox& rBox, const SfxItemSet& rSet );
1668 : void ClearBoxNumAttrs( const SwNodeIndex& rNode );
1669 : void ClearLineNumAttrs( SwPosition & rPos );
1670 :
1671 : sal_Bool InsCopyOfTbl( SwPosition& rInsPos, const SwSelBoxes& rBoxes,
1672 : const SwTable* pCpyTbl = 0, sal_Bool bCpyName = sal_False,
1673 : sal_Bool bCorrPos = sal_False );
1674 :
1675 : sal_Bool UnProtectCells( const String& rTblName );
1676 : sal_Bool UnProtectCells( const SwSelBoxes& rBoxes );
1677 : sal_Bool UnProtectTbls( const SwPaM& rPam );
1678 : sal_Bool HasTblAnyProtection( const SwPosition* pPos,
1679 : const String* pTblName = 0,
1680 : sal_Bool* pFullTblProtection = 0 );
1681 :
1682 : /// Split table at baseline position, i.e. create a new table.
1683 : sal_Bool SplitTable( const SwPosition& rPos, sal_uInt16 eMode = 0,
1684 : sal_Bool bCalcNewSize = sal_False );
1685 :
1686 : /** And vice versa: rPos must be in the table that remains. The flag indicates
1687 : whether the current table is merged with the one before or behind it. */
1688 : sal_Bool MergeTable( const SwPosition& rPos, sal_Bool bWithPrev = sal_True,
1689 : sal_uInt16 nMode = 0 );
1690 :
1691 : /// Make charts of given table update.
1692 : void UpdateCharts( const String &rName ) const;
1693 :
1694 : /// Update all charts, for that exists any table.
1695 0 : void UpdateAllCharts() { DoUpdateAllCharts(); }
1696 :
1697 : /// Table is renamed and refreshes charts.
1698 : void SetTableName( SwFrmFmt& rTblFmt, const String &rNewName );
1699 :
1700 : /// @return the reference in document that is set for name.
1701 : const SwFmtRefMark* GetRefMark( const String& rName ) const;
1702 :
1703 : /// @return RefMark via index - for UNO.
1704 : const SwFmtRefMark* GetRefMark( sal_uInt16 nIndex ) const;
1705 :
1706 : /** @return names of all references that are set in document.
1707 : If array pointer is 0 return only whether a RefMark is set in document. */
1708 : sal_uInt16 GetRefMarks( std::vector<rtl::OUString>* = 0 ) const;
1709 :
1710 : /// Insert label. If a FlyFormat is created, return it.
1711 : SwFlyFrmFmt* InsertLabel( const SwLabelType eType, const String &rTxt, const String& rSeparator,
1712 : const String& rNumberingSeparator,
1713 : const sal_Bool bBefore, const sal_uInt16 nId, const sal_uLong nIdx,
1714 : const String& rCharacterStyle,
1715 : const sal_Bool bCpyBrd = sal_True );
1716 : SwFlyFrmFmt* InsertDrawLabel(
1717 : const String &rTxt, const String& rSeparator, const String& rNumberSeparator,
1718 : const sal_uInt16 nId, const String& rCharacterStyle, SdrObject& rObj );
1719 :
1720 : /// Query attribute pool.
1721 14918 : const SwAttrPool& GetAttrPool() const { return *mpAttrPool; }
1722 308484 : SwAttrPool& GetAttrPool() { return *mpAttrPool; }
1723 :
1724 : /// Search an EditShell or, if appropriate, a ViewShell via layout.
1725 : SwEditShell* GetEditShell( ViewShell** ppSh = 0 ) const;
1726 : ::sw::IShellCursorSupplier * GetIShellCursorSupplier();
1727 :
1728 : /// OLE 2.0-notification.
1729 1360 : inline void SetOle2Link(const Link& rLink) {aOle2Link = rLink;}
1730 335 : inline const Link& GetOle2Link() const {return aOle2Link;}
1731 :
1732 : /// insert section (the ODF kind of section, not the nodesarray kind)
1733 : SwSection * InsertSwSection(SwPaM const& rRange, SwSectionData &,
1734 : SwTOXBase const*const pTOXBase = 0,
1735 : SfxItemSet const*const pAttr = 0, bool const bUpdate = true);
1736 : sal_uInt16 IsInsRegionAvailable( const SwPaM& rRange,
1737 : const SwNode** ppSttNd = 0 ) const;
1738 : SwSection* GetCurrSection( const SwPosition& rPos ) const;
1739 470 : SwSectionFmts& GetSections() { return *pSectionFmtTbl; }
1740 0 : const SwSectionFmts& GetSections() const { return *pSectionFmtTbl; }
1741 : SwSectionFmt *MakeSectionFmt( SwSectionFmt *pDerivedFrom );
1742 : void DelSectionFmt( SwSectionFmt *pFmt, bool bDelNodes = false );
1743 : void UpdateSection(sal_uInt16 const nSect, SwSectionData &,
1744 : SfxItemSet const*const = 0, bool const bPreventLinkUpdate = false);
1745 : String GetUniqueSectionName( const String* pChkStr = 0 ) const;
1746 :
1747 : /* @@@MAINTAINABILITY-HORROR@@@
1748 : The model should not have anything to do with a shell.
1749 : Unnecessary compile/link time dependency.
1750 : */
1751 :
1752 : // Pointer to SfxDocShell from Doc. Can be 0!!
1753 58328 : SwDocShell* GetDocShell() { return pDocShell; }
1754 1684 : const SwDocShell* GetDocShell() const { return pDocShell; }
1755 : void SetDocShell( SwDocShell* pDSh );
1756 :
1757 : void ShareLayout( boost::shared_ptr<SwRootFrm>& rPtr);
1758 :
1759 : /** in case during copying of embedded object a new shell is created,
1760 : it should be set here and cleaned later */
1761 0 : void SetTmpDocShell( SfxObjectShellLock rLock ) { xTmpDocShell = rLock; }
1762 0 : SfxObjectShellLock GetTmpDocShell() { return xTmpDocShell; }
1763 :
1764 : /// For Autotexts? (text modules) They have only one SVPersist at their disposal.
1765 : SfxObjectShell* GetPersist() const;
1766 :
1767 : /// Pointer to storage of SfxDocShells. Can be 0!!!
1768 : ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > GetDocStorage();
1769 :
1770 : /// Query / set flag indicating if document is loaded asynchronously at this moment.
1771 115 : bool IsInLoadAsynchron() const { return mbInLoadAsynchron; }
1772 0 : void SetInLoadAsynchron( bool bFlag ) { mbInLoadAsynchron = bFlag; }
1773 :
1774 : bool SelectServerObj( const String& rStr, SwPaM*& rpPam,
1775 : SwNodeRange*& rpRange ) const;
1776 :
1777 : /// For Drag&Move: (e.g. allow "moving" of RefMarks)
1778 6 : bool IsCopyIsMove() const { return mbCopyIsMove; }
1779 4 : void SetCopyIsMove( bool bFlag ) { mbCopyIsMove = bFlag; }
1780 :
1781 : SwDrawContact* GroupSelection( SdrView& );
1782 : void UnGroupSelection( SdrView& );
1783 : bool DeleteSelection( SwDrawView& );
1784 :
1785 : /// Invalidates OnlineSpell-WrongLists.
1786 : void SpellItAgainSam( bool bInvalid, bool bOnlyWrong, bool bSmartTags );
1787 : void InvalidateAutoCompleteFlag();
1788 :
1789 : void SetCalcFieldValueHdl(Outliner* pOutliner);
1790 :
1791 : // Query if ::com::sun::star::util::URL was visited.
1792 : // Query via Doc, if only a ::com::sun::star::text::Bookmark has been given.
1793 : // In this case the document name has to be set in front.
1794 : bool IsVisitedURL( const String& rURL ) const;
1795 :
1796 : /// Save current values for automatic registration of exceptions in Autocorrection.
1797 : void SetAutoCorrExceptWord( SwAutoCorrExceptWord* pNew );
1798 0 : SwAutoCorrExceptWord* GetAutoCorrExceptWord() { return pACEWord; }
1799 :
1800 : const SwFmtINetFmt* FindINetAttr( const String& rName ) const;
1801 :
1802 : /// Call into intransparent Basic; expect possible Return String.
1803 : bool ExecMacro( const SvxMacro& rMacro, String* pRet = 0, SbxArray* pArgs = 0 );
1804 :
1805 : /// Call into intransparent Basic / JavaScript.
1806 : sal_uInt16 CallEvent( sal_uInt16 nEvent, const SwCallMouseEvent& rCallEvent,
1807 : bool bChkPtr = false, SbxArray* pArgs = 0,
1808 : const Link* pCallBack = 0 );
1809 :
1810 : /** Adjust left margin via object bar (similar to adjustment of numerations).
1811 : One can either change the margin "by" adding or substracting a given
1812 : offset or set it "to" this position (bModulus = true). */
1813 : void MoveLeftMargin( const SwPaM& rPam, bool bRight = true,
1814 : bool bModulus = true );
1815 :
1816 : /// Query NumberFormatter.
1817 : inline SvNumberFormatter* GetNumberFormatter( sal_Bool bCreate = sal_True );
1818 : inline const SvNumberFormatter* GetNumberFormatter( sal_Bool bCreate = sal_True ) const;
1819 :
1820 : bool HasInvisibleContent() const;
1821 : /// delete invisible content, like hidden sections and paragraphs
1822 : bool RemoveInvisibleContent();
1823 : /// restore the invisible content if it's available on the undo stack
1824 : bool RestoreInvisibleContent();
1825 :
1826 : bool ConvertFieldsToText();
1827 :
1828 : /// Create sub-documents according to given collection.
1829 : /// If no collection is given, use chapter styles for 1st level.
1830 : sal_Bool GenerateGlobalDoc( const String& rPath,
1831 : const SwTxtFmtColl* pSplitColl = 0 );
1832 : sal_Bool GenerateGlobalDoc( const String& rPath, int nOutlineLevel = 0 );
1833 : sal_Bool GenerateHTMLDoc( const String& rPath,
1834 : const SwTxtFmtColl* pSplitColl = 0 );
1835 : sal_Bool GenerateHTMLDoc( const String& rPath, int nOutlineLevel = 0 );
1836 :
1837 : /// Compare two documents.
1838 : long CompareDoc( const SwDoc& rDoc );
1839 :
1840 : /// Merge two documents.
1841 : long MergeDoc( const SwDoc& rDoc );
1842 :
1843 : /** Set comment-text for Redline. It then comes in via AppendRedLine.
1844 : Used by AutoFormat. 0-pointer resets mode.
1845 : Sequence number is for conjoining of Redlines by the UI. */
1846 : void SetAutoFmtRedlineComment( const String* pTxt, sal_uInt16 nSeqNo = 0 );
1847 :
1848 0 : bool IsAutoFmtRedline() const { return mbIsAutoFmtRedline; }
1849 0 : void SetAutoFmtRedline( bool bFlag ) { mbIsAutoFmtRedline = bFlag; }
1850 :
1851 : /// For AutoFormat: with Undo/Redlining.
1852 : void SetTxtFmtCollByAutoFmt( const SwPosition& rPos, sal_uInt16 nPoolId,
1853 : const SfxItemSet* pSet = 0 );
1854 : void SetFmtItemByAutoFmt( const SwPaM& rPam, const SfxItemSet& );
1855 :
1856 : /// Only for SW-textbloxks! Does not pay any attention to layout!
1857 : void ClearDoc(); // Deletes all content!
1858 :
1859 : /// Query /set data for PagePreView.
1860 0 : const SwPagePreViewPrtData* GetPreViewPrtData() const { return pPgPViewPrtData; }
1861 :
1862 : // If pointer == 0 destroy pointer in document.
1863 : // Else copy object.
1864 : // Pointer is not transferred to ownership by document!
1865 : void SetPreViewPrtData( const SwPagePreViewPrtData* pData );
1866 :
1867 : /** update all modified OLE-Objects. The modification is called over the
1868 : StarOne - Interface */
1869 0 : void SetOLEObjModified()
1870 0 : { if( GetCurrentViewShell() ) aOLEModifiedTimer.Start(); } //swmod 071107//swmod 071225
1871 :
1872 : // -------------------- Uno - Interfaces ---------------------------
1873 14700 : const SwUnoCrsrTbl& GetUnoCrsrTbl() const { return *pUnoCrsrTbl; }
1874 : SwUnoCrsr* CreateUnoCrsr( const SwPosition& rPos, bool bTblCrsr = false );
1875 :
1876 : // -------------------- FeShell - Interfaces -----------------------
1877 : // !!! These assume always an existing layout !!!
1878 : bool ChgAnchor( const SdrMarkList& _rMrkList,
1879 : RndStdIds _eAnchorType,
1880 : const bool _bSameOnly,
1881 : const bool _bPosCorr );
1882 :
1883 : void SetRowHeight( const SwCursor& rCursor, const SwFmtFrmSize &rNew );
1884 : void GetRowHeight( const SwCursor& rCursor, SwFmtFrmSize *& rpSz ) const;
1885 : void SetRowSplit( const SwCursor& rCursor, const SwFmtRowSplit &rNew );
1886 : void GetRowSplit( const SwCursor& rCursor, SwFmtRowSplit *& rpSz ) const;
1887 : sal_Bool BalanceRowHeight( const SwCursor& rCursor, sal_Bool bTstOnly = sal_True );
1888 : void SetRowBackground( const SwCursor& rCursor, const SvxBrushItem &rNew );
1889 : sal_Bool GetRowBackground( const SwCursor& rCursor, SvxBrushItem &rToFill ) const;
1890 : void SetTabBorders( const SwCursor& rCursor, const SfxItemSet& rSet );
1891 : void SetTabLineStyle( const SwCursor& rCursor,
1892 : const Color* pColor, sal_Bool bSetLine,
1893 : const editeng::SvxBorderLine* pBorderLine );
1894 : void GetTabBorders( const SwCursor& rCursor, SfxItemSet& rSet ) const;
1895 : void SetBoxAttr( const SwCursor& rCursor, const SfxPoolItem &rNew );
1896 : /**
1897 : Retrieves a box attribute from the given cursor.
1898 :
1899 : @return Whether the property is set over the current box selection.
1900 :
1901 : @remarks A property is 'set' if it's set to the same value over all boxes in the current selection.
1902 : The property value is retrieved from the first box in the current selection. It is then compared to
1903 : the values of the same property over any other boxes in the selection; if any value is different from
1904 : that of the first box, the property is unset (and sal_False is returned).
1905 : */
1906 : sal_Bool GetBoxAttr( const SwCursor& rCursor, SfxPoolItem &rToFill ) const;
1907 : void SetBoxAlign( const SwCursor& rCursor, sal_uInt16 nAlign );
1908 : sal_uInt16 GetBoxAlign( const SwCursor& rCursor ) const;
1909 : void AdjustCellWidth( const SwCursor& rCursor, sal_Bool bBalance = sal_False );
1910 :
1911 : int Chainable( const SwFrmFmt &rSource, const SwFrmFmt &rDest );
1912 : int Chain( SwFrmFmt &rSource, const SwFrmFmt &rDest );
1913 : void Unchain( SwFrmFmt &rFmt );
1914 :
1915 : // For Copy/Move from FrmShell.
1916 : SdrObject* CloneSdrObj( const SdrObject&, bool bMoveWithinDoc = false,
1917 : bool bInsInPage = true );
1918 :
1919 : //
1920 : // -------------------- FeShell - Interface end ------------------
1921 :
1922 : /// Interface for TextInputData - for text input of Chinese and Japanese.
1923 : SwExtTextInput* CreateExtTextInput( const SwPaM& rPam );
1924 : void DeleteExtTextInput( SwExtTextInput* pDel );
1925 : SwExtTextInput* GetExtTextInput( const SwNode& rNd,
1926 : xub_StrLen nCntntPos = STRING_NOTFOUND) const;
1927 : SwExtTextInput* GetExtTextInput() const;
1928 :
1929 : /// Interface for access to AutoComplete-List.
1930 2385 : static SwAutoCompleteWord& GetAutoCompleteWords() { return *pACmpltWords; }
1931 :
1932 18 : bool ContainsMSVBasic() const { return mbContains_MSVBasic; }
1933 0 : void SetContainsMSVBasic( bool bFlag ) { mbContains_MSVBasic = bFlag; }
1934 :
1935 : /// Interface for the list of Ruby - texts/attributes
1936 : sal_uInt16 FillRubyList( const SwPaM& rPam, SwRubyList& rList,
1937 : sal_uInt16 nMode );
1938 : sal_uInt16 SetRubyList( const SwPaM& rPam, const SwRubyList& rList,
1939 : sal_uInt16 nMode );
1940 :
1941 : void ReadLayoutCache( SvStream& rStream );
1942 : void WriteLayoutCache( SvStream& rStream );
1943 1538 : SwLayoutCache* GetLayoutCache() const { return pLayoutCache; }
1944 :
1945 : /** Checks if any of the text node contains hidden characters.
1946 : Used for optimization. Changing the view option 'view hidden text'
1947 : has to trigger a reformatting only if some of the text is hidden.
1948 : */
1949 : bool ContainsHiddenChars() const;
1950 :
1951 : /// call back for API wrapper
1952 : SwModify* GetUnoCallBack() const;
1953 :
1954 3877 : IGrammarContact* getGrammarContact() const { return mpGrammarContact; }
1955 :
1956 : /** Marks/Unmarks a list level of a certain list
1957 :
1958 : levels of a certain lists are marked now
1959 :
1960 : @param sListId list Id of the list whose level has to be marked/unmarked
1961 : @param nListLevel level to mark
1962 : @param bValue - true mark the level
1963 : - false unmark the level
1964 : */
1965 : void MarkListLevel( const String& sListId,
1966 : const int nListLevel,
1967 : const bool bValue );
1968 :
1969 : /** Marks/Unmarks a list level of a certain list
1970 :
1971 : levels of a certain lists are marked now
1972 :
1973 : @param rList list whose level has to be marked/unmarked
1974 : @param nListLevel level to mark
1975 : @param bValue - true mark the level
1976 : - false unmark the level
1977 : */
1978 : void MarkListLevel( SwList& rList,
1979 : const int nListLevel,
1980 : const bool bValue );
1981 :
1982 : /// Change a format undoable.
1983 : void ChgFmt(SwFmt & rFmt, const SfxItemSet & rSet);
1984 :
1985 : void RenameFmt(SwFmt & rFmt, const String & sNewName,
1986 : bool bBroadcast = false);
1987 :
1988 : /// Change a TOX undoable.
1989 : void ChgTOX(SwTOXBase & rTOX, const SwTOXBase & rNew);
1990 :
1991 : /**
1992 : Returns a textual description of a PaM.
1993 :
1994 : @param rPaM the PaM to describe
1995 :
1996 : If rPaM only spans one paragraph the result is:
1997 :
1998 : '<text in the PaM>'
1999 :
2000 : <text in the PaM> is shortened to nUndoStringLength characters.
2001 :
2002 : If rPaM spans more than one paragraph the result is:
2003 :
2004 : paragraphs (STR_PARAGRAPHS)
2005 :
2006 : @return the textual description of rPaM
2007 : */
2008 : String GetPaMDescr(const SwPaM & rPaM) const;
2009 :
2010 : bool IsFirstOfNumRule(SwPosition & rPos);
2011 :
2012 : // access methods for XForms model(s)
2013 :
2014 : /// access container for XForms model; will be NULL if !isXForms()
2015 : com::sun::star::uno::Reference<com::sun::star::container::XNameContainer>
2016 : getXForms() const;
2017 :
2018 : com::sun::star::uno::Reference< com::sun::star::linguistic2::XProofreadingIterator > GetGCIterator() const;
2019 :
2020 : /// is this an XForms document?
2021 : bool isXForms() const;
2022 :
2023 : /// initialize XForms models; turn this into an XForms document
2024 : void initXForms( bool bCreateDefaultModel );
2025 : // access methods for XForms model(s)
2026 :
2027 : //Update all the page masters
2028 : void SetDefaultPageMode(bool bSquaredPageMode);
2029 : sal_Bool IsSquaredPageMode() const;
2030 :
2031 74 : void Setn32DummyCompatabilityOptions1( sal_uInt32 CompatabilityOptions1 )
2032 : {
2033 74 : n32DummyCompatabilityOptions1 = CompatabilityOptions1;
2034 74 : }
2035 8 : sal_uInt32 Getn32DummyCompatabilityOptions1( )
2036 : {
2037 8 : return n32DummyCompatabilityOptions1;
2038 : }
2039 74 : void Setn32DummyCompatabilityOptions2( sal_uInt32 CompatabilityOptions2 )
2040 : {
2041 74 : n32DummyCompatabilityOptions2 = CompatabilityOptions2;
2042 74 : }
2043 8 : sal_uInt32 Getn32DummyCompatabilityOptions2( )
2044 : {
2045 8 : return n32DummyCompatabilityOptions2;
2046 : }
2047 : com::sun::star::uno::Reference< com::sun::star::script::vba::XVBAEventProcessor > GetVbaEventProcessor();
2048 28 : void SetVBATemplateToProjectCache( com::sun::star::uno::Reference< com::sun::star::container::XNameContainer >& xCache ) { m_xTemplateToProjectCache = xCache; };
2049 74 : com::sun::star::uno::Reference< com::sun::star::container::XNameContainer > GetVBATemplateToProjectCache() { return m_xTemplateToProjectCache; };
2050 : ::sfx2::IXmlIdRegistry& GetXmlIdRegistry();
2051 : ::sw::MetaFieldManager & GetMetaFieldManager();
2052 : ::sw::UndoManager & GetUndoManager();
2053 : ::sw::UndoManager const& GetUndoManager() const;
2054 : SfxObjectShell* CreateCopy(bool bCallInitNew) const;
2055 :
2056 : /**
2057 : * Dumps the entire nodes structure to the given destination (file nodes.xml in the current directory by default)
2058 : * @since 3.5
2059 : */
2060 : void dumpAsXml( xmlTextWriterPtr writer = NULL );
2061 :
2062 : /// must be called only in SwDocShell::InitNew, causes UpdateDrawDefaults to be called when drawing layer is created
2063 : void SetDrawDefaults();
2064 :
2065 : private:
2066 : /// method to set new graphics pool defaults, must only be called by SetDrawDefaults!
2067 : void UpdateDrawDefaults();
2068 : /// Copies master header to left / first one, if necessary - used by ChgPageDesc().
2069 : void CopyMasterHeader(const SwPageDesc &rChged, const SwFmtHeader &rHead, SwPageDesc *pDesc, bool bLeft);
2070 : /// Copies master footer to left / first one, if necessary - used by ChgPageDesc().
2071 : void CopyMasterFooter(const SwPageDesc &rChged, const SwFmtFooter &rFoot, SwPageDesc *pDesc, bool bLeft);
2072 : };
2073 :
2074 : // This method is called in Dtor of SwDoc and deletes cache of ContourObjects.
2075 : void ClrContourCache();
2076 :
2077 : inline const SwTableNode* SwDoc::IsIdxInTbl( const SwNodeIndex& rIdx ) const
2078 : {
2079 : return ((SwDoc*)this)->IsIdxInTbl( rIdx );
2080 : }
2081 :
2082 516 : inline SvNumberFormatter* SwDoc::GetNumberFormatter( sal_Bool bCreate )
2083 : {
2084 516 : if( bCreate && !pNumberFormatter )
2085 480 : _CreateNumberFormatter();
2086 516 : return pNumberFormatter;
2087 : }
2088 :
2089 0 : inline const SvNumberFormatter* SwDoc::GetNumberFormatter( sal_Bool bCreate ) const
2090 : {
2091 0 : return ((SwDoc*)this)->GetNumberFormatter( bCreate );
2092 : }
2093 :
2094 4 : inline void SwDoc::SetOLEPrtNotifyPending( bool bSet )
2095 : {
2096 4 : mbOLEPrtNotifyPending = bSet;
2097 4 : if( !bSet )
2098 0 : mbAllOLENotify = sal_False;
2099 4 : }
2100 :
2101 : // namespace <docfunc> for functions and procedures working on a Writer document.
2102 : namespace docfunc
2103 : {
2104 : /** method to check, if given Writer document contains at least one drawing object
2105 :
2106 : @author OD
2107 :
2108 : @param p_rDoc
2109 : input parameter - reference to the Writer document, which is investigated.
2110 : */
2111 : bool ExistsDrawObjs( SwDoc& p_rDoc );
2112 :
2113 : /** method to check, if given Writer document contains only drawing objects,
2114 : which are completely on its page.
2115 :
2116 : @author OD
2117 :
2118 : @param p_rDoc
2119 : input parameter - reference to the Writer document, which is investigated.
2120 : */
2121 : bool AllDrawObjsOnPage( SwDoc& p_rDoc );
2122 :
2123 : /** method to check, if the outline style has to written as a normal list style
2124 :
2125 : #i69627#
2126 : The outline style has to written as a normal list style, if a parent
2127 : paragraph style of one of the paragraph styles, which are assigned to
2128 : the list levels of the outline style, has a list style set or inherits
2129 : a list style from its parent paragraphs style.
2130 : This information is needed for the OpenDocument file format export.
2131 :
2132 : @author OD
2133 :
2134 : @param rDoc
2135 : input parameter - reference to the text document, which is investigated.
2136 :
2137 : @return boolean
2138 : indicating, if the outline style has to written as a normal list style
2139 : */
2140 : bool HasOutlineStyleToBeWrittenAsNormalListStyle( SwDoc& rDoc );
2141 : }
2142 : #endif //_DOC_HXX
2143 :
2144 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|