1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
30 #include <cppuhelper/weakref.hxx>
35 #include <hintids.hxx>
36 #include <ndhints.hxx>
38 #include <modeltoviewhelper.hxx>
39 #include <SwNumberTreeTypes.hxx>
40 #include <IDocumentContentOperations.hxx>
42 #include <sfx2/Metadatable.hxx>
50 // --> OD 2008-05-06 #refactorlists#
53 // --> OD 2008-12-02 #i96772#
58 class TransliterationWrapper
;
63 class SwTxtFld
; // Fuer GetTxtFld()
65 class SwUndoTransliterate
;
68 struct SwSpellArgs
; // for Spell(), splargs.hxx
69 struct SwConversionArgs
; // for Convert(), splargs.hxx
70 class SwInterHyphInfo
; // for Hyphenate(), splargs.hxx
71 class SwWrongList
; // fuer OnlineSpelling
72 class SwGrammarMarkUp
;
76 struct SwParaIdleData_Impl
;
78 namespace com
{ namespace sun
{ namespace star
{
80 template < class > class Sequence
;
82 namespace text
{ class XTextContent
; }
85 typedef std::set
< xub_StrLen
> SwSoftPageBreakList
;
87 // --------------------
89 // --------------------
90 class SW_DLLPUBLIC SwTxtNode
: public SwCntntNode
, public ::sfx2::Metadatable
93 // fuer das Erzeugen des ersten TextNode
94 friend class SwDoc
; // CTOR und AppendTxtNode()
96 friend class SwTxtFrm
;
97 friend class SwScriptInfo
;
99 //Kann 0 sein, nur dann nicht 0 wenn harte Attribute drin stehen.
100 //Also niemals direkt zugreifen!
101 SwpHints
*m_pSwpHints
;
103 // --> OD 2005-11-02 #i51089 - TUNING#
104 mutable SwNodeNum
* mpNodeNum
; // Numerierung fuer diesen Absatz
108 SwParaIdleData_Impl
* m_pParaIdleData_Impl
;
110 // Some of the chars this para are hidden. Paragraph has to be reformatted
111 // on changing the view to print preview.
112 mutable bool m_bContainsHiddenChars
: 1;
113 // The whole paragraph is hidden because of the hidden text attribute
114 mutable bool m_bHiddenCharsHidePara
: 1;
115 // The last two flags have to be recalculated if this flag is set:
116 mutable bool m_bRecalcHiddenCharFlags
: 1;
118 mutable bool m_bLastOutlineState
: 1;
121 // BYTE nOutlineLevel; //#outline level, removed by zhaojianwei.
122 // --> OD 2008-11-19 #i70748#
123 bool mbEmptyListStyleSetDueToSetOutlineLevelAttr
;
126 // --> OD 2008-03-27 #refactorlists#
127 // boolean, indicating that a <SetAttr(..)> or <ResetAttr(..)> or
128 // <ResetAllAttr(..)> method is running.
129 // Needed to avoid duplicate handling of attribute change actions.
130 bool mbInSetOrResetAttr
;
132 // --> OD 2008-05-06 #refactorlists#
133 // pointer to the list, to whose the text node is added to
136 /// #i111677# cached expansion (for clipboard)
137 ::std::auto_ptr
< ::rtl::OUString
> m_pNumStringCache
;
139 ::com::sun::star::uno::WeakReference
<
140 ::com::sun::star::text::XTextContent
> m_wXParagraph
;
142 SW_DLLPRIVATE
SwTxtNode( const SwNodeIndex
&rWhere
, SwTxtFmtColl
*pTxtColl
,
143 const SfxItemSet
* pAutoAttr
= 0 );
145 // Kopiert die Attribute an nStart nach pDest.
146 SW_DLLPRIVATE
void CopyAttr( SwTxtNode
*pDest
, const xub_StrLen nStart
, const xub_StrLen nOldPos
);
148 SW_DLLPRIVATE SwTxtNode
* _MakeNewTxtNode( const SwNodeIndex
&, BOOL bNext
= TRUE
,
149 BOOL bChgFollow
= TRUE
);
151 SW_DLLPRIVATE
void CutImpl(
152 SwTxtNode
* const pDest
, const SwIndex
& rDestStart
,
153 const SwIndex
& rStart
, /*const*/ xub_StrLen nLen
,
154 const bool bUpdate
= true );
156 // Verlagere alles umfassende harte Attribute in den AttrSet des Absatzes
157 SW_DLLPRIVATE
void MoveTxtAttr_To_AttrSet(); // wird von SplitNode gerufen.
159 // lege den spz. AttrSet an
160 SW_DLLPRIVATE
virtual void NewAttrSet( SwAttrPool
& );
162 SW_DLLPRIVATE
void Replace0xFF( XubString
& rTxt
, xub_StrLen
& rTxtStt
,
163 xub_StrLen nEndPos
, BOOL bExpandFlds
) const;
165 // Optimization: Asking for information about hidden characters at SwScriptInfo
166 // updates these flags.
167 inline bool IsCalcHiddenCharFlags() const
168 { return m_bRecalcHiddenCharFlags
; }
169 inline void SetHiddenCharAttribute( bool bNewHiddenCharsHidePara
, bool bNewContainsHiddenChars
) const
171 m_bHiddenCharsHidePara
= bNewHiddenCharsHidePara
;
172 m_bContainsHiddenChars
= bNewContainsHiddenChars
;
173 m_bRecalcHiddenCharFlags
= false;
176 SW_DLLPRIVATE
void CalcHiddenCharFlags() const;
178 SW_DLLPRIVATE SwNumRule
* _GetNumRule(BOOL bInParent
= TRUE
) const;
180 SW_DLLPRIVATE
void SetLanguageAndFont( const SwPaM
&rPaM
,
181 LanguageType nLang
, USHORT nLangWhichId
,
182 const Font
*pFont
, USHORT nFontWhichId
);
185 // Start: Data collected during idle time
187 SW_DLLPRIVATE
void SetParaNumberOfWords( ULONG nTmpWords
) const;
188 SW_DLLPRIVATE ULONG
GetParaNumberOfWords() const;
189 SW_DLLPRIVATE
void SetParaNumberOfChars( ULONG nTmpChars
) const;
190 SW_DLLPRIVATE ULONG
GetParaNumberOfChars() const;
191 SW_DLLPRIVATE
void InitSwParaStatistics( bool bNew
);
193 /** create number for this text node, if not already existing
195 OD 2005-11-02 #i51089 - TUNING#
196 OD 2007-10-26 #i83479# - made private
198 @return number of this node
200 SwNodeNum
* CreateNum() const;
202 inline void TryDeleteSwpHints();
204 SW_DLLPRIVATE
void impl_FmtToTxtAttr(const SfxItemSet
& i_rAttrSet
);
207 bool IsWordCountDirty() const;
208 bool IsWrongDirty() const;
209 bool IsGrammarCheckDirty() const;
210 bool IsSmartTagDirty() const; // SMARTTAGS
211 bool IsAutoCompleteWordDirty() const;
212 void SetWordCountDirty( bool bNew
) const;
213 void SetWrongDirty( bool bNew
) const;
214 void SetGrammarCheckDirty( bool bNew
) const;
215 void SetSmartTagDirty( bool bNew
) const; // SMARTTAGS
216 void SetAutoCompleteWordDirty( bool bNew
) const;
217 void SetWrong( SwWrongList
* pNew
, bool bDelete
= true );
218 SwWrongList
* GetWrong();
219 // --> OD 2008-05-23 #i71360#
220 const SwWrongList
* GetWrong() const;
222 void SetGrammarCheck( SwGrammarMarkUp
* pNew
, bool bDelete
= true );
223 SwGrammarMarkUp
* GetGrammarCheck();
225 void SetSmartTags( SwWrongList
* pNew
, bool bDelete
= true );
226 SwWrongList
* GetSmartTags();
229 // End: Data collected during idle time
233 using SwCntntNode::GetAttr
;
235 const String
& GetTxt() const { return m_Text
; }
237 // getters for SwpHints
238 inline SwpHints
&GetSwpHints();
239 inline const SwpHints
&GetSwpHints() const;
240 inline SwpHints
*GetpSwpHints() { return m_pSwpHints
; }
241 inline const SwpHints
*GetpSwpHints() const { return m_pSwpHints
; }
242 inline bool HasHints() const { return m_pSwpHints
? true : false; }
243 inline SwpHints
&GetOrCreateSwpHints();
245 virtual ~SwTxtNode();
247 virtual xub_StrLen
Len() const;
250 void GetMinMaxSize( ULONG nIndex
, ULONG
& rMin
, ULONG
&rMax
, ULONG
&rAbs
,
251 OutputDevice
* pOut
= 0 ) const;
253 // --> OD 2008-03-13 #refactorlists#
254 // overriding to handle change of certain paragraph attributes
255 virtual BOOL
SetAttr( const SfxPoolItem
& );
256 virtual BOOL
SetAttr( const SfxItemSet
& rSet
);
257 virtual BOOL
ResetAttr( USHORT nWhich1
, USHORT nWhich2
= 0 );
258 virtual BOOL
ResetAttr( const SvUShorts
& rWhichArr
);
259 virtual USHORT
ResetAllAttr();
262 /// insert text content
263 void InsertText( const XubString
& rStr
, const SwIndex
& rIdx
,
264 const enum IDocumentContentOperations::InsertFlags nMode
265 = IDocumentContentOperations::INS_DEFAULT
);
267 /** delete text content
268 ATTENTION: must not be called with a range that overlaps the start of
269 an attribute with both extent and dummy char
271 void EraseText ( const SwIndex
&rIdx
, const xub_StrLen nCount
= STRING_LEN
,
272 const enum IDocumentContentOperations::InsertFlags nMode
273 = IDocumentContentOperations::INS_DEFAULT
);
275 /** delete all attributes.
276 If neither pSet nor nWhich is given, delete all attributes (except
277 refmarks, toxmarks, meta) in range.
278 @param rIdx start position
279 @param nLen range in which attributes will be deleted
280 @param pSet if not 0, delete only attributes contained in pSet
281 @param nWhich if not 0, delete only attributes with matching which
282 @param bInclRefToxMark
283 refmarks, toxmarks, and metas will be ignored unless this is true
284 ATTENTION: setting bInclRefToxMark is only allowed from UNDO!
286 void RstAttr( const SwIndex
&rIdx
, xub_StrLen nLen
, USHORT nWhich
= 0,
287 const SfxItemSet
* pSet
= 0, BOOL bInclRefToxMark
= FALSE
);
290 // loesche das Text-Attribut (muss beim Pool abgemeldet werden!)
291 void DestroyAttr( SwTxtAttr
* pAttr
);
293 // loesche alle Attribute aus dem SwpHintsArray.
294 void ClearSwpHintsArr( bool bDelFields
);
296 /// Insert pAttr into hints array. @return true iff inserted successfully
297 bool InsertHint( SwTxtAttr
* const pAttr
,
298 const SetAttrMode nMode
= nsSetAttrMode::SETATTR_DEFAULT
);
299 /// create new text attribute from rAttr and insert it
300 /// @return inserted hint; 0 if not sure the hint is inserted
301 SwTxtAttr
* InsertItem( SfxPoolItem
& rAttr
,
302 const xub_StrLen nStart
, const xub_StrLen nEnd
,
303 const SetAttrMode nMode
= nsSetAttrMode::SETATTR_DEFAULT
);
305 // setze diese Attribute am TextNode. Wird der gesamte Bereich umspannt,
306 // dann setze sie nur im AutoAttrSet (SwCntntNode:: SetAttr)
307 BOOL
SetAttr( const SfxItemSet
& rSet
,
308 xub_StrLen nStt
, xub_StrLen nEnd
,
309 const SetAttrMode nMode
= nsSetAttrMode::SETATTR_DEFAULT
);
310 // erfrage die Attribute vom TextNode ueber den Bereich
311 // --> OD 2008-01-16 #newlistlevelattrs#
312 // Introduce 4th optional parameter <bMergeIndentValuesOfNumRule>.
313 // If <bMergeIndentValuesOfNumRule> == TRUE, the indent attributes of
314 // the corresponding list level of an applied list style is merged into
315 // the requested item set as a LR-SPACE item, if <bOnlyTxtAttr> == FALSE,
316 // corresponding node has not its own indent attributes and the
317 // position-and-space mode of the list level is SvxNumberFormat::LABEL_ALIGNMENT.
318 BOOL
GetAttr( SfxItemSet
& rSet
, xub_StrLen nStt
, xub_StrLen nEnd
,
319 BOOL bOnlyTxtAttr
= FALSE
,
320 BOOL bGetFromChrFmt
= TRUE
,
321 const bool bMergeIndentValuesOfNumRule
= false ) const;
324 // uebertrage Attribute eines AttrSets ( AutoFmt ) in das SwpHintsArray
325 void FmtToTxtAttr( SwTxtNode
* pNd
);
327 /// delete all attributes of type nWhich at nStart (opt. end nEnd)
328 void DeleteAttributes( const USHORT nWhich
,
329 const xub_StrLen nStart
, const xub_StrLen nEnd
= 0 );
330 /// delete the attribute pTxtAttr
331 void DeleteAttribute ( SwTxtAttr
* const pTxtAttr
);
333 // Aktionen auf Text und Attributen
334 // --> OD 2008-11-18 #i96213#
335 // introduce optional parameter to control, if all attributes have to be copied.
336 void CopyText( SwTxtNode
* const pDest
,
337 const SwIndex
&rStart
,
338 const xub_StrLen nLen
,
339 const bool bForceCopyOfAllAttrs
= false );
340 void CopyText( SwTxtNode
* const pDest
,
341 const SwIndex
&rDestStart
,
342 const SwIndex
&rStart
,
344 const bool bForceCopyOfAllAttrs
= false );
347 void CutText(SwTxtNode
* const pDest
,
348 const SwIndex
& rStart
, const xub_StrLen nLen
);
349 inline void CutText(SwTxtNode
* const pDest
, const SwIndex
&rDestStart
,
350 const SwIndex
& rStart
, const xub_StrLen nLen
);
352 /// replace nDelLen characters at rStart with rText
353 void ReplaceText( const SwIndex
& rStart
, const xub_StrLen nDelLen
,
354 const XubString
& rText
);
355 void ReplaceTextOnly( xub_StrLen nPos
, xub_StrLen nLen
, const XubString
& rText
,
356 const ::com::sun::star::uno::Sequence
<sal_Int32
>& rOffsets
);
358 // virtuelle Methoden aus dem CntntNode
359 virtual SwCntntFrm
*MakeFrm();
360 virtual SwCntntNode
*SplitCntntNode( const SwPosition
& );
361 virtual SwCntntNode
*JoinNext();
362 virtual SwCntntNode
*JoinPrev();
364 SwCntntNode
*AppendNode( const SwPosition
& );
366 // setze ggf. das DontExpand-Flag an INet bzw. Zeichenvorlagen
367 BOOL
DontExpandFmt( const SwIndex
& rIdx
, bool bFlag
= true,
368 BOOL bFmtToTxtAttributes
= TRUE
);
370 enum GetTxtAttrMode
{
371 DEFAULT
, /// DEFAULT: (Start < nIndex <= End)
372 EXPAND
, /// EXPAND : (Start <= nIndex < End)
373 PARENT
, /// PARENT : (Start < nIndex < End)
376 /** get the innermost text attribute covering position nIndex.
377 @param nWhich only attribute with this id is returned.
378 @param eMode the predicate for matching (@see GetTxtAttrMode).
380 ATTENTION: this function is not well-defined for those
381 hints of which several may cover a single position, like
382 RES_TXTATR_CHARFMT, RES_TXTATR_REFMARK, RES_TXTATR_TOXMARK
384 SwTxtAttr
*GetTxtAttrAt(xub_StrLen
const nIndex
, RES_TXTATR
const nWhich
,
385 enum GetTxtAttrMode
const eMode
= DEFAULT
) const;
387 /** get the innermost text attributes covering position nIndex.
388 @param nWhich only attributes with this id are returned.
389 @param eMode the predicate for matching (@see GetTxtAttrMode).
391 ::std::vector
<SwTxtAttr
*> GetTxtAttrsAt(xub_StrLen
const nIndex
,
392 RES_TXTATR
const nWhich
,
393 enum GetTxtAttrMode
const eMode
= DEFAULT
) const;
395 /** get the text attribute at position nIndex which owns
396 the dummy character CH_TXTATR_* at that position, if one exists.
397 @param nIndex the position in the text
398 @param nWhich if different from RES_TXTATR_END, return only
399 attribute with given which id
400 @return the text attribute at nIndex of type nWhich, if it exists
402 SwTxtAttr
*GetTxtAttrForCharAt( const xub_StrLen nIndex
,
403 const RES_TXTATR nWhich
= RES_TXTATR_END
) const;
405 // Aktuelles Wort zurueckliefern
406 XubString
GetCurWord(xub_StrLen
) const;
407 USHORT
Spell(SwSpellArgs
*);
408 USHORT
Convert( SwConversionArgs
& );
410 inline SwTxtFmtColl
*GetTxtColl() const;
411 virtual SwFmtColl
*ChgFmtColl( SwFmtColl
* );
412 void _ChgTxtCollUpdateNum( const SwTxtFmtColl
* pOld
,
413 const SwTxtFmtColl
* pNew
);
415 // kopiere die Collection mit allen Autoformaten zum Dest-Node
416 // dieser kann auch in einem anderen Dokument stehen!
417 // (Methode steht im ndcopy.cxx!!)
418 void CopyCollFmt( SwTxtNode
& rDestNd
);
420 //const SwNodeNum* _GetNodeNum() const { return pNdNum; }
423 // BEGIN OF BULLET/NUMBERING/OUTLINE STUFF:
427 Returns numbering rule of this text node.
429 @param bInParent serach in parent attributes, too
431 @return numbering rule of this text node or NULL if none is set
433 SwNumRule
*GetNumRule(BOOL bInParent
= TRUE
) const;
435 inline const SwNodeNum
* GetNum() const
440 SwNumberTree::tNumberVector
GetNumberVector() const;
443 Returns if this text node is an outline.
445 @retval true this text node is an outline
448 bool IsOutline() const;
450 bool IsOutlineStateChanged() const;
452 void UpdateOutlineState();
456 Returns if this text node may be numbered.
458 A text node may be numbered if
459 - it has no SwNodeNum
460 - it has a SwNodeNum and it has a numbering rule and the according
461 SwNumFmt defines a numbering type that is an enumeration.
463 @retval TRUE this text node may be numbered
466 //BOOL MayBeNumbered() const;
469 Notify this textnode that its numbering rule has changed.
473 /** Returns outline of numbering string
475 OD 2005-11-17 #128041#
476 Introduce parameter <_bInclPrefixAndSuffixStrings> in order to control,
477 if the prefix and the suffix strings have to been included or not.
479 @param _bInclPrefixAndSuffixStrings
480 optional input parameter - boolean indicating, if the prefix and the
481 suffix strings have to been included or not. default value = <true>
483 @param _nRestrictToThisLevel
484 optional input parameter - unsigned integer indicating the maximum outline
485 level to which the output string must be restricted to. Default value is
488 XubString
GetNumString( const bool _bInclPrefixAndSuffixStrings
= true, const unsigned int _nRestrictToThisLevel
= MAXLEVEL
) const;
491 Returns the additional indents of this text node and its numbering.
495 @return additional indents
497 long GetLeftMarginWithNum( BOOL bTxtLeft
= FALSE
) const;
500 Returns the combined first line indent of this text node and
503 @param the first line indent of this text node taking the
504 numbering into account (return parameter)
506 @retval TRUE this node has SwNodeNum and has numbering rule
509 BOOL
GetFirstLineOfsWithNum( short& rFirstOffset
) const;
511 // --> OD 2010-01-05 #b6884103#
512 SwTwips
GetAdditionalIndentForStartingNewList() const;
515 // --> OD 2008-12-02 #i96772#
516 void ClearLRSpaceItemDueToListLevelIndents( SvxLRSpaceItem
& o_rLRSpaceItem
) const;
519 /** return left margin for tab stop position calculation
521 OD 2008-06-30 #i91133#
522 Needed for text formatting
523 Method considers new list level attributes, which also can provide a left margin value
527 long GetLeftMarginForTabCalculation() const;
530 Returns if this text node has a number.
532 This text node has a number if it has a SwNodeNum and a
533 numbering rule and the numbering format specified for the
534 level of the SwNodeNum is of an enumeration type.
536 @retval TRUE This text node has a number.
539 BOOL
HasNumber() const;
542 Returns if this text node has a bullet.
544 This text node has a bullet if it has a SwNodeNum and a
545 numbering rule and the numbering format specified for the
546 level of the SwNodeNum is of a bullet type.
548 @retval TRUE This text node has a bullet.
551 BOOL
HasBullet() const;
554 Returns is this text node is numbered.
556 This node is numbered if it has a SwNodeNum and it has a
557 numbering rule and has not a hidden SwNodeNum.
559 ATTENTION: Returns TRUE even if the SwNumFmt has type
562 @retval TRUE This node is numbered.
565 BOOL
IsNumbered() const;
568 Returns if this text node has a marked label.
570 @retval true This text node has a marked label.
573 bool HasMarkedLabel() const;
575 /** Sets the list level of this text node.
577 Side effect, when the text node is a list item:
578 The text node's representation in the list tree (<SwNodeNum> instance)
581 @param nLevel level to set
583 void SetAttrListLevel(int nLevel
);
585 bool HasAttrListLevel() const;
587 int GetAttrListLevel() const;
589 /** Returns the actual list level of this text node, when it is a list item
591 @return the actual list level of this text node, if it is a list item,
594 int GetActualListLevel() const;
597 Returns outline level of this text node.
599 If a text node has an outline number (i.e. it has an SwNodeNum
600 and a outline numbering rule) the outline level is the level of
603 If a text node has no outline number and has a paragraph style
604 attached the outline level is the outline level of the
607 Otherwise the text node has no outline level (NO_NUMBERING).
609 NOTE: The outline level of text nodes is subject to change. The
610 plan is to have an SwTxtNode::nOutlineLevel member that is
611 updated from a paragraph style upon appliance of that paragraph
614 @return outline level or NO_NUMBERING if there is no outline level
616 int GetAttrOutlineLevel() const;//#OutlineLevel,added by zhaojianwei
619 Sets the out line level *at* a text node.
621 @param nLevel the level to be set
623 If the text node has an outline number the level is set at the
626 If the text node has no outline number but has a paragraph
627 style applied the outline level is set at the paragraph style.
629 NOTE: This is subject to change, see GetOutlineLevel.
631 //void SetOutlineLevel(int nLevel);
632 void SetAttrOutlineLevel(int nLevel
);//#OutlineLevel,added by zhaojianwei
634 // --> OD 2008-11-19 #i70748#
635 bool IsEmptyListStyleDueToSetOutlineLevelAttr();
636 void SetEmptyListStyleDueToSetOutlineLevelAttr();
637 void ResetEmptyListStyleDueToResetOutlineLevelAttr();
641 Returns the width of leading tabs/blanks in this paragraph.
642 This space will be converted into numbering indent if the paragraph
643 is set to be numbered.
645 @return the width of the leading whitespace
647 USHORT
GetWidthOfLeadingTabs() const;
651 Returns if the paragraph has a visible numbering or bullet.
652 This includes all kinds of numbering/bullet/outlines.
653 Note: This function returns false, if the numbering format is
654 SVX_NUM_NUMBER_NONE or if the numbering/bullet has been deleted.
656 @return TRUE if the paragraph has a visible numbering/bullet/outline
658 bool HasVisibleNumberingOrBullet() const;
660 // --> OD 2008-02-19 #refactorlists#
661 void SetListId( const String sListId
);
662 String
GetListId() const;
665 /** Determines, if the list level indent attributes can be applied to the
668 OD 2008-01-17 #newlistlevelattrs#
669 The list level indents can be applied to the paragraph under the one
670 of following conditions:
671 - the list style is directly applied to the paragraph and the paragraph
672 has no own indent attributes.
673 - the list style is applied to the paragraph through one of its paragraph
674 styles, the paragraph has no own indent attributes and on the paragraph
675 style hierarchy from the paragraph to the paragraph style with the
676 list style no indent attributes are found.
682 bool AreListLevelIndentsApplicable() const;
684 /** Retrieves the list tab stop position, if the paragraph's list level defines
685 one and this list tab stop has to merged into the tap stops of the paragraph
687 OD 2008-01-17 #newlistlevelattrs#
691 @param nListTabStopPosition
692 output parameter - containing the list tab stop position
694 @return boolean - indicating, if a list tab stop position is provided
696 bool GetListTabStopPosition( long& nListTabStopPosition
) const;
698 /** Retrieves the character following the list label, if the paragraph's
699 list level defines one.
701 OD 2008-01-17 #newlistlevelattrs#
705 @return XubString - the list tab stop position
707 XubString
GetLabelFollowedBy() const;
710 // END OF BULLET/NUMBERING/OUTLINE STUFF:
713 void fillSoftPageBreakList( SwSoftPageBreakList
& rBreak
) const;
715 USHORT
GetLang( const xub_StrLen nBegin
, const xub_StrLen nLen
= 0,
716 USHORT nScript
= 0 ) const;
718 // steht in ndcopy.cxx
719 BOOL
IsSymbol( const xub_StrLen nBegin
) const; // steht in itratr.cxx
720 virtual SwCntntNode
* MakeCopy( SwDoc
*, const SwNodeIndex
& ) const;
722 // interaktive Trennung: wir finden den TxtFrm und rufen sein CalcHyph
723 BOOL
Hyphenate( SwInterHyphInfo
&rHyphInf
);
724 void DelSoftHyph( const xub_StrLen nStart
, const xub_StrLen nEnd
);
726 // --> OD 2007-11-15 #i83479#
727 // add 4th optional parameter <bAddSpaceAfterListLabelStr> indicating,
728 // when <bWithNum = true> that a space is inserted after the string for
730 // add 5th optional parameter <bWithSpacesForLevel> indicating, if additional
731 // spaces are inserted in front of the expanded text string depending on
733 XubString
GetExpandTxt( const xub_StrLen nIdx
= 0,
734 const xub_StrLen nLen
= STRING_LEN
,
735 const bool bWithNum
= false,
736 const bool bAddSpaceAfterListLabelStr
= false,
737 const bool bWithSpacesForLevel
= false ) const;
739 BOOL
GetExpandTxt( SwTxtNode
& rDestNd
, const SwIndex
* pDestIdx
= 0,
740 xub_StrLen nIdx
= 0, xub_StrLen nLen
= STRING_LEN
,
741 BOOL bWithNum
= FALSE
, BOOL bWithFtn
= TRUE
,
742 BOOL bReplaceTabsWithSpaces
= FALSE
) const;
747 const ModelToViewHelper::ConversionMap
*
748 BuildConversionMap( rtl::OUString
& rExpandText
) const;
750 XubString
GetRedlineTxt( xub_StrLen nIdx
= 0,
751 xub_StrLen nLen
= STRING_LEN
,
752 BOOL bExpandFlds
= FALSE
,
753 BOOL bWithNum
= FALSE
) const;
754 //Liefert fuer die Initalfunktion tatsaechliche Anzahl der Initialzeichen
755 //bei nWishLen == 0 die des ersten Wortes
756 USHORT
GetDropLen( USHORT nWishLen
) const;
758 // Passes back info needed on the dropcap dimensions
759 bool GetDropSize(int& rFontHeight
, int& rDropHeight
, int& rDropDescent
) const;
761 // Hidden Paragraph Field:
762 inline bool CalcHiddenParaField()
763 { return m_pSwpHints
? m_pSwpHints
->CalcHiddenParaField() : false; }
764 // set CalcVisible flags
765 inline void SetCalcHiddenParaField()
766 { if (m_pSwpHints
) m_pSwpHints
->SetCalcHiddenParaField(); }
768 // is the paragraph visible?
769 inline bool HasHiddenParaField() const
770 { return m_pSwpHints
? m_pSwpHints
->HasHiddenParaField() : false; }
773 // Hidden Paragraph Field:
775 inline bool HasHiddenCharAttribute( bool bWholePara
) const
777 if ( m_bRecalcHiddenCharFlags
)
778 CalcHiddenCharFlags();
779 return bWholePara
? m_bHiddenCharsHidePara
: m_bContainsHiddenChars
;
782 inline void SetCalcHiddenCharFlags() const
783 { m_bRecalcHiddenCharFlags
= true; }
785 // --> FME 2004-06-08 #i12836# enhanced pdf
787 // Returns if the node is hidden due to
788 // 1. HiddenParaField
789 // 2. HiddenCharAttribute
792 bool IsHidden() const;
795 TYPEINFO(); // fuer rtti
797 // fuers Umhaengen der TxtFmtCollections (Outline-Nummerierung!!)
798 virtual void Modify( SfxPoolItem
*, SfxPoolItem
* );
800 // override SwIndexReg
801 virtual void Update( SwIndex
const & rPos
, const xub_StrLen nChangeLen
,
802 const bool bNegative
= false, const bool bDelete
= false );
804 // change text to Upper/Lower/Hiragana/Katagana/...
805 void TransliterateText( utl::TransliterationWrapper
& rTrans
,
806 xub_StrLen nStart
, xub_StrLen nEnd
,
807 SwUndoTransliterate
* pUndo
= 0 );
809 // count words in given range
810 void CountWords( SwDocStat
& rStat
, xub_StrLen nStart
, xub_StrLen nEnd
) const;
812 // Checks some global conditions like loading or destruction of document
813 // to economize notifications
814 bool IsNotificationEnabled() const;
816 // Checks a temporary notification blocker and the global conditons of IsNotificationEnabled()
817 bool IsNotifiable() const;
819 void SetListRestart( bool bRestart
);
820 // --> OD 2005-11-02 #i51089 - TUNING#
821 bool IsListRestart() const;
824 void SetAttrListRestartValue( SwNumberTree::tSwNumTreeNumber nNum
);
825 bool HasAttrListRestartValue() const;
826 SwNumberTree::tSwNumTreeNumber
GetAttrListRestartValue() const;
827 SwNumberTree::tSwNumTreeNumber
GetActualListStartValue() const;
829 void SetCountedInList( bool bCounted
);
830 bool IsCountedInList() const;
832 // --> OD 2008-03-13 #refactorlists#
833 // void SyncNumberAndNumRule();
834 // void UnregisterNumber();
836 void RemoveFromList();
837 bool IsInList() const;
840 bool IsFirstOfNumRule() const;
842 USHORT
GetScalingOfSelectedText( xub_StrLen nStt
, xub_StrLen nEnd
) const;
844 SW_DLLPRIVATE ::com::sun::star::uno::WeakReference
<
845 ::com::sun::star::text::XTextContent
> const& GetXParagraph() const
846 { return m_wXParagraph
; }
847 SW_DLLPRIVATE
void SetXParagraph(::com::sun::star::uno::Reference
<
848 ::com::sun::star::text::XTextContent
> const& xParagraph
)
849 { m_wXParagraph
= xParagraph
; }
852 virtual ::sfx2::IXmlIdRegistry
& GetRegistry();
853 virtual bool IsInClipboard() const;
854 virtual bool IsInUndo() const;
855 virtual bool IsInContent() const;
856 virtual ::com::sun::star::uno::Reference
<
857 ::com::sun::star::rdf::XMetadatable
> MakeUnoObject();
859 DECL_FIXEDMEMPOOL_NEWDEL(SwTxtNode
)
862 //-----------------------------------------------------------------------------
864 inline SwpHints
& SwTxtNode::GetSwpHints()
866 ASSERT_ID( m_pSwpHints
, ERR_NOHINTS
);
869 inline const SwpHints
&SwTxtNode::GetSwpHints() const
871 ASSERT_ID( m_pSwpHints
, ERR_NOHINTS
);
875 inline SwpHints
& SwTxtNode::GetOrCreateSwpHints()
879 m_pSwpHints
= new SwpHints
;
884 inline void SwTxtNode::TryDeleteSwpHints()
886 if ( m_pSwpHints
&& m_pSwpHints
->CanBeDeleted() )
888 DELETEZ( m_pSwpHints
);
892 inline SwTxtFmtColl
* SwTxtNode::GetTxtColl() const
894 return static_cast<SwTxtFmtColl
*>(const_cast<SwModify
*>(GetRegisteredIn()));
897 // fuer den IBM-Compiler nicht inlinen wg. 42876
899 // Inline Metoden aus Node.hxx - erst hier ist der TxtNode bekannt !!
900 inline SwTxtNode
*SwNode::GetTxtNode()
902 return ND_TEXTNODE
== nNodeType
? static_cast<SwTxtNode
*>(this) : 0;
904 inline const SwTxtNode
*SwNode::GetTxtNode() const
906 return ND_TEXTNODE
== nNodeType
? static_cast<const SwTxtNode
*>(this) : 0;
911 SwTxtNode::CutText(SwTxtNode
* const pDest
, const SwIndex
& rDestStart
,
912 const SwIndex
& rStart
, const xub_StrLen nLen
)
914 CutImpl( pDest
, rDestStart
, rStart
, nLen
, true );