LibreOffice Module xmloff (master)  1
ximpshap.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 <cassert>
21 
22 #include <sal/log.hxx>
23 #include <com/sun/star/document/XEventsSupplier.hpp>
24 #include <com/sun/star/container/XNameReplace.hpp>
25 #include <com/sun/star/presentation/ClickAction.hpp>
26 #include <com/sun/star/drawing/FillStyle.hpp>
27 #include <com/sun/star/drawing/LineStyle.hpp>
29 #include <com/sun/star/drawing/XGluePointsSupplier.hpp>
30 #include <com/sun/star/drawing/GluePoint2.hpp>
31 #include <com/sun/star/drawing/Alignment.hpp>
32 #include <com/sun/star/drawing/EscapeDirection.hpp>
33 #include <com/sun/star/media/ZoomLevel.hpp>
34 #include <com/sun/star/awt/Rectangle.hpp>
35 #include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
36 #include <com/sun/star/container/XNameAccess.hpp>
37 #include "ximpshap.hxx"
40 #include <xmloff/xmluconv.hxx>
41 #include <com/sun/star/container/XNamed.hpp>
42 #include <com/sun/star/beans/XPropertySet.hpp>
43 #include <com/sun/star/awt/XControlModel.hpp>
44 #include <com/sun/star/drawing/XControlShape.hpp>
45 #include <com/sun/star/drawing/PointSequenceSequence.hpp>
46 #include <com/sun/star/drawing/PointSequence.hpp>
47 #include <com/sun/star/lang/XServiceInfo.hpp>
48 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
49 #include <com/sun/star/util/XCloneable.hpp>
50 #include <com/sun/star/beans/XMultiPropertyStates.hpp>
51 #include <xexptran.hxx>
52 #include <com/sun/star/drawing/PolyPolygonBezierCoords.hpp>
53 #include <com/sun/star/beans/XPropertySetInfo.hpp>
54 #include <com/sun/star/drawing/HomogenMatrix3.hpp>
55 #include <com/sun/star/graphic/XGraphic.hpp>
56 #include <com/sun/star/style/XStyle.hpp>
57 
58 #include <sax/tools/converter.hxx>
59 #include <comphelper/sequence.hxx>
60 #include <tools/diagnose_ex.h>
61 
62 #include <xmloff/families.hxx>
64 #include <xmloff/xmltoken.hxx>
67 #include <XMLImageMapContext.hxx>
68 #include "sdpropls.hxx"
69 #include "eventimp.hxx"
70 #include "descriptionimp.hxx"
71 #include "SignatureLineContext.hxx"
72 #include "QRCodeContext.hxx"
73 #include "ximpcustomshape.hxx"
75 #include <xmloff/xmlerror.hxx>
78 #include <xmloff/attrlist.hxx>
80 #include <com/sun/star/drawing/XEnhancedCustomShapeDefaulter.hpp>
81 #include <com/sun/star/container/XChild.hpp>
82 #include <com/sun/star/text/XTextDocument.hpp>
90 #include <o3tl/any.hxx>
91 #include <o3tl/safeint.hxx>
92 
93 using namespace ::com::sun::star;
94 using namespace ::com::sun::star::uno;
95 using namespace ::com::sun::star::drawing;
96 using namespace ::com::sun::star::style;
97 using namespace ::com::sun::star::container;
98 using namespace ::com::sun::star::document;
99 using namespace ::xmloff::token;
100 using namespace ::xmloff::EnhancedCustomShapeToken;
101 
103 {
104  { XML_TOP_LEFT, drawing::Alignment_TOP_LEFT },
105  { XML_TOP, drawing::Alignment_TOP },
106  { XML_TOP_RIGHT, drawing::Alignment_TOP_RIGHT },
107  { XML_LEFT, drawing::Alignment_LEFT },
108  { XML_CENTER, drawing::Alignment_CENTER },
109  { XML_RIGHT, drawing::Alignment_RIGHT },
110  { XML_BOTTOM_LEFT, drawing::Alignment_BOTTOM_LEFT },
111  { XML_BOTTOM, drawing::Alignment_BOTTOM },
112  { XML_BOTTOM_RIGHT, drawing::Alignment_BOTTOM_RIGHT },
113  { XML_TOKEN_INVALID, drawing::Alignment(0) }
114 };
115 
117 {
118  { XML_AUTO, drawing::EscapeDirection_SMART },
119  { XML_LEFT, drawing::EscapeDirection_LEFT },
120  { XML_RIGHT, drawing::EscapeDirection_RIGHT },
121  { XML_UP, drawing::EscapeDirection_UP },
122  { XML_DOWN, drawing::EscapeDirection_DOWN },
123  { XML_HORIZONTAL, drawing::EscapeDirection_HORIZONTAL },
124  { XML_VERTICAL, drawing::EscapeDirection_VERTICAL },
125  { XML_TOKEN_INVALID, drawing::EscapeDirection(0) }
126 };
127 
128 static bool ImpIsEmptyURL( std::u16string_view rURL )
129 {
130  if( rURL.empty() )
131  return true;
132 
133  // #i13140# Also compare against 'toplevel' URLs. which also
134  // result in empty filename strings.
135  if( rURL == u"#./" )
136  return true;
137 
138  return false;
139 }
140 
141 
143  SvXMLImport& rImport,
144  const css::uno::Reference< css::xml::sax::XFastAttributeList>& xAttrList,
145  uno::Reference< drawing::XShapes > const & rShapes,
146  bool bTemporaryShape)
147  : SvXMLShapeContext( rImport, bTemporaryShape )
148  , mxShapes( rShapes )
149  , mxAttrList(xAttrList)
150  , mbListContextPushed( false )
151  , mnStyleFamily(XmlStyleFamily::SD_GRAPHICS_ID)
152  , mbIsPlaceholder(false)
153  , mbClearDefaultAttributes( true )
154  , mbIsUserTransformed(false)
155  , mnZOrder(-1)
156  , maSize(1, 1)
157  , mnRelWidth(0)
158  , mnRelHeight(0)
159  , maPosition(0, 0)
160  , maUsedTransformation()
161  , mbVisible(true)
162  , mbPrintable(true)
163  , mbHaveXmlId(false)
164  , mbTextBox(false)
165 {
166 }
167 
169 {
170 }
171 
172 css::uno::Reference< css::xml::sax::XFastContextHandler > SdXMLShapeContext::createFastChildContext(
173  sal_Int32 nElement,
174  const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList )
175 {
176  SvXMLImportContextRef xContext;
177  // #i68101#
178  if( nElement == XML_ELEMENT(SVG, XML_TITLE) || nElement == XML_ELEMENT(SVG, XML_DESC)
179  || nElement == XML_ELEMENT(SVG_COMPAT, XML_TITLE) || nElement == XML_ELEMENT(SVG_COMPAT, XML_DESC) )
180  {
181  xContext = new SdXMLDescriptionContext( GetImport(), nElement, mxShape );
182  }
183  else if( nElement == XML_ELEMENT(LO_EXT, XML_SIGNATURELINE) )
184  {
185  xContext = new SignatureLineContext( GetImport(), nElement, xAttrList, mxShape );
186  }
187  else if( nElement == XML_ELEMENT(LO_EXT, XML_QRCODE) )
188  {
189  xContext = new QRCodeContext( GetImport(), nElement, xAttrList, mxShape );
190  }
191  else if( nElement == XML_ELEMENT(OFFICE, XML_EVENT_LISTENERS) )
192  {
193  xContext = new SdXMLEventsContext( GetImport(), mxShape );
194  }
195  else if( nElement == XML_ELEMENT(DRAW, XML_GLUE_POINT) )
196  {
197  addGluePoint( xAttrList );
198  }
199  else if( nElement == XML_ELEMENT(DRAW, XML_THUMBNAIL) )
200  {
201  // search attributes for xlink:href
202  maThumbnailURL = xAttrList->getOptionalValue(XML_ELEMENT(XLINK, XML_HREF));
203  }
204  else
205  {
206  // create text cursor on demand
207  if( !mxCursor.is() )
208  {
209  uno::Reference< text::XText > xText( mxShape, uno::UNO_QUERY );
210  if( xText.is() )
211  {
214  mxOldCursor = xTxtImport->GetCursor();
215  mxCursor = xText->createTextCursor();
216  if( mxCursor.is() )
217  {
218  xTxtImport->SetCursor( mxCursor );
219  }
220 
221  // remember old list item and block (#91964#) and reset them
222  // for the text frame
223  xTxtImport->PushListContext();
224  mbListContextPushed = true;
225  }
226  }
227 
228  // if we have a text cursor, lets try to import some text
229  if( mxCursor.is() )
230  {
231  xContext = GetImport().GetTextImport()->CreateTextChildContext(
232  GetImport(), nElement, xAttrList,
234  }
235  }
236 
237  if (!xContext)
238  XMLOFF_WARN_UNKNOWN_ELEMENT("xmloff", nElement);
239 
240  return xContext;
241 }
242 
243 void SdXMLShapeContext::addGluePoint( const uno::Reference< xml::sax::XFastAttributeList>& xAttrList )
244 {
245  // get the glue points container for this shape if it's not already there
246  if( !mxGluePoints.is() )
247  {
248  uno::Reference< drawing::XGluePointsSupplier > xSupplier( mxShape, uno::UNO_QUERY );
249  if( !xSupplier.is() )
250  return;
251 
252  mxGluePoints.set( xSupplier->getGluePoints(), UNO_QUERY );
253 
254  if( !mxGluePoints.is() )
255  return;
256  }
257 
258  drawing::GluePoint2 aGluePoint;
259  aGluePoint.IsUserDefined = true;
260  aGluePoint.Position.X = 0;
261  aGluePoint.Position.Y = 0;
262  aGluePoint.Escape = drawing::EscapeDirection_SMART;
263  aGluePoint.PositionAlignment = drawing::Alignment_CENTER;
264  aGluePoint.IsRelative = true;
265 
266  sal_Int32 nId = -1;
267 
268  // read attributes for the 3DScene
269  for( auto& aIter : sax_fastparser::castToFastAttributeList(xAttrList) )
270  {
271  switch(aIter.getToken())
272  {
273  case XML_ELEMENT(SVG, XML_X):
274  case XML_ELEMENT(SVG_COMPAT, XML_X):
276  aGluePoint.Position.X, aIter.toString());
277  break;
278  case XML_ELEMENT(SVG, XML_Y):
279  case XML_ELEMENT(SVG_COMPAT, XML_Y):
281  aGluePoint.Position.Y, aIter.toString());
282  break;
283  case XML_ELEMENT(DRAW, XML_ID):
284  nId = aIter.toInt32();
285  break;
286  case XML_ELEMENT(DRAW, XML_ALIGN):
287  {
288  drawing::Alignment eKind;
289  if( SvXMLUnitConverter::convertEnum( eKind, aIter.toView(), aXML_GlueAlignment_EnumMap ) )
290  {
291  aGluePoint.PositionAlignment = eKind;
292  aGluePoint.IsRelative = false;
293  }
294  break;
295  }
297  {
298  SvXMLUnitConverter::convertEnum( aGluePoint.Escape, aIter.toView(), aXML_GlueEscapeDirection_EnumMap );
299  break;
300  }
301  default:
302  XMLOFF_WARN_UNKNOWN("xmloff", aIter);
303  }
304  }
305 
306  if( nId != -1 )
307  {
308  try
309  {
310  sal_Int32 nInternalId = mxGluePoints->insert( uno::makeAny( aGluePoint ) );
311  GetImport().GetShapeImport()->addGluePointMapping( mxShape, nId, nInternalId );
312  }
313  catch(const uno::Exception&)
314  {
315  DBG_UNHANDLED_EXCEPTION( "xmloff", "during setting of glue points");
316  }
317  }
318 }
319 
320 void SdXMLShapeContext::startFastElement (sal_Int32 /*nElement*/,
321  const css::uno::Reference< css::xml::sax::XFastAttributeList >& /*xAttrList*/)
322 {
323  GetImport().GetShapeImport()->finishShape( mxShape, mxAttrList, mxShapes );
324 }
325 
327 {
328  if(mxCursor.is())
329  {
330  // delete addition newline
331  mxCursor->gotoEnd( false );
332  mxCursor->goLeft( 1, true );
333  mxCursor->setString( "" );
334 
335  // reset cursor
336  GetImport().GetTextImport()->ResetCursor();
337  }
338 
339  if(mxOldCursor.is())
340  GetImport().GetTextImport()->SetCursor( mxOldCursor );
341 
342  // reinstall old list item (if necessary) #91964#
343  if (mbListContextPushed) {
344  GetImport().GetTextImport()->PopListContext();
345  }
346 
347  if( !msHyperlink.isEmpty() ) try
348  {
349  uno::Reference< beans::XPropertySet > xProp( mxShape, uno::UNO_QUERY );
350 
351  if ( xProp.is() && xProp->getPropertySetInfo()->hasPropertyByName( "Hyperlink" ) )
352  xProp->setPropertyValue( "Hyperlink", uno::Any( msHyperlink ) );
353  Reference< XEventsSupplier > xEventsSupplier( mxShape, UNO_QUERY );
354 
355  if( xEventsSupplier.is() )
356  {
357  Reference< XNameReplace > xEvents( xEventsSupplier->getEvents(), UNO_SET_THROW );
358 
359  uno::Sequence< beans::PropertyValue > aProperties( 3 );
360  aProperties[0].Name = "EventType";
361  aProperties[0].Handle = -1;
362  aProperties[0].Value <<= OUString( "Presentation" );
363  aProperties[0].State = beans::PropertyState_DIRECT_VALUE;
364 
365  aProperties[1].Name = "ClickAction";
366  aProperties[1].Handle = -1;
367  aProperties[1].Value <<= css::presentation::ClickAction_DOCUMENT;
368  aProperties[1].State = beans::PropertyState_DIRECT_VALUE;
369 
370  aProperties[2].Name = "Bookmark";
371  aProperties[2].Handle = -1;
372  aProperties[2].Value <<= msHyperlink;
373  aProperties[2].State = beans::PropertyState_DIRECT_VALUE;
374 
375  xEvents->replaceByName( "OnClick", Any( aProperties ) );
376  }
377  else
378  {
379  // in draw use the Bookmark property
380  Reference< beans::XPropertySet > xSet( mxShape, UNO_QUERY_THROW );
381  xSet->setPropertyValue( "Bookmark", Any( msHyperlink ) );
382  xSet->setPropertyValue("OnClick", Any( css::presentation::ClickAction_DOCUMENT ) );
383  }
384  }
385  catch(const Exception&)
386  {
387  DBG_UNHANDLED_EXCEPTION("xmloff", "while setting hyperlink");
388  }
389 
390  if( mxLockable.is() )
391  mxLockable->removeActionLock();
392 }
393 
394 void SdXMLShapeContext::AddShape(uno::Reference< drawing::XShape >& xShape)
395 {
396  if(xShape.is())
397  {
398  // set shape local
399  mxShape = xShape;
400 
401  if(!maShapeName.isEmpty())
402  {
403  uno::Reference< container::XNamed > xNamed( mxShape, uno::UNO_QUERY );
404  if( xNamed.is() )
405  xNamed->setName( maShapeName );
406  }
407 
408  rtl::Reference< XMLShapeImportHelper > xImp( GetImport().GetShapeImport() );
409  xImp->addShape( xShape, mxAttrList, mxShapes );
410 
412  {
413  uno::Reference<beans::XMultiPropertyStates> xMultiPropertyStates(xShape, uno::UNO_QUERY );
414  if (xMultiPropertyStates.is())
415  xMultiPropertyStates->setAllPropertiesToDefault();
416  }
417 
418  if( !mbVisible || !mbPrintable ) try
419  {
420  uno::Reference< beans::XPropertySet > xSet( xShape, uno::UNO_QUERY_THROW );
421  if( !mbVisible )
422  xSet->setPropertyValue("Visible", uno::Any( false ) );
423 
424  if( !mbPrintable )
425  xSet->setPropertyValue("Printable", uno::Any( false ) );
426  }
427  catch(const Exception&)
428  {
429  DBG_UNHANDLED_EXCEPTION( "xmloff", "while setting visible or printable" );
430  }
431 
432  if(!mbTemporaryShape && (!GetImport().HasTextImport()
433  || !GetImport().GetTextImport()->IsInsideDeleteContext()))
434  {
435  xImp->shapeWithZIndexAdded( xShape, mnZOrder );
436  }
437 
438  if (mnRelWidth || mnRelHeight)
439  {
440  uno::Reference<beans::XPropertySet> xPropertySet(xShape, uno::UNO_QUERY);
441  uno::Reference<beans::XPropertySetInfo> xPropertySetInfo = xPropertySet->getPropertySetInfo();
442  if (mnRelWidth && xPropertySetInfo->hasPropertyByName("RelativeWidth"))
443  xPropertySet->setPropertyValue("RelativeWidth", uno::makeAny(mnRelWidth));
444  if (mnRelHeight && xPropertySetInfo->hasPropertyByName("RelativeHeight"))
445  xPropertySet->setPropertyValue("RelativeHeight", uno::makeAny(mnRelHeight));
446  }
447 
448  if( !maShapeId.isEmpty() )
449  {
450  uno::Reference< uno::XInterface > xRef( static_cast<uno::XInterface *>(xShape.get()) );
452  }
453 
454  // #91065# count only if counting for shape import is enabled
455  if(GetImport().GetShapeImport()->IsHandleProgressBarEnabled())
456  {
457  // #80365# increment progress bar at load once for each draw object
459  }
460  }
461 
462  mxLockable.set( xShape, UNO_QUERY );
463 
464  if( mxLockable.is() )
465  mxLockable->addActionLock();
466 
467 }
468 
469 void SdXMLShapeContext::AddShape(OUString const & serviceName)
470 {
471  uno::Reference< lang::XMultiServiceFactory > xServiceFact(GetImport().GetModel(), uno::UNO_QUERY);
472  if(!xServiceFact.is())
473  return;
474 
475  try
476  {
477  /* Since fix for issue i33294 the Writer model doesn't support
478  com.sun.star.drawing.OLE2Shape anymore.
479  To handle Draw OLE objects it's decided to import these
480  objects as com.sun.star.drawing.OLE2Shape and convert these
481  objects after the import into com.sun.star.drawing.GraphicObjectShape.
482  */
483  uno::Reference< drawing::XShape > xShape;
484  if ( serviceName == "com.sun.star.drawing.OLE2Shape" &&
485  uno::Reference< text::XTextDocument >(GetImport().GetModel(), uno::UNO_QUERY).is() )
486  {
487  xShape.set(xServiceFact->createInstance("com.sun.star.drawing.temporaryForXMLImportOLE2Shape"), uno::UNO_QUERY);
488  }
489  else if (serviceName == "com.sun.star.drawing.GraphicObjectShape"
490  || serviceName == "com.sun.star.drawing.MediaShape"
491  || serviceName == "com.sun.star.presentation.MediaShape")
492  {
493  css::uno::Sequence<css::uno::Any> args(1);
494  args[0] <<= GetImport().GetDocumentBase();
495  xShape.set( xServiceFact->createInstanceWithArguments(serviceName, args),
496  css::uno::UNO_QUERY);
497  }
498  else
499  {
500  xShape.set(xServiceFact->createInstance(serviceName), uno::UNO_QUERY);
501  }
502  if( xShape.is() )
503  AddShape( xShape );
504  }
505  catch(const uno::Exception& e)
506  {
507  uno::Sequence<OUString> aSeq { serviceName };
509  aSeq, e.Message, nullptr );
510  }
511 }
512 
514 {
515  if(!mxShape.is())
516  return;
517 
518  uno::Reference< beans::XPropertySet > xPropSet(mxShape, uno::UNO_QUERY);
519  if(!xPropSet.is())
520  return;
521 
523 
524  if(maSize.Width != 1 || maSize.Height != 1)
525  {
526  // take care there are no zeros used by error
527  if(0 == maSize.Width)
528  maSize.Width = 1;
529  if(0 == maSize.Height)
530  maSize.Height = 1;
531 
532  // set global size. This should always be used.
533  maUsedTransformation.scale(maSize.Width, maSize.Height);
534  }
535 
536  if(maPosition.X != 0 || maPosition.Y != 0)
537  {
538  // if global position is used, add it to transformation
540  }
541 
543  {
544  // transformation is used, apply to object.
545  // NOTICE: The transformation is applied AFTER evtl. used
546  // global positioning and scaling is used, so any shear or
547  // rotate used herein is applied around the (0,0) position
548  // of the PAGE object !!!
551 
552  // now add to transformation
553  maUsedTransformation *= aMat;
554  }
555 
556  // now set transformation for this object
557 
558  // maUsedTransformtion contains the mathematical correct matrix, which if
559  // applied to a unit square would generate the transformed shape. But the property
560  // "Transformation" contains a matrix, which can be used in TRSetBaseGeometry
561  // and would be created by TRGetBaseGeometry. And those use a mathematically wrong
562  // sign for the shearing angle. So we need to adapt the matrix here.
563  basegfx::B2DTuple aScale;
564  basegfx::B2DTuple aTranslate;
565  double fRotate;
566  double fShearX;
567  maUsedTransformation.decompose(aScale, aTranslate, fRotate, fShearX);
568  basegfx::B2DHomMatrix aB2DHomMatrix;
570  aScale,
571  basegfx::fTools::equalZero(fShearX) ? 0.0 : -fShearX,
572  basegfx::fTools::equalZero(fRotate) ? 0.0 : fRotate,
573  aTranslate);
574  drawing::HomogenMatrix3 aUnoMatrix;
575 
576  aUnoMatrix.Line1.Column1 = aB2DHomMatrix.get(0, 0);
577  aUnoMatrix.Line1.Column2 = aB2DHomMatrix.get(0, 1);
578  aUnoMatrix.Line1.Column3 = aB2DHomMatrix.get(0, 2);
579 
580  aUnoMatrix.Line2.Column1 = aB2DHomMatrix.get(1, 0);
581  aUnoMatrix.Line2.Column2 = aB2DHomMatrix.get(1, 1);
582  aUnoMatrix.Line2.Column3 = aB2DHomMatrix.get(1, 2);
583 
584  aUnoMatrix.Line3.Column1 = aB2DHomMatrix.get(2, 0);
585  aUnoMatrix.Line3.Column2 = aB2DHomMatrix.get(2, 1);
586  aUnoMatrix.Line3.Column3 = aB2DHomMatrix.get(2, 2);
587 
588  xPropSet->setPropertyValue("Transformation", Any(aUnoMatrix));
589 }
590 
591 void SdXMLShapeContext::SetStyle( bool bSupportsStyle /* = true */)
592 {
593  try
594  {
595  uno::Reference< beans::XPropertySet > xPropSet(mxShape, uno::UNO_QUERY);
596  if( !xPropSet.is() )
597  return;
598 
599  do
600  {
601  // set style on shape
602  if(maDrawStyleName.isEmpty())
603  break;
604 
605  const SvXMLStyleContext* pStyle = nullptr;
606  bool bAutoStyle(false);
607 
608  if(GetImport().GetShapeImport()->GetAutoStylesContext())
609  pStyle = GetImport().GetShapeImport()->GetAutoStylesContext()->FindStyleChildContext(mnStyleFamily, maDrawStyleName);
610 
611  if(pStyle)
612  bAutoStyle = true;
613 
614  if(!pStyle && GetImport().GetShapeImport()->GetStylesContext())
615  pStyle = GetImport().GetShapeImport()->GetStylesContext()->FindStyleChildContext(mnStyleFamily, maDrawStyleName);
616 
617  OUString aStyleName = maDrawStyleName;
618  uno::Reference< style::XStyle > xStyle;
619 
620  XMLPropStyleContext* pDocStyle
621  = dynamic_cast<XMLShapeStyleContext*>(const_cast<SvXMLStyleContext*>(pStyle));
622  if (pDocStyle)
623  {
624  if( pDocStyle->GetStyle().is() )
625  {
626  xStyle = pDocStyle->GetStyle();
627  }
628  else
629  {
630  aStyleName = pDocStyle->GetParentName();
631  }
632  }
633 
634  if( !xStyle.is() && !aStyleName.isEmpty() )
635  {
636  try
637  {
638 
639  uno::Reference< style::XStyleFamiliesSupplier > xFamiliesSupplier( GetImport().GetModel(), uno::UNO_QUERY );
640 
641  if( xFamiliesSupplier.is() )
642  {
643  uno::Reference< container::XNameAccess > xFamilies( xFamiliesSupplier->getStyleFamilies() );
644  if( xFamilies.is() )
645  {
646 
647  uno::Reference< container::XNameAccess > xFamily;
648 
650  {
651  aStyleName = GetImport().GetStyleDisplayName(
653  aStyleName );
654  sal_Int32 nPos = aStyleName.lastIndexOf( '-' );
655  if( -1 != nPos )
656  {
657  OUString aFamily( aStyleName.copy( 0, nPos ) );
658 
659  xFamilies->getByName( aFamily ) >>= xFamily;
660  aStyleName = aStyleName.copy( nPos + 1 );
661  }
662  }
663  else
664  {
665  // get graphics family
666  xFamilies->getByName("graphics") >>= xFamily;
667  aStyleName = GetImport().GetStyleDisplayName(
669  aStyleName );
670  }
671 
672  if( xFamily.is() )
673  xFamily->getByName( aStyleName ) >>= xStyle;
674  }
675  }
676  }
677  catch(const uno::Exception&)
678  {
679  DBG_UNHANDLED_EXCEPTION( "xmloff", "finding style for shape" );
680  }
681  }
682 
683  if( bSupportsStyle && xStyle.is() )
684  {
685  try
686  {
687  // set style on object
688  xPropSet->setPropertyValue("Style", Any(xStyle));
689  }
690  catch(const uno::Exception&)
691  {
692  DBG_UNHANDLED_EXCEPTION( "xmloff", "setting style for shape" );
693  }
694  }
695 
696  // Writer shapes: if this one has a TextBox, set it here. We need to do it before
697  // pDocStyle->FillPropertySet, because setting some properties depend on the format
698  // having RES_CNTNT attribute (e.g., UNO_NAME_TEXT_(LEFT|RIGHT|UPPER|LOWER)DIST; see
699  // SwTextBoxHelper::syncProperty, which indirectly calls SwTextBoxHelper::isTextBox)
700  uno::Reference<beans::XPropertySetInfo> xPropertySetInfo
701  = xPropSet->getPropertySetInfo();
702  if (xPropertySetInfo->hasPropertyByName("TextBox"))
703  xPropSet->setPropertyValue("TextBox", uno::makeAny(mbTextBox));
704 
705  // if this is an auto style, set its properties
706  if(bAutoStyle && pDocStyle)
707  {
708  // set PropertySet on object
709  pDocStyle->FillPropertySet(xPropSet);
710  }
711 
712  } while(false);
713 
714  // try to set text auto style
715  do
716  {
717  // set style on shape
718  if( maTextStyleName.isEmpty() )
719  break;
720 
721  if( nullptr == GetImport().GetShapeImport()->GetAutoStylesContext())
722  break;
723 
724  const SvXMLStyleContext* pTempStyle = GetImport().GetShapeImport()->GetAutoStylesContext()->FindStyleChildContext(XmlStyleFamily::TEXT_PARAGRAPH, maTextStyleName);
725  XMLPropStyleContext* pStyle = const_cast<XMLPropStyleContext*>(dynamic_cast<const XMLPropStyleContext*>( pTempStyle ) ); // use temp var, PTR_CAST is a bad macro, FindStyleChildContext will be called twice
726  if( pStyle == nullptr )
727  break;
728 
729  // set PropertySet on object
730  pStyle->FillPropertySet(xPropSet);
731 
732  } while(false);
733  }
734  catch(const uno::Exception&)
735  {
736  }
737 }
738 
740 {
741  if( maLayerName.isEmpty() )
742  return;
743 
744  try
745  {
746  uno::Reference< beans::XPropertySet > xPropSet(mxShape, uno::UNO_QUERY);
747  if(xPropSet.is() )
748  {
749  xPropSet->setPropertyValue("LayerName", Any(maLayerName));
750  return;
751  }
752  }
753  catch(const uno::Exception&)
754  {
755  }
756 }
757 
759 {
760  if( maThumbnailURL.isEmpty() )
761  return;
762 
763  try
764  {
765  uno::Reference< beans::XPropertySet > xPropSet(mxShape, uno::UNO_QUERY);
766  if( !xPropSet.is() )
767  return;
768 
769  uno::Reference< beans::XPropertySetInfo > xPropSetInfo( xPropSet->getPropertySetInfo() );
770  if( xPropSetInfo.is() && xPropSetInfo->hasPropertyByName( "ThumbnailGraphic" ) )
771  {
772  // load the thumbnail graphic and export it to a wmf stream so we can set
773  // it at the api
774 
775  uno::Reference<graphic::XGraphic> xGraphic = GetImport().loadGraphicByURL(maThumbnailURL);
776  xPropSet->setPropertyValue("ThumbnailGraphic", uno::makeAny(xGraphic));
777  }
778  }
779  catch(const uno::Exception&)
780  {
781  }
782 }
783 
784 // this is called from the parent group for each unparsed attribute in the attribute list
786 {
787  sal_Int32 nTmp;
788  switch (aIter.getToken())
789  {
790  case XML_ELEMENT(DRAW, XML_ZINDEX):
791  case XML_ELEMENT(DRAW_EXT, XML_ZINDEX):
792  mnZOrder = aIter.toInt32();
793  break;
794  case XML_ELEMENT(DRAW, XML_ID):
795  case XML_ELEMENT(DRAW_EXT, XML_ID):
796  if (!mbHaveXmlId) { maShapeId = aIter.toString(); }
797  break;
798  case XML_ELEMENT(DRAW, XML_NAME):
799  case XML_ELEMENT(DRAW_EXT, XML_NAME):
800  maShapeName = aIter.toString();
801  break;
803  case XML_ELEMENT(DRAW_EXT, XML_STYLE_NAME):
804  maDrawStyleName = aIter.toString();
805  break;
807  case XML_ELEMENT(DRAW_EXT, XML_TEXT_STYLE_NAME):
808  maTextStyleName = aIter.toString();
809  break;
810  case XML_ELEMENT(DRAW, XML_LAYER):
811  case XML_ELEMENT(DRAW_EXT, XML_LAYER):
812  maLayerName = aIter.toString();
813  break;
815  case XML_ELEMENT(DRAW_EXT, XML_TRANSFORM):
817  break;
819  case XML_ELEMENT(DRAW_EXT, XML_DISPLAY):
820  mbVisible = IsXMLToken( aIter, XML_ALWAYS ) || IsXMLToken( aIter, XML_SCREEN );
821  mbPrintable = IsXMLToken( aIter, XML_ALWAYS ) || IsXMLToken( aIter, XML_PRINTER );
822  break;
823  case XML_ELEMENT(PRESENTATION, XML_USER_TRANSFORMED):
825  break;
826  case XML_ELEMENT(PRESENTATION, XML_PLACEHOLDER):
827  mbIsPlaceholder = IsXMLToken( aIter, XML_TRUE );
828  if( mbIsPlaceholder )
829  mbClearDefaultAttributes = false;
830  break;
831  case XML_ELEMENT(PRESENTATION, XML_CLASS):
832  maPresentationClass = aIter.toString();
833  break;
834  case XML_ELEMENT(PRESENTATION, XML_STYLE_NAME):
835  maDrawStyleName = aIter.toString();
837  break;
838  case XML_ELEMENT(SVG, XML_X):
839  case XML_ELEMENT(SVG_COMPAT, XML_X):
841  maPosition.X, aIter.toView());
842  break;
843  case XML_ELEMENT(SVG, XML_Y):
844  case XML_ELEMENT(SVG_COMPAT, XML_Y):
846  maPosition.Y, aIter.toView());
847  break;
848  case XML_ELEMENT(SVG, XML_WIDTH):
849  case XML_ELEMENT(SVG_COMPAT, XML_WIDTH):
851  maSize.Width, aIter.toView());
852  if (maSize.Width > 0)
853  maSize.Width = o3tl::saturating_add<sal_Int32>(maSize.Width, 1);
854  else if (maSize.Width < 0)
855  maSize.Width = o3tl::saturating_add<sal_Int32>(maSize.Width, -1);
856  break;
857  case XML_ELEMENT(SVG, XML_HEIGHT):
858  case XML_ELEMENT(SVG_COMPAT, XML_HEIGHT):
860  maSize.Height, aIter.toView());
861  if (maSize.Height > 0)
862  maSize.Height = o3tl::saturating_add<sal_Int32>(maSize.Height, 1);
863  else if (maSize.Height < 0)
864  maSize.Height = o3tl::saturating_add<sal_Int32>(maSize.Height, -1);
865  break;
867  case XML_ELEMENT(SVG_COMPAT, XML_TRANSFORM):
868  // because of #85127# take svg:transform into account and handle like
869  // draw:transform for compatibility
871  break;
873  if (sax::Converter::convertPercent(nTmp, aIter.toView()))
874  mnRelWidth = static_cast<sal_Int16>(nTmp);
875  break;
877  if (sax::Converter::convertPercent(nTmp, aIter.toView()))
878  mnRelHeight = static_cast<sal_Int16>(nTmp);
879  break;
880  case XML_ELEMENT(NONE, XML_ID):
881  case XML_ELEMENT(XML, XML_ID):
882  maShapeId = aIter.toString();
883  mbHaveXmlId = true;
884  break;
885  default:
886  return false;
887  }
888  return true;
889 }
890 
892 {
893  if( !maPresentationClass.isEmpty() && const_cast<SdXMLShapeContext*>(this)->GetImport().GetShapeImport()->IsPresentationShapesSupported() )
894  {
896  {
897  return true;
898  }
899 
902  {
903  return true;
904  }
905  }
906 
907  return false;
908 }
909 
911  SvXMLImport& rImport,
912  const css::uno::Reference< css::xml::sax::XFastAttributeList>& xAttrList,
913  uno::Reference< drawing::XShapes > const & rShapes,
914  bool bTemporaryShape)
915 : SdXMLShapeContext( rImport, xAttrList, rShapes, bTemporaryShape ),
916  mnRadius( 0 )
917 {
918 }
919 
921 {
922 }
923 
924 // this is called from the parent group for each unparsed attribute in the attribute list
926 {
927  switch (aIter.getToken())
928  {
931  mnRadius, aIter.toView());
932  break;
933  default:
934  return SdXMLShapeContext::processAttribute( aIter );
935  }
936  return true;
937 }
938 
940  const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList)
941 {
942  // create rectangle shape
943  AddShape("com.sun.star.drawing.RectangleShape");
944  if(!mxShape.is())
945  return;
946 
947  // Add, set Style and properties from base shape
948  SetStyle();
949  SetLayer();
950 
951  // set pos, size, shear and rotate
953 
954  if(mnRadius)
955  {
956  uno::Reference< beans::XPropertySet > xPropSet(mxShape, uno::UNO_QUERY);
957  if(xPropSet.is())
958  {
959  try
960  {
961  xPropSet->setPropertyValue("CornerRadius", uno::makeAny( mnRadius ) );
962  }
963  catch(const uno::Exception&)
964  {
965  DBG_UNHANDLED_EXCEPTION( "xmloff", "setting corner radius");
966  }
967  }
968  }
969  SdXMLShapeContext::startFastElement(nElement, xAttrList);
970 }
971 
972 
974  SvXMLImport& rImport,
975  const css::uno::Reference< css::xml::sax::XFastAttributeList>& xAttrList,
976  uno::Reference< drawing::XShapes > const & rShapes,
977  bool bTemporaryShape)
978 : SdXMLShapeContext( rImport, xAttrList, rShapes, bTemporaryShape ),
979  mnX1( 0 ),
980  mnY1( 0 ),
981  mnX2( 1 ),
982  mnY2( 1 )
983 {
984 }
985 
987 {
988 }
989 
990 // this is called from the parent group for each unparsed attribute in the attribute list
992 {
993  switch (aIter.getToken())
994  {
995  case XML_ELEMENT(SVG, XML_X1):
996  case XML_ELEMENT(SVG_COMPAT, XML_X1):
998  mnX1, aIter.toView());
999  break;
1000  case XML_ELEMENT(SVG, XML_Y1):
1001  case XML_ELEMENT(SVG_COMPAT, XML_Y1):
1003  mnY1, aIter.toView());
1004  break;
1005  case XML_ELEMENT(SVG, XML_X2):
1006  case XML_ELEMENT(SVG_COMPAT, XML_X2):
1008  mnX2, aIter.toView());
1009  break;
1010  case XML_ELEMENT(SVG, XML_Y2):
1011  case XML_ELEMENT(SVG_COMPAT, XML_Y2):
1013  mnY2, aIter.toView());
1014  break;
1015  default:
1016  return SdXMLShapeContext::processAttribute( aIter );
1017  }
1018  return true;
1019 }
1020 
1022  const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList)
1023 {
1024  // #85920# use SetTransformation() to handle import of simple lines.
1025  // This is necessary to take into account all anchor positions and
1026  // other things. All shape imports use the same import schemata now.
1027  // create necessary shape (Line Shape)
1028  AddShape("com.sun.star.drawing.PolyLineShape");
1029 
1030  if(!mxShape.is())
1031  return;
1032 
1033  // Add, set Style and properties from base shape
1034  SetStyle();
1035  SetLayer();
1036 
1037  // get sizes and offsets
1038  awt::Point aTopLeft(mnX1, mnY1);
1039  awt::Point aBottomRight(mnX2, mnY2);
1040 
1041  if(mnX1 > mnX2)
1042  {
1043  aTopLeft.X = mnX2;
1044  aBottomRight.X = mnX1;
1045  }
1046 
1047  if(mnY1 > mnY2)
1048  {
1049  aTopLeft.Y = mnY2;
1050  aBottomRight.Y = mnY1;
1051  }
1052 
1053  // set local parameters on shape
1054  uno::Reference< beans::XPropertySet > xPropSet(mxShape, uno::UNO_QUERY);
1055  if(xPropSet.is())
1056  {
1057  drawing::PointSequenceSequence aPolyPoly(1);
1058  drawing::PointSequence* pOuterSequence = aPolyPoly.getArray();
1059  pOuterSequence->realloc(2);
1060  awt::Point* pInnerSequence = pOuterSequence->getArray();
1061 
1062  *pInnerSequence = awt::Point(o3tl::saturating_sub(mnX1, aTopLeft.X), o3tl::saturating_sub(mnY1, aTopLeft.Y));
1063  pInnerSequence++;
1064  *pInnerSequence = awt::Point(o3tl::saturating_sub(mnX2, aTopLeft.X), o3tl::saturating_sub(mnY2, aTopLeft.Y));
1065 
1066  xPropSet->setPropertyValue("Geometry", Any(aPolyPoly));
1067  }
1068 
1069  // Size is included in point coordinates
1070  maSize.Width = 1;
1071  maSize.Height = 1;
1072  maPosition.X = aTopLeft.X;
1073  maPosition.Y = aTopLeft.Y;
1074 
1075  // set pos, size, shear and rotate and get copy of matrix
1077 
1078  SdXMLShapeContext::startFastElement(nElement, xAttrList);
1079 }
1080 
1081 
1083  SvXMLImport& rImport,
1084  const css::uno::Reference< css::xml::sax::XFastAttributeList>& xAttrList,
1085  uno::Reference< drawing::XShapes > const & rShapes,
1086  bool bTemporaryShape)
1087 : SdXMLShapeContext( rImport, xAttrList, rShapes, bTemporaryShape ),
1088  mnCX( 0 ),
1089  mnCY( 0 ),
1090  mnRX( 1 ),
1091  mnRY( 1 ),
1092  meKind( drawing::CircleKind_FULL ),
1093  mnStartAngle( 0 ),
1094  mnEndAngle( 0 )
1095 {
1096 }
1097 
1099 {
1100 }
1101 
1102 // this is called from the parent group for each unparsed attribute in the attribute list
1104 {
1105  switch (aIter.getToken())
1106  {
1107  case XML_ELEMENT(SVG, XML_RX):
1108  case XML_ELEMENT(SVG_COMPAT, XML_RX):
1110  mnRX, aIter.toView());
1111  break;
1112  case XML_ELEMENT(SVG, XML_RY):
1113  case XML_ELEMENT(SVG_COMPAT, XML_RY):
1115  mnRY, aIter.toView());
1116  break;
1117  case XML_ELEMENT(SVG, XML_CX):
1118  case XML_ELEMENT(SVG_COMPAT, XML_CX):
1120  mnCX, aIter.toView());
1121  break;
1122  case XML_ELEMENT(SVG, XML_CY):
1123  case XML_ELEMENT(SVG_COMPAT, XML_CY):
1125  mnCY, aIter.toView());
1126  break;
1127  case XML_ELEMENT(SVG, XML_R):
1128  case XML_ELEMENT(SVG_COMPAT, XML_R):
1129  // single radius, it's a circle and both radii are the same
1131  mnRX, aIter.toView());
1132  mnRY = mnRX;
1133  break;
1134  case XML_ELEMENT(DRAW, XML_KIND):
1136  break;
1138  {
1139  double dStartAngle;
1140  if (::sax::Converter::convertDouble( dStartAngle, aIter.toView() ))
1141  mnStartAngle = static_cast<sal_Int32>(dStartAngle * 100.0);
1142  break;
1143  }
1145  {
1146  double dEndAngle;
1147  if (::sax::Converter::convertDouble( dEndAngle, aIter.toView() ))
1148  mnEndAngle = static_cast<sal_Int32>(dEndAngle * 100.0);
1149  break;
1150  }
1151  default:
1152  return SdXMLShapeContext::processAttribute( aIter );
1153  }
1154  return true;
1155 }
1156 
1158  const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList)
1159 {
1160  // create rectangle shape
1161  AddShape("com.sun.star.drawing.EllipseShape");
1162  if(!mxShape.is())
1163  return;
1164 
1165  // Add, set Style and properties from base shape
1166  SetStyle();
1167  SetLayer();
1168 
1169  if(mnCX != 0 || mnCY != 0 || mnRX != 1 || mnRY != 1)
1170  {
1171  // #i121972# center/radius is used, put to pos and size
1172  maSize.Width = 2 * mnRX;
1173  maSize.Height = 2 * mnRY;
1174  maPosition.X = mnCX - mnRX;
1175  maPosition.Y = mnCY - mnRY;
1176  }
1177 
1178  // set pos, size, shear and rotate
1180 
1181  if( meKind != drawing::CircleKind_FULL )
1182  {
1183  uno::Reference< beans::XPropertySet > xPropSet( mxShape, uno::UNO_QUERY );
1184  if( xPropSet.is() )
1185  {
1186  xPropSet->setPropertyValue("CircleKind", Any( meKind) );
1187  xPropSet->setPropertyValue("CircleStartAngle", Any(mnStartAngle) );
1188  xPropSet->setPropertyValue("CircleEndAngle", Any(mnEndAngle) );
1189  }
1190  }
1191 
1192  SdXMLShapeContext::startFastElement(nElement, xAttrList);
1193 }
1194 
1195 
1197  SvXMLImport& rImport,
1198  const css::uno::Reference< css::xml::sax::XFastAttributeList>& xAttrList,
1199  uno::Reference< drawing::XShapes > const & rShapes, bool bClosed, bool bTemporaryShape)
1200 : SdXMLShapeContext( rImport, xAttrList, rShapes, bTemporaryShape ),
1201  mbClosed( bClosed )
1202 {
1203 }
1204 
1205 // this is called from the parent group for each unparsed attribute in the attribute list
1207 {
1208  switch (aIter.getToken())
1209  {
1210  case XML_ELEMENT(SVG, XML_VIEWBOX):
1211  case XML_ELEMENT(SVG_COMPAT, XML_VIEWBOX):
1212  maViewBox = aIter.toString();
1213  break;
1214  case XML_ELEMENT(DRAW, XML_POINTS):
1215  maPoints = aIter.toString();
1216  break;
1217  default:
1218  return SdXMLShapeContext::processAttribute( aIter);
1219  }
1220  return true;
1221 }
1222 
1224 {
1225 }
1226 
1228  const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList)
1229 {
1230  // Add, set Style and properties from base shape
1231  if(mbClosed)
1232  AddShape("com.sun.star.drawing.PolyPolygonShape");
1233  else
1234  AddShape("com.sun.star.drawing.PolyLineShape");
1235 
1236  if( !mxShape.is() )
1237  return;
1238 
1239  SetStyle();
1240  SetLayer();
1241 
1242  // set local parameters on shape
1243  uno::Reference< beans::XPropertySet > xPropSet(mxShape, uno::UNO_QUERY);
1244  if(xPropSet.is())
1245  {
1246  // set polygon
1247  if(!maPoints.isEmpty() && !maViewBox.isEmpty())
1248  {
1249  const SdXMLImExViewBox aViewBox(maViewBox, GetImport().GetMM100UnitConverter());
1250  basegfx::B2DVector aSize(aViewBox.GetWidth(), aViewBox.GetHeight());
1251 
1252  // Is this correct? It overrides ViewBox stuff; OTOH it makes no
1253  // sense to have the geometry content size different from object size
1254  if(maSize.Width != 0 && maSize.Height != 0)
1255  {
1256  aSize = basegfx::B2DVector(maSize.Width, maSize.Height);
1257  }
1258 
1259  basegfx::B2DPolygon aPolygon;
1260 
1262  {
1263  if(aPolygon.count())
1264  {
1265  const basegfx::B2DRange aSourceRange(
1266  aViewBox.GetX(), aViewBox.GetY(),
1267  aViewBox.GetX() + aViewBox.GetWidth(), aViewBox.GetY() + aViewBox.GetHeight());
1268  const basegfx::B2DRange aTargetRange(
1269  aViewBox.GetX(), aViewBox.GetY(),
1270  aViewBox.GetX() + aSize.getX(), aViewBox.GetY() + aSize.getY());
1271 
1272  if(!aSourceRange.equal(aTargetRange))
1273  {
1274  aPolygon.transform(
1276  aSourceRange,
1277  aTargetRange));
1278  }
1279 
1280  css::drawing::PointSequenceSequence aPointSequenceSequence;
1282  xPropSet->setPropertyValue("Geometry", Any(aPointSequenceSequence));
1283  // Size is now contained in the point coordinates, adapt maSize for
1284  // to use the correct transformation matrix in SetTransformation()
1285  maSize.Width = 1;
1286  maSize.Height = 1;
1287  }
1288  }
1289  }
1290  }
1291 
1292  // set pos, size, shear and rotate and get copy of matrix
1294 
1295  SdXMLShapeContext::startFastElement(nElement, xAttrList);
1296 }
1297 
1298 
1300  SvXMLImport& rImport,
1301  const css::uno::Reference< css::xml::sax::XFastAttributeList>& xAttrList,
1302  uno::Reference< drawing::XShapes > const & rShapes,
1303  bool bTemporaryShape)
1304 : SdXMLShapeContext( rImport, xAttrList, rShapes, bTemporaryShape )
1305 {
1306 }
1307 
1309 {
1310 }
1311 
1312 // this is called from the parent group for each unparsed attribute in the attribute list
1314 {
1315  switch (aIter.getToken())
1316  {
1317  case XML_ELEMENT(SVG, XML_VIEWBOX):
1318  case XML_ELEMENT(SVG_COMPAT, XML_VIEWBOX):
1319  maViewBox = aIter.toString();
1320  break;
1321  case XML_ELEMENT(SVG, XML_D):
1322  case XML_ELEMENT(SVG_COMPAT, XML_D):
1323  maD = aIter.toString();
1324  break;
1325  default:
1326  return SdXMLShapeContext::processAttribute( aIter );
1327  }
1328  return true;
1329 }
1330 
1332  const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList)
1333 {
1334  // create polygon shape
1335  if(maD.isEmpty())
1336  return;
1337 
1338  const SdXMLImExViewBox aViewBox(maViewBox, GetImport().GetMM100UnitConverter());
1339  basegfx::B2DVector aSize(aViewBox.GetWidth(), aViewBox.GetHeight());
1340 
1341  // Is this correct? It overrides ViewBox stuff; OTOH it makes no
1342  // sense to have the geometry content size different from object size
1343  if(maSize.Width != 0 && maSize.Height != 0)
1344  {
1345  aSize = basegfx::B2DVector(maSize.Width, maSize.Height);
1346  }
1347 
1348  basegfx::B2DPolyPolygon aPolyPolygon;
1349 
1350  if(!basegfx::utils::importFromSvgD(aPolyPolygon, maD, GetImport().needFixPositionAfterZ(), nullptr))
1351  return;
1352 
1353  if(!aPolyPolygon.count())
1354  return;
1355 
1356  const basegfx::B2DRange aSourceRange(
1357  aViewBox.GetX(), aViewBox.GetY(),
1358  aViewBox.GetX() + aViewBox.GetWidth(), aViewBox.GetY() + aViewBox.GetHeight());
1359  const basegfx::B2DRange aTargetRange(
1360  aViewBox.GetX(), aViewBox.GetY(),
1361  aViewBox.GetX() + aSize.getX(), aViewBox.GetY() + aSize.getY());
1362 
1363  if(!aSourceRange.equal(aTargetRange))
1364  {
1365  aPolyPolygon.transform(
1367  aSourceRange,
1368  aTargetRange));
1369  }
1370 
1371  // create shape
1372  OUString service;
1373 
1374  if(aPolyPolygon.areControlPointsUsed())
1375  {
1376  if(aPolyPolygon.isClosed())
1377  {
1378  service = "com.sun.star.drawing.ClosedBezierShape";
1379  }
1380  else
1381  {
1382  service = "com.sun.star.drawing.OpenBezierShape";
1383  }
1384  }
1385  else
1386  {
1387  if(aPolyPolygon.isClosed())
1388  {
1389  service = "com.sun.star.drawing.PolyPolygonShape";
1390  }
1391  else
1392  {
1393  service = "com.sun.star.drawing.PolyLineShape";
1394  }
1395  }
1396 
1397  // Add, set Style and properties from base shape
1398  AddShape(service);
1399 
1400  // #89344# test for mxShape.is() and not for mxShapes.is() to support
1401  // shape import helper classes WITHOUT XShapes (member mxShapes). This
1402  // is used by the writer.
1403  if( !mxShape.is() )
1404  return;
1405 
1406  SetStyle();
1407  SetLayer();
1408 
1409  // set local parameters on shape
1410  uno::Reference< beans::XPropertySet > xPropSet(mxShape, uno::UNO_QUERY);
1411 
1412  if(xPropSet.is())
1413  {
1414  uno::Any aAny;
1415 
1416  // set polygon data
1417  if(aPolyPolygon.areControlPointsUsed())
1418  {
1419  drawing::PolyPolygonBezierCoords aSourcePolyPolygon;
1420 
1422  aPolyPolygon,
1423  aSourcePolyPolygon);
1424  aAny <<= aSourcePolyPolygon;
1425  }
1426  else
1427  {
1428  drawing::PointSequenceSequence aSourcePolyPolygon;
1429 
1431  aPolyPolygon,
1432  aSourcePolyPolygon);
1433  aAny <<= aSourcePolyPolygon;
1434  }
1435 
1436  xPropSet->setPropertyValue("Geometry", aAny);
1437  // Size is now contained in the point coordinates, adapt maSize for
1438  // to use the correct transformation matrix in SetTransformation()
1439  maSize.Width = 1;
1440  maSize.Height = 1;
1441  }
1442 
1443  // set pos, size, shear and rotate
1445 
1446  SdXMLShapeContext::startFastElement(nElement, xAttrList);
1447 }
1448 
1449 
1451  SvXMLImport& rImport,
1452  const css::uno::Reference< css::xml::sax::XFastAttributeList>& xAttrList,
1453  uno::Reference< drawing::XShapes > const & rShapes)
1454 : SdXMLShapeContext( rImport, xAttrList, rShapes, false/*bTemporaryShape*/ ),
1455  mnRadius(0),
1456  maChainNextName("")
1457 {
1458 }
1459 
1461 {
1462 }
1463 
1464 // this is called from the parent group for each unparsed attribute in the attribute list
1466 {
1467  switch (aIter.getToken())
1468  {
1471  mnRadius, aIter.toView());
1472  break;
1474  maChainNextName = aIter.toString();
1475  break;
1476  default:
1477  return SdXMLShapeContext::processAttribute( aIter );
1478  }
1479  return true;
1480 }
1481 
1483  const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList)
1484 {
1485  // create textbox shape
1486  bool bIsPresShape = false;
1487  bool bClearText = false;
1488 
1489  OUString service;
1490 
1491  if( isPresentationShape() )
1492  {
1493  // check if the current document supports presentation shapes
1494  if( GetImport().GetShapeImport()->IsPresentationShapesSupported() )
1495  {
1497  {
1498  // XmlShapeTypePresSubtitleShape
1499  service = "com.sun.star.presentation.SubtitleShape";
1500  }
1502  {
1503  // XmlShapeTypePresOutlinerShape
1504  service = "com.sun.star.presentation.OutlinerShape";
1505  }
1507  {
1508  // XmlShapeTypePresNotesShape
1509  service = "com.sun.star.presentation.NotesShape";
1510  }
1512  {
1513  // XmlShapeTypePresHeaderShape
1514  service = "com.sun.star.presentation.HeaderShape";
1515  bClearText = true;
1516  }
1518  {
1519  // XmlShapeTypePresFooterShape
1520  service = "com.sun.star.presentation.FooterShape";
1521  bClearText = true;
1522  }
1524  {
1525  // XmlShapeTypePresSlideNumberShape
1526  service = "com.sun.star.presentation.SlideNumberShape";
1527  bClearText = true;
1528  }
1530  {
1531  // XmlShapeTypePresDateTimeShape
1532  service = "com.sun.star.presentation.DateTimeShape";
1533  bClearText = true;
1534  }
1535  else // IsXMLToken( maPresentationClass, XML_TITLE ) )
1536  {
1537  // XmlShapeTypePresTitleTextShape
1538  service = "com.sun.star.presentation.TitleTextShape";
1539  }
1540  bIsPresShape = true;
1541  }
1542  }
1543 
1544  if( service.isEmpty() )
1545  {
1546  // normal text shape
1547  service = "com.sun.star.drawing.TextShape";
1548  }
1549 
1550  // Add, set Style and properties from base shape
1551  AddShape(service);
1552 
1553  if( !mxShape.is() )
1554  return;
1555 
1556  SetStyle();
1557  SetLayer();
1558 
1559  if(bIsPresShape)
1560  {
1561  uno::Reference< beans::XPropertySet > xProps(mxShape, uno::UNO_QUERY);
1562  if(xProps.is())
1563  {
1564  uno::Reference< beans::XPropertySetInfo > xPropsInfo( xProps->getPropertySetInfo() );
1565  if( xPropsInfo.is() )
1566  {
1567  if( !mbIsPlaceholder && xPropsInfo->hasPropertyByName("IsEmptyPresentationObject"))
1568  xProps->setPropertyValue("IsEmptyPresentationObject", css::uno::Any(false) );
1569 
1570  if( mbIsUserTransformed && xPropsInfo->hasPropertyByName("IsPlaceholderDependent"))
1571  xProps->setPropertyValue("IsPlaceholderDependent", css::uno::Any(false) );
1572  }
1573  }
1574  }
1575 
1576  if( bClearText )
1577  {
1578  uno::Reference< text::XText > xText( mxShape, uno::UNO_QUERY );
1579  xText->setString( "" );
1580  }
1581 
1582  // set parameters on shape
1583 //A AW->CL: Eventually You need to strip scale and translate from the transformation
1584 //A to reach the same goal again.
1585 //A if(!bIsPresShape || mbIsUserTransformed)
1586 //A {
1587 //A // set pos and size on shape, this should remove binding
1588 //A // to pres object on masterpage
1589 //A SetSizeAndPosition();
1590 //A }
1591 
1592  // set pos, size, shear and rotate
1594 
1595  if(mnRadius)
1596  {
1597  uno::Reference< beans::XPropertySet > xPropSet(mxShape, uno::UNO_QUERY);
1598  if(xPropSet.is())
1599  {
1600  try
1601  {
1602  xPropSet->setPropertyValue("CornerRadius", uno::makeAny( mnRadius ) );
1603  }
1604  catch(const uno::Exception&)
1605  {
1606  DBG_UNHANDLED_EXCEPTION( "xmloff", "setting corner radius");
1607  }
1608  }
1609  }
1610 
1611  if(!maChainNextName.isEmpty())
1612  {
1613  uno::Reference< beans::XPropertySet > xPropSet(mxShape, uno::UNO_QUERY);
1614  if(xPropSet.is())
1615  {
1616  try
1617  {
1618  xPropSet->setPropertyValue("TextChainNextName",
1619  uno::makeAny( maChainNextName ) );
1620  }
1621  catch(const uno::Exception&)
1622  {
1623  DBG_UNHANDLED_EXCEPTION( "xmloff", "setting name of next chain link");
1624  }
1625  }
1626  }
1627 
1628  SdXMLShapeContext::startFastElement(nElement, xAttrList);
1629 }
1630 
1631 
1633  SvXMLImport& rImport,
1634  const css::uno::Reference< css::xml::sax::XFastAttributeList>& xAttrList,
1635  uno::Reference< drawing::XShapes > const & rShapes,
1636  bool bTemporaryShape)
1637 : SdXMLShapeContext( rImport, xAttrList, rShapes, bTemporaryShape )
1638 {
1639 }
1640 
1642 {
1643 }
1644 
1645 // this is called from the parent group for each unparsed attribute in the attribute list
1647 {
1648  switch (aIter.getToken())
1649  {
1650  case XML_ELEMENT(DRAW, XML_CONTROL):
1651  maFormId = aIter.toString();
1652  break;
1653  default:
1654  return SdXMLShapeContext::processAttribute( aIter );
1655  }
1656  return true;
1657 }
1658 
1660  const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList)
1661 {
1662  // create Control shape
1663  // add, set style and properties from base shape
1664  AddShape("com.sun.star.drawing.ControlShape");
1665  if( !mxShape.is() )
1666  return;
1667 
1668  SAL_WARN_IF( !!maFormId.isEmpty(), "xmloff", "draw:control without a form:id attribute!" );
1669  if( !maFormId.isEmpty() )
1670  {
1671  if( GetImport().IsFormsSupported() )
1672  {
1673  uno::Reference< awt::XControlModel > xControlModel( GetImport().GetFormImport()->lookupControl( maFormId ), uno::UNO_QUERY );
1674  if( xControlModel.is() )
1675  {
1676  uno::Reference< drawing::XControlShape > xControl( mxShape, uno::UNO_QUERY );
1677  if( xControl.is() )
1678  xControl->setControl( xControlModel );
1679 
1680  }
1681  }
1682  }
1683 
1684  SetStyle();
1685  SetLayer();
1686 
1687  // set pos, size, shear and rotate
1689 
1690  SdXMLShapeContext::startFastElement(nElement, xAttrList);
1691 }
1692 
1693 
1695  SvXMLImport& rImport,
1696  const css::uno::Reference< css::xml::sax::XFastAttributeList>& xAttrList,
1697  uno::Reference< drawing::XShapes > const & rShapes,
1698  bool bTemporaryShape)
1699 : SdXMLShapeContext( rImport, xAttrList, rShapes, bTemporaryShape ),
1700  maStart(0,0),
1701  maEnd(1,1),
1702  mnType( drawing::ConnectorType_STANDARD ),
1703  mnStartGlueId(-1),
1704  mnEndGlueId(-1),
1705  mnDelta1(0),
1706  mnDelta2(0),
1707  mnDelta3(0)
1708 {
1709 }
1710 
1712 {
1713 }
1714 
1716 {
1717  bool bWrongPositionAfterZ( false );
1718  sal_Int32 nUPD( 0 );
1719  sal_Int32 nBuildId( 0 );
1720  if ( getBuildIds( nUPD, nBuildId ) && // test OOo and old versions of LibO and AOO
1721  ( ( ( nUPD == 641 ) || ( nUPD == 645 ) || ( nUPD == 680 ) || ( nUPD == 300 ) ||
1722  ( nUPD == 310 ) || ( nUPD == 320 ) || ( nUPD == 330 ) || ( nUPD == 340 ) ||
1723  ( nUPD == 350 && nBuildId < 202 ) )
1724  || (getGeneratorVersion() == SvXMLImport::AOO_40x))) // test if AOO 4.0.x
1725  // apparently bug was fixed in AOO by i#123433 f15874d8f976f3874bdbcb53429eeefa65c28841
1726  {
1727  bWrongPositionAfterZ = true;
1728  }
1729  return bWrongPositionAfterZ;
1730 }
1731 
1732 
1733 // this is called from the parent group for each unparsed attribute in the attribute list
1735 {
1736  switch( aIter.getToken() )
1737  {
1739  maStartShapeId = aIter.toString();
1740  break;
1742  mnStartGlueId = aIter.toInt32();
1743  break;
1745  maEndShapeId = aIter.toString();
1746  break;
1748  mnEndGlueId = aIter.toInt32();
1749  break;
1751  {
1752  OUString sValue = aIter.toString();
1753  SvXMLTokenEnumerator aTokenEnum( sValue );
1754  std::u16string_view aToken;
1755  if( aTokenEnum.getNextToken( aToken ) )
1756  {
1758  mnDelta1, aToken);
1759  if( aTokenEnum.getNextToken( aToken ) )
1760  {
1762  mnDelta2, aToken);
1763  if( aTokenEnum.getNextToken( aToken ) )
1764  {
1766  mnDelta3, aToken);
1767  }
1768  }
1769  }
1770  break;
1771  }
1772  case XML_ELEMENT(DRAW, XML_TYPE):
1773  {
1775  break;
1776  }
1777  // #121965# draw:transform may be used in ODF1.2, e.g. exports from MS seem to use these
1780  break;
1781 
1782  case XML_ELEMENT(SVG, XML_X1):
1783  case XML_ELEMENT(SVG_COMPAT, XML_X1):
1785  maStart.X, aIter.toView());
1786  break;
1787  case XML_ELEMENT(SVG, XML_Y1):
1788  case XML_ELEMENT(SVG_COMPAT, XML_Y1):
1790  maStart.Y, aIter.toView());
1791  break;
1792  case XML_ELEMENT(SVG, XML_X2):
1793  case XML_ELEMENT(SVG_COMPAT, XML_X2):
1795  maEnd.X, aIter.toView());
1796  break;
1797  case XML_ELEMENT(SVG, XML_Y2):
1798  case XML_ELEMENT(SVG_COMPAT, XML_Y2):
1800  maEnd.Y, aIter.toView());
1801  break;
1802  case XML_ELEMENT(SVG, XML_D):
1803  case XML_ELEMENT(SVG_COMPAT, XML_D):
1804  {
1805  basegfx::B2DPolyPolygon aPolyPolygon;
1806 
1807  if(basegfx::utils::importFromSvgD(aPolyPolygon, aIter.toString(), GetImport().needFixPositionAfterZ(), nullptr))
1808  {
1809  if(aPolyPolygon.count())
1810  {
1811  drawing::PolyPolygonBezierCoords aSourcePolyPolygon;
1812 
1814  aPolyPolygon,
1815  aSourcePolyPolygon);
1816  maPath <<= aSourcePolyPolygon;
1817  }
1818  }
1819  break;
1820  }
1821  default:
1822  return SdXMLShapeContext::processAttribute( aIter );
1823  }
1824  return true;
1825 }
1826 
1828  const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList)
1829 {
1830  // For security reasons, do not add empty connectors. There may have been an error in EA2
1831  // that created empty, far set off connectors (e.g. 63 meters below top of document). This
1832  // is not guaranteed, but it's definitely safe to not add empty connectors.
1833  bool bDoAdd(true);
1834 
1835  if( maStartShapeId.isEmpty()
1836  && maEndShapeId.isEmpty()
1837  && maStart.X == maEnd.X
1838  && maStart.Y == maEnd.Y
1839  && 0 == mnDelta1
1840  && 0 == mnDelta2
1841  && 0 == mnDelta3
1842  )
1843  {
1844  bDoAdd = false;
1845  }
1846 
1847  if(!bDoAdd)
1848  return;
1849 
1850  // create Connector shape
1851  // add, set style and properties from base shape
1852  AddShape("com.sun.star.drawing.ConnectorShape");
1853  if(!mxShape.is())
1854  return;
1855 
1856  // #121965# if draw:transform is used, apply directly to the start
1857  // and end positions before using these
1858  if(mnTransform.NeedsAction())
1859  {
1860  // transformation is used, apply to object.
1863 
1864  if(!aMat.isIdentity())
1865  {
1866  basegfx::B2DPoint aStart(maStart.X, maStart.Y);
1867  basegfx::B2DPoint aEnd(maEnd.X, maEnd.Y);
1868 
1869  aStart = aMat * aStart;
1870  aEnd = aMat * aEnd;
1871 
1872  maStart.X = basegfx::fround(aStart.getX());
1873  maStart.Y = basegfx::fround(aStart.getY());
1874  maEnd.X = basegfx::fround(aEnd.getX());
1875  maEnd.Y = basegfx::fround(aEnd.getY());
1876  }
1877  }
1878 
1879  // add connection ids
1880  if( !maStartShapeId.isEmpty() )
1881  GetImport().GetShapeImport()->addShapeConnection( mxShape, true, maStartShapeId, mnStartGlueId );
1882  if( !maEndShapeId.isEmpty() )
1883  GetImport().GetShapeImport()->addShapeConnection( mxShape, false, maEndShapeId, mnEndGlueId );
1884 
1885  uno::Reference< beans::XPropertySet > xProps( mxShape, uno::UNO_QUERY );
1886  if( xProps.is() )
1887  {
1888  xProps->setPropertyValue("StartPosition", Any(maStart));
1889  xProps->setPropertyValue("EndPosition", Any(maEnd) );
1890  xProps->setPropertyValue("EdgeKind", Any(mnType) );
1891  xProps->setPropertyValue("EdgeLine1Delta", Any(mnDelta1) );
1892  xProps->setPropertyValue("EdgeLine2Delta", Any(mnDelta2) );
1893  xProps->setPropertyValue("EdgeLine3Delta", Any(mnDelta3) );
1894  }
1895  SetStyle();
1896  SetLayer();
1897 
1898  if ( maPath.hasValue() )
1899  {
1900  // #i115492#
1901  // Ignore svg:d attribute for text documents created by OpenOffice.org
1902  // versions before OOo 3.3, because these OOo versions are storing
1903  // svg:d values not using the correct unit.
1904  bool bApplySVGD( true );
1905  if ( uno::Reference< text::XTextDocument >(GetImport().GetModel(), uno::UNO_QUERY).is() )
1906  {
1907  sal_Int32 nUPD( 0 );
1908  sal_Int32 nBuild( 0 );
1909  const bool bBuildIdFound = GetImport().getBuildIds( nUPD, nBuild );
1910  if ( GetImport().IsTextDocInOOoFileFormat() ||
1911  ( bBuildIdFound &&
1912  ( ( nUPD == 641 ) || ( nUPD == 645 ) || // prior OOo 2.0
1913  ( nUPD == 680 ) || // OOo 2.x
1914  ( nUPD == 300 ) || // OOo 3.0 - OOo 3.0.1
1915  ( nUPD == 310 ) || // OOo 3.1 - OOo 3.1.1
1916  ( nUPD == 320 ) ) ) ) // OOo 3.2 - OOo 3.2.1
1917  {
1918  bApplySVGD = false;
1919  }
1920  }
1921 
1922  if ( bApplySVGD )
1923  {
1924  // tdf#83360 use path data only when redundant data of start and end point coordinates of
1925  // path start/end and connector start/end is equal. This is to avoid using erraneous
1926  // or inconsistent path data at import of foreign formats. Office itself always
1927  // writes out a consistent data set. Not using it when there is inconsistency
1928  // is okay since the path data is redundant, buffered data just to avoid recalculation
1929  // of the connector's layout at load time, no real information would be lost.
1930  // A 'connected' end has prio to direct coordinate data in Start/EndPosition
1931  // to the path data (which should have the start/end redundant in the path)
1932  const drawing::PolyPolygonBezierCoords* pSource = static_cast< const drawing::PolyPolygonBezierCoords* >(maPath.getValue());
1933  const sal_uInt32 nSequenceCount(pSource->Coordinates.getLength());
1934  bool bStartEqual(false);
1935  bool bEndEqual(false);
1936 
1937  if(nSequenceCount)
1938  {
1939  const drawing::PointSequence& rStartSeq = pSource->Coordinates[0];
1940  const sal_uInt32 nStartCount = rStartSeq.getLength();
1941 
1942  if(nStartCount)
1943  {
1944  const awt::Point& rStartPoint = rStartSeq.getConstArray()[0];
1945 
1946  if(rStartPoint.X == maStart.X && rStartPoint.Y == maStart.Y)
1947  {
1948  bStartEqual = true;
1949  }
1950  }
1951 
1952  const drawing::PointSequence& rEndSeq = pSource->Coordinates[nSequenceCount - 1];
1953  const sal_uInt32 nEndCount = rEndSeq.getLength();
1954 
1955  if(nEndCount)
1956  {
1957  const awt::Point& rEndPoint = rEndSeq.getConstArray()[nEndCount - 1];
1958 
1959  if(rEndPoint.X == maEnd.X && rEndPoint.Y == maEnd.Y)
1960  {
1961  bEndEqual = true;
1962  }
1963  }
1964  }
1965 
1966  if(!bStartEqual || !bEndEqual)
1967  {
1968  bApplySVGD = false;
1969  }
1970  }
1971 
1972  if ( bApplySVGD )
1973  {
1975  xProps->setPropertyValue("PolyPolygonBezier", maPath);
1976  }
1977  }
1978 
1979  SdXMLShapeContext::startFastElement(nElement, xAttrList);
1980 }
1981 
1982 
1984  SvXMLImport& rImport,
1985  const css::uno::Reference< css::xml::sax::XFastAttributeList>& xAttrList,
1986  uno::Reference< drawing::XShapes > const & rShapes,
1987  bool bTemporaryShape)
1988 : SdXMLShapeContext( rImport, xAttrList, rShapes, bTemporaryShape ),
1989  maStart(0,0),
1990  maEnd(1,1)
1991 {
1992 }
1993 
1995 {
1996 }
1997 
1998 // this is called from the parent group for each unparsed attribute in the attribute list
2000 {
2001  switch( aIter.getToken() )
2002  {
2003  case XML_ELEMENT(SVG, XML_X1):
2004  case XML_ELEMENT(SVG_COMPAT, XML_X1):
2005  {
2007  maStart.X, aIter.toView());
2008  break;
2009  }
2010  case XML_ELEMENT(SVG, XML_Y1):
2011  case XML_ELEMENT(SVG_COMPAT, XML_Y1):
2012  {
2014  maStart.Y, aIter.toView());
2015  break;
2016  }
2017  case XML_ELEMENT(SVG, XML_X2):
2018  case XML_ELEMENT(SVG_COMPAT, XML_X2):
2019  {
2021  maEnd.X, aIter.toView());
2022  break;
2023  }
2024  case XML_ELEMENT(SVG, XML_Y2):
2025  case XML_ELEMENT(SVG_COMPAT, XML_Y2):
2026  {
2028  maEnd.Y, aIter.toView());
2029  break;
2030  }
2031  default:
2032  return SdXMLShapeContext::processAttribute( aIter );
2033  }
2034  return true;
2035 }
2036 
2038  const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList)
2039 {
2040  // create Measure shape
2041  // add, set style and properties from base shape
2042  AddShape("com.sun.star.drawing.MeasureShape");
2043  if(!mxShape.is())
2044  return;
2045 
2046  SetStyle();
2047  SetLayer();
2048 
2049  uno::Reference< beans::XPropertySet > xProps( mxShape, uno::UNO_QUERY );
2050  if( xProps.is() )
2051  {
2052  xProps->setPropertyValue("StartPosition", Any(maStart));
2053  xProps->setPropertyValue("EndPosition", Any(maEnd) );
2054  }
2055 
2056  // delete pre created fields
2057  uno::Reference< text::XText > xText( mxShape, uno::UNO_QUERY );
2058  if( xText.is() )
2059  {
2060  xText->setString( " " );
2061  }
2062 
2063  SdXMLShapeContext::startFastElement(nElement, xAttrList);
2064 }
2065 
2067 {
2068  do
2069  {
2070  // delete pre created fields
2071  uno::Reference< text::XText > xText( mxShape, uno::UNO_QUERY );
2072  if( !xText.is() )
2073  break;
2074 
2075  uno::Reference< text::XTextCursor > xCursor( xText->createTextCursor() );
2076  if( !xCursor.is() )
2077  break;
2078 
2079  xCursor->collapseToStart();
2080  xCursor->goRight( 1, true );
2081  xCursor->setString( "" );
2082  }
2083  while(false);
2084 
2086 }
2087 
2088 
2090  SvXMLImport& rImport,
2091  const css::uno::Reference< css::xml::sax::XFastAttributeList>& xAttrList,
2092  uno::Reference< drawing::XShapes > const & rShapes,
2093  bool bTemporaryShape)
2094 : SdXMLShapeContext( rImport, xAttrList, rShapes, bTemporaryShape ), mnPageNumber(0)
2095 {
2096  mbClearDefaultAttributes = false;
2097 }
2098 
2100 {
2101 }
2102 
2103 // this is called from the parent group for each unparsed attribute in the attribute list
2105 {
2106  if( aIter.getToken() == XML_ELEMENT(DRAW, XML_PAGE_NUMBER) )
2107  mnPageNumber = aIter.toInt32();
2108  else
2109  return SdXMLShapeContext::processAttribute( aIter );
2110  return true;
2111 }
2112 
2114  const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList)
2115 {
2116  // create Page shape
2117  // add, set style and properties from base shape
2118 
2119  // #86163# take into account which type of PageShape needs to
2120  // be constructed. It's a pres shape if presentation:XML_CLASS == XML_PAGE.
2121  bool bIsPresentation = !maPresentationClass.isEmpty() &&
2122  GetImport().GetShapeImport()->IsPresentationShapesSupported();
2123 
2124  uno::Reference< lang::XServiceInfo > xInfo( mxShapes, uno::UNO_QUERY );
2125  const bool bIsOnHandoutPage = xInfo.is() && xInfo->supportsService("com.sun.star.presentation.HandoutMasterPage");
2126 
2127  if( bIsOnHandoutPage )
2128  {
2129  AddShape("com.sun.star.presentation.HandoutShape");
2130  }
2131  else
2132  {
2133  if(bIsPresentation && !IsXMLToken( maPresentationClass, XML_PAGE ) )
2134  {
2135  bIsPresentation = false;
2136  }
2137 
2138  if(bIsPresentation)
2139  {
2140  AddShape("com.sun.star.presentation.PageShape");
2141  }
2142  else
2143  {
2144  AddShape("com.sun.star.drawing.PageShape");
2145  }
2146  }
2147 
2148  if(!mxShape.is())
2149  return;
2150 
2151  SetStyle();
2152  SetLayer();
2153 
2154  // set pos, size, shear and rotate
2156 
2157  uno::Reference< beans::XPropertySet > xPropSet(mxShape, uno::UNO_QUERY);
2158  if(xPropSet.is())
2159  {
2160  uno::Reference< beans::XPropertySetInfo > xPropSetInfo( xPropSet->getPropertySetInfo() );
2161  static const OUStringLiteral aPageNumberStr(u"PageNumber");
2162  if( xPropSetInfo.is() && xPropSetInfo->hasPropertyByName(aPageNumberStr))
2163  xPropSet->setPropertyValue(aPageNumberStr, uno::makeAny( mnPageNumber ));
2164  }
2165 
2166  SdXMLShapeContext::startFastElement(nElement, xAttrList);
2167 }
2168 
2169 
2171  SvXMLImport& rImport,
2172  const css::uno::Reference< css::xml::sax::XFastAttributeList>& xAttrList,
2173  uno::Reference< drawing::XShapes > const & rShapes,
2174  bool bTemporaryShape)
2175 : SdXMLShapeContext( rImport, xAttrList, rShapes, bTemporaryShape ),
2176  // #86616# for correct edge rounding import mnRadius needs to be initialized
2177  mnRadius( 0 )
2178 {
2179 }
2180 
2182 {
2183 }
2184 
2186  const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList)
2187 {
2188  // create Caption shape
2189  // add, set style and properties from base shape
2190  AddShape("com.sun.star.drawing.CaptionShape");
2191  if( !mxShape.is() )
2192  return;
2193 
2194  SetStyle();
2195  SetLayer();
2196 
2197  uno::Reference< beans::XPropertySet > xProps( mxShape, uno::UNO_QUERY );
2198 
2199  // SJ: If AutoGrowWidthItem is set, SetTransformation will lead to the wrong SnapRect
2200  // because NbcAdjustTextFrameWidthAndHeight() is called (text is set later and center alignment
2201  // is the default setting, so the top left reference point that is used by the caption point is
2202  // no longer correct) There are two ways to solve this problem, temporarily disabling the
2203  // autogrowwidth as we are doing here or to apply the CaptionPoint after setting text
2204  bool bIsAutoGrowWidth = false;
2205  if ( xProps.is() )
2206  {
2207  uno::Any aAny( xProps->getPropertyValue("TextAutoGrowWidth") );
2208  aAny >>= bIsAutoGrowWidth;
2209 
2210  if ( bIsAutoGrowWidth )
2211  xProps->setPropertyValue("TextAutoGrowWidth", uno::makeAny( false ) );
2212  }
2213 
2214  // set pos, size, shear and rotate
2216  if( xProps.is() )
2217  xProps->setPropertyValue("CaptionPoint", uno::makeAny( maCaptionPoint ) );
2218 
2219  if ( bIsAutoGrowWidth )
2220  xProps->setPropertyValue("TextAutoGrowWidth", uno::makeAny( true ) );
2221 
2222  if(mnRadius)
2223  {
2224  uno::Reference< beans::XPropertySet > xPropSet(mxShape, uno::UNO_QUERY);
2225  if(xPropSet.is())
2226  {
2227  try
2228  {
2229  xPropSet->setPropertyValue("CornerRadius", uno::makeAny( mnRadius ) );
2230  }
2231  catch(const uno::Exception&)
2232  {
2233  DBG_UNHANDLED_EXCEPTION( "xmloff", "setting corner radius");
2234  }
2235  }
2236  }
2237 
2238  SdXMLShapeContext::startFastElement(nElement, xAttrList);
2239 }
2240 
2241 // this is called from the parent group for each unparsed attribute in the attribute list
2243 {
2244  switch (aIter.getToken())
2245  {
2248  maCaptionPoint.X, aIter.toView());
2249  break;
2252  maCaptionPoint.Y, aIter.toView());
2253  break;
2256  mnRadius, aIter.toView());
2257  break;
2258  default:
2259  return SdXMLShapeContext::processAttribute( aIter );
2260  }
2261  return true;
2262 }
2263 
2264 
2266  SvXMLImport& rImport,
2267  const css::uno::Reference< css::xml::sax::XFastAttributeList>& xAttrList,
2268  uno::Reference< drawing::XShapes > const & rShapes)
2269 : SdXMLShapeContext( rImport, xAttrList, rShapes, false/*bTemporaryShape*/ ),
2270  maURL()
2271 {
2272 }
2273 
2274 // this is called from the parent group for each unparsed attribute in the attribute list
2276 {
2277  if( aIter.getToken() == XML_ELEMENT(XLINK, XML_HREF) )
2278  maURL = aIter.toString();
2279  else
2280  return SdXMLShapeContext::processAttribute( aIter );
2281  return true;
2282 }
2283 
2285  const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList)
2286 {
2287  // create graphic object shape
2288  OUString service;
2289 
2290  if( IsXMLToken( maPresentationClass, XML_GRAPHIC ) && GetImport().GetShapeImport()->IsPresentationShapesSupported() )
2291  {
2292  service = "com.sun.star.presentation.GraphicObjectShape";
2293  }
2294  else
2295  {
2296  service = "com.sun.star.drawing.GraphicObjectShape";
2297  }
2298 
2299  AddShape(service);
2300 
2301  if(!mxShape.is())
2302  return;
2303 
2304  SetStyle();
2305  SetLayer();
2306 
2307  uno::Reference< beans::XPropertySet > xPropset(mxShape, uno::UNO_QUERY);
2308  if(xPropset.is())
2309  {
2310  // since OOo 1.x had no line or fill style for graphics, but may create
2311  // documents with them, we have to override them here
2312  sal_Int32 nUPD, nBuildId;
2313  if( GetImport().getBuildIds( nUPD, nBuildId ) && (nUPD == 645) ) try
2314  {
2315  xPropset->setPropertyValue("FillStyle", Any( FillStyle_NONE ) );
2316  xPropset->setPropertyValue("LineStyle", Any( LineStyle_NONE ) );
2317  }
2318  catch(const Exception&)
2319  {
2320  }
2321 
2322  uno::Reference< beans::XPropertySetInfo > xPropsInfo( xPropset->getPropertySetInfo() );
2323  if( xPropsInfo.is() && xPropsInfo->hasPropertyByName("IsEmptyPresentationObject"))
2324  xPropset->setPropertyValue("IsEmptyPresentationObject", css::uno::makeAny( mbIsPlaceholder ) );
2325 
2326  if( !mbIsPlaceholder )
2327  {
2328  if( !maURL.isEmpty() )
2329  {
2330  uno::Reference<graphic::XGraphic> xGraphic = GetImport().loadGraphicByURL(maURL);
2331  if (xGraphic.is())
2332  {
2333  xPropset->setPropertyValue("Graphic", uno::makeAny(xGraphic));
2334  }
2335  }
2336  }
2337  }
2338 
2340  {
2341  uno::Reference< beans::XPropertySet > xProps(mxShape, uno::UNO_QUERY);
2342  if(xProps.is())
2343  {
2344  uno::Reference< beans::XPropertySetInfo > xPropsInfo( xProps->getPropertySetInfo() );
2345  if( xPropsInfo.is() )
2346  {
2347  if( xPropsInfo->hasPropertyByName("IsPlaceholderDependent"))
2348  xProps->setPropertyValue("IsPlaceholderDependent", css::uno::Any(false) );
2349  }
2350  }
2351  }
2352 
2353  // set pos, size, shear and rotate
2355 
2356  SdXMLShapeContext::startFastElement(nElement, xAttrList);
2357 }
2358 
2360 {
2361  if (mxBase64Stream.is())
2362  {
2363  uno::Reference<graphic::XGraphic> xGraphic(GetImport().loadGraphicFromBase64(mxBase64Stream));
2364  if (xGraphic.is())
2365  {
2366  uno::Reference<beans::XPropertySet> xProperties(mxShape, uno::UNO_QUERY);
2367  if (xProperties.is())
2368  {
2369  xProperties->setPropertyValue("Graphic", uno::makeAny(xGraphic));
2370  }
2371  }
2372  }
2373 
2375 }
2376 
2377 css::uno::Reference< css::xml::sax::XFastContextHandler > SdXMLGraphicObjectShapeContext::createFastChildContext(
2378  sal_Int32 nElement,
2379  const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList )
2380 {
2381  css::uno::Reference< css::xml::sax::XFastContextHandler > xContext;
2382 
2383  if( nElement == XML_ELEMENT(OFFICE, XML_BINARY_DATA) )
2384  {
2385  if( maURL.isEmpty() && !mxBase64Stream.is() )
2386  {
2388  if( mxBase64Stream.is() )
2389  xContext = new XMLBase64ImportContext( GetImport(),
2390  mxBase64Stream );
2391  }
2392  }
2393 
2394  // delegate to parent class if no context could be created
2395  if (!xContext)
2396  xContext = SdXMLShapeContext::createFastChildContext(nElement,
2397  xAttrList);
2398 
2399  if (!xContext)
2400  XMLOFF_WARN_UNKNOWN_ELEMENT("xmloff", nElement);
2401 
2402  return xContext;
2403 }
2404 
2406 {
2407 
2408 }
2409 
2410 
2412  SvXMLImport& rImport,
2413  const css::uno::Reference< css::xml::sax::XFastAttributeList>& xAttrList,
2414  uno::Reference< drawing::XShapes > const & rShapes,
2415  bool bTemporaryShape)
2416 : SdXMLShapeContext( rImport, xAttrList, rShapes, bTemporaryShape )
2417 {
2418 }
2419 
2421  const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList)
2422 {
2423  const bool bIsPresentation = isPresentationShape();
2424 
2425  AddShape(
2426  bIsPresentation
2427  ? OUString("com.sun.star.presentation.ChartShape")
2428  : OUString("com.sun.star.drawing.OLE2Shape"));
2429 
2430  if(!mxShape.is())
2431  return;
2432 
2433  SetStyle();
2434  SetLayer();
2435 
2436  if( !mbIsPlaceholder )
2437  {
2438  uno::Reference< beans::XPropertySet > xProps(mxShape, uno::UNO_QUERY);
2439  if(xProps.is())
2440  {
2441  uno::Reference< beans::XPropertySetInfo > xPropsInfo( xProps->getPropertySetInfo() );
2442  if( xPropsInfo.is() && xPropsInfo->hasPropertyByName("IsEmptyPresentationObject"))
2443  xProps->setPropertyValue("IsEmptyPresentationObject", css::uno::Any(false) );
2444 
2445  uno::Any aAny;
2446 
2447  xProps->setPropertyValue("CLSID", Any(OUString("12DCAE26-281F-416F-a234-c3086127382e")) );
2448 
2449  aAny = xProps->getPropertyValue("Model");
2450  uno::Reference< frame::XModel > xChartModel;
2451  if( aAny >>= xChartModel )
2452  {
2453  mxChartContext.set( GetImport().GetChartImport()->CreateChartContext( GetImport(), xChartModel ) );
2454  }
2455  }
2456  }
2457 
2459  {
2460  uno::Reference< beans::XPropertySet > xProps(mxShape, uno::UNO_QUERY);
2461  if(xProps.is())
2462  {
2463  uno::Reference< beans::XPropertySetInfo > xPropsInfo( xProps->getPropertySetInfo() );
2464  if( xPropsInfo.is() )
2465  {
2466  if( xPropsInfo->hasPropertyByName("IsPlaceholderDependent"))
2467  xProps->setPropertyValue("IsPlaceholderDependent", css::uno::Any(false) );
2468  }
2469  }
2470  }
2471 
2472  // set pos, size, shear and rotate
2474 
2475  SdXMLShapeContext::startFastElement(nElement, xAttrList);
2476 
2477  if( mxChartContext.is() )
2478  mxChartContext->startFastElement( nElement, xAttrList );
2479 }
2480 
2482 {
2483  if( mxChartContext.is() )
2484  mxChartContext->endFastElement(nElement);
2485 
2487 }
2488 
2489 void SdXMLChartShapeContext::characters( const OUString& rChars )
2490 {
2491  if( mxChartContext.is() )
2492  mxChartContext->characters( rChars );
2493 }
2494 
2495 css::uno::Reference< css::xml::sax::XFastContextHandler > SdXMLChartShapeContext::createFastChildContext(
2496  sal_Int32 nElement,
2497  const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList )
2498 {
2499  if( mxChartContext.is() )
2500  return mxChartContext->createFastChildContext( nElement, xAttrList );
2501 
2502  return nullptr;
2503 }
2504 
2505 
2507  const css::uno::Reference< css::xml::sax::XFastAttributeList>& xAttrList,
2508  css::uno::Reference< css::drawing::XShapes > const & rShapes)
2509 : SdXMLShapeContext( rImport, xAttrList, rShapes, false/*bTemporaryShape*/ )
2510 {
2511 }
2512 
2514 {
2515 }
2516 
2517 void SdXMLObjectShapeContext::startFastElement (sal_Int32 /*nElement*/,
2518  const css::uno::Reference< css::xml::sax::XFastAttributeList >& /*xAttrList*/)
2519 {
2520  // #96717# in theorie, if we don't have a URL we shouldn't even
2521  // export this OLE shape. But practically it's too risky right now
2522  // to change this so we better dispose this on load
2523  //if( !mbIsPlaceholder && ImpIsEmptyURL(maHref) )
2524  // return;
2525 
2526  // #100592# this BugFix prevents that a shape is created. CL
2527  // is thinking about an alternative.
2528  // #i13140# Check for more than empty string in maHref, there are
2529  // other possibilities that maHref results in empty container
2530  // storage names
2531  if( !(GetImport().getImportFlags() & SvXMLImportFlags::EMBEDDED) && !mbIsPlaceholder && ImpIsEmptyURL(maHref) )
2532  return;
2533 
2534  OUString service("com.sun.star.drawing.OLE2Shape");
2535 
2536  bool bIsPresShape = !maPresentationClass.isEmpty() && GetImport().GetShapeImport()->IsPresentationShapesSupported();
2537 
2538  if( bIsPresShape )
2539  {
2541  {
2542  service = "com.sun.star.presentation.ChartShape";
2543  }
2545  {
2546  service = "com.sun.star.presentation.CalcShape";
2547  }
2549  {
2550  service = "com.sun.star.presentation.OLE2Shape";
2551  }
2552  }
2553 
2554  AddShape(service);
2555 
2556  if( !mxShape.is() )
2557  return;
2558 
2559  SetLayer();
2560 
2561  if(bIsPresShape)
2562  {
2563  uno::Reference< beans::XPropertySet > xProps(mxShape, uno::UNO_QUERY);
2564  if(xProps.is())
2565  {
2566  uno::Reference< beans::XPropertySetInfo > xPropsInfo( xProps->getPropertySetInfo() );
2567  if( xPropsInfo.is() )
2568  {
2569  if( !mbIsPlaceholder && xPropsInfo->hasPropertyByName("IsEmptyPresentationObject"))
2570  xProps->setPropertyValue("IsEmptyPresentationObject", css::uno::Any(false) );
2571 
2572  if( mbIsUserTransformed && xPropsInfo->hasPropertyByName("IsPlaceholderDependent"))
2573  xProps->setPropertyValue("IsPlaceholderDependent", css::uno::Any(false) );
2574  }
2575  }
2576  }
2577 
2578  if( !mbIsPlaceholder && !maHref.isEmpty() )
2579  {
2580  uno::Reference< beans::XPropertySet > xProps( mxShape, uno::UNO_QUERY );
2581 
2582  if( xProps.is() )
2583  {
2584  OUString aPersistName = GetImport().ResolveEmbeddedObjectURL( maHref, maCLSID );
2585 
2586  if ( GetImport().IsPackageURL( maHref ) )
2587  {
2588  static const OUStringLiteral sURL( u"vnd.sun.star.EmbeddedObject:" );
2589 
2590  if ( aPersistName.startsWith( sURL ) )
2591  aPersistName = aPersistName.copy( sURL.getLength() );
2592 
2593  xProps->setPropertyValue("PersistName",
2594  uno::makeAny( aPersistName ) );
2595  }
2596  else
2597  {
2598  // this is OOo link object
2599  xProps->setPropertyValue("LinkURL",
2600  uno::makeAny( aPersistName ) );
2601  }
2602  }
2603  }
2604 
2605  // set pos, size, shear and rotate
2607 
2608  SetStyle();
2609 
2610  GetImport().GetShapeImport()->finishShape( mxShape, mxAttrList, mxShapes );
2611 }
2612 
2614 {
2615  if (GetImport().isGeneratorVersionOlderThan(
2617  {
2618  // #i118485#
2619  // If it's an old file from us written before OOo3.4, we need to correct
2620  // FillStyle and LineStyle for OLE2 objects. The error was that the old paint
2621  // implementations just ignored added fill/linestyles completely, thus
2622  // those objects need to be corrected to not show blue and hairline which
2623  // always was the default, but would be shown now
2624  uno::Reference< beans::XPropertySet > xProps(mxShape, uno::UNO_QUERY);
2625 
2626  if( xProps.is() )
2627  {
2628  xProps->setPropertyValue("FillStyle", uno::makeAny(drawing::FillStyle_NONE));
2629  xProps->setPropertyValue("LineStyle", uno::makeAny(drawing::LineStyle_NONE));
2630  }
2631  }
2632 
2633  if( mxBase64Stream.is() )
2634  {
2635  OUString aPersistName( GetImport().ResolveEmbeddedObjectURLFromBase64() );
2636  static const OUStringLiteral sURL( u"vnd.sun.star.EmbeddedObject:" );
2637 
2638  aPersistName = aPersistName.copy( sURL.getLength() );
2639 
2640  uno::Reference< beans::XPropertySet > xProps(mxShape, uno::UNO_QUERY);
2641  if( xProps.is() )
2642  xProps->setPropertyValue("PersistName", uno::makeAny( aPersistName ) );
2643  }
2644 
2646 }
2647 
2648 // this is called from the parent group for each unparsed attribute in the attribute list
2650 {
2651  switch( aIter.getToken() )
2652  {
2653  case XML_ELEMENT(DRAW, XML_CLASS_ID):
2654  maCLSID = aIter.toString();
2655  break;
2656  case XML_ELEMENT(XLINK, XML_HREF):
2657  maHref = aIter.toString();
2658  break;
2659  default:
2660  return SdXMLShapeContext::processAttribute( aIter );
2661  }
2662  return true;
2663 }
2664 
2665 css::uno::Reference< css::xml::sax::XFastContextHandler > SdXMLObjectShapeContext::createFastChildContext(
2666  sal_Int32 nElement,
2667  const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList )
2668 {
2669  if(nElement == XML_ELEMENT(OFFICE, XML_BINARY_DATA))
2670  {
2672  if( mxBase64Stream.is() )
2674  }
2675  else if( nElement == XML_ELEMENT(OFFICE, XML_DOCUMENT) ||
2676  nElement == XML_ELEMENT(MATH, XML_MATH) )
2677  {
2679  new XMLEmbeddedObjectImportContext(GetImport(), nElement, xAttrList));
2680  maCLSID = xEContext->GetFilterCLSID();
2681  if( !maCLSID.isEmpty() )
2682  {
2683  uno::Reference< beans::XPropertySet > xPropSet(mxShape, uno::UNO_QUERY);
2684  if( xPropSet.is() )
2685  {
2686  xPropSet->setPropertyValue("CLSID", uno::makeAny( maCLSID ) );
2687 
2688  uno::Reference< lang::XComponent > xComp;
2689  xPropSet->getPropertyValue("Model") >>= xComp;
2690  SAL_WARN_IF( !xComp.is(), "xmloff", "no xModel for own OLE format" );
2691  xEContext->SetComponent(xComp);
2692  }
2693  }
2694  return xEContext;
2695  }
2696 
2697  // delegate to parent class if no context could be created
2698  return SdXMLShapeContext::createFastChildContext(nElement, xAttrList);
2699 }
2700 
2702  const css::uno::Reference< css::xml::sax::XFastAttributeList>& xAttrList,
2703  css::uno::Reference< css::drawing::XShapes > const & rShapes)
2704 : SdXMLShapeContext( rImport, xAttrList, rShapes, false/*bTemporaryShape*/ ),
2705  mbIsScript( false )
2706 {
2707 }
2708 
2710 {
2711 }
2712 
2713 void SdXMLAppletShapeContext::startFastElement (sal_Int32 /*nElement*/,
2714  const css::uno::Reference< css::xml::sax::XFastAttributeList >& /*xAttrList*/)
2715 {
2716  AddShape("com.sun.star.drawing.AppletShape");
2717 
2718  if( mxShape.is() )
2719  {
2720  SetLayer();
2721 
2722  // set pos, size, shear and rotate
2724  GetImport().GetShapeImport()->finishShape( mxShape, mxAttrList, mxShapes );
2725  }
2726 }
2727 
2728 // this is called from the parent group for each unparsed attribute in the attribute list
2730 {
2731  switch( aIter.getToken() )
2732  {
2734  maAppletName = aIter.toString();
2735  break;
2736  case XML_ELEMENT(DRAW, XML_CODE):
2737  maAppletCode = aIter.toString();
2738  break;
2740  mbIsScript = IsXMLToken( aIter, XML_TRUE );
2741  break;
2742  case XML_ELEMENT(XLINK, XML_HREF):
2744  break;
2745  default:
2746  return SdXMLShapeContext::processAttribute( aIter );
2747  }
2748  return true;
2749 }
2750 
2752 {
2753  uno::Reference< beans::XPropertySet > xProps( mxShape, uno::UNO_QUERY );
2754  if( xProps.is() )
2755  {
2756  if ( maSize.Width && maSize.Height )
2757  {
2758  // the visual area for applet must be set on loading
2759  awt::Rectangle aRect( 0, 0, maSize.Width, maSize.Height );
2760  xProps->setPropertyValue("VisibleArea", Any(aRect) );
2761  }
2762 
2763  if( maParams.hasElements() )
2764  {
2765  xProps->setPropertyValue("AppletCommands", Any(maParams) );
2766  }
2767 
2768  if( !maHref.isEmpty() )
2769  {
2770  xProps->setPropertyValue("AppletCodeBase", Any(maHref) );
2771  }
2772 
2773  if( !maAppletName.isEmpty() )
2774  {
2775  xProps->setPropertyValue("AppletName", Any(maAppletName) );
2776  }
2777 
2778  if( mbIsScript )
2779  {
2780  xProps->setPropertyValue("AppletIsScript", Any(mbIsScript) );
2781 
2782  }
2783 
2784  if( !maAppletCode.isEmpty() )
2785  {
2786  xProps->setPropertyValue("AppletCode", Any(maAppletCode) );
2787  }
2788 
2789  xProps->setPropertyValue("AppletDocBase", Any(GetImport().GetDocumentBase()) );
2790 
2791  SetThumbnail();
2792  }
2793 
2795 }
2796 
2797 css::uno::Reference< css::xml::sax::XFastContextHandler > SdXMLAppletShapeContext::createFastChildContext(
2798  sal_Int32 nElement,
2799  const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList )
2800 {
2801  if( nElement == XML_ELEMENT(DRAW, XML_PARAM) )
2802  {
2803  OUString aParamName, aParamValue;
2804  // now parse the attribute list and look for draw:name and draw:value
2805  for( auto& aIter : sax_fastparser::castToFastAttributeList(xAttrList) )
2806  {
2807  if( aIter.getToken() == XML_ELEMENT(DRAW, XML_NAME) )
2808  aParamName = aIter.toString();
2809  if( aIter.getToken() == XML_ELEMENT(DRAW, XML_VALUE) )
2810  aParamValue = aIter.toString();
2811  }
2812 
2813  if( !aParamName.isEmpty() )
2814  {
2815  sal_Int32 nIndex = maParams.getLength();
2816  maParams.realloc( nIndex + 1 );
2817  maParams[nIndex].Name = aParamName;
2818  maParams[nIndex].Handle = -1;
2819  maParams[nIndex].Value <<= aParamValue;
2820  maParams[nIndex].State = beans::PropertyState_DIRECT_VALUE;
2821  }
2822 
2823  return new SvXMLImportContext( GetImport() );
2824  }
2825 
2826  return SdXMLShapeContext::createFastChildContext( nElement, xAttrList );
2827 }
2828 
2829 
2831  const css::uno::Reference< css::xml::sax::XFastAttributeList>& xAttrList,
2832  css::uno::Reference< css::drawing::XShapes > const & rShapes) :
2833 SdXMLShapeContext( rImport, xAttrList, rShapes, false/*bTemporaryShape*/ ),
2834 mbMedia( false )
2835 {
2836 }
2837 
2839 {
2840 }
2841 
2842 void SdXMLPluginShapeContext::startFastElement (sal_Int32 /*nElement*/,
2843  const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList)
2844 {
2845 
2846  // watch for MimeType attribute to see if we have a media object
2847  for( auto& aIter : sax_fastparser::castToFastAttributeList(xAttrList) )
2848  {
2849  if( aIter.getToken() == XML_ELEMENT(DRAW, XML_MIME_TYPE) )
2850  {
2851  if( aIter.toString() == "application/vnd.sun.star.media" )
2852  mbMedia = true;
2853  // leave this loop
2854  break;
2855  }
2856  }
2857 
2858  OUString service;
2859 
2860  bool bIsPresShape = false;
2861 
2862  if( mbMedia )
2863  {
2864  service = "com.sun.star.drawing.MediaShape";
2865 
2866  bIsPresShape = !maPresentationClass.isEmpty() && GetImport().GetShapeImport()->IsPresentationShapesSupported();
2867  if( bIsPresShape )
2868  {
2870  {
2871  service = "com.sun.star.presentation.MediaShape";
2872  }
2873  }
2874  }
2875  else
2876  service = "com.sun.star.drawing.PluginShape";
2877 
2878  AddShape(service);
2879 
2880  if( !mxShape.is() )
2881  return;
2882 
2883  SetLayer();
2884 
2885  if(bIsPresShape)
2886  {
2887  uno::Reference< beans::XPropertySet > xProps( mxShape, uno::UNO_QUERY );
2888  if(xProps.is())
2889  {
2890  uno::Reference< beans::XPropertySetInfo > xPropsInfo( xProps->getPropertySetInfo() );
2891  if( xPropsInfo.is() )
2892  {
2893  if( !mbIsPlaceholder && xPropsInfo->hasPropertyByName("IsEmptyPresentationObject"))
2894  xProps->setPropertyValue("IsEmptyPresentationObject", css::uno::Any(false) );
2895 
2896  if( mbIsUserTransformed && xPropsInfo->hasPropertyByName("IsPlaceholderDependent"))
2897  xProps->setPropertyValue("IsPlaceholderDependent", css::uno::Any(false) );
2898  }
2899  }
2900  }
2901 
2902  // set pos, size, shear and rotate
2904  GetImport().GetShapeImport()->finishShape( mxShape, mxAttrList, mxShapes );
2905 }
2906 
2907 static OUString
2908 lcl_GetMediaReference(SvXMLImport const& rImport, OUString const& rURL)
2909 {
2910  if (rImport.IsPackageURL(rURL))
2911  {
2912  return "vnd.sun.star.Package:" + rURL;
2913  }
2914  else
2915  {
2916  return rImport.GetAbsoluteReference(rURL);
2917  }
2918 }
2919 
2920 // this is called from the parent group for each unparsed attribute in the attribute list
2922 {
2923  switch( aIter.getToken() )
2924  {
2926  maMimeType = aIter.toString();
2927  break;
2928  case XML_ELEMENT(XLINK, XML_HREF):
2930  break;
2931  default:
2932  return SdXMLShapeContext::processAttribute( aIter );
2933  }
2934  return true;
2935 }
2936 
2938 {
2939  uno::Reference< beans::XPropertySet > xProps( mxShape, uno::UNO_QUERY );
2940 
2941  if( xProps.is() )
2942  {
2943  if ( maSize.Width && maSize.Height )
2944  {
2945  static const OUStringLiteral sVisibleArea( u"VisibleArea" );
2946  uno::Reference< beans::XPropertySetInfo > aXPropSetInfo( xProps->getPropertySetInfo() );
2947  if ( !aXPropSetInfo.is() || aXPropSetInfo->hasPropertyByName( sVisibleArea ) )
2948  {
2949  // the visual area for a plugin must be set on loading
2950  awt::Rectangle aRect( 0, 0, maSize.Width, maSize.Height );
2951  xProps->setPropertyValue( sVisibleArea, Any(aRect) );
2952  }
2953  }
2954 
2955  if( !mbMedia )
2956  {
2957  // in case we have a plugin object
2958  if( maParams.hasElements() )
2959  {
2960  xProps->setPropertyValue("PluginCommands", Any(maParams) );
2961  }
2962 
2963  if( !maMimeType.isEmpty() )
2964  {
2965  xProps->setPropertyValue("PluginMimeType", Any(maMimeType) );
2966  }
2967 
2968  if( !maHref.isEmpty() )
2969  {
2970  xProps->setPropertyValue("PluginURL", Any(maHref) );
2971  }
2972  }
2973  else
2974  {
2975  // in case we have a media object
2976  xProps->setPropertyValue( "MediaURL", uno::makeAny(maHref));
2977 
2978  xProps->setPropertyValue("MediaMimeType", uno::makeAny(maMimeType) );
2979 
2980  for( const auto& rParam : std::as_const(maParams) )
2981  {
2982  const OUString& rName = rParam.Name;
2983 
2984  if( rName == "Loop" )
2985  {
2986  OUString aValueStr;
2987  rParam.Value >>= aValueStr;
2988  xProps->setPropertyValue("Loop",
2989  uno::makeAny( aValueStr == "true" ) );
2990  }
2991  else if( rName == "Mute" )
2992  {
2993  OUString aValueStr;
2994  rParam.Value >>= aValueStr;
2995  xProps->setPropertyValue("Mute",
2996  uno::makeAny( aValueStr == "true" ) );
2997  }
2998  else if( rName == "VolumeDB" )
2999  {
3000  OUString aValueStr;
3001  rParam.Value >>= aValueStr;
3002  xProps->setPropertyValue("VolumeDB",
3003  uno::makeAny( static_cast< sal_Int16 >( aValueStr.toInt32() ) ) );
3004  }
3005  else if( rName == "Zoom" )
3006  {
3007  OUString aZoomStr;
3008  media::ZoomLevel eZoomLevel;
3009 
3010  rParam.Value >>= aZoomStr;
3011 
3012  if( aZoomStr == "25%" )
3013  eZoomLevel = media::ZoomLevel_ZOOM_1_TO_4;
3014  else if( aZoomStr == "50%" )
3015  eZoomLevel = media::ZoomLevel_ZOOM_1_TO_2;
3016  else if( aZoomStr == "100%" )
3017  eZoomLevel = media::ZoomLevel_ORIGINAL;
3018  else if( aZoomStr == "200%" )
3019  eZoomLevel = media::ZoomLevel_ZOOM_2_TO_1;
3020  else if( aZoomStr == "400%" )
3021  eZoomLevel = media::ZoomLevel_ZOOM_4_TO_1;
3022  else if( aZoomStr == "fit" )
3023  eZoomLevel = media::ZoomLevel_FIT_TO_WINDOW;
3024  else if( aZoomStr == "fixedfit" )
3025  eZoomLevel = media::ZoomLevel_FIT_TO_WINDOW_FIXED_ASPECT;
3026  else if( aZoomStr == "fullscreen" )
3027  eZoomLevel = media::ZoomLevel_FULLSCREEN;
3028  else
3029  eZoomLevel = media::ZoomLevel_NOT_AVAILABLE;
3030 
3031  xProps->setPropertyValue("Zoom", uno::makeAny( eZoomLevel ) );
3032  }
3033  }
3034  }
3035 
3036  SetThumbnail();
3037  }
3038 
3040 }
3041 
3042 css::uno::Reference< css::xml::sax::XFastContextHandler > SdXMLPluginShapeContext::createFastChildContext(
3043  sal_Int32 nElement,
3044  const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList )
3045 {
3046  if( nElement == XML_ELEMENT(DRAW, XML_PARAM) )
3047  {
3048  OUString aParamName, aParamValue;
3049  // now parse the attribute list and look for draw:name and draw:value
3050  for( auto& aIter : sax_fastparser::castToFastAttributeList(xAttrList) )
3051  {
3052  if( aIter.getToken() == XML_ELEMENT(DRAW, XML_NAME) )
3053  aParamName = aIter.toString();
3054  else if( aIter.getToken() == XML_ELEMENT(DRAW, XML_VALUE) )
3055  aParamValue = aIter.toString();
3056  }
3057 
3058  if( !aParamName.isEmpty() )
3059  {
3060  sal_Int32 nIndex = maParams.getLength();
3061  maParams.realloc( nIndex + 1 );
3062  maParams[nIndex].Name = aParamName;
3063  maParams[nIndex].Handle = -1;
3064  maParams[nIndex].Value <<= aParamValue;
3065  maParams[nIndex].State = beans::PropertyState_DIRECT_VALUE;
3066  }
3067 
3068  return new SvXMLImportContext( GetImport() );
3069  }
3070 
3071  return SdXMLShapeContext::createFastChildContext( nElement, xAttrList );
3072 }
3073 
3074 
3076  const css::uno::Reference< css::xml::sax::XFastAttributeList>& xAttrList,
3077  css::uno::Reference< css::drawing::XShapes > const & rShapes)
3078 : SdXMLShapeContext( rImport, xAttrList, rShapes, false/*bTemporaryShape*/ )
3079 {
3080 }
3081 
3083 {
3084 }
3085 
3087  const css::uno::Reference< css::xml::sax::XFastAttributeList >& /*xAttrList*/)
3088 {
3089  AddShape("com.sun.star.drawing.FrameShape");
3090 
3091  if( !mxShape.is() )
3092  return;
3093 
3094  SetLayer();
3095 
3096  // set pos, size, shear and rotate
3098 
3099  uno::Reference< beans::XPropertySet > xProps( mxShape, uno::UNO_QUERY );
3100  if( xProps.is() )
3101  {
3102  if( !maFrameName.isEmpty() )
3103  {
3104  xProps->setPropertyValue("FrameName", Any(maFrameName) );
3105  }
3106 
3107  if( !maHref.isEmpty() )
3108  {
3109  xProps->setPropertyValue("FrameURL", Any(maHref) );
3110  }
3111  }
3112 
3113  SetStyle();
3114 
3115  GetImport().GetShapeImport()->finishShape( mxShape, mxAttrList, mxShapes );
3116 }
3117 
3118 // this is called from the parent group for each unparsed attribute in the attribute list
3120 {
3121  switch( aIter.getToken() )
3122  {
3124  maFrameName = aIter.toString();
3125  break;
3126  case XML_ELEMENT(XLINK, XML_HREF):
3128  break;
3129  default:
3130  return SdXMLShapeContext::processAttribute( aIter );
3131  }
3132  return true;
3133 }
3134 
3136 {
3137  uno::Reference< beans::XPropertySet > xProps( mxShape, uno::UNO_QUERY );
3138 
3139  if( xProps.is() )
3140  {
3141  if ( maSize.Width && maSize.Height )
3142  {
3143  // the visual area for a floating frame must be set on loading
3144  awt::Rectangle aRect( 0, 0, maSize.Width, maSize.Height );
3145  xProps->setPropertyValue("VisibleArea", Any(aRect) );
3146  }
3147  }
3148 
3149  SetThumbnail();
3151 }
3152 
3153 
3155  const css::uno::Reference< css::xml::sax::XFastAttributeList>& xAttrList,
3156  css::uno::Reference< css::drawing::XShapes > const & rShapes,
3157  bool bTemporaryShape)
3158 : SdXMLShapeContext( rImport, xAttrList, rShapes, bTemporaryShape ),
3160  mbSupportsReplacement( false ),
3161  mxImplContext(),
3162  mxReplImplContext()
3163 {
3164  uno::Reference < util::XCloneable > xClone( xAttrList, uno::UNO_QUERY );
3165  if( xClone.is() )
3166  mxAttrList.set( xClone->createClone(), uno::UNO_QUERY );
3167  else
3169 }
3170 
3172 {
3173 }
3174 
3176 {
3177  const SdXMLGraphicObjectShapeContext* pSdXMLGraphicObjectShapeContext = dynamic_cast< const SdXMLGraphicObjectShapeContext* >(&rContext);
3178 
3179  if(!pSdXMLGraphicObjectShapeContext)
3180  return;
3181 
3182  try
3183  {
3184  uno::Reference< container::XChild > xChild(pSdXMLGraphicObjectShapeContext->getShape(), uno::UNO_QUERY_THROW);
3185 
3186  uno::Reference< drawing::XShapes > xParent(xChild->getParent(), uno::UNO_QUERY_THROW);
3187 
3188  // remove from parent
3189  xParent->remove(pSdXMLGraphicObjectShapeContext->getShape());
3190 
3191  // dispose
3192  uno::Reference< lang::XComponent > xComp(pSdXMLGraphicObjectShapeContext->getShape(), UNO_QUERY);
3193 
3194  if(xComp.is())
3195  {
3196  xComp->dispose();
3197  }
3198  }
3199  catch( uno::Exception& )
3200  {
3201  DBG_UNHANDLED_EXCEPTION( "xmloff", "Error in cleanup of multiple graphic object import." );
3202  }
3203 }
3204 
3205 namespace
3206 {
3207 uno::Reference<beans::XPropertySet> getGraphicPropertySetFromImportContext(const SvXMLImportContext& rContext)
3208 {
3209  uno::Reference<beans::XPropertySet> aPropertySet;
3210  const SdXMLGraphicObjectShapeContext* pSdXMLGraphicObjectShapeContext = dynamic_cast<const SdXMLGraphicObjectShapeContext*>(&rContext);
3211 
3212  if (pSdXMLGraphicObjectShapeContext)
3213  aPropertySet.set(pSdXMLGraphicObjectShapeContext->getShape(), uno::UNO_QUERY);
3214 
3215  return aPropertySet;
3216 }
3217 
3218 } // end anonymous namespace
3219 
3220 uno::Reference<graphic::XGraphic> SdXMLFrameShapeContext::getGraphicFromImportContext(const SvXMLImportContext& rContext) const
3221 {
3222  uno::Reference<graphic::XGraphic> xGraphic;
3223  try
3224  {
3225  const uno::Reference<beans::XPropertySet> xPropertySet = getGraphicPropertySetFromImportContext(rContext);
3226 
3227  if (xPropertySet.is())
3228  {
3229  xPropertySet->getPropertyValue("Graphic") >>= xGraphic;
3230  }
3231  }
3232  catch( uno::Exception& )
3233  {
3234  DBG_UNHANDLED_EXCEPTION("xmloff", "Error in cleanup of multiple graphic object import.");
3235  }
3236 
3237  return xGraphic;
3238 }
3239 
3241 {
3242  OUString aRetval;
3243  const SdXMLGraphicObjectShapeContext* pSdXMLGraphicObjectShapeContext = dynamic_cast< const SdXMLGraphicObjectShapeContext* >(&rContext);
3244 
3245  if(pSdXMLGraphicObjectShapeContext)
3246  {
3247  try
3248  {
3249  const uno::Reference< beans::XPropertySet > xPropSet(pSdXMLGraphicObjectShapeContext->getShape(), uno::UNO_QUERY_THROW);
3250 
3251  xPropSet->getPropertyValue("GraphicStreamURL") >>= aRetval;
3252  }
3253  catch( uno::Exception& )
3254  {
3255  DBG_UNHANDLED_EXCEPTION( "xmloff", "Error in cleanup of multiple graphic object import." );
3256  }
3257  }
3258 
3259  return aRetval;
3260 }
3261 
3262 css::uno::Reference< css::xml::sax::XFastContextHandler > SdXMLFrameShapeContext::createFastChildContext(
3263  sal_Int32 nElement,
3264  const uno::Reference< xml::sax::XFastAttributeList>& xAttrList )
3265 {
3266  SvXMLImportContextRef xContext;
3267  if( !mxImplContext.is() )
3268  {
3270  GetImport(), nElement, xAttrList, mxShapes, mxAttrList );
3271 
3272  xContext = pShapeContext;
3273 
3274  // propagate the hyperlink to child context
3275  if ( !msHyperlink.isEmpty() )
3276  pShapeContext->setHyperlink( msHyperlink );
3277 
3278  auto nToken = nElement & TOKEN_MASK;
3279  // Ignore gltf model if necessary and so the fallback image will be imported
3280  if( nToken == XML_PLUGIN )
3281  {
3282  SdXMLPluginShapeContext* pPluginContext = dynamic_cast<SdXMLPluginShapeContext*>(pShapeContext);
3283  if( pPluginContext && pPluginContext->getMimeType() == "model/vnd.gltf+json" )
3284  {
3285  mxImplContext = nullptr;
3286  return new SvXMLImportContext(GetImport());
3287  }
3288  }
3289 
3290  mxImplContext = xContext;
3293 
3294  if(getSupportsMultipleContents() && dynamic_cast< SdXMLGraphicObjectShapeContext* >(xContext.get()))
3295  {
3296  if ( !maShapeId.isEmpty() )
3298 
3300  }
3301  }
3302  else if(getSupportsMultipleContents() && nElement == XML_ELEMENT(DRAW, XML_IMAGE))
3303  {
3304  // read another image
3306  GetImport(), nElement, xAttrList, mxShapes, mxAttrList);
3307  mxImplContext = xContext;
3308 
3309  if(dynamic_cast< SdXMLGraphicObjectShapeContext* >(xContext.get()))
3310  {
3312  }
3313  }
3314  else if( mbSupportsReplacement && !mxReplImplContext.is() &&
3315  nElement == XML_ELEMENT(DRAW, XML_IMAGE) )
3316  {
3317  // read replacement image
3318  SvXMLImportContext *pImplContext = mxImplContext.get();
3319  SdXMLShapeContext *pSContext =
3320  dynamic_cast<SdXMLShapeContext*>( pImplContext );
3321  if( pSContext )
3322  {
3323  uno::Reference < beans::XPropertySet > xPropSet(
3324  pSContext->getShape(), uno::UNO_QUERY );
3325  if( xPropSet.is() )
3326  {
3327  xContext = new XMLReplacementImageContext( GetImport(),
3328  nElement, xAttrList, xPropSet );
3329  mxReplImplContext = xContext;
3330  }
3331  }
3332  }
3333  else if( nElement == XML_ELEMENT(SVG, XML_TITLE) || // #i68101#
3334  nElement == XML_ELEMENT(SVG_COMPAT, XML_TITLE) ||
3335  nElement == XML_ELEMENT(SVG, XML_DESC) ||
3336  nElement == XML_ELEMENT(SVG_COMPAT, XML_DESC) ||
3337  nElement == XML_ELEMENT(OFFICE, XML_EVENT_LISTENERS) ||
3338  nElement == XML_ELEMENT(DRAW, XML_GLUE_POINT) ||
3339  nElement == XML_ELEMENT(DRAW, XML_THUMBNAIL) )
3340  {
3342  { // tdf#103567 ensure props are set on surviving shape
3343  // note: no more draw:image can be added once we get here
3345  }
3346  SvXMLImportContext *pImplContext = mxImplContext.get();
3347  xContext = static_cast<SvXMLImportContext*>(dynamic_cast<SdXMLShapeContext&>(*pImplContext).createFastChildContext( nElement,
3348  xAttrList ).get());
3349  }
3350  else if ( nElement == XML_ELEMENT(DRAW, XML_IMAGE_MAP) )
3351  {
3353  { // tdf#103567 ensure props are set on surviving shape
3354  // note: no more draw:image can be added once we get here
3356  }
3357  SdXMLShapeContext *pSContext = dynamic_cast< SdXMLShapeContext* >( mxImplContext.get() );
3358  if( pSContext )
3359  {
3360  uno::Reference < beans::XPropertySet > xPropSet( pSContext->getShape(), uno::UNO_QUERY );
3361  if (xPropSet.is())
3362  {
3363  xContext = new XMLImageMapContext(GetImport(), xPropSet);
3364  }
3365  }
3366  }
3367  else if ( nElement == XML_ELEMENT(LO_EXT, XML_SIGNATURELINE) )
3368  {
3369  SdXMLShapeContext* pSContext = dynamic_cast<SdXMLShapeContext*>(mxImplContext.get());
3370  if (pSContext)
3371  {
3372  uno::Reference<beans::XPropertySet> xPropSet(pSContext->getShape(), uno::UNO_QUERY);
3373  if (xPropSet.is())
3374  {
3375  xContext = new SignatureLineContext(GetImport(), nElement, xAttrList,
3376  pSContext->getShape());
3377  }
3378  }
3379  }
3380  else if ( nElement == XML_ELEMENT(LO_EXT, XML_QRCODE))
3381  {
3382  SdXMLShapeContext* pSContext = dynamic_cast<SdXMLShapeContext*>(mxImplContext.get());
3383  if (pSContext)
3384  {
3385  uno::Reference<beans::XPropertySet> xPropSet(pSContext->getShape(), uno::UNO_QUERY);
3386  if (xPropSet.is())
3387  {
3388  xContext = new QRCodeContext(GetImport(), nElement, xAttrList,
3389  pSContext->getShape());
3390  }
3391  }
3392  }
3393 
3394  return xContext;
3395 }
3396 
3397 void SdXMLFrameShapeContext::startFastElement (sal_Int32 /*nElement*/,
3398  const css::uno::Reference< css::xml::sax::XFastAttributeList >& /*xAttrList*/)
3399 {
3400  // ignore
3401 }
3402 
3404 {
3405  // solve if multiple image child contexts were imported
3406  SvXMLImportContextRef const pSelectedContext(solveMultipleImages());
3407  const SdXMLGraphicObjectShapeContext* pShapeContext(
3408  dynamic_cast<const SdXMLGraphicObjectShapeContext*>(pSelectedContext.get()));
3409  if ( pShapeContext )
3410  {
3411  assert( mxImplContext.is() );
3412  const uno::Reference< uno::XInterface > xShape( pShapeContext->getShape() );
3414  }
3415 
3416  if( !mxImplContext.is() )
3417  {
3418  // now check if this is an empty presentation object
3420  {
3421  switch (aIter.getToken())
3422  {
3423  case XML_ELEMENT(PRESENTATION, XML_PLACEHOLDER):
3424  mbIsPlaceholder = IsXMLToken( aIter, XML_TRUE );
3425  break;
3426  case XML_ELEMENT(PRESENTATION, XML_CLASS):
3427  maPresentationClass = aIter.toString();
3428  break;
3429  default:;
3430  }
3431  }
3432 
3433  if( (!maPresentationClass.isEmpty()) && mbIsPlaceholder )
3434  {
3435  uno::Reference< xml::sax::XFastAttributeList> xEmpty;
3436 
3438 
3440  {
3441  eToken = XML_IMAGE;
3442 
3443  }
3444  else if( IsXMLToken( maPresentationClass, XML_PAGE ) )
3445  {
3446  eToken = XML_PAGE_THUMBNAIL;
3447  }
3448  else if( IsXMLToken( maPresentationClass, XML_CHART ) ||
3451  {
3452  eToken = XML_OBJECT;
3453  }
3454 
3455  auto x = XML_ELEMENT(DRAW, eToken);
3457  GetImport(), x, mxAttrList, mxShapes, xEmpty );
3458 
3459  if( mxImplContext.is() )
3460  {
3461  mxImplContext->startFastElement( x, mxAttrList );
3462  mxImplContext->endFastElement(x);
3463  }
3464  }
3465  }
3466 
3467  mxImplContext = nullptr;
3469 }
3470 
3472 {
3473  bool bId( false );
3474 
3475  switch ( aIter.getToken() )
3476  {
3477  case XML_ELEMENT(DRAW, XML_ID):
3478  case XML_ELEMENT(DRAW_EXT, XML_ID):
3479  case XML_ELEMENT(NONE, XML_ID):
3480  case XML_ELEMENT(XML, XML_ID) :
3481  bId = true;
3482  break;
3483  default:;
3484  }
3485 
3486  if ( bId )
3487  return SdXMLShapeContext::processAttribute( aIter );
3488  return true; // deliberately ignoring other attributes
3489 }
3490 
3491 
3493  SvXMLImport& rImport,
3494  const css::uno::Reference< css::xml::sax::XFastAttributeList>& xAttrList,
3495  uno::Reference< drawing::XShapes > const & rShapes)
3496 : SdXMLShapeContext( rImport, xAttrList, rShapes, false/*bTemporaryShape*/ )
3497 {
3498  // See the XMLTextFrameContext ctor, a frame has Writer content (and not
3499  // editeng) if its autostyle has a parent style. Do the same for shapes as well.
3500  for( auto& aIter : sax_fastparser::castToFastAttributeList(xAttrList) )
3501  {
3502  if (aIter.getToken() == XML_ELEMENT(DRAW, XML_STYLE_NAME))
3503  {
3504  OUString aStyleName = aIter.toString();
3505  if(!aStyleName.isEmpty())
3506  {
3508  XMLPropStyleContext* pStyle = xTxtImport->FindAutoFrameStyle(aStyleName);
3509  // Note that this an API name, so intentionally not localized.
3510  if (pStyle && pStyle->GetParentName() == "Frame")
3511  {
3512  mbTextBox = true;
3513  break;
3514  }
3515  }
3516  }
3517  }
3518 }
3519 
3521 {
3522 }
3523 
3524 // this is called from the parent group for each unparsed attribute in the attribute list
3526 {
3527  if( aIter.getToken() == XML_ELEMENT(DRAW, XML_ENGINE) )
3528  {
3529  maCustomShapeEngine = aIter.toString();
3530  }
3531  else if (aIter.getToken() == XML_ELEMENT(DRAW, XML_DATA) )
3532  {
3533  maCustomShapeData = aIter.toString();
3534  }
3535  else
3536  return SdXMLShapeContext::processAttribute( aIter );
3537  return true;
3538 }
3539 
3541  const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList)
3542 {
3543  // create rectangle shape
3544  AddShape("com.sun.star.drawing.CustomShape");
3545  if ( !mxShape.is() )
3546  return;
3547 
3548  // Add, set Style and properties from base shape
3549  SetStyle();
3550  SetLayer();
3551 
3552  // set pos, size, shear and rotate
3554 
3555  try
3556  {
3557  uno::Reference< beans::XPropertySet > xPropSet( mxShape, uno::UNO_QUERY );
3558  if( xPropSet.is() )
3559  {
3560  if ( !maCustomShapeEngine.isEmpty() )
3561  {
3562  xPropSet->setPropertyValue( EASGet( EAS_CustomShapeEngine ), Any(maCustomShapeEngine) );
3563  }
3564  if ( !maCustomShapeData.isEmpty() )
3565  {
3566  xPropSet->setPropertyValue( EASGet( EAS_CustomShapeData ), Any(maCustomShapeData) );
3567  }
3568  }
3569  }
3570  catch(const uno::Exception&)
3571  {
3572  DBG_UNHANDLED_EXCEPTION( "xmloff", "setting enhanced customshape geometry" );
3573  }
3574  SdXMLShapeContext::startFastElement(nElement, xAttrList);
3575 }
3576 
3578 {
3579  // Customshapes remember mirror state in its enhanced geometry.
3580  // SetTransformation() in StartElement() may have applied mirroring, but that is not yet
3581  // contained. Merge that information here before writing the property.
3583  {
3584  basegfx::B2DVector aScale, aTranslate;
3585  double fRotate, fShearX;
3586 
3587  maUsedTransformation.decompose(aScale, aTranslate, fRotate, fShearX);
3588 
3589  if (aScale.getX() < 0.0)
3590  {
3591  static const OUStringLiteral sName(u"MirroredX");
3592  //fdo#84043 Merge, if property exists, otherwise append it
3593  auto aI = std::find_if(maCustomShapeGeometry.begin(), maCustomShapeGeometry.end(),
3594  [](beans::PropertyValue& rValue) { return rValue.Name == sName; });
3595  if (aI != maCustomShapeGeometry.end())
3596  {
3597  beans::PropertyValue& rItem = *aI;
3598  bool bMirroredX = *o3tl::doAccess<bool>(rItem.Value);
3599  rItem.Value <<= !bMirroredX;
3600  rItem.Handle = -1;
3601  rItem.State = beans::PropertyState_DIRECT_VALUE;
3602  }
3603  else
3604  {
3605  beans::PropertyValue* pItem;
3606  maCustomShapeGeometry.emplace_back();
3607  pItem = &maCustomShapeGeometry.back();
3608  pItem->Name = sName;
3609  pItem->Handle = -1;
3610  pItem->Value <<= true;
3611  pItem->State = beans::PropertyState_DIRECT_VALUE;
3612  }
3613  }
3614 
3615  if (aScale.getY() < 0.0)
3616  {
3617  static const OUStringLiteral sName(u"MirroredY");
3618  //fdo#84043 Merge, if property exists, otherwise append it
3619  auto aI = std::find_if(maCustomShapeGeometry.begin(), maCustomShapeGeometry.end(),
3620  [](beans::PropertyValue& rValue) { return rValue.Name == sName; });
3621  if (aI != maCustomShapeGeometry.end())
3622  {
3623  beans::PropertyValue& rItem = *aI;
3624  bool bMirroredY = *o3tl::doAccess<bool>(rItem.Value);
3625  rItem.Value <<= !bMirroredY;
3626  rItem.Handle = -1;
3627  rItem.State = beans::PropertyState_DIRECT_VALUE;
3628  }
3629  else
3630  {
3631  beans::PropertyValue* pItem;
3632  maCustomShapeGeometry.emplace_back();
3633  pItem = &maCustomShapeGeometry.back();
3634  pItem->Name = sName;
3635  pItem->Handle = -1;
3636  pItem->Value <<= true;
3637  pItem->State = beans::PropertyState_DIRECT_VALUE;
3638  }
3639  }
3640  }
3641 
3642  if ( !maCustomShapeGeometry.empty() )
3643  {
3644  // converting the vector to a sequence
3645  uno::Sequence< beans::PropertyValue > aSeq( comphelper::containerToSequence(maCustomShapeGeometry) );
3646 
3647  try
3648  {
3649  uno::Reference< beans::XPropertySet > xPropSet( mxShape, uno::UNO_QUERY );
3650  if( xPropSet.is() )
3651  {
3652  xPropSet->setPropertyValue( "CustomShapeGeometry", Any(aSeq) );
3653  }
3654  }
3655  catch(const uno::Exception&)
3656  {
3657  DBG_UNHANDLED_EXCEPTION( "xmloff", "setting enhanced customshape geometry" );
3658  }
3659 
3660  sal_Int32 nUPD;
3661  sal_Int32 nBuild;
3662  if (GetImport().getBuildIds(nUPD, nBuild))
3663  {
3664  if( ((nUPD >= 640 && nUPD <= 645) || (nUPD == 680)) && (nBuild <= 9221) )
3665  {
3666  Reference< drawing::XEnhancedCustomShapeDefaulter > xDefaulter( mxShape, UNO_QUERY );
3667  if( xDefaulter.is() )
3668  {
3669  xDefaulter->createCustomShapeDefaults( "" );
3670  }
3671  }
3672  }
3673  }
3674 
3676 
3677  // tdf#98163 call a custom slot to be able to reset the UNO API
3678  // implementations held on the SdrObjects of type
3679  // SdrObjCustomShape - those tend to linger until the entire file
3680  // is loaded. For large files with a lot of these, 32bit systems
3681  // may crash due to being out of resources after ca. 4200
3682  // Outliners and VirtualDevices used there as RefDevice
3683  try
3684  {
3685  uno::Reference< beans::XPropertySet > xPropSet(mxShape, uno::UNO_QUERY);
3686 
3687  if(xPropSet.is())
3688  {
3689  xPropSet->setPropertyValue(
3690  "FlushCustomShapeUnoApiObjects", css::uno::Any(true));
3691  }
3692  }
3693  catch(const uno::Exception&)
3694  {
3695  DBG_UNHANDLED_EXCEPTION("xmloff", "flushing after load");
3696  }
3697 }
3698 
3699 css::uno::Reference< css::xml::sax::XFastContextHandler > SdXMLCustomShapeContext::createFastChildContext(
3700  sal_Int32 nElement,
3701  const uno::Reference< xml::sax::XFastAttributeList>& xAttrList )
3702 {
3703  css::uno::Reference< css::xml::sax::XFastContextHandler > xContext;
3704  if ( nElement == XML_ELEMENT(DRAW, XML_ENHANCED_GEOMETRY) )
3705  {
3706  uno::Reference< beans::XPropertySet > xPropSet( mxShape,uno::UNO_QUERY );
3707  if ( xPropSet.is() )
3709  }
3710  // delegate to parent class if no context could be created
3711  if (!xContext)
3712  xContext = SdXMLShapeContext::createFastChildContext( nElement,
3713  xAttrList);
3714  return xContext;
3715 }
3716 
3717 SdXMLTableShapeContext::SdXMLTableShapeContext( SvXMLImport& rImport, const css::uno::Reference< css::xml::sax::XFastAttributeList>& xAttrList, css::uno::Reference< css::drawing::XShapes > const & rShapes )
3718 : SdXMLShapeContext( rImport, xAttrList, rShapes, false )
3719 {
3720 }
3721 
3723 {
3724 }
3725 
3727  const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList)
3728 {
3729  OUString service("com.sun.star.drawing.TableShape");
3730 
3731  bool bIsPresShape = !maPresentationClass.isEmpty() && GetImport().GetShapeImport()->IsPresentationShapesSupported();
3732  if( bIsPresShape )
3733  {
3735  {
3736  service = "com.sun.star.presentation.TableShape";
3737  }
3738  }
3739 
3740  AddShape(service);
3741 
3742  if( !mxShape.is() )
3743  return;
3744 
3745  SetLayer();
3746 
3747  uno::Reference< beans::XPropertySet > xProps(mxShape, uno::UNO_QUERY);
3748 
3749  if(bIsPresShape && xProps.is())
3750  {
3751  uno::Reference< beans::XPropertySetInfo > xPropsInfo( xProps->getPropertySetInfo() );
3752  if( xPropsInfo.is() )
3753  {
3754  if( !mbIsPlaceholder && xPropsInfo->hasPropertyByName("IsEmptyPresentationObject"))
3755  xProps->setPropertyValue("IsEmptyPresentationObject", css::uno::Any(false) );
3756 
3757  if( mbIsUserTransformed && xPropsInfo->hasPropertyByName("IsPlaceholderDependent"))
3758  xProps->setPropertyValue("IsPlaceholderDependent", css::uno::Any(false) );
3759  }
3760  }
3761 
3762  SetStyle();
3763 
3764  if( xProps.is() )
3765  {
3766  if( !msTemplateStyleName.isEmpty() ) try
3767  {
3768  Reference< XStyleFamiliesSupplier > xFamiliesSupp( GetImport().GetModel(), UNO_QUERY_THROW );
3769  Reference< XNameAccess > xFamilies( xFamiliesSupp->getStyleFamilies() );
3770  Reference< XNameAccess > xTableFamily( xFamilies->getByName( "table" ), UNO_QUERY_THROW );
3771  Reference< XStyle > xTableStyle( xTableFamily->getByName( msTemplateStyleName ), UNO_QUERY_THROW );
3772  xProps->setPropertyValue("TableTemplate", Any( xTableStyle ) );
3773  }
3774  catch(const Exception&)
3775  {
3776  DBG_UNHANDLED_EXCEPTION("xmloff.draw");
3777  }
3778 
3779  const XMLPropertyMapEntry* pEntry = &aXMLTableShapeAttributes[0];
3780  for( int i = 0; pEntry->msApiName && (i < 6); i++, pEntry++ )
3781  {
3782  try
3783  {
3784  const OUString sAPIPropertyName( pEntry->msApiName, pEntry->nApiNameLength, RTL_TEXTENCODING_ASCII_US );
3785  xProps->setPropertyValue( sAPIPropertyName, Any( maTemplateStylesUsed[i] ) );
3786  }
3787  catch(const Exception&)
3788  {
3789  DBG_UNHANDLED_EXCEPTION("xmloff.draw");
3790  }
3791  }
3792  }
3793 
3794  GetImport().GetShapeImport()->finishShape( mxShape, mxAttrList, mxShapes );
3795 
3796  const rtl::Reference< XMLTableImport >& xTableImport( GetImport().GetShapeImport()->GetShapeTableImport() );
3797  if( xTableImport.is() && xProps.is() )
3798  {
3799  uno::Reference< table::XColumnRowRange > xColumnRowRange(
3800  xProps->getPropertyValue("Model"), uno::UNO_QUERY );
3801 
3802  if( xColumnRowRange.is() )
3803  mxTableImportContext = xTableImport->CreateTableContext( xColumnRowRange );
3804 
3805  if( mxTableImportContext.is() )
3806  mxTableImportContext->startFastElement( nElement, xAttrList );
3807  }
3808 }
3809 
3811 {
3812  if( mxTableImportContext.is() )
3813  mxTableImportContext->endFastElement(nElement);
3814 
3816 
3817  if( mxShape.is() )
3818  {
3819  // set pos, size, shear and rotate
3821  }
3822 }
3823 
3824 // this is called from the parent group for each unparsed attribute in the attribute list
3826 {
3827  auto nElement = aIter.getToken();
3828  if( IsTokenInNamespace(nElement, XML_NAMESPACE_TABLE) )
3829  {
3830  if( (nElement & TOKEN_MASK) == XML_TEMPLATE_NAME )
3831  {
3832  msTemplateStyleName = aIter.toString();
3833  }
3834  else
3835  {
3836  int i = 0;
3837  const XMLPropertyMapEntry* pEntry = &aXMLTableShapeAttributes[0];
3838  while( pEntry->msApiName && (i < 6) )
3839  {
3840  if( (nElement & TOKEN_MASK) == pEntry->meXMLName )
3841  {
3842  if( IsXMLToken( aIter, XML_TRUE ) )
3843  maTemplateStylesUsed[i] = true;
3844  break;
3845  }
3846  pEntry++;
3847  i++;
3848  }
3849  }
3850  }
3851  return SdXMLShapeContext::processAttribute( aIter );
3852 }
3853 
3854 css::uno::Reference< css::xml::sax::XFastContextHandler > SdXMLTableShapeContext::createFastChildContext(
3855  sal_Int32 nElement,
3856  const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList )
3857 {
3859  return mxTableImportContext->createFastChildContext(nElement, xAttrList);
3860  return SdXMLShapeContext::createFastChildContext(nElement, xAttrList);
3861 }
3862 
3863 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void SetTransformation()
Definition: ximpshap.cxx:513
virtual bool processAttribute(const sax_fastparser::FastAttributeList::FastAttributeIter &) override
Definition: ximpshap.cxx:1313
SdXMLAppletShapeContext(SvXMLImport &rImport, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList, css::uno::Reference< css::drawing::XShapes > const &rShapes)
Definition: ximpshap.cxx:2701
virtual bool processAttribute(const sax_fastparser::FastAttributeList::FastAttributeIter &) override
Definition: ximpshap.cxx:1734
bool importFromSvgPoints(B2DPolygon &o_rPoly, const OUString &rSvgPointsAttribute)
virtual ~SdXMLRectShapeContext() override
Definition: ximpshap.cxx:920
sal_Int32 nApiNameLength
Property-Name.
Definition: maptype.hxx:34
bool reserveIdentifier(const OUString &rIdentifier)
reserves an identifier for later registration.
OUString maLayerName
Definition: ximpshap.hxx:69
css::uno::Sequence< css::beans::PropertyValue > maParams
Definition: ximpshap.hxx:500
bool convertMeasureToCore(sal_Int32 &rValue, std::u16string_view rString, sal_Int32 nMin=SAL_MIN_INT32, sal_Int32 nMax=SAL_MAX_INT32) const
convert string to measure with meCoreMeasureUnit, using optional min and max values ...
Definition: xmluconv.cxx:171
SdXMLGraphicObjectShapeContext(SvXMLImport &rImport, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList, css::uno::Reference< css::drawing::XShapes > const &rShapes)
Definition: ximpshap.cxx:2265
sal_Int32 nIndex
virtual void SAL_CALL startFastElement(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
Definition: ximpshap.cxx:939
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
Definition: ximpshap.cxx:2377
sal_Int32 mnZOrder
Definition: ximpshap.hxx:67
bool mbListContextPushed
whether to restore list context (#91964#)
Definition: ximpshap.hxx:61
virtual ~SdXMLPageShapeContext() override
Definition: ximpshap.cxx:2099
SvXMLImportContextRef mxReplImplContext
Definition: ximpshap.hxx:554
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 ...
Definition: ximpshap.cxx:3577
bool NeedsAction() const
Definition: xexptran.hxx:55
void removeGraphicFromImportContext(const SvXMLImportContext &rContext) override
helper to get the created xShape instance, needs to be overridden
Definition: ximpshap.cxx:3175
SdXMLConnectorShapeContext(SvXMLImport &rImport, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList, css::uno::Reference< css::drawing::XShapes > const &rShapes, bool bTemporaryShape)
Definition: ximpshap.cxx:1694
EnhancedCustomShapeTokenEnum EASGet(const OUString &rShapeType)
css::uno::Reference< css::text::XTextCursor > mxCursor
Definition: ximpshap.hxx:48
css::uno::Reference< css::io::XOutputStream > mxBase64Stream
Definition: ximpshap.hxx:439
css::uno::Reference< css::graphic::XGraphic > getGraphicFromImportContext(const SvXMLImportContext &rContext) const override
Definition: ximpshap.cxx:3220
virtual void SAL_CALL startFastElement(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
Definition: ximpshap.cxx:2517
css::uno::Reference< css::container::XIdentifierContainer > mxGluePoints
Definition: ximpshap.hxx:51
virtual ~SdXMLPluginShapeContext() override
Definition: ximpshap.cxx:2838
bool isPresentationShape() const
Definition: ximpshap.cxx:891
void B2DPolyPolygonToUnoPointSequenceSequence(const B2DPolyPolygon &rPolyPolygon, css::drawing::PointSequenceSequence &rPointSequenceSequenceRetval)
SvXMLEnumMapEntry< drawing::ConnectorType > const aXML_ConnectionKind_EnumMap[]
Definition: sdpropls.cxx:496
SdXMLCaptionShapeContext(SvXMLImport &rImport, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList, css::uno::Reference< css::drawing::XShapes > const &rShapes, bool bTemporaryShape)
Definition: ximpshap.cxx:2170
virtual bool processAttribute(const sax_fastparser::FastAttributeList::FastAttributeIter &) override
Definition: ximpshap.cxx:1999
virtual ~SdXMLGraphicObjectShapeContext() override
Definition: ximpshap.cxx:2405
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 ...
Definition: ximpshap.cxx:2359
bool mbTextBox
If the text of this shape is handled by a Writer TextFrame.
Definition: ximpshap.hxx:81
std::enable_if< std::is_signed< T >::value, T >::type saturating_sub(T a, T b)
bool getSupportsMultipleContents() const
read/write access to boolean switch
virtual void SAL_CALL startFastElement(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
Definition: ximpshap.cxx:3397
css::uno::Reference< css::text::XTextCursor > mxOldCursor
Definition: ximpshap.hxx:49
virtual void SAL_CALL startFastElement(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
Definition: ximpshap.cxx:2713
SvXMLImport & GetImport()
Definition: xmlictxt.hxx:59
double GetWidth() const
Definition: xexptran.hxx:96
double getX() const
const css::uno::Reference< css::style::XStyle > & GetStyle() const
Definition: prstylei.hxx:106
virtual ~SdXMLPathShapeContext() override
Definition: ximpshap.cxx:1308
virtual ~SdXMLEllipseShapeContext() override
Definition: ximpshap.cxx:1098
OUString msTemplateStyleName
Definition: ximpshap.hxx:631
SdXMLPathShapeContext(SvXMLImport &rImport, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList, css::uno::Reference< css::drawing::XShapes > const &rShapes, bool bTemporaryShape)
Definition: ximpshap.cxx:1299
sal_Int16 nId
SdXMLControlShapeContext(SvXMLImport &rImport, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList, css::uno::Reference< css::drawing::XShapes > const &rShapes, bool bTemporaryShape)
Definition: ximpshap.cxx:1632
tuple args
double getY() const
virtual ~SdXMLLineShapeContext() override
Definition: ximpshap.cxx:986
virtual ~SdXMLMeasureShapeContext() override
Definition: ximpshap.cxx:1994
bool importFromSvgD(B2DPolyPolygon &o_rPolyPoly, const OUString &rSvgDAttribute, bool bHandleRelativeNextPointCompatible, PointIndexSet *pHelpPointIndexSet)
geometry::RealPoint2D maPosition
bool IsXMLToken(std::u16string_view rString, enum XMLTokenEnum eToken)
compare eToken to the string
Definition: xmltoken.cxx:3480
css::uno::Reference< css::io::XOutputStream > GetStreamForEmbeddedObjectURLFromBase64() const
Definition: xmlimp.cxx:1350
FastAttributeList & castToFastAttributeList(const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList)
css::awt::Point maStart
Definition: ximpshap.hxx:319
virtual void SAL_CALL startFastElement(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
Definition: ximpshap.cxx:2185
SdXMLMeasureShapeContext(SvXMLImport &rImport, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList, css::uno::Reference< css::drawing::XShapes > const &rShapes, bool bTemporaryShape)
Definition: ximpshap.cxx:1983
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &AttrList) override
Definition: ximpshap.cxx:3854
virtual bool processAttribute(const sax_fastparser::FastAttributeList::FastAttributeIter &) override
Definition: ximpshap.cxx:2729
css::uno::Reference< css::graphic::XGraphic > loadGraphicByURL(OUString const &rURL)
Definition: xmlimp.cxx:1275
virtual bool processAttribute(const sax_fastparser::FastAttributeList::FastAttributeIter &) override
Definition: ximpshap.cxx:2649
static const sal_uInt16 AOO_40x
Definition: xmlimp.hxx:541
rtl::Reference< XMLTextImportHelper > const & GetTextImport()
Definition: xmlimp.hxx:599
static const sal_uInt16 LO_41x
Definition: xmlimp.hxx:550
virtual bool processAttribute(const sax_fastparser::FastAttributeList::FastAttributeIter &) override
Definition: ximpshap.cxx:3119
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &AttrList) override
Definition: ximpshap.cxx:172
float x
OUString maTextStyleName
Definition: ximpshap.hxx:55
OUString GetDocumentBase() const
Definition: xmlimp.cxx:1797
void setHyperlink(const OUString &rHyperlink)
virtual ~SdXMLObjectShapeContext() override
Definition: ximpshap.cxx:2513
virtual void SAL_CALL startFastElement(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
Definition: ximpshap.cxx:2284
css::awt::Point maEnd
Definition: ximpshap.hxx:320
virtual void SAL_CALL startFastElement(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
Definition: ximpshap.cxx:1021
SdXMLEllipseShapeContext(SvXMLImport &rImport, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList, css::uno::Reference< css::drawing::XShapes > const &rShapes, bool bTemporaryShape)
Definition: ximpshap.cxx:1082
double get(sal_uInt16 nRow, sal_uInt16 nColumn) const
NONE
virtual ~SdXMLCustomShapeContext() override
Definition: ximpshap.cxx:3520
#define XMLERROR_API
Definition: xmlerror.hxx:71
static void convertDouble(OUStringBuffer &rBuffer, double fNumber, bool bWriteUnits, sal_Int16 nSourceUnit, sal_Int16 nTargetUnit)
void AddShape(css::uno::Reference< css::drawing::XShape > &xShape)
OUString maThumbnailURL
Definition: ximpshap.hxx:58
sal_Int16 mnRelWidth
Definition: ximpshap.hxx:73
css::uno::Any const & rValue
Definition: ImageStyle.hxx:38
XmlStyleFamily
Definition: families.hxx:47
virtual void SAL_CALL startFastElement(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
Definition: ximpshap.cxx:1157
void setSupportsMultipleContents(bool bNew)
sal_uInt16 getGeneratorVersion() const
this checks the build ID and returns
Definition: xmlimp.cxx:1838
PropertiesInfo aProperties
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
virtual ~SdXMLFrameShapeContext() override
Definition: ximpshap.cxx:3171
DRAW
B2DHomMatrix createScaleShearXRotateTranslateB2DHomMatrix(double fScaleX, double fScaleY, double fShearX, double fRadiant, double fTranslateX, double fTranslateY)
SdXMLLineShapeContext(SvXMLImport &rImport, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList, css::uno::Reference< css::drawing::XShapes > const &rShapes, bool bTemporaryShape)
Definition: ximpshap.cxx:973
static const sal_uInt16 OOo_34x
Definition: xmlimp.hxx:539
virtual bool processAttribute(const sax_fastparser::FastAttributeList::FastAttributeIter &) override
Definition: ximpshap.cxx:1646
#define XMLOFF_WARN_UNKNOWN(area, rIter)
Definition: xmlictxt.hxx:113
virtual ~SdXMLConnectorShapeContext() override
Definition: ximpshap.cxx:1711
virtual void SAL_CALL startFastElement(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
Definition: ximpshap.cxx:3540
OUString ResolveEmbeddedObjectURL(const OUString &rURL, std::u16string_view rClassId)
Definition: xmlimp.cxx:1320
bool mbClearDefaultAttributes
Definition: ximpshap.hxx:65
Definition: txtimp.hxx:72
::comphelper::UnoInterfaceToUniqueIdentifierMapper & getInterfaceToIdentifierMapper()
Definition: xmlimp.cxx:1781
OUString maPresentationClass
Definition: ximpshap.hxx:56
const css::uno::Reference< css::drawing::XShape > & getShape() const
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &AttrList) override
Definition: ximpshap.cxx:3262
static bool ImpIsEmptyURL(std::u16string_view rURL)
Definition: ximpshap.cxx:128
bool maTemplateStylesUsed[6]
Definition: ximpshap.hxx:632
virtual void SAL_CALL startFastElement(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
Definition: ximpshap.cxx:320
SdXMLShapeContext(SvXMLImport &rImport, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList, css::uno::Reference< css::drawing::XShapes > const &rShapes, bool bTemporaryShape)
Definition: ximpshap.cxx:142
virtual void SAL_CALL characters(const OUString &rChars) override
This method is called for all characters that are contained in the current element.
Definition: ximpshap.cxx:2489
css::uno::Reference< css::io::XOutputStream > GetStreamForGraphicObjectURLFromBase64() const
Definition: xmlimp.cxx:1309
B2IRange fround(const B2DRange &rRange)
const char * sName
void addContent(const SvXMLImportContext &rSvXMLImportContext)
add a content to the remembered image import contexts
XMLTokenEnum
The enumeration of all XML tokens.
Definition: xmltoken.hxx:49
std::vector< css::beans::PropertyValue > maCustomShapeGeometry
Definition: ximpshap.hxx:586
virtual void SAL_CALL startFastElement(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
Definition: ximpshap.cxx:3086
OUString maShapeId
Definition: ximpshap.hxx:68
css::uno::Reference< css::document::XActionLockable > mxLockable
Definition: ximpshap.hxx:52
const XMLPropertyMapEntry aXMLTableShapeAttributes[]
contains the attribute to property mapping for a drawing layer table WARNING: if attributes are added...
Definition: sdpropls.cxx:368
virtual void SAL_CALL startFastElement(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
Definition: ximpshap.cxx:1482
virtual void SAL_CALL startFastElement(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
Definition: ximpshap.cxx:2113
B2DHomMatrix createSourceRangeTargetRangeTransform(const B2DRange &rSourceRange, const B2DRange &rTargetRange)
void Increment(sal_Int32 nInc=1)
#define DBG_UNHANDLED_EXCEPTION(...)
SvXMLImportContextRef mxChartContext
Definition: ximpshap.hxx:413
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
Definition: ximpshap.cxx:2797
css::awt::Point maCaptionPoint
Definition: ximpshap.hxx:364
SdXMLPluginShapeContext(SvXMLImport &rImport, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList, css::uno::Reference< css::drawing::XShapes > const &rShapes)
Definition: ximpshap.cxx:2830
sal_Int16 mnRelHeight
Definition: ximpshap.hxx:74
bool isClosed() const
bool mbIsUserTransformed
Definition: ximpshap.hxx:66
virtual ~SdXMLPolygonShapeContext() override
Definition: ximpshap.cxx:1223
virtual void SAL_CALL startFastElement(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
Definition: ximpshap.cxx:1331
void addGluePoint(const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList)
Definition: ximpshap.cxx:243
int i
css::awt::Size maSize
Definition: ximpshap.hxx:72
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 ...
Definition: ximpshap.cxx:3135
virtual void FillPropertySet(const css::uno::Reference< css::beans::XPropertySet > &rPropSet)
Definition: prstylei.cxx:222
bool getBuildIds(sal_Int32 &rUPD, sal_Int32 &rBuild) const
returns the upd and build id (f.e.
Definition: xmlimp.cxx:1818
bool IsFormsSupported() const
Definition: xmlimp.hxx:456
bool getNextToken(std::u16string_view &rToken)
Definition: xmluconv.cxx:501
void SetString(const OUString &rNew, const SvXMLUnitConverter &rConv)
Definition: xexptran.cxx:349
bool decompose(B2DTuple &rScale, B2DTuple &rTranslate, double &rRotate, double &rShearX) const
sal_Int32 mnType
bool IsPackageURL(const OUString &rURL) const
Definition: xmlimp.cxx:1227
virtual ~SdXMLTextBoxShapeContext() override
Definition: ximpshap.cxx:1460
MATH
virtual ~SdXMLFloatingFrameShapeContext() override
Definition: ximpshap.cxx:3082
const char * msApiName
Definition: maptype.hxx:33
static bool equalZero(const double &rfVal)
Represents a property with its API-name, its XML-name and the type of its value.
Definition: maptype.hxx:31
float u
void scale(double fX, double fY)
css::uno::Reference< css::drawing::XShape > mxShape
void transform(const basegfx::B2DHomMatrix &rMatrix)
virtual ~SdXMLCaptionShapeContext() override
Definition: ximpshap.cxx:2181
ProgressBarHelper * GetProgressBarHelper()
Definition: xmlimp.cxx:1436
virtual ~SdXMLAppletShapeContext() override
Definition: ximpshap.cxx:2709
SvXMLImportContext(SvXMLImport &rImport)
A contexts constructor does anything that is required if an element starts.
Definition: xmlictxt.cxx:30
OUString maDrawStyleName
Definition: ximpshap.hxx:54
virtual void SAL_CALL startFastElement(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
Definition: ximpshap.cxx:1227
css::uno::Type const & get()
bool isIdentity() const
css::awt::Point maStart
Definition: ximpshap.hxx:282
const Point maEnd
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
Definition: ximpshap.cxx:3042
virtual bool processAttribute(const sax_fastparser::FastAttributeList::FastAttributeIter &) override
Definition: ximpshap.cxx:3825
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 ...
Definition: ximpshap.cxx:3403
bool registerReservedReference(const OUString &rIdentifier, const css::uno::Reference< css::uno::XInterface > &rInterface)
registers the given uno object with reserved identifier.
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 ...
Definition: ximpshap.cxx:2937
virtual bool processAttribute(const sax_fastparser::FastAttributeList::FastAttributeIter &) override
Definition: ximpshap.cxx:1103
virtual bool processAttribute(const sax_fastparser::FastAttributeList::FastAttributeIter &) override
Definition: ximpshap.cxx:991
css::uno::Reference< css::xml::sax::XFastAttributeList > mxAttrList
Definition: ximpshap.hxx:50
void transform(const basegfx::B2DHomMatrix &rMatrix)
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)
static bool convertPercent(sal_Int32 &rValue, std::u16string_view rString)
virtual void SAL_CALL startFastElement(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
Definition: ximpshap.cxx:1659
This class deliberately does not support XWeak, to improve performance when loading large documents...
Definition: xmlictxt.hxx:44
SvXMLImportContextRef solveMultipleImages()
solve multiple imported images.
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 ...
Definition: ximpshap.cxx:2613
virtual void SAL_CALL startFastElement(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
Definition: ximpshap.cxx:2037
Map an XMLTokenEnum to an enum value.
Definition: ximpshap.hxx:39
DefTokenId nToken
css::awt::Point maPosition
Definition: ximpshap.hxx:75
virtual bool processAttribute(const sax_fastparser::FastAttributeList::FastAttributeIter &) override
Definition: ximpshap.cxx:3471
SdXMLPolygonShapeContext(SvXMLImport &rImport, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList, css::uno::Reference< css::drawing::XShapes > const &rShapes, bool bClosed, bool bTemporaryShape)
Definition: ximpshap.cxx:1196
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 ...
Definition: ximpshap.cxx:2751
css::uno::Reference< css::drawing::XShapes > mxShapes
Definition: ximpshap.hxx:47
SvXMLEnumMapEntry< drawing::Alignment > const aXML_GlueAlignment_EnumMap[]
Definition: ximpshap.cxx:102
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 ...
Definition: ximpshap.cxx:2066
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 ...
Definition: ximpshap.cxx:3810
sal_uInt32 count() const
bool mbVisible
constexpr sal_uInt16 XML_NAMESPACE_TABLE
const OUString & GetParentName() const
Definition: xmlstyle.hxx:80
virtual void SAL_CALL startFastElement(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
Definition: ximpshap.cxx:1827
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &AttrList) override
Definition: ximpshap.cxx:2495
constexpr bool IsTokenInNamespace(sal_Int32 nToken, sal_uInt16 nNamespacePrefix)
Definition: xmlimp.hxx:103
OUString GetAbsoluteReference(const OUString &rValue) const
Definition: xmlimp.cxx:1606
css::drawing::CircleKind meKind
Definition: ximpshap.hxx:172
virtual bool processAttribute(const sax_fastparser::FastAttributeList::FastAttributeIter &) override
Definition: ximpshap.cxx:2104
OUString GetStyleDisplayName(XmlStyleFamily nFamily, const OUString &rName) const
Definition: xmlimp.cxx:1410
#define SAL_WARN_IF(condition, area, stream)
virtual ~SdXMLTableShapeContext() override
Definition: ximpshap.cxx:3722
virtual bool processAttribute(const sax_fastparser::FastAttributeList::FastAttributeIter &) override
Definition: ximpshap.cxx:1206
virtual void SAL_CALL startFastElement(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
Definition: ximpshap.cxx:2420
bool needFixPositionAfterZ() const
Definition: ximpshap.cxx:1715
css::uno::Sequence< DstElementType > containerToSequence(const SrcType &i_Container)
Handling of tokens in XML:
virtual bool processAttribute(const sax_fastparser::FastAttributeList::FastAttributeIter &) override
Definition: ximpshap.cxx:3525
SdXMLFrameShapeContext(SvXMLImport &rImport, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList, css::uno::Reference< css::drawing::XShapes > const &rShapes, bool bTemporaryShape)
Definition: ximpshap.cxx:3154
XmlStyleFamily mnStyleFamily
Definition: ximpshap.hxx:63
void SetStyle(bool bSupportsStyle=true)
if bSupportsStyle is false, auto styles will be set but not a style
Definition: ximpshap.cxx:591
virtual void SAL_CALL startFastElement(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
Definition: ximpshap.cxx:2842
Point maStart
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &AttrList) override
Definition: ximpshap.cxx:2665
SdXMLRectShapeContext(SvXMLImport &rImport, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList, css::uno::Reference< css::drawing::XShapes > const &rShapes, bool bTemporaryShape)
Definition: ximpshap.cxx:910
SdXMLObjectShapeContext(SvXMLImport &rImport, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList, css::uno::Reference< css::drawing::XShapes > const &rShapes)
Definition: ximpshap.cxx:2506
#define XMLERROR_FLAG_ERROR
Definition: xmlerror.hxx:36
SvXMLImportContextRef mxImplContext
Definition: ximpshap.hxx:553
#define XML_ELEMENT(prefix, name)
Definition: xmlimp.hxx:96
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 ...
Definition: ximpshap.cxx:2481
virtual void SAL_CALL startFastElement(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
Definition: ximpshap.cxx:3726
virtual bool processAttribute(const sax_fastparser::FastAttributeList::FastAttributeIter &)
Definition: ximpshap.cxx:785
static bool convertEnum(EnumT &rEnum, std::u16string_view rValue, const SvXMLEnumMapEntry< EnumT > *pMap)
convert string to enum using given enum map, if the enum is not found in the map, this method will re...
Definition: xmluconv.hxx:138
const SvXMLUnitConverter & GetMM100UnitConverter() const
Definition: xmlimp.hxx:399
SvXMLEnumMapEntry< drawing::EscapeDirection > const aXML_GlueEscapeDirection_EnumMap[]
Definition: ximpshap.cxx:116
OUString getGraphicPackageURLFromImportContext(const SvXMLImportContext &rContext) const override
Definition: ximpshap.cxx:3240
void SetError(sal_Int32 nId, const css::uno::Sequence< OUString > &rMsgParams, const OUString &rExceptionMessage, const css::uno::Reference< css::xml::sax::XLocator > &rLocator)
Record an error condition that occurred during import.
Sequence< sal_Int8 > aSeq
SdXMLCustomShapeContext(SvXMLImport &rImport, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList, css::uno::Reference< css::drawing::XShapes > const &rShapes)
Definition: ximpshap.cxx:3492
css::uno::Reference< css::io::XOutputStream > mxBase64Stream
Definition: ximpshap.hxx:388
void translate(double fX, double fY)
virtual bool processAttribute(const sax_fastparser::FastAttributeList::FastAttributeIter &) override
Definition: ximpshap.cxx:2242
double GetHeight() const
Definition: xexptran.hxx:97
void GetFullTransform(::basegfx::B2DHomMatrix &rFullTrans)
Definition: xexptran.cxx:482
enum::xmloff::token::XMLTokenEnum meXMLName
length of property name
Definition: maptype.hxx:35
virtual ~SdXMLControlShapeContext() override
Definition: ximpshap.cxx:1641
SdXMLPageShapeContext(SvXMLImport &rImport, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList, css::uno::Reference< css::drawing::XShapes > const &rShapes, bool bTemporaryShape)
Definition: ximpshap.cxx:2089
void B2DPolyPolygonToUnoPolyPolygonBezierCoords(const B2DPolyPolygon &rPolyPolygon, css::drawing::PolyPolygonBezierCoords &rPolyPolygonBezierCoordsRetval)
OUString maShapeName
Definition: ximpshap.hxx:57
constexpr sal_Int32 TOKEN_MASK
Definition: xmlimp.hxx:93
#define XMLOFF_WARN_UNKNOWN_ELEMENT(area, token)
Definition: xmlictxt.hxx:119
sal_Int32 mnPageNumber
Definition: ximpshap.hxx:343
basegfx::B2DHomMatrix maUsedTransformation
Definition: ximpshap.hxx:76
css::awt::Point maEnd
Definition: ximpshap.hxx:283
SvXMLImportContextRef mxTableImportContext
Definition: ximpshap.hxx:630
SdXMLFloatingFrameShapeContext(SvXMLImport &rImport, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList, css::uno::Reference< css::drawing::XShapes > const &rShapes)
Definition: ximpshap.cxx:3075
const OUString & registerReference(const css::uno::Reference< css::uno::XInterface > &rInterface)
returns a unique identifier for the given uno object.
virtual ~SdXMLShapeContext() override
Definition: ximpshap.cxx:168
static OUString lcl_GetMediaReference(SvXMLImport const &rImport, OUString const &rURL)
Definition: ximpshap.cxx:2908
virtual bool processAttribute(const sax_fastparser::FastAttributeList::FastAttributeIter &) override
Definition: ximpshap.cxx:1465
SdXMLTableShapeContext(SvXMLImport &rImport, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList, css::uno::Reference< css::drawing::XShapes > const &rShapes)
Definition: ximpshap.cxx:3717
bool areControlPointsUsed() const
XMLTokenEnum eToken
Definition: xmltoken.cxx:40
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &AttrList) override
Definition: ximpshap.cxx:3699
virtual bool processAttribute(const sax_fastparser::FastAttributeList::FastAttributeIter &) override
Definition: ximpshap.cxx:925
double GetX() const
Definition: xexptran.hxx:94
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 ...
Definition: ximpshap.cxx:326
double GetY() const
Definition: xexptran.hxx:95
Reference< XGraphic > xGraphic
virtual bool processAttribute(const sax_fastparser::FastAttributeList::FastAttributeIter &) override
Definition: ximpshap.cxx:2275
SvXMLEnumMapEntry< drawing::CircleKind > const aXML_CircleKind_EnumMap[]
Definition: sdpropls.cxx:568
SdXMLChartShapeContext(SvXMLImport &rImport, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList, css::uno::Reference< css::drawing::XShapes > const &rShapes, bool bTemporaryShape)
Definition: ximpshap.cxx:2411
virtual bool processAttribute(const sax_fastparser::FastAttributeList::FastAttributeIter &) override
Definition: ximpshap.cxx:2921
SdXMLImExTransform2D mnTransform
Definition: ximpshap.hxx:71
sal_uInt16 nPos
css::drawing::ConnectorType mnType
Definition: ximpshap.hxx:286
css::uno::Sequence< css::beans::PropertyValue > maParams
Definition: ximpshap.hxx:470
::basegfx::B2IVector maSize
rtl::Reference< XMLShapeImportHelper > const & GetShapeImport()
Definition: xmlimp.hxx:607
SdXMLTextBoxShapeContext(SvXMLImport &rImport, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList, css::uno::Reference< css::drawing::XShapes > const &rShapes)
Definition: ximpshap.cxx:1450
sal_uInt32 count() const
const OUString & getMimeType() const
Definition: ximpshap.hxx:520
OUString maCustomShapeEngine
Definition: ximpshap.hxx:583
typedef void(CALLTYPE *GetFuncDataPtr)(sal_uInt16 &nNo