50 sal_Int32 m_nCurrentSwPos;
52 sal_Int32 SearchNext( sal_Int32 nStartPos );
57 void NextPos() { m_nCurrentSwPos = SearchNext(m_nCurrentSwPos + 1); }
59 sal_Int32 WhereNext()
const {
return m_nCurrentSwPos; }
61 bool OutAttr( sal_Int32 nSwPos );
71 m_nCurrentSwPos = SearchNext(nStt + 1);
74 sal_Int32 SwASC_AttrIter::SearchNext( sal_Int32 nStartPos )
77 const SwpHints* pTextAttrs = m_rNd.GetpSwpHints();
82 for (
size_t i = 0;
i < pTextAttrs->
Count(); ++
i )
89 if( nPos >= nStartPos && nPos <= nMinPos )
92 if( ( ++nPos ) >= nStartPos && nPos < nMinPos )
97 const sal_Int32 nHintStart = pHt->
GetStart();
98 if ( nHintStart >= nStartPos && nHintStart <= nMinPos )
100 nMinPos = nHintStart;
104 if ( nHintEnd >= nStartPos && nHintEnd < nMinPos )
114 bool SwASC_AttrIter::OutAttr( sal_Int32 nSwPos )
117 const SwpHints* pTextAttrs = m_rNd.GetpSwpHints();
120 for(
size_t i = 0;
i < pTextAttrs->
Count(); ++
i )
129 switch( pHt->
Which() )
135 ->GetFormatField().GetField()->ExpandField(
true,
nullptr);
144 sOut = m_rWrt.m_pDoc->GetEndNoteInfo().m_aFormat.GetNumStr(
147 sOut = m_rWrt.m_pDoc->GetFootnoteInfo().m_aFormat.GetNumStr(
158 if( !sOut.isEmpty() )
159 m_rWrt.Strm().WriteUnicodeOrByteText(sOut);
161 else if( nSwPos < pHt->GetStart() )
170 class SwASC_RedlineIter
180 , m_rIDRA(rNode.GetDoc().getIDocumentRedlineAccess())
181 , m_nextRedline(rWriter.m_bHideDeleteRedlines
187 bool CheckNodeDeleted()
195 && m_rNode.
GetIndex() < pRedline->End()->nNode.GetIndex();
198 std::pair<sal_Int32, sal_Int32> GetNextRedlineSkip()
205 if (pRedline->GetType() != RedlineType::Delete)
209 SwPosition const*
const pStart(pRedline->Start());
211 if (m_rNode.
GetIndex() < pStart->nNode.GetIndex())
218 nRedlineStart = pStart->nNode.GetIndex() == m_rNode.
GetIndex()
219 ? pStart->nContent.GetIndex()
224 if (pStart->nContent.GetIndex() != nRedlineEnd)
226 assert(nRedlineEnd < pStart->nContent.GetIndex());
230 nRedlineEnd = pEnd->nNode.GetIndex() == m_rNode.
GetIndex()
231 ? pEnd->nContent.GetIndex()
234 return std::make_pair(nRedlineStart, nRedlineEnd);
246 sal_Int32 nStrPos = rWrt.
m_pCurrentPam->GetPoint()->nContent.GetIndex();
247 const sal_Int32 nNodeEnd = rNd.
Len();
248 sal_Int32 nEnd = nNodeEnd;
255 SwASC_AttrIter aAttrIter( static_cast<SwASCWriter&>(rWrt), rNd, nStrPos );
256 SwASC_RedlineIter redlineIter(static_cast<SwASCWriter&>(rWrt), rNd);
258 if (redlineIter.CheckNodeDeleted())
270 if (!bIsOutlineNumRule)
278 if (numString.isEmpty() && !bIsOutlineNumRule)
288 if (!level.isEmpty() || !numString.isEmpty())
299 std::pair<sal_Int32, sal_Int32> curRedline(redlineIter.GetNextRedlineSkip());
301 const sal_Int32 nNextAttr =
std::min(aAttrIter.WhereNext(), nEnd);
303 bool isOutAttr(
false);
304 if (nStrPos < curRedline.first || curRedline.second <= nStrPos)
306 isOutAttr = aAttrIter.OutAttr(nStrPos);
314 if (nNextAttr <= curRedline.first)
316 buf.append(
aStr.subView(nStrPos, nNextAttr - nStrPos));
319 else if (nStrPos < curRedline.second)
321 if (nStrPos < curRedline.first)
323 buf.append(
aStr.subView(nStrPos, curRedline.first - nStrPos));
325 if (curRedline.second <= nNextAttr)
327 nStrPos = curRedline.second;
328 curRedline = redlineIter.GetNextRedlineSkip();
338 curRedline = redlineIter.GetNextRedlineSkip();
341 OUString aOutStr(buf.makeStringAndClear());
342 if ( !bExportSoftHyphens )
371 && !nStrPos && nEnd == nNodeEnd ) )
SwNodeOffset min(const SwNodeOffset &a, const SwNodeOffset &b)
rtl_TextEncoding GetCharSet() const
bool HasBullet() const
Returns if this text node has a bullet.
Marks a position in the document model.
const OUString & GetText() const
virtual sal_Int32 Len() const override
FnNodeOut SwNodeFnTab[RES_NODE_END-RES_NODE_BEGIN]
bool HasDummyChar() const
#define CH_TXT_ATR_FORMELEMENT
int GetActualListLevel() const
Returns the actual list level of this text node, when it is a list item.
#define CH_TXTATR_BREAKWORD
constexpr TypedWhichId< SwFormatFootnote > RES_TXTATR_FTN(59)
OUString removeAny(std::u16string_view rIn, sal_Unicode const *const pChars)
A wrapper around SfxPoolItem to store the start position of (usually) a text portion, with an optional end.
bool m_bASCII_ParaAsBlank
sal_Unicode GetBulletChar(sal_uInt8 nLevel)
retrieve unicode of character used for the default bullet list for the given list level ...
#define CH_TXT_ATR_INPUTFIELDSTART
sal_Int32 GetStart() const
SwNodeOffset GetIndex() const
sal_Unicode GetCharOfTextAttr(const SwTextAttr &rAttr)
bool m_bWriteClipboardDoc
bool m_bASCII_NoLastLineEnd
constexpr TypedWhichId< SwFormatField > RES_TXTATR_FIELD(RES_TXTATR_NOEND_BEGIN)
SwTextAttr * Get(size_t nPos) const
static Writer & OutASC_SwTextNode(Writer &rWrt, SwContentNode &rNode)
SwNodeOffset GetIndex() const
vector_type::size_type size_type
constexpr TypedWhichId< SwFormatLineBreak > RES_TXTATR_LINEBREAK(61)
#define CH_TXT_ATR_FIELDSTART
SwNumRule * GetNumRule(bool bInParent=true) const
Returns numbering rule of this text node.
T static_txtattr_cast(S *s)
const SwFormatFootnote & GetFootnote() const
const SwPosition * Start() const
constexpr TypedWhichId< SwFormatField > RES_TXTATR_ANNOTATION(60)
SwTextNode is a paragraph in the document model.
SwNodeFnTab aASCNodeFnTab
#define CH_TXT_ATR_INPUTFIELDEND
An SwTextAttr container, stores all directly formatted text portions for a text node.
bool m_bExportParagraphNumbering
const SwPosition * End() const
const sal_Int32 * End() const
constexpr TypedWhichId< SwFormatField > RES_TXTATR_INPUTFIELD(55)
#define CH_TXT_ATR_FIELDEND
std::shared_ptr< SwUnoCursor > m_pCurrentPam
constexpr sal_Int32 COMPLETE_STRING
OUString GetNumString(const bool _bInclPrefixAndSuffixStrings=true, const unsigned int _nRestrictToThisLevel=MAXLEVEL, SwRootFrame const *pLayout=nullptr) const
Returns outline of numbering string.
const SwAsciiOptions & GetAsciiOptions() const
bool HasVisibleNumberingOrBullet() const
Returns if the paragraph has a visible numbering or bullet.
virtual const SwRedlineTable & GetRedlineTable() const =0
#define CH_TXT_ATR_FIELDSEP
static constexpr size_type npos
bool WriteUnicodeOrByteText(std::u16string_view rStr, rtl_TextEncoding eDestCharSet)
SwNumRule * GetOutlineNumRule() const