summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2014-01-10 11:30:59 -0500
committerEike Rathke <erack@redhat.com>2014-01-10 18:56:36 +0000
commit3a9aad596ac874e086acc897edcf8fe0212d65a8 (patch)
tree1b455a5f7769a6484158db03a062a036009d34ca /svx
parent7ebac02b35700b7ca96e636d5729b65115c2c708 (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. (cherry picked from commit 10840ad753b60886ea5175060cb0ec2a77e1579a) (cherry picked from commit d1846cd8d4530d620b996f27a0ea7ab0c91639b5) Change-Id: I999160daf6fc9ce3d7e641f57b1998543df1cc4e Reviewed-on: https://gerrit.libreoffice.org/7379 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/unodraw/unoshap2.cxx39
1 files changed, 31 insertions, 8 deletions
diff --git a/svx/source/unodraw/unoshap2.cxx b/svx/source/unodraw/unoshap2.cxx
index 3d8370fabb0e..774b87d6b0bb 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
//----------------------------------------------------------------------