LibreOffice Module oox (master) 1
vmlshapecontext.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#include <sal/config.h>
21
22#include <string_view>
23
25
28#include <oox/helper/helper.hxx>
29#include <oox/token/namespaces.hxx>
30#include <oox/token/tokens.hxx>
32#include <oox/vml/vmlshape.hxx>
35
36#include <osl/diagnose.h>
38#include <o3tl/string_view.hxx>
39
40namespace oox::vml {
41
42using namespace ::com::sun::star;
43
44using ::oox::core::ContextHandler2;
45using ::oox::core::ContextHandler2Helper;
47
48namespace {
49
52std::optional< bool > lclDecodeBool( const AttributeList& rAttribs, sal_Int32 nToken )
53{
54 std::optional< OUString > oValue = rAttribs.getString( nToken );
55 if( oValue.has_value() ) return std::optional< bool >( ConversionHelper::decodeBool( oValue.value() ) );
56 return std::optional< bool >();
57}
58
62std::optional< double > lclDecodePercent( const AttributeList& rAttribs, sal_Int32 nToken, double fDefValue )
63{
64 std::optional< OUString > oValue = rAttribs.getString( nToken );
65 if( oValue.has_value() ) return std::optional< double >( ConversionHelper::decodePercent( oValue.value(), fDefValue ) );
66 return std::optional< double >();
67}
68
72std::optional< double > lclDecodeOpacity( const AttributeList& rAttribs, sal_Int32 nToken, double fDefValue )
73{
74 std::optional< OUString > oValue = rAttribs.getString( nToken );
75 double fRetval(fDefValue);
76
77 if( oValue.has_value() )
78 {
79 const OUString& aString(oValue.value());
80 const sal_Int32 nLength(aString.getLength());
81
82 if(nLength > 0)
83 {
84 if(aString.endsWith("f"))
85 {
86 fRetval = std::clamp(aString.toDouble() / 65536.0, 0.0, 1.0);
87 }
88 else
89 {
90 fRetval = ConversionHelper::decodePercent( aString, fDefValue );
91 }
92 }
93 }
94
95 return std::optional< double >(fRetval);
96}
97
100std::optional< Int32Pair > lclDecodeInt32Pair( const AttributeList& rAttribs, sal_Int32 nToken )
101{
102 std::optional< OUString > oValue = rAttribs.getString( nToken );
103 std::optional< Int32Pair > oRetValue;
104 if( oValue.has_value() )
105 {
106 std::u16string_view aValue1, aValue2;
107 ConversionHelper::separatePair( aValue1, aValue2, oValue.value(), ',' );
108 oRetValue = Int32Pair( o3tl::toInt32(aValue1), o3tl::toInt32(aValue2) );
109 }
110 return oRetValue;
111}
112
115std::optional< DoublePair > lclDecodePercentPair( const AttributeList& rAttribs, sal_Int32 nToken )
116{
117 std::optional< OUString > oValue = rAttribs.getString( nToken );
118 std::optional< DoublePair > oRetValue;
119 if( oValue.has_value() )
120 {
121 std::u16string_view aValue1, aValue2;
122 ConversionHelper::separatePair( aValue1, aValue2, oValue.value(), ',' );
123 oRetValue = DoublePair(
124 ConversionHelper::decodePercent( aValue1, 0.0 ),
125 ConversionHelper::decodePercent( aValue2, 0.0 ) );
126 }
127 return oRetValue;
128}
129
134bool lclDecodeVmlxBool( std::u16string_view rValue, bool bDefaultForEmpty )
135{
136 if( rValue.empty() ) return bDefaultForEmpty;
137 sal_Int32 nToken = AttributeConversion::decodeToken( rValue );
138 // anything else than 't' or 'True' is considered to be false, as specified
139 return (nToken == XML_t) || (nToken == XML_True);
140}
141
142} // namespace
143
144ShapeLayoutContext::ShapeLayoutContext( ContextHandler2Helper const & rParent, Drawing& rDrawing ) :
145 ContextHandler2( rParent ),
146 mrDrawing( rDrawing )
147{
148}
149
151{
152 switch( nElement )
153 {
154 case O_TOKEN( idmap ):
155 {
156 OUString aBlockIds = rAttribs.getStringDefaulted( XML_data);
157 sal_Int32 nIndex = 0;
158 while( nIndex >= 0 )
159 {
160 std::u16string_view aToken = o3tl::trim(o3tl::getToken(aBlockIds, 0, ' ', nIndex ));
161 if( !aToken.empty() )
163 }
164 }
165 break;
166 }
167 return nullptr;
168}
169
170ClientDataContext::ClientDataContext( ContextHandler2Helper const & rParent,
171 ClientData& rClientData, const AttributeList& rAttribs ) :
172 ContextHandler2( rParent ),
173 mrClientData( rClientData )
174{
175 mrClientData.mnObjType = rAttribs.getToken( XML_ObjectType, XML_TOKEN_INVALID );
176}
177
178ContextHandlerRef ClientDataContext::onCreateContext( sal_Int32 /*nElement*/, const AttributeList& /*rAttribs*/ )
179{
180 if( isRootElement() )
181 {
182 maElementText.clear();
183 return this;
184 }
185 return nullptr;
186}
187
188void ClientDataContext::onCharacters( const OUString& rChars )
189{
190 /* Empty but existing elements have special meaning, e.g. 'true'. Collect
191 existing text and convert it in onEndElement(). */
192 maElementText = rChars;
193}
194
196{
197 switch( getCurrentElement() )
198 {
199 case VMLX_TOKEN( Anchor ): mrClientData.maAnchor = maElementText; break;
200 case VMLX_TOKEN( FmlaMacro ): mrClientData.maFmlaMacro = maElementText; break;
201 case VMLX_TOKEN( FmlaPict ): mrClientData.maFmlaPict = maElementText; break;
202 case VMLX_TOKEN( FmlaLink ): mrClientData.maFmlaLink = maElementText; break;
203 case VMLX_TOKEN( FmlaRange ): mrClientData.maFmlaRange = maElementText; break;
204 case VMLX_TOKEN( FmlaGroup ): mrClientData.maFmlaGroup = maElementText; break;
205 case VMLX_TOKEN( TextHAlign ): mrClientData.mnTextHAlign = AttributeConversion::decodeToken( maElementText ); break;
206 case VMLX_TOKEN( TextVAlign ): mrClientData.mnTextVAlign = AttributeConversion::decodeToken( maElementText ); break;
207 case VMLX_TOKEN( Column ): mrClientData.mnCol = maElementText.toInt32(); break;
208 case VMLX_TOKEN( Row ): mrClientData.mnRow = maElementText.toInt32(); break;
209 case VMLX_TOKEN( Checked ): mrClientData.mnChecked = maElementText.toInt32(); break;
210 case VMLX_TOKEN( DropStyle ): mrClientData.mnDropStyle = AttributeConversion::decodeToken( maElementText ); break;
211 case VMLX_TOKEN( DropLines ): mrClientData.mnDropLines = maElementText.toInt32(); break;
212 case VMLX_TOKEN( Val ): mrClientData.mnVal = maElementText.toInt32(); break;
213 case VMLX_TOKEN( Min ): mrClientData.mnMin = maElementText.toInt32(); break;
214 case VMLX_TOKEN( Max ): mrClientData.mnMax = maElementText.toInt32(); break;
215 case VMLX_TOKEN( Inc ): mrClientData.mnInc = maElementText.toInt32(); break;
216 case VMLX_TOKEN( Page ): mrClientData.mnPage = maElementText.toInt32(); break;
217 case VMLX_TOKEN( SelType ): mrClientData.mnSelType = AttributeConversion::decodeToken( maElementText ); break;
218 case VMLX_TOKEN( VTEdit ): mrClientData.mnVTEdit = maElementText.toInt32(); break;
219 case VMLX_TOKEN( PrintObject ): mrClientData.mbPrintObject = lclDecodeVmlxBool( maElementText, true ); break;
220 case VMLX_TOKEN( Visible ): mrClientData.mbVisible = lclDecodeVmlxBool( maElementText, true ); break;
221 case VMLX_TOKEN( DDE ): mrClientData.mbDde = lclDecodeVmlxBool( maElementText, true ); break;
222 case VMLX_TOKEN( NoThreeD ): mrClientData.mbNo3D = lclDecodeVmlxBool( maElementText, true ); break;
223 case VMLX_TOKEN( NoThreeD2 ): mrClientData.mbNo3D2 = lclDecodeVmlxBool( maElementText, true ); break;
224 case VMLX_TOKEN( MultiLine ): mrClientData.mbMultiLine = lclDecodeVmlxBool( maElementText, true ); break;
225 case VMLX_TOKEN( VScroll ): mrClientData.mbVScroll = lclDecodeVmlxBool( maElementText, true ); break;
226 case VMLX_TOKEN( SecretEdit ): mrClientData.mbSecretEdit = lclDecodeVmlxBool( maElementText, true ); break;
227 }
228}
229
230ShapeContextBase::ShapeContextBase( ContextHandler2Helper const & rParent ) :
231 ContextHandler2( rParent )
232{
233}
234
235ContextHandlerRef ShapeContextBase::createShapeContext( ContextHandler2Helper const & rParent,
236 ShapeContainer& rShapes, sal_Int32 nElement, const AttributeList& rAttribs )
237{
238 switch( nElement )
239 {
240 case O_TOKEN( shapelayout ):
241 return new ShapeLayoutContext( rParent, rShapes.getDrawing() );
242
243 case VML_TOKEN( shapetype ):
244 return new ShapeTypeContext( rParent, rShapes.createShapeType(), rAttribs );
245 case VML_TOKEN( group ):
246 return new GroupShapeContext( rParent, rShapes.createShape< GroupShape >(), rAttribs );
247 case VML_TOKEN( shape ):
248 if (rAttribs.hasAttribute(XML_path) &&
249 // tdf#122563 skip in the case of empty path
250 !rAttribs.getStringDefaulted(XML_path).isEmpty())
251 return new ShapeContext( rParent, rShapes.createShape< BezierShape >(), rAttribs );
252 else
253 return new ShapeContext( rParent, rShapes.createShape< ComplexShape >(), rAttribs );
254 case VML_TOKEN( rect ):
255 return new RectangleShapeContext( rParent, rAttribs, rShapes.createShape< RectangleShape >() );
256 case VML_TOKEN( roundrect ):
257 return new ShapeContext( rParent, rShapes.createShape< RectangleShape >(), rAttribs );
258 case VML_TOKEN( oval ):
259 return new ShapeContext( rParent, rShapes.createShape< EllipseShape >(), rAttribs );
260 case VML_TOKEN( polyline ):
261 return new ShapeContext( rParent, rShapes.createShape< PolyLineShape >(), rAttribs );
262 case VML_TOKEN( line ):
263 return new ShapeContext( rParent, rShapes.createShape< LineShape >(), rAttribs );
264 case VML_TOKEN( curve ):
265 return new ShapeContext( rParent, rShapes.createShape< BezierShape >(), rAttribs );
266
267 // TODO:
268 case VML_TOKEN( arc ):
269 case VML_TOKEN( diagram ):
270 case VML_TOKEN( image ):
271 return new ShapeContext( rParent, rShapes.createShape< ComplexShape >(), rAttribs );
272
273 case W_TOKEN(control):
274 return new ControlShapeContext( rParent, rShapes, rAttribs );
275 }
276 return nullptr;
277}
278
279ShapeTypeContext::ShapeTypeContext(ContextHandler2Helper const & rParent,
280 std::shared_ptr<ShapeType> const& pShapeType,
281 const AttributeList& rAttribs)
282 : ShapeContextBase(rParent)
283 , m_pShapeType(pShapeType) // tdf#112311 keep it alive
284 , mrTypeModel( pShapeType->getTypeModel() )
285{
286 // shape identifier and shape name
287 bool bHasOspid = rAttribs.hasAttribute( O_TOKEN( spid ) );
288 mrTypeModel.maShapeId = rAttribs.getXString( bHasOspid ? O_TOKEN( spid ) : XML_id, OUString() );
289 mrTypeModel.maLegacyId = rAttribs.getStringDefaulted( XML_id);
290 OSL_ENSURE( !mrTypeModel.maShapeId.isEmpty(), "ShapeTypeContext::ShapeTypeContext - missing shape identifier" );
291 // builtin shape type identifier
292 mrTypeModel.moShapeType = rAttribs.getInteger( O_TOKEN( spt ) );
293 // if the o:spid attribute exists, the id attribute contains the user-defined shape name
294 if( bHasOspid )
295 {
296 mrTypeModel.maShapeName = rAttribs.getXString( XML_id, OUString() );
297 // get ShapeType and ShapeId from name for compatibility
298 static constexpr OUStringLiteral sShapeTypePrefix = u"shapetype_";
299 OUString tmp;
300 if( mrTypeModel.maShapeName.startsWith( sShapeTypePrefix ) )
301 {
303 mrTypeModel.moShapeType = o3tl::toInt32(mrTypeModel.maShapeName.subView(sShapeTypePrefix.getLength()));
304 }
305 else if (mrTypeModel.maShapeName.startsWith("_x0000_t", &tmp))
306 {
308 mrTypeModel.moShapeType = tmp.toInt32();
309 }
310 }
311
312 // coordinate system position/size, CSS style
313 mrTypeModel.moCoordPos = lclDecodeInt32Pair( rAttribs, XML_coordorigin );
314 mrTypeModel.moCoordSize = lclDecodeInt32Pair( rAttribs, XML_coordsize );
315 setStyle( rAttribs.getStringDefaulted( XML_style) );
316 if( lclDecodeBool( rAttribs, O_TOKEN( hr )).value_or( false ))
317 { // MSO's handling of o:hr width is nowhere near what the spec says:
318 // - o:hrpct is not in % but in 0.1%
319 // - if o:hrpct is not given, 100% width is assumed
320 // - given width is used only if explicit o:hrpct="0" is given
321 OUString hrpct = rAttribs.getString( O_TOKEN( hrpct ), "1000" );
322 if( hrpct != "0" )
323 mrTypeModel.maWidthPercent = OUString::number( hrpct.toInt32() );
326 mrTypeModel.maPositionHorizontal = rAttribs.getString( O_TOKEN( hralign ), "left" );
327 mrTypeModel.moWrapType = "topAndBottom";
328 }
329
330 // stroke settings (may be overridden by v:stroke element later)
331 mrTypeModel.maStrokeModel.moStroked = lclDecodeBool( rAttribs, XML_stroked );
332 mrTypeModel.maStrokeModel.moColor = rAttribs.getString( XML_strokecolor );
333 mrTypeModel.maStrokeModel.moWeight = rAttribs.getString( XML_strokeweight );
334
335 // fill settings (may be overridden by v:fill element later)
336 mrTypeModel.maFillModel.moFilled = lclDecodeBool( rAttribs, XML_filled );
337 mrTypeModel.maFillModel.moColor = rAttribs.getString( XML_fillcolor );
338
339 // For roundrect we may have an arcsize attribute to read
340 mrTypeModel.maArcsize = rAttribs.getStringDefaulted(XML_arcsize);
341 // editas
342 mrTypeModel.maEditAs = rAttribs.getStringDefaulted(XML_editas);
343
344 mrTypeModel.maAdjustments = rAttribs.getStringDefaulted(XML_adj);
345}
346
348{
349 if( isRootElement() ) switch( nElement )
350 {
351 case VML_TOKEN( stroke ):
352 assignIfUsed( mrTypeModel.maStrokeModel.moStroked, lclDecodeBool( rAttribs, XML_on ) );
353 mrTypeModel.maStrokeModel.maStartArrow.moArrowType = rAttribs.getToken( XML_startarrow );
354 mrTypeModel.maStrokeModel.maStartArrow.moArrowWidth = rAttribs.getToken( XML_startarrowwidth );
355 mrTypeModel.maStrokeModel.maStartArrow.moArrowLength = rAttribs.getToken( XML_startarrowlength );
356 mrTypeModel.maStrokeModel.maEndArrow.moArrowType = rAttribs.getToken( XML_endarrow );
357 mrTypeModel.maStrokeModel.maEndArrow.moArrowWidth = rAttribs.getToken( XML_endarrowwidth );
358 mrTypeModel.maStrokeModel.maEndArrow.moArrowLength = rAttribs.getToken( XML_endarrowlength );
359 assignIfUsed( mrTypeModel.maStrokeModel.moColor, rAttribs.getString( XML_color ) );
360 mrTypeModel.maStrokeModel.moOpacity = lclDecodeOpacity( rAttribs, XML_opacity, 1.0 );
361 assignIfUsed( mrTypeModel.maStrokeModel.moWeight, rAttribs.getString( XML_weight ) );
362 mrTypeModel.maStrokeModel.moDashStyle = rAttribs.getString( XML_dashstyle );
363 mrTypeModel.maStrokeModel.moLineStyle = rAttribs.getToken( XML_linestyle );
364 mrTypeModel.maStrokeModel.moEndCap = rAttribs.getToken( XML_endcap );
365 mrTypeModel.maStrokeModel.moJoinStyle = rAttribs.getToken( XML_joinstyle );
366 break;
367 case VML_TOKEN( fill ):
368 {
369 // in DOCX shapes use r:id for the relationship id
370 // in XLSX they use o:relid
371 bool bHasORelId = rAttribs.hasAttribute( O_TOKEN(relid) );
372 assignIfUsed( mrTypeModel.maFillModel.moFilled, lclDecodeBool( rAttribs, XML_on ) );
373 assignIfUsed( mrTypeModel.maFillModel.moColor, rAttribs.getString( XML_color ) );
374 mrTypeModel.maFillModel.moOpacity = lclDecodeOpacity( rAttribs, XML_opacity, 1.0 );
375 mrTypeModel.maFillModel.moColor2 = rAttribs.getString( XML_color2 );
376 mrTypeModel.maFillModel.moOpacity2 = lclDecodeOpacity( rAttribs, XML_opacity2, 1.0 );
378 mrTypeModel.maFillModel.moAngle = rAttribs.getInteger( XML_angle );
379 mrTypeModel.maFillModel.moFocus = lclDecodePercent( rAttribs, XML_focus, 0.0 );
380 mrTypeModel.maFillModel.moFocusPos = lclDecodePercentPair( rAttribs, XML_focusposition );
381 mrTypeModel.maFillModel.moFocusSize = lclDecodePercentPair( rAttribs, XML_focussize );
382 mrTypeModel.maFillModel.moBitmapPath = decodeFragmentPath( rAttribs, bHasORelId ? O_TOKEN(relid) : R_TOKEN(id) );
383 mrTypeModel.maFillModel.moRotate = lclDecodeBool( rAttribs, XML_rotate );
384 break;
385 }
386 case VML_TOKEN( imagedata ):
387 {
388 // shapes in docx use r:id for the relationship id
389 // in xlsx it they use o:relid
390 bool bHasORelId = rAttribs.hasAttribute( O_TOKEN( relid ) );
391 mrTypeModel.moGraphicPath = decodeFragmentPath( rAttribs, bHasORelId ? O_TOKEN( relid ) : R_TOKEN( id ) );
392 mrTypeModel.moGraphicTitle = rAttribs.getString( O_TOKEN( title ) );
393
394 // Get crop attributes.
395 mrTypeModel.moCropBottom = rAttribs.getString(XML_cropbottom);
396 mrTypeModel.moCropLeft = rAttribs.getString(XML_cropleft);
397 mrTypeModel.moCropRight = rAttribs.getString(XML_cropright);
398 mrTypeModel.moCropTop = rAttribs.getString(XML_croptop);
399
400 // Gain / contrast.
401 std::optional<OUString> oGain = rAttribs.getString(XML_gain);
402 sal_Int32 nGain = 0x10000;
403 if (oGain.has_value() && oGain.value().endsWith("f"))
404 {
405 nGain = oGain.value().toInt32();
406 }
407 if (nGain < 0x10000)
408 {
409 nGain *= 101; // 100 + 1 to round
410 nGain /= 0x10000;
411 nGain -= 100;
412 }
413 mrTypeModel.mnGain = nGain;
414
415 // Blacklevel / brightness.
416 std::optional<OUString> oBlacklevel = rAttribs.getString(XML_blacklevel);
417 sal_Int16 nBlacklevel = 0;
418 if (oBlacklevel.has_value() && oBlacklevel.value().endsWith("f"))
419 {
420 nBlacklevel = oBlacklevel.value().toInt32();
421 }
422 if (nBlacklevel != 0)
423 {
424 nBlacklevel /= 327;
425 }
426 mrTypeModel.mnBlacklevel = nBlacklevel;
427 }
428 break;
429 case NMSP_vmlWord | XML_wrap:
430 mrTypeModel.moWrapAnchorX = rAttribs.getString(XML_anchorx);
431 mrTypeModel.moWrapAnchorY = rAttribs.getString(XML_anchory);
433 mrTypeModel.moWrapSide = rAttribs.getString(XML_side);
434 break;
435 case VML_TOKEN( shadow ):
436 {
438 mrTypeModel.maShadowModel.moShadowOn = lclDecodeBool(rAttribs, XML_on).value_or(false);
441 mrTypeModel.maShadowModel.moOpacity = lclDecodePercent(rAttribs, XML_opacity, 1.0);
442 }
443 break;
444 case VML_TOKEN( textpath ):
447 assignIfUsed(mrTypeModel.maTextpathModel.moTrim, lclDecodeBool(rAttribs, XML_trim));
448 break;
449 }
450 return nullptr;
451}
452
453std::optional< OUString > ShapeTypeContext::decodeFragmentPath( const AttributeList& rAttribs, sal_Int32 nToken ) const
454{
455 std::optional< OUString > oFragmentPath;
456 std::optional< OUString > oRelId = rAttribs.getString( nToken );
457 if( oRelId.has_value() )
458 oFragmentPath = getFragmentPathFromRelId( oRelId.value() );
459 return oFragmentPath;
460}
461
462void ShapeTypeContext::setStyle( std::u16string_view rStyle )
463{
464 sal_Int32 nIndex = 0;
465 while( nIndex >= 0 )
466 {
467 std::u16string_view aName, aValue;
468 if( ConversionHelper::separatePair( aName, aValue, o3tl::getToken(rStyle, 0, ';', nIndex ), ':' ) )
469 {
470 if( aName == u"position" ) mrTypeModel.maPosition = aValue;
471 else if( aName == u"z-index" ) mrTypeModel.maZIndex = aValue;
472 else if( aName == u"left" ) mrTypeModel.maLeft = aValue;
473 else if( aName == u"top" ) mrTypeModel.maTop = aValue;
474 else if( aName == u"width" ) mrTypeModel.maWidth = aValue;
475 else if( aName == u"height" ) mrTypeModel.maHeight = aValue;
476 else if( aName == u"margin-left" ) mrTypeModel.maMarginLeft = aValue;
477 else if( aName == u"margin-top" ) mrTypeModel.maMarginTop = aValue;
478 else if( aName == u"mso-position-vertical-relative" ) mrTypeModel.maPositionVerticalRelative = aValue;
479 else if( aName == u"mso-position-horizontal-relative" ) mrTypeModel.maPositionHorizontalRelative = aValue;
480 else if( aName == u"mso-position-horizontal" ) mrTypeModel.maPositionHorizontal = aValue;
481 else if( aName == u"mso-position-vertical" ) mrTypeModel.maPositionVertical = aValue;
482 else if( aName == u"mso-width-percent" ) mrTypeModel.maWidthPercent = aValue;
483 else if( aName == u"mso-width-relative" ) mrTypeModel.maWidthRelative = aValue;
484 else if( aName == u"mso-height-percent" ) mrTypeModel.maHeightPercent = aValue;
485 else if( aName == u"mso-height-relative" ) mrTypeModel.maHeightRelative = aValue;
486 else if( aName == u"mso-fit-shape-to-text" ) mrTypeModel.mbAutoHeight = true;
487 else if( aName == u"rotation" ) mrTypeModel.maRotation = aValue;
488 else if( aName == u"flip" ) mrTypeModel.maFlip = aValue;
489 else if( aName == u"visibility" )
490 mrTypeModel.mbVisible = aValue != u"hidden";
491 else if( aName == u"mso-wrap-style" ) mrTypeModel.maWrapStyle = aValue;
492 else if ( aName == u"v-text-anchor" ) mrTypeModel.maVTextAnchor = aValue;
493 else if ( aName == u"mso-wrap-distance-left" ) mrTypeModel.maWrapDistanceLeft = aValue;
494 else if ( aName == u"mso-wrap-distance-right" ) mrTypeModel.maWrapDistanceRight = aValue;
495 else if ( aName == u"mso-wrap-distance-top" ) mrTypeModel.maWrapDistanceTop = aValue;
496 else if ( aName == u"mso-wrap-distance-bottom" ) mrTypeModel.maWrapDistanceBottom = aValue;
497 }
498 }
499}
500
501ShapeContext::ShapeContext(ContextHandler2Helper const& rParent,
502 const std::shared_ptr<ShapeBase>& pShape, const AttributeList& rAttribs)
503 : ShapeTypeContext(rParent, pShape, rAttribs)
504 , mrShape(*pShape)
505 , mrShapeModel(pShape->getShapeModel())
506{
507 // collect shape specific attributes
508 mrShapeModel.maType = rAttribs.getXString( XML_type, OUString() );
509 // polyline path
510 setPoints( rAttribs.getStringDefaulted( XML_points) );
511 // line start and end positions
512 setFrom(rAttribs.getStringDefaulted(XML_from));
513 setTo(rAttribs.getStringDefaulted(XML_to));
514 setControl1(rAttribs.getStringDefaulted(XML_control1));
515 setControl2(rAttribs.getStringDefaulted(XML_control2));
516 setVmlPath(rAttribs.getStringDefaulted(XML_path));
517 setHyperlink(rAttribs.getStringDefaulted(XML_href));
518}
519
521{
522 // Excel specific shape client data
523 if( isRootElement() ) switch( nElement )
524 {
525 case VML_TOKEN( textbox ):
526 {
527 // Calculate the shape type: map both <rect> and <v:shape> with a textbox shape type to
528 // a TextShape.
529 sal_Int32 nShapeType = 0;
530 if (ShapeContainer* pShapeContainer = mrShape.getContainer())
531 {
532 OUString aType = mrShapeModel.maType;
533 if (!aType.isEmpty() && aType[0] == '#')
534 {
535 aType = aType.copy(1);
536 }
537 if (const ShapeType* pShapeType = pShapeContainer->getShapeTypeById(aType))
538 {
539 nShapeType = pShapeType->getTypeModel().moShapeType.value();
540 }
541 }
542 mrShapeModel.mbInGroup = (getParentElement() == VML_TOKEN(group));
543
544 // FIXME: the shape with textbox should be used for the next cases
545 if (getCurrentElement() == VML_TOKEN(rect) || nShapeType == ESCHER_ShpInst_TextBox)
546 {
548 // FIXME: without this a text will be added into the group-shape instead of its
549 // parent shape
550 dynamic_cast<SimpleShape&>(mrShape).setService("com.sun.star.drawing.TextShape");
551 else
552 // FIXME: without this we does not handle some properties like shadow
553 dynamic_cast<SimpleShape&>(mrShape).setService("com.sun.star.text.TextFrame");
554 }
555 return new TextBoxContext( *this, mrShapeModel.createTextBox(mrShape.getTypeModel()), rAttribs,
557 }
558 case VMLX_TOKEN( ClientData ):
559 // tdf#41466 ActiveX control shapes with a textbox are transformed into a frame
560 // (see unit test testActiveXOptionButtonGroup)
561 dynamic_cast<SimpleShape&>(mrShape).setService("com.sun.star.text.TextFrame");
562 return new ClientDataContext( *this, mrShapeModel.createClientData(), rAttribs );
563 case VMLPPT_TOKEN( textdata ):
564 // Force RectangleShape, this is ugly :(
565 // and is there because of the lines above which change it to TextFrame
566 dynamic_cast< SimpleShape& >( mrShape ).setService(
567 "com.sun.star.drawing.RectangleShape");
569 break;
570 case O_TOKEN( signatureline ):
574 = rAttribs.getStringDefaulted(O_TOKEN(suggestedsigner));
576 = rAttribs.getStringDefaulted(O_TOKEN(suggestedsigner2));
578 = rAttribs.getStringDefaulted(O_TOKEN(suggestedsigneremail));
580 = rAttribs.getStringDefaulted(O_TOKEN(signinginstructions));
582 rAttribs.getString(XML_showsigndate, "t")); // default is true
584 rAttribs.getString(XML_allowcomments, "f")); // default is false
585 break;
586 case O_TOKEN( lock ):
587 // TODO
588 break;
589 }
590 // handle remaining stuff in base class
591 return ShapeTypeContext::onCreateContext( nElement, rAttribs );
592}
593
594void ShapeContext::setPoints(std::u16string_view rPoints)
595{
596 mrShapeModel.maPoints.clear();
597 sal_Int32 nIndex = 0;
598
599 while (nIndex >= 0)
600 {
603 0, true, true);
606 0, false, true);
607 mrShapeModel.maPoints.emplace_back(nX, nY);
608 }
609 // VML polyline has no size in its style attribute. Word writes the size to attribute
610 // coordsize with values in twip but without unit. For others we get size from points.
611 if (!mrShape.getTypeModel().maWidth.isEmpty() || !mrShape.getTypeModel().maHeight.isEmpty())
612 return;
613
614 if (mrShape.getTypeModel().moCoordSize.has_value())
615 {
616 double fWidth = mrShape.getTypeModel().moCoordSize.value().first;
618 double fHeight = mrShape.getTypeModel().moCoordSize.value().second;
620 mrShape.getTypeModel().maWidth = OUString::number(fWidth) + "pt";
621 mrShape.getTypeModel().maHeight = OUString::number(fHeight) + "pt";
622 }
623 else if (mrShapeModel.maPoints.size())
624 {
625 double fMinX = mrShapeModel.maPoints[0].X;
626 double fMaxX = mrShapeModel.maPoints[0].X;
627 double fMinY = mrShapeModel.maPoints[0].Y;
628 double fMaxY = mrShapeModel.maPoints[0].Y;
629 for (const auto& rPoint : mrShapeModel.maPoints)
630 {
631 if (rPoint.X < fMinX)
632 fMinX = rPoint.X;
633 else if (rPoint.X > fMaxX)
634 fMaxX = rPoint.X;
635 if (rPoint.Y < fMinY)
636 fMinY = rPoint.Y;
637 else if (rPoint.Y > fMaxY)
638 fMaxY = rPoint.Y;
639 }
641 = OUString::number(
643 + "pt";
645 = OUString::number(
647 + "pt";
648 // Set moCoordSize, otherwise default (1000,1000) is used.
650 Int32Pair(basegfx::fround(fMaxX - fMinX), basegfx::fround(fMaxY - fMinY));
651 }
652}
653
654void ShapeContext::setFrom( const OUString& rPoints )
655{
656 if (!rPoints.isEmpty())
657 mrShapeModel.maFrom = rPoints;
658}
659
660void ShapeContext::setTo( const OUString& rPoints )
661{
662 if (!rPoints.isEmpty())
663 mrShapeModel.maTo = rPoints;
664}
665
666void ShapeContext::setControl1( const OUString& rPoints )
667{
668 if (!rPoints.isEmpty())
669 mrShapeModel.maControl1 = rPoints;
670}
671
672void ShapeContext::setControl2( const OUString& rPoints )
673{
674 if (!rPoints.isEmpty())
675 mrShapeModel.maControl2 = rPoints;
676}
677void ShapeContext::setVmlPath( const OUString& rPath )
678{
679 if (!rPath.isEmpty())
680 mrShapeModel.maVmlPath = rPath;
681}
682
683void ShapeContext::setHyperlink( const OUString& rHyperlink )
684{
685 if (!rHyperlink.isEmpty())
686 mrShapeModel.maHyperlink = rHyperlink;
687}
688
689GroupShapeContext::GroupShapeContext(ContextHandler2Helper const& rParent,
690 const std::shared_ptr<GroupShape>& pShape,
691 const AttributeList& rAttribs)
692 : ShapeContext(rParent, pShape, rAttribs)
693 , mrShapes(pShape->getChildren())
694{
695}
696
698{
699 // try to create a context of an embedded shape
700 ContextHandlerRef xContext = createShapeContext( *this, mrShapes, nElement, rAttribs );
701 // handle remaining stuff of this shape in base class
702 return xContext ? xContext : ShapeContext::onCreateContext( nElement, rAttribs );
703}
704
705RectangleShapeContext::RectangleShapeContext(ContextHandler2Helper const& rParent,
706 const AttributeList& rAttribs,
707 const std::shared_ptr<RectangleShape>& pShape)
708 : ShapeContext(rParent, pShape, rAttribs)
709{
710}
711
713{
714 // The parent class's context is fine
715 return ShapeContext::onCreateContext( nElement, rAttribs );
716}
717
718ControlShapeContext::ControlShapeContext( ::oox::core::ContextHandler2Helper const & rParent, ShapeContainer& rShapes, const AttributeList& rAttribs )
719 : ShapeContextBase (rParent)
720{
722 aInfo.maShapeId = rAttribs.getXString( W_TOKEN( shapeid ), OUString() );
723 aInfo.maFragmentPath = getFragmentPathFromRelId(rAttribs.getStringDefaulted( R_TOKEN(id)));
724 aInfo.maName = rAttribs.getStringDefaulted( W_TOKEN( name ));
725 aInfo.mbTextContentShape = true;
726 rShapes.getDrawing().registerControl(aInfo);
727}
728
729} // namespace oox
730
731/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
struct _ADOColumn Column
static sal_Int32 decodeToken(std::u16string_view rValue)
Returns the XML token identifier from the passed string.
Provides access to attribute values of an element.
OUString getStringDefaulted(sal_Int32 nAttrToken) const
Returns the string value of the specified attribute, returns an empty string if attribute not present...
bool hasAttribute(sal_Int32 nAttrToken) const
Returns true, if the specified attribute is present.
std::optional< OUString > getXString(sal_Int32 nAttrToken) const
Returns the string value of the specified attribute.
std::optional< sal_Int32 > getInteger(sal_Int32 nAttrToken) const
Returns the 32-bit signed integer value of the specified attribute (decimal).
std::optional< OUString > getString(sal_Int32 nAttrToken) const
Returns the string value of the specified attribute.
std::optional< sal_Int32 > getToken(sal_Int32 nAttrToken) const
Returns the token identifier of the value of the specified attribute.
OUString getFragmentPathFromRelId(const OUString &rRelId) const
Returns the full fragment path for the passed relation identifier.
GraphicHelper & getGraphicHelper() const
Returns a helper for the handling of graphics and graphic objects.
Definition: filterbase.cxx:346
Bezier shape object that supports to, from, control1 and control2 attribute or path attribute specifi...
Definition: vmlshape.hxx:396
virtual ::oox::core::ContextHandlerRef onCreateContext(sal_Int32 nElement, const AttributeList &rAttribs) override
virtual void onCharacters(const OUString &rChars) override
ClientDataContext(::oox::core::ContextHandler2Helper const &rParent, ClientData &rClientData, const AttributeList &rAttribs)
virtual void onEndElement() override
A complex shape object.
Definition: vmlshape.hxx:427
ControlShapeContext(::oox::core::ContextHandler2Helper const &rParent, ShapeContainer &rShapes, const AttributeList &rAttribs)
Represents the collection of VML shapes for a complete draw page.
Definition: vmldrawing.hxx:94
::oox::core::XmlFilterBase & getFilter() const
Returns the filter object that imports/exports this VML drawing.
Definition: vmldrawing.hxx:104
void registerControl(const ControlInfo &rControl)
Registers the passed embedded form control.
Definition: vmldrawing.cxx:135
void registerBlockId(sal_Int32 nBlockId)
Registers a block of shape identifiers reserved by this drawing.
Definition: vmldrawing.cxx:116
An oval shape object.
Definition: vmlshape.hxx:355
virtual ::oox::core::ContextHandlerRef onCreateContext(sal_Int32 nElement, const AttributeList &rAttribs) override
GroupShapeContext(::oox::core::ContextHandler2Helper const &rParent, const std::shared_ptr< GroupShape > &pShape, const AttributeList &rAttribs)
A group shape that extends the basic shape by a container of child shapes.
Definition: vmlshape.hxx:442
A Line shape object.
Definition: vmlshape.hxx:377
A polygon shape object.
Definition: vmlshape.hxx:363
virtual ::oox::core::ContextHandlerRef onCreateContext(sal_Int32 nElement, const AttributeList &rAttribs) override
RectangleShapeContext(::oox::core::ContextHandler2Helper const &rParent, const AttributeList &rAttribs, const std::shared_ptr< RectangleShape > &pShape)
A rectangular shape object.
Definition: vmlshape.hxx:341
ShapeContainer * getContainer() const
Definition: vmlshape.cxx:507
Container that holds a list of shapes and shape templates.
Drawing & getDrawing()
Returns the drawing this shape container is part of.
std::shared_ptr< ShapeType > createShapeType()
Creates and returns a new shape template object.
std::shared_ptr< ShapeT > createShape()
Creates and returns a new shape object of the specified type.
ShapeContextBase(::oox::core::ContextHandler2Helper const &rParent)
::oox::core::ContextHandlerRef createShapeContext(::oox::core::ContextHandler2Helper const &rParent, ShapeContainer &rShapes, sal_Int32 nElement, const AttributeList &rAttribs)
void setVmlPath(const OUString &rPath)
Processes the 'path' attribute.
ShapeContext(::oox::core::ContextHandler2Helper const &rParent, const std::shared_ptr< ShapeBase > &pShape, const AttributeList &rAttribs)
void setTo(const OUString &rPoints)
Processes the 'to' attribute.
void setControl1(const OUString &rPoints)
Processes the 'control1' attribute.
virtual ::oox::core::ContextHandlerRef onCreateContext(sal_Int32 nElement, const AttributeList &rAttribs) override
void setHyperlink(const OUString &rHyperlink)
Processes the 'href' attribute.
void setControl2(const OUString &rPoints)
Processes the 'control2' attribute.
void setPoints(std::u16string_view rPoints)
Processes the 'points' attribute.
void setFrom(const OUString &rPoints)
Processes the 'from' attribute.
virtual ::oox::core::ContextHandlerRef onCreateContext(sal_Int32 nElement, const AttributeList &rAttribs) override
ShapeLayoutContext(::oox::core::ContextHandler2Helper const &rParent, Drawing &rDrawing)
void setStyle(std::u16string_view rStyle)
Processes the 'style' attribute.
ShapeTypeContext(::oox::core::ContextHandler2Helper const &rParent, std::shared_ptr< ShapeType > const &pShapeType, const AttributeList &rAttribs)
std::optional< OUString > decodeFragmentPath(const AttributeList &rAttribs, sal_Int32 nToken) const
Resolve a relation identifier to a fragment path.
virtual ::oox::core::ContextHandlerRef onCreateContext(sal_Int32 nElement, const AttributeList &rAttribs) override
A shape template contains all formatting properties of shapes and can serve as templates for several ...
Definition: vmlshape.hxx:131
const Drawing & getDrawing() const
Definition: vmlshape.hxx:148
ShapeTypeModel & getTypeModel()
Returns read/write access to the shape template model structure.
Definition: vmlshape.hxx:137
A simple shape object based on a specific UNO shape service.
Definition: vmlshape.hxx:310
float u
#define ESCHER_ShpInst_TextBox
const char * name
sal_Int32 nIndex
OUString aName
B2IRange fround(const B2DRange &rRange)
std::shared_ptr< osl::Mutex > const & lock()
line
std::basic_string_view< charT, traits > trim(std::basic_string_view< charT, traits > str)
sal_Int32 toInt32(std::u16string_view str, sal_Int16 radix=10)
std::basic_string_view< charT, traits > getToken(std::basic_string_view< charT, traits > sv, charT delimiter, std::size_t &position)
constexpr Point convert(const Point &rPoint, o3tl::Length eFrom, o3tl::Length eTo)
::rtl::Reference< ContextHandler > ContextHandlerRef
OOX_DLLPUBLIC bool separatePair(std::u16string_view &orValue1, std::u16string_view &orValue2, std::u16string_view rValue, sal_Unicode cSep)
Returns two values contained in rValue separated by cSep.
OOX_DLLPUBLIC sal_Int32 decodeMeasureToTwip(const GraphicHelper &rGraphicHelper, std::u16string_view rValue, sal_Int32 nRefValue, bool bPixelX, bool bDefaultAsPixel)
Converts the passed VML measure string to Twip.
OOX_DLLPUBLIC double decodePercent(std::u16string_view rValue, double fDefValue)
Converts the passed VML percentage measure string to a normalized floating-point value.
OOX_DLLPUBLIC bool decodeBool(std::u16string_view rValue)
Returns the boolean value from the passed string of a VML attribute.
::std::pair< sal_Int32, sal_Int32 > Int32Pair
::std::pair< double, double > DoublePair
void assignIfUsed(std::optional< Type > &rDestValue, const std::optional< Type > &rSourceValue)
Definition: helper.hxx:174
group
Visible
XML_type
XML_TOKEN_INVALID
DefTokenId nToken
return hr
Excel specific shape client data (such as cell anchor).
Definition: vmlshape.hxx:168
bool mbDde
True = object is linked through DDE.
Definition: vmlshape.hxx:192
sal_Int32 mnCol
Column index for spreadsheet cell note.
Definition: vmlshape.hxx:178
sal_Int32 mnInc
Small increment of spin buttons and scroll bars.
Definition: vmlshape.hxx:186
sal_Int32 mnDropStyle
Drop down box style (read-only or editable).
Definition: vmlshape.hxx:181
bool mbVisible
True = cell note is visible.
Definition: vmlshape.hxx:191
OUString maFmlaLink
Link to value cell associated to the control.
Definition: vmlshape.hxx:172
sal_Int32 mnObjType
Type of the shape.
Definition: vmlshape.hxx:175
bool mbVScroll
True = textbox has a vertical scrollbar.
Definition: vmlshape.hxx:196
bool mbNo3D2
True = flat style, false = 3D style (listboxes and dropdowns).
Definition: vmlshape.hxx:194
OUString maFmlaPict
Target cell range of picture links.
Definition: vmlshape.hxx:171
sal_Int32 mnSelType
Listbox selection type.
Definition: vmlshape.hxx:188
bool mbNo3D
True = flat style, false = 3D style.
Definition: vmlshape.hxx:193
bool mbPrintObject
True = print the object.
Definition: vmlshape.hxx:190
sal_Int32 mnTextHAlign
Horizontal text alignment.
Definition: vmlshape.hxx:176
bool mbMultiLine
True = textbox allows line breaks.
Definition: vmlshape.hxx:195
OUString maFmlaRange
Link to cell range used as data source for the control.
Definition: vmlshape.hxx:173
sal_Int32 mnVTEdit
Data type of the textbox.
Definition: vmlshape.hxx:189
sal_Int32 mnTextVAlign
Vertical text alignment.
Definition: vmlshape.hxx:177
sal_Int32 mnMax
Maximum value of spin buttons and scroll bars.
Definition: vmlshape.hxx:185
sal_Int32 mnPage
Large increment of spin buttons and scroll bars.
Definition: vmlshape.hxx:187
sal_Int32 mnDropLines
Number of lines in drop down box.
Definition: vmlshape.hxx:182
sal_Int32 mnRow
Row index for spreadsheet cell note.
Definition: vmlshape.hxx:179
OUString maAnchor
Cell anchor as comma-separated string.
Definition: vmlshape.hxx:169
sal_Int32 mnVal
Current value of spin buttons and scroll bars.
Definition: vmlshape.hxx:183
bool mbSecretEdit
True = textbox is a password edit field.
Definition: vmlshape.hxx:197
sal_Int32 mnMin
Minimum value of spin buttons and scroll bars.
Definition: vmlshape.hxx:184
OUString maFmlaGroup
Link to value cell associated to a group of option buttons.
Definition: vmlshape.hxx:174
OUString maFmlaMacro
Link to macro associated to the control.
Definition: vmlshape.hxx:170
sal_Int32 mnChecked
State for checkboxes and option buttons.
Definition: vmlshape.hxx:180
Contains information about a form control embedded in a draw page.
Definition: vmldrawing.hxx:79
OUString maName
Programmatical name of the form control.
Definition: vmldrawing.hxx:82
bool mbTextContentShape
Whether this control shape will be imported to Writer or not (has AnchorType property or not).
Definition: vmldrawing.hxx:83
OUString maShapeId
Shape identifier for shape lookup.
Definition: vmldrawing.hxx:80
OUString maFragmentPath
Path to the fragment describing the form control properties.
Definition: vmldrawing.hxx:81
std::optional< DoublePair > moFocusSize
Rectangular gradient focus size of second color.
std::optional< double > moOpacity
Solid fill color opacity.
std::optional< OUString > moColor2
End color of gradient.
std::optional< bool > moRotate
True = rotate gradient/bitmap with shape.
std::optional< DoublePair > moFocusPos
Rectangular gradient focus position of second color.
std::optional< sal_Int32 > moType
Fill type.
std::optional< double > moFocus
Linear gradient focus of second color.
std::optional< bool > moFilled
Shape fill on/off.
std::optional< OUString > moBitmapPath
Path to fill bitmap fragment.
std::optional< double > moOpacity2
End color opacity of gradient.
std::optional< sal_Int32 > moAngle
Gradient rotation angle.
std::optional< OUString > moColor
Solid fill color.
bool mbHasShadow
Is a v:shadow element seen?
std::optional< double > moOpacity
Specifies the opacity of the shadow.
std::optional< OUString > moOffset
Specifies the shadow's offset from the shape's location.
std::optional< bool > moShadowOn
Is the element turned on?
std::optional< OUString > moColor
Specifies the color of the shadow.
OUString maSignatureLineSuggestedSignerTitle
Definition: vmlshape.hxx:220
TextBox & createTextBox(ShapeTypeModel &rModel)
Creates and returns a new shape textbox structure.
Definition: vmlshape.cxx:272
OUString maLegacyDiagramPath
Legacy Diagram Fragment Path.
Definition: vmlshape.hxx:211
OUString maSignatureLineSuggestedSignerName
Definition: vmlshape.hxx:219
PointVector maPoints
Points for the polyline shape.
Definition: vmlshape.hxx:208
OUString maHyperlink
The hyperlink assigned to the shape.
Definition: vmlshape.hxx:226
bool mbSignatureLineCanAddComment
Definition: vmlshape.hxx:224
OUString maControl2
Bezier control point 2.
Definition: vmlshape.hxx:215
OUString maVmlPath
VML path for this shape.
Definition: vmlshape.hxx:216
bool mbIsSignatureLine
Shape is a signature line.
Definition: vmlshape.hxx:217
OUString maType
Shape template with default properties.
Definition: vmlshape.hxx:207
bool mbSignatureLineShowSignDate
Definition: vmlshape.hxx:223
OUString maSignatureLineSuggestedSignerEmail
Definition: vmlshape.hxx:221
ClientData & createClientData()
Creates and returns a new shape client data structure.
Definition: vmlshape.cxx:278
OUString maControl1
Bezier control point 1.
Definition: vmlshape.hxx:214
OUString maTo
End point for line shape.
Definition: vmlshape.hxx:213
OUString maSignatureLineSigningInstructions
Definition: vmlshape.hxx:222
OUString maSignatureId
ID of the signature.
Definition: vmlshape.hxx:218
OUString maFrom
Start point for line shape.
Definition: vmlshape.hxx:212
OUString maHeightPercent
The height in percents of the HeightRelative.
Definition: vmlshape.hxx:82
OUString maWrapDistanceTop
Distance from the top of the shape to the text that wraps around it.
Definition: vmlshape.hxx:108
OUString maPosition
Position type of the shape.
Definition: vmlshape.hxx:69
OUString maShapeName
Name of the shape, if present.
Definition: vmlshape.hxx:64
OUString maFlip
Flip type of the shape (can be "x" or "y").
Definition: vmlshape.hxx:86
ShadowModel maShadowModel
Shape shadow formatting.
Definition: vmlshape.hxx:96
OUString maPositionVertical
The Y position orientation.
Definition: vmlshape.hxx:80
std::optional< Int32Pair > moCoordPos
Top-left position of coordinate system for children scaling.
Definition: vmlshape.hxx:67
OUString maHeightRelative
To what the height is relative.
Definition: vmlshape.hxx:84
std::optional< Int32Pair > moCoordSize
Size of coordinate system for children scaling.
Definition: vmlshape.hxx:68
FillModel maFillModel
Shape fill formatting.
Definition: vmlshape.hxx:95
OUString maTop
Y position of the shape bounding box (number with unit).
Definition: vmlshape.hxx:72
std::optional< OUString > moGraphicTitle
Title of the graphic.
Definition: vmlshape.hxx:100
OUString maWrapDistanceRight
Distance from the right side of the shape to the text that wraps around it.
Definition: vmlshape.hxx:107
bool mbVisible
Visible or Hidden.
Definition: vmlshape.hxx:88
OUString maEditAs
Edit As type (e.g. "canvas" etc)
Definition: vmlshape.hxx:91
OUString maWrapStyle
Wrapping mode for text.
Definition: vmlshape.hxx:89
std::optional< OUString > moGraphicPath
Path to a graphic for this shape.
Definition: vmlshape.hxx:99
std::optional< OUString > moCropLeft
Specifies how much to crop the image from the left in as a fraction of picture size.
Definition: vmlshape.hxx:111
std::optional< OUString > moCropTop
Specifies how much to crop the image from the top down as a fraction of picture size.
Definition: vmlshape.hxx:113
std::optional< OUString > moWrapAnchorY
The base object from which our vertical positioning should be calculated.
Definition: vmlshape.hxx:102
std::optional< OUString > moCropRight
Specifies how much to crop the image from the right in as a fraction of picture size.
Definition: vmlshape.hxx:112
OUString maRotation
Rotation of the shape, in degrees.
Definition: vmlshape.hxx:85
OUString maHeight
Height of the shape bounding box (number with unit).
Definition: vmlshape.hxx:74
OUString maAdjustments
Shape adjustment values.
Definition: vmlshape.hxx:92
sal_Int16 mnBlacklevel
The image brightness, on a 0..0x10000 scale.
Definition: vmlshape.hxx:120
bool mbAutoHeight
If true, the height value is a minimum value (mostly used for textboxes)
Definition: vmlshape.hxx:87
std::optional< OUString > moWrapType
How to wrap the text around the object.
Definition: vmlshape.hxx:103
OUString maShapeId
Unique identifier of the shape.
Definition: vmlshape.hxx:62
OUString maWidthPercent
The width in percents of the WidthRelative.
Definition: vmlshape.hxx:81
StrokeModel maStrokeModel
Border line formatting.
Definition: vmlshape.hxx:94
std::optional< OUString > moWrapAnchorX
The base object from which our horizontal positioning should be calculated.
Definition: vmlshape.hxx:101
OUString maPositionVerticalRelative
The Y position is relative to this.
Definition: vmlshape.hxx:78
OUString maWidth
Width of the shape bounding box (number with unit).
Definition: vmlshape.hxx:73
OUString maLeft
X position of the shape bounding box (number with unit).
Definition: vmlshape.hxx:71
OUString maMarginTop
Y position of the shape bounding box to shape anchor (number with unit).
Definition: vmlshape.hxx:76
std::optional< OUString > moWrapSide
On which side to wrap the text around the object.
Definition: vmlshape.hxx:104
OUString maPositionHorizontalRelative
The X position is relative to this.
Definition: vmlshape.hxx:77
OUString maArcsize
round rectangles arc size
Definition: vmlshape.hxx:90
OUString maZIndex
ZIndex of the shape.
Definition: vmlshape.hxx:70
std::optional< OUString > moCropBottom
Specifies the how much to crop the image from the bottom up as a fraction of picture size.
Definition: vmlshape.hxx:110
OUString maWidthRelative
To what the width is relative.
Definition: vmlshape.hxx:83
OUString maVTextAnchor
How the text inside the shape is anchored vertically.
Definition: vmlshape.hxx:105
OUString maLegacyId
Plaintext identifier of the shape.
Definition: vmlshape.hxx:63
OUString maPositionHorizontal
The X position orientation (default: absolute).
Definition: vmlshape.hxx:79
OUString maWrapDistanceBottom
Distance from the bottom of the shape to the text that wraps around it.
Definition: vmlshape.hxx:109
std::optional< sal_Int32 > moShapeType
Builtin shape type identifier.
Definition: vmlshape.hxx:65
OUString maMarginLeft
X position of the shape bounding box to shape anchor (number with unit).
Definition: vmlshape.hxx:75
OUString maWrapDistanceLeft
Distance from the left side of the shape to the text that wraps around it.
Definition: vmlshape.hxx:106
TextpathModel maTextpathModel
Shape textpath formatting.
Definition: vmlshape.hxx:97
sal_Int32 mnGain
An adjustment for the intensity of all colors, i.e. contrast, on a 0..0x10000 scale.
Definition: vmlshape.hxx:117
std::optional< sal_Int32 > moArrowWidth
std::optional< sal_Int32 > moArrowType
std::optional< sal_Int32 > moArrowLength
StrokeArrowModel maStartArrow
Start line arrow style.
StrokeArrowModel maEndArrow
End line arrow style.
std::optional< sal_Int32 > moLineStyle
Line style (single, double, ...).
std::optional< sal_Int32 > moEndCap
Type of line end cap.
std::optional< OUString > moColor
Solid line color.
std::optional< bool > moStroked
Shape border line on/off.
std::optional< OUString > moDashStyle
Line dash (predefined or manually).
std::optional< sal_Int32 > moJoinStyle
Type of line join.
std::optional< double > moOpacity
Solid line color opacity.
std::optional< OUString > moWeight
Line width.
std::optional< OUString > moStyle
Specifies the style of the textpath.
std::optional< bool > moTrim
Specifies whether extra space is removed above and below the text.
std::optional< OUString > moString
Specifies the string of the textpath.
Page
sal_Int32 nLength