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