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