Kaydet (Commit) baa9c806 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

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
üst 051667ec
......@@ -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 );
......
......@@ -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 )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment