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