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

menu classes bugs

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@58084 954022d7-b5bf-4e40-9824-e11837661b57
parent 2034b54f
......@@ -19,6 +19,38 @@
#define min(a,b) (((a) < (b)) ? (a) : (b))
#endif
namespace NSEditorApi
{
class IMenuEventDataBase
{
protected:
ULONG m_lRef;
public:
IMenuEventDataBase()
{
m_lRef = 1;
}
virtual ~IMenuEventDataBase()
{
}
virtual ULONG AddRef()
{
++m_lRef;
return m_lRef;
}
virtual ULONG Release()
{
ULONG ret = --m_lRef;
if (0 == m_lRef)
delete this;
return ret;
}
};
}
namespace NSEditorApi
{
......@@ -181,7 +213,7 @@ namespace NSEditorApi
}
template<typename Type>
class js_wrapper
class js_wrapper : public NSEditorApi::IMenuEventDataBase
{
protected:
Type* m_pPointer;
......@@ -292,11 +324,10 @@ public:
}
// colors
namespace NSEditorApi
{
class CAscColorSimple
class CAscColorSimple : public IMenuEventDataBase
{
public:
unsigned char R;
......@@ -312,9 +343,12 @@ namespace NSEditorApi
B = 0;
A = 0;
}
virtual ~CAscColorSimple()
{
}
};
class CColorMod
class CColorMod : public IMenuEventDataBase
{
private:
std::string m_sName;
......@@ -326,12 +360,15 @@ namespace NSEditorApi
m_sName = "";
m_nValue = 0;
}
virtual ~CColorMod()
{
}
LINK_PROPERTY_STRINGA(Name)
LINK_PROPERTY_INT(Value)
};
class CColorMods
class CColorMods : public IMenuEventDataBase
{
private:
CColorMod* m_pMods;
......@@ -343,7 +380,7 @@ namespace NSEditorApi
m_pMods = NULL;
m_lCount = 0;
}
~CColorMods()
virtual ~CColorMods()
{
if (NULL != m_pMods)
delete [] m_pMods;
......@@ -359,7 +396,7 @@ namespace NSEditorApi
}
};
class CAscColor
class CAscColor : public IMenuEventDataBase
{
private:
js_wrapper<int> m_nType; // c_oAscColor_COLOR_TYPE
......@@ -380,7 +417,7 @@ namespace NSEditorApi
CAscColor()
{
}
~CAscColor()
virtual ~CAscColor()
{
}
......@@ -399,7 +436,7 @@ namespace NSEditorApi
// document
namespace NSEditorApi
{
class CAscEditorPermissions
class CAscEditorPermissions : public IMenuEventDataBase
{
private:
bool m_bCanEdit;
......@@ -419,6 +456,9 @@ namespace NSEditorApi
m_bIsAutosaveEnabled = true;
m_nAutosaveMinInterval = 300;
}
virtual ~CAscEditorPermissions()
{
}
public:
LINK_PROPERTY_BOOL(CanEdit)
......@@ -429,7 +469,7 @@ namespace NSEditorApi
LINK_PROPERTY_INT(AutosaveMinInterval)
};
class CAscLicense
class CAscLicense : public IMenuEventDataBase
{
private:
js_wrapper<std::wstring> m_sCustomer;
......@@ -449,6 +489,9 @@ namespace NSEditorApi
m_sCustomerInfo.SetNull();
m_sCustomerLogo.SetNull();
}
virtual ~CAscLicense()
{
}
LINK_PROPERTY_STRING_JS(Customer)
LINK_PROPERTY_STRING_JS(CustomerAddr)
......@@ -458,7 +501,7 @@ namespace NSEditorApi
LINK_PROPERTY_STRING_JS(CustomerLogo)
};
class CAscDocumentOpenProgress
class CAscDocumentOpenProgress : public IMenuEventDataBase
{
private:
int m_nType;
......@@ -480,6 +523,9 @@ namespace NSEditorApi
m_nImagesCount = 0;
m_nImageCurrent = 0;
}
virtual ~CAscDocumentOpenProgress()
{
}
LINK_PROPERTY_INT(Type)
LINK_PROPERTY_INT(FontsCount)
......@@ -488,7 +534,7 @@ namespace NSEditorApi
LINK_PROPERTY_INT(ImageCurrent)
};
class CAscDocumentInfo
class CAscDocumentInfo : public IMenuEventDataBase
{
private:
js_wrapper<std::wstring> m_sId;
......@@ -510,6 +556,9 @@ namespace NSEditorApi
m_sUserId.SetNull();
m_sUserName.SetNull();
}
virtual ~CAscDocumentInfo()
{
}
LINK_PROPERTY_STRING_JS(Id)
LINK_PROPERTY_STRING_JS(Url)
......@@ -709,7 +758,7 @@ namespace NSEditorApi
LINK_PROPERTY_INT_JS(PathType)
};
class CAscFill
class CAscFill : public IMenuEventDataBase
{
private:
js_wrapper<int> m_nType;
......@@ -720,6 +769,9 @@ namespace NSEditorApi
CAscFill()
{
}
virtual ~CAscFill()
{
}
LINK_PROPERTY_INT_JS(Type)
LINK_PROPERTY_INT_JS(Transparent)
......@@ -731,7 +783,7 @@ namespace NSEditorApi
// stroke
namespace NSEditorApi
{
class CAscStroke
class CAscStroke : public IMenuEventDataBase
{
private:
js_wrapper<int> m_nType;
......@@ -754,6 +806,9 @@ namespace NSEditorApi
{
m_bCanChangeArrows = false;
}
virtual ~CAscStroke()
{
}
LINK_PROPERTY_OBJECT_JS(CAscColor, Color)
......@@ -774,7 +829,7 @@ namespace NSEditorApi
// shape/image/chart props
namespace NSEditorApi
{
class CAscShapeProp
class CAscShapeProp : public IMenuEventDataBase
{
js_wrapper<std::wstring> m_sType;
......@@ -792,6 +847,9 @@ namespace NSEditorApi
m_bCanFill = true;
m_bFromChart = false;
}
virtual ~CAscShapeProp()
{
}
LINK_PROPERTY_STRING_JS(Type)
LINK_PROPERTY_BOOL_JS(CanFill)
......@@ -943,7 +1001,7 @@ namespace NSEditorApi
LINK_PROPERTY_INT_JS(AxisType)
};
class CAscChartProperties
class CAscChartProperties : public IMenuEventDataBase
{
private:
js_wrapper<int> m_nStyle;
......@@ -985,6 +1043,9 @@ namespace NSEditorApi
CAscChartProperties()
{
}
virtual ~CAscChartProperties()
{
}
LINK_PROPERTY_INT_JS(Style)
LINK_PROPERTY_INT_JS(Title)
......@@ -1020,7 +1081,7 @@ namespace NSEditorApi
LINK_PROPERTY_BOOL_JS(Smooth)
};
class CAscImageProp
class CAscImageProp : public IMenuEventDataBase
{
private:
js_wrapper<bool> m_bCanBeFlow;
......@@ -1058,6 +1119,13 @@ namespace NSEditorApi
js_wrapper<int> m_nVerticalTextAlign;
public:
CAscImageProp()
{
}
virtual ~CAscImageProp()
{
}
LINK_PROPERTY_BOOL_JS(CanBeFlow)
LINK_PROPERTY_DOUBLE_JS(Width)
......@@ -1096,7 +1164,7 @@ namespace NSEditorApi
// section
namespace NSEditorApi
{
class CAscSection
class CAscSection : public IMenuEventDataBase
{
private:
js_wrapper<double> m_dPageWidth;
......@@ -1118,6 +1186,9 @@ namespace NSEditorApi
m_dMarginTop = (double)0;
m_dMarginBottom = (double)0;
}
virtual ~CAscSection()
{
}
LINK_PROPERTY_DOUBLE_JS(PageWidth)
LINK_PROPERTY_DOUBLE_JS(PageHeight)
......@@ -1170,7 +1241,7 @@ namespace NSEditorApi
LINK_PROPERTY_INT_JS(Index)
};
class CAscTextPr
class CAscTextPr : public IMenuEventDataBase
{
private:
js_wrapper<bool> m_bBold;
......@@ -1196,6 +1267,9 @@ namespace NSEditorApi
CAscTextPr()
{
}
virtual ~CAscTextPr()
{
}
LINK_PROPERTY_BOOL_JS(Bold)
LINK_PROPERTY_BOOL_JS(Italic)
......@@ -1419,7 +1493,7 @@ namespace NSEditorApi
LINK_PROPERTY_OBJECT_JS(CAscTextFontFamily, FontFamily)
};
class CAscParagraphPr
class CAscParagraphPr : public IMenuEventDataBase
{
private:
js_wrapper<bool> m_bContextualSpacing;
......@@ -1464,6 +1538,9 @@ namespace NSEditorApi
CAscParagraphPr()
{
}
virtual ~CAscParagraphPr()
{
}
LINK_PROPERTY_BOOL_JS(ContextualSpacing)
......@@ -1698,7 +1775,7 @@ namespace NSEditorApi
}
};
class CAscTableProperties
class CAscTableProperties : public IMenuEventDataBase
{
private:
js_wrapper<bool> m_bCanBeFlow;
......@@ -1747,6 +1824,9 @@ namespace NSEditorApi
m_bCellSelect = false;
m_bLocked = false;
}
virtual ~CAscTableProperties()
{
}
LINK_PROPERTY_BOOL_JS(CanBeFlow)
LINK_PROPERTY_BOOL_JS(CellSelect)
......@@ -1801,7 +1881,7 @@ namespace NSEditorApi
// header/footer
namespace NSEditorApi
{
class CAscHeaderFooterPr
class CAscHeaderFooterPr : public IMenuEventDataBase
{
private:
js_wrapper<int> m_nType;
......@@ -1816,6 +1896,9 @@ namespace NSEditorApi
CAscHeaderFooterPr()
{
}
virtual ~CAscHeaderFooterPr()
{
}
LINK_PROPERTY_INT_JS(Type)
LINK_PROPERTY_DOUBLE_JS(Position)
......@@ -1829,7 +1912,7 @@ namespace NSEditorApi
// hyperlink
namespace NSEditorApi
{
class CAscHyperlinkPr
class CAscHyperlinkPr : public IMenuEventDataBase
{
private:
js_wrapper<std::wstring> m_sText;
......@@ -1841,6 +1924,9 @@ namespace NSEditorApi
CAscHyperlinkPr()
{
}
virtual ~CAscHyperlinkPr()
{
}
LINK_PROPERTY_STRING_JS(Text)
LINK_PROPERTY_STRING_JS(Value)
......@@ -1851,7 +1937,7 @@ namespace NSEditorApi
// common
namespace NSEditorApi
{
class CAscColorScheme
class CAscColorScheme : public IMenuEventDataBase
{
private:
std::wstring m_sName;
......@@ -1868,7 +1954,7 @@ namespace NSEditorApi
m_pColors = NULL;
m_lColorsCount = 0;
}
~CAscColorScheme()
virtual ~CAscColorScheme()
{
if (m_bIsDelete)
{
......@@ -1910,7 +1996,7 @@ namespace NSEditorApi
}
};
class CAscTexture
class CAscTexture : public IMenuEventDataBase
{
private:
int m_nId;
......@@ -1922,6 +2008,9 @@ namespace NSEditorApi
m_nId = 0;
m_sImage = L"";
}
virtual ~CAscTexture()
{
}
LINK_PROPERTY_INT(Id)
LINK_PROPERTY_STRING(Image)
......@@ -1965,7 +2054,7 @@ namespace NSEditorApi
}
};
class CAscInsertImage
class CAscInsertImage : public IMenuEventDataBase
{
private:
js_wrapper<CAscImageRaw> m_oRaw;
......@@ -1976,13 +2065,16 @@ namespace NSEditorApi
CAscInsertImage()
{
}
virtual ~CAscInsertImage()
{
}
LINK_PROPERTY_OBJECT_JS(CAscImageRaw, Raw)
LINK_PROPERTY_STRING_JS(Path)
LINK_PROPERTY_STRINGA_JS(Base64)
};
class CAscInsertTable
class CAscInsertTable : public IMenuEventDataBase
{
private:
js_wrapper<std::wstring> m_sStyle;
......@@ -1993,6 +2085,9 @@ namespace NSEditorApi
CAscInsertTable()
{
}
virtual ~CAscInsertTable()
{
}
LINK_PROPERTY_STRING_JS(Style)
LINK_PROPERTY_INT_JS(Columns)
......@@ -2002,7 +2097,7 @@ namespace NSEditorApi
typedef CAscShapeProp CAscInsertShape;
typedef CAscHyperlinkPr CAscInsertHyperlink;
class CAscMethodParamInt
class CAscMethodParamInt : public IMenuEventDataBase
{
private:
js_wrapper<int> m_nValue;
......@@ -2011,6 +2106,9 @@ namespace NSEditorApi
CAscMethodParamInt()
{
}
virtual ~CAscMethodParamInt()
{
}
LINK_PROPERTY_INT_JS(Value)
};
......@@ -2033,7 +2131,7 @@ namespace NSEditorApi
}
};
class CAscStyleImages
class CAscStyleImages : public IMenuEventDataBase
{
public:
std::vector<CAscStyleImage> m_arStyles;
......@@ -2041,36 +2139,19 @@ namespace NSEditorApi
CAscStyleImages()
{
}
};
}
namespace NSEditorApi
{
class CAscStylesTemplate
{
public:
std::vector<std::wstring> m_names;
int m_nWidth;
int m_nHeight;
CAscImageRaw m_oImage;
public:
CAscStylesTemplate()
virtual ~CAscStyleImages()
{
}
};
typedef CAscStylesTemplate CAscParagraphStyles;
typedef CAscStylesTemplate CAscTableStyles;
}
namespace NSEditorApi
{
class CAscMenuEvent
class CAscMenuEvent : public IMenuEventDataBase
{
public:
int m_nType;
void* m_pData;
IMenuEventDataBase* m_pData;
public:
CAscMenuEvent()
......@@ -2078,14 +2159,14 @@ namespace NSEditorApi
m_nType = -1;
m_pData = NULL;
}
~CAscMenuEvent()
virtual ~CAscMenuEvent()
{
if (NULL != m_pData)
delete m_pData;
}
};
class CAscMenuEventStackData
class CAscMenuEventStackData : public IMenuEventDataBase
{
public:
std::vector<CAscMenuEvent*> m_data;
......@@ -2094,7 +2175,7 @@ namespace NSEditorApi
CAscMenuEventStackData()
{
}
~CAscMenuEventStackData()
virtual ~CAscMenuEventStackData()
{
for (std::vector<CAscMenuEvent*>::iterator i = m_data.begin(); i != m_data.end(); ++i)
{
......
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