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