16#include <com/sun/star/document/DocumentProperties.hpp>
17#include <com/sun/star/drawing/XDrawPageSupplier.hpp>
18#include <com/sun/star/text/VertOrientation.hpp>
19#include <com/sun/star/lang/XMultiServiceFactory.hpp>
22#include <rtl/character.hxx>
27#include <ooxml/resourceids.hxx>
77 bool bFoundCode =
false;
78 bool bInKeyword =
false;
79 while (!bFoundCode &&
ch !=
'}')
84 if (!bInKeyword && rtl::isAsciiAlphanumeric(
static_cast<unsigned char>(
ch)))
86 else if (bInKeyword && rtl::isAsciiWhiteSpace(
static_cast<unsigned char>(
ch)))
89 && !rtl::isAsciiAlphanumeric(
static_cast<unsigned char>(
ch)))
93 if (std::string_view(
aBuf) ==
"INCLUDEPICTURE")
105 OUString aFieldCommand = OStringToOUString(
aBuf, RTL_TEXTENCODING_UTF8);
106 std::tuple<OUString, std::vector<OUString>, std::vector<OUString>> aResult
109 = std::get<1>(aResult).empty() ? OUString() : std::get<1>(aResult).front();
115 if (
aBuf.toString().indexOf(
"FORM") != -1)
215 nId = NS_ooxml::LN_headerr;
222 nId = NS_ooxml::LN_footerr;
227 nId = NS_ooxml::LN_headerl;
230 nId = NS_ooxml::LN_headerr;
235 nId = NS_ooxml::LN_headerf;
240 nId = NS_ooxml::LN_footerl;
243 nId = NS_ooxml::LN_footerr;
248 nId = NS_ooxml::LN_footerf;
266 Id nId = NS_ooxml::LN_footnote;
271 sal_uInt64
const nCurrent =
Strm().
Tell();
272 for (
int i = 0;
i < 7; ++
i)
278 OString aKeyword =
aBuf.makeStringAndClear();
279 if (aKeyword ==
"\\ftnalt")
280 nId = NS_ooxml::LN_endnote;
284 bool bCustomMark =
false;
285 OUString aCustomMark;
290 aCustomMark = std::get<1>(elem)->getString();
315 NS_ooxml::LN_CT_FtnEdnRef_customMarkFollows, pValue);
349 aAttributes.
set(
Id(1),
new RTFValue(NS_ooxml::LN_annotation));
365 aAttributes.
set(NS_ooxml::LN_CT_TrackChange_author, pValue);
370 aAttributes.
set(NS_ooxml::LN_CT_Comment_initials, pValue);
381 bool bPictureFrame =
false;
384 if (rProperty.first ==
"shapeType"
386 == std::u16string_view(
389 bPictureFrame =
true;
619 if (xDrawSupplier.is())
625 xDrawSupplier->getDrawPage()->add(xShape);
637 NS_ooxml::LN_CT_FtnEdn_type,
638 new RTFValue(NS_ooxml::LN_Value_doc_ST_FtnEdn_separator));
SvStream & ReadChar(char &rChar)
sal_uInt64 Seek(sal_uInt64 nPos)
virtual void endCharacterGroup()=0
Receives end mark for group with the same character properties.
virtual void props(writerfilter::Reference< Properties >::Pointer_t ref)=0
Receives properties of the current run of text.
virtual void startCharacterGroup()=0
Receives start mark for group with the same character properties.
void setNeedSect(bool bNeedSect)
If we need a final section break at the end of the document.
RTFDocumentImpl * m_pSuperstream
Superstream of this substream.
bool m_bObject
If we are in an object group and if the we use its \objdata element.
std::size_t m_nGroupStartPos
OUString m_aAuthor
Annotation author of the next annotation.
OUString m_aPicturePath
For the INCLUDEPICTURE field's argument.
RTFError dispatchDestination(RTFKeyword nKeyword) override
void resetFrame()
Resets m_aStates.top().aFrame.
std::queue< std::pair< Id, std::size_t > > m_nHeaderFooterPositions
bool m_bNeedCrOrig
Original value of m_bNeedCr – saved/restored before/after textframes.
css::uno::Reference< css::uno::XComponentContext > const & m_xContext
void singleChar(sal_uInt8 nValue, bool bRunProps=false)
std::deque< RTFSprms > m_aNestedTableCellsAttributes
void checkUnicode(bool bUnicode, bool bHex)
If we have some unicode or hex characters to send.
RTFBuffer_t m_aSuperBuffer
Buffered superscript, till footnote is reached (or not).
css::uno::Reference< css::lang::XMultiServiceFactory > m_xModelFactory
std::deque< RTFSprms > m_aNestedTableCellsSprms
int m_nNestedCells
cell props buffer for nested tables, reset by \nestrow the \nesttableprops is a destination and must ...
int m_nListLevel
Index of the current list level in a list table entry.
oox::formulaimport::XmlStreamBuilder m_aMathBuffer
Formula import.
OUString m_aAuthorInitials
Initials of author of the next annotation.
bool m_bNeedCr
If we need to emit a CR at the end of substream.
css::uno::Reference< css::lang::XComponent > const & m_xDstDoc
tools::SvRef< RTFTokenizer > m_pTokenizer
RTFParserState m_aDefaultState
Read by RTF_PARD.
void checkFirstRun()
If this is the first run of the document, starts the initial paragraph.
tools::SvRef< RTFSdrImport > m_pSdrImport
void text(OUString &rString)
RTFError dispatchFlag(RTFKeyword nKeyword) override
void resolveSubstream(std::size_t nPos, Id nId)
bool m_bNeedPap
If paragraph properties should be emitted on next run.
bool m_hasRHeader
Flags for ensuring that only one header and footer is added per section.
css::uno::Reference< css::document::XDocumentProperties > m_xDocumentProperties
This acts like an importer, but used for looking ahead, e.g.
Represents an RTF Math Control Word.
Destination GetDestination() const
void setCreatedShapeGroup(bool bCreatedShapeGroup)
OUStringBuffer & getDestinationText()
Destination getDestination() const
void setInShape(bool bInShape)
void setCurrentBuffer(RTFBuffer_t *pCurrentBuffer)
void setFieldLocked(bool bSet)
RTFSprms & getTableSprms()
void setDestination(Destination eDestination)
RTFSprms & getCharacterAttributes()
RTFBuffer_t * getCurrentBuffer() const
RTFSprms & getCharacterSprms()
void setInShapeGroup(bool bInShapeGroup)
void setInListpicture(bool bInListpicture)
RTFSprms & getTableCellAttributes()
void setInBackground(bool bInBackground)
RTFSprms & getTableCellSprms()
void setCurrentDestinationText(OUStringBuffer *pDestinationText)
Sends RTFSprm instances to DomainMapper.
std::vector< std::pair< OUString, OUString > > & getProperties()
Skips a destination after a not parsed control word if it was prefixed with *.
void setParsed(bool bParsed)
A list of RTFSprm with a copy constructor that performs a deep copy.
void set(Id nKeyword, const RTFValue::Pointer_t &pValue, RTFOverwrite eOverwrite=RTFOverwrite::YES)
Does the same as ->push_back(), except that it can overwrite or ignore existing entries.
static bool lookupMathKeyword(RTFMathSymbol &rSymbol)
To look up additional properties of a math symbol.
#define ESCHER_ShpInst_PictureFrame
#define SAL_INFO(area, stream)
std::tuple< OUString, std::vector< OUString >, std::vector< OUString > > splitFieldCommand(std::u16string_view rCommand)
std::tuple< RTFBufferTypes, RTFValue::Pointer_t, tools::SvRef< TableRowBuffer > > Buf_t
A buffer storing dmapper calls.
@ PARAGRAPHNUMBERING_TEXTAFTER
@ ANNOTATIONREFERENCESTART
@ PARAGRAPHNUMBERING_TEXTBEFORE
@ BUFFER_RESOLVESUBSTREAM
const char * keywordToString(RTFKeyword nKeyword)
const sal_uInt8 cFieldStart