diff options
author | sj <sj@openoffice.org> | 2010-09-29 16:18:54 +0200 |
---|---|---|
committer | sj <sj@openoffice.org> | 2010-09-29 16:18:54 +0200 |
commit | 74686377ec36c4fbfa4b84063bfb13ae009e313c (patch) | |
tree | 174f6fb061e9fbd3fecb98796ed275de29db69d9 /oox | |
parent | 40e1e1a4b2c190ffd71e17d83fc9f00c81d7d5b1 (diff) |
impress201: #i101074# fixed background import problem.. now supporting ColorRef based background colors
Diffstat (limited to 'oox')
-rw-r--r-- | oox/inc/oox/ppt/slidepersist.hxx | 2 | ||||
-rw-r--r-- | oox/source/ppt/slidefragmenthandler.cxx | 7 | ||||
-rw-r--r-- | oox/source/ppt/slidepersist.cxx | 7 |
3 files changed, 15 insertions, 1 deletions
diff --git a/oox/inc/oox/ppt/slidepersist.hxx b/oox/inc/oox/ppt/slidepersist.hxx index 31156a56ee84..bcb0c5803d61 100644 --- a/oox/inc/oox/ppt/slidepersist.hxx +++ b/oox/inc/oox/ppt/slidepersist.hxx @@ -91,6 +91,7 @@ public: void setBackgroundProperties( const oox::drawingml::FillPropertiesPtr pFillPropertiesPtr ){ mpBackgroundPropertiesPtr = pFillPropertiesPtr; } oox::drawingml::FillPropertiesPtr getBackgroundProperties() const { return mpBackgroundPropertiesPtr; } + oox::drawingml::Color& getBackgroundColorRef() { return maBackgroundColorRef; } sal_Bool isMasterPage() const { return mbMaster; } sal_Bool isNotesPage() const { return mbNotes; } @@ -130,6 +131,7 @@ private: SlidePersistPtr mpMasterPagePtr; oox::drawingml::ShapePtr maShapesPtr; + oox::drawingml::Color maBackgroundColorRef; oox::drawingml::FillPropertiesPtr mpBackgroundPropertiesPtr; ::std::list< boost::shared_ptr< TimeNode > > maTimeNodeList; diff --git a/oox/source/ppt/slidefragmenthandler.cxx b/oox/source/ppt/slidefragmenthandler.cxx index 69f32e01e7eb..7e77f5a54938 100644 --- a/oox/source/ppt/slidefragmenthandler.cxx +++ b/oox/source/ppt/slidefragmenthandler.cxx @@ -145,7 +145,14 @@ Reference< XFastContextHandler > SlideFragmentHandler::createFastChildContext( s mpSlidePersistPtr->setBackgroundProperties( pFillPropertiesPtr ); } break; + case NMSP_PPT|XML_bgRef: // a:CT_StyleMatrixReference + { + FillPropertiesPtr pFillPropertiesPtr( new FillProperties( + *mpSlidePersistPtr->getTheme()->getFillStyle( xAttribs->getOptionalValue( XML_idx ).toInt32() ) ) ); + xRet.set( new ColorContext( *this, mpSlidePersistPtr->getBackgroundColorRef() ) ); + mpSlidePersistPtr->setBackgroundProperties( pFillPropertiesPtr ); + } break; case NMSP_PPT|XML_clrMap: // CT_ColorMapping diff --git a/oox/source/ppt/slidepersist.cxx b/oox/source/ppt/slidepersist.cxx index ce99ffc49f19..8555ba371b77 100644 --- a/oox/source/ppt/slidepersist.cxx +++ b/oox/source/ppt/slidepersist.cxx @@ -173,12 +173,17 @@ void SlidePersist::createBackground( const XmlFilterBase& rFilterBase ) { try { + sal_Int32 nPhClr = API_RGB_TRANSPARENT; + if ( maBackgroundColorRef.isUsed() ) + nPhClr = maBackgroundColorRef.getColor( rFilterBase.getGraphicHelper() ); + PropertyMap aPropMap; static const rtl::OUString sBackground( RTL_CONSTASCII_USTRINGPARAM( "Background" ) ); uno::Reference< beans::XPropertySet > xPagePropSet( mxPage, uno::UNO_QUERY_THROW ); uno::Reference< beans::XPropertySet > xPropertySet( aPropMap.makePropertySet() ); PropertySet aPropSet( xPropertySet ); - mpBackgroundPropertiesPtr->pushToPropSet( aPropSet, rFilterBase.getModelObjectHelper(), rFilterBase.getGraphicHelper() ); + mpBackgroundPropertiesPtr->pushToPropSet( aPropSet, rFilterBase.getModelObjectHelper(), + rFilterBase.getGraphicHelper(), oox::drawingml::FillProperties::DEFAULT_IDS, 0, nPhClr ); xPagePropSet->setPropertyValue( sBackground, Any( xPropertySet ) ); } catch( Exception ) |