LibreOffice Module sc (master)  1
drawingfragment.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 <drawingfragment.hxx>
21 
23 #include <com/sun/star/beans/PropertyValue.hpp>
24 #include <com/sun/star/beans/XPropertySet.hpp>
25 #include <com/sun/star/container/XIndexContainer.hpp>
26 #include <com/sun/star/container/XNameReplace.hpp>
27 #include <com/sun/star/document/XEventsSupplier.hpp>
28 #include <com/sun/star/drawing/XControlShape.hpp>
29 #include <com/sun/star/drawing/XDrawPage.hpp>
30 #include <com/sun/star/drawing/XShapes.hpp>
31 #include <com/sun/star/script/ScriptEventDescriptor.hpp>
32 #include <com/sun/star/script/XEventAttacherManager.hpp>
33 #include <rtl/strbuf.hxx>
34 #include <svx/svdobj.hxx>
35 #include <drwlayer.hxx>
36 #include <userdat.hxx>
37 #include <oox/core/filterbase.hxx>
42 #include <oox/token/namespaces.hxx>
43 #include <oox/token/properties.hxx>
44 #include <oox/token/tokens.hxx>
45 #include <oox/vml/vmlshape.hxx>
47 #include <formulaparser.hxx>
48 #include <stylesbuffer.hxx>
49 #include <themebuffer.hxx>
50 #include <unitconverter.hxx>
51 #include <worksheetbuffer.hxx>
52 namespace oox::xls {
53 
54 using namespace ::com::sun::star::beans;
55 using namespace ::com::sun::star::container;
56 using namespace ::com::sun::star::document;
57 using namespace ::com::sun::star::drawing;
58 using namespace ::com::sun::star::script;
59 using namespace ::com::sun::star::uno;
60 using namespace ::oox::core;
61 using namespace ::oox::drawingml;
62 using namespace ::oox::ole;
63 
64 using ::com::sun::star::awt::Size;
65 using ::com::sun::star::awt::Point;
66 using ::com::sun::star::awt::Rectangle;
67 using ::com::sun::star::awt::XControlModel;
68 // no using's for ::oox::vml, that may clash with ::oox::drawingml types
69 
70 ShapeMacroAttacher::ShapeMacroAttacher( const OUString& rMacroName, const Reference< XShape >& rxShape ) :
71  VbaMacroAttacherBase( rMacroName ),
72  mxShape( rxShape )
73 {
74 }
75 
76 void ShapeMacroAttacher::attachMacro( const OUString& rMacroUrl )
77 {
78  try
79  {
80  Reference< XEventsSupplier > xSupplier( mxShape, UNO_QUERY_THROW );
81  Reference< XNameReplace > xEvents( xSupplier->getEvents(), UNO_SET_THROW );
82  Sequence< PropertyValue > aEventProps( 2 );
83  aEventProps[ 0 ].Name = "EventType";
84  aEventProps[ 0 ].Value <<= OUString( "Script" );
85  aEventProps[ 1 ].Name = "Script";
86  aEventProps[ 1 ].Value <<= rMacroUrl;
87  xEvents->replaceByName( "OnClick", Any( aEventProps ) );
88  }
89  catch( Exception& )
90  {
91  }
92 }
93 
94 Shape::Shape( const WorksheetHelper& rHelper, const AttributeList& rAttribs, const char* pcServiceName ) :
95  ::oox::drawingml::Shape( pcServiceName ),
96  WorksheetHelper( rHelper )
97 {
98  OUString aMacro = rAttribs.getXString( XML_macro, OUString() );
99  if( !aMacro.isEmpty() )
101 }
102 
103 void Shape::finalizeXShape( XmlFilterBase& rFilter, const Reference< XShapes >& rxShapes )
104 {
105  OUString sURL;
106  getShapeProperties().getProperty( PROP_URL ) >>= sURL;
108  if( !maMacroName.isEmpty() && mxShape.is() )
109  {
110  VbaMacroAttacherRef xAttacher = std::make_shared<ShapeMacroAttacher>( maMacroName, mxShape );
112  }
113  ::oox::drawingml::Shape::finalizeXShape( rFilter, rxShapes );
114  if ( !sURL.isEmpty() )
115  {
117  if ( pObj )
118  {
119  if ( ScMacroInfo* pInfo = ScDrawLayer::GetMacroInfo( pObj, true ) )
120  pInfo->SetHlink( sURL );
121  }
122  }
123 }
124 
125 GroupShapeContext::GroupShapeContext( const FragmentHandler2& rParent,
126  const WorksheetHelper& rHelper, const ShapePtr& rxParentShape, const ShapePtr& rxShape ) :
127  ShapeGroupContext( rParent, rxParentShape, rxShape ),
128  WorksheetHelper( rHelper )
129 {
130 }
131 
132 /*static*/ ContextHandlerRef GroupShapeContext::createShapeContext( FragmentHandler2& rParent,
133  const WorksheetHelper& rHelper, sal_Int32 nElement, const AttributeList& rAttribs,
134  const ShapePtr& rxParentShape, ShapePtr* pxShape )
135 {
136  switch( nElement )
137  {
138  case XDR_TOKEN( sp ):
139  {
140  ShapePtr xShape = std::make_shared<Shape>( rHelper, rAttribs, "com.sun.star.drawing.CustomShape" );
141  if( pxShape ) *pxShape = xShape;
142  return new ShapeContext( rParent, rxParentShape, xShape );
143  }
144  case XDR_TOKEN( cxnSp ):
145  {
146  ShapePtr xShape = std::make_shared<Shape>( rHelper, rAttribs, "com.sun.star.drawing.ConnectorShape" );
147  if( pxShape ) *pxShape = xShape;
148  return new ConnectorShapeContext( rParent, rxParentShape, xShape );
149  }
150  case XDR_TOKEN( pic ):
151  {
152  ShapePtr xShape = std::make_shared<Shape>( rHelper, rAttribs, "com.sun.star.drawing.GraphicObjectShape" );
153  if( pxShape ) *pxShape = xShape;
154  return new GraphicShapeContext( rParent, rxParentShape, xShape );
155  }
156  case XDR_TOKEN( graphicFrame ):
157  {
158  ShapePtr xShape = std::make_shared<Shape>( rHelper, rAttribs, "com.sun.star.drawing.GraphicObjectShape" );
159  if( pxShape ) *pxShape = xShape;
160  return new GraphicalObjectFrameContext( rParent, rxParentShape, xShape, rHelper.getSheetType() != WorksheetType::Chart );
161  }
162  case XDR_TOKEN( grpSp ):
163  {
164  ShapePtr xShape = std::make_shared<Shape>( rHelper, rAttribs, "com.sun.star.drawing.GroupShape" );
165  if( pxShape ) *pxShape = xShape;
166  return new GroupShapeContext( rParent, rHelper, rxParentShape, xShape );
167  }
168  }
169  return nullptr;
170 }
171 
173  sal_Int32 nElement, const AttributeList& rAttribs )
174 {
175  ContextHandlerRef xContext = createShapeContext( *this, *this, nElement, rAttribs, mpGroupShapePtr );
176  return xContext ? xContext : ShapeGroupContext::onCreateContext( nElement, rAttribs );
177 }
178 
179 DrawingFragment::DrawingFragment( const WorksheetHelper& rHelper, const OUString& rFragmentPath ) :
180  WorksheetFragmentBase( rHelper, rFragmentPath ),
181  mxDrawPage( rHelper.getDrawPage() )
182 {
183  OSL_ENSURE( mxDrawPage.is(), "DrawingFragment::DrawingFragment - missing drawing page" );
184 }
185 
187 {
188  switch( getCurrentElement() )
189  {
190  case XML_ROOT_CONTEXT:
191  if( nElement == XDR_TOKEN( wsDr ) ) return this;
192  break;
193 
194  case XDR_TOKEN( wsDr ):
195  switch( nElement )
196  {
197  case XDR_TOKEN( absoluteAnchor ):
198  case XDR_TOKEN( oneCellAnchor ):
199  case XDR_TOKEN( twoCellAnchor ):
200  mxAnchor.reset( new ShapeAnchor( *this ) );
201  mxAnchor->importAnchor( nElement, rAttribs );
202  return this;
203  }
204  break;
205 
206  case XDR_TOKEN( absoluteAnchor ):
207  case XDR_TOKEN( oneCellAnchor ):
208  case XDR_TOKEN( twoCellAnchor ):
209  {
210  switch( nElement )
211  {
212  case XDR_TOKEN( from ):
213  case XDR_TOKEN( to ): return this;
214 
215  case XDR_TOKEN( pos ): if( mxAnchor ) mxAnchor->importPos( rAttribs ); break;
216  case XDR_TOKEN( ext ): if( mxAnchor ) mxAnchor->importExt( rAttribs ); break;
217  case XDR_TOKEN( clientData ): if( mxAnchor ) mxAnchor->importClientData( rAttribs ); break;
218 
219  default: return GroupShapeContext::createShapeContext( *this, *this, nElement, rAttribs, ShapePtr(), &mxShape );
220  }
221  }
222  break;
223 
224  case XDR_TOKEN( from ):
225  case XDR_TOKEN( to ):
226  switch( nElement )
227  {
228  case XDR_TOKEN( col ):
229  case XDR_TOKEN( row ):
230  case XDR_TOKEN( colOff ):
231  case XDR_TOKEN( rowOff ): return this; // collect index in onCharacters()
232  }
233  break;
234  }
235  return nullptr;
236 }
237 
238 void DrawingFragment::onCharacters( const OUString& rChars )
239 {
240  switch( getCurrentElement() )
241  {
242  case XDR_TOKEN( col ):
243  case XDR_TOKEN( row ):
244  case XDR_TOKEN( colOff ):
245  case XDR_TOKEN( rowOff ):
246  if( mxAnchor ) mxAnchor->setCellPos( getCurrentElement(), getParentElement(), rChars );
247  break;
248  }
249 }
250 
252 {
253  switch( getCurrentElement() )
254  {
255  case XDR_TOKEN( absoluteAnchor ):
256  case XDR_TOKEN( oneCellAnchor ):
257  case XDR_TOKEN( twoCellAnchor ):
258  if( mxDrawPage.is() && mxShape && mxAnchor )
259  {
260  EmuRectangle aShapeRectEmu = mxAnchor->calcAnchorRectEmu( getDrawPageSize() );
261  const bool bIsShapeVisible = mxAnchor->isAnchorValid();
262  if( (aShapeRectEmu.X >= 0) && (aShapeRectEmu.Y >= 0) && (aShapeRectEmu.Width >= 0) && (aShapeRectEmu.Height >= 0) )
263  {
264  const sal_Int32 aRotation = mxShape->getRotation();
265  if ((aRotation >= 45 * PER_DEGREE && aRotation < 135 * PER_DEGREE)
266  || (aRotation >= 225 * PER_DEGREE && aRotation < 315 * PER_DEGREE))
267  {
268  // When rotating any shape in MSO Excel within the range of degrees given above,
269  // Excel changes the cells in which the shape is anchored. The new position of
270  // the anchors are always calculated using a 90 degrees rotation anticlockwise.
271  // There is an important result of this operation: the top left point of the shape changes,
272  // it will be another vertex.
273  // The anchor position is given in the xml file, it is in the xdr:from and xdr:to elements.
274  // Let's see what happens in time order:
275  // We create a shape in Excel, the anchor position is in a given cell, then the rotation happens
276  // as mentioned above, and excel recalculates the cells in which the anchors are positioned.
277  // This new cell is exported into the xml elements xdr:from and xdr:to, when Excel exports the document!
278  // Thus, if we have a 90 degrees rotation and an already rotated point from which we base
279  // our calculations here in LO, the result is an incorrect 180 degrees rotation.
280  // Now, we need to create the bounding rectangle of the shape with this in mind.
281  // (Important to mention that at this point we don't talk about rotations at all, this bounding
282  // rectangle contains the original not-rotated shape. Rotation happens later in the code.)
283  // We get the new (x, y) coords, then swap width with height.
284  // To get the new coords we reflect the rectangle in the line y = x. (This will return the
285  // correct vertex, which is the actual top left one.)
286  // Another fact that appears to be true in Excel is that there are only 2 of possible anchor
287  // positions for a shape that is only rotated (and not resized for example).
288  // The first position happens in the set of degrees {[45, 135) U [225, 315)} and the second
289  // set is all the other angles. The two sets partition the circle (of all rotations: 360 degrees).
290  sal_Int64 nHalfWidth = aShapeRectEmu.Width / 2;
291  sal_Int64 nHalfHeight = aShapeRectEmu.Height / 2;
292  aShapeRectEmu.X = aShapeRectEmu.X + nHalfWidth - nHalfHeight;
293  aShapeRectEmu.Y = aShapeRectEmu.Y + nHalfHeight - nHalfWidth;
294  std::swap(aShapeRectEmu.Width, aShapeRectEmu.Height);
295  }
296 
297  // TODO: DrawingML implementation expects 32-bit coordinates for EMU rectangles (change that to EmuRectangle)
298  Rectangle aShapeRectEmu32(
299  getLimitedValue< sal_Int32, sal_Int64 >( aShapeRectEmu.X, 0, SAL_MAX_INT32 ),
300  getLimitedValue< sal_Int32, sal_Int64 >( aShapeRectEmu.Y, 0, SAL_MAX_INT32 ),
301  getLimitedValue< sal_Int32, sal_Int64 >( aShapeRectEmu.Width, 0, SAL_MAX_INT32 ),
302  getLimitedValue< sal_Int32, sal_Int64 >( aShapeRectEmu.Height, 0, SAL_MAX_INT32 ) );
303 
304  // Make sure to set the position and size *before* calling addShape().
305  mxShape->setPosition(Point(aShapeRectEmu32.X, aShapeRectEmu32.Y));
306  mxShape->setSize(Size(aShapeRectEmu32.Width, aShapeRectEmu32.Height));
307 
308  basegfx::B2DHomMatrix aTransformation;
309  if ( !bIsShapeVisible)
310  mxShape->setHidden(true);
311 
312  mxShape->addShape( getOoxFilter(), &getTheme(), mxDrawPage, aTransformation, mxShape->getFillProperties() );
313 
314  /* Collect all shape positions in the WorksheetHelper base
315  class. But first, scale EMUs to 1/100 mm. */
316  Rectangle aShapeRectHmm(
317  convertEmuToHmm(aShapeRectEmu32.X ), convertEmuToHmm(aShapeRectEmu32.Y ),
318  convertEmuToHmm(aShapeRectEmu32.Width ), convertEmuToHmm(aShapeRectEmu32.Height ) );
319  extendShapeBoundingBox( aShapeRectHmm );
320  // set cell Anchoring
321  if ( mxAnchor->getEditAs() != ShapeAnchor::ANCHOR_ABSOLUTE )
322  {
323  SdrObject* pObj = SdrObject::getSdrObjectFromXShape( mxShape->getXShape() );
324  if ( pObj )
325  {
326  bool bResizeWithCell = mxAnchor->getEditAs() == ShapeAnchor::ANCHOR_TWOCELL;
328  }
329  }
330  }
331  }
332  mxShape.reset();
333  mxAnchor.reset();
334  break;
335  }
336 }
337 
338 // VML
339 
340 namespace {
341 
342 class VmlFindNoteFunc
343 {
344 public:
345  explicit VmlFindNoteFunc( const ScAddress& rPos );
346  bool operator()( const ::oox::vml::ShapeBase& rShape ) const;
347 
348 private:
349  sal_Int32 mnCol;
350  sal_Int32 mnRow;
351 };
352 
353 VmlFindNoteFunc::VmlFindNoteFunc( const ScAddress& rPos ) :
354  mnCol( rPos.Col() ),
355  mnRow( rPos.Row() )
356 {
357 }
358 
359 bool VmlFindNoteFunc::operator()( const ::oox::vml::ShapeBase& rShape ) const
360 {
361  const ::oox::vml::ClientData* pClientData = rShape.getClientData();
362  return pClientData && (pClientData->mnCol == mnCol) && (pClientData->mnRow == mnRow);
363 }
364 
365 } // namespace
366 
367 VmlControlMacroAttacher::VmlControlMacroAttacher( const OUString& rMacroName,
368  const Reference< XIndexContainer >& rxCtrlFormIC, sal_Int32 nCtrlIndex, sal_Int32 nCtrlType, sal_Int32 nDropStyle ) :
369  VbaMacroAttacherBase( rMacroName ),
370  mxCtrlFormIC( rxCtrlFormIC ),
371  mnCtrlIndex( nCtrlIndex ),
372  mnCtrlType( nCtrlType ),
373  mnDropStyle( nDropStyle )
374 {
375 }
376 
377 void VmlControlMacroAttacher::attachMacro( const OUString& rMacroUrl )
378 {
379  ScriptEventDescriptor aEventDesc;
380  aEventDesc.ScriptType = "Script";
381  aEventDesc.ScriptCode = rMacroUrl;
382 
383  // editable drop downs are treated like edit boxes
384  bool bEditDropDown = (mnCtrlType == XML_Drop) && (mnDropStyle == XML_ComboEdit);
385  sal_Int32 nCtrlType = bEditDropDown ? XML_Edit : mnCtrlType;
386 
387  switch( nCtrlType )
388  {
389  case XML_Button:
390  case XML_Checkbox:
391  case XML_Radio:
392  aEventDesc.ListenerType = "XActionListener";
393  aEventDesc.EventMethod = "actionPerformed";
394  break;
395  case XML_Label:
396  case XML_GBox:
397  case XML_Dialog:
398  aEventDesc.ListenerType = "XMouseListener";
399  aEventDesc.EventMethod = "mouseReleased";
400  break;
401  case XML_Edit:
402  aEventDesc.ListenerType = "XTextListener";
403  aEventDesc.EventMethod = "textChanged";
404  break;
405  case XML_Spin:
406  case XML_Scroll:
407  aEventDesc.ListenerType = "XAdjustmentListener";
408  aEventDesc.EventMethod = "adjustmentValueChanged";
409  break;
410  case XML_List:
411  case XML_Drop:
412  aEventDesc.ListenerType = "XChangeListener";
413  aEventDesc.EventMethod = "changed";
414  break;
415  default:
416  OSL_ENSURE( false, "VmlControlMacroAttacher::attachMacro - unexpected object type" );
417  return;
418  }
419 
420  try
421  {
422  Reference< XEventAttacherManager > xEventMgr( mxCtrlFormIC, UNO_QUERY_THROW );
423  xEventMgr->registerScriptEvent( mnCtrlIndex, aEventDesc );
424  }
425  catch( Exception& )
426  {
427  }
428 }
429 
431  ::oox::vml::Drawing( rHelper.getOoxFilter(), rHelper.getDrawPage(), ::oox::vml::VMLDRAWING_EXCEL ),
432  WorksheetHelper( rHelper ),
433  maControlConv( rHelper.getBaseFilter().getModel(), rHelper.getBaseFilter().getGraphicHelper() )
434 {
435  // default font for legacy listboxes and dropdowns: Tahoma, 8pt
436  maListBoxFont.moName = "Tahoma";
437  maListBoxFont.moColor = "auto";
438  maListBoxFont.monSize = 160;
439 }
440 
441 const ::oox::vml::ShapeBase* VmlDrawing::getNoteShape( const ScAddress& rPos ) const
442 {
443  return getShapes().findShape( VmlFindNoteFunc( rPos ) );
444 }
445 
446 bool VmlDrawing::isShapeSupported( const ::oox::vml::ShapeBase& rShape ) const
447 {
448  const ::oox::vml::ClientData* pClientData = rShape.getClientData();
449  return !pClientData || (pClientData->mnObjType != XML_Note);
450 }
451 
452 OUString VmlDrawing::getShapeBaseName( const ::oox::vml::ShapeBase& rShape ) const
453 {
454  if( const ::oox::vml::ClientData* pClientData = rShape.getClientData() )
455  {
456  switch( pClientData->mnObjType )
457  {
458  case XML_Button: return "Button";
459  case XML_Checkbox: return "Check Box";
460  case XML_Dialog: return "Dialog Frame";
461  case XML_Drop: return "Drop Down";
462  case XML_Edit: return "Edit Box";
463  case XML_GBox: return "Group Box";
464  case XML_Label: return "Label";
465  case XML_List: return "List Box";
466  case XML_Note: return "Comment";
467  case XML_Pict: return (pClientData->mbDde || getOleObjectInfo( rShape.getShapeId() )) ? OUString( "Object" ) : OUString( "Picture" );
468  case XML_Radio: return "Option Button";
469  case XML_Scroll: return "Scroll Bar";
470  case XML_Spin: return "Spinner";
471  }
472  }
473  return ::oox::vml::Drawing::getShapeBaseName( rShape );
474 }
475 
476 bool VmlDrawing::convertClientAnchor( Rectangle& orShapeRect, const OUString& rShapeAnchor ) const
477 {
478  if( rShapeAnchor.isEmpty() )
479  return false;
480  ShapeAnchor aAnchor( *this );
481  aAnchor.importVmlAnchor( rShapeAnchor );
482  orShapeRect = aAnchor.calcAnchorRectHmm( getDrawPageSize() );
483  return (orShapeRect.Width >= 0) && (orShapeRect.Height >= 0);
484 }
485 
486 Reference< XShape > VmlDrawing::createAndInsertClientXShape( const ::oox::vml::ShapeBase& rShape,
487  const Reference< XShapes >& rxShapes, const Rectangle& rShapeRect ) const
488 {
489  // simulate the legacy drawing controls with OLE form controls
490  OUString aShapeName = rShape.getShapeName();
491  const ::oox::vml::ClientData* pClientData = rShape.getClientData();
492  if( !aShapeName.isEmpty() && pClientData )
493  {
494  Rectangle aShapeRect = rShapeRect;
495  const ::oox::vml::TextBox* pTextBox = rShape.getTextBox();
496  EmbeddedControl aControl( aShapeName );
497  switch( pClientData->mnObjType )
498  {
499  case XML_Button:
500  {
501  AxCommandButtonModel& rAxModel = aControl.createModel< AxCommandButtonModel >();
502  convertControlText( rAxModel.maFontData, rAxModel.mnTextColor, rAxModel.maCaption, pTextBox, pClientData->mnTextHAlign );
503  rAxModel.mnFlags = AX_FLAGS_ENABLED | AX_FLAGS_OPAQUE | AX_FLAGS_WORDWRAP;
504  rAxModel.mnVerticalAlign = pClientData->mnTextVAlign;
505  }
506  break;
507 
508  case XML_Label:
509  {
510  AxLabelModel& rAxModel = aControl.createModel< AxLabelModel >();
511  convertControlText( rAxModel.maFontData, rAxModel.mnTextColor, rAxModel.maCaption, pTextBox, pClientData->mnTextHAlign );
512  rAxModel.mnFlags = AX_FLAGS_ENABLED | AX_FLAGS_WORDWRAP;
513  rAxModel.mnBorderStyle = AX_BORDERSTYLE_NONE;
514  rAxModel.mnSpecialEffect = AX_SPECIALEFFECT_FLAT;
515  rAxModel.mnVerticalAlign = pClientData->mnTextVAlign;
516  }
517  break;
518 
519  case XML_Edit:
520  {
521  bool bNumeric = (pClientData->mnVTEdit == ::oox::vml::VML_CLIENTDATA_INTEGER) || (pClientData->mnVTEdit == ::oox::vml::VML_CLIENTDATA_NUMBER);
522  AxMorphDataModelBase& rAxModel = bNumeric ?
523  static_cast< AxMorphDataModelBase& >( aControl.createModel< AxNumericFieldModel >() ) :
524  static_cast< AxMorphDataModelBase& >( aControl.createModel< AxTextBoxModel >() );
525  convertControlText( rAxModel.maFontData, rAxModel.mnTextColor, rAxModel.maValue, pTextBox, pClientData->mnTextHAlign );
526  setFlag( rAxModel.mnFlags, AX_FLAGS_MULTILINE, pClientData->mbMultiLine );
527  setFlag( rAxModel.mnScrollBars, AX_SCROLLBAR_VERTICAL, pClientData->mbVScroll );
528  if( pClientData->mbSecretEdit )
529  rAxModel.mnPasswordChar = '*';
530  }
531  break;
532 
533  case XML_GBox:
534  {
535  AxFrameModel& rAxModel = aControl.createModel< AxFrameModel >();
536  convertControlText( rAxModel.maFontData, rAxModel.mnTextColor, rAxModel.maCaption, pTextBox, pClientData->mnTextHAlign );
537  rAxModel.mnBorderStyle = pClientData->mbNo3D ? AX_BORDERSTYLE_SINGLE : AX_BORDERSTYLE_NONE;
538  rAxModel.mnSpecialEffect = pClientData->mbNo3D ? AX_SPECIALEFFECT_FLAT : AX_SPECIALEFFECT_BUMPED;
539 
540  /* Move top border of groupbox up by half font height, because
541  Excel specifies Y position of the groupbox border line
542  instead the top border of the caption text. */
543  if( const ::oox::vml::TextFontModel* pFontModel = pTextBox ? pTextBox->getFirstFont() : nullptr )
544  {
545  sal_Int32 nFontHeightHmm = getUnitConverter().scaleToMm100( pFontModel->monSize.get( 160 ), Unit::Twip );
546  sal_Int32 nYDiff = ::std::min< sal_Int32 >( nFontHeightHmm / 2, aShapeRect.Y );
547  aShapeRect.Y -= nYDiff;
548  aShapeRect.Height += nYDiff;
549  }
550  }
551  break;
552 
553  case XML_Checkbox:
554  {
555  AxCheckBoxModel& rAxModel = aControl.createModel< AxCheckBoxModel >();
556  convertControlText( rAxModel.maFontData, rAxModel.mnTextColor, rAxModel.maCaption, pTextBox, pClientData->mnTextHAlign );
557  convertControlBackground( rAxModel, rShape );
558  rAxModel.maValue = OUString::number( pClientData->mnChecked );
559  rAxModel.mnSpecialEffect = pClientData->mbNo3D ? AX_SPECIALEFFECT_FLAT : AX_SPECIALEFFECT_SUNKEN;
560  rAxModel.mnVerticalAlign = pClientData->mnTextVAlign;
561  bool bTriState = (pClientData->mnChecked != ::oox::vml::VML_CLIENTDATA_UNCHECKED) && (pClientData->mnChecked != ::oox::vml::VML_CLIENTDATA_CHECKED);
562  rAxModel.mnMultiSelect = bTriState ? AX_SELECTION_MULTI : AX_SELECTION_SINGLE;
563  }
564  break;
565 
566  case XML_Radio:
567  {
568  AxOptionButtonModel& rAxModel = aControl.createModel< AxOptionButtonModel >();
569 
570  // unique name to prevent autoGrouping with ActiveX controls and which a GroupBox may override - see vmldrawing.cxx.
571  rAxModel.maGroupName = "autoGroup_formControl";
572  convertControlText( rAxModel.maFontData, rAxModel.mnTextColor, rAxModel.maCaption, pTextBox, pClientData->mnTextHAlign );
573  convertControlBackground( rAxModel, rShape );
574  rAxModel.maValue = OUString::number( pClientData->mnChecked );
575  rAxModel.mnSpecialEffect = pClientData->mbNo3D ? AX_SPECIALEFFECT_FLAT : AX_SPECIALEFFECT_SUNKEN;
576  rAxModel.mnVerticalAlign = pClientData->mnTextVAlign;
577  }
578  break;
579 
580  case XML_List:
581  {
582  AxListBoxModel& rAxModel = aControl.createModel< AxListBoxModel >();
583  convertControlFontData( rAxModel.maFontData, rAxModel.mnTextColor, maListBoxFont );
584  rAxModel.mnBorderStyle = pClientData->mbNo3D2 ? AX_BORDERSTYLE_SINGLE : AX_BORDERSTYLE_NONE;
585  rAxModel.mnSpecialEffect = pClientData->mbNo3D2 ? AX_SPECIALEFFECT_FLAT : AX_SPECIALEFFECT_SUNKEN;
586  switch( pClientData->mnSelType )
587  {
588  case XML_Single: rAxModel.mnMultiSelect = AX_SELECTION_SINGLE; break;
589  case XML_Multi: rAxModel.mnMultiSelect = AX_SELECTION_MULTI; break;
590  case XML_Extend: rAxModel.mnMultiSelect = AX_SELECTION_EXTENDED; break;
591  }
592  }
593  break;
594 
595  case XML_Drop:
596  {
597  AxComboBoxModel& rAxModel = aControl.createModel< AxComboBoxModel >();
598  convertControlFontData( rAxModel.maFontData, rAxModel.mnTextColor, maListBoxFont );
599  rAxModel.mnDisplayStyle = AX_DISPLAYSTYLE_DROPDOWN;
600  rAxModel.mnShowDropButton = AX_SHOWDROPBUTTON_ALWAYS;
601  rAxModel.mnBorderStyle = pClientData->mbNo3D2 ? AX_BORDERSTYLE_SINGLE : AX_BORDERSTYLE_NONE;
602  rAxModel.mnSpecialEffect = pClientData->mbNo3D2 ? AX_SPECIALEFFECT_FLAT : AX_SPECIALEFFECT_SUNKEN;
603  rAxModel.mnListRows = pClientData->mnDropLines;
604  }
605  break;
606 
607  case XML_Spin:
608  {
609  AxSpinButtonModel& rAxModel = aControl.createModel< AxSpinButtonModel >();
610  rAxModel.mnMin = pClientData->mnMin;
611  rAxModel.mnMax = pClientData->mnMax;
612  rAxModel.mnPosition = pClientData->mnVal;
613  rAxModel.mnSmallChange = pClientData->mnInc;
614  }
615  break;
616 
617  case XML_Scroll:
618  {
619  AxScrollBarModel& rAxModel = aControl.createModel< AxScrollBarModel >();
620  rAxModel.mnMin = pClientData->mnMin;
621  rAxModel.mnMax = pClientData->mnMax;
622  rAxModel.mnPosition = pClientData->mnVal;
623  rAxModel.mnSmallChange = pClientData->mnInc;
624  rAxModel.mnLargeChange = pClientData->mnPage;
625  }
626  break;
627 
628  case XML_Dialog:
629  {
630  // fake with a group box
631  AxFrameModel& rAxModel = aControl.createModel< AxFrameModel >();
632  convertControlText( rAxModel.maFontData, rAxModel.mnTextColor, rAxModel.maCaption, pTextBox, XML_Left );
633  rAxModel.mnBorderStyle = AX_BORDERSTYLE_SINGLE;
634  rAxModel.mnSpecialEffect = AX_SPECIALEFFECT_FLAT;
635  }
636  break;
637  }
638 
639  if( ControlModelBase* pAxModel = aControl.getModel() )
640  {
641  // create the control shape
642  pAxModel->maSize.first = aShapeRect.Width;
643  pAxModel->maSize.second = aShapeRect.Height;
644  sal_Int32 nCtrlIndex = -1;
645  Reference< XShape > xShape = createAndInsertXControlShape( aControl, rxShapes, aShapeRect, nCtrlIndex );
646 
647  // control shape macro
648  if( xShape.is() && (nCtrlIndex >= 0) && !pClientData->maFmlaMacro.isEmpty() )
649  {
650  OUString aMacroName = getFormulaParser().importMacroName( pClientData->maFmlaMacro );
651  if( !aMacroName.isEmpty() )
652  {
653  Reference< XIndexContainer > xFormIC = getControlForm().getXForm();
654  VbaMacroAttacherRef xAttacher = std::make_shared<VmlControlMacroAttacher>( aMacroName, xFormIC, nCtrlIndex, pClientData->mnObjType, pClientData->mnDropStyle );
656  }
657  }
658 
659  return xShape;
660  }
661  }
662 
663  return Reference< XShape >();
664 }
665 
666 void VmlDrawing::notifyXShapeInserted( const Reference< XShape >& rxShape,
667  const Rectangle& rShapeRect, const ::oox::vml::ShapeBase& rShape, bool bGroupChild )
668 {
669  // collect all shape positions in the WorksheetHelper base class (but not children of group shapes)
670  if( !bGroupChild )
671  extendShapeBoundingBox( rShapeRect );
672 
673  // convert settings from VML client data
674  const ::oox::vml::ClientData* pClientData = rShape.getClientData();
675  if(!pClientData)
676  return;
677 
678  // specific settings for embedded form controls
679  try
680  {
681  Reference< XControlShape > xCtrlShape( rxShape, UNO_QUERY_THROW );
682  Reference< XControlModel > xCtrlModel( xCtrlShape->getControl(), UNO_SET_THROW );
683  PropertySet aPropSet( xCtrlModel );
684 
685  // printable
686  aPropSet.setProperty( PROP_Printable, pClientData->mbPrintObject );
687 
688  // control source links
689  if( !pClientData->maFmlaLink.isEmpty() || !pClientData->maFmlaRange.isEmpty() )
690  maControlConv.bindToSources( xCtrlModel, pClientData->maFmlaLink, pClientData->maFmlaRange, getSheetIndex() );
691  }
692  catch( Exception& )
693  {
694  }
695 }
696 
697 // private --------------------------------------------------------------------
698 
699 sal_uInt32 VmlDrawing::convertControlTextColor( const OUString& rTextColor ) const
700 {
701  // color attribute not present or 'auto' - use passed default color
702  if( rTextColor.isEmpty() || rTextColor.equalsIgnoreAsciiCase( "auto" ) )
703  return AX_SYSCOLOR_WINDOWTEXT;
704 
705  if( rTextColor[ 0 ] == '#' )
706  {
707  // RGB colors in the format '#RRGGBB'
708  if( rTextColor.getLength() == 7 )
709  return OleHelper::encodeOleColor( rTextColor.copy( 1 ).toUInt32( 16 ) );
710 
711  // RGB colors in the format '#RGB'
712  if( rTextColor.getLength() == 4 )
713  {
714  sal_Int32 nR = rTextColor.copy( 1, 1 ).toUInt32( 16 ) * 0x11;
715  sal_Int32 nG = rTextColor.copy( 2, 1 ).toUInt32( 16 ) * 0x11;
716  sal_Int32 nB = rTextColor.copy( 3, 1 ).toUInt32( 16 ) * 0x11;
717  return OleHelper::encodeOleColor( (nR << 16) | (nG << 8) | nB );
718  }
719 
720  OSL_ENSURE( false, OStringBuffer( "VmlDrawing::convertControlTextColor - invalid color name '" ).
721  append( OUStringToOString( rTextColor, RTL_TEXTENCODING_ASCII_US ) ).append( '\'' ).getStr() );
722  return AX_SYSCOLOR_WINDOWTEXT;
723  }
724 
725  const GraphicHelper& rGraphicHelper = getBaseFilter().getGraphicHelper();
726 
727  /* Predefined color names or system color names (resolve to RGB to detect
728  valid color name). */
729  sal_Int32 nColorToken = AttributeConversion::decodeToken( rTextColor );
730  ::Color nRgbValue = Color::getVmlPresetColor( nColorToken, API_RGB_TRANSPARENT );
731  if( nRgbValue == API_RGB_TRANSPARENT )
732  nRgbValue = rGraphicHelper.getSystemColor( nColorToken );
733  if( nRgbValue != API_RGB_TRANSPARENT )
734  return OleHelper::encodeOleColor( nRgbValue );
735 
736  // try palette color
737  return OleHelper::encodeOleColor( rGraphicHelper.getPaletteColor( rTextColor.toInt32() ) );
738 }
739 
740 void VmlDrawing::convertControlFontData( AxFontData& rAxFontData, sal_uInt32& rnOleTextColor, const ::oox::vml::TextFontModel& rFontModel ) const
741 {
742  if( rFontModel.moName.has() )
743  rAxFontData.maFontName = rFontModel.moName.get();
744 
745  // font height: convert from twips to points, then to internal representation of AX controls
746  rAxFontData.setHeightPoints( static_cast< sal_Int16 >( (rFontModel.monSize.get( 200 ) + 10) / 20 ) );
747 
748  // font effects
749  rAxFontData.mnFontEffects = AxFontFlags::NONE;
750  setFlag( rAxFontData.mnFontEffects, AxFontFlags::Bold, rFontModel.mobBold.get( false ) );
751  setFlag( rAxFontData.mnFontEffects, AxFontFlags::Italic, rFontModel.mobItalic.get( false ) );
752  setFlag( rAxFontData.mnFontEffects, AxFontFlags::Strikeout, rFontModel.mobStrikeout.get( false ) );
753  sal_Int32 nUnderline = rFontModel.monUnderline.get( XML_none );
754  setFlag( rAxFontData.mnFontEffects, AxFontFlags::Underline, nUnderline != XML_none );
755  rAxFontData.mbDblUnderline = nUnderline == XML_double;
756 
757  // font color
758  rnOleTextColor = convertControlTextColor( rFontModel.moColor.get( OUString() ) );
759 }
760 
761 void VmlDrawing::convertControlText( AxFontData& rAxFontData, sal_uInt32& rnOleTextColor,
762  OUString& rCaption, const ::oox::vml::TextBox* pTextBox, sal_Int32 nTextHAlign ) const
763 {
764  if( pTextBox )
765  {
766  rCaption = pTextBox->getText();
767  if( const ::oox::vml::TextFontModel* pFontModel = pTextBox->getFirstFont() )
768  convertControlFontData( rAxFontData, rnOleTextColor, *pFontModel );
769  }
770 
771  switch( nTextHAlign )
772  {
773  case XML_Left: rAxFontData.mnHorAlign = AxHorizontalAlign::Left; break;
774  case XML_Center: rAxFontData.mnHorAlign = AxHorizontalAlign::Center; break;
775  case XML_Right: rAxFontData.mnHorAlign = AxHorizontalAlign::Right; break;
776  default: rAxFontData.mnHorAlign = AxHorizontalAlign::Left;
777  }
778 }
779 
780 void VmlDrawing::convertControlBackground( AxMorphDataModelBase& rAxModel, const ::oox::vml::ShapeBase& rShape ) const
781 {
782  const ::oox::vml::FillModel& rFillModel = rShape.getTypeModel().maFillModel;
783  bool bHasFill = rFillModel.moFilled.get( true );
784  setFlag( rAxModel.mnFlags, AX_FLAGS_OPAQUE, bHasFill );
785  if( bHasFill )
786  {
787  const GraphicHelper& rGraphicHelper = getBaseFilter().getGraphicHelper();
788  ::Color nSysWindowColor = rGraphicHelper.getSystemColor( XML_window, API_RGB_WHITE );
789  ::oox::drawingml::Color aColor = ::oox::vml::ConversionHelper::decodeColor( rGraphicHelper, rFillModel.moColor, rFillModel.moOpacity, nSysWindowColor );
790  ::Color nRgbValue = aColor.getColor( rGraphicHelper );
791  rAxModel.mnBackColor = OleHelper::encodeOleColor( nRgbValue );
792  }
793 }
794 
795 VmlDrawingFragment::VmlDrawingFragment( const WorksheetHelper& rHelper, const OUString& rFragmentPath ) :
796  ::oox::vml::DrawingFragment( rHelper.getOoxFilter(), rFragmentPath, rHelper.getVmlDrawing() ),
797  WorksheetHelper( rHelper )
798 {
799 }
800 
802 {
805 }
806 
807 } // namespace oox
808 
809 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void finalizeXShape(::oox::core::XmlFilterBase &rFilter, const css::uno::Reference< css::drawing::XShapes > &rxShapes)
const OleObjectInfo * getOleObjectInfo(const OUString &rShapeId) const
VmlDrawingFragment(const WorksheetHelper &rHelper, const OUString &rFragmentPath)
sal_Int32 convertEmuToHmm(sal_Int64 nValue)
virtual OUString getShapeBaseName(const ::oox::vml::ShapeBase &rShape) const override
Returns additional base names for automatic shape name creation.
const sal_Int32 AX_BORDERSTYLE_SINGLE
const sal_Int32 PER_DEGREE
css::uno::Reference< css::drawing::XShape > mxShape
const sal_uInt32 AX_FLAGS_OPAQUE
const sal_Int32 AX_SPECIALEFFECT_SUNKEN
UnitConverter & getUnitConverter() const
Returns the measurement unit converter.
OptValue< OUString > getXString(sal_Int32 nAttrToken) const
::oox::ole::ControlConverter maControlConv
PropertyMap & getShapeProperties()
static ScMacroInfo * GetMacroInfo(SdrObject *pObj, bool bCreate=false)
Definition: drwlayer.cxx:2321
ShapeContainer & getShapes()
static SdrObject * getSdrObjectFromXShape(const css::uno::Reference< css::uno::XInterface > &xInt)
Shape(const WorksheetHelper &rHelper, const AttributeList &rAttribs, const char *pcServiceName)
void bindToSources(const css::uno::Reference< css::awt::XControlModel > &rxCtrlModel, const OUString &rCtrlSource, const OUString &rRowSource, sal_Int32 nRefSheet=0) const
sal_Int32 mnCol
const sal_uInt32 AX_FLAGS_ENABLED
const sal_Int32 AX_SHOWDROPBUTTON_ALWAYS
void convertAndInsert() const
uno::Reference< drawing::XDrawPage > mxDrawPage
virtual bool isShapeSupported(const ::oox::vml::ShapeBase &rShape) const override
Filters cell note shapes.
const sal_Int32 VML_CLIENTDATA_NUMBER
sal_Int32 getParentElement(sal_Int32 nCountBack=1) const
const css::awt::Size & getDrawPageSize() const
Returns the size of the entire drawing page in 1/100 mm.
Fragment handler for a complete sheet drawing.
ShapeMacroAttacher(const OUString &rMacroName, const css::uno::Reference< css::drawing::XShape > &rxShape)
sal_Int32 scaleToMm100(double fValue, Unit eUnit) const
Converts the passed value to 1/100 millimeters.
GraphicHelper & getGraphicHelper() const
uno::Reference< drawing::XShape > const mxShape
void extendShapeBoundingBox(const css::awt::Rectangle &rShapeRect)
Extends the shape bounding box by the position and size of the passed rectangle (in 1/100 mm)...
const ::Color API_RGB_TRANSPARENT(0xffffffff)
void convertSheetNameRef(OUString &sSheetNameRef) const
Converts sSheetNameRef (e.g.
size_t pos
UBlockCode from
::oox::core::ContextHandlerRef createShapeContext(::oox::core::FragmentHandler2 &rParent, const WorksheetHelper &rHelper, sal_Int32 nElement, const AttributeList &rAttribs, const ::oox::drawingml::ShapePtr &rxParentShape,::oox::drawingml::ShapePtr *pxShape=nullptr)
virtual void finalizeXShape(::oox::core::XmlFilterBase &rFilter, const css::uno::Reference< css::drawing::XShapes > &rxShapes) override
::oox::core::FilterBase & getBaseFilter() const
Returns the base filter object (base class of all filters).
UBlockCode to
virtual bool convertClientAnchor(css::awt::Rectangle &orShapeRect, const OUString &rShapeAnchor) const override
Calculates the shape rectangle from a cell anchor string.
static sal_Int32 decodeToken(const OUString &rValue)
Reference< XEventAttacher2 > xAttacher
virtual ::Color getPaletteColor(sal_Int32 nPaletteIdx) const
css::uno::Reference< css::drawing::XShape > mxShape
::oox::ole::EmbeddedForm & getControlForm() const
void setFlag(Type &ornBitField, Type nMask, bool bSet=true)
::oox::ole::VbaProject & getVbaProject() const
const ::oox::vml::ShapeBase * getNoteShape(const ScAddress &rPos) const
Returns the drawing shape for a cell note at the specified position.
::oox::drawingml::ShapePtr mxShape
Drawing page of this sheet.
Contains the position of a shape in the spreadsheet.
Definition: drawingbase.hxx:67
void importVmlAnchor(const OUString &rAnchor)
Imports the client anchor settings from a VML element.
#define SAL_MAX_INT32
const ::Color API_RGB_WHITE(0xFFFFFF)
virtual void onEndElement() override
virtual void finalizeImport() override
::Color getColor(const GraphicHelper &rGraphicHelper,::Color nPhClr=API_RGB_TRANSPARENT) const
static void SetCellAnchoredFromPosition(SdrObject &rObj, const ScDocument &rDoc, SCTAB nTab, bool bResizeWithCell)
Definition: drwlayer.cxx:2040
::Color getVmlPresetColor(sal_Int32 nToken,::Color nDefaultRgb)
css::uno::Reference< css::drawing::XShapes > mxDrawPage
const sal_Int32 AX_SCROLLBAR_VERTICAL
const sal_Int32 AX_BORDERSTYLE_NONE
sal_Int32 getCurrentElement() const
::oox::core::XmlFilterBase & getOoxFilter() const
Returns the base OOXML/BIFF12 filter object.
virtual css::uno::Reference< css::drawing::XShape > createAndInsertClientXShape(const ::oox::vml::ShapeBase &rShape, const css::uno::Reference< css::drawing::XShapes > &rxShapes, const css::awt::Rectangle &rShapeRect) const override
Creates a UNO control shape for legacy drawing controls.
const sal_Int32 AX_SPECIALEFFECT_FLAT
css::uno::Reference< css::container::XIndexContainer > mxCtrlFormIC
VMLDRAWING_EXCEL
const sal_uInt32 AX_FLAGS_MULTILINE
std::shared_ptr< VbaMacroAttacherBase > VbaMacroAttacherRef
const sal_Int32 AX_SELECTION_MULTI
const sal_Int32 AX_SELECTION_SINGLE
DrawingFragment(const WorksheetHelper &rHelper, const OUString &rFragmentPath)
virtual void attachMacro(const OUString &rMacroUrl) override
Fragment handler derived from the WorksheetHelper helper class.
OString OUStringToOString(const OUString &str, ConnectionSettings const *settings)
virtual void notifyXShapeInserted(const css::uno::Reference< css::drawing::XShape > &rxShape, const css::awt::Rectangle &rShapeRect, const ::oox::vml::ShapeBase &rShape, bool bGroupChild) override
Updates the bounding box covering all shapes of this drawing.
void convertControlBackground(::oox::ole::AxMorphDataModelBase &rAxModel, const ::oox::vml::ShapeBase &rShape) const
Converts the passed VML shape background formatting to ActiveX control formatting.
void convertControlText(::oox::ole::AxFontData &rAxFontData, sal_uInt32 &rnOleTextColor, OUString &rCaption, const ::oox::vml::TextBox *pTextBox, sal_Int32 nTextHAlign) const
Converts the caption, the font settings, and the horizontal alignment from the passed VML textbox to ...
virtual ::oox::core::ContextHandlerRef onCreateContext(sal_Int32 nElement, const ::oox::AttributeList &rAttribs) override
const sal_Int32 AX_SELECTION_EXTENDED
OptValue< OUString > moColor
OptValue< OUString > moName
css::uno::Reference< css::drawing::XShape > createAndInsertXControlShape(const ::oox::ole::EmbeddedControl &rControl, const css::uno::Reference< css::drawing::XShapes > &rxShapes, const css::awt::Rectangle &rShapeRect, sal_Int32 &rnCtrlIndex) const
css::awt::Rectangle calcAnchorRectHmm(const css::awt::Size &rPageSizeHmm) const
Calculates the resulting shape anchor in 1/100 mm.
SCTAB getSheetIndex() const
Returns the index of the current sheet.
const sal_uInt32 AX_SYSCOLOR_WINDOWTEXT
virtual ::oox::core::ContextHandlerRef onCreateContext(sal_Int32 nElement, const AttributeList &rAttribs) override
GroupShapeContext(const ::oox::core::FragmentHandler2 &rParent, const WorksheetHelper &rHelper, const ::oox::drawingml::ShapePtr &rxParentShape, const ::oox::drawingml::ShapePtr &rxShape)
OptValue< sal_Int32 > monSize
const sal_uInt32 AX_FLAGS_WORDWRAP
const sal_Int32 AX_SPECIALEFFECT_BUMPED
const ShapeBase * findShape(const Functor &rFunctor) const
void convertControlFontData(::oox::ole::AxFontData &rAxFontData, sal_uInt32 &rnOleTextColor, const ::oox::vml::TextFontModel &rFontModel) const
Converts the passed VML textbox font to an ActiveX form control font.
FormulaParser & getFormulaParser() const
Returns a shared import formula parser (import filter only!).
const sal_Int32 XML_ROOT_CONTEXT
css::uno::Any getProperty(sal_Int32 nPropId)
ThemeBuffer & getTheme() const
Returns the office theme object read from the theme substorage.
std::shared_ptr< Shape > ShapePtr
::oox::vml::TextFontModel maListBoxFont
One-cell anchor (top-left corner at cell, size in absolute units).
Definition: drawingbase.hxx:77
VmlDrawing & getVmlDrawing() const
Returns the VML drawing page for this sheet (OOXML/BIFF12 only).
sal_Int32 mnRow
void registerMacroAttacher(const VbaMacroAttacherRef &rxAttacher)
const sal_Int32 AX_DISPLAYSTYLE_DROPDOWN
VmlDrawing(const WorksheetHelper &rHelper)
OUString importMacroName(const OUString &rFormulaString)
Converts the passed formula to a macro name for a drawing shape.
ShapeAnchorRef mxAnchor
Current top-level shape.
::Color getSystemColor(sal_Int32 nToken,::Color nDefaultRgb=API_RGB_TRANSPARENT) const
const sal_Int32 VML_CLIENTDATA_CHECKED
virtual void onCharacters(const OUString &rChars) override
sal_uInt32 convertControlTextColor(const OUString &rTextColor) const
Converts the passed VML textbox text color to an OLE color.
virtual void attachMacro(const OUString &rMacroUrl) override
virtual void finalizeImport() override
const css::uno::Reference< css::container::XIndexContainer > & getXForm() const
WorksheetBuffer & getWorksheets() const
Returns the worksheet buffer containing sheet names and properties.