Commit e9603c8e authored by Oleg.Korshul's avatar Oleg.Korshul Committed by Alexander Trofimov

(1.0.0.8) изменения - завязка не на файлы, а на итемы

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@57894 954022d7-b5bf-4e40-9824-e11837661b57
parent 7ac86fdd
...@@ -78,6 +78,7 @@ public: ...@@ -78,6 +78,7 @@ public:
CString m_strDstFilePath; CString m_strDstFilePath;
CAtlArray<CString> m_arChanges; CAtlArray<CString> m_arChanges;
int m_nCountChangesItems;
public: public:
CExecuteParams() : m_arChanges() CExecuteParams() : m_arChanges()
...@@ -91,6 +92,8 @@ public: ...@@ -91,6 +92,8 @@ public:
m_strSrcFilePath = _T(""); m_strSrcFilePath = _T("");
m_strDstFilePath = _T(""); m_strDstFilePath = _T("");
m_nCountChangesItems = -1;
} }
~CExecuteParams() ~CExecuteParams()
{ {
...@@ -119,6 +122,8 @@ public: ...@@ -119,6 +122,8 @@ public:
XmlUtils::CXmlNode oNodeChanges; XmlUtils::CXmlNode oNodeChanges;
if (oNode.GetNode(_T("Changes"), oNodeChanges)) if (oNode.GetNode(_T("Changes"), oNodeChanges))
{ {
m_nCountChangesItems = oNodeChanges.ReadAttributeInt(_T("TopItem"), -1);
XmlUtils::CXmlNodes oNodes; XmlUtils::CXmlNodes oNodes;
oNodeChanges.GetNodes(_T("Change"), oNodes); oNodeChanges.GetNodes(_T("Change"), oNodes);
...@@ -604,6 +609,8 @@ private: ...@@ -604,6 +609,8 @@ private:
pNative->m_strEditorType = m_strEditorType; pNative->m_strEditorType = m_strEditorType;
pNative->SetFilePath(m_strFilePath); pNative->SetFilePath(m_strFilePath);
pNative->m_nMaxChangesNumber = m_oParams.m_nCountChangesItems;
if (js_func_open->IsFunction()) if (js_func_open->IsFunction())
{ {
v8::Handle<v8::Function> func_open = v8::Handle<v8::Function>::Cast(js_func_open); v8::Handle<v8::Function> func_open = v8::Handle<v8::Function>::Cast(js_func_open);
...@@ -634,10 +641,7 @@ private: ...@@ -634,10 +641,7 @@ private:
strException = to_cstring(try_catch.Message()->Get()); // ? strException = to_cstring(try_catch.Message()->Get()); // ?
strError = _T(""); strError = _T("");
int nNumberC = pNative->m_nCurrentChangesNumber; strError.Format(_T("index=\"%d\""), pNative->m_nCurrentChangesNumber);
if (nNumberC >= 0)
--nNumberC;
strError.Format(_T("index=\"%d\""), nNumberC);
return FALSE; return FALSE;
} }
} }
......
...@@ -33,7 +33,9 @@ public: ...@@ -33,7 +33,9 @@ public:
CString m_strImagesDirectory; CString m_strImagesDirectory;
CString m_strEditorType; CString m_strEditorType;
int m_nCurrentChangesNumber; int m_nCurrentChangesNumber;
int m_nMaxChangesNumber;
public: public:
CMemoryStream* m_pStream; CMemoryStream* m_pStream;
...@@ -44,6 +46,7 @@ public: ...@@ -44,6 +46,7 @@ public:
m_pChanges = NULL; m_pChanges = NULL;
m_nCurrentChangesNumber = -1; m_nCurrentChangesNumber = -1;
m_nMaxChangesNumber = -1;
} }
~CNativeControl() ~CNativeControl()
{ {
...@@ -165,17 +168,20 @@ void _SetFileId(const v8::FunctionCallbackInfo<v8::Value>& args) ...@@ -165,17 +168,20 @@ void _SetFileId(const v8::FunctionCallbackInfo<v8::Value>& args)
pNative->SetFileId(to_cstring(args[0])); pNative->SetFileId(to_cstring(args[0]));
} }
void _SetCurrentChangeFile(const v8::FunctionCallbackInfo<v8::Value>& args) void _CheckNextChange(const v8::FunctionCallbackInfo<v8::Value>& args)
{ {
args.GetReturnValue().Set(v8::Undefined());
if (args.Length() < 1)
return;
CNativeControl* pNative = unwrap_nativeobject(args.This()); CNativeControl* pNative = unwrap_nativeobject(args.This());
int nIndex = args[0]->ToInt32()->Value(); pNative->m_nCurrentChangesNumber++;
pNative->m_nCurrentChangesNumber = nIndex; if (-1 != pNative->m_nCurrentChangesNumber)
{
if (pNative->m_nCurrentChangesNumber >= pNative->m_nMaxChangesNumber)
{
args.GetReturnValue().Set(v8::Boolean::New(false));
return;
}
}
args.GetReturnValue().Set(v8::Boolean::New(true));
} }
void _GetFileArrayBuffer(const v8::FunctionCallbackInfo<v8::Value>& args) void _GetFileArrayBuffer(const v8::FunctionCallbackInfo<v8::Value>& args)
...@@ -269,7 +275,7 @@ v8::Handle<v8::ObjectTemplate> CreateNativeControlTemplate(v8::Isolate* isolate) ...@@ -269,7 +275,7 @@ v8::Handle<v8::ObjectTemplate> CreateNativeControlTemplate(v8::Isolate* isolate)
result->Set(v8::String::NewSymbol("GetFileString"), v8::FunctionTemplate::New(_GetFileString)); result->Set(v8::String::NewSymbol("GetFileString"), v8::FunctionTemplate::New(_GetFileString));
result->Set(v8::String::NewSymbol("GetEditorType"), v8::FunctionTemplate::New(_GetEditorType)); result->Set(v8::String::NewSymbol("GetEditorType"), v8::FunctionTemplate::New(_GetEditorType));
result->Set(v8::String::NewSymbol("SetCurrentChangeFile"), v8::FunctionTemplate::New(_SetCurrentChangeFile)); result->Set(v8::String::NewSymbol("CheckNextChange"), v8::FunctionTemplate::New(_CheckNextChange));
result->Set(v8::String::NewSymbol("GetCountChanges"), v8::FunctionTemplate::New(_GetChangesCount)); result->Set(v8::String::NewSymbol("GetCountChanges"), v8::FunctionTemplate::New(_GetChangesCount));
result->Set(v8::String::NewSymbol("GetChangesFile"), v8::FunctionTemplate::New(_GetChangesFile)); result->Set(v8::String::NewSymbol("GetChangesFile"), v8::FunctionTemplate::New(_GetChangesFile));
......
...@@ -2,6 +2,6 @@ ...@@ -2,6 +2,6 @@
//1 //1
//0 //0
//0 //0
//7 //8
#define INTVER 1,0,0,7 #define INTVER 1,0,0,8
#define STRVER "1,0,0,7\0" #define STRVER "1,0,0,8\0"
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