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 ...@@ -63,16 +63,12 @@ CGMImpressOutAct::CGMImpressOutAct( CGM& rCGM, const uno::Reference< frame::XMod
maXDrawPages = aDrawPageSup->getDrawPages(); maXDrawPages = aDrawPageSup->getDrawPages();
if ( maXDrawPages.is() ) if ( maXDrawPages.is() )
{ {
maXServiceManagerSC = comphelper::getProcessServiceFactory(); maXMultiServiceFactory.set( rModel, uno::UNO_QUERY);
if ( maXServiceManagerSC.is() ) if( maXMultiServiceFactory.is() )
{ {
uno::Any aAny( rModel->queryInterface( ::getCppuType((const uno::Reference< lang::XMultiServiceFactory >*)0) )); maXDrawPage = *(uno::Reference< drawing::XDrawPage > *)maXDrawPages->getByIndex( 0 ).getValue();
if( aAny >>= maXMultiServiceFactory ) 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() ...@@ -437,11 +433,10 @@ void CGMImpressOutAct::EndGroup()
if ( ( mnCurrentCount - mnFirstIndex ) > 1 ) if ( ( mnCurrentCount - mnFirstIndex ) > 1 )
{ {
uno::Reference< drawing::XShapeGrouper > aXShapeGrouper; uno::Reference< drawing::XShapeGrouper > aXShapeGrouper;
uno::Any aAny( maXDrawPage->queryInterface( ::getCppuType(((const uno::Reference< drawing::XShapeGrouper >*)0) ))); aXShapeGrouper.set( maXDrawPage, uno::UNO_QUERY );
if( aAny >>= aXShapeGrouper ) if( aXShapeGrouper.is() )
{ {
uno::Reference< drawing::XShapes > aXShapes( uno::Reference< drawing::XShapes > aXShapes = drawing::ShapeCollection::create(comphelper::getProcessComponentContext());
drawing::ShapeCollection::create(comphelper::getComponentContext(maXServiceManagerSC)) );
for ( sal_uInt32 i = mnFirstIndex; i < mnCurrentCount; i++ ) for ( sal_uInt32 i = mnFirstIndex; i < mnCurrentCount; i++ )
{ {
uno::Reference< drawing::XShape > aXShape = *(uno::Reference< drawing::XShape > *)maXShapes->getByIndex( i ).getValue(); uno::Reference< drawing::XShape > aXShape = *(uno::Reference< drawing::XShape > *)maXShapes->getByIndex( i ).getValue();
......
...@@ -97,9 +97,7 @@ class CGMImpressOutAct : public CGMOutAct ...@@ -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::XDrawPages > maXDrawPages;
::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage > maXDrawPage; ::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 > maXMultiServiceFactory;
::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > maXServiceManagerSC;
::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > maXShape; ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > maXShape;
sal_Bool ImplCreateShape( const ::rtl::OUString& rType ); 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