20#include <rtl/ustring.hxx>
21#include <osl/diagnose.h>
23#include <com/sun/star/util/MeasureUnit.hpp>
56 const OUString& rValue,
62 OUString
const& rValue,
74 OUString m_FoMarginValue;
76 bool m_bHaveMargin[4];
81SwXMLImportTableItemMapper_Impl::SwXMLImportTableItemMapper_Impl(
88void SwXMLImportTableItemMapper_Impl::Reset()
90 m_FoMarginValue.clear();
91 for (
int i = 0;
i < 3; ++
i)
93 m_bHaveMargin[
i] =
false;
97void SwXMLImportTableItemMapper_Impl::setMapEntries(
104bool SwXMLImportTableItemMapper_Impl::handleSpecialItem(
108 const OUString& rValue,
113 switch( rItem.
Which() )
119 m_bHaveMargin[
LEFT] =
true;
122 m_bHaveMargin[
RIGHT] =
true;
126 rItem, rValue, nMemberId, rUnitConv);
132 m_bHaveMargin[
TOP] =
true;
135 m_bHaveMargin[
BOTTOM] =
true;
139 rItem, rValue, nMemberId, rUnitConv);
150 rItem, rValue, nMemberId, rUnitConv );
158bool SwXMLImportTableItemMapper_Impl::handleNoItem(
161 OUString
const& rValue,
165 if ((XML_NAMESPACE_FO == rEntry.
nNameSpace) &&
168 m_FoMarginValue = rValue;
174 rEntry, rSet, rValue, rUnitConverter, rNamespaceMap);
178void SwXMLImportTableItemMapper_Impl::finished(
181 if (m_FoMarginValue.isEmpty())
184 sal_uInt16
const Ids[4][2] = {
190 for (
int i = 0;
i < 4; ++
i)
192 if (m_bHaveMargin[i])
208 if (eState >= SfxItemState::DEFAULT && pItem)
210 std::unique_ptr<SfxPoolItem> pNewItem(pItem->
Clone());
211 bool const bPut = PutXMLValue(
212 *pNewItem, m_FoMarginValue, Ids[i][1], rUnitConverter);
220 OSL_ENSURE(
false,
"could not get item");
228 util::MeasureUnit::TWIP, util::MeasureUnit::TWIP,
247 const Reference< xml::sax::XFastAttributeList > & xAttrList,
255 case XmlStyleFamily::TABLE_TABLE:
258 case XmlStyleFamily::TABLE_COLUMN:
261 case XmlStyleFamily::TABLE_ROW:
264 case XmlStyleFamily::TABLE_CELL:
const SfxPoolItem & GetDefaultItem(sal_uInt16 nWhich) const
static bool IsWhich(sal_uInt16 nId)
SfxItemPool * GetPool() const
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const=0
virtual void setMapEntries(SvXMLItemMapEntriesRef rMapEntries)
static bool PutXMLValue(SfxPoolItem &rItem, const OUString &rValue, sal_uInt16 nMemberId, const SvXMLUnitConverter &rUnitConverter)
This method is called for every item that should be set based upon an XML attribute value.
virtual bool handleSpecialItem(const SvXMLItemMapEntry &rEntry, SfxPoolItem &rItem, SfxItemSet &rSet, const OUString &rValue, const SvXMLUnitConverter &rUnitConverter)
this method is called for every item that has the MID_SW_FLAG_SPECIAL_ITEM_IMPORT flag set
virtual void finished(SfxItemSet &rSet, SvXMLUnitConverter const &rUnitConverter) const
This method is called when all attributes have benn processed.
virtual bool handleNoItem(const SvXMLItemMapEntry &rEntry, SfxItemSet &rSet, const OUString &rValue, const SvXMLUnitConverter &rUnitConverter, const SvXMLNamespaceMap &rNamespaceMap)
this method is called for every item that has the MID_SW_FLAG_NO_ITEM_IMPORT flag set
this class manages an array of SvXMLItemMapEntry.
SvXMLItemMapEntriesRef m_xTableItemMap
SvXMLItemMapEntriesRef m_xTableRowItemMap
const SvXMLImportItemMapper & GetTableItemMapper() const
SvXMLImportContext * CreateTableItemImportContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList, XmlStyleFamily nSubFamily, SfxItemSet &rItemSet)
std::unique_ptr< SvXMLUnitConverter > m_pTwipUnitConv
std::unique_ptr< SvXMLImportItemMapper > m_pTableItemMapper
SvXMLItemMapEntriesRef m_xTableCellItemMap
SvXMLItemMapEntriesRef m_xTableColItemMap
constexpr TypedWhichId< SwFormatFrameSize > RES_FRM_SIZE(89)
constexpr TypedWhichId< SvxLRSpaceItem > RES_LR_SPACE(97)
constexpr TypedWhichId< SvxULSpaceItem > RES_UL_SPACE(98)
enum::xmloff::token::XMLTokenEnum const eLocalName
#define MID_FRMSIZE_COL_WIDTH
const o3tl::span< SvXMLItemMapEntry const > aXMLTableCellItemMap(aTableCellItemMap)
const o3tl::span< SvXMLItemMapEntry const > aXMLTableColItemMap(aTableColItemMap)
const o3tl::span< SvXMLItemMapEntry const > aXMLTableItemMap(aTableItemMap)
const o3tl::span< SvXMLItemMapEntry const > aXMLTableRowItemMap(aTableRowItemMap)