Commit 069544bf authored by Sergey Konovalov's avatar Sergey Konovalov

tab leader

parent 99191e65
......@@ -355,10 +355,16 @@ class Tab
public:
BYTE Val;
double Pos;
BYTE* Leader;
Tab()
{
Val = shd_Nil;
Pos = 0;
Leader = NULL;
}
~Tab()
{
RELEASEOBJECT(Leader);
}
};
class Tabs
......
......@@ -827,7 +827,23 @@ public:
case g_tabtype_clear: sVal = L"clear"; break;
default: sVal = L"left"; break;
}
pCStringWriter->WriteString(L"<w:tab w:val=\"" + sVal + L"\" w:pos=\"" + std::to_wstring(nTab) + L"\"/>");
pCStringWriter->WriteString(L"<w:tab w:val=\"" + sVal + L"\" w:pos=\"" + std::to_wstring(nTab) + L"\"");
if (NULL != oTab.Leader)
{
std::wstring sLeader;
switch(*oTab.Leader)
{
case SimpleTypes::tabtlcDot : sLeader = (L"dot");
case SimpleTypes::tabtlcHeavy : sLeader = (L"heavy");
case SimpleTypes::tabtlcHyphen : sLeader = (L"hyphen");
case SimpleTypes::tabtlcMiddleDot : sLeader = (L"middleDot");
case SimpleTypes::tabtlcNone : sLeader = (L"none");
case SimpleTypes::tabtlcUnderscore : sLeader = (L"underscore");
default : sLeader = (L"none");
}
pCStringWriter->WriteString(L" w:leader=\"" + sLeader + L"\"");
}
pCStringWriter->WriteString(L"/>");
}
pCStringWriter->WriteString(std::wstring(L"</w:tabs>"));
}
......@@ -1008,6 +1024,11 @@ public:
poTabItem->Val = m_oBufferedStream.GetUChar();
else if(c_oSerProp_pPrType::Tab_Item_Pos == type)
poTabItem->Pos = m_oBufferedStream.GetDouble();
else if(c_oSerProp_pPrType::Tab_Item_Leader == type)
{
poTabItem->Leader = new BYTE;
*poTabItem->Leader = m_oBufferedStream.GetUChar();
}
else
res = c_oSerConstants::ReadUnknown;
return res;
......
......@@ -345,7 +345,8 @@ extern int g_nCurFormatVersion;
SectPr = 31,
numPr_Ins = 32,
pPrChange = 33,
outlineLvl = 34
outlineLvl = 34,
Tab_Item_Leader = 35
};}
namespace c_oSerProp_rPrType{enum c_oSerProp_rPrType
{
......
......@@ -1179,6 +1179,12 @@ namespace BinDocxRW
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Double);
m_oBcw.m_oStream.WriteDouble(TabItem.m_oPos.get().ToMm());
}
if(false != TabItem.m_oLeader.IsInit())
{
m_oBcw.m_oStream.WriteBYTE(c_oSerProp_pPrType::Tab_Item_Leader);
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Byte);
m_oBcw.m_oStream.WriteBYTE((BYTE)TabItem.m_oLeader->GetValue());
}
}
void WriteNumPr(const OOX::Logic::CNumPr& numPr, const OOX::Logic::CParagraphProperty& pPr)
{
......
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