diff options
author | Tamás Zolnai <tamas.zolnai@collabora.com> | 2019-05-17 20:03:10 +0200 |
---|---|---|
committer | Tamás Zolnai <tamas.zolnai@collabora.com> | 2019-05-18 12:41:09 +0200 |
commit | a8bba60e8b655167ad91edcd0c2d1723d525b546 (patch) | |
tree | 4ecb80c1f38c30f8856d097801bf7ecbfd36b2d6 /oox | |
parent | 3c3a371c799d00475deb13b4c3e0a8860c7e4fb3 (diff) |
tdf#125346: PPTX export: Shape has wrong fill color comming from theme
Write the correct theme path to the InteropGrabBag, the same path
what is generated and checked in the export code.
Change-Id: I32617c1a11cf3bafb142f7c8839b498aaac49aa0
Reviewed-on: https://gerrit.libreoffice.org/72500
Tested-by: Jenkins
Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/ppt/presentationfragmenthandler.cxx | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/oox/source/ppt/presentationfragmenthandler.cxx b/oox/source/ppt/presentationfragmenthandler.cxx index e7cf6ffb0511..5fc2e802f82b 100644 --- a/oox/source/ppt/presentationfragmenthandler.cxx +++ b/oox/source/ppt/presentationfragmenthandler.cxx @@ -161,7 +161,7 @@ static void ResolveTextFields( XmlFilterBase const & rFilter ) } void PresentationFragmentHandler::saveThemeToGrabBag(const oox::drawingml::ThemePtr& pThemePtr, - const OUString& sTheme) + sal_Int32 nThemeIdx) { if (!pThemePtr) return; @@ -199,8 +199,11 @@ void PresentationFragmentHandler::saveThemeToGrabBag(const oox::drawingml::Theme aCurrentTheme[nId].Value = rColor; } + // add new theme to the sequence - aTheme[0].Name = sTheme; + // Export code uses the master slide's index to find the right theme + // so use the same index in the grabbag. + aTheme[0].Name = "ppt/theme/theme" + OUString::number(nThemeIdx) + ".xml"; const uno::Any& rCurrentTheme = makeAny(aCurrentTheme); aTheme[0].Value = rCurrentTheme; @@ -279,10 +282,17 @@ void PresentationFragmentHandler::importSlide(sal_uInt32 nSlide, bool bFirstPage Reference< drawing::XMasterPagesSupplier > xMPS( xModel, uno::UNO_QUERY_THROW ); Reference< drawing::XDrawPages > xMasterPages( xMPS->getMasterPages(), uno::UNO_SET_THROW ); + sal_Int32 nIndex; if( rFilter.getMasterPages().empty() ) - xMasterPages->getByIndex( 0 ) >>= xMasterPage; + { + nIndex = 0; + xMasterPages->getByIndex( nIndex ) >>= xMasterPage; + } else - xMasterPage = xMasterPages->insertNewByIndex( xMasterPages->getCount() ); + { + nIndex = xMasterPages->getCount(); + xMasterPage = xMasterPages->insertNewByIndex( nIndex ); + } pMasterPersistPtr = std::make_shared<SlidePersist>( rFilter, true, false, xMasterPage, ShapePtr( new PPTShape( Master, "com.sun.star.drawing.GroupShape" ) ), mpTextListStyle ); @@ -312,7 +322,7 @@ void PresentationFragmentHandler::importSlide(sal_uInt32 nSlide, bool bFirstPage UNO_QUERY_THROW)); rThemes[ aThemeFragmentPath ] = pThemePtr; pThemePtr->setFragment(xDoc); - saveThemeToGrabBag(pThemePtr, aThemeFragmentPath); + saveThemeToGrabBag(pThemePtr, nIndex + 1); } else { |