summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorTamás Zolnai <tamas.zolnai@collabora.com>2019-05-18 15:21:11 +0200
committerAndras Timar <andras.timar@collabora.com>2019-05-19 21:19:58 +0200
commit876664aba6d54e5f1be3585a6d05c354b140481c (patch)
treebd64d89884860f4710b01b7e03da17f5aebc6a01 /oox
parent8e13c14a1221430cdbd79be5b5c27a1c781ffb1d (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/72522 Reviewed-by: Andras Timar <andras.timar@collabora.com> Tested-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 3c4a3c109b78..6e0ebeb27661 100644
--- a/oox/source/ppt/presentationfragmenthandler.cxx
+++ b/oox/source/ppt/presentationfragmenthandler.cxx
@@ -159,7 +159,7 @@ void ResolveTextFields( XmlFilterBase const & rFilter )
}
}
-void PresentationFragmentHandler::saveThemeToGrabBag(oox::drawingml::ThemePtr pThemePtr, const OUString& sTheme)
+void PresentationFragmentHandler::saveThemeToGrabBag(oox::drawingml::ThemePtr pThemePtr, sal_Int32 nThemeIdx)
{
if (!pThemePtr)
return;
@@ -197,8 +197,11 @@ void PresentationFragmentHandler::saveThemeToGrabBag(oox::drawingml::ThemePtr pT
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;
@@ -274,10 +277,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 );
@@ -307,7 +317,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
{