summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2012-09-04 20:38:17 +0200
committerLionel Elie Mamane <lionel@mamane.lu>2012-09-05 10:41:56 +0200
commit8806e6e1029f08cb43540f1aa9753b19f0e459f8 (patch)
treefd3ac3f11ef22d77539a192f1985522b40247c47 /svx
parentc53bb3f1ec305eff1eb1da1542574eeffeb29d96 (diff)
fdo#53872: reportdesign: fix section drawpage crash:
In order to wrap the SdrPage's UNO object completely, set its mxUnoPage member to the OSection wrapper instance in OSection::init; only OSection should have access to it. Also initialize m_xDrawPage_Tunnel (thanks Lionel for the hint). (regression from 05218c101df486302bf4cfe8be23ad840daa3f73) Change-Id: I048ddafc31e946853e56e6a403ddc9487cfbcf0e Signed-off-by: Lionel Elie Mamane <lionel@mamane.lu> (cherry picked from commit 0e6054f8f5e2d41e50a50645defa5861599fe375) Signed-off-by: Lionel Elie Mamane <lionel@mamane.lu>
Diffstat (limited to 'svx')
-rw-r--r--svx/inc/svx/svdpage.hxx12
-rw-r--r--svx/source/svdraw/svdpage.cxx5
2 files changed, 11 insertions, 6 deletions
diff --git a/svx/inc/svx/svdpage.hxx b/svx/inc/svx/svdpage.hxx
index 3833a6787908..782dbab8402f 100644
--- a/svx/inc/svx/svdpage.hxx
+++ b/svx/inc/svx/svdpage.hxx
@@ -43,12 +43,14 @@
#include <svx/sdrmasterpagedescriptor.hxx>
#include "svx/svxdllapi.h"
#include <com/sun/star/container/XIndexAccess.hpp>
+#include <com/sun/star/drawing/XDrawPage.hpp>
#include <svx/svdobj.hxx>
#include <boost/scoped_ptr.hpp>
//////////////////////////////////////////////////////////////////////////////
// predefines
+namespace reportdesign { class OSection; }
namespace sdr { namespace contact { class ViewContact; }}
class SdrPage;
class SdrModel;
@@ -428,8 +430,8 @@ public:
friend class SvxUnoDrawPagesAccess;
// this class uses its own UNO wrapper
-// and thus has to set mxUnoPage
-friend class ChXChartDocument;
+// and thus has to set mxUnoPage (it also relies on mxUnoPage not being WeakRef)
+friend class reportdesign::OSection;
sal_Int32 nWdt; // Seitengroesse
sal_Int32 nHgt; // Seitengroesse
@@ -438,13 +440,11 @@ friend class ChXChartDocument;
sal_Int32 nBordRgt; // Seitenrand rechts
sal_Int32 nBordLwr; // Seitenrand unten
- // this is a weak reference to a possible living api wrapper for this page
- ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > mxUnoPage;
-
protected:
SdrLayerAdmin* pLayerAdmin;
private:
SdrPageProperties* mpSdrPageProperties;
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > mxUnoPage;
public:
SdrPageProperties& getSdrPageProperties() { return *mpSdrPageProperties; }
@@ -467,6 +467,8 @@ protected:
// #i93597#
unsigned mbPageBorderOnlyLeftRight : 1;
+ void SetUnoPage(::com::sun::star::uno::Reference<
+ ::com::sun::star::drawing::XDrawPage> const&);
virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > createUnoPage();
public:
diff --git a/svx/source/svdraw/svdpage.cxx b/svx/source/svdraw/svdpage.cxx
index 3fcd8363730d..d6d148e9312e 100644
--- a/svx/source/svdraw/svdpage.cxx
+++ b/svx/source/svdraw/svdpage.cxx
@@ -1788,10 +1788,13 @@ void SdrPage::SetInserted( bool bIns )
}
}
+void SdrPage::SetUnoPage(uno::Reference<drawing::XDrawPage> const& xNewPage)
+{
+ mxUnoPage = xNewPage;
+}
uno::Reference< uno::XInterface > SdrPage::getUnoPage()
{
- // try weak reference first
if( !mxUnoPage.is() )
{
// create one