diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2020-10-29 20:14:45 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-10-31 08:07:25 +0100 |
commit | 88267a7de0b65a2c784931ffc0c1408b82495da9 (patch) | |
tree | 5adb8f89c29209c8059b4b7f51a689493eca79a6 /xmloff | |
parent | 8c26281f84fc935600a99a1e83a26a841ae63fa9 (diff) |
remove pimpl from SdXMLShowsContext
Change-Id: I54d4103d3a53300e9ed018b0d7f9a25e177722de
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105027
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/source/draw/ximpshow.cxx | 73 | ||||
-rw-r--r-- | xmloff/source/draw/ximpshow.hxx | 13 |
2 files changed, 38 insertions, 48 deletions
diff --git a/xmloff/source/draw/ximpshow.cxx b/xmloff/source/draw/ximpshow.cxx index fba73962d02b..0e227d9cfa64 100644 --- a/xmloff/source/draw/ximpshow.cxx +++ b/xmloff/source/draw/ximpshow.cxx @@ -17,12 +17,9 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/frame/XModel.hpp> #include <com/sun/star/util/Duration.hpp> #include <com/sun/star/xml/sax/XAttributeList.hpp> -#include <com/sun/star/lang/XSingleServiceFactory.hpp> -#include <com/sun/star/container/XNameContainer.hpp> #include <com/sun/star/presentation/XCustomPresentationSupplier.hpp> #include <com/sun/star/presentation/XPresentationSupplier.hpp> #include <com/sun/star/container/XIndexContainer.hpp> @@ -48,38 +45,26 @@ using namespace ::com::sun::star::container; using namespace ::com::sun::star::presentation; using namespace ::xmloff::token; -class ShowsImpImpl -{ -public: - Reference< XSingleServiceFactory > mxShowFactory; - Reference< XNameContainer > mxShows; - Reference< XPropertySet > mxPresProps; - Reference< XNameAccess > mxPages; - OUString maCustomShowName; -}; - - SdXMLShowsContext::SdXMLShowsContext( SdXMLImport& rImport, const Reference< XFastAttributeList >& xAttrList ) -: SvXMLImportContext(rImport), - mpImpl(new ShowsImpImpl ) +: SvXMLImportContext(rImport) { Reference< XCustomPresentationSupplier > xShowsSupplier( rImport.GetModel(), UNO_QUERY ); if( xShowsSupplier.is() ) { - mpImpl->mxShows = xShowsSupplier->getCustomPresentations(); - mpImpl->mxShowFactory.set( mpImpl->mxShows, UNO_QUERY ); + mxShows = xShowsSupplier->getCustomPresentations(); + mxShowFactory.set( mxShows, UNO_QUERY ); } Reference< XDrawPagesSupplier > xDrawPagesSupplier( rImport.GetModel(), UNO_QUERY ); if( xDrawPagesSupplier.is() ) - mpImpl->mxPages.set( xDrawPagesSupplier->getDrawPages(), UNO_QUERY ); + mxPages.set( xDrawPagesSupplier->getDrawPages(), UNO_QUERY ); Reference< XPresentationSupplier > xPresentationSupplier( rImport.GetModel(), UNO_QUERY ); if( xPresentationSupplier.is() ) - mpImpl->mxPresProps.set( xPresentationSupplier->getPresentation(), UNO_QUERY ); + mxPresProps.set( xPresentationSupplier->getPresentation(), UNO_QUERY ); - if( !mpImpl->mxPresProps.is() ) + if( !mxPresProps.is() ) return; bool bAll = true; @@ -98,13 +83,13 @@ SdXMLShowsContext::SdXMLShowsContext( SdXMLImport& rImport, const Reference< XFa { case XML_ELEMENT(PRESENTATION, XML_START_PAGE): { - mpImpl->mxPresProps->setPropertyValue("FirstPage", Any(sValue) ); + mxPresProps->setPropertyValue("FirstPage", Any(sValue) ); bAll = false; break; } case XML_ELEMENT(PRESENTATION, XML_SHOW): { - mpImpl->maCustomShowName = sValue; + maCustomShowName = sValue; bAll = false; break; } @@ -116,37 +101,37 @@ SdXMLShowsContext::SdXMLShowsContext( SdXMLImport& rImport, const Reference< XFa const sal_Int32 nMS = (aDuration.Hours * 60 + aDuration.Minutes) * 60 + aDuration.Seconds; - mpImpl->mxPresProps->setPropertyValue("Pause", Any(nMS) ); + mxPresProps->setPropertyValue("Pause", Any(nMS) ); break; } case XML_ELEMENT(PRESENTATION, XML_ANIMATIONS): { aAny <<= IsXMLToken( sValue, XML_ENABLED ); - mpImpl->mxPresProps->setPropertyValue("AllowAnimations", aAny ); + mxPresProps->setPropertyValue("AllowAnimations", aAny ); break; } case XML_ELEMENT(PRESENTATION, XML_STAY_ON_TOP): { aAny <<= IsXMLToken( sValue, XML_TRUE ); - mpImpl->mxPresProps->setPropertyValue("IsAlwaysOnTop", aAny ); + mxPresProps->setPropertyValue("IsAlwaysOnTop", aAny ); break; } case XML_ELEMENT(PRESENTATION, XML_FORCE_MANUAL): { aAny <<= IsXMLToken( sValue, XML_TRUE ); - mpImpl->mxPresProps->setPropertyValue("IsAutomatic", aAny ); + mxPresProps->setPropertyValue("IsAutomatic", aAny ); break; } case XML_ELEMENT(PRESENTATION, XML_ENDLESS): { aAny <<= IsXMLToken( sValue, XML_TRUE ); - mpImpl->mxPresProps->setPropertyValue("IsEndless", aAny ); + mxPresProps->setPropertyValue("IsEndless", aAny ); break; } case XML_ELEMENT(PRESENTATION, XML_FULL_SCREEN): { aAny <<= IsXMLToken( sValue, XML_TRUE ); - mpImpl->mxPresProps->setPropertyValue("IsFullScreen", aAny ); + mxPresProps->setPropertyValue("IsFullScreen", aAny ); break; } case XML_ELEMENT(PRESENTATION, XML_MOUSE_VISIBLE): @@ -157,40 +142,40 @@ SdXMLShowsContext::SdXMLShowsContext( SdXMLImport& rImport, const Reference< XFa case XML_ELEMENT(PRESENTATION, XML_START_WITH_NAVIGATOR): { aAny <<= IsXMLToken( sValue, XML_TRUE ); - mpImpl->mxPresProps->setPropertyValue("StartWithNavigator", aAny ); + mxPresProps->setPropertyValue("StartWithNavigator", aAny ); break; } case XML_ELEMENT(PRESENTATION, XML_MOUSE_AS_PEN): { aAny <<= IsXMLToken( sValue, XML_TRUE ); - mpImpl->mxPresProps->setPropertyValue("UsePen", aAny ); + mxPresProps->setPropertyValue("UsePen", aAny ); break; } case XML_ELEMENT(PRESENTATION, XML_TRANSITION_ON_CLICK): { aAny <<= IsXMLToken( sValue, XML_ENABLED ); - mpImpl->mxPresProps->setPropertyValue("IsTransitionOnClick", aAny ); + mxPresProps->setPropertyValue("IsTransitionOnClick", aAny ); break; } case XML_ELEMENT(PRESENTATION, XML_SHOW_LOGO): { aAny <<= IsXMLToken( sValue, XML_TRUE ); - mpImpl->mxPresProps->setPropertyValue("IsShowLogo", aAny ); + mxPresProps->setPropertyValue("IsShowLogo", aAny ); break; } } } - mpImpl->mxPresProps->setPropertyValue("IsShowAll", Any(bAll) ); - mpImpl->mxPresProps->setPropertyValue("IsMouseVisible", Any(bIsMouseVisible) ); + mxPresProps->setPropertyValue("IsShowAll", Any(bAll) ); + mxPresProps->setPropertyValue("IsMouseVisible", Any(bIsMouseVisible) ); } SdXMLShowsContext::~SdXMLShowsContext() { - if( mpImpl && !mpImpl->maCustomShowName.isEmpty() ) + if( !maCustomShowName.isEmpty() ) { uno::Any aAny; - aAny <<= mpImpl->maCustomShowName; - mpImpl->mxPresProps->setPropertyValue("CustomShow", aAny ); + aAny <<= maCustomShowName; + mxPresProps->setPropertyValue("CustomShow", aAny ); } } @@ -221,7 +206,7 @@ css::uno::Reference< css::xml::sax::XFastContextHandler > SdXMLShowsContext::cre if( !aName.isEmpty() && !aPages.isEmpty() ) { - Reference< XIndexContainer > xShow( mpImpl->mxShowFactory->createInstance(), UNO_QUERY ); + Reference< XIndexContainer > xShow( mxShowFactory->createInstance(), UNO_QUERY ); if( xShow.is() ) { SvXMLTokenEnumerator aPageNames( aPages, ',' ); @@ -229,11 +214,11 @@ css::uno::Reference< css::xml::sax::XFastContextHandler > SdXMLShowsContext::cre while( aPageNames.getNextToken( sPageName ) ) { - if( !mpImpl->mxPages->hasByName( sPageName ) ) + if( !mxPages->hasByName( sPageName ) ) continue; Reference< XDrawPage > xPage; - mpImpl->mxPages->getByName( sPageName ) >>= xPage; + mxPages->getByName( sPageName ) >>= xPage; if( xPage.is() ) { xShow->insertByIndex( xShow->getCount(), Any(xPage) ); @@ -242,13 +227,13 @@ css::uno::Reference< css::xml::sax::XFastContextHandler > SdXMLShowsContext::cre Any aAny; aAny <<= xShow; - if( mpImpl->mxShows->hasByName( aName ) ) + if( mxShows->hasByName( aName ) ) { - mpImpl->mxShows->replaceByName( aName, aAny ); + mxShows->replaceByName( aName, aAny ); } else { - mpImpl->mxShows->insertByName( aName, aAny ); + mxShows->insertByName( aName, aAny ); } } } diff --git a/xmloff/source/draw/ximpshow.hxx b/xmloff/source/draw/ximpshow.hxx index b7c4b3b492d8..a97ded31b904 100644 --- a/xmloff/source/draw/ximpshow.hxx +++ b/xmloff/source/draw/ximpshow.hxx @@ -23,15 +23,14 @@ #include <xmloff/xmlictxt.hxx> #include "sdxmlimp_impl.hxx" #include <memory> - -class ShowsImpImpl; +#include <com/sun/star/beans/XPropertySet.hpp> +#include <com/sun/star/lang/XSingleServiceFactory.hpp> +#include <com/sun/star/container/XNameContainer.hpp> // presentations:animations class SdXMLShowsContext : public SvXMLImportContext { - std::unique_ptr<ShowsImpImpl> mpImpl; - public: SdXMLShowsContext( SdXMLImport& rImport, @@ -43,6 +42,12 @@ public: virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList >& AttrList ) override; +private: + css::uno::Reference< css::lang::XSingleServiceFactory > mxShowFactory; + css::uno::Reference< css::container::XNameContainer > mxShows; + css::uno::Reference< css::beans::XPropertySet > mxPresProps; + css::uno::Reference< css::container::XNameAccess > mxPages; + OUString maCustomShowName; }; #endif // INCLUDED_XMLOFF_SOURCE_DRAW_XIMPSHOW_HXX |