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>
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 // Konstanten fuer das Text-Insert:
79 #define INS_DEFAULT 0x0000 // keine Extras
80 #define INS_EMPTYEXPAND 0x0001 // leere Hints beim Einfuegen aufspannen
81 #define INS_NOHINTEXPAND 0x0002 // Hints an der InsPos nicht aufspannen
83 namespace com
{ namespace sun
{ namespace star
{ namespace uno
{
84 template < class > class Sequence
;
87 typedef std::set
< xub_StrLen
> SwSoftPageBreakList
;
89 // --------------------
91 // --------------------
92 class SW_DLLPUBLIC SwTxtNode
: public SwCntntNode
, public ::sfx2::Metadatable
95 // fuer das Erzeugen des ersten TextNode
96 friend class SwDoc
; // CTOR und AppendTxtNode()
98 friend class SwTxtFrm
;
99 friend class SwScriptInfo
;
100 friend void SwpHints::Insert( SwTxtAttr
*, SwTxtNode
&, USHORT
);
101 friend void SwpHints::BuildPortions( SwTxtNode
&, SwTxtAttr
&, USHORT
);
103 //Kann 0 sein, nur dann nicht 0 wenn harte Attribute drin stehen.
104 //Also niemals direkt zugreifen!
105 SwpHints
*m_pSwpHints
;
107 // --> OD 2005-11-02 #i51089 - TUNING#
108 mutable SwNodeNum
* mpNodeNum
; // Numerierung fuer diesen Absatz
112 SwParaIdleData_Impl
* m_pParaIdleData_Impl
;
114 // Some of the chars this para are hidden. Paragraph has to be reformatted
115 // on changing the view to print preview.
116 mutable bool m_bContainsHiddenChars
: 1;
117 // The whole paragraph is hidden because of the hidden text attribute
118 mutable bool m_bHiddenCharsHidePara
: 1;
119 // The last two flags have to be recalculated if this flag is set:
120 mutable bool m_bRecalcHiddenCharFlags
: 1;
122 mutable bool m_bLastOutlineState
: 1;
125 // BYTE nOutlineLevel; //#outline level, removed by zhaojianwei.
126 // --> OD 2008-11-19 #i70748#
127 bool mbEmptyListStyleSetDueToSetOutlineLevelAttr
;
130 // --> OD 2008-03-27 #refactorlists#
131 // boolean, indicating that a <SetAttr(..)> or <ResetAttr(..)> or
132 // <ResetAllAttr(..)> method is running.
133 // Needed to avoid duplicate handling of attribute change actions.
134 bool mbInSetOrResetAttr
;
136 // --> OD 2008-05-06 #refactorlists#
137 // pointer to the list, to whose the text node is added to
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 _Cut( SwTxtNode
*pDest
, const SwIndex
&rDestStart
,
152 const SwIndex
&rStart
, xub_StrLen nLen
, BOOL bUpdate
= TRUE
);
154 SW_DLLPRIVATE SwTxtAttr
* MakeTxtAttr( const SfxPoolItem
& rNew
, xub_StrLen nStt
, xub_StrLen nEnd
, bool bRedlineAttr
= false );
155 SW_DLLPRIVATE SwTxtAttr
* MakeTxtAttr( const SfxItemSet
& rSet
, xub_StrLen nStt
, xub_StrLen nEnd
);
157 // Verlagere alles umfassende harte Attribute in den AttrSet des Absatzes
158 SW_DLLPRIVATE
void MoveTxtAttr_To_AttrSet(); // wird von SplitNode gerufen.
160 // lege den spz. AttrSet an
161 SW_DLLPRIVATE
virtual void NewAttrSet( SwAttrPool
& );
163 SW_DLLPRIVATE
void Replace0xFF( XubString
& rTxt
, xub_StrLen
& rTxtStt
,
164 xub_StrLen nEndPos
, BOOL bExpandFlds
) const;
166 // Optimization: Asking for information about hidden characters at SwScriptInfo
167 // updates these flags.
168 inline bool IsCalcHiddenCharFlags() const
169 { return m_bRecalcHiddenCharFlags
; }
170 inline void SetHiddenCharAttribute( bool bNewHiddenCharsHidePara
, bool bNewContainsHiddenChars
) const
172 m_bHiddenCharsHidePara
= bNewHiddenCharsHidePara
;
173 m_bContainsHiddenChars
= bNewContainsHiddenChars
;
174 m_bRecalcHiddenCharFlags
= false;
177 SW_DLLPRIVATE
void CalcHiddenCharFlags() const;
179 SW_DLLPRIVATE SwNumRule
* _GetNumRule(BOOL bInParent
= TRUE
) const;
181 SW_DLLPRIVATE
void SetLanguageAndFont( const SwPaM
&rPaM
,
182 LanguageType nLang
, USHORT nLangWhichId
,
183 const Font
*pFont
, USHORT nFontWhichId
);
186 // Start: Data collected during idle time
188 SW_DLLPRIVATE
void SetParaNumberOfWords( ULONG nTmpWords
) const;
189 SW_DLLPRIVATE ULONG
GetParaNumberOfWords() const;
190 SW_DLLPRIVATE
void SetParaNumberOfChars( ULONG nTmpChars
) const;
191 SW_DLLPRIVATE ULONG
GetParaNumberOfChars() const;
192 SW_DLLPRIVATE
void InitSwParaStatistics( bool bNew
);
194 /** create number for this text node, if not already existing
196 OD 2005-11-02 #i51089 - TUNING#
197 OD 2007-10-26 #i83479# - made private
199 @return number of this node
201 SwNodeNum
* CreateNum() const;
203 inline void TryDeleteSwpHints();
206 bool IsWordCountDirty() const;
207 bool IsWrongDirty() const;
208 bool IsGrammarCheckDirty() const;
209 bool IsSmartTagDirty() const; // SMARTTAGS
210 bool IsAutoCompleteWordDirty() const;
211 void SetWordCountDirty( bool bNew
) const;
212 void SetWrongDirty( bool bNew
) const;
213 void SetGrammarCheckDirty( bool bNew
) const;
214 void SetSmartTagDirty( bool bNew
) const; // SMARTTAGS
215 void SetAutoCompleteWordDirty( bool bNew
) const;
216 void SetWrong( SwWrongList
* pNew
, bool bDelete
= true );
217 SwWrongList
* GetWrong();
218 // --> OD 2008-05-23 #i71360#
219 const SwWrongList
* GetWrong() const;
221 void SetGrammarCheck( SwGrammarMarkUp
* pNew
, bool bDelete
= true );
222 SwGrammarMarkUp
* GetGrammarCheck();
224 void SetSmartTags( SwWrongList
* pNew
, bool bDelete
= true );
225 SwWrongList
* GetSmartTags();
228 // End: Data collected during idle time
232 using SwCntntNode::GetAttr
;
234 const String
& GetTxt() const { return m_Text
; }
236 // getters for SwpHints
237 inline SwpHints
&GetSwpHints();
238 inline const SwpHints
&GetSwpHints() const;
239 inline SwpHints
*GetpSwpHints() { return m_pSwpHints
; }
240 inline const SwpHints
*GetpSwpHints() const { return m_pSwpHints
; }
241 inline bool HasHints() const { return m_pSwpHints
? true : false; }
242 inline SwpHints
&GetOrCreateSwpHints();
244 virtual ~SwTxtNode();
246 virtual xub_StrLen
Len() const;
249 void GetMinMaxSize( ULONG nIndex
, ULONG
& rMin
, ULONG
&rMax
, ULONG
&rAbs
,
250 OutputDevice
* pOut
= 0 ) const;
252 // --> OD 2008-03-13 #refactorlists#
253 // overriding to handle change of certain paragraph attributes
254 virtual BOOL
SetAttr( const SfxPoolItem
& );
255 virtual BOOL
SetAttr( const SfxItemSet
& rSet
);
256 virtual BOOL
ResetAttr( USHORT nWhich1
, USHORT nWhich2
= 0 );
257 virtual BOOL
ResetAttr( const SvUShorts
& rWhichArr
);
258 virtual USHORT
ResetAllAttr();
262 * Einfuegen anderer Datentypen durch Erzeugen eines
263 * temporaeren Strings.
265 SwTxtNode
& Insert( xub_Unicode c
, const SwIndex
&rIdx
);
266 SwTxtNode
& Insert( const XubString
&rStr
, const SwIndex
&rIdx
,
267 const USHORT nMode
= INS_DEFAULT
);
269 SwTxtNode
& Erase( const SwIndex
&rIdx
, xub_StrLen nCount
= STRING_LEN
,
270 const USHORT nMode
= INS_DEFAULT
);
272 // Aktionen auf Attributen
273 // loesche alle TextAttribute die als Attribut im Set vorhanden sind
274 // (Set-Pointer != 0 ) oder alle deren Which-Wert mit nWhich mappen
275 // oder wenn Which = 0, alle.
276 void RstAttr( const SwIndex
&rIdx
, xub_StrLen nLen
, USHORT nWhich
= 0,
277 const SfxItemSet
* pSet
= 0, BOOL bInclRefToxMark
= FALSE
);
280 // loesche das Text-Attribut (muss beim Pool abgemeldet werden!)
281 void DestroyAttr( SwTxtAttr
* pAttr
);
283 // loesche alle Attribute aus dem SwpHintsArray.
284 void ClearSwpHintsArr( bool bDelFields
);
286 // Insert pAttr into hints array.
287 BOOL
Insert( SwTxtAttr
*pAttr
, USHORT nMode
= 0 );
288 // lege ein neues TextAttribut an und fuege es ins SwpHints-Array ein
289 // returne den neuen Pointer (oder 0 bei Fehlern)!
290 SwTxtAttr
* InsertItem( const SfxPoolItem
& rAttr
,
291 xub_StrLen nStt
, xub_StrLen nEnd
, USHORT nMode
= 0 );
293 // setze diese Attribute am TextNode. Wird der gesamte Bereich umspannt,
294 // dann setze sie nur im AutoAttrSet (SwCntntNode:: SetAttr)
295 BOOL
SetAttr( const SfxItemSet
& rSet
,
296 xub_StrLen nStt
, xub_StrLen nEnd
, USHORT nMode
= 0 );
297 // erfrage die Attribute vom TextNode ueber den Bereich
298 // --> OD 2008-01-16 #newlistlevelattrs#
299 // Introduce 4th optional parameter <bMergeIndentValuesOfNumRule>.
300 // If <bMergeIndentValuesOfNumRule> == TRUE, the indent attributes of
301 // the corresponding list level of an applied list style is merged into
302 // the requested item set as a LR-SPACE item, if <bOnlyTxtAttr> == FALSE,
303 // corresponding node has not its own indent attributes and the
304 // position-and-space mode of the list level is SvxNumberFormat::LABEL_ALIGNMENT.
305 BOOL
GetAttr( SfxItemSet
& rSet
, xub_StrLen nStt
, xub_StrLen nEnd
,
306 BOOL bOnlyTxtAttr
= FALSE
,
307 BOOL bGetFromChrFmt
= TRUE
,
308 const bool bMergeIndentValuesOfNumRule
= false ) const;
311 // uebertrage Attribute eines AttrSets ( AutoFmt ) in das SwpHintsArray
312 void FmtToTxtAttr( SwTxtNode
* pNd
);
314 // loeschen eines einzelnen Attributes (fuer SwUndoAttr)
315 // ( nur das Attribut loeschen, dass mit Which,Start und End oder
316 // mit pTxtHint identisch ist (es gibt nur ein gueltiges))
317 // AUSNAHME: ToxMarks !!!
318 void Delete( USHORT nTxtWhich
, xub_StrLen nStart
, xub_StrLen nEnd
= 0 );
319 void Delete( SwTxtAttr
* pTxtAttr
, BOOL bThisOnly
= FALSE
);
321 // Aktionen auf Text und Attributen
322 // --> OD 2008-11-18 #i96213#
323 // introduce optional parameter to control, if all attributes have to be copied.
324 void Copy( SwTxtNode
*pDest
,
325 const SwIndex
&rStart
,
327 const bool bForceCopyOfAllAttrs
= false );
328 void Copy( SwTxtNode
*pDest
,
329 const SwIndex
&rDestStart
,
330 const SwIndex
&rStart
,
332 const bool bForceCopyOfAllAttrs
= false );
334 void Cut(SwTxtNode
*pDest
, const SwIndex
&rStart
, xub_StrLen nLen
);
335 inline void Cut(SwTxtNode
*pDest
, const SwIndex
&rDestStart
,
336 const SwIndex
&rStart
, xub_StrLen nLen
);
337 // ersetze im String an Position nIdx das Zeichen
338 void Replace( const SwIndex
& rStart
, xub_Unicode cCh
);
339 void Replace( const SwIndex
& rStart
, xub_StrLen nLen
, const XubString
& rText
);
340 void ReplaceTextOnly( xub_StrLen nPos
, xub_StrLen nLen
, const XubString
& rText
,
341 const ::com::sun::star::uno::Sequence
<sal_Int32
>& rOffsets
);
343 // virtuelle Methoden aus dem CntntNode
344 virtual SwCntntFrm
*MakeFrm();
345 virtual SwCntntNode
*SplitCntntNode( const SwPosition
& );
346 virtual SwCntntNode
*JoinNext();
347 virtual SwCntntNode
*JoinPrev();
349 SwCntntNode
*AppendNode( const SwPosition
& );
351 // setze ggf. das DontExpand-Flag an INet bzw. Zeichenvorlagen
352 BOOL
DontExpandFmt( const SwIndex
& rIdx
, bool bFlag
= true,
353 BOOL bFmtToTxtAttributes
= TRUE
);
355 // gebe das vorgegebene Attribut, welches an der TextPosition (rIdx)
356 // gesetzt ist zurueck. Gibt es keines, returne 0-Pointer
357 // gesetzt heisst: Start <= rIdx < End
358 SwTxtAttr
*GetTxtAttr( const SwIndex
& rIdx
, USHORT nWhichHt
,
359 BOOL bExpand
= FALSE
) const;
361 // Diese Methode liefert nur Textattribute auf der Position nIdx
362 // zurueck, die kein EndIdx besitzen und denselben Which besitzen.
363 // Ueblicherweise steht an dieser Position ein CH_TXTATR.
364 // Bei RES_TXTATR_END entfaellt die Pruefung auf den Which-Wert.
365 SwTxtAttr
*GetTxtAttr( const xub_StrLen nIdx
,
366 const USHORT nWhichHt
= RES_TXTATR_END
) const;
368 SwTxtFld
*GetTxtFld( const SwIndex
& rIdx
)
369 { return (SwTxtFld
*)GetTxtAttr( rIdx
, RES_TXTATR_FIELD
); }
371 // Aktuelles Wort zurueckliefern
372 XubString
GetCurWord(xub_StrLen
) const;
373 USHORT
Spell(SwSpellArgs
*);
374 USHORT
Convert( SwConversionArgs
& );
376 inline SwTxtFmtColl
*GetTxtColl() const;
377 virtual SwFmtColl
*ChgFmtColl( SwFmtColl
* );
378 void _ChgTxtCollUpdateNum( const SwTxtFmtColl
* pOld
,
379 const SwTxtFmtColl
* pNew
);
381 // kopiere die Collection mit allen Autoformaten zum Dest-Node
382 // dieser kann auch in einem anderen Dokument stehen!
383 // (Methode steht im ndcopy.cxx!!)
384 void CopyCollFmt( SwTxtNode
& rDestNd
);
386 //const SwNodeNum* _GetNodeNum() const { return pNdNum; }
389 // BEGIN OF BULLET/NUMBERING/OUTLINE STUFF:
393 Returns numbering rule of this text node.
395 @param bInParent serach in parent attributes, too
397 @return numbering rule of this text node or NULL if none is set
399 SwNumRule
*GetNumRule(BOOL bInParent
= TRUE
) const;
401 inline const SwNodeNum
* GetNum() const
406 SwNumberTree::tNumberVector
GetNumberVector() const;
409 Returns if this text node is an outline.
411 @retval true this text node is an outline
414 bool IsOutline() const;
416 bool IsOutlineStateChanged() const;
418 void UpdateOutlineState();
422 Returns if this text node may be numbered.
424 A text node may be numbered if
425 - it has no SwNodeNum
426 - it has a SwNodeNum and it has a numbering rule and the according
427 SwNumFmt defines a numbering type that is an enumeration.
429 @retval TRUE this text node may be numbered
432 //BOOL MayBeNumbered() const;
435 Notify this textnode that its numbering rule has changed.
439 /** Returns outline of numbering string
441 OD 2005-11-17 #128041#
442 Introduce parameter <_bInclPrefixAndSuffixStrings> in order to control,
443 if the prefix and the suffix strings have to been included or not.
445 @param _bInclPrefixAndSuffixStrings
446 optional input parameter - boolean indicating, if the prefix and the
447 suffix strings have to been included or not. default value = <true>
449 @param _nRestrictToThisLevel
450 optional input parameter - unsigned integer indicating the maximum outline
451 level to which the output string must be restricted to. Default value is
454 XubString
GetNumString( const bool _bInclPrefixAndSuffixStrings
= true, const unsigned int _nRestrictToThisLevel
= MAXLEVEL
) const;
457 Returns the additional indents of this text node and its numbering.
461 @return additional indents
463 long GetLeftMarginWithNum( BOOL bTxtLeft
= FALSE
) const;
466 Returns the combined first line indent of this text node and
469 @param the first line indent of this text node taking the
470 numbering into account (return parameter)
472 @retval TRUE this node has SwNodeNum and has numbering rule
475 BOOL
GetFirstLineOfsWithNum( short& rFirstOffset
) const;
477 // --> OD 2008-12-02 #i96772#
478 void ClearLRSpaceItemDueToListLevelIndents( SvxLRSpaceItem
& o_rLRSpaceItem
) const;
481 /** return left margin for tab stop position calculation
483 OD 2008-06-30 #i91133#
484 Needed for text formatting
485 Method considers new list level attributes, which also can provide a left margin value
489 long GetLeftMarginForTabCalculation() const;
492 Returns if this text node has a number.
494 This text node has a number if it has a SwNodeNum and a
495 numbering rule and the numbering format specified for the
496 level of the SwNodeNum is of an enumeration type.
498 @retval TRUE This text node has a number.
501 BOOL
HasNumber() const;
504 Returns if this text node has a bullet.
506 This text node has a bullet if it has a SwNodeNum and a
507 numbering rule and the numbering format specified for the
508 level of the SwNodeNum is of a bullet type.
510 @retval TRUE This text node has a bullet.
513 BOOL
HasBullet() const;
516 Returns is this text node is numbered.
518 This node is numbered if it has a SwNodeNum and it has a
519 numbering rule and has not a hidden SwNodeNum.
521 ATTENTION: Returns TRUE even if the SwNumFmt has type
524 @retval TRUE This node is numbered.
527 BOOL
IsNumbered() const;
530 Returns if this text node has a marked label.
532 @retval true This text node has a marked label.
535 bool HasMarkedLabel() const;
537 /** Sets the list level of this text node.
539 Side effect, when the text node is a list item:
540 The text node's representation in the list tree (<SwNodeNum> instance)
543 @param nLevel level to set
545 void SetAttrListLevel(int nLevel
);
547 bool HasAttrListLevel() const;
549 int GetAttrListLevel() const;
551 /** Returns the actual list level of this text node, when it is a list item
553 @return the actual list level of this text node, if it is a list item,
556 int GetActualListLevel() const;
559 Returns outline level of this text node.
561 If a text node has an outline number (i.e. it has an SwNodeNum
562 and a outline numbering rule) the outline level is the level of
565 If a text node has no outline number and has a paragraph style
566 attached the outline level is the outline level of the
569 Otherwise the text node has no outline level (NO_NUMBERING).
571 NOTE: The outline level of text nodes is subject to change. The
572 plan is to have an SwTxtNode::nOutlineLevel member that is
573 updated from a paragraph style upon appliance of that paragraph
576 @return outline level or NO_NUMBERING if there is no outline level
578 int GetAttrOutlineLevel() const;//#OutlineLevel,added by zhaojianwei
581 Sets the out line level *at* a text node.
583 @param nLevel the level to be set
585 If the text node has an outline number the level is set at the
588 If the text node has no outline number but has a paragraph
589 style applied the outline level is set at the paragraph style.
591 NOTE: This is subject to change, see GetOutlineLevel.
593 //void SetOutlineLevel(int nLevel);
594 void SetAttrOutlineLevel(int nLevel
);//#OutlineLevel,added by zhaojianwei
596 // --> OD 2008-11-19 #i70748#
597 bool IsEmptyListStyleDueToSetOutlineLevelAttr();
598 void SetEmptyListStyleDueToSetOutlineLevelAttr();
599 void ResetEmptyListStyleDueToResetOutlineLevelAttr();
603 Returns the width of leading tabs/blanks in this paragraph.
604 This space will be converted into numbering indent if the paragraph
605 is set to be numbered.
607 @return the width of the leading whitespace
609 USHORT
GetWidthOfLeadingTabs() const;
613 Returns if the paragraph has a visible numbering or bullet.
614 This includes all kinds of numbering/bullet/outlines.
615 Note: This function returns false, if the numbering format is
616 SVX_NUM_NUMBER_NONE or if the numbering/bullet has been deleted.
618 @return TRUE if the paragraph has a visible numbering/bullet/outline
620 bool HasVisibleNumberingOrBullet() const;
622 // --> OD 2008-02-19 #refactorlists#
623 void SetListId( const String sListId
);
624 String
GetListId() const;
627 /** Determines, if the list level indent attributes can be applied to the
630 OD 2008-01-17 #newlistlevelattrs#
631 The list level indents can be applied to the paragraph under the one
632 of following conditions:
633 - the list style is directly applied to the paragraph and the paragraph
634 has no own indent attributes.
635 - the list style is applied to the paragraph through one of its paragraph
636 styles, the paragraph has no own indent attributes and on the paragraph
637 style hierarchy from the paragraph to the paragraph style with the
638 list style no indent attributes are found.
644 bool AreListLevelIndentsApplicable() const;
646 /** Retrieves the list tab stop position, if the paragraph's list level defines
647 one and this list tab stop has to merged into the tap stops of the paragraph
649 OD 2008-01-17 #newlistlevelattrs#
653 @param nListTabStopPosition
654 output parameter - containing the list tab stop position
656 @return boolean - indicating, if a list tab stop position is provided
658 bool GetListTabStopPosition( long& nListTabStopPosition
) const;
660 /** Retrieves the character following the list label, if the paragraph's
661 list level defines one.
663 OD 2008-01-17 #newlistlevelattrs#
667 @return XubString - the list tab stop position
669 XubString
GetLabelFollowedBy() const;
672 // END OF BULLET/NUMBERING/OUTLINE STUFF:
675 void fillSoftPageBreakList( SwSoftPageBreakList
& rBreak
) const;
677 USHORT
GetLang( const xub_StrLen nBegin
, const xub_StrLen nLen
= 0,
678 USHORT nScript
= 0 ) const;
680 // steht in ndcopy.cxx
681 BOOL
IsSymbol( const xub_StrLen nBegin
) const; // steht in itratr.cxx
682 virtual SwCntntNode
* MakeCopy( SwDoc
*, const SwNodeIndex
& ) const;
684 // interaktive Trennung: wir finden den TxtFrm und rufen sein CalcHyph
685 BOOL
Hyphenate( SwInterHyphInfo
&rHyphInf
);
686 void DelSoftHyph( const xub_StrLen nStart
, const xub_StrLen nEnd
);
688 // --> OD 2007-11-15 #i83479#
689 // add 4th optional parameter <bAddSpaceAfterListLabelStr> indicating,
690 // when <bWithNum = true> that a space is inserted after the string for
692 // add 5th optional parameter <bWithSpacesForLevel> indicating, if additional
693 // spaces are inserted in front of the expanded text string depending on
695 XubString
GetExpandTxt( const xub_StrLen nIdx
= 0,
696 const xub_StrLen nLen
= STRING_LEN
,
697 const bool bWithNum
= false,
698 const bool bAddSpaceAfterListLabelStr
= false,
699 const bool bWithSpacesForLevel
= false ) const;
701 BOOL
GetExpandTxt( SwTxtNode
& rDestNd
, const SwIndex
* pDestIdx
= 0,
702 xub_StrLen nIdx
= 0, xub_StrLen nLen
= STRING_LEN
,
703 BOOL bWithNum
= FALSE
, BOOL bWithFtn
= TRUE
,
704 BOOL bReplaceTabsWithSpaces
= FALSE
) const;
709 const ModelToViewHelper::ConversionMap
*
710 BuildConversionMap( rtl::OUString
& rExpandText
) const;
712 XubString
GetRedlineTxt( xub_StrLen nIdx
= 0,
713 xub_StrLen nLen
= STRING_LEN
,
714 BOOL bExpandFlds
= FALSE
,
715 BOOL bWithNum
= FALSE
) const;
716 //Liefert fuer die Initalfunktion tatsaechliche Anzahl der Initialzeichen
717 //bei nWishLen == 0 die des ersten Wortes
718 USHORT
GetDropLen( USHORT nWishLen
) const;
720 // Passes back info needed on the dropcap dimensions
721 bool GetDropSize(int& rFontHeight
, int& rDropHeight
, int& rDropDescent
) const;
723 // Hidden Paragraph Field:
724 inline bool CalcHiddenParaField()
725 { return m_pSwpHints
? m_pSwpHints
->CalcHiddenParaField() : false; }
726 // set CalcVisible flags
727 inline void SetCalcHiddenParaField()
728 { if (m_pSwpHints
) m_pSwpHints
->SetCalcHiddenParaField(); }
730 // is the paragraph visible?
731 inline bool HasHiddenParaField() const
732 { return m_pSwpHints
? m_pSwpHints
->HasHiddenParaField() : false; }
735 // Hidden Paragraph Field:
737 inline bool HasHiddenCharAttribute( bool bWholePara
) const
739 if ( m_bRecalcHiddenCharFlags
)
740 CalcHiddenCharFlags();
741 return bWholePara
? m_bHiddenCharsHidePara
: m_bContainsHiddenChars
;
744 inline void SetCalcHiddenCharFlags() const
745 { m_bRecalcHiddenCharFlags
= true; }
747 // --> FME 2004-06-08 #i12836# enhanced pdf
749 // Returns if the node is hidden due to
750 // 1. HiddenParaField
751 // 2. HiddenCharAttribute
754 bool IsHidden() const;
757 inline SwTxtAttr
* MakeRedlineTxtAttr( const SfxPoolItem
& rNew
)
758 { return MakeTxtAttr( rNew
, 0, 0, true ); }
760 TYPEINFO(); // fuer rtti
762 // fuers Umhaengen der TxtFmtCollections (Outline-Nummerierung!!)
763 virtual void Modify( SfxPoolItem
*, SfxPoolItem
* );
766 virtual void Update( const SwIndex
& aPos
, USHORT xub_StrLen
,
767 BOOL bNegativ
= FALSE
, BOOL bDelete
= FALSE
);
769 // change text to Upper/Lower/Hiragana/Katagana/...
770 void TransliterateText( utl::TransliterationWrapper
& rTrans
,
771 xub_StrLen nStart
, xub_StrLen nEnd
,
772 SwUndoTransliterate
* pUndo
= 0 );
774 // count words in given range
775 void CountWords( SwDocStat
& rStat
, xub_StrLen nStart
, xub_StrLen nEnd
) const;
777 // Checks some global conditions like loading or destruction of document
778 // to economize notifications
779 bool IsNotificationEnabled() const;
781 // Checks a temporary notification blocker and the global conditons of IsNotificationEnabled()
782 bool IsNotifiable() const;
784 void SetListRestart( bool bRestart
);
785 // --> OD 2005-11-02 #i51089 - TUNING#
786 bool IsListRestart() const;
789 void SetAttrListRestartValue( SwNumberTree::tSwNumTreeNumber nNum
);
790 bool HasAttrListRestartValue() const;
791 SwNumberTree::tSwNumTreeNumber
GetAttrListRestartValue() const;
792 SwNumberTree::tSwNumTreeNumber
GetActualListStartValue() const;
794 void SetCountedInList( bool bCounted
);
795 bool IsCountedInList() const;
797 // --> OD 2008-03-13 #refactorlists#
798 // void SyncNumberAndNumRule();
799 // void UnregisterNumber();
801 void RemoveFromList();
802 bool IsInList() const;
805 bool IsFirstOfNumRule() const;
807 USHORT
GetScalingOfSelectedText( xub_StrLen nStt
, xub_StrLen nEnd
) const;
810 virtual ::sfx2::IXmlIdRegistry
& GetRegistry();
811 virtual bool IsInClipboard() const;
812 virtual bool IsInUndo() const;
813 virtual bool IsInContent() const;
814 virtual ::com::sun::star::uno::Reference
<
815 ::com::sun::star::rdf::XMetadatable
> MakeUnoObject();
817 bool IsCollapse() const;
819 DECL_FIXEDMEMPOOL_NEWDEL(SwTxtNode
)
822 //-----------------------------------------------------------------------------
824 inline SwpHints
& SwTxtNode::GetSwpHints()
826 ASSERT_ID( m_pSwpHints
, ERR_NOHINTS
);
829 inline const SwpHints
&SwTxtNode::GetSwpHints() const
831 ASSERT_ID( m_pSwpHints
, ERR_NOHINTS
);
835 inline SwpHints
& SwTxtNode::GetOrCreateSwpHints()
839 m_pSwpHints
= new SwpHints
;
844 inline void SwTxtNode::TryDeleteSwpHints()
846 if ( m_pSwpHints
&& m_pSwpHints
->CanBeDeleted() )
848 DELETEZ( m_pSwpHints
);
852 inline SwTxtFmtColl
* SwTxtNode::GetTxtColl() const
854 return static_cast<SwTxtFmtColl
*>(const_cast<SwModify
*>(GetRegisteredIn()));
857 // fuer den IBM-Compiler nicht inlinen wg. 42876
859 // Inline Metoden aus Node.hxx - erst hier ist der TxtNode bekannt !!
860 inline SwTxtNode
*SwNode::GetTxtNode()
862 return ND_TEXTNODE
== nNodeType
? static_cast<SwTxtNode
*>(this) : 0;
864 inline const SwTxtNode
*SwNode::GetTxtNode() const
866 return ND_TEXTNODE
== nNodeType
? static_cast<const SwTxtNode
*>(this) : 0;
870 inline void SwTxtNode::Cut(SwTxtNode
*pDest
, const SwIndex
&rDestStart
,
871 const SwIndex
&rStart
, xub_StrLen nLen
)
873 _Cut( pDest
, rDestStart
, rStart
, nLen
, TRUE
);