summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorTamás Zolnai <tamas.zolnai@collabora.com>2019-05-18 15:13:59 +0200
committerAndras Timar <andras.timar@collabora.com>2019-05-19 21:20:11 +0200
commit2506c835834acfdc344227a82f407e3b818db321 (patch)
tree763b2f188ffc083f3171faa70237485d215e58aa /oox
parentc25b5c2c3d019f1a282ba3fe65eb577ff1c8870b (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. Reviewed-on: https://gerrit.libreoffice.org/72500 Tested-by: Jenkins Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com> (cherry picked from commit a8bba60e8b655167ad91edcd0c2d1723d525b546) Change-Id: I32617c1a11cf3bafb142f7c8839b498aaac49aa0 Reviewed-on: https://gerrit.libreoffice.org/72521 Tested-by: Jenkins Reviewed-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'oox')
-rw-r--r--oox/source/ppt/presentationfragmenthandler.cxx20
1 files changed, 15 insertions, 5 deletions
diff --git a/oox/source/ppt/presentationfragmenthandler.cxx b/oox/source/ppt/presentationfragmenthandler.cxx
index f2477b2cef6e..13bba2da95a3 100644
--- a/oox/source/ppt/presentationfragmenthandler.cxx
+++ b/oox/source/ppt/presentationfragmenthandler.cxx
@@ -160,7 +160,7 @@ static void ResolveTextFields( XmlFilterBase const & rFilter )
}
void PresentationFragmentHandler::saveThemeToGrabBag(const oox::drawingml::ThemePtr& pThemePtr,
- const OUString& sTheme)
+ sal_Int32 nThemeIdx)
{
if (!pThemePtr)
return;
@@ -198,8 +198,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;
@@ -273,10 +276,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_QUERY_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 );
@@ -306,7 +316,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
{