Commit 704d501a authored by Elen.Subbotina's avatar Elen.Subbotina Committed by Alexander Trofimov

поправлена собираемость компонент под Win32

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@58916 954022d7-b5bf-4e40-9824-e11837661b57
parent 1e8dab25
...@@ -537,6 +537,58 @@ ...@@ -537,6 +537,58 @@
RelativePath=".\DocWrapper\FontProcessor.h" RelativePath=".\DocWrapper\FontProcessor.h"
> >
</File> </File>
<File
RelativePath="..\ASCPresentationEditor\OfficeDrawing\Shapes\BaseShape\PPTShape\Formula.cpp"
>
</File>
<File
RelativePath="..\ASCPresentationEditor\OfficeDrawing\Shapes\BaseShape\PPTXShape\Formula.cpp"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
ObjectFile="$(IntDir)\$(InputName)1.obj"
XMLDocumentationFileName="$(IntDir)\$(InputName)1.xdc"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
ObjectFile="$(IntDir)\$(InputName)1.obj"
XMLDocumentationFileName="$(IntDir)\$(InputName)1.xdc"
/>
</FileConfiguration>
<FileConfiguration
Name="ReleaseASC|Win32"
>
<Tool
Name="VCCLCompilerTool"
ObjectFile="$(IntDir)\$(InputName)1.obj"
XMLDocumentationFileName="$(IntDir)\$(InputName)1.xdc"
/>
</FileConfiguration>
<FileConfiguration
Name="ReleaseOpenSource|Win32"
>
<Tool
Name="VCCLCompilerTool"
ObjectFile="$(IntDir)\$(InputName)1.obj"
XMLDocumentationFileName="$(IntDir)\$(InputName)1.xdc"
/>
</FileConfiguration>
</File>
<File
RelativePath="..\ASCPresentationEditor\OfficeDrawing\Shapes\BaseShape\PPTXShape\Formula.h"
>
</File>
<File
RelativePath="..\ASCPresentationEditor\OfficeDrawing\Shapes\BaseShape\PPTShape\Formula.h"
>
</File>
</Filter> </Filter>
<Filter <Filter
Name="XLSX" Name="XLSX"
......
...@@ -43,7 +43,6 @@ ...@@ -43,7 +43,6 @@
#include <atltypes.h> #include <atltypes.h>
#include <atlctl.h> #include <atlctl.h>
#include <atlhost.h> #include <atlhost.h>
#include <atlcoll.h>
using namespace ATL; using namespace ATL;
#include "../Common/ASCUtils.h" #include "../Common/ASCUtils.h"
......
...@@ -2,6 +2,6 @@ ...@@ -2,6 +2,6 @@
//2 //2
//0 //0
//0 //0
//226 //232
#define INTVER 2,0,0,226 #define INTVER 2,0,0,232
#define STRVER "2,0,0,226\0" #define STRVER "2,0,0,232\0"
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
#include <atltypes.h> #include <atltypes.h>
#include <atlctl.h> #include <atlctl.h>
#include <atlhost.h> #include <atlhost.h>
#include <atlcoll.h>
#else #else
#include "../../Common/DocxFormat/Source/Base/ASCString.h" #include "../../Common/DocxFormat/Source/Base/ASCString.h"
#include "../../DesktopEditor/common/Types.h" #include "../../DesktopEditor/common/Types.h"
...@@ -298,21 +298,6 @@ namespace NSBinPptxRW ...@@ -298,21 +298,6 @@ namespace NSBinPptxRW
} }
} }
#ifdef _WIN32
template<typename T>
void WriteRecordArray(int type, int subtype, const CAtlArray<T>& val)
{
StartRecord(type);
ULONG len = (ULONG)val.GetCount();
WriteULONG(len);
for (ULONG i = 0; i < len; ++i)
WriteRecord1(subtype, val[i]);
EndRecord();
}
#endif #ifdef _WIN32
template<typename T> template<typename T>
void WriteRecordArray(int type, int subtype, const std::vector<T>& val) void WriteRecordArray(int type, int subtype, const std::vector<T>& val)
{ {
......
...@@ -47,7 +47,7 @@ namespace PPTX ...@@ -47,7 +47,7 @@ namespace PPTX
{ {
DWORD RGB = 0; DWORD RGB = 0;
CString str = val.get(); CString str = val.get();
if (!str.empty()) if (str != L"")
{ {
switch((CHAR)str[0]) switch((CHAR)str[0])
{ {
......
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
#include "./../../WrapperWritingElement.h" #include "./../../WrapperWritingElement.h"
#include <list>
namespace PPTX namespace PPTX
{ {
namespace Logic namespace Logic
...@@ -86,12 +88,12 @@ namespace PPTX ...@@ -86,12 +88,12 @@ namespace PPTX
} }
case 1: case 1:
{ {
m_strAttributesNames.AddTail(pReader->GetString2()); m_strAttributesNames.push_back(pReader->GetString2());
break; break;
} }
case 2: case 2:
{ {
m_strAttributesValues.AddTail(pReader->GetString2()); m_strAttributesValues.push_back(pReader->GetString2());
break; break;
} }
default: default:
...@@ -107,18 +109,21 @@ namespace PPTX ...@@ -107,18 +109,21 @@ namespace PPTX
pWriter->WriteString1(0, m_strNodeName); pWriter->WriteString1(0, m_strNodeName);
POSITION pos = m_strAttributesNames.GetHeadPosition();
while (NULL != pos) std::list<CString>::const_iterator pos1 = m_strAttributesNames.begin();
while (pos1 != m_strAttributesNames.end())
{ {
const CString& s = m_strAttributesNames.GetNext(pos); const CString& s = *pos1;
pWriter->WriteString1(1, s); pWriter->WriteString1(1, s);
pos1++;
} }
pos = m_strAttributesValues.GetHeadPosition(); std::list<CString>::const_iterator pos2 = m_strAttributesValues.begin();
while (NULL != pos) while (pos2 != m_strAttributesValues.end())
{ {
const CString& s = m_strAttributesValues.GetNext(pos); const CString& s = *pos2;;
pWriter->WriteString1(2, s); pWriter->WriteString1(2, s);
pos2++;
} }
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeEnd); pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeEnd);
...@@ -129,20 +134,24 @@ namespace PPTX ...@@ -129,20 +134,24 @@ namespace PPTX
pWriter->StartAttributes(); pWriter->StartAttributes();
size_t c1 = m_strAttributesNames.GetCount(); // ?? -
size_t c2 = m_strAttributesValues.GetCount(); //size_t c1 = m_strAttributesNames.GetCount();
//size_t c2 = m_strAttributesValues.GetCount();
if (c1 == c2) //if (c1 == c2)
{ {
POSITION pos1 = m_strAttributesNames.GetHeadPosition(); std::list<CString>::const_iterator pos1 = m_strAttributesNames.begin();
POSITION pos2 = m_strAttributesValues.GetHeadPosition(); std::list<CString>::const_iterator pos2 = m_strAttributesValues.begin();
while (pos1 != NULL && pos2 != NULL) while (pos1 != m_strAttributesNames.end() && pos2 != m_strAttributesValues.end())
{ {
const CString& s1 = m_strAttributesNames.GetNext(pos1); const CString& s1 = *pos1;
const CString& s2 = m_strAttributesValues.GetNext(pos2); const CString& s2 = *pos2;
pWriter->WriteAttribute(s1, s2); pWriter->WriteAttribute(s1, s2);
pos1++;
pos2++;
} }
} }
...@@ -184,20 +193,23 @@ namespace PPTX ...@@ -184,20 +193,23 @@ namespace PPTX
pWriter->StartAttributes(); pWriter->StartAttributes();
size_t c1 = m_strAttributesNames.GetCount(); //size_t c1 = m_strAttributesNames.GetCount();
size_t c2 = m_strAttributesValues.GetCount(); //size_t c2 = m_strAttributesValues.GetCount();
if (c1 == c2) //if (c1 == c2)
{ {
POSITION pos1 = m_strAttributesNames.GetHeadPosition(); std::list<CString>::const_iterator pos1 = m_strAttributesNames.begin();
POSITION pos2 = m_strAttributesValues.GetHeadPosition(); std::list<CString>::const_iterator pos2 = m_strAttributesValues.begin();
while (pos1 != NULL && pos2 != NULL) while (pos1 != m_strAttributesNames.end() && pos2 != m_strAttributesValues.end())
{ {
const CString& s1 = m_strAttributesNames.GetNext(pos1); const CString& s1 = *pos1;
const CString& s2 = m_strAttributesValues.GetNext(pos2); const CString& s2 = *pos2;
pWriter->WriteAttribute(s1, s2); pWriter->WriteAttribute(s1, s2);
pos1++;
pos2++;
} }
} }
...@@ -208,8 +220,8 @@ namespace PPTX ...@@ -208,8 +220,8 @@ namespace PPTX
public: public:
CString m_strNodeName; CString m_strNodeName;
CAtlList<CString> m_strAttributesNames; std::list<CString> m_strAttributesNames;
CAtlList<CString> m_strAttributesValues; std::list<CString> m_strAttributesValues;
protected: protected:
virtual void FillParentPointersForChilds(){}; virtual void FillParentPointersForChilds(){};
......
...@@ -930,8 +930,8 @@ namespace NSPresentationEditor ...@@ -930,8 +930,8 @@ namespace NSPresentationEditor
} }
void SetToRenderer(IRenderer *pRenderer) void SetToRenderer(IRenderer *pRenderer)
{ {
pRenderer->put_FontName(Name); pRenderer->put_FontName(string2std_string(Name));
pRenderer->put_FontPath(Path); pRenderer->put_FontPath(string2std_string(Path));
pRenderer->put_FontSize(Size); pRenderer->put_FontSize(Size);
......
#pragma once #pragma once
//#include "stdafx.h" //#include "stdafx.h"
#include "Formula.h" #include "Formula.h"
LONG NSGuidesVML::CFormula::Calculate(NSGuidesVML::CFormulasManager* pManager) LONG NSGuidesVML::CFormula::Calculate(NSGuidesVML::CFormulasManager* pManager)
{ {
if ((0 > m_lIndex) || (m_lIndex >= pManager->m_arResults.size())) if ((0 > m_lIndex) || (m_lIndex >= pManager->m_arResults.size()))
......
...@@ -2,18 +2,18 @@ ...@@ -2,18 +2,18 @@
#include "Formula.h" #include "Formula.h"
double NSGuidesOOXML::CFormula::Calculate(NSGuidesOOXML::CFormulaManager& pManager) double NSGuidesOOXML::CFormula::Calculate(NSGuidesOOXML::CFormulaManager* pManager)
{ {
if ((0 == m_lIndex) || (-m_lIndex > pManager.Guides->size()) || (m_lIndex > pManager.Adjustments->size())) if ((0 == m_lIndex) || (-m_lIndex > pManager->Guides->size()) || (m_lIndex > pManager->Adjustments->size()))
return 0.0; return 0.0;
if((m_lIndex < 0) && (dNonDefResult > (*pManager.Guides)[-m_lIndex-1])) if((m_lIndex < 0) && (dNonDefResult > (*pManager->Guides)[-m_lIndex-1]))
return (*pManager.Guides)[-m_lIndex-1]; return (*pManager->Guides)[-m_lIndex-1];
if((m_lIndex > 0) && (NonDefResult != (*pManager.Adjustments)[m_lIndex-1])) if((m_lIndex > 0) && (NonDefResult != (*pManager->Adjustments)[m_lIndex-1]))
return (*pManager.Adjustments)[m_lIndex-1]; return (*pManager->Adjustments)[m_lIndex-1];
double a = pManager.GetValue(m_lParam1); double a = pManager->GetValue(m_lParam1);
double b = pManager.GetValue(m_lParam2); double b = pManager->GetValue(m_lParam2);
double c = pManager.GetValue(m_lParam3); double c = pManager->GetValue(m_lParam3);
//double c = (double)c1; //double c = (double)c1;
double dRes = 0.0; double dRes = 0.0;
...@@ -51,11 +51,11 @@ double NSGuidesOOXML::CFormula::Calculate(NSGuidesOOXML::CFormulaManager& pManag ...@@ -51,11 +51,11 @@ double NSGuidesOOXML::CFormula::Calculate(NSGuidesOOXML::CFormulaManager& pManag
//long lResult = (long)dRes; //long lResult = (long)dRes;
if(m_lIndex < 0) if(m_lIndex < 0)
{ {
(*pManager.Guides)[-m_lIndex-1] = dRes; (*pManager->Guides)[-m_lIndex-1] = dRes;
// //
pManager.mapGuides.insert(std::pair<CString, long>(m_sName, -m_lIndex-1)); pManager->mapGuides.insert(std::pair<CString, long>(m_sName, -m_lIndex-1));
} }
else else
(*pManager.Adjustments)[m_lIndex-1] = (long)dRes; (*pManager->Adjustments)[m_lIndex-1] = (long)dRes;
return dRes; return dRes;
} }
...@@ -116,7 +116,7 @@ namespace NSGuidesOOXML ...@@ -116,7 +116,7 @@ namespace NSGuidesOOXML
m_lParam3 = oArrayParams[3]; m_lParam3 = oArrayParams[3];
} }
double Calculate(CFormulaManager& pManager); double Calculate(CFormulaManager* pManager);
}; };
class CFormulaManager class CFormulaManager
...@@ -324,14 +324,14 @@ namespace NSGuidesOOXML ...@@ -324,14 +324,14 @@ namespace NSGuidesOOXML
double res = (*Guides)[numGuide->second]; double res = (*Guides)[numGuide->second];
if(res < dNonDefResult) if(res < dNonDefResult)
return res; return res;
return strGuides[numGuide->second].Calculate(*this); return strGuides[numGuide->second].Calculate(this);
} }
if(numAdj != mapAdjustments.end()) if(numAdj != mapAdjustments.end())
{ {
long res = (*Adjustments)[numAdj->second]; long res = (*Adjustments)[numAdj->second];
if(res != NonDefResult) if(res != NonDefResult)
return res; return res;
return strAdjustments[numAdj->second].Calculate(*this); return strAdjustments[numAdj->second].Calculate(this);
} }
return XmlUtils::GetInteger(str); return XmlUtils::GetInteger(str);
} }
...@@ -348,7 +348,7 @@ namespace NSGuidesOOXML ...@@ -348,7 +348,7 @@ namespace NSGuidesOOXML
{ {
Clear(); Clear();
for(long i = 0; i < strGuides.size(); i++) for(long i = 0; i < strGuides.size(); i++)
(*Guides)[i] = strGuides[i].Calculate(*this); (*Guides)[i] = strGuides[i].Calculate(this);
} }
}; };
} }
...@@ -202,5 +202,27 @@ static DWORD GetSysColor(const int nIndex) ...@@ -202,5 +202,27 @@ static DWORD GetSysColor(const int nIndex)
} }
#else
#ifndef COLOR_HOTLIGHT
#define COLOR_HOTLIGHT 26
#endif
#ifndef COLOR_GRADIENTACTIVECAPTION
#define COLOR_GRADIENTACTIVECAPTION 27
#endif
#ifndef COLOR_GRADIENTINACTIVECAPTION
#define COLOR_GRADIENTINACTIVECAPTION 28
#endif
#ifndef COLOR_MENUHILIGHT
#define COLOR_MENUHILIGHT 29
#endif
#ifndef COLOR_MENUBAR
#define COLOR_MENUBAR 30
#endif
#endif //#ifndef _WIN32 #endif //#ifndef _WIN32
#endif // #ifndef _ASC_WIN_API #endif // #ifndef _ASC_WIN_API
...@@ -52,7 +52,6 @@ ...@@ -52,7 +52,6 @@
#include <atlstr.h> #include <atlstr.h>
#include <atltypes.h> #include <atltypes.h>
//#include <atlcoll.h>
typedef unsigned int size_t; typedef unsigned int size_t;
#include "../../../ASCUtils.h" #include "../../../ASCUtils.h"
......
...@@ -95,14 +95,20 @@ namespace NSCommon ...@@ -95,14 +95,20 @@ namespace NSCommon
else else
this->m_pPointer = new Type( (const Type&)*(oOther.m_pPointer) ); this->m_pPointer = new Type( (const Type&)*(oOther.m_pPointer) );
} }
nullable(const XmlUtils::CXmlNode& oNode) //nullable(const XmlUtils::CXmlNode& oNode)
//{
// if (oNode.IsValid())
// this->m_pPointer = new Type(oNode);
// else
// this->m_pPointer = NULL;
//}
nullable(XmlUtils::CXmlNode& oNode)
{ {
if (oNode.IsValid()) if (oNode.IsValid())
this->m_pPointer = new Type(oNode); this->m_pPointer = new Type(oNode);
else else
this->m_pPointer = NULL; this->m_pPointer = NULL;
} }
nullable<Type>& operator=(XmlUtils::CXmlNode& oNode) nullable<Type>& operator=(XmlUtils::CXmlNode& oNode)
{ {
RELEASEOBJECT(this->m_pPointer); RELEASEOBJECT(this->m_pPointer);
......
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
#include "../Base/SmartPtr.h" #include "../Base/SmartPtr.h"
#ifdef _WIN32 #ifdef _WIN32
#include <atlcoll.h>
#include <atlenc.h> #include <atlenc.h>
#include <comutil.h> #include <comutil.h>
#endif #endif
......
...@@ -156,17 +156,10 @@ namespace XmlUtils ...@@ -156,17 +156,10 @@ namespace XmlUtils
} }
#ifdef _WIN32 #ifdef _WIN32
template <typename T> template <typename T>
AVSINLINE void WriteArray(const CAtlArray<T>& oArray) AVSINLINE void WriteArray(const CString& strNodeName, const std::vector<T>& oArray)
{
size_t count = oArray.GetCount();
for (size_t i = 0; i < count; ++i)
m_strValue += oArray[i].toXML();
}
template <typename T>
AVSINLINE void WriteArray(const CString& strNodeName, const CAtlArray<T>& oArray)
{ {
m_strValue += (_T("<") + strNodeName + _T(">")); m_strValue += (_T("<") + strNodeName + _T(">"));
size_t count = oArray.GetCount(); size_t count = oArray.size();
for (size_t i = 0; i < count; ++i) for (size_t i = 0; i < count; ++i)
m_strValue += oArray[i].toXML(); m_strValue += oArray[i].toXML();
m_strValue += (_T("</") + strNodeName + _T(">")); m_strValue += (_T("</") + strNodeName + _T(">"));
...@@ -180,16 +173,6 @@ namespace XmlUtils ...@@ -180,16 +173,6 @@ namespace XmlUtils
for (size_t i = 0; i < count; ++i) for (size_t i = 0; i < count; ++i)
m_strValue += oArray[i].toXML(); m_strValue += oArray[i].toXML();
} }
template <typename T>
AVSINLINE void WriteArray(const CString& strNodeName, const std::vector<T>& oArray)
{
m_strValue += (_T("<") + strNodeName + _T(">"));
size_t count = oArray.size();
for (size_t i = 0; i < count; ++i)
m_strValue += oArray[i].toXML();
m_strValue += (_T("</") + strNodeName + _T(">"));
}
// --------------------------------------------------------------- // // --------------------------------------------------------------- //
AVSINLINE void Write2(const CString& strName, const int& value) AVSINLINE void Write2(const CString& strName, const int& value)
{ {
......
...@@ -1117,7 +1117,7 @@ namespace XmlUtils ...@@ -1117,7 +1117,7 @@ namespace XmlUtils
}; };
class CDispatchPropertyList class CDispatchPropertyList
: public CAtlArray<SDispatchProperty> : public std::vector<SDispatchProperty>
{ {
public: public:
CDispatchPropertyList() CDispatchPropertyList()
...@@ -1136,6 +1136,24 @@ namespace XmlUtils ...@@ -1136,6 +1136,24 @@ namespace XmlUtils
SafeArrayDestroy(GetAt(nIndex).m_varValue.parray); SafeArrayDestroy(GetAt(nIndex).m_varValue.parray);
} }
} }
const SDispatchProperty& GetAt( size_t iElement)
{
return at(iElement);
}
size_t GetCount() { return size();}
size_t Add()
{
SDispatchProperty elem;
push_back(elem);
return size()-1;
}
size_t Add(SDispatchProperty & elem)
{
push_back(elem);
return size()-1;
}
}; };
// //
...@@ -1766,8 +1784,8 @@ namespace XmlUtils ...@@ -1766,8 +1784,8 @@ namespace XmlUtils
tempNode->get_nodeName(&bsName); tempNode->get_nodeName(&bsName);
tempNode->get_text(&bsValue); tempNode->get_text(&bsValue);
strNames.AddTail((CString)bsName); strNames.push_back((CString)bsName);
strValues.AddTail((CString)bsValue); strValues.push_back((CString)bsValue);
SysFreeString(bsName); SysFreeString(bsName);
SysFreeString(bsValue); SysFreeString(bsValue);
...@@ -2457,47 +2475,6 @@ namespace XmlUtils ...@@ -2457,47 +2475,6 @@ namespace XmlUtils
_bstr_t bsName = strName; _bstr_t bsName = strName;
return UpdateAttributeOrValueStringBase(bsName, strVal); return UpdateAttributeOrValueStringBase(bsName, strVal);
} }
//-----------------------------------------------------------------------------
template <typename T>
AVSINLINE void LoadArray(const CString& sName, CAtlArray<T>& arList)
{
XmlUtils::CXmlNodes oNodes;
if (GetNodes(sName, oNodes))
{
int nCount = oNodes.GetCount();
for (int i = 0; i < nCount; ++i)
{
XmlUtils::CXmlNode oItem;
oNodes.GetAt(i, oItem);
arList.Add();
arList[i].fromXML(oItem);
}
}
}
template <typename T>
AVSINLINE void LoadArray(const CString& sName, const CString& sSubName, CAtlArray<T>& arList)
{
XmlUtils::CXmlNode oNode;
if (GetNode(sName, oNode))
{
XmlUtils::CXmlNodes oNodes;
if (oNode.GetNodes(sSubName, oNodes))
{
int nCount = oNodes.GetCount();
for (int i = 0; i < nCount; ++i)
{
XmlUtils::CXmlNode oItem;
oNodes.GetAt(i, oItem);
arList.Add();
arList[i].fromXML(oItem);
}
}
}
}
//--------------------------------------------------------------------------------- //---------------------------------------------------------------------------------
template <typename T> template <typename T>
AVSINLINE void LoadArray(const CString& sName, std::vector<T>& arList) AVSINLINE void LoadArray(const CString& sName, std::vector<T>& arList)
......
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