summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-10-06 12:36:04 +0200
committerStephan Bergmann <sbergman@redhat.com>2015-10-06 12:44:36 +0200
commitbaa9c806e8730741d36009065d203121f623d5d9 (patch)
treebcbc19a7208e9a499d07918698bdbefad21706cf /sc
parent051667ec91a3fa4175fc8ae59529ac02b95e0683 (diff)
Return std::unique_ptr from some XclEscherEx::Create... functions
...even if, for now, the return values are directly release()'ed anyway at the call sites Change-Id: I118c74787260b1ec7eabf5e300580aa5a16b2cfa
Diffstat (limited to 'sc')
-rw-r--r--sc/source/filter/inc/xcl97esc.hxx4
-rw-r--r--sc/source/filter/xcl97/xcl97esc.cxx12
2 files changed, 8 insertions, 8 deletions
diff --git a/sc/source/filter/inc/xcl97esc.hxx b/sc/source/filter/inc/xcl97esc.hxx
index a101befb5a7b..2cc94f53390e 100644
--- a/sc/source/filter/inc/xcl97esc.hxx
+++ b/sc/source/filter/inc/xcl97esc.hxx
@@ -101,14 +101,14 @@ public:
void EndDocument();
/** Creates an OCX form control OBJ record from the passed form control.
@descr Writes the form control data to the 'Ctls' stream. */
- XclExpOcxControlObj* CreateOCXCtrlObj(
+ std::unique_ptr<XclExpOcxControlObj> CreateOCXCtrlObj(
::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape,
const Rectangle* pChildAnchor );
private:
tools::SvRef<SotStorageStream> mxCtlsStrm; /// The 'Ctls' stream.
/** Creates a TBX form control OBJ record from the passed form control. */
- XclExpTbxControlObj* CreateTBXCtrlObj(
+ std::unique_ptr<XclExpTbxControlObj> CreateTBXCtrlObj(
::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape,
const Rectangle* pChildAnchor );
diff --git a/sc/source/filter/xcl97/xcl97esc.cxx b/sc/source/filter/xcl97/xcl97esc.cxx
index 6a36a78eb98b..28a2e16a81bc 100644
--- a/sc/source/filter/xcl97/xcl97esc.cxx
+++ b/sc/source/filter/xcl97/xcl97esc.cxx
@@ -251,9 +251,9 @@ EscherExHostAppData* XclEscherEx::StartShape( const Reference< XShape >& rxShape
OSL_TRACE("XclEscherEx::StartShape, this control can't get the property ControlTypeinMSO!");
}
if( nMsCtlType == 2 ) //OCX Form Control
- pCurrXclObj = CreateOCXCtrlObj( rxShape, pChildAnchor );
+ pCurrXclObj = CreateOCXCtrlObj( rxShape, pChildAnchor ).release();
else //TBX Form Control
- pCurrXclObj = CreateTBXCtrlObj( rxShape, pChildAnchor );
+ pCurrXclObj = CreateTBXCtrlObj( rxShape, pChildAnchor ).release();
if( !pCurrXclObj )
pCurrXclObj = new XclObjAny( mrObjMgr, rxShape, &GetDocRef() ); // just a metafile
}
@@ -408,7 +408,7 @@ void XclEscherEx::EndDocument()
mpOutStrm->Seek( 0 );
}
-XclExpOcxControlObj* XclEscherEx::CreateOCXCtrlObj( Reference< XShape > xShape, const Rectangle* pChildAnchor )
+std::unique_ptr<XclExpOcxControlObj> XclEscherEx::CreateOCXCtrlObj( Reference< XShape > xShape, const Rectangle* pChildAnchor )
{
::std::unique_ptr< XclExpOcxControlObj > xOcxCtrl;
@@ -435,10 +435,10 @@ XclExpOcxControlObj* XclEscherEx::CreateOCXCtrlObj( Reference< XShape > xShape,
}
}
}
- return xOcxCtrl.release();
+ return xOcxCtrl;
}
-XclExpTbxControlObj* XclEscherEx::CreateTBXCtrlObj( Reference< XShape > xShape, const Rectangle* pChildAnchor )
+std::unique_ptr<XclExpTbxControlObj> XclEscherEx::CreateTBXCtrlObj( Reference< XShape > xShape, const Rectangle* pChildAnchor )
{
::std::unique_ptr< XclExpTbxControlObj > xTbxCtrl( new XclExpTbxControlObj( mrObjMgr, xShape, pChildAnchor ) );
if( xTbxCtrl->GetObjType() == EXC_OBJTYPE_UNKNOWN )
@@ -450,7 +450,7 @@ XclExpTbxControlObj* XclEscherEx::CreateTBXCtrlObj( Reference< XShape > xShape,
Reference< XControlModel > xCtrlModel = XclControlHelper::GetControlModel( xShape );
ConvertTbxMacro( *xTbxCtrl, xCtrlModel );
}
- return xTbxCtrl.release();
+ return xTbxCtrl;
}
void XclEscherEx::ConvertTbxMacro( XclExpTbxControlObj& rTbxCtrlObj, Reference< XControlModel > xCtrlModel )