22#include <com/sun/star/frame/XModel.hpp>
23#include <com/sun/star/text/XTextColumns.hpp>
24#include <com/sun/star/text/TextColumn.hpp>
25#include <com/sun/star/lang/XMultiServiceFactory.hpp>
26#include <com/sun/star/style/VerticalAlignment.hpp>
27#include <com/sun/star/beans/XPropertySet.hpp>
58 {
XML_TOP, VerticalAlignment_TOP },
72 xml::sax::XFastAttributeList > & xAttrList );
79 SvXMLImport& rImport, sal_Int32 ,
81 xml::sax::XFastAttributeList > & xAttrList ) :
91 switch( aIter.getToken() )
95 size_t nPos = aIter.toView().find(
'*' );
96 if(
nPos != std::string_view::npos &&
static_cast<sal_Int32
>(
nPos+1) == aIter.getLength() )
100 aIter.toView().substr(0,
nPos),
109 convertMeasureToCore( nVal, aIter.toView() ) )
115 convertMeasureToCore( nVal, aIter.toView() ) )
136 const uno::Reference<
137 xml::sax::XFastAttributeList > & xAttrList );
148 SvXMLImport& rImport, sal_Int32 ,
149 const uno::Reference<
150 xml::sax::XFastAttributeList > & xAttrList) :
156 eVertAlign( VerticalAlignment_TOP )
161 switch( aIter.getToken() )
165 convertMeasureToCore( nVal, aIter.toView() ) )
170 nVal >=1 && nVal <= 100 )
199 SvXMLImport& rImport, sal_Int32 nElement,
200 const Reference< xml::sax::XFastAttributeList >& xAttrList,
202 ::std::vector< XMLPropertyState > &rProps )
206, nAutomaticDistance( 0 )
211 switch(aIter.getToken())
216 nCount =
static_cast<sal_Int16
>(nVal);
233 const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList )
262 Reference<XInterface> xIfc =
xFactory->createInstance(
"com.sun.star.text.TextColumns");
266 Reference< XTextColumns > xColumns( xIfc, UNO_QUERY );
270 xColumns->setColumnCount( 1 );
278 sal_Int32 nRelWidth = 0;
279 sal_uInt16 nColumnsWithWidth = 0;
284 const TextColumn& rColumn =
285 maColumns[
static_cast<sal_uInt16
>(
i)]->getTextColumn();
286 if( rColumn.Width > 0 )
288 nRelWidth += rColumn.Width;
292 if( nColumnsWithWidth <
nCount )
294 sal_Int32 nColWidth = 0==nRelWidth
296 : nRelWidth / nColumnsWithWidth;
300 TextColumn& rColumn =
301 maColumns[
static_cast<sal_uInt16
>(
i)]->getTextColumn();
302 if( rColumn.Width == 0 )
304 rColumn.Width = nColWidth;
305 nRelWidth += rColumn.Width;
306 if( 0 == --nColumnsWithWidth )
312 Sequence< TextColumn > aColumns(
static_cast<sal_Int32
>(
nCount) );
313 TextColumn *pTextColumns = aColumns.getArray();
315 *pTextColumns++ =
maColumns[
static_cast<sal_uInt16
>(
i)]->getTextColumn();
317 xColumns->setColumns( aColumns );
324 xColumns->setColumnCount(
nCount );
327 Reference < XPropertySet > xPropSet( xColumns, UNO_QUERY );
constexpr OUStringLiteral gsSeparatorLineVerticalAlignment(u"SeparatorLineVerticalAlignment")
constexpr OUStringLiteral gsSeparatorLineStyle(u"SeparatorLineStyle")
SvXMLEnumMapEntry< sal_Int8 > const pXML_Sep_Style_Enum[]
constexpr OUStringLiteral gsSeparatorLineWidth(u"SeparatorLineWidth")
constexpr OUStringLiteral gsSeparatorLineColor(u"SeparatorLineColor")
constexpr OUStringLiteral gsSeparatorLineIsOn(u"SeparatorLineIsOn")
constexpr OUStringLiteral gsSeparatorLineRelativeHeight(u"SeparatorLineRelativeHeight")
constexpr OUStringLiteral gsAutomaticDistance(u"AutomaticDistance")
SvXMLEnumMapEntry< VerticalAlignment > const pXML_Sep_Align_Enum[]
This class deliberately does not support XWeak, to improve performance when loading large documents.
SvXMLImport & GetImport()
static bool convertEnum(EnumT &rEnum, std::u16string_view rValue, const SvXMLEnumMapEntry< EnumT > *pMap)
convert string to enum using given enum map, if the enum is not found in the map, this method will re...
void SetInsert(bool bIns)
virtual void SAL_CALL endFastElement(sal_Int32 nElement) override
endFastElement is called before a context will be destructed, but after an elements context has been ...
XMLTextColumnContext_Impl(SvXMLImport &rImport, sal_Int32 nElement, const uno::Reference< xml::sax::XFastAttributeList > &xAttrList)
text::TextColumn & getTextColumn()
sal_Int8 GetHeight() const
sal_Int8 GetStyle() const
sal_Int32 GetWidth() const
VerticalAlignment eVertAlign
VerticalAlignment GetVertAlign() const
XMLTextColumnSepContext_Impl(SvXMLImport &rImport, sal_Int32 nElement, const uno::Reference< xml::sax::XFastAttributeList > &xAttrList)
sal_Int32 GetColor() const
XMLTextColumnsContext(SvXMLImport &rImport, sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList, const XMLPropertyState &rProp, ::std::vector< XMLPropertyState > &rProps)
std::vector< rtl::Reference< XMLTextColumnContext_Impl > > maColumns
virtual void SAL_CALL endFastElement(sal_Int32 nElement) override
endFastElement is called before a context will be destructed, but after an elements context has been ...
sal_Int32 nAutomaticDistance
rtl::Reference< XMLTextColumnSepContext_Impl > mxColumnSep
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &AttrList) override
static bool convertPercent(sal_Int32 &rValue, std::u16string_view rString)
static bool convertColor(sal_Int32 &rColor, std::u16string_view rValue)
static bool convertNumber(sal_Int32 &rValue, std::u16string_view aString, sal_Int32 nMin=SAL_MIN_INT32, sal_Int32 nMax=SAL_MAX_INT32)
Reference< XSingleServiceFactory > xFactory
FastAttributeList & castToFastAttributeList(const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList)
Handling of tokens in XML:
Smart struct to transport an Any with an index to the appropriate property-name.
#define XMLOFF_WARN_UNKNOWN_ELEMENT(area, token)
#define XMLOFF_WARN_UNKNOWN(area, rIter)
#define XML_ELEMENT(prefix, name)