diff options
author | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-01-10 11:30:59 -0500 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-01-10 11:42:11 -0500 |
commit | 10840ad753b60886ea5175060cb0ec2a77e1579a (patch) | |
tree | 9e3d75d9f1d13423e5e30d8cc4f539be449abeb7 /svx | |
parent | fe23abd3812e08015facbbb2eb725dd990d63fa0 (diff) |
fdo#72005: Insert the border rectangle to the bottom of the stack.
This will make the border and fill shape to be drawn first, then everything
else drawn on top.
This commit may look large, but it's actually a very trivial change. The
important part is in SvxShapeGroup where new methods have been added to allow
different insertion positions for the new shapes being inserted, and have
the chart2 code make use of it to insert the fill rectangle to the bottom
rather than to the top.
Change-Id: I999160daf6fc9ce3d7e641f57b1998543df1cc4e
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/unodraw/unoshap2.cxx | 39 |
1 files changed, 31 insertions, 8 deletions
diff --git a/svx/source/unodraw/unoshap2.cxx b/svx/source/unodraw/unoshap2.cxx index ec959efbc193..a3c42bdebca3 100644 --- a/svx/source/unodraw/unoshap2.cxx +++ b/svx/source/unodraw/unoshap2.cxx @@ -106,6 +106,7 @@ uno::Any SAL_CALL SvxShapeGroup::queryAggregation( const uno::Type & rType ) thr QUERYINT( drawing::XShapeGroup ); else QUERYINT( drawing::XShapes ); + else QUERYINT( drawing::XShapes2 ); else QUERYINT( container::XIndexAccess ); else QUERYINT( container::XElementAccess ); else @@ -192,14 +193,8 @@ void SAL_CALL SvxShapeGroup::leaveGroup( ) throw(uno::RuntimeException) // pDrView->LeaveOneGroup(); } -//---------------------------------------------------------------------- - -// XShapes -void SAL_CALL SvxShapeGroup::add( const uno::Reference< drawing::XShape >& xShape ) - throw( uno::RuntimeException ) +void SvxShapeGroup::addUnoShape( const uno::Reference< drawing::XShape >& xShape, sal_uIntPtr nPos ) { - ::SolarMutexGuard aGuard; - SvxShape* pShape = SvxShape::getImplementation( xShape ); if( mpObj.is()&& mxPage.is() && pShape ) @@ -211,7 +206,7 @@ void SAL_CALL SvxShapeGroup::add( const uno::Reference< drawing::XShape >& xShap if( pSdrShape->IsInserted() ) pSdrShape->GetObjList()->RemoveObject( pSdrShape->GetOrdNum() ); - mpObj->GetSubList()->InsertObject( pSdrShape ); + mpObj->GetSubList()->InsertObject(pSdrShape, nPos); pSdrShape->SetModel(mpObj->GetModel()); // #85922# It makes no sense to set the layer asked @@ -236,6 +231,16 @@ void SAL_CALL SvxShapeGroup::add( const uno::Reference< drawing::XShape >& xShap } } +// XShapes +void SAL_CALL SvxShapeGroup::add( const uno::Reference< drawing::XShape >& xShape ) + throw( uno::RuntimeException ) +{ + ::SolarMutexGuard aGuard; + + // Add to the top of the stack (i.e. bottom of the list) by default. + addUnoShape(xShape, 0xFFFF); +} + //---------------------------------------------------------------------- void SAL_CALL SvxShapeGroup::remove( const uno::Reference< drawing::XShape >& xShape ) throw( uno::RuntimeException ) @@ -289,6 +294,24 @@ void SAL_CALL SvxShapeGroup::remove( const uno::Reference< drawing::XShape >& xS mpModel->SetChanged(); } +void SAL_CALL SvxShapeGroup::addTop( const uno::Reference< drawing::XShape >& xShape ) + throw( uno::RuntimeException ) +{ + SolarMutexGuard aGuard; + + // Add to the top of the stack (i.e. bottom of the list). + addUnoShape(xShape, 0xFFFF); +} + +void SAL_CALL SvxShapeGroup::addBottom( const uno::Reference< drawing::XShape >& xShape ) + throw( uno::RuntimeException ) +{ + SolarMutexGuard aGuard; + + // Add to the bottom of the stack (i.e. top of the list). + addUnoShape(xShape, 0); +} + // XIndexAccess //---------------------------------------------------------------------- |