oox/inc/drawingml/textbody.hxx | 1 oox/source/ppt/pptshape.cxx | 46 +++++++++++++++-------------------------- 2 files changed, 18 insertions(+), 29 deletions(-)
New commits: commit 8d504824fd5ec439562997eeb77dfbde25af3db7 Author: Balazs Varga <balazs.va...@collabora.com> AuthorDate: Fri Aug 15 10:32:20 2025 +0200 Commit: Balazs Varga <balazs.va...@collabora.com> CommitDate: Mon Aug 18 09:24:34 2025 +0200 Related: tdf#111927 - PPTX: fix placeholder title text becomes small after clicking in&out Add some clean-up for 78e0581ec09078ea5f344bae66d07978396bb23e Change-Id: I48958d77ceaa79de83df54538bc4820f119c022c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189663 Reviewed-by: Balazs Varga <balazs.va...@collabora.com> Tested-by: Jenkins (cherry picked from commit a7a02a742237d739e7b6b25fcfb9dbe2d4675c28) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189839 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> diff --git a/oox/inc/drawingml/textbody.hxx b/oox/inc/drawingml/textbody.hxx index e0683c606a8b..3f4cd0cb7f55 100644 --- a/oox/inc/drawingml/textbody.hxx +++ b/oox/inc/drawingml/textbody.hxx @@ -96,6 +96,7 @@ public: const TextCharacterProperties& rTextStyleProperties, const TextListStylePtr& pMasterTextListStylePtr) const; + /// throws exception void ApplyMasterTextStyle( const ::oox::core::XmlFilterBase& rFilterBase, const css::uno::Reference< css::style::XStyle > & aXStyle, diff --git a/oox/source/ppt/pptshape.cxx b/oox/source/ppt/pptshape.cxx index 5b80d96e0add..a5a0c57aed8f 100644 --- a/oox/source/ppt/pptshape.cxx +++ b/oox/source/ppt/pptshape.cxx @@ -168,49 +168,37 @@ void PPTShape::setTextMasterStyles( const SlidePersist& rSlidePersist, const oox { Reference< style::XStyleFamiliesSupplier > aXStyleFamiliesSupplier(rFilterBase.getModel(), UNO_QUERY_THROW); Reference< container::XNameAccess > aXNameAccess(aXStyleFamiliesSupplier->getStyleFamilies()); + + if (!aXNameAccess.is()) + return; + Reference< container::XNamed > aXNamed(rSlidePersist.getPage(), UNO_QUERY_THROW); + OUString aFamily = aXNamed->getName(); + + if (!aXNameAccess->hasByName(aFamily)) + return; - if (aXNameAccess.is()) + Reference< container::XNameAccess > xFamilies; + if (aXNameAccess->getByName(aFamily) >>= xFamilies) { OUString aStyle; - OUString aFamily; - if (sType == u"com.sun.star.presentation.TitleTextShape") // title style - { aStyle = u"title"_ustr; - aFamily = aXNamed->getName(); - } else if (sType == u"com.sun.star.presentation.SubtitleShape") // subtitle - { aStyle = u"subtitle"_ustr; - aFamily = aXNamed->getName(); - } else if (sType == u"com.sun.star.presentation.OutlinerShape") // body style - { aStyle = u"outline1"_ustr; - aFamily = aXNamed->getName(); - } else if (sType == u"com.sun.star.presentation.NotesShape") // notes style - { aStyle = u"title"_ustr; - aFamily = aXNamed->getName(); - } - Reference< container::XNameAccess > xFamilies; - if (aXNameAccess->hasByName(aFamily)) + if (!xFamilies->hasByName(aStyle)) + return; + + Reference< style::XStyle > aXStyle; + if (xFamilies->getByName(aStyle) >>= aXStyle) { - if (aXNameAccess->getByName(aFamily) >>= xFamilies) - { - if (xFamilies->hasByName(aStyle)) - { - Reference< style::XStyle > aXStyle; - if (xFamilies->getByName(aStyle) >>= aXStyle) - { - TextCharacterProperties aCharStyleProperties; - getTextBody()->ApplyMasterTextStyle(rFilterBase, aXStyle, aCharStyleProperties, mpMasterTextListStyle); - } - } - } + TextCharacterProperties aCharStyleProperties; + getTextBody()->ApplyMasterTextStyle(rFilterBase, aXStyle, aCharStyleProperties, mpMasterTextListStyle); } } }