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