1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 11 * OpenOffice.org is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License version 3 13 * only, as published by the Free Software Foundation. 14 * 15 * OpenOffice.org is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License version 3 for more details 19 * (a copy is included in the LICENSE file that accompanied this code). 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * version 3 along with OpenOffice.org. If not, see 23 * <http://www.openoffice.org/license.html> 24 * for a copy of the LGPLv3 License. 25 * 26 ************************************************************************/ 27 28 // MARKER(update_precomp.py): autogen include statement, do not remove 29 #include "precompiled_xmloff.hxx" 30 #include <comphelper/extract.hxx> 31 #include "ximp3dobject.hxx" 32 #include <xmloff/XMLShapeStyleContext.hxx> 33 #include <xmloff/xmluconv.hxx> 34 #include <com/sun/star/beans/XPropertySet.hpp> 35 #include <com/sun/star/drawing/PointSequenceSequence.hpp> 36 #include <com/sun/star/drawing/PointSequence.hpp> 37 #include "xexptran.hxx" 38 #include <com/sun/star/drawing/PolyPolygonBezierCoords.hpp> 39 #include <xmloff/families.hxx> 40 #include "ximpstyl.hxx" 41 #include <xmloff/xmltoken.hxx> 42 #include <com/sun/star/drawing/PolyPolygonShape3D.hpp> 43 #include <com/sun/star/drawing/DoubleSequence.hpp> 44 45 using ::rtl::OUString; 46 using ::rtl::OUStringBuffer; 47 48 using namespace ::com::sun::star; 49 50 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 51 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 52 53 TYPEINIT1( SdXML3DObjectContext, SdXMLShapeContext ); 54 55 SdXML3DObjectContext::SdXML3DObjectContext( 56 SvXMLImport& rImport, 57 sal_uInt16 nPrfx, 58 const OUString& rLocalName, 59 const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList, 60 uno::Reference< drawing::XShapes >& rShapes, 61 sal_Bool bTemporaryShape) 62 : SdXMLShapeContext( rImport, nPrfx, rLocalName, xAttrList, rShapes, bTemporaryShape ), 63 mbSetTransform( sal_False ) 64 { 65 sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0; 66 for(sal_Int16 i=0; i < nAttrCount; i++) 67 { 68 OUString sAttrName = xAttrList->getNameByIndex( i ); 69 OUString aLocalName; 70 sal_uInt16 nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName ); 71 OUString sValue = xAttrList->getValueByIndex( i ); 72 const SvXMLTokenMap& rAttrTokenMap = GetImport().GetShapeImport()->Get3DObjectAttrTokenMap(); 73 74 switch(rAttrTokenMap.Get(nPrefix, aLocalName)) 75 { 76 case XML_TOK_3DOBJECT_DRAWSTYLE_NAME: 77 { 78 maDrawStyleName = sValue; 79 break; 80 } 81 case XML_TOK_3DOBJECT_TRANSFORM: 82 { 83 SdXMLImExTransform3D aTransform(sValue, GetImport().GetMM100UnitConverter()); 84 if(aTransform.NeedsAction()) 85 mbSetTransform = aTransform.GetFullHomogenTransform(mxHomMat); 86 break; 87 } 88 } 89 } 90 } 91 92 ////////////////////////////////////////////////////////////////////////////// 93 94 SdXML3DObjectContext::~SdXML3DObjectContext() 95 { 96 } 97 98 ////////////////////////////////////////////////////////////////////////////// 99 100 void SdXML3DObjectContext::StartElement(const uno::Reference< xml::sax::XAttributeList>& xAttrList) 101 { 102 uno::Reference< beans::XPropertySet > xPropSet(mxShape, uno::UNO_QUERY); 103 if(xPropSet.is()) 104 { 105 // set parameters 106 if(mbSetTransform) 107 { 108 uno::Any aAny; 109 aAny <<= mxHomMat; 110 xPropSet->setPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("D3DTransformMatrix")), aAny); 111 } 112 113 // call parent 114 SdXMLShapeContext::StartElement(xAttrList); 115 } 116 } 117 118 ////////////////////////////////////////////////////////////////////////////// 119 120 void SdXML3DObjectContext::EndElement() 121 { 122 // call parent 123 SdXMLShapeContext::EndElement(); 124 } 125 126 ////////////////////////////////////////////////////////////////////////////// 127 /* 128 void SdXML3DObjectContext::AddShape(uno::Reference< drawing::XShape >& xShape) 129 { 130 if(xShape.is() && mxShapes.is()) 131 { 132 // set shape local 133 mxShape = xShape; 134 135 // add new shape to parent 136 mxShapes->add( xShape ); 137 } 138 } 139 */ 140 ////////////////////////////////////////////////////////////////////////////// 141 /* 142 void SdXML3DObjectContext::SetStyle() 143 { 144 // set style on shape 145 if(maDrawStyleName.getLength() && mxShape.is()) 146 { 147 const SvXMLStyleContext* pStyle = 0L; 148 sal_Bool bAutoStyle(sal_False); 149 150 if(GetImport().GetShapeImport()->GetAutoStylesContext()) 151 pStyle = GetImport().GetShapeImport()->GetAutoStylesContext()->FindStyleChildContext( 152 XML_STYLE_FAMILY_SD_GRAPHICS_ID, maDrawStyleName); 153 154 if(pStyle) 155 bAutoStyle = sal_True; 156 157 if(!pStyle && GetImport().GetShapeImport()->GetStylesContext()) 158 pStyle = GetImport().GetShapeImport()->GetStylesContext()-> 159 FindStyleChildContext(XML_STYLE_FAMILY_SD_GRAPHICS_ID, maDrawStyleName); 160 161 if(pStyle && pStyle->ISA(XMLShapeStyleContext)) 162 { 163 uno::Reference< beans::XPropertySet > xPropSet(mxShape, uno::UNO_QUERY); 164 if(xPropSet.is()) 165 { 166 XMLShapeStyleContext* pDocStyle = (XMLShapeStyleContext*)pStyle; 167 168 if(pDocStyle->GetStyle().is()) 169 { 170 // set style on object 171 uno::Any aAny; 172 aAny <<= pDocStyle->GetStyle(); 173 xPropSet->setPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("Style")), aAny); 174 } 175 176 if(bAutoStyle) 177 { 178 // set PropertySet on object 179 pDocStyle->FillPropertySet(xPropSet); 180 } 181 } 182 } 183 } 184 } 185 */ 186 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 187 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 188 189 TYPEINIT1( SdXML3DCubeObjectShapeContext, SdXML3DObjectContext); 190 191 SdXML3DCubeObjectShapeContext::SdXML3DCubeObjectShapeContext( 192 SvXMLImport& rImport, 193 sal_uInt16 nPrfx, 194 const OUString& rLocalName, 195 const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList, 196 uno::Reference< drawing::XShapes >& rShapes, 197 sal_Bool bTemporaryShape) 198 : SdXML3DObjectContext( rImport, nPrfx, rLocalName, xAttrList, rShapes, bTemporaryShape ), 199 maMinEdge(-2500.0, -2500.0, -2500.0), 200 maMaxEdge(2500.0, 2500.0, 2500.0), 201 mbMinEdgeUsed(sal_False), 202 mbMaxEdgeUsed(sal_False) 203 { 204 sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0; 205 for(sal_Int16 i=0; i < nAttrCount; i++) 206 { 207 OUString sAttrName = xAttrList->getNameByIndex( i ); 208 OUString aLocalName; 209 sal_uInt16 nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName ); 210 OUString sValue = xAttrList->getValueByIndex( i ); 211 const SvXMLTokenMap& rAttrTokenMap = GetImport().GetShapeImport()->Get3DCubeObjectAttrTokenMap(); 212 213 switch(rAttrTokenMap.Get(nPrefix, aLocalName)) 214 { 215 case XML_TOK_3DCUBEOBJ_MINEDGE: 216 { 217 ::basegfx::B3DVector aNewVec; 218 GetImport().GetMM100UnitConverter().convertB3DVector(aNewVec, sValue); 219 220 if(aNewVec != maMinEdge) 221 { 222 maMinEdge = aNewVec; 223 mbMinEdgeUsed = sal_True; 224 } 225 break; 226 } 227 case XML_TOK_3DCUBEOBJ_MAXEDGE: 228 { 229 ::basegfx::B3DVector aNewVec; 230 GetImport().GetMM100UnitConverter().convertB3DVector(aNewVec, sValue); 231 232 if(aNewVec != maMaxEdge) 233 { 234 maMaxEdge = aNewVec; 235 mbMaxEdgeUsed = sal_True; 236 } 237 break; 238 } 239 } 240 } 241 } 242 243 ////////////////////////////////////////////////////////////////////////////// 244 245 SdXML3DCubeObjectShapeContext::~SdXML3DCubeObjectShapeContext() 246 { 247 } 248 249 ////////////////////////////////////////////////////////////////////////////// 250 251 void SdXML3DCubeObjectShapeContext::StartElement(const uno::Reference< xml::sax::XAttributeList>& xAttrList) 252 { 253 // create shape 254 AddShape( "com.sun.star.drawing.Shape3DCubeObject" ); 255 if(mxShape.is()) 256 { 257 // add, set style and properties from base shape 258 SetStyle(); 259 SdXML3DObjectContext::StartElement(xAttrList); 260 261 // set local parameters on shape 262 uno::Reference< beans::XPropertySet > xPropSet(mxShape, uno::UNO_QUERY); 263 if(xPropSet.is()) 264 { 265 // set parameters 266 drawing::Position3D aPosition3D; 267 drawing::Direction3D aDirection3D; 268 269 // convert from min, max to size to be set 270 maMaxEdge = maMaxEdge - maMinEdge; 271 272 aPosition3D.PositionX = maMinEdge.getX(); 273 aPosition3D.PositionY = maMinEdge.getY(); 274 aPosition3D.PositionZ = maMinEdge.getZ(); 275 276 aDirection3D.DirectionX = maMaxEdge.getX(); 277 aDirection3D.DirectionY = maMaxEdge.getY(); 278 aDirection3D.DirectionZ = maMaxEdge.getZ(); 279 280 uno::Any aAny; 281 aAny <<= aPosition3D; 282 xPropSet->setPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("D3DPosition")), aAny); 283 aAny <<= aDirection3D; 284 xPropSet->setPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("D3DSize")), aAny); 285 } 286 } 287 } 288 289 ////////////////////////////////////////////////////////////////////////////// 290 291 void SdXML3DCubeObjectShapeContext::EndElement() 292 { 293 // call parent 294 SdXML3DObjectContext::EndElement(); 295 } 296 297 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 298 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 299 300 TYPEINIT1( SdXML3DSphereObjectShapeContext, SdXML3DObjectContext); 301 302 SdXML3DSphereObjectShapeContext::SdXML3DSphereObjectShapeContext( 303 SvXMLImport& rImport, 304 sal_uInt16 nPrfx, 305 const OUString& rLocalName, 306 const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList, 307 uno::Reference< drawing::XShapes >& rShapes, 308 sal_Bool bTemporaryShape) 309 : SdXML3DObjectContext( rImport, nPrfx, rLocalName, xAttrList, rShapes, bTemporaryShape ), 310 maCenter(0.0, 0.0, 0.0), 311 maSize(5000.0, 5000.0, 5000.0), 312 mbCenterUsed(sal_False), 313 mbSizeUsed(sal_False) 314 { 315 sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0; 316 for(sal_Int16 i=0; i < nAttrCount; i++) 317 { 318 OUString sAttrName = xAttrList->getNameByIndex( i ); 319 OUString aLocalName; 320 sal_uInt16 nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName ); 321 OUString sValue = xAttrList->getValueByIndex( i ); 322 const SvXMLTokenMap& rAttrTokenMap = GetImport().GetShapeImport()->Get3DSphereObjectAttrTokenMap(); 323 324 switch(rAttrTokenMap.Get(nPrefix, aLocalName)) 325 { 326 case XML_TOK_3DSPHEREOBJ_CENTER: 327 { 328 ::basegfx::B3DVector aNewVec; 329 GetImport().GetMM100UnitConverter().convertB3DVector(aNewVec, sValue); 330 331 if(aNewVec != maCenter) 332 { 333 maCenter = aNewVec; 334 mbCenterUsed = sal_True; 335 } 336 break; 337 } 338 case XML_TOK_3DSPHEREOBJ_SIZE: 339 { 340 ::basegfx::B3DVector aNewVec; 341 GetImport().GetMM100UnitConverter().convertB3DVector(aNewVec, sValue); 342 343 if(aNewVec != maSize) 344 { 345 maSize = aNewVec; 346 mbSizeUsed = sal_True; 347 } 348 break; 349 } 350 } 351 } 352 } 353 354 ////////////////////////////////////////////////////////////////////////////// 355 356 SdXML3DSphereObjectShapeContext::~SdXML3DSphereObjectShapeContext() 357 { 358 } 359 360 ////////////////////////////////////////////////////////////////////////////// 361 362 void SdXML3DSphereObjectShapeContext::StartElement(const uno::Reference< xml::sax::XAttributeList>& xAttrList) 363 { 364 // create shape 365 AddShape( "com.sun.star.drawing.Shape3DSphereObject" ); 366 if(mxShape.is()) 367 { 368 // add, set style and properties from base shape 369 SetStyle(); 370 SdXML3DObjectContext::StartElement(xAttrList); 371 372 // set local parameters on shape 373 uno::Reference< beans::XPropertySet > xPropSet(mxShape, uno::UNO_QUERY); 374 if(xPropSet.is()) 375 { 376 // set parameters 377 drawing::Position3D aPosition3D; 378 drawing::Direction3D aDirection3D; 379 380 aPosition3D.PositionX = maCenter.getX(); 381 aPosition3D.PositionY = maCenter.getY(); 382 aPosition3D.PositionZ = maCenter.getZ(); 383 384 aDirection3D.DirectionX = maSize.getX(); 385 aDirection3D.DirectionY = maSize.getY(); 386 aDirection3D.DirectionZ = maSize.getZ(); 387 388 uno::Any aAny; 389 aAny <<= aPosition3D; 390 xPropSet->setPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("D3DPosition")), aAny); 391 aAny <<= aDirection3D; 392 xPropSet->setPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("D3DSize")), aAny); 393 } 394 } 395 } 396 397 ////////////////////////////////////////////////////////////////////////////// 398 399 void SdXML3DSphereObjectShapeContext::EndElement() 400 { 401 // call parent 402 SdXML3DObjectContext::EndElement(); 403 } 404 405 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 406 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 407 408 TYPEINIT1( SdXML3DPolygonBasedShapeContext, SdXML3DObjectContext ); 409 410 SdXML3DPolygonBasedShapeContext::SdXML3DPolygonBasedShapeContext( 411 SvXMLImport& rImport, 412 sal_uInt16 nPrfx, 413 const OUString& rLocalName, 414 const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList, 415 uno::Reference< drawing::XShapes >& rShapes, 416 sal_Bool bTemporaryShape) 417 : SdXML3DObjectContext( rImport, nPrfx, rLocalName, xAttrList, rShapes, bTemporaryShape ) 418 { 419 sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0; 420 for(sal_Int16 i=0; i < nAttrCount; i++) 421 { 422 OUString sAttrName = xAttrList->getNameByIndex( i ); 423 OUString aLocalName; 424 sal_uInt16 nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName ); 425 OUString sValue = xAttrList->getValueByIndex( i ); 426 const SvXMLTokenMap& rAttrTokenMap = GetImport().GetShapeImport()->Get3DPolygonBasedAttrTokenMap(); 427 428 switch(rAttrTokenMap.Get(nPrefix, aLocalName)) 429 { 430 case XML_TOK_3DPOLYGONBASED_VIEWBOX: 431 { 432 maViewBox = sValue; 433 break; 434 } 435 case XML_TOK_3DPOLYGONBASED_D: 436 { 437 maPoints = sValue; 438 break; 439 } 440 } 441 } 442 } 443 444 ////////////////////////////////////////////////////////////////////////////// 445 446 SdXML3DPolygonBasedShapeContext::~SdXML3DPolygonBasedShapeContext() 447 { 448 } 449 450 ////////////////////////////////////////////////////////////////////////////// 451 452 void SdXML3DPolygonBasedShapeContext::StartElement(const uno::Reference< xml::sax::XAttributeList>& xAttrList) 453 { 454 uno::Reference< beans::XPropertySet > xPropSet(mxShape, uno::UNO_QUERY); 455 if(xPropSet.is()) 456 { 457 // set parameters 458 if(maPoints.getLength() && maViewBox.getLength()) 459 { 460 SdXMLImExViewBox aViewBox(maViewBox, GetImport().GetMM100UnitConverter()); 461 awt::Point aMinPoint(aViewBox.GetX(), aViewBox.GetY()); 462 awt::Size aMaxSize(aViewBox.GetWidth(), aViewBox.GetHeight()); 463 SdXMLImExSvgDElement aPoints(maPoints, aViewBox, 464 aMinPoint, aMaxSize, GetImport().GetMM100UnitConverter()); 465 466 // convert to double sequences 467 drawing::PointSequenceSequence& xPoSeSe = 468 (drawing::PointSequenceSequence&)aPoints.GetPointSequenceSequence(); 469 sal_Int32 nOuterSequenceCount = xPoSeSe.getLength(); 470 drawing::PointSequence* pInnerSequence = xPoSeSe.getArray(); 471 472 drawing::PolyPolygonShape3D xPolyPolygon3D; 473 xPolyPolygon3D.SequenceX.realloc(nOuterSequenceCount); 474 xPolyPolygon3D.SequenceY.realloc(nOuterSequenceCount); 475 xPolyPolygon3D.SequenceZ.realloc(nOuterSequenceCount); 476 drawing::DoubleSequence* pOuterSequenceX = xPolyPolygon3D.SequenceX.getArray(); 477 drawing::DoubleSequence* pOuterSequenceY = xPolyPolygon3D.SequenceY.getArray(); 478 drawing::DoubleSequence* pOuterSequenceZ = xPolyPolygon3D.SequenceZ.getArray(); 479 480 for(sal_Int32 a(0L); a < nOuterSequenceCount; a++) 481 { 482 sal_Int32 nInnerSequenceCount(pInnerSequence->getLength()); 483 awt::Point* pArray = pInnerSequence->getArray(); 484 485 pOuterSequenceX->realloc(nInnerSequenceCount); 486 pOuterSequenceY->realloc(nInnerSequenceCount); 487 pOuterSequenceZ->realloc(nInnerSequenceCount); 488 double* pInnerSequenceX = pOuterSequenceX->getArray(); 489 double* pInnerSequenceY = pOuterSequenceY->getArray(); 490 double* pInnerSequenceZ = pOuterSequenceZ->getArray(); 491 492 for(sal_Int32 b(0L); b < nInnerSequenceCount; b++) 493 { 494 *pInnerSequenceX++ = pArray->X; 495 *pInnerSequenceY++ = pArray->Y; 496 *pInnerSequenceZ++ = 0.0; 497 pArray++; 498 } 499 pInnerSequence++; 500 501 pOuterSequenceX++; 502 pOuterSequenceY++; 503 pOuterSequenceZ++; 504 } 505 506 // set poly 507 uno::Any aAny; 508 aAny <<= xPolyPolygon3D; 509 xPropSet->setPropertyValue( 510 OUString(RTL_CONSTASCII_USTRINGPARAM("D3DPolyPolygon3D")), aAny); 511 } 512 513 // call parent 514 SdXML3DObjectContext::StartElement(xAttrList); 515 } 516 } 517 518 ////////////////////////////////////////////////////////////////////////////// 519 520 void SdXML3DPolygonBasedShapeContext::EndElement() 521 { 522 // call parent 523 SdXML3DObjectContext::EndElement(); 524 } 525 526 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 527 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 528 529 TYPEINIT1( SdXML3DLatheObjectShapeContext, SdXML3DPolygonBasedShapeContext); 530 531 SdXML3DLatheObjectShapeContext::SdXML3DLatheObjectShapeContext( 532 SvXMLImport& rImport, 533 sal_uInt16 nPrfx, 534 const OUString& rLocalName, 535 const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList, 536 uno::Reference< drawing::XShapes >& rShapes, 537 sal_Bool bTemporaryShape) 538 : SdXML3DPolygonBasedShapeContext( rImport, nPrfx, rLocalName, xAttrList, rShapes, bTemporaryShape ) 539 { 540 } 541 542 ////////////////////////////////////////////////////////////////////////////// 543 544 SdXML3DLatheObjectShapeContext::~SdXML3DLatheObjectShapeContext() 545 { 546 } 547 548 ////////////////////////////////////////////////////////////////////////////// 549 550 void SdXML3DLatheObjectShapeContext::StartElement(const uno::Reference< xml::sax::XAttributeList>& xAttrList) 551 { 552 // create shape 553 AddShape( "com.sun.star.drawing.Shape3DLatheObject" ); 554 if(mxShape.is()) 555 { 556 // add, set style and properties from base shape 557 SetStyle(); 558 SdXML3DPolygonBasedShapeContext::StartElement(xAttrList); 559 } 560 } 561 562 ////////////////////////////////////////////////////////////////////////////// 563 564 void SdXML3DLatheObjectShapeContext::EndElement() 565 { 566 // call parent 567 SdXML3DPolygonBasedShapeContext::EndElement(); 568 } 569 570 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 571 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 572 573 TYPEINIT1( SdXML3DExtrudeObjectShapeContext, SdXML3DPolygonBasedShapeContext); 574 575 SdXML3DExtrudeObjectShapeContext::SdXML3DExtrudeObjectShapeContext( 576 SvXMLImport& rImport, 577 sal_uInt16 nPrfx, 578 const OUString& rLocalName, 579 const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList, 580 uno::Reference< drawing::XShapes >& rShapes, 581 sal_Bool bTemporaryShape) 582 : SdXML3DPolygonBasedShapeContext( rImport, nPrfx, rLocalName, xAttrList, rShapes, bTemporaryShape ) 583 { 584 } 585 586 ////////////////////////////////////////////////////////////////////////////// 587 588 SdXML3DExtrudeObjectShapeContext::~SdXML3DExtrudeObjectShapeContext() 589 { 590 } 591 592 ////////////////////////////////////////////////////////////////////////////// 593 594 void SdXML3DExtrudeObjectShapeContext::StartElement(const uno::Reference< xml::sax::XAttributeList>& xAttrList) 595 { 596 AddShape( "com.sun.star.drawing.Shape3DExtrudeObject" ); 597 if(mxShape.is()) 598 { 599 // add, set style and properties from base shape 600 SetStyle(); 601 SdXML3DPolygonBasedShapeContext::StartElement(xAttrList); 602 } 603 } 604 605 ////////////////////////////////////////////////////////////////////////////// 606 607 void SdXML3DExtrudeObjectShapeContext::EndElement() 608 { 609 // call parent 610 SdXML3DPolygonBasedShapeContext::EndElement(); 611 } 612 613 // EOF 614