@attention [注意事项说明]
*/
// ------------------------------------------------
CATBoolean YFBOCreMarkLinesCmd::InsertNewPart(
CATISpecObject_var& ospNewPart
)
{
CATFrmEditor *pEditor = CATFrmEditor::GetCurrentEditor();
if (pEditor==NULL)
{
return FALSE;
}
CATDocument *pDoc = NULL;
pDoc = pEditor->GetDocument();
if (NULL == pDoc)
{
return FALSE;
}
// Search for the document's root product (RootProduct)
CATUnicodeString ustrTemp = "";
CATIProduct* piProductOnRoot = NULL;
CATIDocRoots* piDocRootsOnDoc = NULL;
CATISpecObject_var spSpecOnDocRoots = NULL_var;
HRESULT rc = pDoc->QueryInterface(IID_CATIDocRoots,(void) &piDocRootsOnDoc);
if ( SUCCEEDED(rc) )
{
CATListValCATBaseUnknown_var pRootProducts = piDocRootsOnDoc->GiveDocRoots();
if (NULL != pRootProducts)
{
if (pRootProducts->Size())
{
CATBaseUnknown_var spBaseTemp = (pRootProducts)[1];
if ( NULL_var != spBaseTemp )