22#include <com/sun/star/text/XTextContent.hpp>
46 class TransliterationWrapper;
136 SAL_DLLPRIVATE
void CopyAttr(
SwTextNode *pDest,
const sal_Int32 nStart,
const sal_Int32 nOldPos);
139 bool bChgFollow =
true );
141 SAL_DLLPRIVATE
void CutImpl(
143 const SwIndex & rStart, sal_Int32 nLen,
144 const bool bUpdate =
true );
147 SAL_DLLPRIVATE
void MoveTextAttr_To_AttrSet();
155 {
return m_bRecalcHiddenCharFlags; }
158 m_bHiddenCharsHidePara = bNewHiddenCharsHidePara;
159 m_bContainsHiddenChars = bNewContainsHiddenChars;
160 m_bRecalcHiddenCharFlags =
false;
163 SAL_DLLPRIVATE
void CalcHiddenCharFlags()
const;
165 SAL_DLLPRIVATE
void SetLanguageAndFont(
const SwPaM &rPaM,
167 const vcl::Font *pFont, sal_uInt16 nFontWhichId );
171 SAL_DLLPRIVATE
void InitSwParaStatistics(
bool bNew );
173 inline void TryDeleteSwpHints();
175 SAL_DLLPRIVATE
void impl_FormatToTextAttr(
const SfxItemSet& i_rAttrSet);
179 void DelFrames_TextNodePart();
184 bool IsWordCountDirty()
const;
185 WrongState GetWrongDirty()
const;
186 bool IsWrongDirty()
const;
187 bool IsGrammarCheckDirty()
const;
188 bool IsSmartTagDirty()
const;
189 bool IsAutoCompleteWordDirty()
const;
190 void SetWordCountDirty(
bool bNew )
const;
191 void SetWrongDirty(WrongState eNew)
const;
192 void SetGrammarCheckDirty(
bool bNew )
const;
193 void SetSmartTagDirty(
bool bNew )
const;
194 void SetAutoCompleteWordDirty(
bool bNew )
const;
195 void SetWrong( std::unique_ptr<SwWrongList> pNew );
197 std::unique_ptr<SwWrongList> ReleaseWrong();
200 void SetGrammarCheck( std::unique_ptr<SwGrammarMarkUp> pNew );
201 void ClearGrammarCheck();
202 std::unique_ptr<SwGrammarMarkUp> ReleaseGrammarCheck();
206 void SetSmartTags( std::unique_ptr<SwWrongList> pNew );
207 void ClearSmartTags();
208 std::unique_ptr<SwWrongList> ReleaseSmartTags();
223 inline sal_Int32 GetSpaceLeft()
const;
227 inline const SwpHints &GetSwpHints()
const;
230 bool HasHints()
const {
return m_pSwpHints !=
nullptr; }
231 inline SwpHints &GetOrCreateSwpHints();
235 virtual sal_Int32
Len()
const override;
243 virtual bool ResetAttr( sal_uInt16 nWhich1, sal_uInt16 nWhich2 = 0 )
override;
244 virtual bool ResetAttr(
const std::vector<sal_uInt16>& rWhichArr )
override;
259 void EraseText (
const SwIndex &rIdx,
const sal_Int32 nCount = SAL_MAX_INT32,
278 const sal_Int32 nLen,
279 const sal_uInt16 nWhich = 0,
281 const bool bInclRefToxMark =
false,
282 const bool bExactRange =
false );
289 void ClearSwpHintsArr(
bool bDelFields );
292 void FileLoadedInitHints();
300 const sal_Int32 nStart,
const sal_Int32 nEnd,
306 sal_Int32 nStt, sal_Int32 nEnd,
316 bool GetParaAttr(
SfxItemSet& rSet, sal_Int32 nStt, sal_Int32 nEnd,
317 const bool bOnlyTextAttr =
false,
318 const bool bGetFromChrFormat =
true,
319 const bool bMergeIndentValuesOfNumRule =
false,
326 void DeleteAttributes(
const sal_uInt16 nWhich,
327 const sal_Int32 nStart,
const sal_Int32 nEnd = 0 );
329 void DeleteAttribute (
SwTextAttr *
const pTextAttr );
335 const sal_Int32 nLen,
336 const bool bForceCopyOfAllAttrs );
341 const bool bForceCopyOfAllAttrs =
false );
344 const SwIndex & rStart,
const sal_Int32 nLen);
346 const SwIndex & rStart,
const sal_Int32 nLen);
351 void ReplaceText(
const SwIndex& rStart,
const sal_Int32 nDelLen,
352 const OUString & rText );
353 void ReplaceTextOnly( sal_Int32 nPos, sal_Int32 nLen,
354 const OUString& rText,
355 const css::uno::Sequence<sal_Int32>& rOffsets );
367 bool DontExpandFormat(
const SwIndex& rIdx,
bool bFlag =
true,
368 bool bFormatToTextAttributes =
true );
385 sal_Int32
const nIndex,
386 sal_uInt16
const nWhich,
387 enum GetTextAttrMode
const eMode = DEFAULT )
const;
393 std::vector<SwTextAttr *> GetTextAttrsAt(
394 sal_Int32
const nIndex,
395 sal_uInt16
const nWhich )
const;
405 const sal_Int32 nIndex,
414 SwTextAttr* GetTextAttrForEndCharAt(sal_Int32 nIndex, sal_uInt16 nWhich)
const;
417 const sal_Int32 nIndex,
418 const bool bIncludeInputFieldAtStart =
false )
const;
431 void CopyCollFormat(
SwTextNode& rDestNd,
bool bUndoForChgFormatColl =
true);
446 void DoNum(std::function<
void (
SwNodeNum &)>
const&);
457 bool IsOutline()
const;
459 bool IsOutlineStateChanged()
const;
461 void UpdateOutlineState();
482 OUString GetNumString(
const bool _bInclPrefixAndSuffixStrings =
true,
483 const unsigned int _nRestrictToThisLevel =
MAXLEVEL,
494 tools::Long GetLeftMarginWithNum(
bool bTextLeft =
false )
const;
506 bool GetFirstLineOfsWithNum(
short& rFirstOffset )
const;
508 SwTwips GetAdditionalIndentForStartingNewList()
const;
510 void ClearLRSpaceItemDueToListLevelIndents( std::shared_ptr<SvxLRSpaceItem>& o_rLRSpaceItem )
const;
517 tools::Long GetLeftMarginForTabCalculation()
const;
528 bool HasNumber(
SwRootFrame const* pLayout =
nullptr)
const;
539 bool HasBullet()
const;
552 bool IsNumbered(
SwRootFrame const* pLayout =
nullptr)
const;
559 bool HasMarkedLabel()
const;
569 void SetAttrListLevel(
int nLevel);
571 bool HasAttrListLevel()
const;
573 int GetAttrListLevel()
const;
602 int GetAttrOutlineLevel()
const;
617 void SetAttrOutlineLevel(
int nLevel);
624 void GetAttrOutlineContentVisible(
bool& bOutlineContentVisibleAttr);
625 void SetAttrOutlineContentVisible(
bool bVisible);
628 void SetEmptyListStyleDueToSetOutlineLevelAttr();
629 void ResetEmptyListStyleDueToResetOutlineLevelAttr();
638 SwTwips GetWidthOfLeadingTabs()
const;
648 bool HasVisibleNumberingOrBullet()
const;
650 void SetListId(OUString
const& rListId);
651 OUString GetListId()
const;
667 bool AreListLevelIndentsApplicable()
const;
677 bool GetListTabStopPosition(
tools::Long& nListTabStopPosition )
const;
684 OUString GetLabelFollowedBy()
const;
690 LanguageType GetLang(
const sal_Int32 nBegin,
const sal_Int32 nLen = 0,
691 sal_uInt16 nScript = 0 )
const;
694 bool IsSymbolAt(sal_Int32 nBegin)
const;
699 void DelSoftHyph(
const sal_Int32 nStart,
const sal_Int32 nEnd );
707 OUString GetExpandText(
SwRootFrame const* pLayout,
708 const sal_Int32 nIdx = 0,
709 const sal_Int32 nLen = -1,
710 const bool bWithNum =
false,
711 const bool bAddSpaceAfterListLabelStr =
false,
712 const bool bWithSpacesForLevel =
false,
715 sal_Int32 nIdx, sal_Int32 nLen,
717 bool bWithNum =
false,
bool bWithFootnote =
true,
718 bool bReplaceTabsWithSpaces =
false )
const;
720 OUString GetRedlineText()
const;
724 sal_Int32 GetDropLen(sal_Int32 nWishLen)
const;
727 bool GetDropSize(
int& rFontHeight,
int& rDropHeight,
int& rDropDescent)
const;
731 {
return m_pSwpHints && m_pSwpHints->CalcHiddenParaField(); }
734 {
if (m_pSwpHints) m_pSwpHints->SetCalcHiddenParaField(); }
738 {
return m_pSwpHints && m_pSwpHints->IsHiddenByParaField(); }
744 if ( m_bRecalcHiddenCharFlags )
745 CalcHiddenCharFlags();
746 return bWholePara ? m_bHiddenCharsHidePara : m_bContainsHiddenChars;
750 { m_bRecalcHiddenCharFlags =
true; }
763 const sal_Int32 nChangeLen,
764 const bool bNegative =
false,
765 const bool bDelete =
false )
override;
769 sal_Int32 nStart, sal_Int32 nEnd,
773 bool CountWords(
SwDocStat& rStat, sal_Int32 nStart, sal_Int32 nEnd )
const;
777 bool IsNotificationEnabled()
const;
780 bool IsNotifiable()
const;
782 void SetListRestart(
bool bRestart );
783 bool IsListRestart()
const;
786 bool HasAttrListRestartValue()
const;
790 void SetCountedInList(
bool bCounted );
791 bool IsCountedInList()
const;
794 void AddToListRLHidden();
795 void AddToListOrig();
796 void RemoveFromList();
797 void RemoveFromListRLHidden();
798 void RemoveFromListOrig();
799 bool IsInList()
const;
801 bool IsFirstOfNumRule(
SwRootFrame const& rLayout)
const;
803 SAL_DLLPRIVATE css::uno::WeakReference<css::text::XTextContent>
const&
GetXParagraph()
const
804 {
return m_wXParagraph; }
805 SAL_DLLPRIVATE
void SetXParagraph(css::uno::Reference<css::text::XTextContent>
const& xParagraph)
806 { m_wXParagraph = xParagraph; }
809 virtual ::sfx2::IXmlIdRegistry&
GetRegistry()
override;
812 virtual bool IsInUndo()
const override;
814 virtual css::uno::Reference< css::rdf::XMetadatable >
MakeUnoObject()
override;
816 bool IsCollapse()
const;
820 sal_uInt32 GetRsid( sal_Int32 nStt, sal_Int32 nEnd )
const;
821 sal_uInt32 GetParRsid()
const;
823 bool CompareRsid(
const SwTextNode &rTextNode, sal_Int32 nStt1, sal_Int32 nStt2 )
const;
824 bool CompareParRsid(
const SwTextNode &rTextNode )
const;
830 static bool IsIgnoredCharFormatForNumbering(
const sal_uInt16 nWhich,
bool bIsCharStyle =
false);
834 void SetInSwUndo(
bool bInUndo);
883 const SwIndex & rStart,
const sal_Int32 nLen)
885 CutImpl( pDest, rDestStart, rStart, nLen );
893 return TXTNODE_MAX-
m_Text.getLength();
struct _xmlTextWriter * xmlTextWriterPtr
const SwModify * GetRegisteredIn() const
SwContentFrame is the layout for content nodes: a common base class for text (paragraph) and non-text...
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 &, const SwNodeIndex &, 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.
virtual void Update(SwIndex const &rPos, const sal_Int32 nChangeLen, const bool bNegative=false, const bool bDelete=false)
Marks a character position inside a document model node.
Marks a node in the document model.
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.
bool IsEmptyListStyleDueToSetOutlineLevelAttr() const
void SetHiddenCharAttribute(bool bNewHiddenCharsHidePara, bool bNewContainsHiddenChars) const
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 SwIndex &rStart, const sal_Int32 nLen)
SAL_DLLPRIVATE css::uno::WeakReference< css::text::XTextContent > const & GetXParagraph() const
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.
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?
css::uno::WeakReference< css::text::XTextContent > m_wXParagraph
SAL_DLLPRIVATE void CutImpl(SwTextNode *const pDest, const SwIndex &rDestStart, const SwIndex &rStart, sal_Int32 nLen, const bool bUpdate=true)
drawinglayer::attribute::SdrAllFillAttributesHelperPtr maFillAttributes
void SetCalcHiddenParaField()
set CalcVisible flags
SAL_DLLPRIVATE void SetXParagraph(css::uno::Reference< css::text::XTextContent > const &xParagraph)
bool mbEmptyListStyleSetDueToSetOutlineLevelAttr
const SwpHints * GetpSwpHints() const
SwParaIdleData_Impl * m_pParaIdleData_Impl
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:
@ EXPAND
DEFAULT: (Start <= nIndex < End)
@ PARENT
EXPAND : (Start < nIndex <= End)
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
o3tl::sorted_vector< sal_Int32 > SwSoftPageBreakList
static LanguageType nLang
Marks a position in the document model.
constexpr sal_uInt8 MAXLEVEL