summaryrefslogtreecommitdiff
path: root/slideshow/source/engine/shapes/drawshape.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'slideshow/source/engine/shapes/drawshape.cxx')
-rw-r--r--slideshow/source/engine/shapes/drawshape.cxx208
1 files changed, 104 insertions, 104 deletions
diff --git a/slideshow/source/engine/shapes/drawshape.cxx b/slideshow/source/engine/shapes/drawshape.cxx
index e018c8015b0a..605532f3673e 100644
--- a/slideshow/source/engine/shapes/drawshape.cxx
+++ b/slideshow/source/engine/shapes/drawshape.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -92,7 +92,7 @@ namespace slideshow
//#i75867# poor quality of ole's alternative view with 3D scenes and zoomfactors besides 100%
//metafiles are resolution dependent when bitmaps are contained with is the case for 3D scenes for example
//in addition a chart has resolution dependent content as it might skip points that are not visible for a given resolution (this is done for performance reasons)
- bool local_getMetafileForChart( const uno::Reference< lang::XComponent >& xSource,
+ bool local_getMetafileForChart( const uno::Reference< lang::XComponent >& xSource,
const uno::Reference< drawing::XDrawPage >& xContainingPage,
GDIMetaFile& rMtf )
{
@@ -156,7 +156,7 @@ namespace slideshow
if(nMaxPixWidth>1 && nMaxPixHeight>1)
aPixelPerChart = awt::Size( nMaxPixWidth, nMaxPixHeight );//this is still to much (but costs only seldom performance), correct would be pixel per chart object
}
-
+
try
{
uno::Sequence< beans::PropertyValue > aZoomFactors(4);
@@ -172,7 +172,7 @@ namespace slideshow
xChartViewProp->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ZoomFactors") ), uno::makeAny( aZoomFactors ));
xChartViewProp->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Resolution") ), uno::makeAny( aPixelPerChart ));
}
- catch (uno::Exception &)
+ catch (uno::Exception &)
{
OSL_ENSURE( false, rtl::OUStringToOString(
comphelper::anyToString(
@@ -198,7 +198,7 @@ namespace slideshow
//same as getMetafile with an exception for charts
//for charts a metafile with a higher resolution is created, because charts have resolution dependent content
- bool local_getMetaFile_WithSpecialChartHandling( const uno::Reference< lang::XComponent >& xSource,
+ bool local_getMetaFile_WithSpecialChartHandling( const uno::Reference< lang::XComponent >& xSource,
const uno::Reference< drawing::XDrawPage >& xContainingPage,
GDIMetaFile& rMtf,
int mtfLoadFlags,
@@ -221,7 +221,7 @@ namespace slideshow
GDIMetaFileSharedPtr DrawShape::forceScrollTextMetaFile()
{
- if ((mnCurrMtfLoadFlags & MTF_LOAD_SCROLL_TEXT_MTF) != MTF_LOAD_SCROLL_TEXT_MTF)
+ if ((mnCurrMtfLoadFlags & MTF_LOAD_SCROLL_TEXT_MTF) != MTF_LOAD_SCROLL_TEXT_MTF)
{
// reload with added flags:
mpCurrMtf.reset( new GDIMetaFile );
@@ -235,13 +235,13 @@ namespace slideshow
// never contain any verbose text comments. Thus,
// can only display the full mtf content, no
// subsets.
- maSubsetting.reset( mpCurrMtf );
+ maSubsetting.reset( mpCurrMtf );
// adapt maBounds. the requested scroll text metafile
// will typically have dimension different from the
// actual shape
::basegfx::B2DRectangle aScrollRect, aPaintRect;
- ENSURE_OR_THROW( getRectanglesFromScrollMtf( aScrollRect,
+ ENSURE_OR_THROW( getRectanglesFromScrollMtf( aScrollRect,
aPaintRect,
mpCurrMtf ),
"DrawShape::forceScrollTextMetaFile(): Could "
@@ -257,7 +257,7 @@ namespace slideshow
}
return mpCurrMtf;
}
-
+
void DrawShape::updateStateIds() const
{
// Update the states, we've just redrawn or created a new
@@ -350,12 +350,12 @@ namespace slideshow
_1,
::boost::cref( mpCurrMtf ),
::boost::cref(
- getViewRenderArgs() ),
+ getViewRenderArgs() ),
nUpdateFlags,
- isVisible() ) )
+ isVisible() ) )
!= static_cast<ViewShapeVector::difference_type>(maViewShapes.size()) )
{
- // at least one of the ViewShape::update() calls did return
+ // at least one of the ViewShape::update() calls did return
// false - update failed on at least one ViewLayer
return false;
}
@@ -397,7 +397,7 @@ namespace slideshow
nUpdateFlags |= ViewShape::CONTENT;
}
- // TODO(P1): This can be done without conditional branching.
+ // TODO(P1): This can be done without conditional branching.
// See HAKMEM.
if( mpAttributeLayer->getPositionState() != mnAttributePositionState )
{
@@ -412,11 +412,11 @@ namespace slideshow
nUpdateFlags |= ViewShape::CLIP;
}
if( mpAttributeLayer->getTransformationState() != mnAttributeTransformationState )
- {
+ {
nUpdateFlags |= ViewShape::TRANSFORMATION;
}
if( mpAttributeLayer->getContentState() != mnAttributeContentState )
- {
+ {
nUpdateFlags |= ViewShape::CONTENT;
}
}
@@ -430,7 +430,7 @@ namespace slideshow
ENSURE_OR_THROW( !maViewShapes.empty(),
"DrawShape::getActualUnitShapeBounds(): called on DrawShape without views" );
- const VectorOfDocTreeNodes& rSubsets(
+ const VectorOfDocTreeNodes& rSubsets(
maSubsetting.getActiveSubsets() );
const ::basegfx::B2DRectangle aDefaultBounds( 0.0,0.0,1.0,1.0 );
@@ -467,15 +467,15 @@ namespace slideshow
// added or removed). Maybe we should exclude it here,
// always assuming full bounds?
- ::cppcanvas::CanvasSharedPtr pDestinationCanvas(
+ ::cppcanvas::CanvasSharedPtr pDestinationCanvas(
maViewShapes.front()->getViewLayer()->getCanvas() );
// TODO(Q2): Although this _is_ currently
// view-agnostic, it might not stay like
// that. Maybe this method should again be moved
// to the ViewShape
- ::cppcanvas::RendererSharedPtr pRenderer(
- maViewShapes.front()->getRenderer(
+ ::cppcanvas::RendererSharedPtr pRenderer(
+ maViewShapes.front()->getRenderer(
pDestinationCanvas, mpCurrMtf, mpAttributeLayer ) );
// If we cannot not prefetch, be defensive and assume
@@ -485,11 +485,11 @@ namespace slideshow
// temporarily, switch total transformation to identity
// (need the bounds in the [0,1]x[0,1] unit coordinate
// system.
- ::basegfx::B2DHomMatrix aEmptyTransformation;
+ ::basegfx::B2DHomMatrix aEmptyTransformation;
- ::basegfx::B2DHomMatrix aOldTransform( pDestinationCanvas->getTransformation() );
+ ::basegfx::B2DHomMatrix aOldTransform( pDestinationCanvas->getTransformation() );
pDestinationCanvas->setTransformation( aEmptyTransformation );
- pRenderer->setTransformation( aEmptyTransformation );
+ pRenderer->setTransformation( aEmptyTransformation );
// restore old transformation when leaving the scope
const ::comphelper::ScopeGuard aGuard(
@@ -504,16 +504,16 @@ namespace slideshow
// cannot use ::boost::bind, ::basegfx::B2DRange::expand()
// is overloaded.
- VectorOfDocTreeNodes::const_iterator aCurr( rSubsets.begin() );
- const VectorOfDocTreeNodes::const_iterator aEnd( rSubsets.end() );
+ VectorOfDocTreeNodes::const_iterator aCurr( rSubsets.begin() );
+ const VectorOfDocTreeNodes::const_iterator aEnd( rSubsets.end() );
while( aCurr != aEnd )
{
- aTotalBounds.expand( pRenderer->getSubsetArea(
+ aTotalBounds.expand( pRenderer->getSubsetArea(
aCurr->getStartIndex(),
aCurr->getEndIndex() ) );
++aCurr;
}
-
+
OSL_ENSURE( aTotalBounds.getMinX() >= -0.1 &&
aTotalBounds.getMinY() >= -0.1 &&
aTotalBounds.getMaxX() <= 1.1 &&
@@ -524,7 +524,7 @@ namespace slideshow
// original bounds (there _are_ some pathologic cases,
// especially when imported from PPT, that have
// e.g. obscenely large polygon bounds)
- aTotalBounds.intersect(
+ aTotalBounds.intersect(
::basegfx::B2DRange( 0.0, 0.0,
1.0, 1.0 ));
@@ -536,10 +536,10 @@ namespace slideshow
}
}
- DrawShape::DrawShape( const uno::Reference< drawing::XShape >& xShape,
- const uno::Reference< drawing::XDrawPage >& xContainingPage,
- double nPrio,
- bool bForeignSource,
+ DrawShape::DrawShape( const uno::Reference< drawing::XShape >& xShape,
+ const uno::Reference< drawing::XDrawPage >& xContainingPage,
+ double nPrio,
+ bool bForeignSource,
const SlideShowContext& rContext ) :
mxShape( xShape ),
mxPage( xContainingPage ),
@@ -574,16 +574,16 @@ namespace slideshow
{
ENSURE_OR_THROW( mxShape.is(), "DrawShape::DrawShape(): Invalid XShape" );
ENSURE_OR_THROW( mxPage.is(), "DrawShape::DrawShape(): Invalid containing page" );
-
+
// check for drawing layer animations:
drawing::TextAnimationKind eKind = drawing::TextAnimationKind_NONE;
- uno::Reference<beans::XPropertySet> xPropSet( mxShape,
+ uno::Reference<beans::XPropertySet> xPropSet( mxShape,
uno::UNO_QUERY );
if( xPropSet.is() )
getPropertyValue( eKind, xPropSet,
OUSTR("TextAnimationKind") );
mbDrawingLayerAnim = (eKind != drawing::TextAnimationKind_NONE);
-
+
// must NOT be called from within initializer list, uses
// state from mnCurrMtfLoadFlags!
mpCurrMtf.reset( new GDIMetaFile );
@@ -594,14 +594,14 @@ namespace slideshow
ENSURE_OR_THROW( mpCurrMtf,
"DrawShape::DrawShape(): Invalid metafile" );
maSubsetting.reset( mpCurrMtf );
-
+
prepareHyperlinkIndices();
}
- DrawShape::DrawShape( const uno::Reference< drawing::XShape >& xShape,
- const uno::Reference< drawing::XDrawPage >& xContainingPage,
- double nPrio,
- const Graphic& rGraphic,
+ DrawShape::DrawShape( const uno::Reference< drawing::XShape >& xShape,
+ const uno::Reference< drawing::XDrawPage >& xContainingPage,
+ double nPrio,
+ const Graphic& rGraphic,
const SlideShowContext& rContext ) :
mxShape( xShape ),
mxPage( xContainingPage ),
@@ -651,9 +651,9 @@ namespace slideshow
ENSURE_OR_THROW( mpCurrMtf, "DrawShape::DrawShape(): Invalid metafile" );
}
- DrawShape::DrawShape( const DrawShape& rSrc,
- const DocTreeNode& rTreeNode,
- double nPrio ) :
+ DrawShape::DrawShape( const DrawShape& rSrc,
+ const DocTreeNode& rTreeNode,
+ double nPrio ) :
mxShape( rSrc.mxShape ),
mxPage( rSrc.mxPage ),
maAnimationFrames(), // don't copy animations for subsets,
@@ -690,7 +690,7 @@ namespace slideshow
// xxx todo: currently not implemented for subsetted shapes;
// would mean modifying set of hyperlink regions when
- // subsetting text portions. N.B.: there's already an
+ // subsetting text portions. N.B.: there's already an
// issue for this #i72828#
}
@@ -701,10 +701,10 @@ namespace slideshow
//////////////////////////////////////////////////////////////////////
DrawShapeSharedPtr DrawShape::create(
- const uno::Reference< drawing::XShape >& xShape,
- const uno::Reference< drawing::XDrawPage >& xContainingPage,
- double nPrio,
- bool bForeignSource,
+ const uno::Reference< drawing::XShape >& xShape,
+ const uno::Reference< drawing::XDrawPage >& xContainingPage,
+ double nPrio,
+ bool bForeignSource,
const SlideShowContext& rContext )
{
DrawShapeSharedPtr pShape( new DrawShape(xShape,
@@ -716,10 +716,10 @@ namespace slideshow
if( pShape->hasIntrinsicAnimation() )
{
OSL_ASSERT( pShape->maAnimationFrames.empty() );
- if( pShape->getNumberOfTreeNodes(
+ if( pShape->getNumberOfTreeNodes(
DocTreeNode::NODETYPE_LOGICAL_PARAGRAPH) > 0 )
{
- pShape->mpIntrinsicAnimationActivity =
+ pShape->mpIntrinsicAnimationActivity =
createDrawingLayerAnimActivity(
rContext,
pShape);
@@ -732,17 +732,17 @@ namespace slideshow
return pShape;
}
- DrawShapeSharedPtr DrawShape::create(
- const uno::Reference< drawing::XShape >& xShape,
- const uno::Reference< drawing::XDrawPage >& xContainingPage,
- double nPrio,
- const Graphic& rGraphic,
+ DrawShapeSharedPtr DrawShape::create(
+ const uno::Reference< drawing::XShape >& xShape,
+ const uno::Reference< drawing::XDrawPage >& xContainingPage,
+ double nPrio,
+ const Graphic& rGraphic,
const SlideShowContext& rContext )
{
- DrawShapeSharedPtr pShape( new DrawShape(xShape,
- xContainingPage,
- nPrio,
- rGraphic,
+ DrawShapeSharedPtr pShape( new DrawShape(xShape,
+ xContainingPage,
+ nPrio,
+ rGraphic,
rContext) );
if( pShape->hasIntrinsicAnimation() )
@@ -755,12 +755,12 @@ namespace slideshow
pShape->maAnimationFrames.end(),
std::back_insert_iterator< std::vector<double> >( aTimeout ),
boost::mem_fn(&MtfAnimationFrame::getDuration) );
-
+
WakeupEventSharedPtr pWakeupEvent(
new WakeupEvent( rContext.mrEventQueue.getTimer(),
rContext.mrActivitiesQueue ) );
-
- ActivitySharedPtr pActivity =
+
+ ActivitySharedPtr pActivity =
createIntrinsicAnimationActivity(
rContext,
pShape,
@@ -772,7 +772,7 @@ namespace slideshow
pWakeupEvent->setActivity( pActivity );
pShape->mpIntrinsicAnimationActivity = pActivity;
}
-
+
OSL_ENSURE( !pShape->hasHyperlinks(),
"DrawShape::create(): graphic-only shapes must not have hyperlinks!" );
@@ -783,13 +783,13 @@ namespace slideshow
{
try
{
- // dispose intrinsic animation activity, else, it will
- // linger forever
+ // dispose intrinsic animation activity, else, it will
+ // linger forever
ActivitySharedPtr pActivity( mpIntrinsicAnimationActivity.lock() );
if( pActivity )
pActivity->dispose();
}
- catch (uno::Exception &)
+ catch (uno::Exception &)
{
OSL_ENSURE( false, rtl::OUStringToOString(
comphelper::anyToString(
@@ -804,14 +804,14 @@ namespace slideshow
}
void DrawShape::addViewLayer( const ViewLayerSharedPtr& rNewLayer,
- bool bRedrawLayer )
+ bool bRedrawLayer )
{
ViewShapeVector::iterator aEnd( maViewShapes.end() );
// already added?
- if( ::std::find_if( maViewShapes.begin(),
- aEnd,
- ::boost::bind<bool>(
+ if( ::std::find_if( maViewShapes.begin(),
+ aEnd,
+ ::boost::bind<bool>(
::std::equal_to< ViewLayerSharedPtr >(),
::boost::bind( &ViewShape::getViewLayer,
_1 ),
@@ -835,9 +835,9 @@ namespace slideshow
// render the Shape on the newly added ViewLayer
if( bRedrawLayer )
{
- pNewShape->update( mpCurrMtf,
+ pNewShape->update( mpCurrMtf,
getViewRenderArgs(),
- ViewShape::FORCE,
+ ViewShape::FORCE,
isVisible() );
}
}
@@ -846,9 +846,9 @@ namespace slideshow
{
const ViewShapeVector::iterator aEnd( maViewShapes.end() );
- OSL_ENSURE( ::std::count_if(maViewShapes.begin(),
- aEnd,
- ::boost::bind<bool>(
+ OSL_ENSURE( ::std::count_if(maViewShapes.begin(),
+ aEnd,
+ ::boost::bind<bool>(
::std::equal_to< ViewLayerSharedPtr >(),
::boost::bind( &ViewShape::getViewLayer,
_1 ),
@@ -857,9 +857,9 @@ namespace slideshow
ViewShapeVector::iterator aIter;
- if( (aIter=::std::remove_if( maViewShapes.begin(),
- aEnd,
- ::boost::bind<bool>(
+ if( (aIter=::std::remove_if( maViewShapes.begin(),
+ aEnd,
+ ::boost::bind<bool>(
::std::equal_to< ViewLayerSharedPtr >(),
::boost::bind( &ViewShape::getViewLayer,
_1 ),
@@ -905,8 +905,8 @@ namespace slideshow
bool DrawShape::isContentChanged() const
{
- return mbForceUpdate ?
- true :
+ return mbForceUpdate ?
+ true :
getUpdateFlags() != ViewShape::NONE;
}
@@ -935,7 +935,7 @@ namespace slideshow
*/
class Expander
{
- public:
+ public:
Expander( ::basegfx::B2DSize& rBounds ) :
mrBounds( rBounds )
{
@@ -945,11 +945,11 @@ namespace slideshow
{
const ::basegfx::B2DSize& rShapeBorder( rShape->getAntialiasingBorder() );
- mrBounds.setX(
+ mrBounds.setX(
::std::max(
rShapeBorder.getX(),
mrBounds.getX() ) );
- mrBounds.setY(
+ mrBounds.setY(
::std::max(
rShapeBorder.getY(),
mrBounds.getY() ) );
@@ -1144,7 +1144,7 @@ namespace slideshow
{
return ! maHyperlinkRegions.empty();
}
-
+
HyperlinkArea::HyperlinkRegions DrawShape::getHyperlinkRegions() const
{
OSL_ASSERT( !maViewShapes.empty() );
@@ -1167,13 +1167,13 @@ namespace slideshow
pViewShape->getViewLayer()->getCanvas() );
// reuse Renderer of first view shape:
- cppcanvas::RendererSharedPtr const pRenderer(
+ cppcanvas::RendererSharedPtr const pRenderer(
pViewShape->getRenderer(
pCanvas, mpCurrMtf, mpAttributeLayer ) );
OSL_ASSERT( pRenderer );
- if (pRenderer)
+ if (pRenderer)
{
basegfx::B2DHomMatrix const aOldTransform(
pCanvas->getTransformation() );
@@ -1189,8 +1189,8 @@ namespace slideshow
maBounds.getHeight() );
pRenderer->setTransformation( aTransform );
pRenderer->setClip();
-
- for( std::size_t pos = maHyperlinkRegions.size(); pos--; )
+
+ for( std::size_t pos = maHyperlinkRegions.size(); pos--; )
{
// get region:
HyperlinkIndexPair const& rIndices = maHyperlinkIndices[pos];
@@ -1291,7 +1291,7 @@ namespace slideshow
{
// it's the toplevel layer
mpAttributeLayer = mpAttributeLayer->getChildLayer();
-
+
// force content redraw, all state variables have
// possibly changed
mbAttributeLayerRevoked = true;
@@ -1341,13 +1341,13 @@ namespace slideshow
{
ENSURE_OR_THROW( (mnCurrMtfLoadFlags & MTF_LOAD_VERBOSE_COMMENTS) != 0,
"DrawShape::getSubset(): subset query on shape with apparently no subsets" );
-
+
// forward to delegate
return maSubsetting.getSubsetShape( rTreeNode );
}
- bool DrawShape::createSubset( AttributableShapeSharedPtr& o_rSubset,
- const DocTreeNode& rTreeNode )
+ bool DrawShape::createSubset( AttributableShapeSharedPtr& o_rSubset,
+ const DocTreeNode& rTreeNode )
{
ENSURE_OR_THROW( (mnCurrMtfLoadFlags & MTF_LOAD_VERBOSE_COMMENTS) != 0,
"DrawShape::createSubset(): subset query on shape with apparently no subsets" );
@@ -1368,14 +1368,14 @@ namespace slideshow
else
{
// not yet created, init entry
- o_rSubset.reset( new DrawShape( *this,
- rTreeNode,
+ o_rSubset.reset( new DrawShape( *this,
+ rTreeNode,
// TODO(Q3): That's a
// hack. We assume
// that start and end
// index will always
// be less than 65535
- mnPriority +
+ mnPriority +
rTreeNode.getStartIndex()/double(SAL_MAX_INT16) ));
bNewlyCreated = true; // subset newly created
@@ -1384,7 +1384,7 @@ namespace slideshow
// always register shape at DrawShapeSubsetting, to keep
// refcount up-to-date
maSubsetting.addSubsetShape( o_rSubset );
-
+
// flush bounds cache
maCurrentShapeUnitBounds.reset();
@@ -1408,7 +1408,7 @@ namespace slideshow
mbForceUpdate = true;
// #i47428# TEMP FIX: synchronize visibility of subset
- // with parent.
+ // with parent.
// TODO(F3): Remove here, and implement
// TEXT_ONLY/BACKGROUND_ONLY with the proverbial
@@ -1416,7 +1416,7 @@ namespace slideshow
// persistent subset, containing all text/only the
// background respectively. From _that_ object,
// generate the temporary character subset shapes.
- const ShapeAttributeLayerSharedPtr& rAttrLayer(
+ const ShapeAttributeLayerSharedPtr& rAttrLayer(
rShape->getTopmostAttributeLayer() );
if( rAttrLayer &&
rAttrLayer->isVisibilityValid() &&
@@ -1430,7 +1430,7 @@ namespace slideshow
else
mbIsVisible = bVisibility;
}
-
+
// END TEMP FIX
return true;
@@ -1446,8 +1446,8 @@ namespace slideshow
return maSubsetting.getNumberOfTreeNodes( eNodeType );
}
- DocTreeNode DrawShape::getTreeNode( sal_Int32 nNodeIndex,
- DocTreeNode::NodeType eNodeType ) const // throw ShapeLoadFailedException
+ DocTreeNode DrawShape::getTreeNode( sal_Int32 nNodeIndex,
+ DocTreeNode::NodeType eNodeType ) const // throw ShapeLoadFailedException
{
ensureVerboseMtfComments();
@@ -1459,7 +1459,7 @@ namespace slideshow
return maSubsetting.getTreeNode( nNodeIndex, eNodeType );
}
- sal_Int32 DrawShape::getNumberOfSubsetTreeNodes ( const DocTreeNode& rParentNode,
+ sal_Int32 DrawShape::getNumberOfSubsetTreeNodes ( const DocTreeNode& rParentNode,
DocTreeNode::NodeType eNodeType ) const // throw ShapeLoadFailedException
{
ensureVerboseMtfComments();
@@ -1467,9 +1467,9 @@ namespace slideshow
return maSubsetting.getNumberOfSubsetTreeNodes( rParentNode, eNodeType );
}
- DocTreeNode DrawShape::getSubsetTreeNode( const DocTreeNode& rParentNode,
- sal_Int32 nNodeIndex,
- DocTreeNode::NodeType eNodeType ) const // throw ShapeLoadFailedException
+ DocTreeNode DrawShape::getSubsetTreeNode( const DocTreeNode& rParentNode,
+ sal_Int32 nNodeIndex,
+ DocTreeNode::NodeType eNodeType ) const // throw ShapeLoadFailedException
{
ensureVerboseMtfComments();