class SfxHint; class SwNumRule; class SwNodeNum; class SvxFirstLineIndentItem; class SvxTextLeftMarginItem; struct SvxFontUnitMetrics; class SwXParagraph; class SwMarkName;
namespace utl { class TransliterationWrapper;
} namespace vcl
{ class Font;
}
class SwContentFrame; class SwTextField; class SwTextInputField; class SfxItemSet; class SwUndoTransliterate; struct SwSpellArgs; struct SwConversionArgs; class SwInterHyphInfo; class SwWrongList; class SwGrammarMarkUp; struct SwDocStat; enumclass ExpandMode; enumclass SwFieldIds : sal_uInt16; class SwField; class SwFormatChangeHint;
namespace sw { class TextNodeNotificationSuppressor; class RemoveUnoObjectHint; class AttrSetChangeHint; class UpdateAttrHint; namespace mark { enumclass RestoreMode; }
}
namespace com::sun::star { namespace uno { template < class > class Sequence;
}
}
/// SwTextNode is a paragraph in the document model. class SW_DLLPUBLIC SwTextNode final
: public SwContentNode
, public ::sfx2::Metadatable
, public sw::FormatDropDefiner
{ friendclass SwContentNode; /// For creating the first TextNode. friendclass SwDoc; ///< CTOR and AppendTextNode() friendclass SwNodes; friendclass SwTextFrame; friendclass SwScriptInfo; friendclass sw::TextNodeNotificationSuppressor;
/** May be 0. It is only then not 0 if it contains hard attributes.
Therefore: never access directly! */
std::unique_ptr<SwpHints> m_pSwpHints;
mutable std::unique_ptr<SwNodeNum> mpNodeNum; ///< Numbering for this paragraph. mutable std::unique_ptr<SwNodeNum> mpNodeNumRLHidden; ///< Numbering for this paragraph (hidden redlines) mutable std::unique_ptr<SwNodeNum> mpNodeNumOrig; ///< Numbering for this paragraph (before changes)
/** Some of the chars this para are hidden. Paragraph has to be reformatted
on changing the view to print preview. */ mutablebool m_bContainsHiddenChars : 1; /// The whole paragraph is hidden because of the hidden text attribute mutablebool m_bHiddenCharsHidePara : 1; /// The last two flags have to be recalculated if this flag is set: mutablebool m_bRecalcHiddenCharFlags : 1;
/** boolean, indicating that a <SetAttr(..)> or <ResetAttr(..)> or <ResetAllAttr(..)>methodisrunning.
Needed to avoid duplicate handling of attribute change actions. */ bool mbInSetOrResetAttr;
/// Is an undo operation in progress? bool m_bInUndo;
/// insert text content /// @param rStr text to insert; in case it does not fit into the capacity /// of the node, the longest prefix that fits is inserted /// @return the prefix of rStr that was actually inserted
OUString InsertText( const OUString & rStr, const SwContentIndex & rIdx, const SwInsertFlags nMode
= SwInsertFlags::DEFAULT );
OUString InsertText( const OUString & rStr, const SwPosition & rIdx, const SwInsertFlags nMode
= SwInsertFlags::DEFAULT ); /// Add a dummy character to the redline of the table changes void InsertDummy() { m_Text = OUStringChar(CH_TXT_TRACKED_DUMMY_CHAR); }
// Delete text attribute (needs to be deregistered at Pool!) void DestroyAttr( SwTextAttr* pAttr );
// delete all attributes from SwpHintsArray. void ClearSwpHintsArr( bool bDelFields );
/// initialize the hints after file loading (which takes shortcuts) void FileLoadedInitHints();
/// Insert pAttr into hints array. @return true iff inserted successfully bool InsertHint( SwTextAttr * const pAttr, const SetAttrMode nMode = SetAttrMode::DEFAULT ); /// create new text attribute from rAttr and insert it /// @return inserted hint; 0 if not sure the hint is inserted
SwTextAttr* InsertItem( SfxPoolItem& rAttr, const sal_Int32 nStart, const sal_Int32 nEnd, const SetAttrMode nMode = SetAttrMode::DEFAULT );
/** Set these attributes at TextNode. If the whole range is comprised
set them only in AutoAttrSet (SwContentNode::SetAttr). */ bool SetAttr( const SfxItemSet& rSet,
sal_Int32 nStt, sal_Int32 nEnd, const SetAttrMode nMode = SetAttrMode::DEFAULT,
SwTextAttr **ppNewTextAttr = nullptr); /** Query the attributes of textnode over the range. Introduce4thoptionalparameter<bMergeIndentValuesOfNumRule>. If<bMergeIndentValuesOfNumRule>==true,theindentattributesof thecorrespondinglistlevelofanappliedliststyleismergedinto therequesteditemsetasaLR-SPACEitem,if<bOnlyTextAttr>==false, correspondingnodehasnotitsownindentattributesandthe
position-and-space mode of the list level is SvxNumberFormat::LABEL_ALIGNMENT. */ bool GetParaAttr( SfxItemSet& rSet, sal_Int32 nStt, sal_Int32 nEnd, constbool bOnlyTextAttr = false, constbool bGetFromChrFormat = true, constbool bMergeIndentValuesOfNumRule = false,
SwRootFrame const* pLayout = nullptr) const;
/// Convey attributes of an AttrSet (AutoFormat) to SwpHintsArray. void FormatToTextAttr( SwTextNode* pNd );
/// delete all attributes of type nWhich at nStart (opt. end nEnd) void DeleteAttributes( const sal_uInt16 nWhich, const sal_Int32 nStart, const sal_Int32 nEnd = 0 ); /// delete the attribute pTextAttr void DeleteAttribute ( SwTextAttr * const pTextAttr );
/** Actions on text and attributes.
introduce optional parameter to control, if all attributes have to be copied. */ void CopyText( SwTextNode * const pDest, const SwContentIndex &rStart, const sal_Int32 nLen, constbool bForceCopyOfAllAttrs ); void CopyText( SwTextNode * const pDest, const SwContentIndex &rDestStart, const SwContentIndex &rStart,
sal_Int32 nLen, constbool bForceCopyOfAllAttrs = false ); void CopyText( SwTextNode * const pDest, const SwContentIndex &rDestStart, const SwPosition &rStart,
sal_Int32 nLen, constbool bForceCopyOfAllAttrs = false ); /* Aftercopyingatextportionwithitscomments,thereplieswillstillreferencetotheiroriginalparent. Weneedtosettheirreferencetotheircopied-parent. idMapForCommentsandnameMapForCommentsvariablesholdtheoriginalidsofcommentsaskeys. Andtheyholdthenewidsandnamesofcommentsasvalues. Sowecanfindareply's(childcomment)newparent(value)bylookingupitsoriginalparent(key).
*/ staticvoid EstablishParentChildRelationsOfComments(const SwTextNode* pDest,
std::map<sal_Int32, sal_Int32>& idMapForComments,
std::map<sal_Int32, SwMarkName>& nameMapForComments);
/// replace nDelLen characters at rStart with rText /// in case the replacement does not fit, it is partially inserted up to /// the capacity of the node void ReplaceText( const SwContentIndex& rStart, const sal_Int32 nDelLen, const OUString & rText ); void ReplaceText( const SwPosition& rStart, const sal_Int32 nDelLen, const OUString & rText ); void ReplaceTextOnly( sal_Int32 nPos, sal_Int32 nLen,
std::u16string_view aText, const css::uno::Sequence<sal_Int32>& rOffsets );
/// When appropriate set DontExpand-flag at INet or character styles respectively. bool DontExpandFormat( sal_Int32 nContentIdx, bool bFlag = true, bool bFormatToTextAttributes = true );
/** get the innermost text attribute covering position nIndex. @paramnWhichonlyattributewiththisidisreturned. @parameModethepredicateformatching(@seeGetTextAttrMode).
/** get the innermost text attributes covering position nIndex. @paramnWhichonlyattributeswiththisidarereturned. @parameModethepredicateformatching(@seeGetTextAttrMode).
*/
std::vector<SwTextAttr *> GetTextAttrsAt(
sal_Int32 const nIndex,
sal_uInt16 const nWhich ) const;
/** get the text attribute at position nIndex which owns thedummycharacterCH_TXTATR_*atthatposition,ifoneexists. @paramnIndexthepositioninthetext @paramnWhichifdifferentfromRES_TXTATR_END,returnonly attributewithgivenwhichid @returnthetextattributeatnIndexoftypenWhich,ifitexists
*/
SwTextAttr *GetTextAttrForCharAt( const sal_Int32 nIndex, const sal_uInt16 nWhich = RES_TXTATR_END ) const;
/** Copy collection with all auto formats to dest-node. Thelattermightbeinanotherdocument!
(Method in ndcopy.cxx!!). */ void CopyCollFormat(SwTextNode& rDestNd, bool bUndoForChgFormatColl = true);
/** @return actual count of initial chars for initial-function.
If nWishLen == 0 that of first word. */
sal_Int32 GetDropLen(sal_Int32 nWishLen) const;
/// Passes back info needed on the dropcap dimensions bool GetDropSize(int& rFontHeight, int& rDropHeight, int& rDropDescent) const;
// Access to DrawingLayer FillAttributes in a preprocessed form for primitive usage virtual drawinglayer::attribute::SdrAllFillAttributesHelperPtr getSdrAllFillAttributesHelper() const override;
/// In MS Word, the font underline setting of the paragraph end position won't affect the formatting of numbering, so we ignore it staticbool IsIgnoredCharFormatForNumbering(const sal_uInt16 nWhich, bool bIsCharStyle = false); void FormatDropNotify(const SwFormatDrop& rDrop) override
{ TriggerNodeUpdate(sw::LegacyModifyHint(&rDrop, &rDrop)); };
inline sal_Int32 SwTextNode::GetSpaceLeft() const
{ // do not fill the String up to the max - need to be able to have a // SwPosition "behind" the last character, i.e., at index TXTNODE_MAX + 1 const sal_Int32 TXTNODE_MAX = SAL_MAX_INT32 - 2; return TXTNODE_MAX-m_Text.getLength();
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.