Commit 3f4ae664 authored by Sergey.Konovalov's avatar Sergey.Konovalov Committed by Alexander Trofimov

(2.0.0.168): ASCOfficeDocxFile2

TextPt shd на чтение/запись.

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@55928 954022d7-b5bf-4e40-9824-e11837661b57
parent cf3fdd19
......@@ -287,6 +287,7 @@ public:
docRGB Color;
BYTE VertAlign;
docRGB HighLight;
CString Shd;
CString RStyle;
double Spacing;
bool DStrikeout;
......@@ -316,6 +317,7 @@ public:
bool bColor;
bool bVertAlign;
bool bHighLight;
bool bShd;
bool bRStyle;
bool bSpacing;
bool bDStrikeout;
......@@ -363,6 +365,7 @@ public:
bColor = false;
bVertAlign = false;
bHighLight = false;
bShd = false;
bRStyle = false;
bSpacing = false;
bDStrikeout = false;
......@@ -383,7 +386,7 @@ public:
}
bool IsNoEmpty()
{
return bBold || bItalic || bUnderline || bStrikeout || bFontAscii || bFontHAnsi || bFontAE || bFontCS || bFontSize || bColor || bVertAlign || bHighLight ||
return bBold || bItalic || bUnderline || bStrikeout || bFontAscii || bFontHAnsi || bFontAE || bFontCS || bFontSize || bColor || bVertAlign || bHighLight || bShd ||
bRStyle || bSpacing || bDStrikeout || bCaps || bSmallCaps || bPosition || bFontHint || bBoldCs || bItalicCs || bFontSizeCs || bCs || bRtl || bLang || bLangBidi || bLangEA || bThemeColor;
}
void Write(XmlUtils::CStringWriter* pCStringWriter)
......@@ -565,7 +568,7 @@ public:
sHighLight.Format(_T("<w:highlight w:val=\"%s\" />"), sColor);
pCStringWriter->WriteString(sHighLight);
}
else
else if(g_nCurFormatVersion < 5)
{
// shading
CString sShd;
......@@ -580,6 +583,8 @@ public:
else if(false == bDoNotWriteNullProp)
pCStringWriter->WriteString(CString(_T("<w:u w:val=\"none\"/>")));
}
if(bShd)
pCStringWriter->WriteString(Shd);
if(bVertAlign)
{
switch(VertAlign)
......
......@@ -319,6 +319,17 @@ public:
}
break;
}
case c_oSerProp_rPrType::Shd:
{
Shd oShd;
oBinary_CommonReader2.ReadShdOut(length, &oShd);
if(shd_Nil != oShd.Value)
{
orPr->bShd = true;
orPr->Shd = oShd.ToString();
}
break;
}
case c_oSerProp_rPrType::RStyle:
{
CString sRStyle((wchar_t*)m_oBufferedStream.ReadPointer(length), length / 2);
......
......@@ -327,7 +327,8 @@ const int g_nFormatVersion = 5;
Lang = 25,
LangBidi = 26,
LangEA = 27,
ColorTheme = 28
ColorTheme = 28,
Shd = 29
};}
namespace c_oSerProp_rowPrType{enum c_oSerProp_rowPrType
{
......
......@@ -417,6 +417,7 @@ namespace BinDocxRW
}
void Write_rPr(const OOX::Logic::CRunProperty& rPr)
{
int nCurPos = 0;
//Bold
if(false != rPr.m_oBold.IsInit())
{
......@@ -570,11 +571,6 @@ namespace BinDocxRW
//HighLight
if(false != rPr.m_oHighlight.IsInit() || false != rPr.m_oShd.IsInit())
{
// , m_oShd, highlightcolorNone
bool bHighLightNone = false;
bool bHighLightColor = false;
bool bShdNone = false;
bool bShdColor = false;
if(false != rPr.m_oHighlight.IsInit())
{
const ComplexTypes::Word::CHighlight& oHighlight = rPr.m_oHighlight.get();
......@@ -583,40 +579,26 @@ namespace BinDocxRW
const SimpleTypes::CHighlightColor<>& oHighlightVal = oHighlight.m_oVal.get();
if(SimpleTypes::highlightcolorNone == oHighlightVal.GetValue())
{
bHighLightNone = true;
m_oBcw.m_oStream.WriteByte(c_oSerProp_rPrType::HighLightTyped);
m_oBcw.m_oStream.WriteByte(c_oSerPropLenType::Byte);
m_oBcw.m_oStream.WriteByte(c_oSer_ColorType::None);
}
else
{
bHighLightColor = true;
SimpleTypes::CHexColor<> oHexColor(oHighlightVal.Get_R(), oHighlightVal.Get_G(), oHighlightVal.Get_B());
m_oBcw.WriteColor(c_oSerProp_rPrType::HighLight, oHexColor);
}
}
}
if(false == bHighLightColor && false != rPr.m_oShd.IsInit())
{
if(rPr.m_oShd->m_oVal.IsInit())
{
const ComplexTypes::Word::CShading& oShd = rPr.m_oShd.get();
if( SimpleTypes::shdNil == oShd.m_oVal->GetValue())
{
bShdNone = true;
}
else if(oShd.m_oFill.IsInit() && SimpleTypes::hexcolorRGB == oShd.m_oFill->GetValue())
{
bShdColor = true;
const SimpleTypes::CHexColor<>& oFill = oShd.m_oFill.get();
SimpleTypes::CHexColor<> oHexColor(oFill.Get_R(), oFill.Get_G(), oFill.Get_B());
m_oBcw.WriteColor(c_oSerProp_rPrType::HighLight, oHexColor);
}
}
}
if(false == bHighLightColor && false == bShdColor && ( true == bHighLightNone || true == bShdNone))
//Shd
if(false != rPr.m_oShd.IsInit())
{
m_oBcw.m_oStream.WriteByte(c_oSerProp_rPrType::HighLightTyped);
m_oBcw.m_oStream.WriteByte(c_oSerPropLenType::Byte);
m_oBcw.m_oStream.WriteByte(c_oSer_ColorType::None);
}
m_oBcw.m_oStream.WriteByte(c_oSerProp_rPrType::Shd);
m_oBcw.m_oStream.WriteByte(c_oSerPropLenType::Variable);
nCurPos = m_oBcw.WriteItemWithLengthStart();
m_oBcw.WriteShd(rPr.m_oShd.get());
m_oBcw.WriteItemWithLengthEnd(nCurPos);
}
//RStyle
if(false != rPr.m_oRStyle.IsInit())
......
......@@ -2,6 +2,6 @@
//2
//0
//0
//167
#define INTVER 2,0,0,167
#define STRVER "2,0,0,167\0"
//168
#define INTVER 2,0,0,168
#define STRVER "2,0,0,168\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