diff options
author | Michael Stahl <mstahl@redhat.com> | 2014-08-17 19:21:35 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2014-08-20 16:40:09 +0200 |
commit | 102348fcd17ab4a862d6f15565f97d8a88cd9231 (patch) | |
tree | 7a78ea26c828e38360b697ad8e74070907b1ea9c /sw/inc/unoframe.hxx | |
parent | 851af7040e05e956a5c8f145679c8141a07fecb4 (diff) |
make SwXFrame derived constructors private
... so that new instances have to be created by the factory functions.
Change-Id: I643a154609b1a277d5cbc22d739ef8e357028f56
Diffstat (limited to 'sw/inc/unoframe.hxx')
-rw-r--r-- | sw/inc/unoframe.hxx | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/sw/inc/unoframe.hxx b/sw/inc/unoframe.hxx index 23af07c96fab..3e5bb973f0ac 100644 --- a/sw/inc/unoframe.hxx +++ b/sw/inc/unoframe.hxx @@ -85,6 +85,10 @@ protected: SwXFrame(SwFrmFmt& rFrmFmt, FlyCntType eSet, const SfxItemPropertySet* pPropSet); + template<class Interface, class Impl> + static css::uno::Reference<Interface> + CreateXFrame(SwDoc & rDoc, SwFrmFmt *const pFrmFmt); + public: static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId(); @@ -163,6 +167,8 @@ class SwXTextFrame : public SwXTextFrameBaseClass, public SwXFrame { protected: + friend class SwXFrame; // just for CreateXFrame + virtual const SwStartNode *GetStartNode() const SAL_OVERRIDE; virtual ::com::sun::star::uno::Reference< @@ -171,10 +177,11 @@ protected: throw (::com::sun::star::uno::RuntimeException) SAL_OVERRIDE; virtual ~SwXTextFrame(); -public: + SwXTextFrame(SwDoc *pDoc); SwXTextFrame(SwFrmFmt& rFmt); +public: static SW_DLLPUBLIC css::uno::Reference<css::text::XTextFrame> CreateXTextFrame(SwDoc & rDoc, SwFrmFmt * pFrmFmt); @@ -240,11 +247,15 @@ class SwXTextGraphicObject : public SwXTextGraphicObjectBaseClass, public SwXFrame { protected: + friend class SwXFrame; // just for CreateXFrame + virtual ~SwXTextGraphicObject(); -public: + SwXTextGraphicObject( SwDoc *pDoc ); SwXTextGraphicObject(SwFrmFmt& rFmt); +public: + static css::uno::Reference<css::text::XTextContent> CreateXTextGraphicObject(SwDoc & rDoc, SwFrmFmt * pFrmFmt); @@ -288,12 +299,15 @@ class SwXTextEmbeddedObject : public SwXTextEmbeddedObjectBaseClass, public SwXFrame { protected: + friend class SwXFrame; // just for CreateXFrame + virtual ~SwXTextEmbeddedObject(); -public: SwXTextEmbeddedObject( SwDoc *pDoc ); SwXTextEmbeddedObject(SwFrmFmt& rFmt); +public: + static css::uno::Reference<css::text::XTextContent> CreateXTextEmbeddedObject(SwDoc & rDoc, SwFrmFmt * pFrmFmt); |