LibreOffice Module xmloff (master) 1
XMLTextFrameContext.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 <o3tl/string_view.hxx>
21#include <osl/diagnose.h>
22#include <sal/log.hxx>
24#include <comphelper/base64.hxx>
26#include <com/sun/star/frame/XModel.hpp>
27#include <com/sun/star/lang/XMultiServiceFactory.hpp>
28#include <com/sun/star/text/TextContentAnchorType.hpp>
29#include <com/sun/star/beans/XPropertySet.hpp>
30#include <com/sun/star/text/XTextFrame.hpp>
31#include <com/sun/star/container/XNamed.hpp>
32#include <com/sun/star/container/XNameContainer.hpp>
33#include <com/sun/star/graphic/XGraphic.hpp>
34#include <com/sun/star/text/SizeType.hpp>
35#include <com/sun/star/drawing/XShape.hpp>
36#include <com/sun/star/document/XEventsSupplier.hpp>
37#include <com/sun/star/document/XEmbeddedObjectSupplier.hpp>
38#include <com/sun/star/io/XOutputStream.hpp>
39#include <com/sun/star/text/HoriOrientation.hpp>
40#include <com/sun/star/text/VertOrientation.hpp>
42#include <utility>
43#include <xmloff/xmlimp.hxx>
44#include <xmloff/xmltoken.hxx>
47#include <xmloff/xmluconv.hxx>
52#include <xmloff/prstylei.hxx>
53#include <xmloff/i18nmap.hxx>
54#include <xexptran.hxx>
65#include <map>
66#include <string_view>
67
68using namespace ::com::sun::star;
69using namespace ::com::sun::star::uno;
70using namespace ::com::sun::star::text;
71using namespace ::com::sun::star::xml::sax;
72using namespace ::com::sun::star::beans;
73using namespace ::com::sun::star::lang;
74using namespace ::com::sun::star::container;
75using namespace ::com::sun::star::drawing;
76using namespace ::com::sun::star::document;
77using namespace ::xmloff::token;
78using ::com::sun::star::document::XEventsSupplier;
79
80#define XML_TEXT_FRAME_TEXTBOX 1
81#define XML_TEXT_FRAME_GRAPHIC 2
82#define XML_TEXT_FRAME_OBJECT 3
83#define XML_TEXT_FRAME_OBJECT_OLE 4
84#define XML_TEXT_FRAME_APPLET 5
85#define XML_TEXT_FRAME_PLUGIN 6
86#define XML_TEXT_FRAME_FLOATING_FRAME 7
87
88typedef ::std::map < const OUString, OUString > ParamMap;
89
91{
92 OUString sHRef;
93 OUString sName;
95 bool bMap;
96
97public:
98
99 inline XMLTextFrameContextHyperlink_Impl( OUString aHRef,
100 OUString aName,
101 OUString aTargetFrameName,
102 bool bMap );
103
104 const OUString& GetHRef() const { return sHRef; }
105 const OUString& GetName() const { return sName; }
106 const OUString& GetTargetFrameName() const { return sTargetFrameName; }
107 bool GetMap() const { return bMap; }
108};
109
111 OUString aHRef, OUString aName,
112 OUString aTargetFrameName, bool bM ) :
113 sHRef(std::move( aHRef )),
114 sName(std::move( aName )),
115 sTargetFrameName(std::move( aTargetFrameName )),
116 bMap( bM )
117{
118}
119
120namespace {
121
122// Implement Title/Description Elements UI (#i73249#)
123class XMLTextFrameTitleOrDescContext_Impl : public SvXMLImportContext
124{
125 OUString& mrTitleOrDesc;
126
127public:
128
129
130 XMLTextFrameTitleOrDescContext_Impl( SvXMLImport& rImport,
131 OUString& rTitleOrDesc );
132
133 virtual void SAL_CALL characters( const OUString& rText ) override;
134};
135
136}
137
138XMLTextFrameTitleOrDescContext_Impl::XMLTextFrameTitleOrDescContext_Impl(
139 SvXMLImport& rImport,
140 OUString& rTitleOrDesc )
141 : SvXMLImportContext( rImport )
142 , mrTitleOrDesc( rTitleOrDesc )
143{
144}
145
146void XMLTextFrameTitleOrDescContext_Impl::characters( const OUString& rText )
147{
148 mrTitleOrDesc += rText;
149}
150
151namespace {
152
153class XMLTextFrameParam_Impl : public SvXMLImportContext
154{
155public:
156 XMLTextFrameParam_Impl( SvXMLImport& rImport,
157 const css::uno::Reference< css::xml::sax::XFastAttributeList > & xAttrList,
158 ParamMap &rParamMap);
159};
160
161}
162
163XMLTextFrameParam_Impl::XMLTextFrameParam_Impl(
164 SvXMLImport& rImport,
165 const css::uno::Reference< css::xml::sax::XFastAttributeList > & xAttrList,
166 ParamMap &rParamMap):
167 SvXMLImportContext( rImport )
168{
169 OUString sName, sValue;
170 bool bFoundValue = false; // to allow empty values
171 for (auto &aIter : sax_fastparser::castToFastAttributeList( xAttrList ))
172 {
173 switch (aIter.getToken())
174 {
175 case XML_ELEMENT(DRAW, XML_VALUE):
176 {
177 sValue = aIter.toString();
178 bFoundValue = true;
179 break;
180 }
181 case XML_ELEMENT(DRAW, XML_NAME):
182 sName = aIter.toString();
183 break;
184 default:
185 XMLOFF_WARN_UNKNOWN("xmloff", aIter);
186 }
187 }
188 if (!sName.isEmpty() && bFoundValue )
189 rParamMap[sName] = sValue;
190}
191
192namespace {
193
194class XMLTextFrameContourContext_Impl : public SvXMLImportContext
195{
196 Reference < XPropertySet > xPropSet;
197
198public:
199
200
201 XMLTextFrameContourContext_Impl( SvXMLImport& rImport, sal_Int32 nElement,
202 const css::uno::Reference< css::xml::sax::XFastAttributeList > & xAttrList,
203 const Reference < XPropertySet >& rPropSet,
204 bool bPath );
205};
206
207}
208
209XMLTextFrameContourContext_Impl::XMLTextFrameContourContext_Impl(
210 SvXMLImport& rImport,
211 sal_Int32 /*nElement*/,
212 const Reference< XFastAttributeList > & xAttrList,
213 const Reference < XPropertySet >& rPropSet,
214 bool bPath ) :
215 SvXMLImportContext( rImport ),
216 xPropSet( rPropSet )
217{
218 OUString sD, sPoints, sViewBox;
219 bool bPixelWidth = false, bPixelHeight = false;
220 bool bAuto = false;
221 sal_Int32 nWidth = 0;
222 sal_Int32 nHeight = 0;
223
224 for( auto& aIter : sax_fastparser::castToFastAttributeList(xAttrList) )
225 {
226 switch( aIter.getToken() )
227 {
228 case XML_ELEMENT(SVG, XML_VIEWBOX):
229 case XML_ELEMENT(SVG_COMPAT, XML_VIEWBOX):
230 sViewBox = aIter.toString();
231 break;
232 case XML_ELEMENT(SVG, XML_D):
233 case XML_ELEMENT(SVG_COMPAT, XML_D):
234 if( bPath )
235 sD = aIter.toString();
236 break;
237 case XML_ELEMENT(DRAW,XML_POINTS):
238 if( !bPath )
239 sPoints = aIter.toString();
240 break;
241 case XML_ELEMENT(SVG, XML_WIDTH):
242 case XML_ELEMENT(SVG_COMPAT, XML_WIDTH):
243 if (::sax::Converter::convertMeasurePx(nWidth, aIter.toView()))
244 bPixelWidth = true;
245 else
246 GetImport().GetMM100UnitConverter().convertMeasureToCore(
247 nWidth, aIter.toView());
248 break;
249 case XML_ELEMENT(SVG, XML_HEIGHT):
250 case XML_ELEMENT(SVG_COMPAT, XML_HEIGHT):
251 if (::sax::Converter::convertMeasurePx(nHeight, aIter.toView()))
252 bPixelHeight = true;
253 else
254 GetImport().GetMM100UnitConverter().convertMeasureToCore(
255 nHeight, aIter.toView());
256 break;
258 bAuto = IsXMLToken(aIter, XML_TRUE);
259 break;
260 }
261 }
262
263 OUString sContourPolyPolygon("ContourPolyPolygon");
264 Reference < XPropertySetInfo > xPropSetInfo = rPropSet->getPropertySetInfo();
265
266 if(!xPropSetInfo->hasPropertyByName(sContourPolyPolygon) ||
267 nWidth <= 0 || nHeight <= 0 || bPixelWidth != bPixelHeight ||
268 !(bPath ? sD : sPoints).getLength())
269 return;
270
271 const SdXMLImExViewBox aViewBox( sViewBox, GetImport().GetMM100UnitConverter());
272 basegfx::B2DPolyPolygon aPolyPolygon;
273
274 if( bPath )
275 {
276 basegfx::utils::importFromSvgD(aPolyPolygon, sD, GetImport().needFixPositionAfterZ(), nullptr);
277 }
278 else
279 {
280 basegfx::B2DPolygon aPolygon;
281
282 if(basegfx::utils::importFromSvgPoints(aPolygon, sPoints))
283 {
284 aPolyPolygon = basegfx::B2DPolyPolygon(aPolygon);
285 }
286 }
287
288 if(aPolyPolygon.count())
289 {
290 const basegfx::B2DRange aSourceRange(
291 aViewBox.GetX(), aViewBox.GetY(),
292 aViewBox.GetX() + aViewBox.GetWidth(), aViewBox.GetY() + aViewBox.GetHeight());
293 const basegfx::B2DRange aTargetRange(
294 0.0, 0.0,
295 nWidth, nHeight);
296
297 if(!aSourceRange.equal(aTargetRange))
298 {
299 aPolyPolygon.transform(
301 aSourceRange,
302 aTargetRange));
303 }
304
305 css::drawing::PointSequenceSequence aPointSequenceSequence;
306 basegfx::utils::B2DPolyPolygonToUnoPointSequenceSequence(aPolyPolygon, aPointSequenceSequence);
307 xPropSet->setPropertyValue( sContourPolyPolygon, Any(aPointSequenceSequence) );
308 }
309
310 static constexpr OUStringLiteral sIsPixelContour(u"IsPixelContour");
311
312 if( xPropSetInfo->hasPropertyByName( sIsPixelContour ) )
313 {
314 xPropSet->setPropertyValue( sIsPixelContour, Any(bPixelWidth) );
315 }
316
317 static constexpr OUStringLiteral sIsAutomaticContour(u"IsAutomaticContour");
318
319 if( xPropSetInfo->hasPropertyByName( sIsAutomaticContour ) )
320 {
321 xPropSet->setPropertyValue( sIsAutomaticContour, Any(bAuto) );
322 }
323}
324
325namespace {
326
327class XMLTextFrameContext_Impl : public SvXMLImportContext
328{
329 css::uno::Reference < css::text::XTextCursor > xOldTextCursor;
330 css::uno::Reference < css::beans::XPropertySet > xPropSet;
331 css::uno::Reference < css::io::XOutputStream > xBase64Stream;
332
334 bool mbListContextPushed;
335
336 OUString m_sOrigName;
337 OUString sName;
338 OUString sStyleName;
339 OUString sNextName;
340 OUString sHRef;
341 OUString sCode;
342 OUString sMimeType;
343 OUString sFrameName;
344 OUString sAppletName;
345 OUString sFilterService;
346 OUString sBase64CharsLeft;
347 OUString sTblName;
348 OUStringBuffer maUrlBuffer;
349
350 ParamMap aParamMap;
351
352 sal_Int32 nX;
353 sal_Int32 nY;
354 sal_Int32 nWidth;
355 sal_Int32 nHeight;
356 sal_Int32 nZIndex;
357 sal_Int16 nPage;
358 sal_Int16 nRotation;
359 sal_Int16 nRelWidth;
360 sal_Int16 nRelHeight;
361
362 sal_uInt16 nType;
363 css::text::TextContentAnchorType eAnchorType;
364
365 bool bMayScript : 1;
366 bool bMinWidth : 1;
367 bool bMinHeight : 1;
368 bool bSyncWidth : 1;
369 bool bSyncHeight : 1;
370 bool bCreateFailed : 1;
371 bool bOwnBase64Stream : 1;
372 bool mbMultipleContent : 1; // This context is created based on a multiple content (image)
373 bool m_isDecorative = false;
374 bool m_isSplitAllowed = false;
375
376 void Create();
377
378public:
379
380
381 bool CreateIfNotThere();
382 const OUString& GetHRef() const { return sHRef; }
383
384 XMLTextFrameContext_Impl( SvXMLImport& rImport,
385 sal_Int32 nElement,
386 const css::uno::Reference<css::xml::sax::XFastAttributeList > & rAttrList,
387 css::text::TextContentAnchorType eAnchorType,
388 sal_uInt16 nType,
389 const css::uno::Reference<css::xml::sax::XFastAttributeList > & rFrameAttrList,
390 bool bMultipleContent = false );
391
392 virtual void SAL_CALL endFastElement(sal_Int32 nElement) override;
393
394 virtual void SAL_CALL characters( const OUString& rChars ) override;
395
396 virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(
397 sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList >& AttrList ) override;
398
399 void SetHyperlink( const OUString& rHRef,
400 const OUString& rName,
401 const OUString& rTargetFrameName,
402 bool bMap );
403
404 // Implement Title/Description Elements UI (#i73249#)
405 void SetTitle( const OUString& rTitle );
406
407 void SetDesc( const OUString& rDesc );
408
409 void SetName();
410
411 const OUString& GetOrigName() const { return m_sOrigName; }
412
413 css::text::TextContentAnchorType GetAnchorType() const { return eAnchorType; }
414
415 const css::uno::Reference < css::beans::XPropertySet >& GetPropSet() const { return xPropSet; }
416};
417
418}
419
420void XMLTextFrameContext_Impl::Create()
421{
423 GetImport().GetTextImport();
424
425 switch ( nType)
426 {
429 if( xBase64Stream.is() )
430 {
431 OUString sURL( GetImport().ResolveEmbeddedObjectURLFromBase64() );
432 if( !sURL.isEmpty() )
433 xPropSet = GetImport().GetTextImport()
434 ->createAndInsertOLEObject( GetImport(), sURL,
435 sStyleName,
436 sTblName,
437 nWidth, nHeight );
438 }
439 else if( !sHRef.isEmpty() )
440 {
441 OUString sURL( GetImport().ResolveEmbeddedObjectURL( sHRef,
442 std::u16string_view() ) );
443
444 if( GetImport().IsPackageURL( sHRef ) )
445 {
446 xPropSet = GetImport().GetTextImport()
447 ->createAndInsertOLEObject( GetImport(), sURL,
448 sStyleName,
449 sTblName,
450 nWidth, nHeight );
451 }
452 else
453 {
454 // it should be an own OOo link that has no storage persistence
455 xPropSet = GetImport().GetTextImport()
456 ->createAndInsertOOoLink( GetImport(),
457 sURL,
458 sStyleName,
459 sTblName,
460 nWidth, nHeight );
461 }
462 }
463 else
464 {
465 OUString sURL = "vnd.sun.star.ServiceName:" + sFilterService;
466 xPropSet = GetImport().GetTextImport()
467 ->createAndInsertOLEObject( GetImport(), sURL,
468 sStyleName,
469 sTblName,
470 nWidth, nHeight );
471
472 }
473 break;
475 {
476 xPropSet = GetImport().GetTextImport()
477 ->createAndInsertApplet( sAppletName, sCode,
478 bMayScript, sHRef,
479 nWidth, nHeight);
480 break;
481 }
483 {
484 if(!sHRef.isEmpty())
485 GetImport().GetAbsoluteReference(sHRef);
486 xPropSet = GetImport().GetTextImport()
487 ->createAndInsertPlugin( sMimeType, sHRef,
488 nWidth, nHeight);
489
490 break;
491 }
493 {
494 xPropSet = GetImport().GetTextImport()
495 ->createAndInsertFloatingFrame( sFrameName, sHRef,
496 sStyleName,
497 nWidth, nHeight);
498 break;
499 }
500 default:
501 {
502 Reference<XMultiServiceFactory> xFactory( GetImport().GetModel(),
503 UNO_QUERY );
504 if( xFactory.is() )
505 {
506 OUString sServiceName;
507 switch( nType )
508 {
509 case XML_TEXT_FRAME_TEXTBOX: sServiceName = "com.sun.star.text.TextFrame"; break;
510 case XML_TEXT_FRAME_GRAPHIC: sServiceName = "com.sun.star.text.GraphicObject"; break;
511 }
512 Reference<XInterface> xIfc = xFactory->createInstance( sServiceName );
513 SAL_WARN_IF( !xIfc.is(), "xmloff.text", "couldn't create frame" );
514 if( xIfc.is() )
515 xPropSet.set( xIfc, UNO_QUERY );
516 }
517 }
518 }
519
520 if( !xPropSet.is() )
521 {
522 bCreateFailed = true;
523 return;
524 }
525
526 Reference< XPropertySetInfo > xPropSetInfo = xPropSet->getPropertySetInfo();
527
528 // Skip duplicated frames
529 if(!mbMultipleContent && // It's allowed to have multiple image for the same frame
530 !sName.isEmpty() &&
531 xTextImportHelper->IsDuplicateFrame(sName, nX, nY, nWidth, nHeight))
532 {
533 bCreateFailed = true;
534 return;
535 }
536
537 // set name
538 Reference < XNamed > xNamed( xPropSet, UNO_QUERY );
539 if( xNamed.is() )
540 {
541 OUString sOrigName( xNamed->getName() );
542 if( sOrigName.isEmpty() ||
543 (!sName.isEmpty() && sOrigName != sName) )
544 {
545 OUString sOldName( sName );
546
547 sal_Int32 i = 0;
548 while( xTextImportHelper->HasFrameByName( sName ) )
549 {
550 sName = sOldName + OUString::number( ++i );
551 }
552 xNamed->setName( sName );
553 if( sName != sOldName )
554 {
555 xTextImportHelper->GetRenameMap().Add( XML_TEXT_RENAME_TYPE_FRAME,
556 sOldName, sName );
557
558 }
559 }
560 }
561
562 // frame style
563 XMLPropStyleContext *pStyle = nullptr;
564 if( !sStyleName.isEmpty() )
565 {
566 pStyle = xTextImportHelper->FindAutoFrameStyle( sStyleName );
567 if( pStyle )
568 sStyleName = pStyle->GetParentName();
569 }
570
571 Any aAny;
572 if( !sStyleName.isEmpty() )
573 {
574 OUString sDisplayStyleName( GetImport().GetStyleDisplayName(
575 XmlStyleFamily::SD_GRAPHICS_ID, sStyleName ) );
576 const Reference < XNameContainer > & rStyles =
577 xTextImportHelper->GetFrameStyles();
578 if( rStyles.is() &&
579 rStyles->hasByName( sDisplayStyleName ) )
580 {
581 xPropSet->setPropertyValue( "FrameStyleName", Any(sDisplayStyleName) );
582 }
583 }
584
585 // anchor type (must be set before any other properties, because
586 // otherwise some orientations cannot be set or will be changed
587 // afterwards)
588 xPropSet->setPropertyValue( "AnchorType", Any(eAnchorType) );
589
590 // hard properties
591 if( pStyle )
592 pStyle->FillPropertySet( xPropSet );
593
594 // x and y
595 sal_Int16 nHoriOrient = HoriOrientation::NONE;
596 aAny = xPropSet->getPropertyValue( "HoriOrient" );
597 aAny >>= nHoriOrient;
598 if( HoriOrientation::NONE == nHoriOrient )
599 {
600 xPropSet->setPropertyValue( "HoriOrientPosition", Any(nX) );
601 }
602
603 sal_Int16 nVertOrient = VertOrientation::NONE;
604 aAny = xPropSet->getPropertyValue( "VertOrient" );
605 aAny >>= nVertOrient;
606 if( VertOrientation::NONE == nVertOrient )
607 {
608 xPropSet->setPropertyValue( "VertOrientPosition", Any(nY) );
609 }
610
611 // width
612 if( nWidth > 0 )
613 {
614 xPropSet->setPropertyValue( "Width", Any(nWidth) );
615 }
616 if( nRelWidth > 0 || nWidth > 0 )
617 {
618 xPropSet->setPropertyValue( "RelativeWidth", Any(nRelWidth) );
619 }
620 if( bSyncWidth || nWidth > 0 )
621 {
622 xPropSet->setPropertyValue( "IsSyncWidthToHeight", Any(bSyncWidth) );
623 }
624 if( xPropSetInfo->hasPropertyByName( "WidthType" ) &&
625 (bMinWidth || nWidth > 0 || nRelWidth > 0 ) )
626 {
627 sal_Int16 nSizeType =
628 (bMinWidth && XML_TEXT_FRAME_TEXTBOX == nType) ? SizeType::MIN
629 : SizeType::FIX;
630 xPropSet->setPropertyValue( "WidthType", Any(nSizeType) );
631 }
632
633 if( nHeight > 0 )
634 {
635 xPropSet->setPropertyValue( "Height", Any(nHeight) );
636 }
637 if( nRelHeight > 0 || nHeight > 0 )
638 {
639 xPropSet->setPropertyValue( "RelativeHeight", Any(nRelHeight) );
640 }
641 if( bSyncHeight || nHeight > 0 )
642 {
643 xPropSet->setPropertyValue( "IsSyncHeightToWidth", Any(bSyncHeight) );
644 }
645 if( xPropSetInfo->hasPropertyByName( "SizeType" ) &&
646 (bMinHeight || nHeight > 0 || nRelHeight > 0 ) )
647 {
648 sal_Int16 nSizeType =
649 (bMinHeight && XML_TEXT_FRAME_TEXTBOX == nType) ? SizeType::MIN
650 : SizeType::FIX;
651 xPropSet->setPropertyValue( "SizeType", Any(nSizeType) );
652 }
653
654 if( XML_TEXT_FRAME_GRAPHIC == nType )
655 {
656 // URL
657 OSL_ENSURE( !sHRef.isEmpty() || xBase64Stream.is(),
658 "neither URL nor base64 image data given" );
659 uno::Reference<graphic::XGraphic> xGraphic;
660 if (!sHRef.isEmpty())
661 {
662 xGraphic = GetImport().loadGraphicByURL(sHRef);
663 }
664 else if (xBase64Stream.is())
665 {
666 xGraphic = GetImport().loadGraphicFromBase64(xBase64Stream);
667 xBase64Stream = nullptr;
668 }
669
670 if (xGraphic.is())
671 xPropSet->setPropertyValue("Graphic", Any(xGraphic));
672
673 // filter name
674 xPropSet->setPropertyValue( "GraphicFilter", Any(OUString()) );
675
676 // rotation
677 xPropSet->setPropertyValue( "GraphicRotation", Any(nRotation) );
678 }
679
680 // page number (must be set after the frame is inserted, because it
681 // will be overwritten then inserting the frame.
682 if( TextContentAnchorType_AT_PAGE == eAnchorType && nPage > 0 )
683 {
684 xPropSet->setPropertyValue( "AnchorPageNo", Any(nPage) );
685 }
686
687 if (m_isDecorative && xPropSetInfo->hasPropertyByName("Decorative"))
688 {
689 xPropSet->setPropertyValue("Decorative", uno::Any(true));
690 }
691
692 if (m_isSplitAllowed && xPropSetInfo->hasPropertyByName("IsSplitAllowed"))
693 {
694 xPropSet->setPropertyValue("IsSplitAllowed", uno::Any(true));
695 }
696
697 if( XML_TEXT_FRAME_OBJECT != nType &&
698 XML_TEXT_FRAME_OBJECT_OLE != nType &&
699 XML_TEXT_FRAME_APPLET != nType &&
700 XML_TEXT_FRAME_PLUGIN!= nType &&
702 {
703 Reference < XTextContent > xTxtCntnt( xPropSet, UNO_QUERY );
704 try
705 {
706 xTextImportHelper->InsertTextContent(xTxtCntnt);
707 }
708 catch (lang::IllegalArgumentException const&)
709 {
710 TOOLS_WARN_EXCEPTION("xmloff.text", "Cannot import part of the text - probably an image in the text frame?");
711 return;
712 }
713 }
714
715 // Make adding the shape to Z-Ordering dependent from if we are
716 // inside an inside_deleted_section (redlining). That is necessary
717 // since the shape will be removed again later. It would lead to
718 // errors if it would stay inside the Z-Ordering. Thus, the
719 // easiest way to solve that conflict is to not add it here.
720 if(!GetImport().HasTextImport()
721 || !GetImport().GetTextImport()->IsInsideDeleteContext())
722 {
723 Reference < XShape > xShape( xPropSet, UNO_QUERY );
724
725 GetImport().GetShapeImport()->shapeWithZIndexAdded( xShape, nZIndex );
726 }
727
728 if( XML_TEXT_FRAME_TEXTBOX != nType )
729 return;
730
731 xTextImportHelper->ConnectFrameChains( sName, sNextName, xPropSet );
732 Reference < XTextFrame > xTxtFrame( xPropSet, UNO_QUERY );
733 Reference < XText > xTxt = xTxtFrame->getText();
734 xOldTextCursor = xTextImportHelper->GetCursor();
735 xTextImportHelper->SetCursor( xTxt->createTextCursor() );
736
737 // remember old list item and block (#89892#) and reset them
738 // for the text frame
739 xTextImportHelper->PushListContext();
740 mbListContextPushed = true;
741}
742
744{
745 const XMLTextFrameContext_Impl* pXMLTextFrameContext_Impl = dynamic_cast< const XMLTextFrameContext_Impl* >(&rContext);
746
747 if(!pXMLTextFrameContext_Impl)
748 return;
749
750 try
751 {
752 // just dispose to delete
753 uno::Reference< lang::XComponent > xComp(pXMLTextFrameContext_Impl->GetPropSet(), UNO_QUERY);
754
755 // Inform shape importer about the removal so it can adjust
756 // z-indexes.
757 uno::Reference<drawing::XShape> xShape(xComp, uno::UNO_QUERY);
758 GetImport().GetShapeImport()->shapeRemoved(xShape);
759
760 if(xComp.is())
761 {
762 xComp->dispose();
763 }
764 }
765 catch( uno::Exception& )
766 {
767 OSL_FAIL( "Error in cleanup of multiple graphic object import (!)" );
768 }
769}
770
772{
773 const XMLTextFrameContext_Impl* pXMLTextFrameContext_Impl = dynamic_cast< const XMLTextFrameContext_Impl* >(&rContext);
774
775 if(pXMLTextFrameContext_Impl)
776 {
777 return "vnd.sun.star.Package:" + pXMLTextFrameContext_Impl->GetHRef();
778 }
779
780 return OUString();
781}
782
783css::uno::Reference<css::graphic::XGraphic> XMLTextFrameContext::getGraphicFromImportContext(const SvXMLImportContext& rContext) const
784{
785 uno::Reference<graphic::XGraphic> xGraphic;
786
787 const XMLTextFrameContext_Impl* pXMLTextFrameContext_Impl = dynamic_cast<const XMLTextFrameContext_Impl*>(&rContext);
788
789 if (pXMLTextFrameContext_Impl)
790 {
791 try
792 {
793 const uno::Reference<beans::XPropertySet>& xPropertySet = pXMLTextFrameContext_Impl->GetPropSet();
794
795 if (xPropertySet.is())
796 {
797 xPropertySet->getPropertyValue("Graphic") >>= xGraphic;
798 }
799 }
800 catch (uno::Exception&)
801 {}
802 }
803 return xGraphic;
804}
805
806bool XMLTextFrameContext_Impl::CreateIfNotThere()
807{
808 if( !xPropSet.is() &&
809 ( XML_TEXT_FRAME_OBJECT_OLE == nType ||
810 XML_TEXT_FRAME_GRAPHIC == nType ) &&
811 xBase64Stream.is() && !bCreateFailed )
812 {
813 if( bOwnBase64Stream )
814 xBase64Stream->closeOutput();
815 Create();
816 }
817
818 return xPropSet.is();
819}
820
821XMLTextFrameContext_Impl::XMLTextFrameContext_Impl(
822 SvXMLImport& rImport,
823 sal_Int32 /*nElement*/,
824 const Reference< XFastAttributeList > & rAttrList,
825 TextContentAnchorType eATyp,
826 sal_uInt16 nNewType,
827 const Reference< XFastAttributeList > & rFrameAttrList,
828 bool bMultipleContent )
829: SvXMLImportContext( rImport )
830, mbListContextPushed( false )
831, nType( nNewType )
832, eAnchorType( eATyp )
833{
834 nX = 0;
835 nY = 0;
836 nWidth = 0;
837 nHeight = 0;
838 nZIndex = -1;
839 nPage = 0;
840 nRotation = 0;
841 nRelWidth = 0;
842 nRelHeight = 0;
843 bMayScript = false;
844
845 bMinHeight = false;
846 bMinWidth = false;
847 bSyncWidth = false;
848 bSyncHeight = false;
849 bCreateFailed = false;
850 bOwnBase64Stream = false;
851 mbMultipleContent = bMultipleContent;
852
853 auto processAttr = [&](sal_Int32 nElement, const sax_fastparser::FastAttributeList::FastAttributeIter& aIter) -> void
854 {
855 switch( nElement )
856 {
857 case XML_ELEMENT(DRAW, XML_STYLE_NAME):
858 sStyleName = aIter.toString();
859 break;
860 case XML_ELEMENT(DRAW, XML_NAME):
861 m_sOrigName = aIter.toString();
862 sName = m_sOrigName;
863 break;
864 case XML_ELEMENT(DRAW, XML_FRAME_NAME):
865 sFrameName = aIter.toString();
866 break;
867 case XML_ELEMENT(DRAW, XML_APPLET_NAME):
868 sAppletName = aIter.toString();
869 break;
870 case XML_ELEMENT(TEXT, XML_ANCHOR_TYPE):
871 if( TextContentAnchorType_AT_PARAGRAPH == eAnchorType ||
872 TextContentAnchorType_AT_CHARACTER == eAnchorType ||
873 TextContentAnchorType_AS_CHARACTER == eAnchorType )
874 {
875
876 TextContentAnchorType eNew;
877 if( XMLAnchorTypePropHdl::convert( aIter.toView(), eNew ) &&
878 ( TextContentAnchorType_AT_PARAGRAPH == eNew ||
879 TextContentAnchorType_AT_CHARACTER == eNew ||
880 TextContentAnchorType_AS_CHARACTER == eNew ||
881 TextContentAnchorType_AT_PAGE == eNew) )
882 eAnchorType = eNew;
883 }
884 break;
886 {
887 sal_Int32 nTmp;
888 if (::sax::Converter::convertNumber(nTmp, aIter.toView(), 1, SHRT_MAX))
889 nPage = static_cast<sal_Int16>(nTmp);
890 }
891 break;
892 case XML_ELEMENT(SVG, XML_X):
893 case XML_ELEMENT(SVG_COMPAT, XML_X):
894 GetImport().GetMM100UnitConverter().convertMeasureToCore(
895 nX, aIter.toView());
896 break;
897 case XML_ELEMENT(SVG, XML_Y):
898 case XML_ELEMENT(SVG_COMPAT, XML_Y):
899 GetImport().GetMM100UnitConverter().convertMeasureToCore(
900 nY, aIter.toView() );
901 break;
902 case XML_ELEMENT(SVG, XML_WIDTH):
903 case XML_ELEMENT(SVG_COMPAT, XML_WIDTH):
904 // relative widths are obsolete since SRC617. Remove them some day!
905 if( aIter.toView().find( '%' ) != std::string_view::npos )
906 {
907 sal_Int32 nTmp;
908 if (::sax::Converter::convertPercent(nTmp, aIter.toView()))
909 nRelWidth = static_cast<sal_Int16>(nTmp);
910 }
911 else
912 {
913 GetImport().GetMM100UnitConverter().convertMeasureToCore(
914 nWidth, aIter.toView(), 0 );
915 }
916 break;
917 case XML_ELEMENT(STYLE, XML_REL_WIDTH):
918 if( IsXMLToken(aIter, XML_SCALE) )
919 {
920 bSyncWidth = true;
921 }
922 else
923 {
924 sal_Int32 nTmp;
925 if (::sax::Converter::convertPercent( nTmp, aIter.toView() ))
926 nRelWidth = static_cast<sal_Int16>(nTmp);
927 }
928 break;
929 case XML_ELEMENT(FO, XML_MIN_WIDTH):
930 case XML_ELEMENT(FO_COMPAT, XML_MIN_WIDTH):
931 if( aIter.toView().find( '%' ) != std::string_view::npos )
932 {
933 sal_Int32 nTmp;
934 if (::sax::Converter::convertPercent(nTmp, aIter.toView()))
935 nRelWidth = static_cast<sal_Int16>(nTmp);
936 }
937 else
938 {
939 GetImport().GetMM100UnitConverter().convertMeasureToCore(
940 nWidth, aIter.toView(), 0 );
941 }
942 bMinWidth = true;
943 break;
944 case XML_ELEMENT(SVG, XML_HEIGHT):
945 case XML_ELEMENT(SVG_COMPAT, XML_HEIGHT):
946 // relative heights are obsolete since SRC617. Remove them some day!
947 if( aIter.toView().find( '%' ) != std::string_view::npos )
948 {
949 sal_Int32 nTmp;
950 if (::sax::Converter::convertPercent(nTmp, aIter.toView()))
951 nRelHeight = static_cast<sal_Int16>(nTmp);
952 }
953 else
954 {
955 GetImport().GetMM100UnitConverter().convertMeasureToCore(
956 nHeight, aIter.toView(), 0 );
957 }
958 break;
959 case XML_ELEMENT(STYLE, XML_REL_HEIGHT):
960 if( IsXMLToken( aIter, XML_SCALE ) )
961 {
962 bSyncHeight = true;
963 }
964 else if( IsXMLToken( aIter, XML_SCALE_MIN ) )
965 {
966 bSyncHeight = true;
967 bMinHeight = true;
968 }
969 else
970 {
971 sal_Int32 nTmp;
972 if (::sax::Converter::convertPercent( nTmp, aIter.toView() ))
973 nRelHeight = static_cast<sal_Int16>(nTmp);
974 }
975 break;
976 case XML_ELEMENT(FO, XML_MIN_HEIGHT):
977 case XML_ELEMENT(FO_COMPAT, XML_MIN_HEIGHT):
978 if( aIter.toView().find( '%' ) != std::string_view::npos )
979 {
980 sal_Int32 nTmp;
981 if (::sax::Converter::convertPercent(nTmp, aIter.toView()))
982 nRelHeight = static_cast<sal_Int16>(nTmp);
983 }
984 else
985 {
986 GetImport().GetMM100UnitConverter().convertMeasureToCore(
987 nHeight, aIter.toView(), 0 );
988 }
989 bMinHeight = true;
990 break;
991 case XML_ELEMENT(DRAW, XML_ZINDEX):
992 ::sax::Converter::convertNumber( nZIndex, aIter.toView(), -1 );
993 break;
995 sNextName = aIter.toString();
996 break;
997 case XML_ELEMENT(XLINK, XML_HREF):
998 sHRef = aIter.toString();
999 break;
1000 case XML_ELEMENT(DRAW, XML_TRANSFORM):
1001 {
1002 // RotateFlyFrameFix: im/export full 'draw:transform' using existing tooling
1003 // Currently only rotation is used, but combinations with 'draw:transform'
1004 // may be necessary in the future, so that svg:x/svg:y/svg:width/svg:height
1005 // may be extended/replaced with 'draw:transform' (see draw objects)
1006 SdXMLImExTransform2D aSdXMLImExTransform2D;
1007 basegfx::B2DHomMatrix aFullTransform;
1008
1009 // Use SdXMLImExTransform2D to convert to transformation
1010 // Note: using GetTwipUnitConverter instead of GetMM100UnitConverter may be needed,
1011 // but is not generally available (as it should be, a 'current' UnitConverter should
1012 // be available at GetExport() - and maybe was once). May have to be addressed as soon
1013 // as translate transformations are used here.
1014 aSdXMLImExTransform2D.SetString(aIter.toString(), GetImport().GetMM100UnitConverter());
1015 aSdXMLImExTransform2D.GetFullTransform(aFullTransform);
1016
1017 if(!aFullTransform.isIdentity())
1018 {
1019 const basegfx::utils::B2DHomMatrixBufferedDecompose aDecomposedTransform(aFullTransform);
1020
1021 // currently we *only* use rotation (and translation indirectly), so warn if *any*
1022 // of the other transform parts is used
1023 SAL_WARN_IF(!basegfx::fTools::equal(1.0, aDecomposedTransform.getScale().getX()), "xmloff.text", "draw:transform uses scaleX" );
1024 SAL_WARN_IF(!basegfx::fTools::equal(1.0, aDecomposedTransform.getScale().getY()), "xmloff.text", "draw:transform uses scaleY" );
1025 SAL_WARN_IF(!basegfx::fTools::equalZero(aDecomposedTransform.getShearX()), "xmloff.text", "draw:transform uses shearX" );
1026
1027 // Translation comes from the translate to RotCenter, rot and BackTranslate.
1028 // This means that it represents the translation between unrotated TopLeft
1029 // and rotated TopLeft. This may be checked here now, but currently we only
1030 // use rotation around center and assume that this *was* a rotation around
1031 // center. The check would compare the object's center with the RotCenter
1032 // that can be extracted from the transformation in aFullTransform.
1033 // The definition contains implicitly the RotationCenter absolute
1034 // to the scaled and translated object, so this may be used if needed (see
1035 // _exportTextGraphic how the -trans/rot/trans is composed)
1036
1037 if(!basegfx::fTools::equalZero(aDecomposedTransform.getRotate()))
1038 {
1039 // rotation is used, set it. Convert from deg to 10th degree integer
1040 // CAUTION: due to #i78696# (rotation mirrored using API) the rotate
1041 // value is already mirrored, so do not do it again here (to be in sync
1042 // with XMLTextParagraphExport::_exportTextGraphic normally it would need
1043 // to me mirrored using * -1.0, see conversion there)
1044 // CAUTION-II: due to tdf#115782 it is better for current ODF to indeed use it
1045 // with the wrong orientation as in all other cases - ARGH! We will need to
1046 // correct this in future ODF ASAP! For now, mirror the rotation here AGAIN
1047 const double fRotate(-basegfx::rad2deg<10>(aDecomposedTransform.getRotate()));
1048 nRotation = static_cast< sal_Int16 >(basegfx::fround(fRotate) % 3600);
1049
1050 // tdf#115529 may be negative, with the above modulo maximal -3599, so
1051 // no loop needed here. nRotation is used in setPropertyValue("GraphicRotation")
1052 // and *has* to be in the range [0 .. 3600[
1053 if(nRotation < 0)
1054 {
1055 nRotation += 3600;
1056 }
1057 }
1058 }
1059 }
1060 break;
1061 case XML_ELEMENT(DRAW, XML_CODE):
1062 sCode = aIter.toString();
1063 break;
1064 case XML_ELEMENT(DRAW, XML_OBJECT):
1065 break;
1066 case XML_ELEMENT(DRAW, XML_ARCHIVE):
1067 break;
1068 case XML_ELEMENT(DRAW, XML_MAY_SCRIPT):
1069 bMayScript = IsXMLToken( aIter, XML_TRUE );
1070 break;
1071 case XML_ELEMENT(DRAW, XML_MIME_TYPE):
1072 case XML_ELEMENT(LO_EXT, XML_MIME_TYPE):
1073 sMimeType = aIter.toString();
1074 break;
1077 sTblName = aIter.toString();
1078 break;
1079 case XML_ELEMENT(LO_EXT, XML_DECORATIVE):
1081 ::sax::Converter::convertBool(m_isDecorative, aIter.toString());
1082 break;
1085 sax::Converter::convertBool(m_isSplitAllowed, aIter.toString());
1086 break;
1087 default:
1088 SAL_INFO("xmloff", "unknown attribute " << SvXMLImport::getPrefixAndNameFromToken(aIter.getToken()) << " value=" << aIter.toString());
1089 }
1090 };
1091
1092 for( auto& aIter : sax_fastparser::castToFastAttributeList(rAttrList) )
1093 processAttr(aIter.getToken(), aIter);
1094 for( auto& aIter : sax_fastparser::castToFastAttributeList(rFrameAttrList) )
1095 processAttr(aIter.getToken(), aIter);
1096
1097 if( ( (XML_TEXT_FRAME_GRAPHIC == nType ||
1098 XML_TEXT_FRAME_OBJECT == nType ||
1099 XML_TEXT_FRAME_OBJECT_OLE == nType) &&
1100 sHRef.isEmpty() ) ||
1101 ( XML_TEXT_FRAME_APPLET == nType && sCode.isEmpty() ) ||
1102 ( XML_TEXT_FRAME_PLUGIN == nType &&
1103 sHRef.isEmpty() && sMimeType.isEmpty() ) )
1104 return; // no URL: no image or OLE object
1105
1106 Create();
1107}
1108
1109void XMLTextFrameContext_Impl::endFastElement(sal_Int32 )
1110{
1111 if( ( XML_TEXT_FRAME_OBJECT_OLE == nType ||
1112 XML_TEXT_FRAME_GRAPHIC == nType) &&
1113 !xPropSet.is() && !bCreateFailed )
1114 {
1115 std::u16string_view sTrimmedChars = o3tl::trim(maUrlBuffer);
1116 if( !sTrimmedChars.empty() )
1117 {
1118 if( !xBase64Stream.is() )
1119 {
1120 if( XML_TEXT_FRAME_GRAPHIC == nType )
1121 {
1122 xBase64Stream =
1123 GetImport().GetStreamForGraphicObjectURLFromBase64();
1124 }
1125 else
1126 {
1127 xBase64Stream =
1128 GetImport().GetStreamForEmbeddedObjectURLFromBase64();
1129 }
1130 if( xBase64Stream.is() )
1131 bOwnBase64Stream = true;
1132 }
1133 if( bOwnBase64Stream && xBase64Stream.is() )
1134 {
1135 OUString sChars;
1136 if( !sBase64CharsLeft.isEmpty() )
1137 {
1138 sChars = sBase64CharsLeft + sTrimmedChars;
1139 sBase64CharsLeft.clear();
1140 }
1141 else
1142 {
1143 sChars = sTrimmedChars;
1144 }
1145 Sequence< sal_Int8 > aBuffer( (sChars.getLength() / 4) * 3 );
1146 sal_Int32 nCharsDecoded =
1147 ::comphelper::Base64::decodeSomeChars( aBuffer, sChars );
1148 xBase64Stream->writeBytes( aBuffer );
1149 if( nCharsDecoded != sChars.getLength() )
1150 sBase64CharsLeft = sChars.copy( nCharsDecoded );
1151 }
1152 }
1153 maUrlBuffer.setLength(0);
1154 }
1155
1156 CreateIfNotThere();
1157
1158 if( xOldTextCursor.is() )
1159 {
1160 GetImport().GetTextImport()->DeleteParagraph();
1161 GetImport().GetTextImport()->SetCursor( xOldTextCursor );
1162 }
1163
1164 // reinstall old list item (if necessary) #89892#
1165 if (mbListContextPushed) {
1166 GetImport().GetTextImport()->PopListContext();
1167 }
1168
1169 if (( nType == XML_TEXT_FRAME_APPLET || nType == XML_TEXT_FRAME_PLUGIN ) && xPropSet.is())
1170 GetImport().GetTextImport()->endAppletOrPlugin( xPropSet, aParamMap);
1171}
1172
1173css::uno::Reference< css::xml::sax::XFastContextHandler > XMLTextFrameContext_Impl::createFastChildContext(
1174 sal_Int32 nElement,
1175 const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList )
1176{
1177 if( nElement == XML_ELEMENT(DRAW, XML_PARAM) )
1178 {
1179 if ( nType == XML_TEXT_FRAME_APPLET || nType == XML_TEXT_FRAME_PLUGIN )
1180 return new XMLTextFrameParam_Impl( GetImport(),
1181 xAttrList, aParamMap );
1182 }
1183 else if( nElement == XML_ELEMENT(OFFICE, XML_BINARY_DATA) )
1184 {
1185 if( !xPropSet.is() && !xBase64Stream.is() && !bCreateFailed )
1186 {
1187 switch( nType )
1188 {
1190 xBase64Stream =
1191 GetImport().GetStreamForGraphicObjectURLFromBase64();
1192 break;
1194 xBase64Stream =
1195 GetImport().GetStreamForEmbeddedObjectURLFromBase64();
1196 break;
1197 }
1198 if( xBase64Stream.is() )
1199 return new XMLBase64ImportContext( GetImport(), xBase64Stream );
1200 }
1201 }
1202 // Correction of condition which also avoids warnings. (#i100480#)
1203 if( XML_TEXT_FRAME_OBJECT == nType &&
1204 ( nElement == XML_ELEMENT(OFFICE, XML_DOCUMENT) ||
1205 nElement == XML_ELEMENT(MATH, XML_MATH) ) )
1206 {
1207 if( !xPropSet.is() && !bCreateFailed )
1208 {
1210 new XMLEmbeddedObjectImportContext( GetImport(), nElement, xAttrList );
1211 sFilterService = pEContext->GetFilterServiceName();
1212 if( !sFilterService.isEmpty() )
1213 {
1214 Create();
1215 if( xPropSet.is() )
1216 {
1217 Reference < XEmbeddedObjectSupplier > xEOS( xPropSet,
1218 UNO_QUERY );
1219 OSL_ENSURE( xEOS.is(),
1220 "no embedded object supplier for own object" );
1221 Reference<css::lang::XComponent> aXComponent(xEOS->getEmbeddedObject());
1222 pEContext->SetComponent( aXComponent );
1223 }
1224 }
1225 return pEContext;
1226 }
1227 }
1228
1229 if( xOldTextCursor.is() ) // text-box
1230 {
1231 auto p = GetImport().GetTextImport()->CreateTextChildContext(
1232 GetImport(), nElement, xAttrList,
1234 if (p)
1235 return p;
1236 }
1237
1238 XMLOFF_WARN_UNKNOWN_ELEMENT("xmloff", nElement);
1239
1240 return nullptr;
1241}
1242
1243void XMLTextFrameContext_Impl::characters( const OUString& rChars )
1244{
1245 maUrlBuffer.append(rChars);
1246}
1247
1248void XMLTextFrameContext_Impl::SetHyperlink( const OUString& rHRef,
1249 const OUString& rName,
1250 const OUString& rTargetFrameName,
1251 bool bMap )
1252{
1253 static constexpr OUStringLiteral s_HyperLinkURL = u"HyperLinkURL";
1254 static constexpr OUStringLiteral s_HyperLinkName = u"HyperLinkName";
1255 static constexpr OUStringLiteral s_HyperLinkTarget = u"HyperLinkTarget";
1256 static constexpr OUStringLiteral s_ServerMap = u"ServerMap";
1257 if( !xPropSet.is() )
1258 return;
1259
1260 Reference < XPropertySetInfo > xPropSetInfo =
1261 xPropSet->getPropertySetInfo();
1262 if( !xPropSetInfo.is() ||
1263 !xPropSetInfo->hasPropertyByName(s_HyperLinkURL))
1264 return;
1265
1266 xPropSet->setPropertyValue( s_HyperLinkURL, Any(rHRef) );
1267
1268 if (xPropSetInfo->hasPropertyByName(s_HyperLinkName))
1269 {
1270 xPropSet->setPropertyValue(s_HyperLinkName, Any(rName));
1271 }
1272
1273 if (xPropSetInfo->hasPropertyByName(s_HyperLinkTarget))
1274 {
1275 xPropSet->setPropertyValue( s_HyperLinkTarget, Any(rTargetFrameName) );
1276 }
1277
1278 if (xPropSetInfo->hasPropertyByName(s_ServerMap))
1279 {
1280 xPropSet->setPropertyValue(s_ServerMap, Any(bMap));
1281 }
1282}
1283
1284void XMLTextFrameContext_Impl::SetName()
1285{
1286 Reference<XNamed> xNamed(xPropSet, UNO_QUERY);
1287 if (m_sOrigName.isEmpty() || !xNamed.is())
1288 return;
1289
1290 OUString const name(xNamed->getName());
1291 if (name != m_sOrigName)
1292 {
1293 try
1294 {
1295 xNamed->setName(m_sOrigName);
1296 }
1297 catch (uno::Exception const&)
1298 { // fdo#71698 document contains 2 frames with same draw:name
1299 TOOLS_INFO_EXCEPTION("xmloff.text", "SetName(): exception setting \""
1300 << m_sOrigName << "\"");
1301 }
1302 }
1303}
1304
1305// Implement Title/Description Elements UI (#i73249#)
1306void XMLTextFrameContext_Impl::SetTitle( const OUString& rTitle )
1307{
1308 if ( xPropSet.is() )
1309 {
1310 Reference< XPropertySetInfo > xPropSetInfo = xPropSet->getPropertySetInfo();
1311 if( xPropSetInfo->hasPropertyByName( "Title" ) )
1312 {
1313 xPropSet->setPropertyValue( "Title", Any( rTitle ) );
1314 }
1315 }
1316}
1317
1318void XMLTextFrameContext_Impl::SetDesc( const OUString& rDesc )
1319{
1320 if ( xPropSet.is() )
1321 {
1322 Reference< XPropertySetInfo > xPropSetInfo = xPropSet->getPropertySetInfo();
1323 if( xPropSetInfo->hasPropertyByName( "Description" ) )
1324 {
1325 xPropSet->setPropertyValue( "Description", Any( rDesc ) );
1326 }
1327 }
1328}
1329
1330
1331bool XMLTextFrameContext::CreateIfNotThere( css::uno::Reference < css::beans::XPropertySet >& rPropSet )
1332{
1333 SvXMLImportContext *pContext = m_xImplContext.get();
1334 XMLTextFrameContext_Impl *pImpl = dynamic_cast< XMLTextFrameContext_Impl*>( pContext );
1335 if( pImpl && pImpl->CreateIfNotThere() )
1336 rPropSet = pImpl->GetPropSet();
1337
1338 return rPropSet.is();
1339}
1340
1342 SvXMLImport& rImport,
1343 const Reference< XFastAttributeList > & xAttrList,
1344 TextContentAnchorType eATyp )
1345: SvXMLImportContext( rImport )
1346, m_xAttrList( new sax_fastparser::FastAttributeList( xAttrList ) )
1347 // Implement Title/Description Elements UI (#i73249#)
1348, m_eDefaultAnchorType( eATyp )
1349 // Shapes in Writer cannot be named via context menu (#i51726#)
1350, m_HasAutomaticStyleWithoutParentStyle( false )
1351, m_bSupportsReplacement( false )
1352{
1353 for( auto& aIter : sax_fastparser::castToFastAttributeList(xAttrList) )
1354 {
1355 // New distinguish attribute between Writer objects and Draw objects is:
1356 // Draw objects have an automatic style without a parent style (#i51726#)
1357 switch (aIter.getToken())
1358 {
1359 case XML_ELEMENT(DRAW, XML_STYLE_NAME):
1360 {
1361 OUString aStyleName = aIter.toString();
1362 if( !aStyleName.isEmpty() )
1363 {
1365 GetImport().GetTextImport();
1366 XMLPropStyleContext* pStyle = xTxtImport->FindAutoFrameStyle( aStyleName );
1367 if ( pStyle && pStyle->GetParentName().isEmpty() )
1368 {
1370 }
1371 }
1372 break;
1373 }
1374 case XML_ELEMENT(TEXT, XML_ANCHOR_TYPE):
1375 {
1376 TextContentAnchorType eNew;
1377 if( XMLAnchorTypePropHdl::convert( aIter.toView(), eNew ) &&
1378 ( TextContentAnchorType_AT_PARAGRAPH == eNew ||
1379 TextContentAnchorType_AT_CHARACTER == eNew ||
1380 TextContentAnchorType_AS_CHARACTER == eNew ||
1381 TextContentAnchorType_AT_PAGE == eNew) )
1382 m_eDefaultAnchorType = eNew;
1383 break;
1384 }
1385 }
1386 }
1387}
1388
1390{
1392 SvXMLImportContextRef const pMultiContext(solveMultipleImages());
1393
1394 SvXMLImportContext const*const pContext =
1395 (pMultiContext.is()) ? pMultiContext.get() : m_xImplContext.get();
1396 XMLTextFrameContext_Impl *pImpl = const_cast<XMLTextFrameContext_Impl*>(dynamic_cast< const XMLTextFrameContext_Impl*>( pContext ));
1397 assert(!pMultiContext.is() || pImpl);
1398
1399 // When we are dealing with a textbox, pImpl will be null;
1400 // we need to set the hyperlink to the shape instead
1401 Reference<XShape> xShape = GetShape();
1402 if (xShape.is() && m_pHyperlink)
1403 {
1404 Reference<XPropertySet> xProps(xShape, UNO_QUERY);
1405 if (xProps.is())
1406 xProps->setPropertyValue("Hyperlink", Any(m_pHyperlink->GetHRef()));
1407 }
1408
1409 if( !pImpl )
1410 return;
1411
1412 pImpl->CreateIfNotThere();
1413
1414 // fdo#68839: in case the surviving image was not the first one,
1415 // it will have a counter added to its name - set the original name
1416 if (pMultiContext.is()) // do this only when necessary; esp. not for text
1417 { // frames that may have entries in GetRenameMap()!
1418 pImpl->SetName();
1419 }
1420
1421 if( !m_sTitle.isEmpty() )
1422 {
1423 pImpl->SetTitle( m_sTitle );
1424 }
1425 if( !m_sDesc.isEmpty() )
1426 {
1427 pImpl->SetDesc( m_sDesc );
1428 }
1429
1430 if( m_pHyperlink )
1431 {
1432 pImpl->SetHyperlink( m_pHyperlink->GetHRef(), m_pHyperlink->GetName(),
1433 m_pHyperlink->GetTargetFrameName(), m_pHyperlink->GetMap() );
1434 m_pHyperlink.reset();
1435 }
1436
1437 GetImport().GetTextImport()->StoreLastImportedFrameName(pImpl->GetOrigName());
1438}
1439
1440css::uno::Reference< css::xml::sax::XFastContextHandler > XMLTextFrameContext::createFastChildContext(
1441 sal_Int32 nElement,
1442 const uno::Reference< xml::sax::XFastAttributeList>& xAttrList )
1443{
1444 SvXMLImportContextRef xContext;
1445
1446 if( !m_xImplContext.is() )
1447 {
1448 // no child exists
1449 if( IsTokenInNamespace(nElement, XML_NAMESPACE_DRAW) )
1450 {
1451 sal_uInt16 nFrameType = USHRT_MAX;
1452 switch (nElement & TOKEN_MASK)
1453 {
1454 case XML_TEXT_BOX:
1455 nFrameType = XML_TEXT_FRAME_TEXTBOX;
1456 break;
1457 case XML_IMAGE:
1458 nFrameType = XML_TEXT_FRAME_GRAPHIC;
1459 break;
1460 case XML_OBJECT:
1461 nFrameType = XML_TEXT_FRAME_OBJECT;
1462 break;
1463 case XML_OBJECT_OLE:
1464 nFrameType = XML_TEXT_FRAME_OBJECT_OLE;
1465 break;
1466 case XML_APPLET:
1467 nFrameType = XML_TEXT_FRAME_APPLET;
1468 break;
1469 case XML_PLUGIN:
1470 nFrameType = XML_TEXT_FRAME_PLUGIN;
1471 break;
1472 case XML_FLOATING_FRAME:
1473 nFrameType = XML_TEXT_FRAME_FLOATING_FRAME;
1474 break;
1475 }
1476
1477 if( USHRT_MAX != nFrameType )
1478 {
1479 // Shapes in Writer cannot be named via context menu (#i51726#)
1480 if ( ( XML_TEXT_FRAME_TEXTBOX == nFrameType ||
1481 XML_TEXT_FRAME_GRAPHIC == nFrameType ) &&
1483 {
1484 Reference < XShapes > xShapes;
1486 GetImport(), nElement, xAttrList, xShapes, m_xAttrList );
1487 }
1488 else if( XML_TEXT_FRAME_PLUGIN == nFrameType )
1489 {
1490 bool bMedia = false;
1491
1492 // check, if we have a media object
1493 for( auto& aIter : sax_fastparser::castToFastAttributeList(xAttrList) )
1494 {
1495 if( aIter.getToken() == XML_ELEMENT(DRAW, XML_MIME_TYPE) )
1496 {
1497 if (::comphelper::IsMediaMimeType(aIter.toView()))
1498 bMedia = true;
1499
1500 // leave this loop
1501 break;
1502 }
1503 }
1504
1505 if( bMedia )
1506 {
1507 Reference < XShapes > xShapes;
1509 GetImport(), nElement, xAttrList, xShapes, m_xAttrList );
1510 }
1511 }
1512 else if( XML_TEXT_FRAME_OBJECT == nFrameType ||
1513 XML_TEXT_FRAME_OBJECT_OLE == nFrameType )
1514 {
1516 }
1517 else if(XML_TEXT_FRAME_GRAPHIC == nFrameType)
1518 {
1520 }
1521
1522 if (!xContext)
1523 {
1524 xContext = new XMLTextFrameContext_Impl( GetImport(), nElement,
1525 xAttrList,
1527 nFrameType,
1528 m_xAttrList );
1529 }
1530
1531 m_xImplContext = xContext;
1532
1534 {
1536 }
1537 }
1538 }
1539 }
1540 else if(getSupportsMultipleContents() && nElement == XML_ELEMENT(DRAW, XML_IMAGE))
1541 {
1542 // read another image
1543 xContext = new XMLTextFrameContext_Impl(
1544 GetImport(), nElement, xAttrList,
1546
1547 m_xImplContext = xContext;
1549 }
1550 else if( m_bSupportsReplacement && !m_xReplImplContext.is() &&
1551 nElement == XML_ELEMENT(DRAW, XML_IMAGE) )
1552 {
1553 // read replacement image
1554 Reference < XPropertySet > xPropSet;
1555 if( CreateIfNotThere( xPropSet ) )
1556 {
1557 xContext = new XMLReplacementImageContext( GetImport(),
1558 nElement, xAttrList, xPropSet );
1559 m_xReplImplContext = xContext;
1560 }
1561 }
1562 else if( nullptr != dynamic_cast< const XMLTextFrameContext_Impl*>( m_xImplContext.get() ))
1563 {
1564 // the child is a writer frame
1565 if( IsTokenInNamespace(nElement, XML_NAMESPACE_SVG) ||
1567 {
1568 // Implement Title/Description Elements UI (#i73249#)
1569 const bool bOld = SvXMLImport::OOo_2x >= GetImport().getGeneratorVersion();
1570 if ( bOld )
1571 {
1572 if ( (nElement & TOKEN_MASK) == XML_DESC )
1573 {
1574 xContext = new XMLTextFrameTitleOrDescContext_Impl( GetImport(),
1575 m_sTitle );
1576 }
1577 }
1578 else
1579 {
1580 if( (nElement & TOKEN_MASK) == XML_TITLE )
1581 {
1583 { // tdf#103567 ensure props are set on surviving shape
1585 }
1586 xContext = new XMLTextFrameTitleOrDescContext_Impl( GetImport(),
1587 m_sTitle );
1588 }
1589 else if ( (nElement & TOKEN_MASK) == XML_DESC )
1590 {
1592 { // tdf#103567 ensure props are set on surviving shape
1594 }
1595 xContext = new XMLTextFrameTitleOrDescContext_Impl( GetImport(),
1596 m_sDesc );
1597 }
1598 }
1599 }
1600 else if( IsTokenInNamespace(nElement, XML_NAMESPACE_DRAW) )
1601 {
1602 Reference < XPropertySet > xPropSet;
1603 if( (nElement & TOKEN_MASK) == XML_CONTOUR_POLYGON )
1604 {
1606 { // tdf#103567 ensure props are set on surviving shape
1608 }
1609 if( CreateIfNotThere( xPropSet ) )
1610 xContext = new XMLTextFrameContourContext_Impl( GetImport(), nElement,
1611 xAttrList, xPropSet, false );
1612 }
1613 else if( (nElement & TOKEN_MASK) == XML_CONTOUR_PATH )
1614 {
1616 { // tdf#103567 ensure props are set on surviving shape
1618 }
1619 if( CreateIfNotThere( xPropSet ) )
1620 xContext = new XMLTextFrameContourContext_Impl( GetImport(), nElement,
1621 xAttrList, xPropSet, true );
1622 }
1623 else if( (nElement & TOKEN_MASK) == XML_IMAGE_MAP )
1624 {
1626 { // tdf#103567 ensure props are set on surviving shape
1628 }
1629 if( CreateIfNotThere( xPropSet ) )
1630 xContext = new XMLImageMapContext( GetImport(), xPropSet );
1631 }
1632 }
1633 else if( nElement == XML_ELEMENT(OFFICE, XML_EVENT_LISTENERS) )
1634 {
1636 { // tdf#103567 ensure props are set on surviving shape
1638 }
1639 // do we still have the frame object?
1640 Reference < XPropertySet > xPropSet;
1641 if( CreateIfNotThere( xPropSet ) )
1642 {
1643 // is it an event supplier?
1644 Reference<XEventsSupplier> xEventsSupplier(xPropSet, UNO_QUERY);
1645 if (xEventsSupplier.is())
1646 {
1647 // OK, we have the events, so create the context
1648 xContext = new XMLEventsImportContext(GetImport(), xEventsSupplier);
1649 }
1650 }
1651 }
1652 }
1653 // #i68101#
1654 else if( nElement == XML_ELEMENT(SVG, XML_TITLE) || nElement == XML_ELEMENT(SVG, XML_DESC ) ||
1655 nElement == XML_ELEMENT(SVG_COMPAT, XML_TITLE) || nElement == XML_ELEMENT(SVG_COMPAT, XML_DESC ) )
1656 {
1658 { // tdf#103567 ensure props are set on surviving shape
1659 // note: no more draw:image can be added once we get here
1661 }
1662 xContext = static_cast<SvXMLImportContext*>(m_xImplContext->createFastChildContext( nElement, xAttrList ).get());
1663 }
1664 else if (nElement == XML_ELEMENT(LO_EXT, XML_SIGNATURELINE))
1665 {
1667 { // tdf#103567 ensure props are set on surviving shape
1668 // note: no more draw:image can be added once we get here
1670 }
1671 xContext = static_cast<SvXMLImportContext*>(m_xImplContext->createFastChildContext(nElement, xAttrList).get());
1672 }
1673 else if (nElement == XML_ELEMENT(LO_EXT, XML_QRCODE))
1674 {
1676 { // tdf#103567 ensure props are set on surviving shape
1677 // note: no more draw:image can be added once we get here
1679 }
1680 xContext = static_cast<SvXMLImportContext*>(m_xImplContext->createFastChildContext(nElement, xAttrList).get());
1681 }
1682 else if (nElement == XML_ELEMENT(DRAW, XML_A))
1683 {
1684 xContext = static_cast<SvXMLImportContext*>(m_xImplContext->createFastChildContext(nElement, xAttrList).get());
1685 }
1686 else
1687 {
1688 // the child is a drawing shape
1690 m_xImplContext.get(), nElement, xAttrList );
1691 }
1692
1693 return xContext;
1694}
1695
1696void XMLTextFrameContext::SetHyperlink( const OUString& rHRef,
1697 const OUString& rName,
1698 const OUString& rTargetFrameName,
1699 bool bMap )
1700{
1701 OSL_ENSURE( !m_pHyperlink, "recursive SetHyperlink call" );
1702 m_pHyperlink = std::make_unique<XMLTextFrameContextHyperlink_Impl>(
1703 rHRef, rName, rTargetFrameName, bMap );
1704}
1705
1706TextContentAnchorType XMLTextFrameContext::GetAnchorType() const
1707{
1708 SvXMLImportContext *pContext = m_xImplContext.get();
1709 XMLTextFrameContext_Impl *pImpl = dynamic_cast< XMLTextFrameContext_Impl*>( pContext );
1710 if( pImpl )
1711 return pImpl->GetAnchorType();
1712 else
1713 return m_eDefaultAnchorType;
1714}
1715
1716Reference < XTextContent > XMLTextFrameContext::GetTextContent() const
1717{
1718 Reference < XTextContent > xTxtCntnt;
1719 SvXMLImportContext *pContext = m_xImplContext.get();
1720 XMLTextFrameContext_Impl *pImpl = dynamic_cast< XMLTextFrameContext_Impl* >( pContext );
1721 if( pImpl )
1722 xTxtCntnt.set( pImpl->GetPropSet(), UNO_QUERY );
1723
1724 return xTxtCntnt;
1725}
1726
1727Reference < XShape > XMLTextFrameContext::GetShape() const
1728{
1729 Reference < XShape > xShape;
1730 SvXMLImportContext* pContext = m_xImplContext.get();
1731 SvXMLShapeContext* pImpl = dynamic_cast<SvXMLShapeContext*>( pContext );
1732 if ( pImpl )
1733 {
1734 xShape = pImpl->getShape();
1735 }
1736
1737 return xShape;
1738}
1739
1740/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
#define XML_TEXT_FRAME_PLUGIN
#define XML_TEXT_FRAME_FLOATING_FRAME
#define XML_TEXT_FRAME_OBJECT_OLE
#define XML_TEXT_FRAME_APPLET
#define XML_TEXT_FRAME_TEXTBOX
#define XML_TEXT_FRAME_GRAPHIC
::std::map< const OUString, OUString > ParamMap
#define XML_TEXT_FRAME_OBJECT
constexpr OUStringLiteral sServiceName
constexpr OUStringLiteral sFrameName
bool getSupportsMultipleContents() const
read/write access to boolean switch
SvXMLImportContextRef solveMultipleImages()
solve multiple imported images.
void setSupportsMultipleContents(bool bNew)
void addContent(const SvXMLImportContext &rSvXMLImportContext)
add a content to the remembered image import contexts
void SetString(const OUString &rNew, const SvXMLUnitConverter &rConv)
Definition: xexptran.cxx:347
void GetFullTransform(::basegfx::B2DHomMatrix &rFullTrans)
Definition: xexptran.cxx:480
This class deliberately does not support XWeak, to improve performance when loading large documents.
Definition: xmlictxt.hxx:48
virtual void SAL_CALL endFastElement(sal_Int32 Element) override
endFastElement is called before a context will be destructed, but after an elements context has been ...
Definition: xmlictxt.cxx:40
SvXMLImport & GetImport()
Definition: xmlictxt.hxx:60
virtual css::uno::Reference< XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 Element, const css::uno::Reference< css::xml::sax::XFastAttributeList > &Attribs) override
Definition: xmlictxt.cxx:59
virtual void SAL_CALL characters(const OUString &aChars) override
This method is called for all characters that are contained in the current element.
Definition: xmlictxt.cxx:70
const css::uno::Reference< css::drawing::XShape > & getShape() const
const OUString & GetParentName() const
Definition: xmlstyle.hxx:81
static bool convert(std::string_view rStrImpValue, css::text::TextContentAnchorType &rType)
Definition: txtprhdl.cxx:635
void SetComponent(css::uno::Reference< css::lang::XComponent > const &rComp)
Import <script:events> element.
virtual void FillPropertySet(const css::uno::Reference< css::beans::XPropertySet > &rPropSet)
Definition: prstylei.cxx:222
static SvXMLShapeContext * CreateFrameChildContext(SvXMLImport &rImport, sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList, css::uno::Reference< css::drawing::XShapes > const &rShapes, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xFrameAttrList)
rtl::Reference< sax_fastparser::FastAttributeList > m_xAttrList
css::text::TextContentAnchorType GetAnchorType() const
css::uno::Reference< css::text::XTextContent > GetTextContent() const
css::text::TextContentAnchorType m_eDefaultAnchorType
std::unique_ptr< XMLTextFrameContextHyperlink_Impl > m_pHyperlink
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &AttrList) override
OUString getGraphicPackageURLFromImportContext(const SvXMLImportContext &rContext) const override
void SetHyperlink(const OUString &rHRef, const OUString &rName, const OUString &rTargetFrameName, bool bMap)
css::uno::Reference< css::graphic::XGraphic > getGraphicFromImportContext(const SvXMLImportContext &rContext) const override
XMLTextFrameContext(SvXMLImport &rImport, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList, css::text::TextContentAnchorType eDfltAnchorType)
virtual void SAL_CALL endFastElement(sal_Int32 nElement) override
endFastElement is called before a context will be destructed, but after an elements context has been ...
bool CreateIfNotThere(css::uno::Reference< css::beans::XPropertySet > &rPropSet)
SvXMLImportContextRef m_xImplContext
css::uno::Reference< css::drawing::XShape > GetShape() const
void removeGraphicFromImportContext(const SvXMLImportContext &rContext) override
helper to get the created xShape instance, needs to be overridden
SvXMLImportContextRef m_xReplImplContext
bool isIdentity() const
void transform(const basegfx::B2DHomMatrix &rMatrix)
sal_uInt32 count() const
static std::size_t decodeSomeChars(css::uno::Sequence< sal_Int8 > &aPass, std::u16string_view sBuffer)
static bool convertPercent(sal_Int32 &rValue, std::u16string_view rString)
static bool convertNumber(sal_Int32 &rValue, std::u16string_view aString, sal_Int32 nMin=SAL_MIN_INT32, sal_Int32 nMax=SAL_MAX_INT32)
#define TOOLS_WARN_EXCEPTION(area, stream)
#define TOOLS_INFO_EXCEPTION(area, stream)
virtual void SetTitle(const OUString &rNewTitle) override
float u
Reference< XSingleServiceFactory > xFactory
DRAW
OUString sName
const char * name
OUString aName
void * p
#define SAL_WARN_IF(condition, area, stream)
#define SAL_INFO(area, stream)
if(aStr !=aBuf) UpdateName_Impl(m_xFollowLb.get()
bool equalZero(const T &rfVal)
bool equal(T const &rfValA, T const &rfValB)
bool importFromSvgPoints(B2DPolygon &o_rPoly, std::u16string_view rSvgPointsAttribute)
void B2DPolyPolygonToUnoPointSequenceSequence(const B2DPolyPolygon &rPolyPolygon, css::drawing::PointSequenceSequence &rPointSequenceSequenceRetval)
bool importFromSvgD(B2DPolyPolygon &o_rPolyPoly, std::u16string_view rSvgDAttribute, bool bHandleRelativeNextPointCompatible, PointIndexSet *pHelpPointIndexSet)
B2DHomMatrix createSourceRangeTargetRangeTransform(const B2DRange &rSourceRange, const B2DRange &rTargetRange)
B2IRange fround(const B2DRange &rRange)
OSQLColumns::const_iterator find(const OSQLColumns::const_iterator &first, const OSQLColumns::const_iterator &last, std::u16string_view _rVal, const ::comphelper::UStringMixEqual &_rCase)
int i
void Create(SwFormatVertOrient &rItem, SvStream &rStrm, sal_uInt16 nVersionAbusedAsSize)
std::basic_string_view< charT, traits > trim(std::basic_string_view< charT, traits > str)
FastAttributeList & castToFastAttributeList(const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList)
OUString toString(OptionInfo const *info)
Handling of tokens in XML:
@ XML_MAY_BREAK_BETWEEN_PAGES
Definition: xmltoken.hxx:3524
@ XML_NOTIFY_ON_UPDATE_OF_TABLE
Definition: xmltoken.hxx:2216
@ XML_NOTIFY_ON_UPDATE_OF_RANGES
Definition: xmltoken.hxx:2262
@ XML_ANCHOR_PAGE_NUMBER
Definition: xmltoken.hxx:247
bool IsXMLToken(std::u16string_view rString, enum XMLTokenEnum eToken)
compare eToken to the string
Definition: xmltoken.cxx:3597
QPRO_FUNC_TYPE nType
#define XML_TEXT_RENAME_TYPE_FRAME
Definition: txtimp.hxx:91
@ TextBox
Definition: txtimp.hxx:73
std::unique_ptr< char[]> aBuffer
static void convertNumber(OUStringBuffer &b, sal_Int32 n)
#define XMLOFF_WARN_UNKNOWN_ELEMENT(area, token)
Definition: xmlictxt.hxx:120
#define XMLOFF_WARN_UNKNOWN(area, rIter)
Definition: xmlictxt.hxx:114
#define XML_ELEMENT(prefix, name)
Definition: xmlimp.hxx:97
constexpr bool IsTokenInNamespace(sal_Int32 nToken, sal_uInt16 nNamespacePrefix)
Definition: xmlimp.hxx:104
constexpr sal_Int32 TOKEN_MASK
Definition: xmlimp.hxx:94
constexpr sal_uInt16 XML_NAMESPACE_DRAW
constexpr sal_uInt16 XML_NAMESPACE_SVG
constexpr sal_uInt16 XML_NAMESPACE_SVG_COMPAT