1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: ndtxt.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
36 #include <hintids.hxx>
37 #include <ndhints.hxx>
39 #include <modeltoviewhelper.hxx>
40 #include <SwNumberTreeTypes.hxx>
43 // --> OD 2008-05-06 #refactorlists#
46 // --> OD 2008-12-02 #i96772#
54 class TransliterationWrapper
;
59 class SwTxtFld
; // Fuer GetTxtFld()
61 class SwUndoTransliterate
;
64 struct SwSpellArgs
; // for Spell(), splargs.hxx
65 struct SwConversionArgs
; // for Convert(), splargs.hxx
66 class SwInterHyphInfo
; // for Hyphenate(), splargs.hxx
67 class SwWrongList
; // fuer OnlineSpelling
68 class SwGrammarMarkUp
;
72 struct SwParaIdleData_Impl
;
74 // Konstanten fuer das Text-Insert:
75 #define INS_DEFAULT 0x0000 // keine Extras
76 #define INS_EMPTYEXPAND 0x0001 // leere Hints beim Einfuegen aufspannen
77 #define INS_NOHINTEXPAND 0x0002 // Hints an der InsPos nicht aufspannen
79 namespace com
{ namespace sun
{ namespace star
{ namespace uno
{
80 template < class > class Sequence
;
83 typedef std::set
< xub_StrLen
> SwSoftPageBreakList
;
85 // --------------------
87 // --------------------
88 class SW_DLLPUBLIC SwTxtNode
: public SwCntntNode
91 // fuer das Erzeugen des ersten TextNode
92 friend class SwDoc
; // CTOR und AppendTxtNode()
94 friend class SwTxtFrm
;
95 friend class SwScriptInfo
;
96 friend void SwpHints::Insert( SwTxtAttr
*, SwTxtNode
&, USHORT
);
97 friend void SwpHints::BuildPortions( SwTxtNode
&, SwTxtAttr
&, USHORT
);
99 //Kann 0 sein, nur dann nicht 0 wenn harte Attribute drin stehen.
100 //Also niemals direkt zugreifen!
103 // --> OD 2005-11-02 #i51089 - TUNING#
104 mutable SwNodeNum
* mpNodeNum
; // Numerierung fuer diesen Absatz
108 SwParaIdleData_Impl
* 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 bContainsHiddenChars
: 1;
113 // The whole paragraph is hidden because of the hidden text attribute
114 mutable BOOL bHiddenCharsHidePara
: 1;
115 // The last two flags have to be recalculated if this flag is set:
116 mutable BOOL bRecalcHiddenCharFlags
: 1;
119 mutable BOOL 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
137 SW_DLLPRIVATE
SwTxtNode( const SwNodeIndex
&rWhere
, SwTxtFmtColl
*pTxtColl
,
138 const SfxItemSet
* pAutoAttr
= 0 );
140 // Kopiert die Attribute an nStart nach pDest.
141 SW_DLLPRIVATE
void CopyAttr( SwTxtNode
*pDest
, const xub_StrLen nStart
, const xub_StrLen nOldPos
);
143 SW_DLLPRIVATE SwTxtNode
* _MakeNewTxtNode( const SwNodeIndex
&, BOOL bNext
= TRUE
,
144 BOOL bChgFollow
= TRUE
);
146 SW_DLLPRIVATE
void _Cut( SwTxtNode
*pDest
, const SwIndex
&rDestStart
,
147 const SwIndex
&rStart
, xub_StrLen nLen
, BOOL bUpdate
= TRUE
);
149 SW_DLLPRIVATE SwTxtAttr
* MakeTxtAttr( const SfxPoolItem
& rNew
, xub_StrLen nStt
, xub_StrLen nEnd
, bool bRedlineAttr
= false );
150 SW_DLLPRIVATE SwTxtAttr
* MakeTxtAttr( const SfxItemSet
& rSet
, xub_StrLen nStt
, xub_StrLen nEnd
);
152 // Verlagere alles umfassende harte Attribute in den AttrSet des Absatzes
153 SW_DLLPRIVATE
void MoveTxtAttr_To_AttrSet(); // wird von SplitNode gerufen.
155 // lege den spz. AttrSet an
156 SW_DLLPRIVATE
virtual void NewAttrSet( SwAttrPool
& );
158 SW_DLLPRIVATE
void Replace0xFF( XubString
& rTxt
, xub_StrLen
& rTxtStt
,
159 xub_StrLen nEndPos
, BOOL bExpandFlds
) const;
161 // Optimization: Asking for information about hidden characters at SwScriptInfo
162 // updates these flags.
163 inline bool IsCalcHiddenCharFlags() const { return bRecalcHiddenCharFlags
; }
164 inline void SetHiddenCharAttribute( bool bNewHiddenCharsHidePara
, bool bNewContainsHiddenChars
) const
166 bHiddenCharsHidePara
= bNewHiddenCharsHidePara
;
167 bContainsHiddenChars
= bNewContainsHiddenChars
;
168 bRecalcHiddenCharFlags
= false;
171 SW_DLLPRIVATE
void CalcHiddenCharFlags() const;
173 SW_DLLPRIVATE SwNumRule
* _GetNumRule(BOOL bInParent
= TRUE
) const;
175 SW_DLLPRIVATE
void SetLanguageAndFont( const SwPaM
&rPaM
,
176 LanguageType nLang
, USHORT nLangWhichId
,
177 const Font
*pFont
, USHORT nFontWhichId
);
180 // Start: Data collected during idle time
182 SW_DLLPRIVATE
void SetParaNumberOfWords( ULONG nTmpWords
) const;
183 SW_DLLPRIVATE ULONG
GetParaNumberOfWords() const;
184 SW_DLLPRIVATE
void SetParaNumberOfChars( ULONG nTmpChars
) const;
185 SW_DLLPRIVATE ULONG
GetParaNumberOfChars() const;
186 SW_DLLPRIVATE
void InitSwParaStatistics( bool bNew
);
188 /** create number for this text node, if not already existing
190 OD 2005-11-02 #i51089 - TUNING#
191 OD 2007-10-26 #i83479# - made private
193 @return number of this node
195 SwNodeNum
* CreateNum() const;
198 bool IsWordCountDirty() const;
199 bool IsWrongDirty() const;
200 bool IsGrammarCheckDirty() const;
201 bool IsSmartTagDirty() const; // SMARTTAGS
202 bool IsAutoCompleteWordDirty() const;
203 void SetWordCountDirty( bool bNew
) const;
204 void SetWrongDirty( bool bNew
) const;
205 void SetGrammarCheckDirty( bool bNew
) const;
206 void SetSmartTagDirty( bool bNew
) const; // SMARTTAGS
207 void SetAutoCompleteWordDirty( bool bNew
) const;
208 void SetWrong( SwWrongList
* pNew
, bool bDelete
= true );
209 SwWrongList
* GetWrong();
210 // --> OD 2008-05-23 #i71360#
211 const SwWrongList
* GetWrong() const;
213 void SetGrammarCheck( SwGrammarMarkUp
* pNew
, bool bDelete
= true );
214 SwGrammarMarkUp
* GetGrammarCheck();
216 void SetSmartTags( SwWrongList
* pNew
, bool bDelete
= true );
217 SwWrongList
* GetSmartTags();
220 // End: Data collected during idle time
224 using SwCntntNode::GetAttr
;
226 const String
& GetTxt() const { return aText
; }
228 // Zugriff auf SwpHints
229 inline SwpHints
&GetSwpHints();
230 inline const SwpHints
&GetSwpHints() const;
231 inline SwpHints
*GetpSwpHints() { return pSwpHints
; }
232 inline const SwpHints
*GetpSwpHints() const { return pSwpHints
; }
233 inline BOOL
HasHints() const { return pSwpHints
? TRUE
: FALSE
; }
234 inline SwpHints
&GetOrCreateSwpHints();
236 virtual ~SwTxtNode();
238 virtual xub_StrLen
Len() const;
241 void GetMinMaxSize( ULONG nIndex
, ULONG
& rMin
, ULONG
&rMax
, ULONG
&rAbs
,
242 OutputDevice
* pOut
= 0 ) const;
244 // --> OD 2008-03-13 #refactorlists#
245 // overriding to handle change of certain paragraph attributes
246 virtual BOOL
SetAttr( const SfxPoolItem
& );
247 virtual BOOL
SetAttr( const SfxItemSet
& rSet
);
248 virtual BOOL
ResetAttr( USHORT nWhich1
, USHORT nWhich2
= 0 );
249 virtual BOOL
ResetAttr( const SvUShorts
& rWhichArr
);
250 virtual USHORT
ResetAllAttr();
254 * Einfuegen anderer Datentypen durch Erzeugen eines
255 * temporaeren Strings.
257 SwTxtNode
& Insert( xub_Unicode c
, const SwIndex
&rIdx
);
258 SwTxtNode
& Insert( const XubString
&rStr
, const SwIndex
&rIdx
,
259 const USHORT nMode
= INS_DEFAULT
);
261 SwTxtNode
& Erase( const SwIndex
&rIdx
, xub_StrLen nCount
= STRING_LEN
,
262 const USHORT nMode
= INS_DEFAULT
);
264 // Aktionen auf Attributen
265 // loesche alle TextAttribute die als Attribut im Set vorhanden sind
266 // (Set-Pointer != 0 ) oder alle deren Which-Wert mit nWhich mappen
267 // oder wenn Which = 0, alle.
268 void RstAttr( const SwIndex
&rIdx
, xub_StrLen nLen
, USHORT nWhich
= 0,
269 const SfxItemSet
* pSet
= 0, BOOL bInclRefToxMark
= FALSE
);
272 // loesche das Text-Attribut (muss beim Pool abgemeldet werden!)
273 void DestroyAttr( SwTxtAttr
* pAttr
);
275 // loesche alle Attribute aus dem SwpHintsArray.
276 void ClearSwpHintsArr( bool bDelFields
);
278 // Insert pAttr into hints array.
279 BOOL
Insert( SwTxtAttr
*pAttr
, USHORT nMode
= 0 );
280 // lege ein neues TextAttribut an und fuege es ins SwpHints-Array ein
281 // returne den neuen Pointer (oder 0 bei Fehlern)!
282 SwTxtAttr
* InsertItem( const SfxPoolItem
& rAttr
,
283 xub_StrLen nStt
, xub_StrLen nEnd
, USHORT nMode
= 0 );
285 // setze diese Attribute am TextNode. Wird der gesamte Bereich umspannt,
286 // dann setze sie nur im AutoAttrSet (SwCntntNode:: SetAttr)
287 BOOL
SetAttr( const SfxItemSet
& rSet
,
288 xub_StrLen nStt
, xub_StrLen nEnd
, USHORT nMode
= 0 );
289 // erfrage die Attribute vom TextNode ueber den Bereich
290 // --> OD 2008-01-16 #newlistlevelattrs#
291 // Introduce 4th optional parameter <bMergeIndentValuesOfNumRule>.
292 // If <bMergeIndentValuesOfNumRule> == TRUE, the indent attributes of
293 // the corresponding list level of an applied list style is merged into
294 // the requested item set as a LR-SPACE item, if <bOnlyTxtAttr> == FALSE,
295 // corresponding node has not its own indent attributes and the
296 // position-and-space mode of the list level is SvxNumberFormat::LABEL_ALIGNMENT.
297 BOOL
GetAttr( SfxItemSet
& rSet
, xub_StrLen nStt
, xub_StrLen nEnd
,
298 BOOL bOnlyTxtAttr
= FALSE
,
299 BOOL bGetFromChrFmt
= TRUE
,
300 const bool bMergeIndentValuesOfNumRule
= false ) const;
303 // uebertrage Attribute eines AttrSets ( AutoFmt ) in das SwpHintsArray
304 void FmtToTxtAttr( SwTxtNode
* pNd
);
306 // loeschen eines einzelnen Attributes (fuer SwUndoAttr)
307 // ( nur das Attribut loeschen, dass mit Which,Start und End oder
308 // mit pTxtHint identisch ist (es gibt nur ein gueltiges))
309 // AUSNAHME: ToxMarks !!!
310 void Delete( USHORT nTxtWhich
, xub_StrLen nStart
, xub_StrLen nEnd
= 0 );
311 void Delete( SwTxtAttr
* pTxtAttr
, BOOL bThisOnly
= FALSE
);
313 // Aktionen auf Text und Attributen
314 // --> OD 2008-11-18 #i96213#
315 // introduce optional parameter to control, if all attributes have to be copied.
316 void Copy( SwTxtNode
*pDest
,
317 const SwIndex
&rStart
,
319 const bool bForceCopyOfAllAttrs
= false );
320 void Copy( SwTxtNode
*pDest
,
321 const SwIndex
&rDestStart
,
322 const SwIndex
&rStart
,
324 const bool bForceCopyOfAllAttrs
= false );
326 void Cut(SwTxtNode
*pDest
, const SwIndex
&rStart
, xub_StrLen nLen
);
327 inline void Cut(SwTxtNode
*pDest
, const SwIndex
&rDestStart
,
328 const SwIndex
&rStart
, xub_StrLen nLen
);
329 // ersetze im String an Position nIdx das Zeichen
330 void Replace( const SwIndex
& rStart
, xub_Unicode cCh
);
331 void Replace( const SwIndex
& rStart
, xub_StrLen nLen
, const XubString
& rText
);
332 void ReplaceTextOnly( xub_StrLen nPos
, xub_StrLen nLen
, const XubString
& rText
,
333 const ::com::sun::star::uno::Sequence
<sal_Int32
>& rOffsets
);
335 // virtuelle Methoden aus dem CntntNode
336 virtual SwCntntFrm
*MakeFrm();
337 virtual SwCntntNode
*SplitCntntNode( const SwPosition
& );
338 virtual SwCntntNode
*JoinNext();
339 virtual SwCntntNode
*JoinPrev();
341 SwCntntNode
*AppendNode( const SwPosition
& );
343 // setze ggf. das DontExpand-Flag an INet bzw. Zeichenvorlagen
344 BOOL
DontExpandFmt( const SwIndex
& rIdx
, BOOL bFlag
= TRUE
,
345 BOOL bFmtToTxtAttributes
= TRUE
);
347 // gebe das vorgegebene Attribut, welches an der TextPosition (rIdx)
348 // gesetzt ist zurueck. Gibt es keines, returne 0-Pointer
349 // gesetzt heisst: Start <= rIdx < End
350 SwTxtAttr
*GetTxtAttr( const SwIndex
& rIdx
, USHORT nWhichHt
,
351 BOOL bExpand
= FALSE
) const;
353 // Diese Methode liefert nur Textattribute auf der Position nIdx
354 // zurueck, die kein EndIdx besitzen und denselben Which besitzen.
355 // Ueblicherweise steht an dieser Position ein CH_TXTATR.
356 // Bei RES_TXTATR_END entfaellt die Pruefung auf den Which-Wert.
357 SwTxtAttr
*GetTxtAttr( const xub_StrLen nIdx
,
358 const USHORT nWhichHt
= RES_TXTATR_END
) const;
360 SwTxtFld
*GetTxtFld( const SwIndex
& rIdx
)
361 { return (SwTxtFld
*)GetTxtAttr( rIdx
, RES_TXTATR_FIELD
); }
363 // Aktuelles Wort zurueckliefern
364 XubString
GetCurWord(xub_StrLen
) const;
365 USHORT
Spell(SwSpellArgs
*);
366 USHORT
Convert( SwConversionArgs
& );
368 inline SwTxtFmtColl
*GetTxtColl() const;
369 virtual SwFmtColl
*ChgFmtColl( SwFmtColl
* );
370 void _ChgTxtCollUpdateNum( const SwTxtFmtColl
* pOld
,
371 const SwTxtFmtColl
* pNew
);
373 // kopiere die Collection mit allen Autoformaten zum Dest-Node
374 // dieser kann auch in einem anderen Dokument stehen!
375 // (Methode steht im ndcopy.cxx!!)
376 void CopyCollFmt( SwTxtNode
& rDestNd
);
378 //const SwNodeNum* _GetNodeNum() const { return pNdNum; }
381 // BEGIN OF BULLET/NUMBERING/OUTLINE STUFF:
385 Returns numbering rule of this text node.
387 @param bInParent serach in parent attributes, too
389 @return numbering rule of this text node or NULL if none is set
391 SwNumRule
*GetNumRule(BOOL bInParent
= TRUE
) const;
393 inline const SwNodeNum
* GetNum() const
398 SwNumberTree::tNumberVector
GetNumberVector() const;
401 Returns if this text node is an outline.
403 @retval TRUE this text node is an outline
406 BOOL
IsOutline() const;
408 BOOL
IsOutlineStateChanged() const;
410 void UpdateOutlineState();
414 Returns if this text node may be numbered.
416 A text node may be numbered if
417 - it has no SwNodeNum
418 - it has a SwNodeNum and it has a numbering rule and the according
419 SwNumFmt defines a numbering type that is an enumeration.
421 @retval TRUE this text node may be numbered
424 //BOOL MayBeNumbered() const;
427 Notify this textnode that its numbering rule has changed.
431 /** Returns outline of numbering string
433 OD 2005-11-17 #128041#
434 Introduce parameter <_bInclPrefixAndSuffixStrings> in order to control,
435 if the prefix and the suffix strings have to been included or not.
437 @param _bInclPrefixAndSuffixStrings
438 optional input parameter - boolean indicating, if the prefix and the
439 suffix strings have to been included or not. default value = <true>
441 @param _nRestrictToThisLevel
442 optional input parameter - unsigned integer indicating the maximum outline
443 level to which the output string must be restricted to. Default value is
446 XubString
GetNumString( const bool _bInclPrefixAndSuffixStrings
= true, const unsigned int _nRestrictToThisLevel
= MAXLEVEL
) const;
449 Returns the additional indents of this text node and its numbering.
453 @return additional indents
455 long GetLeftMarginWithNum( BOOL bTxtLeft
= FALSE
) const;
458 Returns the combined first line indent of this text node and
461 @param the first line indent of this text node taking the
462 numbering into account (return parameter)
464 @retval TRUE this node has SwNodeNum and has numbering rule
467 BOOL
GetFirstLineOfsWithNum( short& rFirstOffset
) const;
469 // --> OD 2008-12-02 #i96772#
470 void ClearLRSpaceItemDueToListLevelIndents( SvxLRSpaceItem
& o_rLRSpaceItem
) const;
473 /** return left margin for tab stop position calculation
475 OD 2008-06-30 #i91133#
476 Needed for text formatting
477 Method considers new list level attributes, which also can provide a left margin value
481 long GetLeftMarginForTabCalculation() const;
484 Returns if this text node has a number.
486 This text node has a number if it has a SwNodeNum and a
487 numbering rule and the numbering format specified for the
488 level of the SwNodeNum is of an enumeration type.
490 @retval TRUE This text node has a number.
493 BOOL
HasNumber() const;
496 Returns if this text node has a bullet.
498 This text node has a bullet if it has a SwNodeNum and a
499 numbering rule and the numbering format specified for the
500 level of the SwNodeNum is of a bullet type.
502 @retval TRUE This text node has a bullet.
505 BOOL
HasBullet() const;
508 Returns is this text node is numbered.
510 This node is numbered if it has a SwNodeNum and it has a
511 numbering rule and has not a hidden SwNodeNum.
513 ATTENTION: Returns TRUE even if the SwNumFmt has type
516 @retval TRUE This node is numbered.
519 BOOL
IsNumbered() const;
522 Returns if this text node has a marked label.
524 @retval true This text node has a marked label.
527 bool HasMarkedLabel() const;
529 /** Sets the list level of this text node.
531 Side effect, when the text node is a list item:
532 The text node's representation in the list tree (<SwNodeNum> instance)
535 @param nLevel level to set
537 void SetAttrListLevel(int nLevel
);
539 bool HasAttrListLevel() const;
541 int GetAttrListLevel() const;
543 /** Returns the actual list level of this text node, when it is a list item
545 @return the actual list level of this text node, if it is a list item,
548 int GetActualListLevel() const;
551 Returns outline level of this text node.
553 If a text node has an outline number (i.e. it has an SwNodeNum
554 and a outline numbering rule) the outline level is the level of
557 If a text node has no outline number and has a paragraph style
558 attached the outline level is the outline level of the
561 Otherwise the text node has no outline level (NO_NUMBERING).
563 NOTE: The outline level of text nodes is subject to change. The
564 plan is to have an SwTxtNode::nOutlineLevel member that is
565 updated from a paragraph style upon appliance of that paragraph
568 @return outline level or NO_NUMBERING if there is no outline level
570 int GetAttrOutlineLevel() const;//#OutlineLevel,added by zhaojianwei
573 Sets the out line level *at* a text node.
575 @param nLevel the level to be set
577 If the text node has an outline number the level is set at the
580 If the text node has no outline number but has a paragraph
581 style applied the outline level is set at the paragraph style.
583 NOTE: This is subject to change, see GetOutlineLevel.
585 //void SetOutlineLevel(int nLevel);
586 void SetAttrOutlineLevel(int nLevel
);//#OutlineLevel,added by zhaojianwei
588 // --> OD 2008-11-19 #i70748#
589 bool IsEmptyListStyleDueToSetOutlineLevelAttr();
590 void SetEmptyListStyleDueToSetOutlineLevelAttr();
591 void ResetEmptyListStyleDueToResetOutlineLevelAttr();
595 Returns the width of leading tabs/blanks in this paragraph.
596 This space will be converted into numbering indent if the paragraph
597 is set to be numbered.
599 @return the width of the leading whitespace
601 USHORT
GetWidthOfLeadingTabs() const;
605 Returns if the paragraph has a visible numbering or bullet.
606 This includes all kinds of numbering/bullet/outlines.
607 Note: This function returns false, if the numbering format is
608 SVX_NUM_NUMBER_NONE or if the numbering/bullet has been deleted.
610 @return TRUE if the paragraph has a visible numbering/bullet/outline
612 bool HasVisibleNumberingOrBullet() const;
614 // --> OD 2008-02-19 #refactorlists#
615 void SetListId( const String sListId
);
616 String
GetListId() const;
619 /** Determines, if the list level indent attributes can be applied to the
622 OD 2008-01-17 #newlistlevelattrs#
623 The list level indents can be applied to the paragraph under the one
624 of following conditions:
625 - the list style is directly applied to the paragraph and the paragraph
626 has no own indent attributes.
627 - the list style is applied to the paragraph through one of its paragraph
628 styles, the paragraph has no own indent attributes and on the paragraph
629 style hierarchy from the paragraph to the paragraph style with the
630 list style no indent attributes are found.
636 bool AreListLevelIndentsApplicable() const;
638 /** Retrieves the list tab stop position, if the paragraph's list level defines
639 one and this list tab stop has to merged into the tap stops of the paragraph
641 OD 2008-01-17 #newlistlevelattrs#
645 @param nListTabStopPosition
646 output parameter - containing the list tab stop position
648 @return boolean - indicating, if a list tab stop position is provided
650 bool GetListTabStopPosition( long& nListTabStopPosition
) const;
652 /** Retrieves the character following the list label, if the paragraph's
653 list level defines one.
655 OD 2008-01-17 #newlistlevelattrs#
659 @return XubString - the list tab stop position
661 XubString
GetLabelFollowedBy() const;
664 // END OF BULLET/NUMBERING/OUTLINE STUFF:
667 void fillSoftPageBreakList( SwSoftPageBreakList
& rBreak
) const;
669 USHORT
GetLang( const xub_StrLen nBegin
, const xub_StrLen nLen
= 0,
670 USHORT nScript
= 0 ) const;
672 // steht in ndcopy.cxx
673 BOOL
IsSymbol( const xub_StrLen nBegin
) const; // steht in itratr.cxx
674 virtual SwCntntNode
* MakeCopy( SwDoc
*, const SwNodeIndex
& ) const;
676 // interaktive Trennung: wir finden den TxtFrm und rufen sein CalcHyph
677 BOOL
Hyphenate( SwInterHyphInfo
&rHyphInf
);
678 void DelSoftHyph( const xub_StrLen nStart
, const xub_StrLen nEnd
);
680 // --> OD 2007-11-15 #i83479#
681 // add 4th optional parameter <bAddSpaceAfterListLabelStr> indicating,
682 // when <bWithNum = true> that a space is inserted after the string for
684 // add 5th optional parameter <bWithSpacesForLevel> indicating, if additional
685 // spaces are inserted in front of the expanded text string depending on
687 XubString
GetExpandTxt( const xub_StrLen nIdx
= 0,
688 const xub_StrLen nLen
= STRING_LEN
,
689 const bool bWithNum
= false,
690 const bool bAddSpaceAfterListLabelStr
= false,
691 const bool bWithSpacesForLevel
= false ) const;
693 BOOL
GetExpandTxt( SwTxtNode
& rDestNd
, const SwIndex
* pDestIdx
= 0,
694 xub_StrLen nIdx
= 0, xub_StrLen nLen
= STRING_LEN
,
695 BOOL bWithNum
= FALSE
, BOOL bWithFtn
= TRUE
,
696 BOOL bReplaceTabsWithSpaces
= FALSE
) const;
701 const ModelToViewHelper::ConversionMap
*
702 BuildConversionMap( rtl::OUString
& rExpandText
) const;
704 XubString
GetRedlineTxt( xub_StrLen nIdx
= 0,
705 xub_StrLen nLen
= STRING_LEN
,
706 BOOL bExpandFlds
= FALSE
,
707 BOOL bWithNum
= FALSE
) const;
708 //Liefert fuer die Initalfunktion tatsaechliche Anzahl der Initialzeichen
709 //bei nWishLen == 0 die des ersten Wortes
710 USHORT
GetDropLen( USHORT nWishLen
) const;
712 // Passes back info needed on the dropcap dimensions
713 bool GetDropSize(int& rFontHeight
, int& rDropHeight
, int& rDropDescent
) const;
717 // Hidden Paragraph Field:
719 inline BOOL
CalcHiddenParaField()
720 { if(pSwpHints
) return pSwpHints
->CalcHiddenParaField(); return FALSE
; }
721 // Setzen des CalcVisible-Flags
722 inline void SetCalcHiddenParaField(){ if(pSwpHints
) pSwpHints
->SetCalcHiddenParaField(); }
724 // Ist der Absatz sichtbar
725 inline BOOL
HasHiddenParaField() const
726 { return pSwpHints
? pSwpHints
->HasHiddenParaField() : FALSE
; }
729 // Hidden Paragraph Field:
731 inline bool HasHiddenCharAttribute( bool bWholePara
) const
733 if ( bRecalcHiddenCharFlags
)
734 CalcHiddenCharFlags();
735 return bWholePara
? bHiddenCharsHidePara
: bContainsHiddenChars
;
737 inline void SetCalcHiddenCharFlags() const { bRecalcHiddenCharFlags
= TRUE
; }
739 // --> FME 2004-06-08 #i12836# enhanced pdf
741 // Returns if the node is hidden due to
742 // 1. HiddenParaField
743 // 2. HiddenCharAttribute
746 bool IsHidden() const;
749 inline SwTxtAttr
* MakeRedlineTxtAttr( const SfxPoolItem
& rNew
)
750 { return MakeTxtAttr( rNew
, 0, 0, true ); }
752 TYPEINFO(); // fuer rtti
754 // fuers Umhaengen der TxtFmtCollections (Outline-Nummerierung!!)
755 virtual void Modify( SfxPoolItem
*, SfxPoolItem
* );
758 virtual void Update( const SwIndex
& aPos
, USHORT xub_StrLen
,
759 BOOL bNegativ
= FALSE
, BOOL bDelete
= FALSE
);
761 // change text to Upper/Lower/Hiragana/Katagana/...
762 void TransliterateText( utl::TransliterationWrapper
& rTrans
,
763 xub_StrLen nStart
, xub_StrLen nEnd
,
764 SwUndoTransliterate
* pUndo
= 0 );
766 // count words in given range
767 void CountWords( SwDocStat
& rStat
, xub_StrLen nStart
, xub_StrLen nEnd
) const;
771 Returns position of certain text attribute.
773 @param pAttr text attribute to search
775 @return position of given attribute or NULL in case of failure
777 SwPosition
* GetPosition(const SwTxtAttr
* pAttr
);
779 // Checks some global conditions like loading or destruction of document
780 // to economize notifications
781 bool IsNotificationEnabled() const;
783 // Checks a temporary notification blocker and the global conditons of IsNotificationEnabled()
784 bool IsNotifiable() const;
786 void SetListRestart( bool bRestart
);
787 // --> OD 2005-11-02 #i51089 - TUNING#
788 bool IsListRestart() const;
791 void SetAttrListRestartValue( SwNumberTree::tSwNumTreeNumber nNum
);
792 bool HasAttrListRestartValue() const;
793 SwNumberTree::tSwNumTreeNumber
GetAttrListRestartValue() const;
794 SwNumberTree::tSwNumTreeNumber
GetActualListStartValue() const;
796 void SetCountedInList( bool bCounted
);
797 bool IsCountedInList() const;
799 // --> OD 2008-03-13 #refactorlists#
800 // void SyncNumberAndNumRule();
801 // void UnregisterNumber();
803 void RemoveFromList();
804 bool IsInList() const;
807 bool IsFirstOfNumRule() const;
809 USHORT
GetScalingOfSelectedText( xub_StrLen nStt
, xub_StrLen nEnd
) const;
811 DECL_FIXEDMEMPOOL_NEWDEL(SwTxtNode
)
814 //-----------------------------------------------------------------------------
816 inline SwpHints
&SwTxtNode::GetSwpHints()
818 ASSERT_ID( pSwpHints
, ERR_NOHINTS
);
821 inline const SwpHints
&SwTxtNode::GetSwpHints() const
823 ASSERT_ID( pSwpHints
, ERR_NOHINTS
);
827 inline SwpHints
& SwTxtNode::GetOrCreateSwpHints()
830 pSwpHints
= new SwpHints
;
834 inline SwTxtFmtColl
* SwTxtNode::GetTxtColl() const
836 return (SwTxtFmtColl
*)GetRegisteredIn();
839 // fuer den IBM-Compiler nicht inlinen wg. 42876
841 // Inline Metoden aus Node.hxx - erst hier ist der TxtNode bekannt !!
842 inline SwTxtNode
*SwNode::GetTxtNode()
844 return ND_TEXTNODE
== nNodeType
? (SwTxtNode
*)this : 0;
846 inline const SwTxtNode
*SwNode::GetTxtNode() const
848 return ND_TEXTNODE
== nNodeType
? (const SwTxtNode
*)this : 0;
852 inline void SwTxtNode::Cut(SwTxtNode
*pDest
, const SwIndex
&rDestStart
,
853 const SwIndex
&rStart
, xub_StrLen nLen
)
855 _Cut( pDest
, rDestStart
, rStart
, nLen
, TRUE
);