summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2014-04-25 19:56:36 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2014-07-02 23:26:31 +0200
commit1457f59505b42618c9576224d27d9e52402f94a9 (patch)
treebee3faac7c4a7c874c6a25ffe6dda805bade982d /svx
parente95df2193f698dcda5616e5523eae4d4cbf76fc9 (diff)
the chart root shape has to be at the bottom, fdo#74333, cp#1000057
Change-Id: Ic99fec987f290e94e4b45f4d193406daa2de4740
Diffstat (limited to 'svx')
-rw-r--r--svx/source/unodraw/unopage.cxx53
1 files changed, 51 insertions, 2 deletions
diff --git a/svx/source/unodraw/unopage.cxx b/svx/source/unodraw/unopage.cxx
index f23ab2ade122..d07b0b9bd0a8 100644
--- a/svx/source/unodraw/unopage.cxx
+++ b/svx/source/unodraw/unopage.cxx
@@ -232,6 +232,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 )
{
@@ -794,14 +838,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;