22#include <com/sun/star/text/XTextContent.hpp>
48 class TransliterationWrapper;
71 class TextNodeNotificationSuppressor;
109 ,
public ::sfx2::Metadatable
164 SAL_DLLPRIVATE
void CopyAttr(
SwTextNode *pDest,
const sal_Int32 nStart,
const sal_Int32 nOldPos);
167 bool bChgFollow =
true );
169 SAL_DLLPRIVATE
void CutImpl(
172 const bool bUpdate =
true );
175 SAL_DLLPRIVATE
void MoveTextAttr_To_AttrSet();
183 {
return m_bRecalcHiddenCharFlags; }
186 m_bHiddenCharsHidePara = bNewHiddenCharsHidePara;
187 m_bContainsHiddenChars = bNewContainsHiddenChars;
188 m_bRecalcHiddenCharFlags =
false;
191 SAL_DLLPRIVATE
void CalcHiddenCharFlags()
const;
193 SAL_DLLPRIVATE
void SetLanguageAndFont(
const SwPaM &rPaM,
195 const vcl::Font *pFont, sal_uInt16 nFontWhichId );
197 inline void TryDeleteSwpHints();
199 SAL_DLLPRIVATE
void impl_FormatToTextAttr(
const SfxItemSet& i_rAttrSet);
203 void DelFrames_TextNodePart();
204 void HandleNonLegacyHint(
const SfxHint&);
207 bool IsWordCountDirty()
const;
209 bool IsWrongDirty()
const;
210 bool IsGrammarCheckDirty()
const;
211 bool IsSmartTagDirty()
const;
212 bool IsAutoCompleteWordDirty()
const;
213 void SetWordCountDirty(
bool bNew )
const;
215 void SetGrammarCheckDirty(
bool bNew )
const;
216 void SetSmartTagDirty(
bool bNew )
const;
217 void SetAutoCompleteWordDirty(
bool bNew )
const;
218 void SetWrong( std::unique_ptr<SwWrongList> pNew );
220 std::unique_ptr<SwWrongList> ReleaseWrong();
223 void SetGrammarCheck( std::unique_ptr<SwGrammarMarkUp> pNew );
224 void ClearGrammarCheck();
225 std::unique_ptr<SwGrammarMarkUp> ReleaseGrammarCheck();
229 void SetSmartTags( std::unique_ptr<SwWrongList> pNew );
230 void ClearSmartTags();
231 std::unique_ptr<SwWrongList> ReleaseSmartTags();
242 const OUString&
GetText()
const {
return m_Text; }
245 inline sal_Int32 GetSpaceLeft()
const;
249 inline const SwpHints &GetSwpHints()
const;
252 bool HasHints()
const {
return m_pSwpHints !=
nullptr; }
253 inline SwpHints &GetOrCreateSwpHints();
257 virtual sal_Int32
Len()
const override;
265 virtual bool ResetAttr( sal_uInt16 nWhich1, sal_uInt16 nWhich2 = 0 )
override;
266 virtual bool ResetAttr(
const std::vector<sal_uInt16>& rWhichArr )
override;
284 void EraseText (
const SwContentIndex &rIdx,
const sal_Int32 nCount = SAL_MAX_INT32,
286 void EraseText (
const SwPosition& rIdx,
const sal_Int32 nCount = SAL_MAX_INT32,
304 const sal_Int32 nContentStart,
305 const sal_Int32 nLen,
306 const sal_uInt16 nWhich = 0,
308 const bool bInclRefToxMark =
false,
309 const bool bExactRange =
false );
316 void ClearSwpHintsArr(
bool bDelFields );
319 void FileLoadedInitHints();
327 const sal_Int32 nStart,
const sal_Int32 nEnd,
333 sal_Int32 nStt, sal_Int32 nEnd,
343 bool GetParaAttr(
SfxItemSet& rSet, sal_Int32 nStt, sal_Int32 nEnd,
344 const bool bOnlyTextAttr =
false,
345 const bool bGetFromChrFormat =
true,
346 const bool bMergeIndentValuesOfNumRule =
false,
353 void DeleteAttributes(
const sal_uInt16 nWhich,
354 const sal_Int32 nStart,
const sal_Int32 nEnd = 0 );
356 void DeleteAttribute (
SwTextAttr *
const pTextAttr );
362 const sal_Int32 nLen,
363 const bool bForceCopyOfAllAttrs );
368 const bool bForceCopyOfAllAttrs =
false );
373 const bool bForceCopyOfAllAttrs =
false );
383 void ReplaceText(
const SwContentIndex& rStart,
const sal_Int32 nDelLen,
384 const OUString & rText );
385 void ReplaceText(
SwPosition& rStart,
const sal_Int32 nDelLen,
386 const OUString & rText );
387 void ReplaceTextOnly( sal_Int32 nPos, sal_Int32 nLen,
388 std::u16string_view aText,
389 const css::uno::Sequence<sal_Int32>& rOffsets );
401 bool DontExpandFormat( sal_Int32 nContentIdx,
bool bFlag =
true,
402 bool bFormatToTextAttributes =
true );
413 sal_Int32
const nIndex,
414 sal_uInt16
const nWhich,
421 std::vector<SwTextAttr *> GetTextAttrsAt(
422 sal_Int32
const nIndex,
423 sal_uInt16
const nWhich )
const;
433 const sal_Int32 nIndex,
442 SwTextAttr* GetTextAttrForEndCharAt(sal_Int32 nIndex, sal_uInt16 nWhich)
const;
445 const sal_Int32 nIndex,
459 void CopyCollFormat(
SwTextNode& rDestNd,
bool bUndoForChgFormatColl =
true);
474 void DoNum(std::function<
void (
SwNodeNum &)>
const&);
485 bool IsOutline()
const;
487 bool IsOutlineStateChanged()
const;
489 void UpdateOutlineState();
510 OUString GetNumString(
const bool _bInclPrefixAndSuffixStrings =
true,
511 const unsigned int _nRestrictToThisLevel =
MAXLEVEL,
522 tools::Long GetLeftMarginWithNum(
bool bTextLeft =
false )
const;
534 bool GetFirstLineOfsWithNum(
short& rFirstOffset )
const;
536 SwTwips GetAdditionalIndentForStartingNewList()
const;
538 void ClearLRSpaceItemDueToListLevelIndents( std::shared_ptr<SvxLRSpaceItem>& o_rLRSpaceItem )
const;
545 tools::Long GetLeftMarginForTabCalculation()
const;
556 bool HasNumber(
SwRootFrame const* pLayout =
nullptr)
const;
567 bool HasBullet()
const;
580 bool IsNumbered(
SwRootFrame const* pLayout =
nullptr)
const;
587 bool HasMarkedLabel()
const;
597 void SetAttrListLevel(
int nLevel);
599 bool HasAttrListLevel()
const;
601 int GetAttrListLevel()
const;
630 int GetAttrOutlineLevel()
const;
645 void SetAttrOutlineLevel(
int nLevel);
652 void GetAttrOutlineContentVisible(
bool& bOutlineContentVisibleAttr);
653 void SetAttrOutlineContentVisible(
bool bVisible);
656 void SetEmptyListStyleDueToSetOutlineLevelAttr();
657 void ResetEmptyListStyleDueToResetOutlineLevelAttr();
666 SwTwips GetWidthOfLeadingTabs()
const;
676 bool HasVisibleNumberingOrBullet()
const;
678 void SetListId(OUString
const& rListId);
679 OUString GetListId()
const;
695 bool AreListLevelIndentsApplicable()
const;
705 bool GetListTabStopPosition(
tools::Long& nListTabStopPosition )
const;
712 OUString GetLabelFollowedBy()
const;
718 LanguageType GetLang(
const sal_Int32 nBegin,
const sal_Int32 nLen = 0,
719 sal_uInt16 nScript = 0 )
const;
722 bool IsSymbolAt(sal_Int32 nBegin)
const;
727 void DelSoftHyph(
const sal_Int32 nStart,
const sal_Int32 nEnd );
735 OUString GetExpandText(
SwRootFrame const* pLayout,
736 const sal_Int32 nIdx = 0,
737 const sal_Int32 nLen = -1,
738 const bool bWithNum =
false,
739 const bool bAddSpaceAfterListLabelStr =
false,
740 const bool bWithSpacesForLevel =
false,
743 sal_Int32 nIdx, sal_Int32 nLen,
745 bool bWithNum =
false,
bool bWithFootnote =
true,
746 bool bReplaceTabsWithSpaces =
false )
const;
748 OUString GetRedlineText()
const;
752 sal_Int32 GetDropLen(sal_Int32 nWishLen)
const;
755 bool GetDropSize(
int& rFontHeight,
int& rDropHeight,
int& rDropDescent)
const;
759 {
return m_pSwpHints && m_pSwpHints->CalcHiddenParaField(); }
762 {
if (m_pSwpHints) m_pSwpHints->SetCalcHiddenParaField(); }
766 {
return m_pSwpHints && m_pSwpHints->IsHiddenByParaField(); }
772 if ( m_bRecalcHiddenCharFlags )
773 CalcHiddenCharFlags();
774 return bWholePara ? m_bHiddenCharsHidePara : m_bContainsHiddenChars;
778 { m_bRecalcHiddenCharFlags =
true; }
791 const sal_Int32 nChangeLen,
792 UpdateMode eMode)
override;
796 sal_Int32 nStart, sal_Int32 nEnd,
800 bool CountWords(
SwDocStat& rStat, sal_Int32 nStart, sal_Int32 nEnd )
const;
804 bool IsNotificationEnabled()
const;
807 bool IsNotifiable()
const;
809 void SetListRestart(
bool bRestart );
810 bool IsListRestart()
const;
813 bool HasAttrListRestartValue()
const;
817 void SetCountedInList(
bool bCounted );
818 bool IsCountedInList()
const;
821 void AddToListRLHidden();
822 void AddToListOrig();
823 void RemoveFromList();
824 void RemoveFromListRLHidden();
825 void RemoveFromListOrig();
826 bool IsInList()
const;
828 bool IsFirstOfNumRule(
SwRootFrame const& rLayout)
const;
831 {
return m_wXParagraph; }
835 virtual ::sfx2::IXmlIdRegistry& GetRegistry()
override;
836 virtual bool IsInClipboard()
const override;
838 virtual bool IsInUndo()
const override;
839 virtual bool IsInContent()
const override;
840 virtual css::uno::Reference< css::rdf::XMetadatable > MakeUnoObject()
override;
842 bool IsCollapse()
const;
846 sal_uInt32 GetRsid( sal_Int32 nStt, sal_Int32 nEnd )
const;
847 sal_uInt32 GetParRsid()
const;
849 bool CompareRsid(
const SwTextNode &rTextNode, sal_Int32 nStt1, sal_Int32 nStt2 )
const;
850 bool CompareParRsid(
const SwTextNode &rTextNode )
const;
856 static bool IsIgnoredCharFormatForNumbering(
const sal_uInt16 nWhich,
bool bIsCharStyle =
false);
860 void SetInSwUndo(
bool bInUndo);
911 CutImpl( pDest, rDestStart, rStart, nLen );
919 return TXTNODE_MAX-
m_Text.getLength();
struct _xmlTextWriter * xmlTextWriterPtr
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()
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.
constexpr OUStringLiteral IsHidden(u"IsHidden")
constexpr sal_uInt16 RES_TXTATR_END(RES_TXTATR_NOEND_END)
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