16#include <com/sun/star/drawing/XDrawPageSupplier.hpp>
17#include <com/sun/star/drawing/XEnhancedCustomShapeDefaulter.hpp>
18#include <com/sun/star/text/RelOrientation.hpp>
19#include <com/sun/star/text/VertOrientation.hpp>
20#include <com/sun/star/lang/XMultiServiceFactory.hpp>
24#include <ooxml/resourceids.hxx>
53 if (!aParam.isEmpty())
56 NS_ooxml::LN_CT_TblPPr_vertAnchor,
new RTFValue(aParam));
73 if (!aParam.isEmpty())
76 NS_ooxml::LN_CT_TblPPr_horzAnchor,
new RTFValue(aParam));
90 if (!aParam.isEmpty())
93 NS_ooxml::LN_CT_TblPPr_tblpYSpec,
new RTFValue(aParam));
107 if (!aParam.isEmpty())
110 NS_ooxml::LN_CT_TblPPr_tblpXSpec,
new RTFValue(aParam));
129 nSprm = NS_ooxml::LN_Value_ST_Underline_dotted;
132 nSprm = NS_ooxml::LN_Value_ST_Underline_words;
148 nParam = NS_ooxml::LN_Value_ST_Jc_center;
151 nParam = NS_ooxml::LN_Value_ST_Jc_both;
154 nParam = NS_ooxml::LN_Value_ST_Jc_left;
157 nParam = NS_ooxml::LN_Value_ST_Jc_right;
160 nParam = NS_ooxml::LN_Value_ST_Jc_distribute;
178 nParam = NS_ooxml::LN_Value_doc_ST_TextAlignment_auto;
181 nParam = NS_ooxml::LN_Value_doc_ST_TextAlignment_top;
184 nParam = NS_ooxml::LN_Value_doc_ST_TextAlignment_center;
187 nParam = NS_ooxml::LN_Value_doc_ST_TextAlignment_baseline;
190 nParam = NS_ooxml::LN_Value_doc_ST_TextAlignment_bottom;
206 nParam = NS_ooxml::LN_Value_ST_TabJc_right;
209 nParam = NS_ooxml::LN_Value_ST_TabJc_center;
212 nParam = NS_ooxml::LN_Value_ST_TabJc_decimal;
228 nParam = NS_ooxml::LN_Value_ST_TabTlc_dot;
231 nParam = NS_ooxml::LN_Value_ST_TabTlc_middleDot;
234 nParam = NS_ooxml::LN_Value_ST_TabTlc_hyphen;
238 nParam = NS_ooxml::LN_Value_ST_TabTlc_underscore;
259 nParam = NS_ooxml::LN_Value_ST_Border_single;
262 nParam = NS_ooxml::LN_Value_ST_Border_dotted;
265 nParam = NS_ooxml::LN_Value_ST_Border_dashed;
268 nParam = NS_ooxml::LN_Value_ST_Border_double;
271 nParam = NS_ooxml::LN_Value_ST_Border_thinThickSmallGap;
274 nParam = NS_ooxml::LN_Value_ST_Border_thinThickMediumGap;
277 nParam = NS_ooxml::LN_Value_ST_Border_thinThickLargeGap;
280 nParam = NS_ooxml::LN_Value_ST_Border_thickThinSmallGap;
283 nParam = NS_ooxml::LN_Value_ST_Border_thickThinMediumGap;
286 nParam = NS_ooxml::LN_Value_ST_Border_thickThinLargeGap;
289 nParam = NS_ooxml::LN_Value_ST_Border_threeDEmboss;
292 nParam = NS_ooxml::LN_Value_ST_Border_threeDEngrave;
295 nParam = NS_ooxml::LN_Value_ST_Border_outset;
298 nParam = NS_ooxml::LN_Value_ST_Border_inset;
301 nParam = NS_ooxml::LN_Value_ST_Border_dashSmallGap;
304 nParam = NS_ooxml::LN_Value_ST_Border_dotDash;
307 nParam = NS_ooxml::LN_Value_ST_Border_dotDotDash;
310 nParam = NS_ooxml::LN_Value_ST_Border_none;
327 nParam = NS_ooxml::LN_Value_ST_SectionMark_continuous;
330 nParam = NS_ooxml::LN_Value_ST_SectionMark_nextColumn;
333 nParam = NS_ooxml::LN_Value_ST_SectionMark_nextPage;
336 nParam = NS_ooxml::LN_Value_ST_SectionMark_evenPage;
339 nParam = NS_ooxml::LN_Value_ST_SectionMark_oddPage;
359 nParam = NS_ooxml::LN_Value_ST_NumberFormat_decimal;
362 nParam = NS_ooxml::LN_Value_ST_NumberFormat_lowerLetter;
365 nParam = NS_ooxml::LN_Value_ST_NumberFormat_upperLetter;
368 nParam = NS_ooxml::LN_Value_ST_NumberFormat_lowerRoman;
371 nParam = NS_ooxml::LN_Value_ST_NumberFormat_upperRoman;
374 nParam = NS_ooxml::LN_Value_ST_NumberFormat_chicago;
383 aAttributes.
set(NS_ooxml::LN_CT_NumFmt_val, pInner);
384 auto pOuter =
new RTFValue(aAttributes);
386 NS_ooxml::LN_EG_SectPrContents_footnotePr, NS_ooxml::LN_CT_FtnProps_numFmt,
395 nParam = NS_ooxml::LN_Value_ST_RestartNumber_eachPage;
398 nParam = NS_ooxml::LN_Value_ST_RestartNumber_eachSect;
401 nParam = NS_ooxml::LN_Value_ST_RestartNumber_continuous;
410 NS_ooxml::LN_EG_SectPrContents_footnotePr,
411 NS_ooxml::LN_EG_FtnEdnNumProps_numRestart, pValue);
419 nParam = NS_ooxml::LN_Value_ST_NumberFormat_decimal;
422 nParam = NS_ooxml::LN_Value_ST_NumberFormat_lowerLetter;
425 nParam = NS_ooxml::LN_Value_ST_NumberFormat_upperLetter;
428 nParam = NS_ooxml::LN_Value_ST_NumberFormat_lowerRoman;
431 nParam = NS_ooxml::LN_Value_ST_NumberFormat_upperRoman;
434 nParam = NS_ooxml::LN_Value_ST_NumberFormat_chicago;
443 aAttributes.
set(NS_ooxml::LN_CT_NumFmt_val, pInner);
444 auto pOuter =
new RTFValue(aAttributes);
446 NS_ooxml::LN_CT_EdnProps_numFmt, pOuter);
453 nParam = NS_ooxml::LN_Value_ST_Jc_left;
456 nParam = NS_ooxml::LN_Value_ST_Jc_center;
459 nParam = NS_ooxml::LN_Value_ST_Jc_right;
475 nParam = NS_ooxml::LN_Value_ST_TextDirection_lrTb;
478 nParam = NS_ooxml::LN_Value_ST_TextDirection_tbRl;
481 nParam = NS_ooxml::LN_Value_ST_TextDirection_btLr;
484 nParam = NS_ooxml::LN_Value_ST_TextDirection_lrTbV;
487 nParam = NS_ooxml::LN_Value_ST_TextDirection_tbRlV;
503 nParam = NS_ooxml::LN_CT_PPrBase_keepLines;
506 nParam = NS_ooxml::LN_CT_PPrBase_keepNext;
511 nParam = NS_ooxml::LN_inTbl;
515 nParam = NS_ooxml::LN_CT_PPrBase_pageBreakBefore;
605 &&
getStyleType(0) != NS_ooxml::LN_Value_ST_StyleType_character)
642 auto pValue =
new RTFValue(aAttributes);
643 for (
int i = 0;
i < 4;
i++)
669 NS_ooxml::LN_CT_TblPrBase_bidiVisual,
690 auto pValue =
new RTFValue(NS_ooxml::LN_Value_ST_Underline_none);
705 auto pValue =
new RTFValue(aAttributes, aSprms);
709 nSprm = NS_ooxml::LN_CT_TcBorders_top;
712 nSprm = NS_ooxml::LN_CT_TcBorders_left;
715 nSprm = NS_ooxml::LN_CT_TcBorders_bottom;
718 nSprm = NS_ooxml::LN_CT_TcBorders_right;
735 auto pValue =
new RTFValue(aAttributes, aSprms);
739 nSprm = NS_ooxml::LN_CT_PageBorders_top;
742 nSprm = NS_ooxml::LN_CT_PageBorders_left;
745 nSprm = NS_ooxml::LN_CT_PageBorders_bottom;
748 nSprm = NS_ooxml::LN_CT_PageBorders_right;
754 NS_ooxml::LN_EG_SectPrContents_pgBorders, nSprm, pValue);
766 auto pValue =
new RTFValue(aAttributes, aSprms);
795 auto pValue =
new RTFValue(aAttributes);
802 auto pValue =
new RTFValue(NS_ooxml::LN_Value_ST_Merge_restart);
808 auto pValue =
new RTFValue(NS_ooxml::LN_Value_ST_Merge_continue);
814 auto pValue =
new RTFValue(NS_ooxml::LN_Value_ST_Merge_restart);
820 auto pValue =
new RTFValue(NS_ooxml::LN_Value_ST_Merge_continue);
831 nParam = NS_ooxml::LN_Value_ST_VerticalJc_top;
834 nParam = NS_ooxml::LN_Value_ST_VerticalJc_center;
837 nParam = NS_ooxml::LN_Value_ST_VerticalJc_bottom;
890 auto pValue =
new RTFValue(
"superscript");
896 auto pValue =
new RTFValue(
"subscript");
914 ? NS_ooxml::LN_Value_ST_LineNumberRestart_newPage
915 : NS_ooxml::LN_Value_ST_LineNumberRestart_continuous);
917 NS_ooxml::LN_EG_SectPrContents_lnNumType,
918 NS_ooxml::LN_CT_LineNumber_restart, pValue);
934 auto pValue =
new RTFValue(NS_ooxml::LN_Value_ST_RestartNumber_eachSect);
936 NS_ooxml::LN_EG_SectPrContents_footnotePr,
937 NS_ooxml::LN_EG_FtnEdnNumProps_numRestart, pValue);
942 NS_ooxml::LN_EG_SectPrContents_lnNumType,
943 NS_ooxml::LN_CT_LineNumber_distance);
956 NS_ooxml::LN_Value_doc_ST_YAlign_top);
960 NS_ooxml::LN_Value_doc_ST_YAlign_bottom);
964 NS_ooxml::LN_Value_doc_ST_YAlign_center);
968 NS_ooxml::LN_Value_doc_ST_YAlign_inside);
972 NS_ooxml::LN_Value_doc_ST_YAlign_outside);
976 NS_ooxml::LN_Value_doc_ST_YAlign_inline);
981 NS_ooxml::LN_Value_doc_ST_HAnchor_margin);
985 NS_ooxml::LN_Value_doc_ST_VAnchor_margin);
989 NS_ooxml::LN_Value_doc_ST_HAnchor_page);
993 NS_ooxml::LN_Value_doc_ST_VAnchor_page);
997 NS_ooxml::LN_Value_doc_ST_HAnchor_text);
1001 NS_ooxml::LN_Value_doc_ST_VAnchor_text);
1006 NS_ooxml::LN_Value_doc_ST_XAlign_center);
1010 NS_ooxml::LN_Value_doc_ST_XAlign_inside);
1014 NS_ooxml::LN_Value_doc_ST_XAlign_outside);
1018 NS_ooxml::LN_Value_doc_ST_XAlign_left);
1022 NS_ooxml::LN_Value_doc_ST_XAlign_right);
1032 sal_Int32
nType = 0;
1077 std::vector<beans::PropertyValue> aDefaults
1079 for (
const auto& rDefault : aDefaults)
1106 if (xDrawSupplier.is())
1121 xDefaulter->createCustomShapeDefaults(OUString::number(
nType));
1123 std::vector<beans::PropertyValue>& rPendingProperties
1125 for (
const auto& rPendingProperty : rPendingProperties)
1127 rPendingProperty.Name, rPendingProperty.Value);
1136 beans::PropertyValue aPropertyValue;
1139 : std::u16string_view(
u"VertOrientRelation"));
1140 aPropertyValue.Value <<= text::RelOrientation::PAGE_PRINT_AREA;
1147 beans::PropertyValue aPropertyValue;
1150 : std::u16string_view(
u"VertOrientRelation"));
1151 aPropertyValue.Value <<= text::RelOrientation::PAGE_FRAME;
1157 beans::PropertyValue aPropertyValue;
1158 aPropertyValue.Name =
"VertOrientRelation";
1184 auto pValue =
new RTFValue(NS_ooxml::LN_Value_ST_NumberFormat_decimal);
1186 NS_ooxml::LN_CT_NumFmt_val, pValue);
1194 NS_ooxml::LN_CT_NumFmt_val,
1195 new RTFValue(NS_ooxml::LN_Value_ST_NumberFormat_bullet));
1200 auto pValue =
new RTFValue(NS_ooxml::LN_Value_ST_PageOrientation_landscape);
1202 NS_ooxml::LN_EG_SectPrContents_pgSz, NS_ooxml::LN_CT_PageSz_orient,
1208 auto pValue =
new RTFValue(NS_ooxml::LN_Value_ST_PageOrientation_landscape);
1210 NS_ooxml::LN_EG_SectPrContents_pgSz, NS_ooxml::LN_CT_PageSz_orient,
1217 NS_ooxml::LN_Value_wordprocessingDrawing_ST_RelFromH_page);
1222 NS_ooxml::LN_Value_wordprocessingDrawing_ST_RelFromV_page);
1231 "CornerRadius",
uno::Any(sal_Int32(83)));
1235 NS_ooxml::LN_Value_doc_ST_Wrap_notBeside);
1261 NS_ooxml::LN_EG_SectPrContents_cols, NS_ooxml::LN_CT_Columns_sep,
1266 NS_ooxml::LN_EG_SectPrContents_pgNumType,
1267 NS_ooxml::LN_CT_PageNumber_start,
new RTFValue(1));
1271 auto pIntValue =
new RTFValue(NS_ooxml::LN_Value_ST_NumberFormat_upperLetter);
1273 NS_ooxml::LN_EG_SectPrContents_pgNumType,
1274 NS_ooxml::LN_CT_PageNumber_fmt, pIntValue);
1279 auto pIntValue =
new RTFValue(NS_ooxml::LN_Value_ST_NumberFormat_lowerLetter);
1281 NS_ooxml::LN_EG_SectPrContents_pgNumType,
1282 NS_ooxml::LN_CT_PageNumber_fmt, pIntValue);
1287 auto pIntValue =
new RTFValue(NS_ooxml::LN_Value_ST_NumberFormat_upperRoman);
1289 NS_ooxml::LN_EG_SectPrContents_pgNumType,
1290 NS_ooxml::LN_CT_PageNumber_fmt, pIntValue);
1295 auto pIntValue =
new RTFValue(NS_ooxml::LN_Value_ST_NumberFormat_lowerRoman);
1297 NS_ooxml::LN_EG_SectPrContents_pgNumType,
1298 NS_ooxml::LN_CT_PageNumber_fmt, pIntValue);
1303 auto pIntValue =
new RTFValue(NS_ooxml::LN_Value_ST_NumberFormat_decimal);
1305 NS_ooxml::LN_EG_SectPrContents_pgNumType,
1306 NS_ooxml::LN_CT_PageNumber_fmt, pIntValue);
HRESULT createInstance(REFIID iid, Ifc **ppIfc)
virtual void startShape(css::uno::Reference< css::drawing::XShape > const &xShape)=0
Receives a shape.
void resetTableRowProperties()
void setNeedSect(bool bNeedSect)
If we need a final section break at the end of the document.
bool m_bHadPicture
A picture was seen in the current paragraph.
std::deque< RTFBuffer_t > m_aTableBufferStack
Buffered table cells, till cell definitions are not reached.
int m_nDefaultFontIndex
Raw default font index, use getFont() on it to get a real one.
bool isStyleSheetImport()
Are we inside the stylesheet table?
RTFKeyword m_nResetBreakOnSectBreak
clean up a synthetic page break, see RTF_PAGE if inactive value is -1, otherwise the RTF_SKB* to rest...
void resetFrame()
Resets m_aStates.top().aFrame.
RTFError dispatchSymbol(RTFKeyword nKeyword) override
RTFSprms m_aSettingsTableSprms
The settings table sprms.
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).
Id getStyleType(int nIndex)
Return the style type of an RTF style index.
bool dispatchFloatingTableFlag(RTFKeyword nKeyword)
Dispatches flags related to Positioned Wrapped Tables.
RTFParserState & getDefaultState()
Get the default parser state.
int m_nNestedCells
cell props buffer for nested tables, reset by \nestrow the \nesttableprops is a destination and must ...
const css::uno::Reference< css::lang::XMultiServiceFactory > & getModelFactory() const
OUString getStyleName(int nIndex)
Return the style name of an RTF style index.
int getFontIndex(int nIndex)
Return the dmapper index of an RTF index for fonts.
bool m_bMathNor
Normal text property, that is math italic and math spacing are not applied to the current run.
css::uno::Reference< css::lang::XComponent > const & m_xDstDoc
int m_nTopLevelCells
cell props buffer for top-level table, reset by \row
RTFParserState m_aDefaultState
Read by RTF_PARD.
void checkFirstRun()
If this is the first run of the document, starts the initial paragraph.
void replayBuffer(RTFBuffer_t &rBuffer, RTFSprms *pSprms, RTFSprms const *pAttributes)
tools::SvRef< RTFSdrImport > m_pSdrImport
RTFError dispatchFlag(RTFKeyword nKeyword) override
bool m_bAfterCellBeforeRow
Are we after a \cell, but before a \row?
rtl_TextEncoding getEncoding(int nFontIndex)
Return the encoding associated with a font index.
bool m_bNeedPap
If paragraph properties should be emitted on next run.
void backupTableRowProperties()
void setPropertySet(const css::uno::Reference< css::beans::XPropertySet > &xPropertySet)
const css::uno::Reference< css::beans::XPropertySet > & getPropertySet() const
void setFLine(sal_Int32 nFLine)
sal_Int32 getDhgt() const
std::vector< css::beans::PropertyValue > & getPendingProperties()
void setHadShapeText(bool bHadShapeText)
const css::uno::Reference< css::drawing::XShape > & getShape() const
void setShape(const css::uno::Reference< css::drawing::XShape > &xShape)
void setSprm(Id nId, Id nValue)
Store a property.
void setRunType(RunType eRunType)
void setCurrentCharacterStyleIndex(int nCurrentCharacterStyleIndex)
void setCurrentEncoding(rtl_TextEncoding nCurrentEncoding)
RTFSprms & getParagraphSprms()
RTFSprms & getTableRowSprms()
RTFSprms & getTabAttributes()
RTFDrawingObject & getDrawingObject()
void setCurrentStyleIndex(int nCurrentStyleIndex)
Destination getDestination() const
RTFSprms & getSectionAttributes()
void setBorderState(RTFBorderState nBorderState)
void setCurrentBuffer(RTFBuffer_t *pCurrentBuffer)
void setFieldLocked(bool bSet)
RTFPicture & getPicture()
rtl_TextEncoding getCurrentEncoding() const
RTFSprms & getTableSprms()
void setDestination(Destination eDestination)
RTFSprms & getCharacterAttributes()
RTFBuffer_t * getCurrentBuffer() const
RTFSprms & getCharacterSprms()
RTFSprms & getSectionSprms()
RTFSprms & getParagraphAttributes()
RTFSprms & getTableAttributes()
RunType getRunType() const
RTFSprms & getTableCellSprms()
static std::vector< css::beans::PropertyValue > getTextFrameDefaults(bool bNew)
These are the default in Word, but not in Writer.
void setHoriOrientRelation(sal_Int16 nHoriOrientRelation)
void setVertOrientRelationToken(sal_uInt32 nVertOrientRelationToken)
void setVertOrientRelation(sal_Int16 nVertOrientRelation)
void setHoriOrientRelationToken(sal_uInt32 nHoriOrientRelationToken)
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.
RTFValue::Pointer_t find(Id nKeyword, bool bFirst=true, bool bForWrite=false)
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.
#define ESCHER_ShpInst_Ellipse
#define SAL_INFO(area, stream)
bool findPropertyName(const std::vector< beans::PropertyValue > &rProperties, const OUString &rName)
void putNestedAttribute(RTFSprms &rSprms, Id nParent, Id nId, const RTFValue::Pointer_t &pValue, RTFOverwrite eOverwrite, bool bAttribute)
bool eraseNestedAttribute(RTFSprms &rSprms, Id nParent, Id nId)
void putNestedSprm(RTFSprms &rSprms, Id nParent, Id nId, const RTFValue::Pointer_t &pValue, RTFOverwrite eOverwrite)
Id getParagraphBorder(sal_uInt32 nIndex)
const char * keywordToString(RTFKeyword nKeyword)
void putBorderProperty(RTFStack &aStates, Id nId, const RTFValue::Pointer_t &pValue)