diff options
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/uibase/uno/unodefaults.cxx | 25 | ||||
-rw-r--r-- | sw/source/uibase/uno/unodefaults.hxx | 4 | ||||
-rw-r--r-- | sw/source/uibase/uno/unotxdoc.cxx | 2 |
3 files changed, 13 insertions, 18 deletions
diff --git a/sw/source/uibase/uno/unodefaults.cxx b/sw/source/uibase/uno/unodefaults.cxx index 6daaeee4edc1..135bf88e80ec 100644 --- a/sw/source/uibase/uno/unodefaults.cxx +++ b/sw/source/uibase/uno/unodefaults.cxx @@ -23,9 +23,9 @@ #include <doc.hxx> #include <IDocumentDrawModelAccess.hxx> -SwSvxUnoDrawPool::SwSvxUnoDrawPool(SwDoc* pDoc) - : SvxUnoDrawPool(pDoc->getIDocumentDrawModelAccess().GetDrawModel(), SVXUNO_SERVICEID_COM_SUN_STAR_DRAWING_DEFAULTS_WRITER) - , m_pDoc(pDoc) +SwSvxUnoDrawPool::SwSvxUnoDrawPool(SwDoc& rDoc) + : SvxUnoDrawPool(rDoc.getIDocumentDrawModelAccess().GetDrawModel(), SVXUNO_SERVICEID_COM_SUN_STAR_DRAWING_DEFAULTS_WRITER) + , m_rDoc(rDoc) { } @@ -35,18 +35,13 @@ SwSvxUnoDrawPool::~SwSvxUnoDrawPool() throw() SfxItemPool* SwSvxUnoDrawPool::getModelPool( bool /*bReadOnly*/ ) throw() { - if(m_pDoc) - { - - // DVO, OD 01.10.2003 #i18732# - return item pool of writer document; - // it contains draw model item pool as secondary pool. - //SdrModel* pModel = m_pDoc->MakeDrawModel(); - //return &pModel->GetItemPool(); - // #i52858# - method name changed - m_pDoc->getIDocumentDrawModelAccess().GetOrCreateDrawModel(); - return &(m_pDoc->GetAttrPool()); - } - return nullptr; + // DVO, OD 01.10.2003 #i18732# - return item pool of writer document; + // it contains draw model item pool as secondary pool. + //SdrModel* pModel = m_rDoc.MakeDrawModel(); + //return &pModel->GetItemPool(); + // #i52858# - method name changed + m_rDoc.getIDocumentDrawModelAccess().GetOrCreateDrawModel(); + return &(m_rDoc.GetAttrPool()); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/uibase/uno/unodefaults.hxx b/sw/source/uibase/uno/unodefaults.hxx index 23bd6b543e10..ba218940b6d0 100644 --- a/sw/source/uibase/uno/unodefaults.hxx +++ b/sw/source/uibase/uno/unodefaults.hxx @@ -25,9 +25,9 @@ class SwDoc; class SwSvxUnoDrawPool : public SvxUnoDrawPool { - SwDoc* m_pDoc; + SwDoc& m_rDoc; public: - SwSvxUnoDrawPool(SwDoc* pDoc); + SwSvxUnoDrawPool(SwDoc& rDoc); virtual ~SwSvxUnoDrawPool() throw() override; virtual SfxItemPool* getModelPool( bool bReadOnly ) throw() override; diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx index 7208fd2d94ca..31f7cf31c68a 100644 --- a/sw/source/uibase/uno/unotxdoc.cxx +++ b/sw/source/uibase/uno/unotxdoc.cxx @@ -4356,7 +4356,7 @@ Reference<XInterface> SwXDocumentPropertyHelper::GetDrawTable(SwCreateDrawTable break; case SwCreateDrawTable::Defaults: if(!xDrawDefaults.is()) - xDrawDefaults = static_cast<cppu::OWeakObject*>(new SwSvxUnoDrawPool(m_pDoc)); + xDrawDefaults = static_cast<cppu::OWeakObject*>(new SwSvxUnoDrawPool(*m_pDoc)); xRet = xDrawDefaults; break; #if OSL_DEBUG_LEVEL > 0 |