25#include <ooxml/resourceids.hxx>
27#include <com/sun/star/text/HoriOrientation.hpp>
28#include <com/sun/star/text/VertOrientation.hpp>
29#include <com/sun/star/text/RelOrientation.hpp>
34#include <svx/strings.hrc>
45m_nOrient(
text::VertOrientation::
NONE),
48m_rPositionOffsets(rPositionOffsets),
59 sal_Int32 nIntValue = rVal.
getInt( );
62 case NS_ooxml::LN_CT_PosV_relativeFrom:
66 case NS_ooxml::LN_Value_wordprocessingDrawing_ST_RelFromV_margin:
67 m_nRelation = text::RelOrientation::PAGE_PRINT_AREA;
70 case NS_ooxml::LN_Value_wordprocessingDrawing_ST_RelFromV_page:
74 case NS_ooxml::LN_Value_wordprocessingDrawing_ST_RelFromV_topMargin:
75 m_nRelation = text::RelOrientation::PAGE_PRINT_AREA_TOP;
78 case NS_ooxml::LN_Value_wordprocessingDrawing_ST_RelFromV_bottomMargin:
79 m_nRelation = text::RelOrientation::PAGE_PRINT_AREA_BOTTOM;
82 case NS_ooxml::LN_Value_wordprocessingDrawing_ST_RelFromV_paragraph:
86 case NS_ooxml::LN_Value_wordprocessingDrawing_ST_RelFromV_line:
92 SAL_WARN(
"writerfilter",
"unhandled case (" << nIntValue <<
") in NS_ooxml::LN_CT_PosV_relativeFrom");
97 case NS_ooxml::LN_CT_PosH_relativeFrom:
101 case NS_ooxml::LN_Value_wordprocessingDrawing_ST_RelFromH_margin:
102 m_nRelation = text::RelOrientation::PAGE_PRINT_AREA;
105 case NS_ooxml::LN_Value_wordprocessingDrawing_ST_RelFromH_page:
109 case NS_ooxml::LN_Value_wordprocessingDrawing_ST_RelFromH_insideMargin:
114 case NS_ooxml::LN_Value_wordprocessingDrawing_ST_RelFromH_column:
118 case NS_ooxml::LN_Value_wordprocessingDrawing_ST_RelFromH_character:
122 case NS_ooxml::LN_Value_wordprocessingDrawing_ST_RelFromH_leftMargin:
126 case NS_ooxml::LN_Value_wordprocessingDrawing_ST_RelFromH_rightMargin:
132 SAL_WARN(
"writerfilter",
"unhandled case (" << nIntValue <<
") in NS_ooxml::LN_CT_PosH_relativeFrom");
146 sal_uInt32 nSprmId = rSprm.
getId();
150 case NS_ooxml::LN_CT_PosH_posOffset:
154 case NS_ooxml::LN_CT_PosV_posOffset:
158 case NS_ooxml::LN_CT_PosH_align:
161 if (rAlign ==
"left")
163 else if (rAlign ==
"right")
164 m_nOrient = text::HoriOrientation::RIGHT;
165 else if (rAlign ==
"center")
166 m_nOrient = text::HoriOrientation::CENTER;
167 else if (rAlign ==
"inside")
168 m_nOrient = text::HoriOrientation::INSIDE;
169 else if (rAlign ==
"outside")
170 m_nOrient = text::HoriOrientation::OUTSIDE;
174 case NS_ooxml::LN_CT_PosV_align:
179 else if (rAlign ==
"bottom")
180 m_nOrient = text::VertOrientation::BOTTOM;
181 else if (rAlign ==
"center")
182 m_nOrient = text::VertOrientation::CENTER;
183 else if (rAlign ==
"inside" &&
m_nRelation == text::RelOrientation::PAGE_PRINT_AREA_BOTTOM)
185 else if (rAlign ==
"outside" &&
m_nRelation == text::RelOrientation::PAGE_PRINT_AREA_BOTTOM)
186 m_nOrient = text::VertOrientation::BOTTOM;
195 if(
m_nRelation == text::RelOrientation::TEXT_LINE )
198 if(
m_nOrient == text::VertOrientation::TOP )
199 return text::VertOrientation::BOTTOM;
200 else if(
m_nOrient == text::VertOrientation::BOTTOM )
201 return text::VertOrientation::TOP;
221 case NS_ooxml::LN_CT_Wrap_type:
224 case NS_ooxml::LN_CT_Wrap_side:
239 text::WrapTextMode nMode = text::WrapTextMode_THROUGH;
243 case NS_ooxml::LN_Value_vml_wordprocessingDrawing_ST_WrapType_square:
245 case NS_ooxml::LN_Value_vml_wordprocessingDrawing_ST_WrapType_tight:
246 case NS_ooxml::LN_Value_vml_wordprocessingDrawing_ST_WrapType_through:
250 case NS_ooxml::LN_Value_vml_wordprocessingDrawing_ST_WrapSide_left:
251 nMode = text::WrapTextMode_LEFT;
253 case NS_ooxml::LN_Value_vml_wordprocessingDrawing_ST_WrapSide_right:
254 nMode = text::WrapTextMode_RIGHT;
257 nMode = text::WrapTextMode_PARALLEL;
261 case NS_ooxml::LN_Value_vml_wordprocessingDrawing_ST_WrapType_topAndBottom:
262 nMode = text::WrapTextMode_NONE;
264 case NS_ooxml::LN_Value_vml_wordprocessingDrawing_ST_WrapType_none:
266 nMode = text::WrapTextMode_THROUGH;
285 [relativeHeight, bOldStyle](
const Items::value_type& rItem) {
288 return bOldStyle ? (rItem.first > relativeHeight) : (rItem.first >= relativeHeight);
291 sal_Int32 itemZOrderOffset(0);
297 itemZOrderOffset = 1;
301 bool bTextBox =
false;
304 if (xInfo->hasPropertyByName(
"TextBox"))
306 xShape->getPropertyValue(
"TextBox") >>= bTextBox;
316 sal_Int32 itemZOrder(0);
318 return itemZOrder + itemZOrderOffset;
320 catch (
const uno::RuntimeException&) {
323 SAL_WARN(
"writerfilter",
"findZOrder() didn't find item z-order" );
337 sal_Int32 nIntValue = rValue.
getInt();
340 case NS_ooxml::LN_CT_PositiveSize2D_cx:
345 case NS_ooxml::LN_CT_PositiveSize2D_cy:
357 sal_uInt32 nSprmId = rSprm.
getId();
360 case NS_ooxml::LN_CT_Inline_extent:
361 case NS_ooxml::LN_CT_Anchor_extent:
366 pProperties->resolve(*
this);
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.
static TagLogger & getInstance()
void element(const std::string &name)
virtual int getInt() const =0
Returns integer representation of the value.
virtual void sprm(Sprm &rSprm) override
Receives a SPRM.
virtual void attribute(Id nName, Value &rValue) override
Receives an attribute.
virtual ~ExtentHandler() override
sal_Int32 findZOrder(sal_Int32 relativeHeight, bool bOldStyle=false)
void addItem(css::uno::Reference< css::beans::XPropertySet > const &props, sal_Int32 relativeHeight)
PositionHandler(std::pair< OUString, OUString > &rPositionOffsets, std::pair< OUString, OUString > &rAligns)
std::pair< OUString, OUString > & m_rAligns
virtual void lcl_sprm(Sprm &rSprm) override
virtual ~PositionHandler() override
virtual void lcl_attribute(Id aName, Value &rVal) override
std::pair< OUString, OUString > & m_rPositionOffsets
sal_Int16 orientation() const
css::text::WrapTextMode getWrapMode() const
virtual ~WrapHandler() override
virtual void lcl_attribute(Id aName, Value &rVal) override
virtual void lcl_sprm(Sprm &rSprm) override
#define TOOLS_WARN_EXCEPTION(area, stream)
#define SAL_WARN(area, stream)
sal_Int32 convertEmuToHmm(sal_Int64 nValue)
OUString getPropertyName(PropertyIds eId)