Kaydet (Commit) 81c967e0 authored tarafından Noel Grandin's avatar Noel Grandin

fdo#46808, Convert to getProcessComponentContext()

Also clean up some weird UNO type casting.

Change-Id: I62e3813e917ec49fcd3ff444209e2234207a6f9d
üst b5cd8f91
......@@ -63,16 +63,12 @@ CGMImpressOutAct::CGMImpressOutAct( CGM& rCGM, const uno::Reference< frame::XMod
maXDrawPages = aDrawPageSup->getDrawPages();
if ( maXDrawPages.is() )
{
maXServiceManagerSC = comphelper::getProcessServiceFactory();
if ( maXServiceManagerSC.is() )
maXMultiServiceFactory.set( rModel, uno::UNO_QUERY);
if( maXMultiServiceFactory.is() )
{
uno::Any aAny( rModel->queryInterface( ::getCppuType((const uno::Reference< lang::XMultiServiceFactory >*)0) ));
if( aAny >>= maXMultiServiceFactory )
{
maXDrawPage = *(uno::Reference< drawing::XDrawPage > *)maXDrawPages->getByIndex( 0 ).getValue();
if ( ImplInitPage() )
bStatRet = sal_True;
}
maXDrawPage = *(uno::Reference< drawing::XDrawPage > *)maXDrawPages->getByIndex( 0 ).getValue();
if ( ImplInitPage() )
bStatRet = sal_True;
}
}
}
......@@ -437,11 +433,10 @@ void CGMImpressOutAct::EndGroup()
if ( ( mnCurrentCount - mnFirstIndex ) > 1 )
{
uno::Reference< drawing::XShapeGrouper > aXShapeGrouper;
uno::Any aAny( maXDrawPage->queryInterface( ::getCppuType(((const uno::Reference< drawing::XShapeGrouper >*)0) )));
if( aAny >>= aXShapeGrouper )
aXShapeGrouper.set( maXDrawPage, uno::UNO_QUERY );
if( aXShapeGrouper.is() )
{
uno::Reference< drawing::XShapes > aXShapes(
drawing::ShapeCollection::create(comphelper::getComponentContext(maXServiceManagerSC)) );
uno::Reference< drawing::XShapes > aXShapes = drawing::ShapeCollection::create(comphelper::getProcessComponentContext());
for ( sal_uInt32 i = mnFirstIndex; i < mnCurrentCount; i++ )
{
uno::Reference< drawing::XShape > aXShape = *(uno::Reference< drawing::XShape > *)maXShapes->getByIndex( i ).getValue();
......
......@@ -97,9 +97,7 @@ class CGMImpressOutAct : public CGMOutAct
::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPages > maXDrawPages;
::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage > maXDrawPage;
// ::com::sun::star::uno::Reference< XServiceRegistry > maXServiceRegistry;
::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > maXMultiServiceFactory;
::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > maXServiceManagerSC;
::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > maXShape;
sal_Bool ImplCreateShape( const ::rtl::OUString& rType );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment