35#include <ooxml/resourceids.hxx>
37#include <com/sun/star/text/VertOrientation.hpp>
38#include <oox/token/tokens.hxx>
46 m_pCurrentInteropGrabBag(nullptr),
47 m_pTableManager( nullptr )
59 sal_uInt32 nSprmId = rSprm.
getId();
61 sal_Int32 nIntValue = (pValue ? pValue->getInt() : 0);
64 case NS_ooxml::LN_CT_TrPrBase_jc:
65 case NS_ooxml::LN_CT_TblPrBase_jc:
73 case NS_ooxml::LN_CT_TrPrBase_trHeight:
80 pProperties->resolve(*pMeasureHandler);
90 case NS_ooxml::LN_CT_TrPr_ins:
91 case NS_ooxml::LN_CT_TrPr_del:
96 sal_Int32
nToken = sal_Int32();
99 case NS_ooxml::LN_CT_TrPr_ins:
100 nToken = XML_tableRowInsert;
102 case NS_ooxml::LN_CT_TrPr_del:
103 nToken = XML_tableRowDelete;
106 auto pTrackChangesHandler = std::make_shared<TrackChangesHandler>(
nToken );
107 pProperties->resolve(*pTrackChangesHandler);
118 case NS_ooxml::LN_CT_TcPrBase_cellIns:
119 case NS_ooxml::LN_CT_TcPrBase_cellDel:
127 case NS_ooxml::LN_CT_TcPrBase_cellIns:
128 nToken = XML_tableCellInsert;
130 case NS_ooxml::LN_CT_TcPrBase_cellDel:
131 nToken = XML_tableCellDelete;
134 throw lang::IllegalArgumentException(
"illegal redline token type",
nullptr, 0);
137 auto pTrackChangesHandler = std::make_shared<TrackChangesHandler>(
nToken );
138 pProperties->resolve(*pTrackChangesHandler);
149 case NS_ooxml::LN_CT_TrPrBase_cantSplit:
157 case NS_ooxml::LN_CT_TcPrBase_vAlign:
162 case NS_ooxml::LN_Value_ST_VerticalJc_center: nVertOrient = text::VertOrientation::CENTER;
break;
163 case NS_ooxml::LN_Value_ST_VerticalJc_bottom: nVertOrient = text::VertOrientation::BOTTOM;
break;
172 OUString aVertOrient;
175 case NS_ooxml::LN_Value_ST_VerticalJc_top: aVertOrient =
"top";
break;
176 case NS_ooxml::LN_Value_ST_VerticalJc_center: aVertOrient =
"center";
break;
177 case NS_ooxml::LN_Value_ST_VerticalJc_both: aVertOrient =
"both";
break;
178 case NS_ooxml::LN_Value_ST_VerticalJc_bottom: aVertOrient =
"bottom";
break;
180 if (!aVertOrient.isEmpty())
182 beans::PropertyValue aValue;
183 aValue.Name =
"vAlign";
184 aValue.Value <<= aVertOrient;
190 case NS_ooxml::LN_CT_TblPrBase_tblBorders:
195 auto pBorderHandler = std::make_shared<BorderHandler>(
true);
197 pBorderHandler->enableInteropGrabBag(
"tblBorders");
198 pProperties->resolve(*pBorderHandler);
202 pTablePropMap->InsertProps(pBorderHandler->getProperties());
205 pTablePropMap->dumpXml();
211 case NS_ooxml::LN_CT_TblPrBase_tblLayout:
218 case NS_ooxml::LN_CT_TblPrEx_tblBorders:
223 auto pBorderHandler = std::make_shared<BorderHandler>(
true);
224 pProperties->resolve(*pBorderHandler);
226 pTablePropMap->InsertProps(pBorderHandler->getProperties());
229 pTablePropMap->dumpXml();
235 case NS_ooxml::LN_CT_TcPrBase_tcBorders :
244 pTDefTableHandler->enableInteropGrabBag(
"tcBorders");
245 pProperties->resolve( *pTDefTableHandler );
249 pTDefTableHandler->fillCellProperties( pCellPropMap );
254 case NS_ooxml::LN_CT_TcPrBase_tcMar:
260 auto pCellMarginHandler = std::make_shared<CellMarginHandler>();
262 pCellMarginHandler->enableInteropGrabBag(
"tcMar");
263 pProperties->resolve(*pCellMarginHandler);
267 if (pCellMarginHandler->m_bTopMarginValid)
269 if (pCellMarginHandler->m_bLeftMarginValid)
271 if (pCellMarginHandler->m_bBottomMarginValid)
273 if (pCellMarginHandler->m_bRightMarginValid)
293 case NS_ooxml::LN_CT_TcPrBase_shd:
300 auto pCellColorHandler = std::make_shared<CellColorHandler>();
301 pCellColorHandler->enableInteropGrabBag(
"shd");
302 pProperties->resolve( *pCellColorHandler );
304 beans::PropertyValue aGrabBag = pCellColorHandler->getInteropGrabBag();
313 case NS_ooxml::LN_CT_TblPrBase_tblCellMar:
320 auto pCellMarginHandler = std::make_shared<CellMarginHandler>();
322 pCellMarginHandler->enableInteropGrabBag(
"tblCellMar");
323 pProperties->resolve( *pCellMarginHandler );
327 if( pCellMarginHandler->m_bTopMarginValid )
329 if( pCellMarginHandler->m_bBottomMarginValid )
331 if( pCellMarginHandler->m_bLeftMarginValid )
333 if( pCellMarginHandler->m_bRightMarginValid )
339 case NS_ooxml::LN_CT_TblPrBase_tblInd:
346 pHandler->enableInteropGrabBag(
"tblInd");
347 pProperties->resolve( *pHandler );
351 sal_uInt32 nTblInd = pHandler->getMeasureValue();
357 case NS_ooxml::LN_CT_TcPrBase_hideMark:
371 case NS_ooxml::LN_CT_TblPrBase_tblStyleRowBandSize:
372 case NS_ooxml::LN_CT_TblPrBase_tblStyleColBandSize:
375 beans::PropertyValue aValue;
376 aValue.Name = (nSprmId == NS_ooxml::LN_CT_TblPrBase_tblStyleRowBandSize ? std::u16string_view(
u"tblStyleRowBandSize") : std::u16string_view(
u"tblStyleColBandSize"));
377 aValue.Value <<= nIntValue;
An SPRM: Section, Paragraph and Run Modifier.
virtual sal_uInt32 getId() const =0
Returns id of the SPRM.
virtual writerfilter::Reference< Properties >::Pointer_t getProps()=0
Returns reference to properties contained in the SPRM.
virtual Value::Pointer_t getValue()=0
Returns value of the SPRM.
virtual std::string toString() const =0
Returns string representation of sprm.
static TagLogger & getInstance()
void startElement(const std::string &name)
void attribute(const std::string &name, const std::string &value)
void SetLayoutType(sal_uInt32 nLayoutType)
Handler for sprms that contain a measure and a unit.
void tableExceptionProps(TablePropertyMapPtr pProps)
void cellProps(TablePropertyMapPtr pProps)
void insertRowProps(TablePropertyMapPtr pProps)
std::vector< css::beans::PropertyValue > * m_pCurrentInteropGrabBag
TableManager * m_pTableManager
void SetInteropGrabBag(std::vector< css::beans::PropertyValue > &rValue)
void insertTableProps(TablePropertyMapPtr pProps)
sal_Int16 convertTableJustification(sal_Int32 nIntValue)
@ PROP_TOP_BORDER_DISTANCE
@ PROP_RIGHT_BORDER_DISTANCE
@ PROP_CELL_INTEROP_GRAB_BAG
@ PROP_LEFT_BORDER_DISTANCE
@ PROP_TABLE_REDLINE_PARAMS
@ PROP_BOTTOM_BORDER_DISTANCE