LibreOffice Module oox (master) 1
vmlexport.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 <config_folders.h>
21#include <rtl/bootstrap.hxx>
22#include <svl/itemset.hxx>
25#include <sax/fastattribs.hxx>
26
27#include <oox/token/tokens.hxx>
28
29#include <rtl/strbuf.hxx>
30#include <rtl/ustring.hxx>
31#include <sal/log.hxx>
32
33#include <tools/stream.hxx>
35#include <svx/msdffdef.hxx>
36#include <svx/svdotext.hxx>
37#include <svx/svdograf.hxx>
38#include <svx/sdmetitm.hxx>
39#include <utility>
40#include <vcl/cvtgrf.hxx>
44#include <o3tl/string_view.hxx>
46
47#include <com/sun/star/beans/XPropertySet.hpp>
48#include <com/sun/star/beans/XPropertySetInfo.hpp>
49#include <com/sun/star/drawing/XShape.hpp>
50#include <com/sun/star/text/HoriOrientation.hpp>
51#include <com/sun/star/text/VertOrientation.hpp>
52#include <com/sun/star/text/RelOrientation.hpp>
53#include <com/sun/star/text/WritingMode2.hpp>
54#include <com/sun/star/text/XTextFrame.hpp>
55
56#include <cstdio>
57
58using namespace sax_fastparser;
59using namespace oox::vml;
60using namespace com::sun::star;
61
62const sal_Int32 Tag_Container = 44444;
63const sal_Int32 Tag_Commit = 44445;
64
65VMLExport::VMLExport( ::sax_fastparser::FSHelperPtr pSerializer, VMLTextExport* pTextExport )
66 : EscherEx( std::make_shared<EscherExGlobal>(), nullptr, /*bOOXML=*/true )
67 , m_pSerializer(std::move( pSerializer ))
68 , m_pTextExport( pTextExport )
69 , m_eHOri( 0 )
70 , m_eVOri( 0 )
71 , m_eHRel( 0 )
72 , m_eVRel( 0 )
73 , m_bInline( false )
74 , m_pSdrObject( nullptr )
75 , m_nShapeType( ESCHER_ShpInst_Nil )
76 , m_nShapeFlags(ShapeFlag::NONE)
77 , m_ShapeStyle( 200 )
78 , m_aShapeTypeWritten( ESCHER_ShpInst_COUNT )
79 , m_bSkipwzName( false )
80 , m_bUseHashMarkForType( false )
81 , m_bOverrideShapeIdGeneration( false )
82 , m_nShapeIDCounter( 0 )
83{
84 mnGroupLevel = 1;
85}
86
87void VMLExport::SetFS( const ::sax_fastparser::FSHelperPtr& pSerializer )
88{
89 m_pSerializer = pSerializer;
90}
91
93{
94}
95
96void VMLExport::OpenContainer( sal_uInt16 nEscherContainer, int nRecInstance )
97{
98 EscherEx::OpenContainer( nEscherContainer, nRecInstance );
99
100 if ( nEscherContainer != ESCHER_SpContainer )
101 return;
102
103 // opening a shape container
104 SAL_WARN_IF(m_nShapeType != ESCHER_ShpInst_Nil, "oox.vml", "opening shape inside of a shape!");
106 m_pShapeAttrList = FastSerializerHelper::createAttrList();
107
108 m_ShapeStyle.setLength(0);
109 m_ShapeStyle.ensureCapacity(200);
110
111 // postpone the output so that we are able to write even the elements
112 // that we learn inside Commit()
114}
115
117{
118 if ( mRecTypes.back() == ESCHER_SpContainer )
119 {
120 // write the shape now when we have all the info
121 sal_Int32 nShapeElement = StartShape();
122
123 m_pSerializer->mergeTopMarks(Tag_Container);
124
125 EndShape( nShapeElement );
126
127 // cleanup
129 m_pShapeAttrList = nullptr;
130 }
131
133}
134
135sal_uInt32 VMLExport::EnterGroup( const OUString& rShapeName, const tools::Rectangle* pRect )
136{
137 sal_uInt32 nShapeId = GenerateShapeId();
138
139 OStringBuffer aStyle( 200 );
140 rtl::Reference<FastAttributeList> pAttrList = FastSerializerHelper::createAttrList();
141
142 pAttrList->add( XML_id, ShapeIdString( nShapeId ) );
143
144 if ( rShapeName.getLength() )
145 pAttrList->add( XML_alt, rShapeName );
146
147 bool rbAbsolutePos = true;
148 //editAs
149 OUString rEditAs = EscherEx::GetEditAs();
150 if (!rEditAs.isEmpty())
151 {
152 pAttrList->add(XML_editas, rEditAs);
153 rbAbsolutePos = false;
154 }
155
156 // style
157 if ( pRect )
158 AddRectangleDimensions( aStyle, *pRect, rbAbsolutePos );
159
160 if ( !aStyle.isEmpty() )
161 pAttrList->add( XML_style, aStyle );
162
163 // coordorigin/coordsize
164 if ( pRect && ( mnGroupLevel == 1 ) )
165 {
166 pAttrList->add( XML_coordorigin,
167 OString::number( pRect->Left() ) + "," + OString::number( pRect->Top() ) );
168
169 pAttrList->add( XML_coordsize,
170 OString::number( pRect->Right() - pRect->Left() ) + "," +
171 OString::number( pRect->Bottom() - pRect->Top() ) );
172 }
173
174 m_pSerializer->startElementNS( XML_v, XML_group, pAttrList );
175
176 mnGroupLevel++;
177 return nShapeId;
178}
179
181{
182 --mnGroupLevel;
183 m_pSerializer->endElementNS( XML_v, XML_group );
184}
185
186void VMLExport::AddShape( sal_uInt32 nShapeType, ShapeFlag nShapeFlags, sal_uInt32 nShapeId )
187{
188 m_nShapeType = nShapeType;
189 m_nShapeFlags = nShapeFlags;
190
191 m_sShapeId = ShapeIdString( nShapeId );
192 if (m_sShapeId.startsWith("_x0000_"))
193 {
194 // xml_id must be set elsewhere. The id is critical for matching VBA macros etc,
195 // and the spid is critical to link to the shape number elsewhere.
196 m_pShapeAttrList->addNS( XML_o, XML_spid, m_sShapeId );
197 }
199 {
200 // Shape is a watermark object - keep the original shape's name
201 // because Microsoft detects if it is a watermark by the actual name
202 m_pShapeAttrList->add( XML_id, m_pSdrObject->GetName() );
203 // also ('o:spid')
204 m_pShapeAttrList->addNS( XML_o, XML_spid, m_sShapeId );
205 }
206 else
207 {
208 m_pShapeAttrList->add(XML_id, m_sShapeId);
209 }
210}
211
212bool VMLExport::IsWaterMarkShape(std::u16string_view rStr)
213{
214 if (rStr.empty() ) return false;
215
216 return o3tl::starts_with(rStr, u"PowerPlusWaterMarkObject") || o3tl::starts_with(rStr, u"WordPictureWatermark");
217}
218
219void VMLExport::OverrideShapeIDGen(bool bOverrideShapeIdGen, const OString& sShapeIDPrefix)
220{
221 m_bOverrideShapeIdGeneration = bOverrideShapeIdGen;
222 if(bOverrideShapeIdGen)
223 {
224 assert(!sShapeIDPrefix.isEmpty());
225 m_sShapeIDPrefix = sShapeIDPrefix;
226 }
227 else
228 m_sShapeIDPrefix.clear();
229}
230
231static void impl_AddArrowHead( sax_fastparser::FastAttributeList *pAttrList, sal_Int32 nElement, sal_uInt32 nValue )
232{
233 if ( !pAttrList )
234 return;
235
236 const char *pArrowHead = nullptr;
237 switch ( nValue )
238 {
239 case ESCHER_LineNoEnd: pArrowHead = "none"; break;
240 case ESCHER_LineArrowEnd: pArrowHead = "block"; break;
241 case ESCHER_LineArrowStealthEnd: pArrowHead = "classic"; break;
242 case ESCHER_LineArrowDiamondEnd: pArrowHead = "diamond"; break;
243 case ESCHER_LineArrowOvalEnd: pArrowHead = "oval"; break;
244 case ESCHER_LineArrowOpenEnd: pArrowHead = "open"; break;
245 }
246
247 if ( pArrowHead )
248 pAttrList->add( nElement, pArrowHead );
249}
250
251static void impl_AddArrowLength( sax_fastparser::FastAttributeList *pAttrList, sal_Int32 nElement, sal_uInt32 nValue )
252{
253 if ( !pAttrList )
254 return;
255
256 const char *pArrowLength = nullptr;
257 switch ( nValue )
258 {
259 case ESCHER_LineShortArrow: pArrowLength = "short"; break;
260 case ESCHER_LineMediumLenArrow: pArrowLength = "medium"; break;
261 case ESCHER_LineLongArrow: pArrowLength = "long"; break;
262 }
263
264 if ( pArrowLength )
265 pAttrList->add( nElement, pArrowLength );
266}
267
268static void impl_AddArrowWidth( sax_fastparser::FastAttributeList *pAttrList, sal_Int32 nElement, sal_uInt32 nValue )
269{
270 if ( !pAttrList )
271 return;
272
273 const char *pArrowWidth = nullptr;
274 switch ( nValue )
275 {
276 case ESCHER_LineNarrowArrow: pArrowWidth = "narrow"; break;
277 case ESCHER_LineMediumWidthArrow: pArrowWidth = "medium"; break;
278 case ESCHER_LineWideArrow: pArrowWidth = "wide"; break;
279 }
280
281 if ( pArrowWidth )
282 pAttrList->add( nElement, pArrowWidth );
283}
284
285static void impl_AddBool( sax_fastparser::FastAttributeList *pAttrList, sal_Int32 nElement, bool bValue )
286{
287 if ( !pAttrList )
288 return;
289
290 pAttrList->add( nElement, bValue? "t": "f" );
291}
292
293static void impl_AddColor( sax_fastparser::FastAttributeList *pAttrList, sal_Int32 nElement, sal_uInt32 nColor )
294{
295 SAL_WARN_IF( nColor & 0xFF000000 , "oox.vml" , "TODO: this is not a RGB value!");
296
297 if ( !pAttrList || ( nColor & 0xFF000000 ) )
298 return;
299
300 nColor = ( ( nColor & 0xFF ) << 16 ) + ( nColor & 0xFF00 ) + ( ( nColor & 0xFF0000 ) >> 16 );
301
302 const char *pColor = nullptr;
303 char pRgbColor[10];
304 switch ( nColor )
305 {
306 case 0x000000: pColor = "black"; break;
307 case 0xC0C0C0: pColor = "silver"; break;
308 case 0x808080: pColor = "gray"; break;
309 case 0xFFFFFF: pColor = "white"; break;
310 case 0x800000: pColor = "maroon"; break;
311 case 0xFF0000: pColor = "red"; break;
312 case 0x800080: pColor = "purple"; break;
313 case 0xFF00FF: pColor = "fuchsia"; break;
314 case 0x008000: pColor = "green"; break;
315 case 0x00FF00: pColor = "lime"; break;
316 case 0x808000: pColor = "olive"; break;
317 case 0xFFFF00: pColor = "yellow"; break;
318 case 0x000080: pColor = "navy"; break;
319 case 0x0000FF: pColor = "blue"; break;
320 case 0x008080: pColor = "teal"; break;
321 case 0x00FFFF: pColor = "aqua"; break;
322 default:
323 {
324 snprintf( pRgbColor, sizeof( pRgbColor ), "#%06x", static_cast< unsigned int >( nColor ) ); // not too handy to use OString::valueOf() here :-(
325 pColor = pRgbColor;
326 }
327 break;
328 }
329
330 pAttrList->add( nElement, pColor );
331}
332
333static void impl_AddInt( sax_fastparser::FastAttributeList *pAttrList, sal_Int32 nElement, sal_uInt32 nValue )
334{
335 if ( !pAttrList )
336 return;
337
338 pAttrList->add( nElement, OString::number( nValue ) );
339}
340
341static sal_uInt16 impl_GetUInt16( const sal_uInt8* &pVal )
342{
343 sal_uInt16 nRet = *pVal++;
344 nRet += ( *pVal++ ) << 8;
345 return nRet;
346}
347
348static sal_Int32 impl_GetPointComponent( const sal_uInt8* &pVal, sal_uInt16 nPointSize )
349{
350 sal_Int32 nRet = 0;
351 if ( ( nPointSize == 0xfff0 ) || ( nPointSize == 4 ) )
352 {
353 sal_uInt16 nUnsigned = *pVal++;
354 nUnsigned += ( *pVal++ ) << 8;
355
356 nRet = sal_Int16( nUnsigned );
357 }
358 else if ( nPointSize == 8 )
359 {
360 sal_uInt32 nUnsigned = *pVal++;
361 nUnsigned += ( *pVal++ ) << 8;
362 nUnsigned += ( *pVal++ ) << 16;
363 nUnsigned += ( *pVal++ ) << 24;
364
365 nRet = nUnsigned;
366 }
367
368 return nRet;
369}
370
372{
373 m_pSdrObject = &rObj;
374}
376{
378 return;
379
380 // postpone the output of the embedded elements so that they are written
381 // inside the shapes
383
384 // dimensions
386 AddLineDimensions( rRect );
387 else
388 {
390 {
391 // Watermark need some padding to be compatible with MSO
392 tools::Long nPaddingY = 0;
394 if ( const SdrMetricItem* pItem = rSet.GetItem( SDRATTR_TEXT_UPPERDIST ) )
395 nPaddingY += pItem->GetValue();
396
397 tools::Rectangle aRect( rRect );
398 aRect.setHeight( aRect.getOpenHeight() + nPaddingY );
400 }
401 else
403 }
404
405 // properties
406 // The numbers of defines ESCHER_Prop_foo and DFF_Prop_foo correspond to the PIDs in
407 // 'Microsoft Office Drawing 97-2007 Binary Format Specification'.
408 // The property values are set by EscherPropertyContainer::CreateCustomShapeProperties() method.
409 bool bAlreadyWritten[ 0xFFF ] = {};
410 const EscherProperties &rOpts = rProps.GetOpts();
411 for (auto const& opt : rOpts)
412 {
413 sal_uInt16 nId = ( opt.nPropId & 0x0FFF );
414
415 if ( bAlreadyWritten[ nId ] )
416 continue;
417
418 switch ( nId )
419 {
420 case ESCHER_Prop_WrapText: // 133
421 {
422 const char *pWrapType = nullptr;
423 switch ( opt.nPropValue )
424 {
426 case ESCHER_WrapByPoints: pWrapType = "square"; break; // these two are equivalent according to the docu
427 case ESCHER_WrapNone: pWrapType = "none"; break;
430 break; // last two are *undefined* in MS-ODRAW, don't exist in VML
431 }
432 if ( pWrapType )
433 {
434 m_ShapeStyle.append(";mso-wrap-style:");
435 m_ShapeStyle.append(pWrapType);
436 }
437 }
438 bAlreadyWritten[ ESCHER_Prop_WrapText ] = true;
439 break;
440
441 case ESCHER_Prop_AnchorText: // 135
442 {
443 char const* pValue(nullptr);
444 switch (opt.nPropValue)
445 {
446 case ESCHER_AnchorTop:
447 pValue = "top";
448 break;
450 pValue = "middle";
451 break;
453 pValue = "bottom";
454 break;
456 pValue = "top-center";
457 break;
459 pValue = "middle-center";
460 break;
462 pValue = "bottom-center";
463 break;
465 pValue = "top-baseline";
466 break;
468 pValue = "bottom-baseline";
469 break;
471 pValue = "top-center-baseline";
472 break;
474 pValue = "bottom-center-baseline";
475 break;
476 }
477 m_ShapeStyle.append(";v-text-anchor:");
478 m_ShapeStyle.append(pValue);
479 }
480 break;
481
482 case ESCHER_Prop_txflTextFlow: // 136
483 {
484 // at least "bottom-to-top" only has an effect when it's on the v:textbox element, not on v:shape
485 assert(m_TextboxStyle.isEmpty());
486 switch (opt.nPropValue)
487 {
488 case ESCHER_txflHorzN:
489 m_TextboxStyle.append("layout-flow:horizontal");
490 break;
491 case ESCHER_txflTtoBA:
492 m_TextboxStyle.append("layout-flow:vertical");
493 break;
494 case ESCHER_txflBtoT:
495 m_TextboxStyle.append("mso-layout-flow-alt:bottom-to-top");
496 break;
497 default:
498 assert(false); // unimplemented in escher export
499 break;
500 }
501 }
502 break;
503
504 // coordorigin
505 case ESCHER_Prop_geoLeft: // 320
506 case ESCHER_Prop_geoTop: // 321
507 {
508 sal_uInt32 nLeft = 0, nTop = 0;
509
510 if ( nId == ESCHER_Prop_geoLeft )
511 {
512 nLeft = opt.nPropValue;
513 rProps.GetOpt( ESCHER_Prop_geoTop, nTop );
514 }
515 else
516 {
517 nTop = opt.nPropValue;
518 rProps.GetOpt( ESCHER_Prop_geoLeft, nLeft );
519 }
520 if(nTop!=0 && nLeft!=0)
521 m_pShapeAttrList->add( XML_coordorigin,
522 OString::number( nLeft ) + "," + OString::number( nTop ) );
523 }
524 bAlreadyWritten[ ESCHER_Prop_geoLeft ] = true;
525 bAlreadyWritten[ ESCHER_Prop_geoTop ] = true;
526 break;
527
528 // coordsize
529 case ESCHER_Prop_geoRight: // 322
530 case ESCHER_Prop_geoBottom: // 323
531 {
532 sal_uInt32 nLeft = 0, nRight = 0, nTop = 0, nBottom = 0;
533 rProps.GetOpt( ESCHER_Prop_geoLeft, nLeft );
534 rProps.GetOpt( ESCHER_Prop_geoTop, nTop );
535
536 if ( nId == ESCHER_Prop_geoRight )
537 {
538 nRight = opt.nPropValue;
539 rProps.GetOpt( ESCHER_Prop_geoBottom, nBottom );
540 }
541 else
542 {
543 nBottom = opt.nPropValue;
544 rProps.GetOpt( ESCHER_Prop_geoRight, nRight );
545 }
546
547 if(nBottom!=0 && nRight!=0 )
548 m_pShapeAttrList->add( XML_coordsize,
549 OString::number( nRight - nLeft ) + "," + OString::number( nBottom - nTop ) );
550 }
551 bAlreadyWritten[ ESCHER_Prop_geoRight ] = true;
552 bAlreadyWritten[ ESCHER_Prop_geoBottom ] = true;
553 break;
554
555 case ESCHER_Prop_pVertices: // 325
556 case ESCHER_Prop_pSegmentInfo: // 326
557 {
558 EscherPropSortStruct aVertices;
560
561 if ( rProps.GetOpt( ESCHER_Prop_pVertices, aVertices ) &&
563 {
564 const sal_uInt8 *pVerticesIt = aVertices.nProp.data() + 6;
565 const sal_uInt8 *pSegmentIt = aSegments.nProp.data();
566 OStringBuffer aPath( 512 );
567
568 sal_uInt16 nPointSize = aVertices.nProp[4] + ( aVertices.nProp[5] << 8 );
569
570 // number of segments
571 sal_uInt16 nSegments = impl_GetUInt16( pSegmentIt );
572 pSegmentIt += 4;
573
574 for ( ; nSegments; --nSegments )
575 {
576 sal_uInt16 nSeg = impl_GetUInt16( pSegmentIt );
577
578 // The segment type is stored in the upper 3 bits
579 // and segment count is stored in the lower 13
580 // bits.
581 unsigned char nSegmentType = (nSeg & 0xE000) >> 13;
582 unsigned short nSegmentCount = nSeg & 0x03FF;
583
584 switch (nSegmentType)
585 {
586 case msopathMoveTo:
587 {
588 sal_Int32 nX = impl_GetPointComponent( pVerticesIt, nPointSize );
589 sal_Int32 nY = impl_GetPointComponent( pVerticesIt, nPointSize );
590 if (nX >= 0 && nY >= 0 )
591 aPath.append( "m" + OString::number( nX ) + "," + OString::number( nY ) );
592 break;
593 }
595 break;
596 case msopathEscape:
597 {
598 // If the segment type is msopathEscape, the lower 13 bits are
599 // divided in a 5 bit escape code and 8 bit
600 // vertex count (not segment count!)
601 unsigned char nEscapeCode = (nSegmentCount & 0x1F00) >> 8;
602 unsigned char nVertexCount = nSegmentCount & 0x00FF;
603 pVerticesIt += nVertexCount;
604
605 switch (nEscapeCode)
606 {
607 case 0xa: // nofill
608 aPath.append( "nf" );
609 break;
610 case 0xb: // nostroke
611 aPath.append( "ns" );
612 break;
613 }
614
615 break;
616 }
617 case msopathLineTo:
618 for (unsigned short i = 0; i < nSegmentCount; ++i)
619 {
620 sal_Int32 nX = impl_GetPointComponent( pVerticesIt, nPointSize );
621 sal_Int32 nY = impl_GetPointComponent( pVerticesIt, nPointSize );
622 aPath.append( "l" + OString::number( nX ) + "," + OString::number( nY ) );
623 }
624 break;
625 case msopathCurveTo:
626 for (unsigned short i = 0; i < nSegmentCount; ++i)
627 {
628 sal_Int32 nX1 = impl_GetPointComponent( pVerticesIt, nPointSize );
629 sal_Int32 nY1 = impl_GetPointComponent( pVerticesIt, nPointSize );
630 sal_Int32 nX2 = impl_GetPointComponent( pVerticesIt, nPointSize );
631 sal_Int32 nY2 = impl_GetPointComponent( pVerticesIt, nPointSize );
632 sal_Int32 nX3 = impl_GetPointComponent( pVerticesIt, nPointSize );
633 sal_Int32 nY3 = impl_GetPointComponent( pVerticesIt, nPointSize );
634 aPath.append( "c" + OString::number( nX1 ) + "," + OString::number( nY1 ) + "," +
635 OString::number( nX2 ) + "," + OString::number( nY2 ) + "," +
636 OString::number( nX3 ) + "," + OString::number( nY3 ) );
637 }
638 break;
639 case msopathClose:
640 aPath.append( "x" );
641 break;
642 case msopathEnd:
643 aPath.append( "e" );
644 break;
645 default:
646 SAL_WARN("oox", "Totally b0rked");
647 break;
648 case msopathInvalid:
649 SAL_WARN("oox", "Invalid - should never be found");
650 break;
651 }
652 }
653 OString pathString = aPath.makeStringAndClear();
654 if ( !pathString.isEmpty() && pathString != "xe" )
655 m_pShapeAttrList->add( XML_path, pathString );
656 }
657 else
658 SAL_WARN("oox.vml", "unhandled shape path, missing either pVertices or pSegmentInfo.");
659 }
660 bAlreadyWritten[ ESCHER_Prop_pVertices ] = true;
661 bAlreadyWritten[ ESCHER_Prop_pSegmentInfo ] = true;
662 break;
663
664 case ESCHER_Prop_fillType: // 384
665 case ESCHER_Prop_fillColor: // 385
666 case ESCHER_Prop_fillBackColor: // 387
667 case ESCHER_Prop_fillBlip: // 390
668 case ESCHER_Prop_fNoFillHitTest: // 447
669 case ESCHER_Prop_fillOpacity: // 386
670 {
671 sal_uInt32 nValue;
673 = FastSerializerHelper::createAttrList();
674
675 bool imageData = false;
676 EscherPropSortStruct aStruct;
677 const SdrGrafObj* pSdrGrafObj = dynamic_cast<const SdrGrafObj*>(m_pSdrObject);
678
679 if (pSdrGrafObj && pSdrGrafObj->isSignatureLine() && m_pTextExport)
680 {
682 = FastSerializerHelper::createAttrList();
683 pAttrListSignatureLine->add(XML_issignatureline, "t");
684 if (!pSdrGrafObj->getSignatureLineId().isEmpty())
685 {
686 pAttrListSignatureLine->add(
687 XML_id, pSdrGrafObj->getSignatureLineId());
688 }
689 if (!pSdrGrafObj->getSignatureLineSuggestedSignerName().isEmpty())
690 {
691 pAttrListSignatureLine->add(
692 FSNS(XML_o, XML_suggestedsigner),
694 }
695 if (!pSdrGrafObj->getSignatureLineSuggestedSignerTitle().isEmpty())
696 {
697 pAttrListSignatureLine->add(
698 FSNS(XML_o, XML_suggestedsigner2),
700 }
701 if (!pSdrGrafObj->getSignatureLineSuggestedSignerEmail().isEmpty())
702 {
703 pAttrListSignatureLine->add(
704 FSNS(XML_o, XML_suggestedsigneremail),
706 }
707 if (!pSdrGrafObj->getSignatureLineSigningInstructions().isEmpty())
708 {
709 pAttrListSignatureLine->add(XML_signinginstructionsset, "t");
710 pAttrListSignatureLine->add(
711 FSNS(XML_o, XML_signinginstructions),
713 }
714 pAttrListSignatureLine->add(
715 XML_showsigndate,
716 pSdrGrafObj->isSignatureLineShowSignDate() ? "t" : "f");
717 pAttrListSignatureLine->add(
718 XML_allowcomments,
719 pSdrGrafObj->isSignatureLineCanAddComment() ? "t" : "f");
720
721 m_pSerializer->singleElementNS(
722 XML_o, XML_signatureline,
723 pAttrListSignatureLine);
724
725 // Get signature line graphic
726 const uno::Reference<graphic::XGraphic>& xGraphic
727 = pSdrGrafObj->getSignatureLineUnsignedGraphic();
728 Graphic aGraphic(xGraphic);
729 OUString aImageId = m_pTextExport->GetDrawingML().WriteImage(aGraphic, false);
730 pAttrList->add(FSNS(XML_r, XML_id), aImageId);
731 imageData = true;
732 }
733 else if (rProps.GetOpt(ESCHER_Prop_fillBlip, aStruct) && m_pTextExport)
734 {
735 SvMemoryStream aStream;
736 // The first bytes are WW8-specific, we're only interested in the PNG
737 int nHeaderSize = 25;
738 aStream.WriteBytes(aStruct.nProp.data() + nHeaderSize,
739 aStruct.nProp.size() - nHeaderSize);
740 aStream.Seek(0);
741 Graphic aGraphic;
742 GraphicConverter::Import(aStream, aGraphic);
743 OUString aImageId = m_pTextExport->GetDrawingML().WriteImage(aGraphic, false);
744 pAttrList->add(FSNS(XML_r, XML_id), aImageId);
745 imageData = true;
746 }
747
749 impl_AddBool(pAttrList.get(), FSNS(XML_o, XML_detectmouseclick), nValue != 0);
750
751 if (imageData && ((pSdrGrafObj && pSdrGrafObj->isSignatureLine())
753 m_pSerializer->singleElementNS( XML_v, XML_imagedata, pAttrList );
754 else
755 {
756 if ( rProps.GetOpt( ESCHER_Prop_fillType, nValue ) )
757 {
758 const char *pFillType = nullptr;
759 switch ( nValue )
760 {
761 case ESCHER_FillSolid: pFillType = "solid"; break;
762 // TODO case ESCHER_FillPattern: pFillType = ""; break;
763 case ESCHER_FillTexture: pFillType = "tile"; break;
764 case ESCHER_FillPicture: pFillType = "frame"; break;
765 // TODO case ESCHER_FillShade: pFillType = ""; break;
766 // TODO case ESCHER_FillShadeCenter: pFillType = ""; break;
767 // TODO case ESCHER_FillShadeShape: pFillType = ""; break;
768 // TODO case ESCHER_FillShadeScale: pFillType = ""; break;
769 // TODO case ESCHER_FillShadeTitle: pFillType = ""; break;
770 // TODO case ESCHER_FillBackground: pFillType = ""; break;
771 default:
772 SAL_INFO("oox.vml", "Unhandled fill type: " << nValue);
773 break;
774 }
775 if ( pFillType )
776 pAttrList->add( XML_type, pFillType );
777 }
778 else if (!rProps.GetOpt(ESCHER_Prop_fillColor, nValue))
779 pAttrList->add( XML_on, "false" );
780
781 if ( rProps.GetOpt( ESCHER_Prop_fillColor, nValue ) )
782 impl_AddColor( m_pShapeAttrList.get(), XML_fillcolor, nValue );
783
784 if ( rProps.GetOpt( ESCHER_Prop_fillBackColor, nValue ) )
785 impl_AddColor( pAttrList.get(), XML_color2, nValue );
786
788 // Partly undo the transformation at the end of EscherPropertyContainer::CreateFillProperties(): VML opacity is 0..1.
789 pAttrList->add(XML_opacity, OString::number(double((nValue * 100) >> 16) / 100));
790 m_pSerializer->singleElementNS( XML_v, XML_fill, pAttrList );
791
792 }
793 }
794 bAlreadyWritten[ ESCHER_Prop_fillType ] = true;
795 bAlreadyWritten[ ESCHER_Prop_fillColor ] = true;
796 bAlreadyWritten[ ESCHER_Prop_fillBackColor ] = true;
797 bAlreadyWritten[ ESCHER_Prop_fillBlip ] = true;
798 bAlreadyWritten[ ESCHER_Prop_fNoFillHitTest ] = true;
799 bAlreadyWritten[ ESCHER_Prop_fillOpacity ] = true;
800 break;
801
802 case ESCHER_Prop_lineColor: // 448
803 case ESCHER_Prop_lineWidth: // 459
804 case ESCHER_Prop_lineDashing: // 462
811 case ESCHER_Prop_lineJoinStyle: // 470
812 case ESCHER_Prop_lineEndCapStyle: // 471
813 {
814 sal_uInt32 nValue;
815 rtl::Reference<sax_fastparser::FastAttributeList> pAttrList = FastSerializerHelper::createAttrList();
816
817 if ( rProps.GetOpt( ESCHER_Prop_lineColor, nValue ) )
818 impl_AddColor( pAttrList.get(), XML_color, nValue );
819
820 if ( rProps.GetOpt( ESCHER_Prop_lineWidth, nValue ) )
821 impl_AddInt( pAttrList.get(), XML_weight, nValue );
822
823 if ( rProps.GetOpt( ESCHER_Prop_lineDashing, nValue ) )
824 {
825 const char *pDashStyle = nullptr;
826 switch ( nValue )
827 {
828 case ESCHER_LineSolid: pDashStyle = "solid"; break;
829 case ESCHER_LineDashSys: pDashStyle = "shortdash"; break;
830 case ESCHER_LineDotSys: pDashStyle = "shortdot"; break;
831 case ESCHER_LineDashDotSys: pDashStyle = "shortdashdot"; break;
832 case ESCHER_LineDashDotDotSys: pDashStyle = "shortdashdotdot"; break;
833 case ESCHER_LineDotGEL: pDashStyle = "dot"; break;
834 case ESCHER_LineDashGEL: pDashStyle = "dash"; break;
835 case ESCHER_LineLongDashGEL: pDashStyle = "longdash"; break;
836 case ESCHER_LineDashDotGEL: pDashStyle = "dashdot"; break;
837 case ESCHER_LineLongDashDotGEL: pDashStyle = "longdashdot"; break;
838 case ESCHER_LineLongDashDotDotGEL: pDashStyle = "longdashdotdot"; break;
839 }
840 if ( pDashStyle )
841 pAttrList->add( XML_dashstyle, pDashStyle );
842 }
843
845 impl_AddArrowHead( pAttrList.get(), XML_startarrow, nValue );
846
848 impl_AddArrowHead( pAttrList.get(), XML_endarrow, nValue );
849
851 impl_AddArrowWidth( pAttrList.get(), XML_startarrowwidth, nValue );
852
854 impl_AddArrowLength( pAttrList.get(), XML_startarrowlength, nValue );
855
857 impl_AddArrowWidth( pAttrList.get(), XML_endarrowwidth, nValue );
858
860 impl_AddArrowLength( pAttrList.get(), XML_endarrowlength, nValue );
861
862 if ( rProps.GetOpt( ESCHER_Prop_lineJoinStyle, nValue ) )
863 {
864 const char *pJoinStyle = nullptr;
865 switch ( nValue )
866 {
867 case ESCHER_LineJoinBevel: pJoinStyle = "bevel"; break;
868 case ESCHER_LineJoinMiter: pJoinStyle = "miter"; break;
869 case ESCHER_LineJoinRound: pJoinStyle = "round"; break;
870 }
871 if ( pJoinStyle )
872 pAttrList->add( XML_joinstyle, pJoinStyle );
873 }
874
876 {
877 const char *pEndCap = nullptr;
878 switch ( nValue )
879 {
880 case ESCHER_LineEndCapRound: pEndCap = "round"; break;
881 case ESCHER_LineEndCapSquare: pEndCap = "square"; break;
882 case ESCHER_LineEndCapFlat: pEndCap = "flat"; break;
883 }
884 if ( pEndCap )
885 pAttrList->add( XML_endcap, pEndCap );
886 }
887
888 m_pSerializer->singleElementNS( XML_v, XML_stroke, pAttrList );
889 }
890 bAlreadyWritten[ ESCHER_Prop_lineColor ] = true;
891 bAlreadyWritten[ ESCHER_Prop_lineWidth ] = true;
892 bAlreadyWritten[ ESCHER_Prop_lineDashing ] = true;
893 bAlreadyWritten[ ESCHER_Prop_lineStartArrowhead ] = true;
894 bAlreadyWritten[ ESCHER_Prop_lineEndArrowhead ] = true;
895 bAlreadyWritten[ ESCHER_Prop_lineStartArrowWidth ] = true;
896 bAlreadyWritten[ ESCHER_Prop_lineStartArrowLength ] = true;
897 bAlreadyWritten[ ESCHER_Prop_lineEndArrowWidth ] = true;
898 bAlreadyWritten[ ESCHER_Prop_lineEndArrowLength ] = true;
899 bAlreadyWritten[ ESCHER_Prop_lineJoinStyle ] = true;
900 bAlreadyWritten[ ESCHER_Prop_lineEndCapStyle ] = true;
901 break;
902
904 if ( !opt.nPropValue )
905 m_ShapeStyle.append( ";visibility:hidden" );
906 break;
909 {
910 sal_uInt32 nValue = 0;
911 bool bShadow = false;
912 bool bObscured = false;
914 {
915 bShadow = (( nValue & 0x20002 ) == 0x20002 );
916 bObscured = (( nValue & 0x10001 ) == 0x10001 );
917 }
918 if ( bShadow )
919 {
920 rtl::Reference<sax_fastparser::FastAttributeList> pAttrList = FastSerializerHelper::createAttrList();
921 impl_AddBool( pAttrList.get(), XML_on, bShadow );
922 impl_AddBool( pAttrList.get(), XML_obscured, bObscured );
923
924 if ( rProps.GetOpt( ESCHER_Prop_shadowColor, nValue ) )
925 impl_AddColor( pAttrList.get(), XML_color, nValue );
926
927 m_pSerializer->singleElementNS( XML_v, XML_shadow, pAttrList );
928 bAlreadyWritten[ ESCHER_Prop_fshadowObscured ] = true;
929 bAlreadyWritten[ ESCHER_Prop_shadowColor ] = true;
930 }
931 }
932 break;
935 {
936 EscherPropSortStruct aUnicode;
937 if (rProps.GetOpt(ESCHER_Prop_gtextUNICODE, aUnicode))
938 {
939 SvMemoryStream aStream;
940
941 if(!opt.nProp.empty())
942 {
943 aStream.WriteBytes(opt.nProp.data(), opt.nProp.size());
944 }
945
946 aStream.Seek(0);
947 OUString aTextPathString = SvxMSDffManager::MSDFFReadZString(aStream, opt.nProp.size(), true);
948 aStream.Seek(0);
949
950 m_pSerializer->singleElementNS(XML_v, XML_path, XML_textpathok, "t");
951
952 rtl::Reference<sax_fastparser::FastAttributeList> pAttrList = FastSerializerHelper::createAttrList();
953 pAttrList->add(XML_on, "t");
954 pAttrList->add(XML_fitshape, "t");
955 pAttrList->add(XML_string, aTextPathString);
957 OUString aStyle;
958 if (rProps.GetOpt(ESCHER_Prop_gtextFont, aFont))
959 {
960 aStream.WriteBytes(aFont.nProp.data(), aFont.nProp.size());
961 aStream.Seek(0);
962 OUString aTextPathFont = SvxMSDffManager::MSDFFReadZString(aStream, aFont.nProp.size(), true);
963 aStyle += "font-family:\"" + aTextPathFont + "\"";
964 }
965 sal_uInt32 nSize;
966 if (rProps.GetOpt(ESCHER_Prop_gtextSize, nSize))
967 {
968 float nSizeF = static_cast<sal_Int32>(nSize) / 65536.0;
969 OUString aSize = OUString::number(nSizeF);
970 aStyle += ";font-size:" + aSize + "pt";
971 }
972
973 sal_uInt32 nGtextFlags;
974 if (rProps.GetOpt(DFF_Prop_gtextFStrikethrough /*255*/, nGtextFlags))
975 {
976 // The property is in fact a collection of flags. Two bytes contain the
977 // fUsegtextF* flags and the other two bytes at same place the associated
978 // On/Off flags. See '2.3.22.10 Geometry Text Boolean Properties' section
979 // in [MS-ODRAW].
980 if ((nGtextFlags & 0x00200020) == 0x00200020) // DFF_Prop_gtextFBold = 250
981 aStyle += ";font-weight:bold";
982 if ((nGtextFlags & 0x00100010) == 0x00100010) // DFF_Prop_gtextFItalic = 251
983 aStyle += ";font-style:italic";
984 if ((nGtextFlags & 0x00800080) == 0x00800080) // no DFF, PID gtextFNormalize = 248
985 aStyle += ";v-same-letter-heights:t";
986
987 // The value 'Fontwork character spacing' in LO is bound to field 'Scaling'
988 // not to 'Spacing' in character properties. In fact the characters are
989 // rendered with changed distance and width. The method in escherex.cxx has
990 // put a rounded value of 'CharScaleWidth' API property to
991 // DFF_Prop_gtextSpacing (=196) as integer part of 16.16 fixed point format.
992 // fUsegtextFTight and gtextFTight (244) of MS binary format are not used.
993 sal_uInt32 nGtextSpacing;
994 if (rProps.GetOpt(DFF_Prop_gtextSpacing, nGtextSpacing))
995 aStyle += ";v-text-spacing:" + OUString::number(nGtextSpacing) + "f";
996 }
997
998 if (!aStyle.isEmpty())
999 pAttrList->add(XML_style, aStyle);
1000
1001 // tdf#153260. LO renders all Fontwork shapes as if trim="t" is set. Default
1002 // value is "f". So always write out "t", otherwise import will reduce the
1003 // shape height as workaround for "f".
1004 pAttrList->add(XML_trim, "t");
1005
1006 m_pSerializer->singleElementNS(XML_v, XML_textpath, pAttrList);
1007 }
1008
1009 bAlreadyWritten[ESCHER_Prop_gtextUNICODE] = true;
1010 bAlreadyWritten[ESCHER_Prop_gtextFont] = true;
1011 }
1012 break;
1015 {
1016 // FIXME: tdf#153296: The currently exported markup for <v:shapetype> is based on
1017 // OOXML presets and unusable in regard to handles. Fontwork shapes use dedicated
1018 // own markup, see FontworkHelpers::GetVMLFontworkShapetypeMarkup.
1019 // Thus this is restricted to preset Fontwork shapes. Such have maximal two
1020 // adjustment values.
1023 {
1024 sal_uInt32 nValue;
1025 OString sAdj;
1026 if (rProps.GetOpt(DFF_Prop_adjustValue, nValue))
1027 {
1028 sAdj = OString::number(static_cast<sal_Int32>(nValue));
1029 if (rProps.GetOpt(DFF_Prop_adjust2Value, nValue))
1030 sAdj += "," + OString::number(static_cast<sal_Int32>(nValue));
1031 }
1032 if (!sAdj.isEmpty())
1033 m_pShapeAttrList->add(XML_adj, sAdj);
1034 bAlreadyWritten[DFF_Prop_adjustValue] = true;
1035 bAlreadyWritten[DFF_Prop_adjust2Value] = true;
1036 }
1037 }
1038 break;
1040 {
1041 // The higher half of the variable contains the angle.
1042 m_ShapeStyle.append(";rotation:" + OString::number(double(opt.nPropValue >> 16)));
1043 bAlreadyWritten[ESCHER_Prop_Rotation] = true;
1044 }
1045 break;
1047 {
1048 // See DffPropertyReader::ApplyLineAttributes().
1049 impl_AddBool( m_pShapeAttrList.get(), XML_stroked, (opt.nPropValue & 8) != 0 );
1050 bAlreadyWritten[ESCHER_Prop_fNoLineDrawDash] = true;
1051 }
1052 break;
1053 case ESCHER_Prop_wzName:
1054 {
1055 SvMemoryStream aStream;
1056
1057 if(!opt.nProp.empty())
1058 {
1059 aStream.WriteBytes(opt.nProp.data(), opt.nProp.size());
1060 }
1061
1062 aStream.Seek(0);
1063 OUString idStr = SvxMSDffManager::MSDFFReadZString(aStream, opt.nProp.size(), true);
1064 aStream.Seek(0);
1066 m_pShapeAttrList->add(XML_ID, idStr);
1067
1068 // note that XML_ID is different from XML_id (although it looks like a LO
1069 // implementation distinction without valid justification to me).
1070 // FIXME: XML_ID produces invalid file, see tdf#153183
1071 bAlreadyWritten[ESCHER_Prop_wzName] = true;
1072 }
1073 break;
1074 default:
1075#if OSL_DEBUG_LEVEL > 0
1076 const size_t opt_nProp_size(opt.nProp.size());
1077 SAL_WARN( "oox.vml", "TODO VMLExport::Commit(), unimplemented id: " << nId
1078 << ", value: " << opt.nPropValue
1079 << ", data: [" << opt_nProp_size << "]");
1080 if ( opt.nProp.size() )
1081 {
1082 const sal_uInt8 *pIt = opt.nProp.data();
1083 OStringBuffer buf( " ( " );
1084 for ( int nCount = opt.nProp.size(); nCount; --nCount )
1085 {
1086 buf.append( OString::number(static_cast<sal_Int32>(*pIt), 16) + " ");
1087 ++pIt;
1088 }
1089 buf.append( ")" );
1090 SAL_WARN("oox.vml", std::string_view(buf));
1091 }
1092#endif
1093 break;
1094 }
1095 }
1096
1098}
1099
1100OString VMLExport::ShapeIdString( sal_uInt32 nId )
1101{
1103 return m_sShapeIDPrefix + OString::number( nId );
1104 else
1105 return "shape_" + OString::number( nId );
1106}
1107
1109{
1110 if (m_nShapeFlags & (ShapeFlag::FlipH | ShapeFlag::FlipV))
1111 {
1112 m_ShapeStyle.append( ";flip:" );
1113
1114 if (m_nShapeFlags & ShapeFlag::FlipH)
1115 m_ShapeStyle.append( "x" );
1116
1117 if (m_nShapeFlags & ShapeFlag::FlipV)
1118 m_ShapeStyle.append( "y" );
1119 }
1120}
1121
1123{
1124 // style
1125 if (!m_ShapeStyle.isEmpty())
1126 m_ShapeStyle.append( ";" );
1127
1128 m_ShapeStyle.append( "position:absolute" );
1129
1130 AddFlipXY();
1131
1132 // the actual dimensions
1133 OString aLeft, aTop, aRight, aBottom;
1134
1135 if ( mnGroupLevel == 1 )
1136 {
1137 static constexpr OStringLiteral aPt( "pt" );
1138 aLeft = OString::number( double( rRectangle.Left() ) / 20 ) + aPt;
1139 aTop = OString::number( double( rRectangle.Top() ) / 20 ) + aPt;
1140 aRight = OString::number( double( rRectangle.Right() ) / 20 ) + aPt;
1141 aBottom = OString::number( double( rRectangle.Bottom() ) / 20 ) + aPt;
1142 }
1143 else
1144 {
1145 aLeft = OString::number( rRectangle.Left() );
1146 aTop = OString::number( rRectangle.Top() );
1147 aRight = OString::number( rRectangle.Right() );
1148 aBottom = OString::number( rRectangle.Bottom() );
1149 }
1150
1151 m_pShapeAttrList->add( XML_from, aLeft + "," + aTop );
1152
1153 m_pShapeAttrList->add( XML_to, aRight + "," + aBottom );
1154}
1155
1156void VMLExport::AddRectangleDimensions( OStringBuffer& rBuffer, const tools::Rectangle& rRectangle, bool rbAbsolutePos)
1157{
1158 if ( !rBuffer.isEmpty() )
1159 rBuffer.append( ";" );
1160
1161 if (rbAbsolutePos && !m_bInline)
1162 {
1163 rBuffer.append( "position:absolute;" );
1164 }
1165
1166 if(m_bInline)
1167 {
1168 rBuffer.append( "width:" + OString::number( double( rRectangle.Right() - rRectangle.Left() ) / 20 ) +
1169 "pt;height:" + OString::number( double( rRectangle.Bottom() - rRectangle.Top() ) / 20 ) +
1170 "pt" );
1171 }
1172 else if ( mnGroupLevel == 1 )
1173 {
1174 rBuffer.append( "margin-left:" + OString::number( double( rRectangle.Left() ) / 20 ) +
1175 "pt;margin-top:" + OString::number( double( rRectangle.Top() ) / 20 ) +
1176 "pt;width:" + OString::number( double( rRectangle.Right() - rRectangle.Left() ) / 20 ) +
1177 "pt;height:" + OString::number( double( rRectangle.Bottom() - rRectangle.Top() ) / 20 ) +
1178 "pt" );
1179 }
1180 else
1181 {
1182 rBuffer.append( "left:" + OString::number( rRectangle.Left() ) +
1183 ";top:" + OString::number( rRectangle.Top() ) +
1184 ";width:" + OString::number( rRectangle.Right() - rRectangle.Left() ) +
1185 ";height:" + OString::number( rRectangle.Bottom() - rRectangle.Top() ) );
1186 }
1187
1188 AddFlipXY();
1189}
1190
1191void VMLExport::AddShapeAttribute( sal_Int32 nAttribute, std::string_view rValue )
1192{
1193 m_pShapeAttrList->add( nAttribute, rValue );
1194}
1195
1196static std::vector<OString> lcl_getShapeTypes()
1197{
1198 std::vector<OString> aRet;
1199
1200 OUString aPath("$BRAND_BASE_DIR/" LIBO_SHARE_FOLDER "/filter/vml-shape-types");
1201 rtl::Bootstrap::expandMacros(aPath);
1202 SvFileStream aStream(aPath, StreamMode::READ);
1203 if (aStream.GetError() != ERRCODE_NONE)
1204 SAL_WARN("oox", "failed to open vml-shape-types");
1205 OStringBuffer aLine;
1206 bool bNotDone = aStream.ReadLine(aLine);
1207 while (bNotDone)
1208 {
1209 // Filter out comments.
1210 if (!o3tl::starts_with(aLine, "/"))
1211 aRet.push_back(OString(aLine));
1212 bNotDone = aStream.ReadLine(aLine);
1213 }
1214 return aRet;
1215}
1216
1217static bool lcl_isTextBox(const SdrObject* pSdrObject)
1218{
1219 uno::Reference<beans::XPropertySet> xPropertySet(const_cast<SdrObject*>(pSdrObject)->getUnoShape(), uno::UNO_QUERY);
1220 if (!xPropertySet.is())
1221 return false;
1222 uno::Reference<beans::XPropertySetInfo> xPropertySetInfo = xPropertySet->getPropertySetInfo();
1223 if (!xPropertySetInfo->hasPropertyByName("TextBox"))
1224 return false;
1225 css::uno::Any aTextBox(xPropertySet->getPropertyValue("TextBox"));
1226 if (!aTextBox.hasValue())
1227 return false;
1228 return aTextBox.get<bool>();
1229}
1230
1231static OUString lcl_getAnchorIdFromGrabBag(const SdrObject* pSdrObject)
1232{
1233 OUString aResult;
1234
1235 uno::Reference<beans::XPropertySet> xShape(const_cast<SdrObject*>(pSdrObject)->getUnoShape(), uno::UNO_QUERY);
1236 if (xShape->getPropertySetInfo()->hasPropertyByName("InteropGrabBag"))
1237 {
1238 comphelper::SequenceAsHashMap aInteropGrabBag(xShape->getPropertyValue("InteropGrabBag"));
1239 if (aInteropGrabBag.find("AnchorId") != aInteropGrabBag.end())
1240 aInteropGrabBag["AnchorId"] >>= aResult;
1241 }
1242
1243 return aResult;
1244}
1245
1247{
1250 else
1251 return m_nShapeIDCounter++;
1252}
1253
1255 std::string_view sShapeID, const bool bIsPictureFrame )
1256{
1257 OString sShapeType;
1258 if ( !bIsPictureFrame )
1259 // We don't have a shape definition for host control in presetShapeDefinitions.xml
1260 // So use a definition copied from DOCX file created with MSO
1261 sShapeType = OString::Concat("<v:shapetype id=\"_x0000_t") + sShapeID +
1262 "\" coordsize=\"21600,21600\" o:spt=\"" + sShapeID +
1263 "\" path=\"m,l,21600l21600,21600l21600,xe\">\n"
1264 "<v:stroke joinstyle=\"miter\"/>\n"
1265 "<v:path shadowok=\"f\" o:extrusionok=\"f\" strokeok=\"f\" fillok=\"f\" o:connecttype=\"rect\"/>\n"
1266 "<o:lock v:ext=\"edit\" shapetype=\"t\"/>\n"
1267 "</v:shapetype>";
1268 else
1269 // We don't have a shape definition for picture frame in presetShapeDefinitions.xml
1270 // So use a definition copied from DOCX file created with MSO
1271 sShapeType = OString::Concat("<v:shapetype id=\"_x0000_t") + sShapeID +
1272 "\" coordsize=\"21600,21600\" o:spt=\"" + sShapeID +
1273 "\" o:preferrelative=\"t\" path=\"m@4@5l@4@11@9@11@9@5xe\" filled=\"f\" stroked=\"f\">\n"
1274 "<v:stroke joinstyle=\"miter\"/>\n"
1275 "<v:formulas>\n"
1276 "<v:f eqn=\"if lineDrawn pixelLineWidth 0\"/>\n"
1277 "<v:f eqn=\"sum @0 1 0\"/>\n"
1278 "<v:f eqn=\"sum 0 0 @1\"/>\n"
1279 "<v:f eqn=\"prod @2 1 2\"/>\n"
1280 "<v:f eqn=\"prod @3 21600 pixelWidth\"/>\n"
1281 "<v:f eqn=\"prod @3 21600 pixelHeight\"/>\n"
1282 "<v:f eqn=\"sum @0 0 1\"/>\n"
1283 "<v:f eqn=\"prod @6 1 2\"/>\n"
1284 "<v:f eqn=\"prod @7 21600 pixelWidth\"/>\n"
1285 "<v:f eqn=\"sum @8 21600 0\"/>\n"
1286 "<v:f eqn=\"prod @7 21600 pixelHeight\"/>\n"
1287 "<v:f eqn=\"sum @10 21600 0\"/>\n"
1288 "</v:formulas>\n"
1289 "<v:path o:extrusionok=\"f\" gradientshapeok=\"t\" o:connecttype=\"rect\"/>\n"
1290 "<o:lock v:ext=\"edit\" aspectratio=\"t\"/>\n"
1291 "</v:shapetype>";
1292 return sShapeType;
1293}
1294
1296{
1298 return -1;
1299
1300 // some of the shapes have their own name ;-)
1301 sal_Int32 nShapeElement = -1;
1302 bool bReferToShapeType = false;
1303 switch ( m_nShapeType )
1304 {
1305 case ESCHER_ShpInst_NotPrimitive: nShapeElement = XML_shape; break;
1306 case ESCHER_ShpInst_Rectangle: nShapeElement = XML_rect; break;
1307 case ESCHER_ShpInst_RoundRectangle: nShapeElement = XML_roundrect; break;
1308 case ESCHER_ShpInst_Ellipse: nShapeElement = XML_oval; break;
1309 case ESCHER_ShpInst_Arc: nShapeElement = XML_arc; break;
1310 case ESCHER_ShpInst_Line: nShapeElement = XML_line; break;
1312 {
1313 bReferToShapeType = true;
1314 nShapeElement = XML_shape;
1316 {
1317 m_pSerializer->write(GetVMLShapeTypeDefinition(OString::number(m_nShapeType), false));
1319 }
1320 break;
1321 }
1323 {
1324 bReferToShapeType = true;
1325 nShapeElement = XML_shape;
1327 {
1328 m_pSerializer->write(GetVMLShapeTypeDefinition(OString::number(m_nShapeType), true));
1330 }
1331 break;
1332 }
1333 default:
1334 nShapeElement = XML_shape;
1335 if (m_pSdrObject->IsTextPath())
1336 {
1337 bReferToShapeType = m_aShapeTypeWritten[m_nShapeType];
1338 if (!bReferToShapeType)
1339 {
1340 // Does a predefined markup exist at all?
1342 static_cast<MSO_SPT>(m_nShapeType));
1343 if (!sMarkup.isEmpty())
1344 {
1345 m_pSerializer->write(sMarkup);
1347 bReferToShapeType = true;
1348 }
1349 }
1350 // ToDo: The case bReferToShapeType==false happens for 'non-primitive' shapes for
1351 // example. We need to get the geometry from CustomShapeGeometry in these cases.
1352 }
1354 {
1355 // a predefined shape?
1356 static std::vector<OString> aShapeTypes = lcl_getShapeTypes();
1357 SAL_WARN_IF(m_nShapeType >= aShapeTypes.size(), "oox.vml", "Unknown shape type!");
1358 if (m_nShapeType < aShapeTypes.size() && aShapeTypes[m_nShapeType] != "NULL")
1359 {
1360 bReferToShapeType = true;
1362 {
1363 m_pSerializer->write(aShapeTypes[m_nShapeType]);
1365 }
1366 }
1367 else
1368 {
1369 // rectangle is probably the best fallback...
1370 nShapeElement = XML_rect;
1371 }
1372 }
1373 break;
1374 }
1375
1376 // anchoring
1377 switch (m_eHOri)
1378 {
1379 case text::HoriOrientation::LEFT:
1380 m_ShapeStyle.append(";mso-position-horizontal:left");
1381 break;
1382 case text::HoriOrientation::CENTER:
1383 m_ShapeStyle.append(";mso-position-horizontal:center");
1384 break;
1385 case text::HoriOrientation::RIGHT:
1386 m_ShapeStyle.append(";mso-position-horizontal:right");
1387 break;
1388 case text::HoriOrientation::INSIDE:
1389 m_ShapeStyle.append(";mso-position-horizontal:inside");
1390 break;
1391 case text::HoriOrientation::OUTSIDE:
1392 m_ShapeStyle.append(";mso-position-horizontal:outside");
1393 break;
1394 default:
1395 case text::HoriOrientation::NONE:
1396 break;
1397 }
1398 switch (m_eHRel)
1399 {
1400 case text::RelOrientation::PAGE_PRINT_AREA:
1401 m_ShapeStyle.append(";mso-position-horizontal-relative:margin");
1402 break;
1403 case text::RelOrientation::PAGE_FRAME:
1404 case text::RelOrientation::PAGE_LEFT:
1405 case text::RelOrientation::PAGE_RIGHT:
1406 m_ShapeStyle.append(";mso-position-horizontal-relative:page");
1407 break;
1408 case text::RelOrientation::CHAR:
1409 m_ShapeStyle.append(";mso-position-horizontal-relative:char");
1410 break;
1411 default:
1412 break;
1413 }
1414
1415 switch (m_eVOri)
1416 {
1417 case text::VertOrientation::TOP:
1418 case text::VertOrientation::LINE_TOP:
1419 case text::VertOrientation::CHAR_TOP:
1420 m_ShapeStyle.append(";mso-position-vertical:top");
1421 break;
1422 case text::VertOrientation::CENTER:
1423 case text::VertOrientation::LINE_CENTER:
1424 m_ShapeStyle.append(";mso-position-vertical:center");
1425 break;
1426 case text::VertOrientation::BOTTOM:
1427 case text::VertOrientation::LINE_BOTTOM:
1428 case text::VertOrientation::CHAR_BOTTOM:
1429 m_ShapeStyle.append(";mso-position-vertical:bottom");
1430 break;
1431 default:
1432 case text::VertOrientation::NONE:
1433 break;
1434 }
1435 switch (m_eVRel)
1436 {
1437 case text::RelOrientation::PAGE_PRINT_AREA:
1438 m_ShapeStyle.append(";mso-position-vertical-relative:margin");
1439 break;
1440 case text::RelOrientation::PAGE_FRAME:
1441 m_ShapeStyle.append(";mso-position-vertical-relative:page");
1442 break;
1443 default:
1444 break;
1445 }
1446
1447 if (!m_pSdrObject->getHyperlink().isEmpty())
1448 m_pShapeAttrList->add(
1449 XML_href, m_pSdrObject->getHyperlink());
1450
1451 m_pShapeAttrList->addNS(XML_o, XML_allowincell, m_IsFollowingTextFlow ? "t" : "f");
1452
1453 // add style
1454 m_pShapeAttrList->add( XML_style, m_ShapeStyle.makeStringAndClear() );
1455
1456 OUString sAnchorId = lcl_getAnchorIdFromGrabBag(m_pSdrObject);
1457 if (!sAnchorId.isEmpty())
1458 m_pShapeAttrList->addNS(XML_wp14, XML_anchorId, sAnchorId);
1459
1460 if ( nShapeElement >= 0 && !m_pShapeAttrList->hasAttribute( XML_type ) && bReferToShapeType )
1461 {
1462 OString sType;
1464 sType = "#";
1466 "_x0000_t" + OString::number( m_nShapeType ) );
1467 }
1468
1469 // allow legacy id (which in form controls and textboxes
1470 // by definition seems to have this otherwise illegal name).
1471 m_pSerializer->setAllowXEscape(!m_sShapeIDPrefix.startsWith("_x0000_"));
1472
1473 // start of the shape
1474 m_pSerializer->startElementNS( XML_v, nShapeElement, m_pShapeAttrList );
1475 m_pSerializer->setAllowXEscape(true);
1476
1477 OString const textboxStyle(m_TextboxStyle.makeStringAndClear());
1478
1479 // now check if we have some editeng text (not associated textbox) and we have a text exporter registered
1480 const SdrTextObj* pTxtObj = DynCastSdrTextObj( m_pSdrObject );
1481 if (pTxtObj && m_pTextExport && !m_pSdrObject->IsTextPath()
1483 {
1485
1486 /*
1487 #i13885#
1488 When the object is actively being edited, that text is not set into
1489 the objects normal text object, but lives in a separate object.
1490 */
1491 if (pTxtObj->IsTextEditActive())
1492 {
1493 pParaObj = pTxtObj->CreateEditOutlinerParaObject();
1494 }
1495 else if (pTxtObj->GetOutlinerParaObject())
1496 {
1497 pParaObj = *pTxtObj->GetOutlinerParaObject();
1498 }
1499
1500 if( pParaObj )
1501 {
1502 rtl::Reference<sax_fastparser::FastAttributeList> pTextboxAttrList = FastSerializerHelper::createAttrList();
1503 if (!textboxStyle.isEmpty())
1504 {
1505 pTextboxAttrList->add(XML_style, textboxStyle);
1506 }
1507
1508 // this is reached only in case some text is attached to the shape
1509 m_pSerializer->startElementNS(XML_v, XML_textbox, pTextboxAttrList);
1510 m_pTextExport->WriteOutliner(*pParaObj);
1511 m_pSerializer->endElementNS(XML_v, XML_textbox);
1512 }
1513 }
1514
1515 return nShapeElement;
1516}
1517
1518void VMLExport::EndShape( sal_Int32 nShapeElement )
1519{
1520 if ( nShapeElement < 0 )
1521 return;
1522
1524 {
1525 uno::Reference<drawing::XShape> xShape {const_cast<SdrObject*>(m_pSdrObject)->getUnoShape(), uno::UNO_QUERY};
1526 uno::Reference<beans::XPropertySet> xPropertySet(xShape, uno::UNO_QUERY);
1527 uno::Reference<beans::XPropertySetInfo> xPropertySetInfo = xPropertySet->getPropertySetInfo();
1528 bool bBottomToTop = false;
1529 if (xPropertySetInfo->hasPropertyByName("CustomShapeGeometry"))
1530 {
1531 // In this case a DrawingML DOCX was imported.
1532 auto aAny = xPropertySet->getPropertyValue("WritingMode");
1533 sal_Int16 nWritingMode;
1534 if ((aAny >>= nWritingMode) && nWritingMode == text::WritingMode2::BT_LR)
1535 bBottomToTop = true;
1536 }
1537 else
1538 {
1539 // In this case a pure VML DOCX was imported, so there is no CustomShapeGeometry.
1540 auto pTextExport = m_pTextExport->GetDrawingML().GetTextExport();
1541 // FIXME: somewhy pTextExport is always nullptr, we should find its reason
1542 if (pTextExport)
1543 {
1544 auto xTextFrame = pTextExport->GetUnoTextFrame(xShape);
1545 uno::Reference<beans::XPropertySet> xPropSet(xTextFrame, uno::UNO_QUERY);
1546 auto aAny = xPropSet->getPropertyValue("WritingMode");
1547 sal_Int16 nWritingMode;
1548 if (aAny >>= nWritingMode)
1549 {
1550 switch (nWritingMode)
1551 {
1552 case text::WritingMode2::BT_LR:
1553 bBottomToTop = true;
1554 break;
1555 default:
1556 break;
1557 }
1558 }
1559 }
1560 }
1561 rtl::Reference<sax_fastparser::FastAttributeList> pTextboxAttrList = FastSerializerHelper::createAttrList();
1562 if (bBottomToTop)
1563 pTextboxAttrList->add(XML_style, "mso-layout-flow-alt:bottom-to-top");
1564 m_pSerializer->startElementNS(XML_v, XML_textbox, pTextboxAttrList);
1565
1566 m_pTextExport->WriteVMLTextBox(uno::Reference<drawing::XShape>(xPropertySet, uno::UNO_QUERY_THROW));
1567
1568 m_pSerializer->endElementNS(XML_v, XML_textbox);
1569 }
1570
1571 if (m_pWrapAttrList)
1572 {
1573 m_pSerializer->singleElementNS(XML_w10, XML_wrap, m_pWrapAttrList);
1574 }
1575
1576 // end of the shape
1577 m_pSerializer->endElementNS( XML_v, nShapeElement );
1578}
1579
1580OString const & VMLExport::AddSdrObject( const SdrObject& rObj,
1581 bool const bIsFollowingTextFlow,
1582 sal_Int16 eHOri, sal_Int16 eVOri, sal_Int16 eHRel, sal_Int16 eVRel,
1583 FastAttributeList* pWrapAttrList,
1584 const bool bOOxmlExport, sal_uInt32 nId)
1585{
1586 m_pSdrObject = &rObj;
1587 m_eHOri = eHOri;
1588 m_eVOri = eVOri;
1589 m_eHRel = eHRel;
1590 m_eVRel = eVRel;
1591 m_pWrapAttrList = pWrapAttrList;
1592 m_bInline = false;
1593 m_IsFollowingTextFlow = bIsFollowingTextFlow;
1594 EscherEx::AddSdrObject(rObj, bOOxmlExport, nId);
1595 return m_sShapeId;
1596}
1597
1598OString const & VMLExport::AddInlineSdrObject( const SdrObject& rObj, const bool bOOxmlExport )
1599{
1600 m_pSdrObject = &rObj;
1601 m_eHOri = -1;
1602 m_eVOri = -1;
1603 m_eHRel = -1;
1604 m_eVRel = -1;
1605 m_pWrapAttrList.clear();
1606 m_bInline = true;
1607 m_IsFollowingTextFlow = true;
1608 EscherEx::AddSdrObject(rObj, bOOxmlExport);
1609 return m_sShapeId;
1610}
1611
1612/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
OptionalString sType
sal_uInt32 mnGroupLevel
sal_uInt32 AddSdrObject(const SdrObject &rObj, bool ooxmlExport=false, sal_uInt32 nId=0)
virtual sal_uInt32 GenerateShapeId()
virtual void OpenContainer(sal_uInt16 nEscherContainer, int nRecInstance=0)
const OUString & GetEditAs() const
std::vector< sal_uInt16 > mRecTypes
virtual void CloseContainer()
bool GetOpt(sal_uInt16 nPropertyID, sal_uInt32 &rPropValue) const
const EscherProperties & GetOpts() const
static ErrCode Import(SvStream &rIStm, Graphic &rGraphic, ConvertDataFormat nFormat=ConvertDataFormat::Unknown)
css::uno::Reference< css::graphic::XGraphic > const & getSignatureLineUnsignedGraphic() const
bool isSignatureLine() const
bool isSignatureLineShowSignDate() const
const OUString & getSignatureLineSuggestedSignerTitle() const
const OUString & getSignatureLineSuggestedSignerName() const
const OUString & getSignatureLineId() const
const OUString & getSignatureLineSigningInstructions() const
bool isSignatureLineCanAddComment() const
const OUString & getSignatureLineSuggestedSignerEmail() const
const OUString & getHyperlink() const
virtual const OUString & GetName() const
virtual bool IsTextPath() const
const SfxItemSet & GetMergedItemSet() const
bool IsTextEditActive() const
virtual OutlinerParaObject * GetOutlinerParaObject() const override
std::optional< OutlinerParaObject > CreateEditOutlinerParaObject() const
const SfxPoolItem * GetItem(sal_uInt16 nWhich, bool bSearchInParent=true) const
std::size_t WriteBytes(const void *pData, std::size_t nSize)
bool ReadLine(OStringBuffer &rStr, sal_Int32 nMaxBytesToRead=0xFFFE)
sal_uInt64 Seek(sal_uInt64 nPos)
ErrCode GetError() const
static OUString MSDFFReadZString(SvStream &rIn, sal_uInt32 nMaxLen, bool bUniCode)
iterator find(const OUString &rKey)
virtual css::uno::Reference< css::text::XTextFrame > GetUnoTextFrame(css::uno::Reference< css::drawing::XShape > xShape)=0
Get textbox which belongs to the shape.
OUString WriteImage(const Graphic &rGraphic, bool bRelPathToMedia=false)
If bRelPathToMedia is true add "../" to image folder path while adding the image relationship.
Definition: drawingml.cxx:1536
DMLTextExport * GetTextExport()
The application-specific text exporter callback, if there is one.
Definition: drawingml.hxx:349
sal_uInt32 m_nShapeType
Remember the shape type.
Definition: vmlexport.hxx:94
OString m_sShapeId
Remember the generated shape id.
Definition: vmlexport.hxx:106
ShapeFlag m_nShapeFlags
Remember the shape flags.
Definition: vmlexport.hxx:97
static OString GetVMLShapeTypeDefinition(std::string_view sShapeID, const bool bIsPictureFrame)
Definition: vmlexport.cxx:1254
virtual void EndShape(sal_Int32 nShapeElement)
End the shape.
Definition: vmlexport.cxx:1518
OString ShapeIdString(sal_uInt32 nId)
Create an OString representing the id from a numerical id.
Definition: vmlexport.cxx:1100
OString const & AddInlineSdrObject(const SdrObject &rObj, const bool bOOxmlExport)
Definition: vmlexport.cxx:1598
::sax_fastparser::FSHelperPtr m_pSerializer
Fast serializer to output the data.
Definition: vmlexport.hxx:76
virtual void AddSdrObjectVMLObject(const SdrObject &rObj) override
Definition: vmlexport.cxx:371
void AddFlipXY()
Add flip X and\or flip Y.
Definition: vmlexport.cxx:1108
OStringBuffer m_TextboxStyle
style for textbox
Definition: vmlexport.hxx:103
virtual void CloseContainer() override
Definition: vmlexport.cxx:116
OString m_sShapeIDPrefix
Prefix for overridden shape id generation (used if m_bOverrideShapeIdGeneration is true)
Definition: vmlexport.hxx:123
void OverrideShapeIDGen(bool bOverrideShapeIdGeneration, const OString &sShapeIDPrefix=OString())
Definition: vmlexport.cxx:219
const SdrObject * m_pSdrObject
The object we're exporting.
Definition: vmlexport.hxx:88
virtual void AddShape(sal_uInt32 nShapeType, ShapeFlag nShapeFlags, sal_uInt32 nShapeId=0) override
Definition: vmlexport.cxx:186
std::vector< bool > m_aShapeTypeWritten
Remember which shape types we had already written.
Definition: vmlexport.hxx:109
virtual sal_uInt32 EnterGroup(const OUString &rShapeName, const tools::Rectangle *pBoundRect) override
Definition: vmlexport.cxx:135
void AddShapeAttribute(sal_Int32 nAttribute, std::string_view sValue)
Add an attribute to the generated <v:shape/> element.
Definition: vmlexport.cxx:1191
sal_Int16 m_eHOri
Anchoring - Writer specific properties.
Definition: vmlexport.hxx:82
static bool IsWaterMarkShape(std::u16string_view rStr)
Definition: vmlexport.cxx:212
OString const & AddSdrObject(const SdrObject &rObj, bool const bIsFollowingTextFlow=false, sal_Int16 eHOri=-1, sal_Int16 eVOri=-1, sal_Int16 eHRel=-1, sal_Int16 eVRel=-1, sax_fastparser::FastAttributeList *pWrapAttrList=nullptr, const bool bOOxmlExport=false, sal_uInt32 nId=0)
Export the sdr object as VML.
Definition: vmlexport.cxx:1580
virtual sal_uInt32 GenerateShapeId() override
Override shape ID generation when m_bOverrideShapeIdGeneration is set to true.
Definition: vmlexport.cxx:1246
bool m_bUseHashMarkForType
Use '#' mark for type attribute (check Type Attribute of VML shape in OOXML documentation)
Definition: vmlexport.hxx:115
bool m_bOverrideShapeIdGeneration
There is a shapeid generation mechanism in EscherEx, but it does not seem to work so override the exi...
Definition: vmlexport.hxx:120
sal_uInt64 m_nShapeIDCounter
Counter for generating shape ids (used if m_bOverrideShapeIdGeneration is true)
Definition: vmlexport.hxx:126
virtual void OpenContainer(sal_uInt16 nEscherContainer, int nRecInstance=0) override
Definition: vmlexport.cxx:96
virtual sal_Int32 StartShape()
Start the shape for which we just collected the information.
Definition: vmlexport.cxx:1295
bool m_bSkipwzName
It seems useless to write out an XML_ID attribute next to XML_id which defines the actual shape id.
Definition: vmlexport.hxx:112
void AddRectangleDimensions(OStringBuffer &rBuffer, const tools::Rectangle &rRectangle, bool rbAbsolutePos=true)
Add position and size to the OStringBuffer.
Definition: vmlexport.cxx:1156
virtual void LeaveGroup() override
Definition: vmlexport.cxx:180
virtual ~VMLExport() override
Definition: vmlexport.cxx:92
OStringBuffer m_ShapeStyle
Remember style, the most important shape attribute ;-)
Definition: vmlexport.hxx:100
void SetFS(const ::sax_fastparser::FSHelperPtr &pSerializer)
Definition: vmlexport.cxx:87
VMLTextExport * m_pTextExport
Parent exporter, used for text callback.
Definition: vmlexport.hxx:79
rtl::Reference<::sax_fastparser::FastAttributeList > m_pShapeAttrList
Fill the shape attributes as they come.
Definition: vmlexport.hxx:91
void AddLineDimensions(const tools::Rectangle &rRectangle)
Add starting and ending point of a line to the m_pShapeAttrList.
Definition: vmlexport.cxx:1122
rtl::Reference< sax_fastparser::FastAttributeList > m_pWrapAttrList
Definition: vmlexport.hxx:83
virtual void Commit(EscherPropertyContainer &rProps, const tools::Rectangle &rRect) override
Definition: vmlexport.cxx:375
Interface to be implemented by the parent exporter that knows how to handle shape text.
Definition: vmlexport.hxx:62
virtual void WriteOutliner(const OutlinerParaObject &rParaObj)=0
virtual oox::drawingml::DrawingML & GetDrawingML()=0
virtual void WriteVMLTextBox(css::uno::Reference< css::drawing::XShape > xShape)=0
Write the contents of the textbox that is associated to this shape in VML format.
void add(const FastAttributeList &)
constexpr tools::Long Top() const
tools::Long getOpenHeight() const
constexpr tools::Long Right() const
void setHeight(tools::Long n)
constexpr tools::Long Left() const
constexpr tools::Long Bottom() const
int nCount
float u
#define ERRCODE_NONE
ESCHER_FillPicture
ESCHER_FillTexture
ESCHER_FillSolid
#define ESCHER_Prop_lineColor
#define ESCHER_ShpInst_RoundRectangle
ESCHER_AnchorTopBaseline
ESCHER_AnchorMiddleCentered
ESCHER_AnchorBottom
ESCHER_AnchorBottomBaseline
ESCHER_AnchorTopCenteredBaseline
ESCHER_AnchorTopCentered
ESCHER_AnchorBottomCenteredBaseline
ESCHER_AnchorBottomCentered
ESCHER_AnchorMiddle
ESCHER_AnchorTop
std::vector< EscherPropSortStruct > EscherProperties
ESCHER_LineJoinMiter
ESCHER_LineJoinRound
ESCHER_LineJoinBevel
#define ESCHER_ShpInst_COUNT
#define ESCHER_Prop_lineStartArrowWidth
#define ESCHER_Prop_fNoFillHitTest
ESCHER_WrapNone
ESCHER_WrapByPoints
ESCHER_WrapSquare
ESCHER_WrapThrough
ESCHER_WrapTopBottom
#define ESCHER_ShpInst_HostControl
#define ESCHER_Prop_lineJoinStyle
#define ESCHER_Prop_fshadowObscured
#define ESCHER_Prop_geoRight
#define ESCHER_Prop_fNoLineDrawDash
#define ESCHER_Prop_wzName
#define ESCHER_Prop_gtextUNICODE
#define ESCHER_Prop_lineStartArrowhead
ESCHER_LineEndCapSquare
ESCHER_LineEndCapFlat
ESCHER_LineEndCapRound
#define ESCHER_Prop_AnchorText
ESCHER_txflBtoT
ESCHER_txflTtoBA
ESCHER_txflHorzN
#define ESCHER_Prop_shadowColor
#define ESCHER_Prop_WrapText
ESCHER_LineMediumWidthArrow
ESCHER_LineWideArrow
ESCHER_LineNarrowArrow
#define ESCHER_Prop_lineStartArrowLength
ESCHER_LineLongArrow
ESCHER_LineMediumLenArrow
ESCHER_LineShortArrow
#define ESCHER_Prop_txflTextFlow
#define ESCHER_Prop_gtextSize
#define ESCHER_Prop_Rotation
#define ESCHER_ShpInst_NotPrimitive
#define ESCHER_Prop_geoLeft
#define ESCHER_Prop_gtextFont
#define ESCHER_Prop_lineEndCapStyle
ESCHER_LineDashSys
ESCHER_LineLongDashDotDotGEL
ESCHER_LineDotGEL
ESCHER_LineDashGEL
ESCHER_LineDashDotSys
ESCHER_LineDashDotDotSys
ESCHER_LineDotSys
ESCHER_LineLongDashGEL
ESCHER_LineDashDotGEL
ESCHER_LineSolid
ESCHER_LineLongDashDotGEL
#define ESCHER_Prop_lineWidth
msopathLineTo
msopathCurveTo
msopathInvalid
msopathClientEscape
msopathClose
msopathMoveTo
msopathEscape
msopathEnd
#define ESCHER_Prop_pSegmentInfo
#define ESCHER_Prop_geoBottom
#define ESCHER_Prop_fillBackColor
#define ESCHER_ShpInst_Ellipse
#define ESCHER_Prop_fHidden
#define ESCHER_Prop_pVertices
#define ESCHER_Prop_fillBlip
#define ESCHER_ShpInst_Arc
#define ESCHER_Prop_lineEndArrowLength
#define ESCHER_Prop_lineEndArrowWidth
#define ESCHER_Prop_geoTop
#define ESCHER_ShpInst_Nil
#define ESCHER_ShpInst_Rectangle
#define ESCHER_Prop_fillType
ShapeFlag
#define ESCHER_Prop_fillOpacity
#define ESCHER_SpContainer
#define ESCHER_Prop_lineEndArrowhead
ESCHER_LineArrowOvalEnd
ESCHER_LineArrowStealthEnd
ESCHER_LineArrowOpenEnd
ESCHER_LineArrowDiamondEnd
ESCHER_LineNoEnd
ESCHER_LineArrowEnd
#define ESCHER_Prop_fillColor
#define ESCHER_ShpInst_Line
#define ESCHER_Prop_lineDashing
#define ESCHER_ShpInst_PictureFrame
sal_Int16 nValue
constexpr sal_Int32 FSNS(sal_Int32 namespc, sal_Int32 element)
#define SAL_WARN_IF(condition, area, stream)
#define SAL_WARN(area, stream)
#define SAL_INFO(area, stream)
#define DFF_Prop_adjust2Value
#define DFF_Prop_adjustValue
MSO_SPT
mso_sptTextPlainText
mso_sptTextCanDown
mso_sptTextOnRing
mso_sptTextSimple
#define DFF_Prop_gtextFStrikethrough
#define DFF_Prop_gtextSpacing
OString GetVMLFontworkShapetypeMarkup(const MSO_SPT eShapeType)
Returns the markup for the v:shapetype element for export of a Fontwork shape to VML.
NONE
std::shared_ptr< T > make_shared(Args &&... args)
constexpr bool starts_with(std::basic_string_view< charT, traits > sv, std::basic_string_view< charT, traits > x) noexcept
std::shared_ptr< FastSerializerHelper > FSHelperPtr
XML_type
long Long
XML_ID
sal_Int16 nId
Definition: olehelper.cxx:98
static SfxItemSet & rSet
std::vector< sal_uInt8 > nProp
constexpr TypedWhichId< SdrMetricItem > SDRATTR_TEXT_UPPERDIST(SDRATTR_MISC_FIRST+6)
SVXCORE_DLLPUBLIC SdrTextObj * DynCastSdrTextObj(SdrObject *)
unsigned char sal_uInt8
static sal_Int32 impl_GetPointComponent(const sal_uInt8 *&pVal, sal_uInt16 nPointSize)
Definition: vmlexport.cxx:348
static void impl_AddInt(sax_fastparser::FastAttributeList *pAttrList, sal_Int32 nElement, sal_uInt32 nValue)
Definition: vmlexport.cxx:333
const sal_Int32 Tag_Container
Definition: vmlexport.cxx:62
static void impl_AddArrowLength(sax_fastparser::FastAttributeList *pAttrList, sal_Int32 nElement, sal_uInt32 nValue)
Definition: vmlexport.cxx:251
static void impl_AddColor(sax_fastparser::FastAttributeList *pAttrList, sal_Int32 nElement, sal_uInt32 nColor)
Definition: vmlexport.cxx:293
static void impl_AddBool(sax_fastparser::FastAttributeList *pAttrList, sal_Int32 nElement, bool bValue)
Definition: vmlexport.cxx:285
const sal_Int32 Tag_Commit
Definition: vmlexport.cxx:63
static OUString lcl_getAnchorIdFromGrabBag(const SdrObject *pSdrObject)
Definition: vmlexport.cxx:1231
static std::vector< OString > lcl_getShapeTypes()
Definition: vmlexport.cxx:1196
static void impl_AddArrowHead(sax_fastparser::FastAttributeList *pAttrList, sal_Int32 nElement, sal_uInt32 nValue)
Definition: vmlexport.cxx:231
static void impl_AddArrowWidth(sax_fastparser::FastAttributeList *pAttrList, sal_Int32 nElement, sal_uInt32 nValue)
Definition: vmlexport.cxx:268
static bool lcl_isTextBox(const SdrObject *pSdrObject)
Definition: vmlexport.cxx:1217
static sal_uInt16 impl_GetUInt16(const sal_uInt8 *&pVal)
Definition: vmlexport.cxx:341
std::vector< ISegmentProgressBarRef > aSegments