diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2014-04-25 19:56:36 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2014-04-25 20:03:48 +0200 |
commit | 3b2ec44912ca2e0548d8078d2edf17fa10856553 (patch) | |
tree | d90a1f26a3a85799a9cfeef3167a98e7b3afa819 /svx/source | |
parent | 12ace5060dbef6add5521fb932d78e7807c793be (diff) |
the chart root shape has to be at the bottom, fdo#74333, cp#1000057
Change-Id: Ic99fec987f290e94e4b45f4d193406daa2de4740
Diffstat (limited to 'svx/source')
-rw-r--r-- | svx/source/unodraw/unopage.cxx | 53 |
1 files changed, 51 insertions, 2 deletions
diff --git a/svx/source/unodraw/unopage.cxx b/svx/source/unodraw/unopage.cxx index cf8b8242dc2d..d8466abf0f04 100644 --- a/svx/source/unodraw/unopage.cxx +++ b/svx/source/unodraw/unopage.cxx @@ -231,6 +231,50 @@ void SAL_CALL SvxDrawPage::add( const uno::Reference< drawing::XShape >& xShape mpModel->SetChanged(); } +void SAL_CALL SvxDrawPage::addTop( const uno::Reference< drawing::XShape >& xShape ) + throw( uno::RuntimeException, std::exception ) +{ + add(xShape); +} + +void SAL_CALL SvxDrawPage::addBottom( const uno::Reference< drawing::XShape >& xShape ) + throw( uno::RuntimeException, std::exception ) +{ + SolarMutexGuard aGuard; + + if ( ( mpModel == NULL ) || ( mpPage == NULL ) ) + throw lang::DisposedException(); + + SvxShape* pShape = SvxShape::getImplementation( xShape ); + + if( NULL == pShape ) + return; + + SdrObject *pObj = pShape->GetSdrObject(); + + if(!pObj) + { + pObj = CreateSdrObject( xShape, true ); + ENSURE_OR_RETURN_VOID( pObj != NULL, "SvxDrawPage::add: no SdrObject was created!" ); + } + else if ( !pObj->IsInserted() ) + { + pObj->SetModel(mpModel); + mpPage->InsertObject( pObj, 0 ); + } + + pShape->Create( pObj, this ); + OSL_ENSURE( pShape->GetSdrObject() == pObj, "SvxDrawPage::add: shape does not know about its newly created SdrObject!" ); + + if ( !pObj->IsInserted() ) + { + pObj->SetModel(mpModel); + mpPage->InsertObject( pObj, 0 ); + } + + mpModel->SetChanged(); +} + void SAL_CALL SvxDrawPage::remove( const Reference< drawing::XShape >& xShape ) throw (uno::RuntimeException, std::exception) { @@ -802,14 +846,19 @@ Reference< drawing::XShape > SvxDrawPage::_CreateShape( SdrObject *pObj ) const return xShape; } -SdrObject *SvxDrawPage::CreateSdrObject( const Reference< drawing::XShape > & xShape ) throw() +SdrObject *SvxDrawPage::CreateSdrObject( const Reference< drawing::XShape > & xShape, bool bBeginning ) throw() { SdrObject* pObj = _CreateSdrObject( xShape ); if( pObj) { pObj->SetModel(mpModel); if ( !pObj->IsInserted() && !pObj->IsDoNotInsertIntoPageAutomatically() ) - mpPage->InsertObject( pObj ); + { + if(bBeginning) + mpPage->InsertObject( pObj, 0 ); + else + mpPage->InsertObject( pObj ); + } } return pObj; |