[Foreigndesk-commits] CVS: ForeignDesk/Src/ite ForeignDesk.odl,1.1,1.2 ProjectProxy.cpp,1.1,1.2 Proj
Brought to you by:
jonathan_clark
From: Jonathan C. <jon...@us...> - 2002-12-25 03:01:11
|
Update of /cvsroot/foreigndesk/ForeignDesk/Src/ite In directory sc8-pr-cvs1:/tmp/cvs-serv16220 Modified Files: ForeignDesk.odl ProjectProxy.cpp ProjectProxy.h Log Message: Add RecycleFromEx method to the COM API Index: ForeignDesk.odl =================================================================== RCS file: /cvsroot/foreigndesk/ForeignDesk/Src/ite/ForeignDesk.odl,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ForeignDesk.odl 19 Nov 2001 20:45:47 -0000 1.1 --- ForeignDesk.odl 25 Dec 2002 03:01:06 -0000 1.2 *************** *** 69,72 **** --- 69,73 ---- [id(11)] long GetTgtLangID(); [id(12)] long OpenProject(BSTR ProjectPath, long SegmentationType); + [id(13)] long RecycleFromEx(BSTR strFromProject, BSTR strToProject, boolean bSaveForFuzzy, boolean bAutoTranslate, float fFuzzyThreshold, boolean bStopAtBlockMatch); //}}AFX_ODL_METHOD Index: ProjectProxy.cpp =================================================================== RCS file: /cvsroot/foreigndesk/ForeignDesk/Src/ite/ProjectProxy.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ProjectProxy.cpp 19 Nov 2001 20:45:47 -0000 1.1 --- ProjectProxy.cpp 25 Dec 2002 03:01:06 -0000 1.2 *************** *** 103,106 **** --- 103,107 ---- DISP_FUNCTION(CProjectProxy, "GetTgtLangID", GetTgtLangID, VT_I4, VTS_NONE) DISP_FUNCTION(CProjectProxy, "OpenProject", OpenProject, VT_I4, VTS_BSTR VTS_I4) + DISP_FUNCTION(CProjectProxy, "RecycleFromEx", RecycleFromEx, VT_I4, VTS_BSTR VTS_BSTR VTS_BOOL VTS_BOOL VTS_R4 VTS_BOOL) //}}AFX_DISPATCH_MAP END_DISPATCH_MAP() *************** *** 348,349 **** --- 349,400 ---- } + + long CProjectProxy::RecycleFromEx(LPCTSTR strFromProject, LPCTSTR strToProject, BOOL bSaveForFuzzy, BOOL bAutoTranslate, float fFuzzyThreshold, BOOL bStopAtBlockMatch) + { + if (m_pProject) + return ERROR_PROJECT_ALREADY_OPEN; + + CProject *pRecycleFromProject = new CProject (); + + try + { + m_pProject = new CProject (); + if (m_pProject != NULL) + { + if ( !m_pProject->Open(strToProject, true)) + { + m_pProject->Close(); // must close + return ERROR_NO_OPEN; + } + } + else + throw ERROR_PROJECT_NOT_NULL; + + if (pRecycleFromProject != NULL) + { + if (!pRecycleFromProject->Open(strFromProject, true)) + { + pRecycleFromProject->Close(); + return ERROR_NO_OPEN; + } + } + else + throw ERROR_PROJECT_NOT_NULL; + + //m_pProject->Recycle (pRecycleFromProject, false, true); + //m_pProject->Recycle(pRecycleFromProject, false, false, 0, false, true); + m_pProject->Recycle (pRecycleFromProject, bSaveForFuzzy, bAutoTranslate, fFuzzyThreshold, bStopAtBlockMatch, true); + + delete pRecycleFromProject; + } + catch (...) + { + if (pRecycleFromProject) + delete pRecycleFromProject; + + return ERROR_NO_OPEN; + } + + + return ERROR_NONE; + } Index: ProjectProxy.h =================================================================== RCS file: /cvsroot/foreigndesk/ForeignDesk/Src/ite/ProjectProxy.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ProjectProxy.h 19 Nov 2001 20:45:47 -0000 1.1 --- ProjectProxy.h 25 Dec 2002 03:01:07 -0000 1.2 *************** *** 90,93 **** --- 90,94 ---- afx_msg long GetTgtLangID(); afx_msg long OpenProject(LPCTSTR ProjectPath, long SegmentationType); + afx_msg long RecycleFromEx(LPCTSTR strFromProject, LPCTSTR strToProject, BOOL bSaveForFuzzy, BOOL bAutoTranslate, float fFuzzyThreshold, BOOL bStopAtBlockMatch); //}}AFX_DISPATCH DECLARE_DISPATCH_MAP() |