Coverage Report

Created: 2025-12-08 09:28

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libreoffice/xmloff/source/draw/ximpshap.hxx
Line
Count
Source
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
#pragma once
21
22
#include <com/sun/star/io/XOutputStream.hpp>
23
#include <com/sun/star/document/XActionLockable.hpp>
24
#include <com/sun/star/drawing/Alignment.hpp>
25
#include <com/sun/star/drawing/CircleKind.hpp>
26
#include <com/sun/star/drawing/ConnectorType.hpp>
27
#include <com/sun/star/drawing/EscapeDirection.hpp>
28
#include <com/sun/star/container/XIdentifierContainer.hpp>
29
#include <xmloff/xmlictxt.hxx>
30
#include <com/sun/star/drawing/XShapes.hpp>
31
#include <com/sun/star/text/XTextCursor.hpp>
32
#include <com/sun/star/awt/Point.hpp>
33
#include <xexptran.hxx>
34
#include <vector>
35
#include <xmloff/shapeimport.hxx>
36
#include <xmlmultiimagehelper.hxx>
37
#include <basegfx/matrix/b2dhommatrix.hxx>
38
39
template<typename EnumT> struct SvXMLEnumMapEntry;
40
41
// common shape context
42
43
class SdXMLShapeContext : public SvXMLShapeContext
44
{
45
protected:
46
    // the shape group this object should be created inside
47
    css::uno::Reference< css::drawing::XShapes >  mxShapes;
48
    css::uno::Reference< css::text::XTextCursor > mxCursor;
49
    css::uno::Reference< css::text::XTextCursor > mxOldCursor;
50
    css::uno::Reference< css::xml::sax::XFastAttributeList> mxAttrList;
51
    css::uno::Reference< css::container::XIdentifierContainer > mxGluePoints;
52
    css::uno::Reference< css::document::XActionLockable > mxLockable;
53
54
    OUString               maDrawStyleName;
55
    OUString               maTextStyleName;
56
    OUString               maPresentationClass;
57
    OUString               maShapeName;
58
    OUString               maThumbnailURL;
59
60
    /// whether to restore list context (#91964#)
61
    bool                        mbListContextPushed;
62
63
    XmlStyleFamily              mnStyleFamily;
64
    bool                    mbIsPlaceholder;
65
    bool                        mbClearDefaultAttributes;
66
    bool                    mbIsUserTransformed;
67
    sal_Int32                   mnZOrder;
68
    OUString               maShapeId;
69
    OUString               maLayerName;
70
71
    SdXMLImExTransform2D        mnTransform;
72
    css::awt::Size              maSize;
73
    sal_Int16                   mnRelWidth;
74
    sal_Int16                   mnRelHeight;
75
    css::awt::Point             maPosition;
76
    basegfx::B2DHomMatrix       maUsedTransformation;
77
78
    bool                        mbVisible;
79
    bool                        mbPrintable;
80
    bool mbHaveXmlId;
81
    bool mbTextBox; ///< If the text of this shape is handled by a Writer TextFrame.
82
83
    /** if bSupportsStyle is false, auto styles will be set but not a style */
84
    void SetStyle( bool bSupportsStyle = true );
85
    void SetLayer();
86
    void SetThumbnail();
87
88
    void AddShape(css::uno::Reference< css::drawing::XShape >& xShape);
89
    void AddShape(OUString const & serviceName);
90
    void SetTransformation();
91
92
    using SvXMLImportContext::GetImport;
93
94
    void addGluePoint( const css::uno::Reference< css::xml::sax::XFastAttributeList>& xAttrList );
95
96
    bool isPresentationShape() const;
97
98
public:
99
100
    SdXMLShapeContext( SvXMLImport& rImport,
101
        css::uno::Reference< css::xml::sax::XFastAttributeList> xAttrList,
102
        css::uno::Reference< css::drawing::XShapes > xShapes,
103
        bool bTemporaryShape);
104
    virtual ~SdXMLShapeContext() override;
105
106
    virtual void SAL_CALL startFastElement(
107
        sal_Int32 nElement,
108
        const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) override;
109
    virtual void SAL_CALL endFastElement(sal_Int32 nElement) override;
110
    virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(
111
        sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList >& AttrList ) override;
112
113
    // this is called from the parent group for each unparsed attribute in the attribute list
114
    virtual bool processAttribute( const sax_fastparser::FastAttributeList::FastAttributeIter & );
115
116
};
117
118
// draw:rect context
119
120
class SdXMLRectShapeContext : public SdXMLShapeContext
121
{
122
    sal_Int32                   mnRadius;
123
124
public:
125
126
    SdXMLRectShapeContext( SvXMLImport& rImport,
127
        const css::uno::Reference< css::xml::sax::XFastAttributeList>& xAttrList,
128
        css::uno::Reference< css::drawing::XShapes > const & rShapes,
129
        bool bTemporaryShape);
130
    virtual ~SdXMLRectShapeContext() override;
131
    virtual void SAL_CALL startFastElement(
132
        sal_Int32 nElement,
133
        const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) override;
134
135
    // this is called from the parent group for each unparsed attribute in the attribute list
136
    virtual bool processAttribute( const sax_fastparser::FastAttributeList::FastAttributeIter & ) override;
137
};
138
139
// draw:line context
140
141
class SdXMLLineShapeContext : public SdXMLShapeContext
142
{
143
    sal_Int32                   mnX1;
144
    sal_Int32                   mnY1;
145
    sal_Int32                   mnX2;
146
    sal_Int32                   mnY2;
147
148
public:
149
150
    SdXMLLineShapeContext( SvXMLImport& rImport,
151
        const css::uno::Reference< css::xml::sax::XFastAttributeList>& xAttrList,
152
        css::uno::Reference< css::drawing::XShapes > const & rShapes,
153
        bool bTemporaryShape);
154
    virtual ~SdXMLLineShapeContext() override;
155
    virtual void SAL_CALL startFastElement(
156
        sal_Int32 nElement,
157
        const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) override;
158
159
    // this is called from the parent group for each unparsed attribute in the attribute list
160
    virtual bool processAttribute( const sax_fastparser::FastAttributeList::FastAttributeIter & ) override;
161
};
162
163
// draw:ellipse and draw:circle context
164
165
class SdXMLEllipseShapeContext : public SdXMLShapeContext
166
{
167
    sal_Int32                   mnCX;
168
    sal_Int32                   mnCY;
169
    sal_Int32                   mnRX;
170
    sal_Int32                   mnRY;
171
172
    css::drawing::CircleKind    meKind;
173
    sal_Int32                   mnStartAngle;
174
    sal_Int32                   mnEndAngle;
175
public:
176
177
    SdXMLEllipseShapeContext( SvXMLImport& rImport,
178
        const css::uno::Reference< css::xml::sax::XFastAttributeList>& xAttrList,
179
        css::uno::Reference< css::drawing::XShapes > const & rShapes,
180
        bool bTemporaryShape);
181
    virtual ~SdXMLEllipseShapeContext() override;
182
    virtual void SAL_CALL startFastElement(
183
        sal_Int32 nElement,
184
        const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) override;
185
186
    // this is called from the parent group for each unparsed attribute in the attribute list
187
    virtual bool processAttribute( const sax_fastparser::FastAttributeList::FastAttributeIter & ) override;
188
};
189
190
// draw:polyline and draw:polygon context
191
192
class SdXMLPolygonShapeContext : public SdXMLShapeContext
193
{
194
    OUString               maPoints;
195
    OUString               maViewBox;
196
    bool                   mbClosed;
197
198
public:
199
200
    SdXMLPolygonShapeContext( SvXMLImport& rImport,
201
        const css::uno::Reference< css::xml::sax::XFastAttributeList>& xAttrList,
202
        css::uno::Reference< css::drawing::XShapes > const & rShapes, bool bClosed, bool bTemporaryShape);
203
    virtual ~SdXMLPolygonShapeContext() override;
204
    virtual void SAL_CALL startFastElement(
205
        sal_Int32 nElement,
206
        const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) override;
207
208
    // this is called from the parent group for each unparsed attribute in the attribute list
209
    virtual bool processAttribute( const sax_fastparser::FastAttributeList::FastAttributeIter & ) override;
210
};
211
212
// draw:path context
213
214
class SdXMLPathShapeContext : public SdXMLShapeContext
215
{
216
    OUString               maD;
217
    OUString               maViewBox;
218
219
public:
220
221
    SdXMLPathShapeContext( SvXMLImport& rImport,
222
        const css::uno::Reference< css::xml::sax::XFastAttributeList>& xAttrList,
223
        css::uno::Reference< css::drawing::XShapes > const & rShapes,
224
        bool bTemporaryShape);
225
    virtual ~SdXMLPathShapeContext() override;
226
    virtual void SAL_CALL startFastElement(
227
        sal_Int32 nElement,
228
        const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) override;
229
230
    // this is called from the parent group for each unparsed attribute in the attribute list
231
    virtual bool processAttribute( const sax_fastparser::FastAttributeList::FastAttributeIter & ) override;
232
};
233
234
// draw:text-box context
235
236
class SdXMLTextBoxShapeContext : public SdXMLShapeContext
237
{
238
    sal_Int32                   mnRadius;
239
    OUString                    maChainNextName;
240
241
public:
242
243
    SdXMLTextBoxShapeContext( SvXMLImport& rImport,
244
        const css::uno::Reference< css::xml::sax::XFastAttributeList>& xAttrList,
245
        css::uno::Reference< css::drawing::XShapes > const & rShapes);
246
    virtual ~SdXMLTextBoxShapeContext() override;
247
    virtual void SAL_CALL startFastElement(
248
        sal_Int32 nElement,
249
        const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) override;
250
251
    // this is called from the parent group for each unparsed attribute in the attribute list
252
    virtual bool processAttribute( const sax_fastparser::FastAttributeList::FastAttributeIter & ) override;
253
};
254
255
// draw:control context
256
257
class SdXMLControlShapeContext : public SdXMLShapeContext
258
{
259
private:
260
    OUString maFormId;
261
262
public:
263
264
    SdXMLControlShapeContext( SvXMLImport& rImport,
265
        const css::uno::Reference< css::xml::sax::XFastAttributeList>& xAttrList,
266
        css::uno::Reference< css::drawing::XShapes > const & rShapes,
267
        bool bTemporaryShape);
268
    virtual ~SdXMLControlShapeContext() override;
269
    virtual void SAL_CALL startFastElement(
270
        sal_Int32 nElement,
271
        const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) override;
272
273
    // this is called from the parent group for each unparsed attribute in the attribute list
274
    virtual bool processAttribute( const sax_fastparser::FastAttributeList::FastAttributeIter & ) override;
275
};
276
277
// draw:connector context
278
279
class SdXMLConnectorShapeContext : public SdXMLShapeContext
280
{
281
private:
282
    css::awt::Point maStart;
283
    css::awt::Point maEnd;
284
285
    css::drawing::ConnectorType
286
                    mnType;
287
288
    OUString        maStartShapeId;
289
    sal_Int32       mnStartGlueId;
290
    OUString        maEndShapeId;
291
    sal_Int32       mnEndGlueId;
292
293
    sal_Int32   mnDelta1;
294
    sal_Int32   mnDelta2;
295
    sal_Int32   mnDelta3;
296
297
    css::uno::Any maPath;
298
299
    // Guess from the svg:d attribute whether the shape was rendered using OOXML definition. The
300
    // default value is true to cover files exported to ODF by MS Office, which does not write a
301
    // svg:d attribute. LibreOffice has always written a svg:d attribute.
302
    bool mbLikelyOOXMLCurve;
303
304
public:
305
306
    SdXMLConnectorShapeContext( SvXMLImport& rImport,
307
        const css::uno::Reference< css::xml::sax::XFastAttributeList>& xAttrList,
308
        css::uno::Reference< css::drawing::XShapes > const & rShapes,
309
        bool bTemporaryShape);
310
    virtual ~SdXMLConnectorShapeContext() override;
311
    virtual void SAL_CALL startFastElement(
312
        sal_Int32 nElement,
313
        const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) override;
314
315
    // this is called from the parent group for each unparsed attribute in the attribute list
316
    virtual bool processAttribute( const sax_fastparser::FastAttributeList::FastAttributeIter & ) override;
317
};
318
319
// draw:measure context
320
321
class SdXMLMeasureShapeContext : public SdXMLShapeContext
322
{
323
private:
324
    css::awt::Point maStart;
325
    css::awt::Point maEnd;
326
327
public:
328
329
    SdXMLMeasureShapeContext( SvXMLImport& rImport,
330
        const css::uno::Reference< css::xml::sax::XFastAttributeList>& xAttrList,
331
        css::uno::Reference< css::drawing::XShapes > const & rShapes,
332
        bool bTemporaryShape);
333
    virtual ~SdXMLMeasureShapeContext() override;
334
    virtual void SAL_CALL startFastElement(
335
        sal_Int32 nElement,
336
        const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) override;
337
    virtual void SAL_CALL endFastElement(sal_Int32 nElement) override;
338
339
    // this is called from the parent group for each unparsed attribute in the attribute list
340
    virtual bool processAttribute( const sax_fastparser::FastAttributeList::FastAttributeIter & ) override;
341
};
342
343
// draw:page context
344
345
class SdXMLPageShapeContext : public SdXMLShapeContext
346
{
347
private:
348
    sal_Int32   mnPageNumber;
349
public:
350
351
    SdXMLPageShapeContext( SvXMLImport& rImport,
352
        const css::uno::Reference< css::xml::sax::XFastAttributeList>& xAttrList,
353
        css::uno::Reference< css::drawing::XShapes > const & rShapes,
354
        bool bTemporaryShape);
355
    virtual ~SdXMLPageShapeContext() override;
356
    virtual void SAL_CALL startFastElement(
357
        sal_Int32 nElement,
358
        const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) override;
359
360
    // this is called from the parent group for each unparsed attribute in the attribute list
361
    virtual bool processAttribute( const sax_fastparser::FastAttributeList::FastAttributeIter & ) override;
362
};
363
364
// draw:caption context
365
366
class SdXMLCaptionShapeContext : public SdXMLShapeContext
367
{
368
private:
369
    css::awt::Point maCaptionPoint;
370
    sal_Int32 mnRadius;
371
372
public:
373
374
    SdXMLCaptionShapeContext( SvXMLImport& rImport,
375
        const css::uno::Reference< css::xml::sax::XFastAttributeList>& xAttrList,
376
        css::uno::Reference< css::drawing::XShapes > const & rShapes,
377
        bool bTemporaryShape);
378
    virtual ~SdXMLCaptionShapeContext() override;
379
    virtual void SAL_CALL startFastElement(
380
        sal_Int32 nElement,
381
        const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) override;
382
383
    // this is called from the parent group for each unparsed attribute in the attribute list
384
    virtual bool processAttribute( const sax_fastparser::FastAttributeList::FastAttributeIter & ) override;
385
};
386
387
// office:image context
388
389
class SdXMLGraphicObjectShapeContext : public SdXMLShapeContext
390
{
391
private:
392
    OUString maURL;
393
    OUString msMimeType;
394
    css::uno::Reference < css::io::XOutputStream > mxBase64Stream;
395
    sal_Int32 mnPage;
396
397
public:
398
0
    OUString const& getMimeType() const { return msMimeType; }
399
400
    SdXMLGraphicObjectShapeContext( SvXMLImport& rImport,
401
        const css::uno::Reference< css::xml::sax::XFastAttributeList>& xAttrList,
402
        css::uno::Reference< css::drawing::XShapes > const & rShapes);
403
    virtual ~SdXMLGraphicObjectShapeContext() override;
404
405
    virtual void SAL_CALL startFastElement(
406
        sal_Int32 nElement,
407
        const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) override;
408
    virtual void SAL_CALL endFastElement(sal_Int32 nElement) override;
409
    virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(
410
        sal_Int32 nElement,
411
        const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) override;
412
413
    // this is called from the parent group for each unparsed attribute in the attribute list
414
    virtual bool processAttribute( const sax_fastparser::FastAttributeList::FastAttributeIter & ) override;
415
};
416
417
// chart:chart context
418
419
class SdXMLChartShapeContext : public SdXMLShapeContext
420
{
421
    SvXMLImportContextRef mxChartContext;
422
423
public:
424
425
    SdXMLChartShapeContext( SvXMLImport& rImport,
426
        const css::uno::Reference< css::xml::sax::XFastAttributeList>& xAttrList,
427
        css::uno::Reference< css::drawing::XShapes > const & rShapes,
428
        bool bTemporaryShape);
429
430
    virtual void SAL_CALL startFastElement(
431
        sal_Int32 nElement,
432
        const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) override;
433
    virtual void SAL_CALL endFastElement(sal_Int32 nElement) override;
434
    virtual void SAL_CALL characters( const OUString& rChars ) override;
435
    virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(
436
        sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList >& AttrList ) override;
437
};
438
439
// draw:object and draw:object_ole context
440
441
class SdXMLObjectShapeContext : public SdXMLShapeContext
442
{
443
private:
444
    OUString maCLSID;
445
    OUString maHref;
446
447
    css::uno::Reference < css::io::XOutputStream > mxBase64Stream;
448
449
public:
450
451
    SdXMLObjectShapeContext( SvXMLImport& rImport,
452
        const css::uno::Reference< css::xml::sax::XFastAttributeList>& xAttrList,
453
        css::uno::Reference< css::drawing::XShapes > const & rShapes);
454
    virtual ~SdXMLObjectShapeContext() override;
455
456
    virtual void SAL_CALL startFastElement(
457
        sal_Int32 nElement,
458
        const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) override;
459
    virtual void SAL_CALL endFastElement(sal_Int32 nElement) override;
460
461
    virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(
462
        sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList >& AttrList ) override;
463
464
    // this is called from the parent group for each unparsed attribute in the attribute list
465
    virtual bool processAttribute( const sax_fastparser::FastAttributeList::FastAttributeIter & ) override;
466
};
467
468
// draw:applet
469
470
class SdXMLAppletShapeContext : public SdXMLShapeContext
471
{
472
private:
473
    OUString maAppletName;
474
    OUString maAppletCode;
475
    OUString maHref;
476
    bool mbIsScript;
477
478
    css::uno::Sequence< css::beans::PropertyValue > maParams;
479
480
public:
481
482
    SdXMLAppletShapeContext( SvXMLImport& rImport,
483
        const css::uno::Reference< css::xml::sax::XFastAttributeList>& xAttrList,
484
        css::uno::Reference< css::drawing::XShapes > const & rShapes);
485
    virtual ~SdXMLAppletShapeContext() override;
486
487
    virtual void SAL_CALL startFastElement(
488
        sal_Int32 nElement,
489
        const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) override;
490
    virtual void SAL_CALL endFastElement(sal_Int32 nElement) override;
491
    virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(
492
        sal_Int32 nElement,
493
        const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) override;
494
495
    // this is called from the parent group for each unparsed attribute in the attribute list
496
    virtual bool processAttribute( const sax_fastparser::FastAttributeList::FastAttributeIter & ) override;
497
};
498
499
// draw:plugin
500
501
class SdXMLPluginShapeContext : public SdXMLShapeContext
502
{
503
private:
504
    OUString   maMimeType;
505
    OUString   maHref;
506
    bool            mbMedia;
507
508
    css::uno::Sequence< css::beans::PropertyValue > maParams;
509
510
public:
511
512
    SdXMLPluginShapeContext( SvXMLImport& rImport,
513
        const css::uno::Reference< css::xml::sax::XFastAttributeList>& xAttrList,
514
        css::uno::Reference< css::drawing::XShapes > const & rShapes);
515
    virtual ~SdXMLPluginShapeContext() override;
516
517
    virtual void SAL_CALL startFastElement(
518
        sal_Int32 nElement,
519
        const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) override;
520
    virtual void SAL_CALL endFastElement(sal_Int32 nElement) override;
521
    virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(
522
        sal_Int32 nElement,
523
        const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) override;
524
525
    // this is called from the parent group for each unparsed attribute in the attribute list
526
    virtual bool processAttribute( const sax_fastparser::FastAttributeList::FastAttributeIter & ) override;
527
528
0
    const OUString& getMimeType() const { return maMimeType; }
529
};
530
531
// draw:floating-frame
532
533
class SdXMLFloatingFrameShapeContext : public SdXMLShapeContext
534
{
535
private:
536
    OUString maFrameName;
537
    OUString maHref;
538
539
    css::uno::Reference<css::drawing::XShape> CreateFloatingFrameShape() const;
540
541
public:
542
543
    SdXMLFloatingFrameShapeContext( SvXMLImport& rImport,
544
        const css::uno::Reference< css::xml::sax::XFastAttributeList>& xAttrList,
545
        css::uno::Reference< css::drawing::XShapes > const & rShapes);
546
    virtual ~SdXMLFloatingFrameShapeContext() override;
547
548
    virtual void SAL_CALL startFastElement(
549
        sal_Int32 nElement,
550
        const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) override;
551
    virtual void SAL_CALL endFastElement(sal_Int32 nElement) override;
552
553
    // this is called from the parent group for each unparsed attribute in the attribute list
554
    virtual bool processAttribute( const sax_fastparser::FastAttributeList::FastAttributeIter & ) override;
555
};
556
557
// draw:-frame
558
559
class SdXMLFrameShapeContext : public SdXMLShapeContext, public MultiImageImportHelper
560
{
561
private:
562
    bool mbSupportsReplacement;
563
    SvXMLImportContextRef mxImplContext;
564
    SvXMLImportContextRef mxReplImplContext;
565
566
protected:
567
    /// helper to get the created xShape instance, needs to be overridden
568
    void removeGraphicFromImportContext(const SvXMLImportContext& rContext) override;
569
    OUString getGraphicPackageURLFromImportContext(const SvXMLImportContext& rContext) const override;
570
    OUString getMimeTypeFromImportContext(const SvXMLImportContext& rContext) const override;
571
    css::uno::Reference<css::graphic::XGraphic> getGraphicFromImportContext(const SvXMLImportContext& rContext) const override;
572
573
public:
574
575
    SdXMLFrameShapeContext( SvXMLImport& rImport,
576
        const css::uno::Reference< css::xml::sax::XFastAttributeList>& xAttrList,
577
        css::uno::Reference< css::drawing::XShapes > const & rShapes,
578
        bool bTemporaryShape);
579
    virtual ~SdXMLFrameShapeContext() override;
580
581
    virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(
582
        sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList >& AttrList ) override;
583
584
    virtual void SAL_CALL startFastElement(
585
        sal_Int32 nElement,
586
        const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) override;
587
    virtual void SAL_CALL endFastElement(sal_Int32 nElement) override;
588
589
    virtual bool processAttribute( const sax_fastparser::FastAttributeList::FastAttributeIter & ) override;
590
};
591
592
class SdXMLCustomShapeContext : public SdXMLShapeContext
593
{
594
    OUString maCustomShapeEngine;
595
    OUString maCustomShapeData;
596
597
    std::vector< css::beans::PropertyValue > maCustomShapeGeometry;
598
599
public:
600
601
602
    SdXMLCustomShapeContext( SvXMLImport& rImport,
603
        const css::uno::Reference< css::xml::sax::XFastAttributeList>& xAttrList,
604
        css::uno::Reference< css::drawing::XShapes > const & rShapes);
605
    virtual ~SdXMLCustomShapeContext() override;
606
607
    virtual void SAL_CALL startFastElement(
608
        sal_Int32 nElement,
609
        const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) override;
610
    virtual void SAL_CALL endFastElement(sal_Int32 nElement) override;
611
    virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(
612
        sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList >& AttrList ) override;
613
614
    // this is called from the parent group for each unparsed attribute in the attribute list
615
    virtual bool processAttribute( const sax_fastparser::FastAttributeList::FastAttributeIter & ) override;
616
};
617
618
// draw:table
619
620
class SdXMLTableShapeContext : public SdXMLShapeContext
621
{
622
public:
623
624
    SdXMLTableShapeContext( SvXMLImport& rImport,
625
        const css::uno::Reference< css::xml::sax::XFastAttributeList>& xAttrList,
626
        css::uno::Reference< css::drawing::XShapes > const & rShapes );
627
    virtual ~SdXMLTableShapeContext() override;
628
629
    virtual void SAL_CALL startFastElement(
630
        sal_Int32 nElement,
631
        const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) override;
632
    virtual void SAL_CALL endFastElement(sal_Int32 nElement) override;
633
634
    virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(
635
        sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList >& AttrList ) override;
636
637
    // this is called from the parent group for each unparsed attribute in the attribute list
638
    virtual bool processAttribute( const sax_fastparser::FastAttributeList::FastAttributeIter & ) override;
639
640
private:
641
    SvXMLImportContextRef mxTableImportContext;
642
    OUString msTemplateStyleName;
643
    bool maTemplateStylesUsed[6] = {};
644
};
645
646
extern SvXMLEnumMapEntry<css::drawing::Alignment> const aXML_GlueAlignment_EnumMap[];
647
extern SvXMLEnumMapEntry<css::drawing::EscapeDirection> const aXML_GlueEscapeDirection_EnumMap[];
648
649
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */