diff options
-rw-r--r-- | reportdesign/inc/ReportDefinition.hxx | 1 | ||||
-rw-r--r-- | reportdesign/source/core/api/Group.cxx | 10 | ||||
-rw-r--r-- | reportdesign/source/core/api/Section.cxx | 33 | ||||
-rw-r--r-- | reportdesign/source/core/inc/Group.hxx | 7 | ||||
-rw-r--r-- | reportdesign/source/core/inc/Section.hxx | 16 |
5 files changed, 41 insertions, 26 deletions
diff --git a/reportdesign/inc/ReportDefinition.hxx b/reportdesign/inc/ReportDefinition.hxx index 1d56882b5c36..f2f3fb18577c 100644 --- a/reportdesign/inc/ReportDefinition.hxx +++ b/reportdesign/inc/ReportDefinition.hxx @@ -192,7 +192,6 @@ namespace reportdesign static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId(); UNLESS_MERGELIBS_MORE(REPORTDESIGN_DLLPUBLIC) static std::shared_ptr<rptui::OReportModel> getSdrModel(const css::uno::Reference< css::report::XReportDefinition >& _xReportDefinition); - private: DECLARE_XINTERFACE( ) DECLARE_XTYPEPROVIDER( ) // css::lang::XServiceInfo diff --git a/reportdesign/source/core/api/Group.cxx b/reportdesign/source/core/api/Group.cxx index ab368dda5940..d7fe730184a4 100644 --- a/reportdesign/source/core/api/Group.cxx +++ b/reportdesign/source/core/api/Group.cxx @@ -17,6 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ #include <Group.hxx> +#include <Groups.hxx> #include <Section.hxx> #include <com/sun/star/lang/NoSupportException.hpp> #include <com/sun/star/report/GroupOn.hpp> @@ -35,7 +36,7 @@ namespace reportdesign using namespace com::sun::star; -OGroup::OGroup(const uno::Reference< report::XGroups >& _xParent +OGroup::OGroup(const rtl::Reference< OGroups >& _xParent ,const uno::Reference< uno::XComponentContext >& _xContext) :GroupBase(m_aMutex) ,GroupPropertySet(_xContext,IMPLEMENTS_PROPERTY_SET,uno::Sequence< OUString >()) @@ -205,7 +206,12 @@ void SAL_CALL OGroup::setKeepTogether( ::sal_Int16 _keeptogether ) uno::Reference< report::XGroups > SAL_CALL OGroup::getGroups() { - return m_xParent; + return m_xParent.get(); +} + +rtl::Reference< OGroups > OGroup::getOGroups() const +{ + return m_xParent.get(); } OUString SAL_CALL OGroup::getExpression() diff --git a/reportdesign/source/core/api/Section.cxx b/reportdesign/source/core/api/Section.cxx index 45cdb8b35110..59ea0280956b 100644 --- a/reportdesign/source/core/api/Section.cxx +++ b/reportdesign/source/core/api/Section.cxx @@ -17,6 +17,8 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ #include <Section.hxx> +#include <Group.hxx> +#include <Groups.hxx> #include <comphelper/enumhelper.hxx> #include <comphelper/servicehelper.hxx> #include <cppuhelper/supportsservice.hxx> @@ -74,7 +76,7 @@ static uno::Sequence< OUString> lcl_getAbsent(bool _bPageSection) } uno::Reference<report::XSection> OSection::createOSection( - const uno::Reference< report::XReportDefinition >& xParentDef, + const rtl::Reference< OReportDefinition >& xParentDef, const uno::Reference< uno::XComponentContext >& context, bool const bPageSection) { @@ -85,7 +87,7 @@ uno::Reference<report::XSection> OSection::createOSection( } uno::Reference<report::XSection> OSection::createOSection( - const uno::Reference< report::XGroup >& xParentGroup, + const rtl::Reference< OGroup >& xParentGroup, const uno::Reference< uno::XComponentContext >& context) { rtl::Reference<OSection> pNew = @@ -95,8 +97,8 @@ uno::Reference<report::XSection> OSection::createOSection( } -OSection::OSection(const uno::Reference< report::XReportDefinition >& xParentDef - ,const uno::Reference< report::XGroup >& xParentGroup +OSection::OSection(const rtl::Reference< OReportDefinition >& xParentDef + ,const rtl::Reference< OGroup >& xParentGroup ,const uno::Reference< uno::XComponentContext >& context ,uno::Sequence< OUString> const& rStrings) :SectionBase(m_aMutex) @@ -282,7 +284,7 @@ void SAL_CALL OSection::setConditionalPrintExpression( const OUString& _conditio void OSection::checkNotPageHeaderFooter() { ::osl::MutexGuard aGuard(m_aMutex); - uno::Reference< report::XReportDefinition > xRet = m_xReportDefinition; + rtl::Reference< OReportDefinition > xRet = m_xReportDefinition; if ( xRet.is() ) { if ( xRet->getPageHeaderOn() && xRet->getPageHeader() == *this ) @@ -368,7 +370,7 @@ void SAL_CALL OSection::setCanShrink( sal_Bool /*_canshrink*/ ) sal_Bool SAL_CALL OSection::getRepeatSection() { ::osl::MutexGuard aGuard(m_aMutex); - uno::Reference< report::XGroup > xGroup = m_xGroup; + rtl::Reference< OGroup > xGroup = m_xGroup; if ( !xGroup.is() ) throw beans::UnknownPropertyException(); return m_bRepeatSection; @@ -378,7 +380,7 @@ void SAL_CALL OSection::setRepeatSection( sal_Bool _repeatsection ) { { ::osl::MutexGuard aGuard(m_aMutex); - uno::Reference< report::XGroup > xGroup = m_xGroup; + rtl::Reference< OGroup > xGroup = m_xGroup; if ( !xGroup.is() ) throw beans::UnknownPropertyException(); } @@ -388,22 +390,23 @@ void SAL_CALL OSection::setRepeatSection( sal_Bool _repeatsection ) uno::Reference< report::XGroup > SAL_CALL OSection::getGroup() { ::osl::MutexGuard aGuard(m_aMutex); - return m_xGroup; + return m_xGroup.get(); } uno::Reference< report::XReportDefinition > SAL_CALL OSection::getReportDefinition() { ::osl::MutexGuard aGuard(m_aMutex); - uno::Reference< report::XReportDefinition > xRet = m_xReportDefinition; - uno::Reference< report::XGroup > xGroup = m_xGroup; - if ( !xRet.is() && xGroup.is() ) + rtl::Reference< OReportDefinition > xRet = m_xReportDefinition; + if (xRet.is()) + return xRet; + rtl::Reference< OGroup > xGroup = m_xGroup; + if ( xGroup.is() ) { - uno::Reference< report::XGroups> xGroups(xGroup->getGroups()); + rtl::Reference< OGroups> xGroups(xGroup->getOGroups()); if ( xGroups.is() ) - xRet = xGroups->getReportDefinition(); + return xGroups->getReportDefinition(); } - - return xRet; + return {}; } // XChild diff --git a/reportdesign/source/core/inc/Group.hxx b/reportdesign/source/core/inc/Group.hxx index 681e24a0f459..67a4b5b5ebd1 100644 --- a/reportdesign/source/core/inc/Group.hxx +++ b/reportdesign/source/core/inc/Group.hxx @@ -28,10 +28,12 @@ #include <comphelper/uno3.hxx> #include <com/sun/star/lang/XServiceInfo.hpp> #include <rtl/ref.hxx> +#include <unotools/weakref.hxx> namespace reportdesign { class OFunctions; + class OGroups; typedef ::cppu::WeakComponentImplHelper< css::report::XGroup , css::lang::XServiceInfo> GroupBase; typedef ::cppu::PropertySetMixin< css::report::XGroup> GroupPropertySet; @@ -45,7 +47,7 @@ namespace reportdesign ,public GroupPropertySet { css::uno::Reference< css::uno::XComponentContext > m_xContext; - css::uno::WeakReference< css::report::XGroups > m_xParent; + unotools::WeakReference< OGroups > m_xParent; css::uno::Reference< css::report::XSection> m_xHeader; css::uno::Reference< css::report::XSection> m_xFooter; rtl::Reference< OFunctions > m_xFunctions; @@ -100,7 +102,7 @@ namespace reportdesign virtual void SAL_CALL disposing() override; public: - OGroup(const css::uno::Reference< css::report::XGroups >& _xParent + OGroup(const rtl::Reference< OGroups >& _xParent ,const css::uno::Reference< css::uno::XComponentContext >& context); DECLARE_XINTERFACE( ) @@ -161,6 +163,7 @@ namespace reportdesign { cppu::WeakComponentImplHelperBase::removeEventListener(aListener); } + rtl::Reference< OGroups > getOGroups() const; }; } // namespace reportdesign diff --git a/reportdesign/source/core/inc/Section.hxx b/reportdesign/source/core/inc/Section.hxx index 7fd9ccffd9f5..595cc9596e8c 100644 --- a/reportdesign/source/core/inc/Section.hxx +++ b/reportdesign/source/core/inc/Section.hxx @@ -25,6 +25,7 @@ #include <comphelper/uno3.hxx> #include <cppuhelper/propertysetmixin.hxx> #include <comphelper/interfacecontainer3.hxx> +#include <unotools/weakref.hxx> #include <com/sun/star/uno/XComponentContext.hpp> #include <com/sun/star/drawing/XDrawPage.hpp> #include <com/sun/star/drawing/XShapeGrouper.hpp> @@ -35,6 +36,9 @@ namespace reportdesign { + class OGroup; + class OReportDefinition; + typedef ::cppu::WeakComponentImplHelper < css::report::XSection , css::lang::XServiceInfo @@ -55,8 +59,8 @@ namespace reportdesign css::uno::Reference< css::drawing::XShapeGrouper > m_xDrawPage_ShapeGrouper; css::uno::Reference< css::form::XFormsSupplier2 > m_xDrawPage_FormSupplier; css::uno::Reference< css::lang::XUnoTunnel > m_xDrawPage_Tunnel; - css::uno::WeakReference< css::report::XGroup > m_xGroup; - css::uno::WeakReference< css::report::XReportDefinition > m_xReportDefinition; + unotools::WeakReference< OGroup > m_xGroup; + unotools::WeakReference< OReportDefinition > m_xReportDefinition; OUString m_sName; OUString m_sConditionalPrintExpression; ::sal_uInt32 m_nHeight; @@ -122,16 +126,16 @@ namespace reportdesign virtual void SAL_CALL disposing() override; private: - OSection(const css::uno::Reference< css::report::XReportDefinition >& xParentDef - ,const css::uno::Reference< css::report::XGroup >& xParentGroup + OSection(const rtl::Reference< OReportDefinition >& xParentDef + ,const rtl::Reference< OGroup >& xParentGroup ,const css::uno::Reference< css::uno::XComponentContext >& context, css::uno::Sequence< OUString> const&); public: static css::uno::Reference< css::report::XSection> - createOSection(const css::uno::Reference< css::report::XReportDefinition >& _xParent + createOSection(const rtl::Reference< OReportDefinition >& _xParent ,const css::uno::Reference< css::uno::XComponentContext >& context,bool _bPageSection=false); static css::uno::Reference< css::report::XSection> - createOSection(const css::uno::Reference< css::report::XGroup >& _xParent + createOSection(const rtl::Reference< OGroup >& _xParent ,const css::uno::Reference< css::uno::XComponentContext >& context); DECLARE_XINTERFACE( ) |