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  setHyperlink( rAttribs.getString( XML_href, OUString() ) );
316  if( lclDecodeBool( rAttribs, O_TOKEN( hr )).get( 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.getString(XML_arcsize, OUString());
341  // editas
342  mrTypeModel.maEditAs = rAttribs.getString(XML_editas, OUString());
343 
344  mrTypeModel.maAdjustments = rAttribs.getString(XML_adj, OUString());
345 }
346 
348 {
349  if( isRootElement() ) switch( nElement )
350  {
351  case VML_TOKEN( stroke ):
352  mrTypeModel.maStrokeModel.moStroked.assignIfUsed( 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  mrTypeModel.maStrokeModel.moColor.assignIfUsed( rAttribs.getString( XML_color ) );
360  mrTypeModel.maStrokeModel.moOpacity = lclDecodeOpacity( rAttribs, XML_opacity, 1.0 );
361  mrTypeModel.maStrokeModel.moWeight.assignIfUsed( 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  mrTypeModel.maFillModel.moFilled.assignIfUsed( lclDecodeBool( rAttribs, XML_on ) );
373  mrTypeModel.maFillModel.moColor.assignIfUsed( 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 );
377  mrTypeModel.maFillModel.moType = rAttribs.getToken( XML_type );
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  break;
401  case NMSP_vmlWord | XML_wrap:
402  mrTypeModel.moWrapAnchorX = rAttribs.getString(XML_anchorx);
403  mrTypeModel.moWrapAnchorY = rAttribs.getString(XML_anchory);
404  mrTypeModel.moWrapType = rAttribs.getString(XML_type);
405  mrTypeModel.moWrapSide = rAttribs.getString(XML_side);
406  break;
407  case VML_TOKEN( shadow ):
408  {
410  mrTypeModel.maShadowModel.moShadowOn = lclDecodeBool(rAttribs, XML_on).get(false);
413  mrTypeModel.maShadowModel.moOpacity = lclDecodePercent(rAttribs, XML_opacity, 1.0);
414  }
415  break;
416  case VML_TOKEN( textpath ):
419  mrTypeModel.maTextpathModel.moTrim.assignIfUsed(lclDecodeBool(rAttribs, XML_trim));
420  break;
421  }
422  return nullptr;
423 }
424 
426 {
427  OptValue< OUString > oFragmentPath;
428  OptValue< OUString > oRelId = rAttribs.getString( nToken );
429  if( oRelId.has() )
430  oFragmentPath = getFragmentPathFromRelId( oRelId.get() );
431  return oFragmentPath;
432 }
433 
434 void ShapeTypeContext::setStyle( const OUString& rStyle )
435 {
436  sal_Int32 nIndex = 0;
437  while( nIndex >= 0 )
438  {
439  OUString aName, aValue;
440  if( ConversionHelper::separatePair( aName, aValue, rStyle.getToken( 0, ';', nIndex ), ':' ) )
441  {
442  if( aName == "position" ) mrTypeModel.maPosition = aValue;
443  else if( aName == "z-index" ) mrTypeModel.maZIndex = aValue;
444  else if( aName == "left" ) mrTypeModel.maLeft = aValue;
445  else if( aName == "top" ) mrTypeModel.maTop = aValue;
446  else if( aName == "width" ) mrTypeModel.maWidth = aValue;
447  else if( aName == "height" ) mrTypeModel.maHeight = aValue;
448  else if( aName == "margin-left" ) mrTypeModel.maMarginLeft = aValue;
449  else if( aName == "margin-top" ) mrTypeModel.maMarginTop = aValue;
450  else if( aName == "mso-position-vertical-relative" ) mrTypeModel.maPositionVerticalRelative = aValue;
451  else if( aName == "mso-position-horizontal-relative" ) mrTypeModel.maPositionHorizontalRelative = aValue;
452  else if( aName == "mso-position-horizontal" ) mrTypeModel.maPositionHorizontal = aValue;
453  else if( aName == "mso-position-vertical" ) mrTypeModel.maPositionVertical = aValue;
454  else if( aName == "mso-width-percent" ) mrTypeModel.maWidthPercent = aValue;
455  else if( aName == "mso-width-relative" ) mrTypeModel.maWidthRelative = aValue;
456  else if( aName == "mso-height-percent" ) mrTypeModel.maHeightPercent = aValue;
457  else if( aName == "mso-height-relative" ) mrTypeModel.maHeightRelative = aValue;
458  else if( aName == "mso-fit-shape-to-text" ) mrTypeModel.mbAutoHeight = true;
459  else if( aName == "rotation" ) mrTypeModel.maRotation = aValue;
460  else if( aName == "flip" ) mrTypeModel.maFlip = aValue;
461  else if( aName == "visibility" )
462  mrTypeModel.mbVisible = aValue != "hidden";
463  else if( aName == "mso-wrap-style" ) mrTypeModel.maWrapStyle = aValue;
464  else if ( aName == "v-text-anchor" ) mrTypeModel.maVTextAnchor = aValue;
465  else if ( aName == "mso-wrap-distance-left" ) mrTypeModel.maWrapDistanceLeft = aValue;
466  else if ( aName == "mso-wrap-distance-right" ) mrTypeModel.maWrapDistanceRight = aValue;
467  else if ( aName == "mso-wrap-distance-top" ) mrTypeModel.maWrapDistanceTop = aValue;
468  else if ( aName == "mso-wrap-distance-bottom" ) mrTypeModel.maWrapDistanceBottom = aValue;
469  }
470  }
471 }
472 
473 void ShapeTypeContext::setHyperlink( const OUString& rHyperlink )
474 {
475  mrTypeModel.maHyperlink = rHyperlink;
476 }
477 
478 ShapeContext::ShapeContext(ContextHandler2Helper const& rParent,
479  const std::shared_ptr<ShapeBase>& pShape, const AttributeList& rAttribs)
480  : ShapeTypeContext(rParent, pShape, rAttribs)
481  , mrShape(*pShape)
482  , mrShapeModel(pShape->getShapeModel())
483 {
484  // collect shape specific attributes
485  mrShapeModel.maType = rAttribs.getXString( XML_type, OUString() );
486  // polyline path
487  setPoints( rAttribs.getString( XML_points, OUString() ) );
488  // line start and end positions
489  setFrom(rAttribs.getString(XML_from, OUString()));
490  setTo(rAttribs.getString(XML_to, OUString()));
491  setControl1(rAttribs.getString(XML_control1, OUString()));
492  setControl2(rAttribs.getString(XML_control2, OUString()));
493  setVmlPath(rAttribs.getString(XML_path, OUString()));
494 }
495 
496 ContextHandlerRef ShapeContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
497 {
498  // Excel specific shape client data
499  if( isRootElement() ) switch( nElement )
500  {
501  case VML_TOKEN( textbox ):
502  {
503  // Calculate the shape type: map both <rect> and <v:shape> with a textbox shape type to
504  // a TextShape.
505  sal_Int32 nShapeType = 0;
506  if (ShapeContainer* pShapeContainer = mrShape.getContainer())
507  {
508  OUString aType = mrShapeModel.maType;
509  if (!aType.isEmpty() && aType[0] == '#')
510  {
511  aType = aType.copy(1);
512  }
513  if (const ShapeType* pShapeType = pShapeContainer->getShapeTypeById(aType))
514  {
515  nShapeType = pShapeType->getTypeModel().moShapeType.get();
516  }
517  }
518  mrShapeModel.mbInGroup = (getParentElement() == VML_TOKEN(group));
519 
520  // FIXME: the shape with textbox should be used for the next cases
521  if (getCurrentElement() == VML_TOKEN(rect) || nShapeType == ESCHER_ShpInst_TextBox)
522  {
524  // FIXME: without this a text will be added into the group-shape instead of its
525  // parent shape
526  dynamic_cast<SimpleShape&>(mrShape).setService("com.sun.star.drawing.TextShape");
527  else
528  // FIXME: without this we does not handle some properties like shadow
529  dynamic_cast<SimpleShape&>(mrShape).setService("com.sun.star.text.TextFrame");
530  }
531  return new TextBoxContext( *this, mrShapeModel.createTextBox(mrShape.getTypeModel()), rAttribs,
533  }
534  case VMLX_TOKEN( ClientData ):
535  // tdf#41466 ActiveX control shapes with a textbox are transformed into a frame
536  // (see unit test testActiveXOptionButtonGroup)
537  dynamic_cast<SimpleShape&>(mrShape).setService("com.sun.star.text.TextFrame");
538  return new ClientDataContext( *this, mrShapeModel.createClientData(), rAttribs );
539  case VMLPPT_TOKEN( textdata ):
540  // Force RectangleShape, this is ugly :(
541  // and is there because of the lines above which change it to TextFrame
542  dynamic_cast< SimpleShape& >( mrShape ).setService(
543  "com.sun.star.drawing.RectangleShape");
544  mrShapeModel.maLegacyDiagramPath = getFragmentPathFromRelId(rAttribs.getString(XML_id, OUString()));
545  break;
546  case O_TOKEN( signatureline ):
548  mrShapeModel.maSignatureId = rAttribs.getString(XML_id, OUString());
550  = rAttribs.getString(O_TOKEN(suggestedsigner), OUString());
552  = rAttribs.getString(O_TOKEN(suggestedsigner2), OUString());
554  = rAttribs.getString(O_TOKEN(suggestedsigneremail), OUString());
556  = rAttribs.getString(O_TOKEN(signinginstructions), OUString());
558  rAttribs.getString(XML_showsigndate, "t")); // default is true
560  rAttribs.getString(XML_allowcomments, "f")); // default is false
561  break;
562  case O_TOKEN( lock ):
563  // TODO
564  break;
565  }
566  // handle remaining stuff in base class
567  return ShapeTypeContext::onCreateContext( nElement, rAttribs );
568 }
569 
570 void ShapeContext::setPoints( const OUString& rPoints )
571 {
572  mrShapeModel.maPoints.clear();
573  sal_Int32 nIndex = 0;
574 
575  while( nIndex >= 0 )
576  {
577  sal_Int32 nX = rPoints.getToken( 0, ',', nIndex ).toInt32();
578  sal_Int32 nY = rPoints.getToken( 0, ',', nIndex ).toInt32();
579  mrShapeModel.maPoints.emplace_back( nX, nY );
580  }
581 }
582 
583 void ShapeContext::setFrom( const OUString& rPoints )
584 {
585  if (!rPoints.isEmpty())
586  mrShapeModel.maFrom = rPoints;
587 }
588 
589 void ShapeContext::setTo( const OUString& rPoints )
590 {
591  if (!rPoints.isEmpty())
592  mrShapeModel.maTo = rPoints;
593 }
594 
595 void ShapeContext::setControl1( const OUString& rPoints )
596 {
597  if (!rPoints.isEmpty())
598  mrShapeModel.maControl1 = rPoints;
599 }
600 
601 void ShapeContext::setControl2( const OUString& rPoints )
602 {
603  if (!rPoints.isEmpty())
604  mrShapeModel.maControl2 = rPoints;
605 }
606 void ShapeContext::setVmlPath( const OUString& rPath )
607 {
608  if (!rPath.isEmpty())
609  mrShapeModel.maVmlPath = rPath;
610 }
611 
612 GroupShapeContext::GroupShapeContext(ContextHandler2Helper const& rParent,
613  const std::shared_ptr<GroupShape>& pShape,
614  const AttributeList& rAttribs)
615  : ShapeContext(rParent, pShape, rAttribs)
616  , mrShapes(pShape->getChildren())
617 {
618 }
619 
621 {
622  // try to create a context of an embedded shape
623  ContextHandlerRef xContext = createShapeContext( *this, mrShapes, nElement, rAttribs );
624  // handle remaining stuff of this shape in base class
625  return xContext ? xContext : ShapeContext::onCreateContext( nElement, rAttribs );
626 }
627 
628 RectangleShapeContext::RectangleShapeContext(ContextHandler2Helper const& rParent,
629  const AttributeList& rAttribs,
630  const std::shared_ptr<RectangleShape>& pShape)
631  : ShapeContext(rParent, pShape, rAttribs)
632 {
633 }
634 
636 {
637  // The parent class's context is fine
638  return ShapeContext::onCreateContext( nElement, rAttribs );
639 }
640 
642  : ShapeContextBase (rParent)
643 {
645  aInfo.maShapeId = rAttribs.getXString( W_TOKEN( shapeid ), OUString() );
646  aInfo.maFragmentPath = getFragmentPathFromRelId(rAttribs.getString( R_TOKEN(id), OUString() ));
647  aInfo.maName = rAttribs.getString( W_TOKEN( name ), OUString() );
648  aInfo.mbTextContentShape = true;
649  rShapes.getDrawing().registerControl(aInfo);
650 }
651 
652 } // namespace oox
653 
654 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sal_Int32 mnCol
Column index for spreadsheet cell note.
Definition: vmlshape.hxx:173
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:179
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:188
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:177
ShapeContextBase(::oox::core::ContextHandler2Helper const &rParent)
OUString maSignatureId
ID of the signature.
Definition: vmlshape.hxx:213
bool mbDde
True = object is linked through DDE.
Definition: vmlshape.hxx:187
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:167
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:212
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:162
OptValue< double > moOpacity
Solid fill color opacity.
OUString maSignatureLineSuggestedSignerName
Definition: vmlshape.hxx:214
OUString maFmlaMacro
Link to macro associated to the control.
Definition: vmlshape.hxx:165
sal_Int32 toInt32(OUString const &rStr)
A shape template contains all formatting properties of shapes and can serve as templates for several ...
Definition: vmlshape.hxx:125
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:191
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:182
OUString maFmlaRange
Link to cell range used as data source for the control.
Definition: vmlshape.hxx:168
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:166
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:211
OUString maEditAs
Edit As type (e.g. "canvas" etc)
Definition: vmlshape.hxx:91
OUString maType
Shape template with default properties.
Definition: vmlshape.hxx:202
bool mbSecretEdit
True = textbox is a password edit field.
Definition: vmlshape.hxx:192
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
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:174
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:219
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:176
sal_Int32 mnVTEdit
Data type of the textbox.
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.
sal_Int32 mnMax
Maximum value of spin buttons and scroll bars.
Definition: vmlshape.hxx:180
StrokeModel maStrokeModel
Border line formatting.
Definition: vmlshape.hxx:94
bool mbVisible
True = cell note is visible.
Definition: vmlshape.hxx:186
OUString maHeightRelative
To what the height is relative.
Definition: vmlshape.hxx:84
OptValue< OUString > moBitmapPath
Path to fill bitmap fragment.
OUString maAnchor
Cell anchor as comma-separated string.
Definition: vmlshape.hxx:164
sal_Int32 mnSelType
Listbox selection type.
Definition: vmlshape.hxx:183
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:132
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:172
OptValue< DoublePair > moFocusPos
Rectangular gradient focus position of second color.
OUString maControl1
Bezier control point 1.
Definition: vmlshape.hxx:209
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:181
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
OUString maHyperlink
The hyperlink assigned to the shape.
Definition: vmlshape.hxx:115
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:206
bool mbMultiLine
True = textbox allows line breaks.
Definition: vmlshape.hxx:190
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:215
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.
XML_TOKEN_INVALID
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:218
bool mbNo3D2
True = flat style, false = 3D style (listboxes and dropdowns).
Definition: vmlshape.hxx:189
ShadowModel maShadowModel
Shape shadow formatting.
Definition: vmlshape.hxx:96
sal_Int32 mnChecked
State for checkboxes and option buttons.
Definition: vmlshape.hxx:175
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)
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:217
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:207
bool mbPrintObject
True = print the object.
Definition: vmlshape.hxx:185
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:210
sal_Int32 mnVal
Current value of spin buttons and scroll bars.
Definition: vmlshape.hxx:178
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
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:169
OUString maSignatureLineSuggestedSignerEmail
Definition: vmlshape.hxx:216
const char * name
void setHyperlink(const OUString &rHyperlink)
Processes the 'href' attribute.
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:171
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:208
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:170
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:143
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:203