50 sal_Int32 nCurrentSwPos;
52 sal_Int32 SearchNext( sal_Int32 nStartPos );
59 nCurrentSwPos = SearchNext( nCurrentSwPos + 1 );
62 sal_Int32 WhereNext()
const
67 bool OutAttr( sal_Int32 nSwPos );
72 SwASC_AttrIter::SwASC_AttrIter(
80 nCurrentSwPos = SearchNext( nStt + 1 );
83 sal_Int32 SwASC_AttrIter::SearchNext( sal_Int32 nStartPos )
86 const SwpHints* pTextAttrs = rNd.GetpSwpHints();
91 for (
size_t i = 0;
i < pTextAttrs->
Count(); ++
i )
98 if( nPos >= nStartPos && nPos <= nMinPos )
101 if( ( ++nPos ) >= nStartPos && nPos < nMinPos )
106 const sal_Int32 nHintStart = pHt->
GetStart();
107 if ( nHintStart >= nStartPos && nHintStart <= nMinPos )
109 nMinPos = nHintStart;
113 if ( nHintEnd >= nStartPos && nHintEnd < nMinPos )
123 bool SwASC_AttrIter::OutAttr( sal_Int32 nSwPos )
126 const SwpHints* pTextAttrs = rNd.GetpSwpHints();
129 for(
size_t i = 0;
i < pTextAttrs->
Count(); ++
i )
138 switch( pHt->
Which() )
144 ->GetFormatField().GetField()->ExpandField(
true,
nullptr);
153 sOut = rWrt.m_pDoc->GetEndNoteInfo().m_aFormat.
156 sOut = rWrt.m_pDoc->GetFootnoteInfo().m_aFormat.
161 if( !sOut.isEmpty() )
162 rWrt.Strm().WriteUnicodeOrByteText( sOut );
164 else if( nSwPos < pHt->GetStart() )
173 class SwASC_RedlineIter
183 , m_rIDRA(rNode.GetDoc().getIDocumentRedlineAccess())
184 , m_nextRedline(rWriter.m_bHideDeleteRedlines
190 bool CheckNodeDeleted()
198 && m_rNode.
GetIndex() < pRedline->End()->nNode.GetIndex();
201 std::pair<sal_Int32, sal_Int32> GetNextRedlineSkip()
208 if (pRedline->GetType() != RedlineType::Delete)
212 SwPosition const*
const pStart(pRedline->Start());
214 if (m_rNode.
GetIndex() < pStart->nNode.GetIndex())
221 nRedlineStart = pStart->nNode.GetIndex() == m_rNode.
GetIndex()
222 ? pStart->nContent.GetIndex()
227 if (pStart->nContent.GetIndex() != nRedlineEnd)
229 assert(nRedlineEnd < pStart->nContent.GetIndex());
233 nRedlineEnd = pEnd->nNode.GetIndex() == m_rNode.
GetIndex()
234 ? pEnd->nContent.GetIndex()
237 return std::make_pair(nRedlineStart, nRedlineEnd);
249 sal_Int32 nStrPos = rWrt.
m_pCurrentPam->GetPoint()->nContent.GetIndex();
250 const sal_Int32 nNodeEnd = rNd.
Len();
251 sal_Int32 nEnd = nNodeEnd;
258 SwASC_AttrIter aAttrIter( static_cast<SwASCWriter&>(rWrt), rNd, nStrPos );
259 SwASC_RedlineIter redlineIter(static_cast<SwASCWriter&>(rWrt), rNd);
261 if (redlineIter.CheckNodeDeleted())
273 if (!bIsOutlineNumRule)
281 if (numString.isEmpty() && !bIsOutlineNumRule)
291 if (!level.isEmpty() || !numString.isEmpty())
302 std::pair<sal_Int32, sal_Int32> curRedline(redlineIter.GetNextRedlineSkip());
304 const sal_Int32 nNextAttr = std::min(aAttrIter.WhereNext(), nEnd);
306 bool isOutAttr(
false);
307 if (nStrPos < curRedline.first || curRedline.second <= nStrPos)
309 isOutAttr = aAttrIter.OutAttr(nStrPos);
317 if (nNextAttr <= curRedline.first)
319 buf.append(
aStr.copy(nStrPos, nNextAttr - nStrPos));
322 else if (nStrPos < curRedline.second)
324 if (nStrPos < curRedline.first)
326 buf.append(
aStr.copy(nStrPos, curRedline.first - nStrPos));
328 if (curRedline.second <= nNextAttr)
330 nStrPos = curRedline.second;
331 curRedline = redlineIter.GetNextRedlineSkip();
341 curRedline = redlineIter.GetNextRedlineSkip();
344 OUString aOutStr(buf.makeStringAndClear());
345 if ( !bExportSoftHyphens )
373 && !nStrPos && nEnd == nNodeEnd ) )
rtl_TextEncoding GetCharSet() const
sal_uLong GetIndex() 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
constexpr TypedWhichId< SwFormatField > RES_TXTATR_ANNOTATION(59)
#define CH_TXT_ATR_FORMELEMENT
int GetActualListLevel() const
Returns the actual list level of this text node, when it is a list item.
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
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_uLong GetIndex() const
sal_Int32 GetStart() const
constexpr TypedWhichId< SwFormatFootnote > RES_TXTATR_FTN(58)
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)
vector_type::size_type size_type
#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
OUString removeAny(OUString const &rIn, sal_Unicode const *const pChars)
const SwPosition * Start() const
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
OUString GetNumString(const bool _bInclPrefixAndSuffixStrings=true, const unsigned int _nRestrictToThisLevel=MAXLEVEL, SwRootFrame const *pLayout=nullptr) const
Returns outline of numbering string.
bool WriteUnicodeOrByteText(const OUString &rStr, rtl_TextEncoding eDestCharSet)
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
const sal_Int32 COMPLETE_STRING
SwNumRule * GetOutlineNumRule() const