22#include <com/sun/star/text/XTextContent.hpp>
49 class TransliterationWrapper;
72 class TextNodeNotificationSuppressor;
110 ,
public ::sfx2::Metadatable
165 SAL_DLLPRIVATE
void CopyAttr(
SwTextNode *pDest,
const sal_Int32 nStart,
const sal_Int32 nOldPos);
168 bool bChgFollow =
true );
170 SAL_DLLPRIVATE
void CutImpl(
173 const bool bUpdate =
true );
176 SAL_DLLPRIVATE
void MoveTextAttr_To_AttrSet();
184 {
return m_bRecalcHiddenCharFlags; }
187 m_bHiddenCharsHidePara = bNewHiddenCharsHidePara;
188 m_bContainsHiddenChars = bNewContainsHiddenChars;
189 m_bRecalcHiddenCharFlags =
false;
192 SAL_DLLPRIVATE
void CalcHiddenCharFlags()
const;
194 SAL_DLLPRIVATE
void SetLanguageAndFont(
const SwPaM &rPaM,
196 const vcl::Font *pFont, sal_uInt16 nFontWhichId );
198 inline void TryDeleteSwpHints();
200 SAL_DLLPRIVATE
void impl_FormatToTextAttr(
const SfxItemSet& i_rAttrSet);
204 void DelFrames_TextNodePart();
205 void HandleNonLegacyHint(
const SfxHint&);
208 bool IsWordCountDirty()
const;
210 bool IsWrongDirty()
const;
211 bool IsGrammarCheckDirty()
const;
212 bool IsSmartTagDirty()
const;
213 bool IsAutoCompleteWordDirty()
const;
214 void SetWordCountDirty(
bool bNew )
const;
216 void SetGrammarCheckDirty(
bool bNew )
const;
217 void SetSmartTagDirty(
bool bNew )
const;
218 void SetAutoCompleteWordDirty(
bool bNew )
const;
219 void SetWrong( std::unique_ptr<SwWrongList> pNew );
221 std::unique_ptr<SwWrongList> ReleaseWrong();
224 void SetGrammarCheck( std::unique_ptr<SwGrammarMarkUp> pNew );
225 void ClearGrammarCheck();
226 std::unique_ptr<SwGrammarMarkUp> ReleaseGrammarCheck();
230 void SetSmartTags( std::unique_ptr<SwWrongList> pNew );
231 void ClearSmartTags();
232 std::unique_ptr<SwWrongList> ReleaseSmartTags();
240 void UpdateDocPos(
const SwTwips nDocPos,
const sal_uInt32 nIndex);
244 const OUString&
GetText()
const {
return m_Text; }
247 inline sal_Int32 GetSpaceLeft()
const;
251 inline const SwpHints &GetSwpHints()
const;
254 bool HasHints()
const {
return m_pSwpHints !=
nullptr; }
255 inline SwpHints &GetOrCreateSwpHints();
259 virtual sal_Int32
Len()
const override;
267 virtual bool ResetAttr( sal_uInt16 nWhich1, sal_uInt16 nWhich2 = 0 )
override;
268 virtual bool ResetAttr(
const std::vector<sal_uInt16>& rWhichArr )
override;
288 void EraseText (
const SwContentIndex &rIdx,
const sal_Int32 nCount = SAL_MAX_INT32,
290 void EraseText (
const SwPosition& rIdx,
const sal_Int32 nCount = SAL_MAX_INT32,
308 const sal_Int32 nContentStart,
309 const sal_Int32 nLen,
310 const sal_uInt16 nWhich = 0,
312 const bool bInclRefToxMark =
false,
313 const bool bExactRange =
false );
320 void ClearSwpHintsArr(
bool bDelFields );
323 void FileLoadedInitHints();
331 const sal_Int32 nStart,
const sal_Int32 nEnd,
337 sal_Int32 nStt, sal_Int32 nEnd,
347 bool GetParaAttr(
SfxItemSet& rSet, sal_Int32 nStt, sal_Int32 nEnd,
348 const bool bOnlyTextAttr =
false,
349 const bool bGetFromChrFormat =
true,
350 const bool bMergeIndentValuesOfNumRule =
false,
357 void DeleteAttributes(
const sal_uInt16 nWhich,
358 const sal_Int32 nStart,
const sal_Int32 nEnd = 0 );
360 void DeleteAttribute (
SwTextAttr *
const pTextAttr );
366 const sal_Int32 nLen,
367 const bool bForceCopyOfAllAttrs );
372 const bool bForceCopyOfAllAttrs =
false );
377 const bool bForceCopyOfAllAttrs =
false );
387 void ReplaceText(
const SwContentIndex& rStart,
const sal_Int32 nDelLen,
388 const OUString & rText );
389 void ReplaceText(
SwPosition& rStart,
const sal_Int32 nDelLen,
390 const OUString & rText );
391 void ReplaceTextOnly( sal_Int32 nPos, sal_Int32 nLen,
392 std::u16string_view aText,
393 const css::uno::Sequence<sal_Int32>& rOffsets );
405 bool DontExpandFormat( sal_Int32 nContentIdx,
bool bFlag =
true,
406 bool bFormatToTextAttributes =
true );
417 sal_Int32
const nIndex,
418 sal_uInt16
const nWhich,
425 std::vector<SwTextAttr *> GetTextAttrsAt(
426 sal_Int32
const nIndex,
427 sal_uInt16
const nWhich )
const;
437 const sal_Int32 nIndex,
446 SwTextAttr* GetTextAttrForEndCharAt(sal_Int32 nIndex, sal_uInt16 nWhich)
const;
449 const sal_Int32 nIndex,
463 void CopyCollFormat(
SwTextNode& rDestNd,
bool bUndoForChgFormatColl =
true);
478 void DoNum(std::function<
void (
SwNodeNum &)>
const&);
489 bool IsOutline()
const;
491 bool IsOutlineStateChanged()
const;
493 void UpdateOutlineState();
514 OUString GetNumString(
const bool _bInclPrefixAndSuffixStrings =
true,
515 const unsigned int _nRestrictToThisLevel =
MAXLEVEL,
527 tools::Long GetLeftMarginWithNum(
bool bTextLeft =
false )
const;
539 bool GetFirstLineOfsWithNum(
short& rFirstOffset )
const;
541 SwTwips GetAdditionalIndentForStartingNewList()
const;
548 tools::Long GetLeftMarginForTabCalculation()
const;
559 bool HasNumber(
SwRootFrame const* pLayout =
nullptr)
const;
570 bool HasBullet()
const;
583 bool IsNumbered(
SwRootFrame const* pLayout =
nullptr)
const;
590 bool HasMarkedLabel()
const;
600 void SetAttrListLevel(
int nLevel);
602 bool HasAttrListLevel()
const;
604 int GetAttrListLevel()
const;
633 int GetAttrOutlineLevel()
const;
648 void SetAttrOutlineLevel(
int nLevel);
655 void GetAttrOutlineContentVisible(
bool& bOutlineContentVisibleAttr);
656 void SetAttrOutlineContentVisible(
bool bVisible);
659 void SetEmptyListStyleDueToSetOutlineLevelAttr();
660 void ResetEmptyListStyleDueToResetOutlineLevelAttr();
669 SwTwips GetWidthOfLeadingTabs()
const;
679 bool HasVisibleNumberingOrBullet()
const;
681 void SetListId(OUString
const& rListId);
682 OUString GetListId()
const;
699 bool AreListLevelIndentsApplicableImpl(sal_uInt16 nWhich)
const;
709 bool GetListTabStopPosition(
tools::Long& nListTabStopPosition )
const;
716 OUString GetLabelFollowedBy()
const;
722 LanguageType GetLang(
const sal_Int32 nBegin,
const sal_Int32 nLen = 0,
723 sal_uInt16 nScript = 0 )
const;
726 bool IsSymbolAt(sal_Int32 nBegin)
const;
731 void DelSoftHyph(
const sal_Int32 nStart,
const sal_Int32 nEnd );
739 OUString GetExpandText(
SwRootFrame const* pLayout,
740 const sal_Int32 nIdx = 0,
741 const sal_Int32 nLen = -1,
742 const bool bWithNum =
false,
743 const bool bAddSpaceAfterListLabelStr =
false,
744 const bool bWithSpacesForLevel =
false,
747 sal_Int32 nIdx, sal_Int32 nLen,
749 bool bWithNum =
false,
bool bWithFootnote =
true,
750 bool bReplaceTabsWithSpaces =
false )
const;
752 OUString GetRedlineText()
const;
756 sal_Int32 GetDropLen(sal_Int32 nWishLen)
const;
759 bool GetDropSize(
int& rFontHeight,
int& rDropHeight,
int& rDropDescent)
const;
763 {
return m_pSwpHints && m_pSwpHints->CalcHiddenParaField(); }
766 {
if (m_pSwpHints) m_pSwpHints->SetCalcHiddenParaField(); }
770 {
return m_pSwpHints && m_pSwpHints->IsHiddenByParaField(); }
776 if ( m_bRecalcHiddenCharFlags )
777 CalcHiddenCharFlags();
778 return bWholePara ? m_bHiddenCharsHidePara : m_bContainsHiddenChars;
782 { m_bRecalcHiddenCharFlags =
true; }
795 const sal_Int32 nChangeLen,
796 UpdateMode eMode)
override;
800 sal_Int32 nStart, sal_Int32 nEnd,
804 bool CountWords(
SwDocStat& rStat, sal_Int32 nStart, sal_Int32 nEnd )
const;
808 bool IsNotificationEnabled()
const;
811 bool IsNotifiable()
const;
813 void SetListRestart(
bool bRestart );
814 bool IsListRestart()
const;
817 bool HasAttrListRestartValue()
const;
821 void SetCountedInList(
bool bCounted );
822 bool IsCountedInList()
const;
825 void AddToListRLHidden();
826 void AddToListOrig();
827 void RemoveFromList();
828 void RemoveFromListRLHidden();
829 void RemoveFromListOrig();
830 bool IsInList()
const;
832 bool IsFirstOfNumRule(
SwRootFrame const& rLayout)
const;
835 {
return m_wXParagraph; }
839 virtual ::sfx2::IXmlIdRegistry& GetRegistry()
override;
840 virtual bool IsInClipboard()
const override;
842 virtual bool IsInUndo()
const override;
843 virtual bool IsInContent()
const override;
844 virtual css::uno::Reference< css::rdf::XMetadatable > MakeUnoObject()
override;
846 bool IsCollapse()
const;
850 sal_uInt32 GetRsid( sal_Int32 nStt, sal_Int32 nEnd )
const;
851 sal_uInt32 GetParRsid()
const;
853 bool CompareRsid(
const SwTextNode &rTextNode, sal_Int32 nStt1, sal_Int32 nStt2 )
const;
854 bool CompareParRsid(
const SwTextNode &rTextNode )
const;
860 static bool IsIgnoredCharFormatForNumbering(
const sal_uInt16 nWhich,
bool bIsCharStyle =
false);
864 void SetInSwUndo(
bool bInUndo);
915 CutImpl( pDest, rDestStart, rStart, nLen );
923 return TXTNODE_MAX-
m_Text.getLength();
SwContentFrame is the layout for content nodes: a common base class for text (paragraph) and non-text...
Marks a character position inside a document model content node (SwContentNode)
virtual void SwClientNotify(const SwModify &, const SfxHint &rHint) override
virtual drawinglayer::attribute::SdrAllFillAttributesHelperPtr getSdrAllFillAttributesHelper() const
virtual SwContentFrame * MakeFrame(SwFrame *pSib)=0
MakeFrame will be called for a certain layout pSib is another SwFrame of the same layout (e....
const SfxPoolItem & GetAttr(sal_uInt16 nWhich, bool bInParent=true) const
SS for PoolItems: hard attributation.
virtual SwContentNode * JoinNext()
virtual bool SetAttr(const SfxPoolItem &)
made virtual
virtual sal_Int32 Len() const
virtual SwContentNode * MakeCopy(SwDoc &, SwNode &rWhere, bool bNewFrames) const =0
virtual SwFormatColl * ChgFormatColl(SwFormatColl *)
virtual bool ResetAttr(sal_uInt16 nWhich1, sal_uInt16 nWhich2=0)
virtual sal_uInt16 ResetAllAttr()
virtual void NewAttrSet(SwAttrPool &)=0
Make respective nodes create the specific AttrSets.
Base class of all fields.
Base class of the Writer layout elements.
Base class of the Writer document model elements.
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
virtual void dumpAsXml(xmlTextWriterPtr pWriter) const
Dumps the node structure to the given destination (file nodes.xml in the current directory by default...
PaM is Point and Mark: a selection of the document model.
The root element of a Writer document layout.
A wrapper around SfxPoolItem to store the start position of (usually) a text portion,...
Represents the style of a paragraph.
Represents the visualization of a paragraph.
SwTextNode is a paragraph in the document model.
SAL_DLLPRIVATE unotools::WeakReference< SwXParagraph > const & GetXParagraph() const
bool IsEmptyListStyleDueToSetOutlineLevelAttr() const
void SetHiddenCharAttribute(bool bNewHiddenCharsHidePara, bool bNewContainsHiddenChars) const
sw::ParagraphIdleData m_aParagraphIdleData
sal_Int32 GetSpaceLeft() const
bool IsCalcHiddenCharFlags() const
Optimization: Asking for information about hidden characters at SwScriptInfo updates these flags.
bool CalcHiddenParaField()
Hidden Paragraph Field:
bool m_bRecalcHiddenCharFlags
The last two flags have to be recalculated if this flag is set:
SwpHints & GetOrCreateSwpHints()
void CutText(SwTextNode *const pDest, const SwContentIndex &rStart, const sal_Int32 nLen)
std::unique_ptr< SwNodeNum > mpNodeNum
Numbering for this paragraph.
bool IsHiddenByParaField() const
is the paragraph visible?
std::optional< OUString > m_oNumStringCache
std::unique_ptr< SwpHints > m_pSwpHints
May be 0.
void FormatDropNotify(const SwFormatDrop &rDrop) override
bool m_bContainsHiddenChars
Some of the chars this para are hidden.
unotools::WeakReference< SwXParagraph > m_wXParagraph
void SetCalcHiddenCharFlags() const
SwpHints & GetSwpHints()
getters for SwpHints
bool m_bHiddenCharsHidePara
The whole paragraph is hidden because of the hidden text attribute.
bool m_bInUndo
Is an undo operation in progress?
drawinglayer::attribute::SdrAllFillAttributesHelperPtr maFillAttributes
void SetCalcHiddenParaField()
set CalcVisible flags
bool mbEmptyListStyleSetDueToSetOutlineLevelAttr
const SwpHints * GetpSwpHints() const
SAL_DLLPRIVATE void CutImpl(SwTextNode *const pDest, const SwContentIndex &rDestStart, const SwContentIndex &rStart, sal_Int32 nLen, const bool bUpdate=true)
SwpHints * GetpSwpHints()
void InsertDummy()
Add a dummy character to the redline of the table changes.
const OUString & GetText() const
bool mbInSetOrResetAttr
boolean, indicating that a <SetAttr(..)> or <ResetAttr(..)> or <ResetAllAttr(..)> method is running.
bool HasHiddenCharAttribute(bool bWholePara) const
Hidden Paragraph Field:
std::unique_ptr< SwNodeNum > mpNodeNumOrig
Numbering for this paragraph (before changes)
SwTextFormatColl * GetTextColl() const
std::unique_ptr< SwNodeNum > mpNodeNumRLHidden
Numbering for this paragraph (hidden redlines)
An SwTextAttr container, stores all directly formatted text portions for a text node.
struct _xmlTextWriter * xmlTextWriterPtr
constexpr OUStringLiteral IsHidden(u"IsHidden")
constexpr sal_uInt16 RES_TXTATR_END(RES_TXTATR_NOEND_END)
#define CH_TXT_TRACKED_DUMMY_CHAR
ExpandMode
Some helpers for converting model strings to view strings.
tools::Long tSwNumTreeNumber
std::vector< tSwNumTreeNumber > tNumberVector
SwNumRule * GetNumRule(SwTextFormatColl &rTextFormatColl)
determines the list style, which directly set at the given paragraph style
std::shared_ptr< SdrAllFillAttributesHelper > SdrAllFillAttributesHelperPtr
Dialog to specify the properties of date form field.
@ Expand
DEFAULT: (Start <= nIndex < End)
o3tl::sorted_vector< sal_Int32 > SwSoftPageBreakList
static LanguageType nLang
Marks a position in the document model.
sal_uLong nNumberOfAsianWords
WrongState eWrongDirty
online spell checking needed/done?
sal_uLong nNumberOfCharsExcludingSpaces
std::unique_ptr< SwWrongList > pWrong
std::unique_ptr< SwWrongList > pSmartTags
std::unique_ptr< SwGrammarMarkUp > pGrammarCheck
bool bAutoComplDirty
auto complete list dirty
constexpr sal_uInt8 MAXLEVEL