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