1 /**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License. You may obtain a copy of the License at
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied. See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 *
20 *************************************************************/
21
22
23
24 // MARKER(update_precomp.py): autogen include statement, do not remove
25 #include "precompiled_slideshow.hxx"
26
27 // must be first
28 #include <canvas/debug.hxx>
29 #include <vcl/cvtgrf.hxx>
30 #include <tools/urlobj.hxx>
31 #include <tools/stream.hxx>
32 #include <svtools/grfmgr.hxx>
33 #include <unotools/ucbstreamhelper.hxx>
34 #include <unotools/streamwrap.hxx>
35 #include <basegfx/point/b2dpoint.hxx>
36 #include <basegfx/polygon/b2dpolygon.hxx>
37 #include <cppcanvas/basegfxfactory.hxx>
38 #include <cppcanvas/polypolygon.hxx>
39 #include <com/sun/star/awt/Rectangle.hpp>
40 #include <com/sun/star/drawing/ColorMode.hpp>
41 #include <com/sun/star/text/GraphicCrop.hpp>
42 #include <com/sun/star/container/XNameContainer.hpp>
43 #include <com/sun/star/drawing/PointSequenceSequence.hpp>
44 #include <com/sun/star/drawing/PointSequence.hpp>
45 #include <com/sun/star/lang/XMultiComponentFactory.hpp>
46 #include <com/sun/star/drawing/XLayerSupplier.hpp>
47 #include <com/sun/star/drawing/XLayerManager.hpp>
48 #include <com/sun/star/container/XNameAccess.hpp>
49 #include <com/sun/star/lang/XComponent.hpp>
50 #include <com/sun/star/drawing/XDrawPagesSupplier.hpp>
51
52 #include "drawshapesubsetting.hxx"
53 #include "drawshape.hxx"
54 #include "backgroundshape.hxx"
55 #include "mediashape.hxx"
56 #include "appletshape.hxx"
57 #include "shapeimporter.hxx"
58 #include "slideshowexceptions.hxx"
59 #include "gdimtftools.hxx"
60 #include "tools.hxx"
61 #include "slideshowcontext.hxx"
62
63 #include <boost/shared_ptr.hpp>
64 #include <boost/scoped_ptr.hpp>
65
66 using namespace com::sun::star;
67
68 namespace slideshow {
69 namespace internal {
70
71 namespace {
72
importShapeGraphic(GraphicObject & o_rGraphic,uno::Reference<beans::XPropertySet> const & xPropSet)73 bool importShapeGraphic(
74 GraphicObject & o_rGraphic,
75 uno::Reference<beans::XPropertySet> const& xPropSet )
76 {
77 rtl::OUString aURL;
78 if( !getPropertyValue( aURL, xPropSet, OUSTR("GraphicURL")) ||
79 aURL.getLength() == 0 )
80 {
81 // no or empty property - cannot import shape graphic
82 return false;
83 }
84
85 rtl::OUString const aVndUrl(
86 RTL_CONSTASCII_USTRINGPARAM( "vnd.sun.star.GraphicObject:" ) );
87 sal_Int32 nIndex( aURL.indexOf( aVndUrl ) );
88
89 if(nIndex != -1)
90 {
91 // skip past the end of the "vnd..." prefix
92 nIndex += aVndUrl.getLength();
93
94 if(nIndex >= aURL.getLength())
95 {
96 OSL_ENSURE( false, "ShapeImporter::importShape(): "
97 "embedded graphic has no graphic ID" );
98 return false;
99 }
100
101 // unique ID string found in URL, extract
102 // to separate string
103 rtl::OUString const aUniqueId(
104 aURL.copy( nIndex, aURL.getLength() - nIndex ) );
105
106 // TODO(T2): Creating a GraphicObject is not
107 // thread safe (internally calls VCL, and has
108 // unguarded internal singleton mpGlobalMgr)
109
110 // fetch already loaded graphic from graphic manager.
111 ByteString const aOldString( static_cast<String>(aUniqueId),
112 RTL_TEXTENCODING_UTF8 );
113 o_rGraphic = GraphicObject( aOldString );
114
115
116 if( GRAPHIC_DEFAULT == o_rGraphic.GetType()
117 || GRAPHIC_NONE == o_rGraphic.GetType() )
118 {
119 // even the GrfMgr does not seem to know this graphic
120 return false;
121 }
122 }
123 else
124 {
125 // no special string found, graphic must be
126 // external. Load via GraphicIm porter
127 INetURLObject aTmp( aURL );
128 boost::scoped_ptr<SvStream> pGraphicStream(
129 utl::UcbStreamHelper::CreateStream(
130 aTmp.GetMainURL( INetURLObject::NO_DECODE ),
131 STREAM_READ ) );
132 if( !pGraphicStream )
133 {
134 OSL_ENSURE( false, "ShapeImporter::importShape(): "
135 "cannot create input stream for graphic" );
136 return false;
137 }
138
139 Graphic aTmpGraphic;
140 if( GraphicConverter::Import(
141 *pGraphicStream, aTmpGraphic ) != ERRCODE_NONE )
142 {
143 OSL_ENSURE( false, "ShapeImporter::importShape(): "
144 "Failed to import shape graphic from given URL" );
145 return false;
146 }
147
148 o_rGraphic = GraphicObject( aTmpGraphic );
149 }
150 return true;
151 }
152
153 /** This shape implementation just acts as a dummy for the layermanager.
154 Its sole role is for hit test detection of group shapes.
155 */
156 class ShapeOfGroup : public Shape
157 {
158 public:
159 ShapeOfGroup( ShapeSharedPtr const& pGroupShape,
160 uno::Reference<drawing::XShape> const& xShape,
161 uno::Reference<beans::XPropertySet> const& xPropSet,
162 double nPrio );
163
164 // Shape:
165 virtual uno::Reference<drawing::XShape> getXShape() const;
166 virtual void addViewLayer( ViewLayerSharedPtr const& pNewLayer,
167 bool bRedrawLayer );
168 virtual bool removeViewLayer( ViewLayerSharedPtr const& pNewLayer );
169 virtual bool clearAllViewLayers();
170 virtual bool update() const;
171 virtual bool render() const;
172 virtual bool isContentChanged() const;
173 virtual basegfx::B2DRectangle getBounds() const;
174 virtual basegfx::B2DRectangle getDomBounds() const;
175 virtual basegfx::B2DRectangle getUpdateArea() const;
176 virtual bool isVisible() const;
177 virtual double getPriority() const;
178 virtual bool isBackgroundDetached() const;
179
180 private:
181 ShapeSharedPtr const mpGroupShape;
182 uno::Reference<drawing::XShape> const mxShape;
183 double const mnPrio;
184 basegfx::B2DPoint maPosOffset;
185 double mnWidth;
186 double mnHeight;
187 };
188
ShapeOfGroup(ShapeSharedPtr const & pGroupShape,uno::Reference<drawing::XShape> const & xShape,uno::Reference<beans::XPropertySet> const & xPropSet,double nPrio)189 ShapeOfGroup::ShapeOfGroup( ShapeSharedPtr const& pGroupShape,
190 uno::Reference<drawing::XShape> const& xShape,
191 uno::Reference<beans::XPropertySet> const& xPropSet,
192 double nPrio ) :
193 mpGroupShape(pGroupShape),
194 mxShape(xShape),
195 mnPrio(nPrio)
196 {
197 // read bound rect
198 uno::Any const aTmpRect_( xPropSet->getPropertyValue( OUSTR("BoundRect") ));
199 awt::Rectangle const aTmpRect( aTmpRect_.get<awt::Rectangle>() );
200 basegfx::B2DRectangle const groupPosSize( pGroupShape->getBounds() );
201 maPosOffset = basegfx::B2DPoint( aTmpRect.X - groupPosSize.getMinX(),
202 aTmpRect.Y - groupPosSize.getMinY() );
203 mnWidth = aTmpRect.Width;
204 mnHeight = aTmpRect.Height;
205 }
206
getXShape() const207 uno::Reference<drawing::XShape> ShapeOfGroup::getXShape() const
208 {
209 return mxShape;
210 }
211
addViewLayer(ViewLayerSharedPtr const &,bool)212 void ShapeOfGroup::addViewLayer( ViewLayerSharedPtr const& /*pNewLayer*/,
213 bool /*bRedrawLayer*/ )
214 {
215 }
216
removeViewLayer(ViewLayerSharedPtr const &)217 bool ShapeOfGroup::removeViewLayer( ViewLayerSharedPtr const& /*pNewLayer*/ )
218 {
219 return true;
220 }
221
clearAllViewLayers()222 bool ShapeOfGroup::clearAllViewLayers()
223 {
224 return true;
225 }
226
update() const227 bool ShapeOfGroup::update() const
228 {
229 return true;
230 }
231
render() const232 bool ShapeOfGroup::render() const
233 {
234 return true;
235 }
236
isContentChanged() const237 bool ShapeOfGroup::isContentChanged() const
238 {
239 return false;
240 }
241
getBounds() const242 basegfx::B2DRectangle ShapeOfGroup::getBounds() const
243 {
244 basegfx::B2DRectangle const groupPosSize( mpGroupShape->getBounds() );
245 double const posX = (groupPosSize.getMinX() + maPosOffset.getX());
246 double const posY = (groupPosSize.getMinY() + maPosOffset.getY());
247 return basegfx::B2DRectangle( posX, posY, posX + mnWidth, posY + mnHeight );
248 }
249
getDomBounds() const250 basegfx::B2DRectangle ShapeOfGroup::getDomBounds() const
251 {
252 return getBounds();
253 }
254
getUpdateArea() const255 basegfx::B2DRectangle ShapeOfGroup::getUpdateArea() const
256 {
257 return getBounds();
258 }
259
isVisible() const260 bool ShapeOfGroup::isVisible() const
261 {
262 return mpGroupShape->isVisible();
263 }
264
getPriority() const265 double ShapeOfGroup::getPriority() const
266 {
267 return mnPrio;
268 }
269
isBackgroundDetached() const270 bool ShapeOfGroup::isBackgroundDetached() const
271 {
272 return false;
273 }
274
275 } // anon namespace
276
createShape(uno::Reference<drawing::XShape> const & xCurrShape,uno::Reference<beans::XPropertySet> const & xPropSet,rtl::OUString const & shapeType) const277 ShapeSharedPtr ShapeImporter::createShape(
278 uno::Reference<drawing::XShape> const& xCurrShape,
279 uno::Reference<beans::XPropertySet> const& xPropSet,
280 rtl::OUString const& shapeType ) const
281 {
282 if( shapeType.equalsAsciiL(
283 RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.MediaShape") ) ||
284 shapeType.equalsAsciiL(
285 RTL_CONSTASCII_STRINGPARAM("com.sun.star.presentation.MediaShape") ) )
286 {
287 // Media shape (video etc.). This is a special object
288 return createMediaShape(xCurrShape,
289 mnAscendingPrio,
290 mrContext);
291 }
292 else if( shapeType.equalsAsciiL(
293 RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.PluginShape") ))
294 {
295 // PropertyValues to copy from XShape to plugin
296 static const char* aPropertyValues[] =
297 {
298 "PluginURL",
299 "PluginMimeType",
300 "PluginCommands"
301 };
302
303 // (Netscape)Plugin shape. This is a special object
304 return createAppletShape( xCurrShape,
305 mnAscendingPrio,
306 ::rtl::OUString(
307 RTL_CONSTASCII_USTRINGPARAM(
308 "com.sun.star.comp.sfx2.PluginObject" )),
309 aPropertyValues,
310 sizeof(aPropertyValues)/sizeof(*aPropertyValues),
311 mrContext );
312 }
313 else if( shapeType.equalsAsciiL(
314 RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.AppletShape") ))
315 {
316 // PropertyValues to copy from XShape to applet
317 static const char* aPropertyValues[] =
318 {
319 "AppletCodeBase",
320 "AppletName",
321 "AppletCode",
322 "AppletCommands",
323 "AppletIsScript"
324 };
325
326 // (Java)Applet shape. This is a special object
327 return createAppletShape( xCurrShape,
328 mnAscendingPrio,
329 ::rtl::OUString(
330 RTL_CONSTASCII_USTRINGPARAM(
331 "com.sun.star.comp.sfx2.AppletObject" )),
332 aPropertyValues,
333 sizeof(aPropertyValues)/sizeof(*aPropertyValues),
334 mrContext );
335 }
336 else if( shapeType.equalsAsciiL(
337 RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.OLE2Shape") ) ||
338 shapeType.equalsAsciiL(
339 RTL_CONSTASCII_STRINGPARAM("com.sun.star.presentation.OLE2Shape") ) )
340 {
341 // #i46224# Mark OLE shapes as foreign content - scan them for
342 // unsupported actions, and fallback to bitmap, if necessary
343 return DrawShape::create( xCurrShape,
344 mxPage,
345 mnAscendingPrio,
346 true,
347 mrContext );
348 }
349 else if( shapeType.equalsAsciiL(
350 RTL_CONSTASCII_STRINGPARAM(
351 "com.sun.star.drawing.GraphicObjectShape") ) ||
352 shapeType.equalsAsciiL(
353 RTL_CONSTASCII_STRINGPARAM(
354 "com.sun.star.presentation.GraphicObjectShape") ) )
355 {
356 GraphicObject aGraphicObject;
357
358 // to get hold of GIF animations, inspect Graphic
359 // objects more thoroughly (the plain-jane shape
360 // metafile of course would only contain the first
361 // animation frame)
362 if( !importShapeGraphic( aGraphicObject, xPropSet ) )
363 return ShapeSharedPtr(); // error loading graphic -
364 // #142147# no placeholders in
365 // slideshow
366
367 if( !aGraphicObject.IsAnimated() )
368 {
369 // no animation - simply utilize plain draw shape import
370
371 // import shape as bitmap - either its a bitmap
372 // anyway, or its a metafile, which currently the
373 // metafile renderer might not display correctly.
374 return DrawShape::create( xCurrShape,
375 mxPage,
376 mnAscendingPrio,
377 true,
378 mrContext );
379 }
380
381
382 // now extract relevant shape attributes via API
383 // ---------------------------------------------
384
385 drawing::ColorMode eColorMode( drawing::ColorMode_STANDARD );
386 sal_Int16 nLuminance(0);
387 sal_Int16 nContrast(0);
388 sal_Int16 nRed(0);
389 sal_Int16 nGreen(0);
390 sal_Int16 nBlue(0);
391 double nGamma(1.0);
392 sal_Int16 nTransparency(0);
393 sal_Int32 nRotation(0);
394
395 getPropertyValue( eColorMode, xPropSet, OUSTR("GraphicColorMode") );
396 getPropertyValue( nLuminance, xPropSet, OUSTR("AdjustLuminance") );
397 getPropertyValue( nContrast, xPropSet, OUSTR("AdjustContrast") );
398 getPropertyValue( nRed, xPropSet, OUSTR("AdjustRed") );
399 getPropertyValue( nGreen, xPropSet, OUSTR("AdjustGreen") );
400 getPropertyValue( nBlue, xPropSet, OUSTR("AdjustBlue") );
401 getPropertyValue( nGamma, xPropSet, OUSTR("Gamma") );
402 getPropertyValue( nTransparency, xPropSet, OUSTR("Transparency") );
403 getPropertyValue( nRotation, xPropSet, OUSTR("RotateAngle") );
404
405 GraphicAttr aGraphAttrs;
406 aGraphAttrs.SetDrawMode( (GraphicDrawMode)eColorMode );
407 aGraphAttrs.SetLuminance( nLuminance );
408 aGraphAttrs.SetContrast( nContrast );
409 aGraphAttrs.SetChannelR( nRed );
410 aGraphAttrs.SetChannelG( nGreen );
411 aGraphAttrs.SetChannelB( nBlue );
412 aGraphAttrs.SetGamma( nGamma );
413 aGraphAttrs.SetTransparency( static_cast<sal_uInt8>(nTransparency) );
414 aGraphAttrs.SetRotation( static_cast<sal_uInt16>(nRotation*10) );
415
416 text::GraphicCrop aGraphCrop;
417 if( getPropertyValue( aGraphCrop, xPropSet, OUSTR("GraphicCrop") ))
418 {
419 aGraphAttrs.SetCrop( aGraphCrop.Left,
420 aGraphCrop.Top,
421 aGraphCrop.Right,
422 aGraphCrop.Bottom );
423 }
424
425 // fetch readily transformed and color-modified
426 // graphic
427 // ---------------------------------------------
428
429 Graphic aGraphic(
430 aGraphicObject.GetTransformedGraphic(
431 aGraphicObject.GetPrefSize(),
432 aGraphicObject.GetPrefMapMode(),
433 aGraphAttrs ) );
434
435 return DrawShape::create( xCurrShape,
436 mxPage,
437 mnAscendingPrio,
438 aGraphic,
439 mrContext );
440 }
441 else
442 {
443 return DrawShape::create( xCurrShape,
444 mxPage,
445 mnAscendingPrio,
446 false,
447 mrContext );
448 }
449 }
450
isSkip(uno::Reference<beans::XPropertySet> const & xPropSet,rtl::OUString const & shapeType,uno::Reference<drawing::XLayer> const & xLayer)451 bool ShapeImporter::isSkip(
452 uno::Reference<beans::XPropertySet> const& xPropSet,
453 rtl::OUString const& shapeType,
454 uno::Reference< drawing::XLayer> const& xLayer )
455 {
456 // skip empty presentation objects:
457 bool bEmpty = false;
458 if( getPropertyValue( bEmpty,
459 xPropSet,
460 OUSTR("IsEmptyPresentationObject")) &&
461 bEmpty )
462 {
463 return true;
464 }
465
466 //skip shapes which corresponds to annotations
467 if(xLayer.is())
468 {
469 rtl::OUString layerName;
470 uno::Reference<beans::XPropertySet> xPropLayerSet(
471 xLayer, uno::UNO_QUERY );
472 const uno::Any& a(xPropLayerSet->getPropertyValue(rtl::OUString::createFromAscii("Name")) );
473 bool const bRet = (a >>= layerName);
474 if(bRet)
475 {
476 if( layerName.equals(rtl::OUString::createFromAscii("DrawnInSlideshow")))
477 {
478 //Transform shapes into PolyPolygons
479 importPolygons(xPropSet);
480
481 return true;
482 }
483 }
484 }
485
486 // don't export presentation placeholders on masterpage
487 // they can be non empty when user edits the default texts
488 if(mbConvertingMasterPage)
489 {
490 if(shapeType.equalsAsciiL(
491 RTL_CONSTASCII_STRINGPARAM("com.sun.star.presentation."
492 "TitleTextShape") ) ||
493 shapeType.equalsAsciiL(
494 RTL_CONSTASCII_STRINGPARAM("com.sun.star.presentation."
495 "OutlinerShape") ))
496 {
497 return true;
498 }
499 }
500 return false;
501 }
502
503
importPolygons(uno::Reference<beans::XPropertySet> const & xPropSet)504 void ShapeImporter::importPolygons(uno::Reference<beans::XPropertySet> const& xPropSet) {
505
506 drawing::PointSequenceSequence aRetval;
507 sal_Int32 nLineColor=0;
508 double fLineWidth;
509 getPropertyValue( aRetval, xPropSet, OUSTR("PolyPolygon") );
510 getPropertyValue( nLineColor, xPropSet, OUSTR("LineColor") );
511 getPropertyValue( fLineWidth, xPropSet, OUSTR("LineWidth") );
512
513 drawing::PointSequence* pOuterSequence = aRetval.getArray();
514 awt::Point* pInnerSequence = pOuterSequence->getArray();
515
516 ::basegfx::B2DPolygon aPoly;
517 basegfx::B2DPoint aPoint;
518 for( sal_Int32 nCurrPoly=0; nCurrPoly<pOuterSequence->getLength(); ++nCurrPoly, ++pInnerSequence )
519 {
520 aPoint.setX((*pInnerSequence).X);
521 aPoint.setY((*pInnerSequence).Y);
522 aPoly.append( aPoint );
523 }
524 UnoViewVector::const_iterator aIter=(mrContext.mrViewContainer).begin();
525 UnoViewVector::const_iterator aEnd=(mrContext.mrViewContainer).end();
526 while(aIter != aEnd)
527 {
528 ::cppcanvas::PolyPolygonSharedPtr pPolyPoly(
529 ::cppcanvas::BaseGfxFactory::getInstance().createPolyPolygon( (*aIter)->getCanvas(),
530 aPoly ) );
531 if( pPolyPoly )
532 {
533 pPolyPoly->setRGBALineColor( unoColor2RGBColor( nLineColor ).getIntegerColor() );
534 pPolyPoly->setStrokeWidth(fLineWidth);
535 pPolyPoly->draw();
536 maPolygons.push_back(pPolyPoly);
537 }
538 aIter++;
539 }
540 }
541
importBackgroundShape()542 ShapeSharedPtr ShapeImporter::importBackgroundShape() // throw (ShapeLoadFailedException)
543 {
544 if( maShapesStack.empty() )
545 throw ShapeLoadFailedException();
546
547 XShapesEntry& rTop = maShapesStack.top();
548 ShapeSharedPtr pBgShape(
549 createBackgroundShape(mxPage,
550 uno::Reference<drawing::XDrawPage>(
551 rTop.mxShapes,
552 uno::UNO_QUERY_THROW),
553 mrContext) );
554 mnAscendingPrio += 1.0;
555
556 return pBgShape;
557 }
558
importShape()559 ShapeSharedPtr ShapeImporter::importShape() // throw (ShapeLoadFailedException)
560 {
561 ShapeSharedPtr pRet;
562 bool bIsGroupShape = false;
563
564 while( !maShapesStack.empty() && !pRet )
565 {
566 XShapesEntry& rTop = maShapesStack.top();
567 if( rTop.mnPos < rTop.mnCount )
568 {
569 uno::Reference<drawing::XShape> const xCurrShape(
570 rTop.mxShapes->getByIndex( rTop.mnPos ), uno::UNO_QUERY );
571 ++rTop.mnPos;
572 uno::Reference<beans::XPropertySet> xPropSet(
573 xCurrShape, uno::UNO_QUERY );
574 if( !xPropSet.is() )
575 {
576 // we definitely need the properties of
577 // the shape here. This will also fail,
578 // if getByIndex did not return a valid
579 // shape
580 throw ShapeLoadFailedException();
581 }
582
583 //Retrieve the layer for the current shape
584 uno::Reference< drawing::XLayer > xDrawnInSlideshow;
585
586 uno::Reference< drawing::XLayerSupplier > xLayerSupplier(mxPagesSupplier, uno::UNO_QUERY);
587 if(xLayerSupplier.is())
588 {
589 uno::Reference< container::XNameAccess > xNameAccess = xLayerSupplier->getLayerManager();
590
591 uno::Reference< drawing::XLayerManager > xLayerManager(xNameAccess, uno::UNO_QUERY);
592
593 xDrawnInSlideshow = xLayerManager->getLayerForShape(xCurrShape);
594 }
595
596 rtl::OUString const shapeType( xCurrShape->getShapeType());
597
598 // is this shape presentation-invisible?
599 if( !isSkip(xPropSet, shapeType, xDrawnInSlideshow) )
600 {
601 bIsGroupShape = shapeType.equalsAsciiL(
602 RTL_CONSTASCII_STRINGPARAM(
603 "com.sun.star.drawing.GroupShape") );
604
605 if( rTop.mpGroupShape ) // in group particle mode?
606 {
607 pRet.reset( new ShapeOfGroup(
608 rTop.mpGroupShape /* container shape */,
609 xCurrShape, xPropSet,
610 mnAscendingPrio ) );
611 }
612 else
613 {
614 pRet = createShape( xCurrShape, xPropSet, shapeType );
615 }
616 mnAscendingPrio += 1.0;
617 }
618 }
619 if( rTop.mnPos >= rTop.mnCount )
620 {
621 // group or top-level shapes finished:
622 maShapesStack.pop();
623 }
624 if( bIsGroupShape && pRet )
625 {
626 // push new group on the stack: group traversal
627 maShapesStack.push( XShapesEntry( pRet ) );
628 }
629 }
630
631 return pRet;
632 }
633
isImportDone() const634 bool ShapeImporter::isImportDone() const
635 {
636 return maShapesStack.empty();
637 }
638
getPolygons()639 PolyPolygonVector ShapeImporter::getPolygons()
640 {
641 return maPolygons;
642 }
643
ShapeImporter(uno::Reference<drawing::XDrawPage> const & xPage,uno::Reference<drawing::XDrawPage> const & xActualPage,uno::Reference<drawing::XDrawPagesSupplier> const & xPagesSupplier,const SlideShowContext & rContext,sal_Int32 nOrdNumStart,bool bConvertingMasterPage)644 ShapeImporter::ShapeImporter( uno::Reference<drawing::XDrawPage> const& xPage,
645 uno::Reference<drawing::XDrawPage> const& xActualPage,
646 uno::Reference<drawing::XDrawPagesSupplier> const& xPagesSupplier,
647 const SlideShowContext& rContext,
648 sal_Int32 nOrdNumStart,
649 bool bConvertingMasterPage ) :
650 mxPage( xActualPage ),
651 mxPagesSupplier( xPagesSupplier ),
652 mrContext( rContext ),
653 maPolygons(),
654 maShapesStack(),
655 mnAscendingPrio( nOrdNumStart ),
656 mbConvertingMasterPage( bConvertingMasterPage )
657 {
658 uno::Reference<drawing::XShapes> const xShapes(
659 xPage, uno::UNO_QUERY_THROW );
660 maShapesStack.push( XShapesEntry(xShapes) );
661 }
662
663 } // namespace internal
664 } // namespace presentation
665
666