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