Compare commits

..

7 Commits

Author SHA1 Message Date
58903d92e1 [ios][odfconverter] fix crash 2019-07-03 18:41:19 +03:00
b7ea6bb376 . 2019-07-03 16:49:36 +03:00
a1007d4522 . 2019-07-03 13:42:24 +03:00
4b68d3294c . 2019-07-02 16:12:51 +03:00
24b44f6b03 [x2t] Fix writing m:oMath inside w:hyperlink 2019-07-02 14:02:16 +03:00
9f20ee6fef . 2019-07-01 18:48:47 +03:00
663bf866ed . 2019-07-01 12:57:57 +03:00
15 changed files with 374 additions and 101 deletions

View File

@ -800,8 +800,9 @@ namespace DocFileFormat
}
}
XMLTools::XMLElement elem(L"w:br");
elem.AppendAttribute(L"w:type", L"textWrapping");
elem.AppendAttribute(L"w:clear", L"all");
//СЗ в МРФ Техноград о предоставлении ТП 1 квартал 2019_MO_Q31.doc
//elem.AppendAttribute(L"w:type", L"textWrapping");
//elem.AppendAttribute(L"w:clear", L"all");
m_pXmlWriter->WriteString(elem.GetXMLString());
}

View File

@ -4236,15 +4236,15 @@ int Binary_DocumentTableReader::ReadParagraphContent(BYTE type, long length, voi
}
else if ( c_oSerParType::OMathPara == type )
{
m_oDocumentWriter.m_oContent.WriteString(std::wstring(_T("<m:oMathPara>")));
GetRunStringWriter().WriteString(std::wstring(_T("<m:oMathPara>")));
READ1_DEF(length, res, this->ReadMathOMathPara, poResult);
m_oDocumentWriter.m_oContent.WriteString(std::wstring(_T("</m:oMathPara>")));
GetRunStringWriter().WriteString(std::wstring(_T("</m:oMathPara>")));
}
else if ( c_oSerParType::OMath == type )
{
m_oDocumentWriter.m_oContent.WriteString(std::wstring(_T("<m:oMath>")));
GetRunStringWriter().WriteString(std::wstring(_T("<m:oMath>")));
READ1_DEF(length, res, this->ReadMathArg, poResult);
m_oDocumentWriter.m_oContent.WriteString(std::wstring(_T("</m:oMath>")));
GetRunStringWriter().WriteString(std::wstring(_T("</m:oMath>")));
}
else if ( c_oSerParType::MRun == type )
{

View File

@ -122,27 +122,64 @@ namespace formulasconvert {
XmlUtils::replace_all( expr, L"SCOBCAIN", L"(");
XmlUtils::replace_all( expr, L"SCOBCAOUT", L")");
XmlUtils::replace_all( expr, L"KVADRATIN", L"[");
XmlUtils::replace_all( expr, L"KVADRATOUT", L"]");
//XmlUtils::replace_all( expr, L"KVADRATIN", L"[");
//XmlUtils::replace_all( expr, L"KVADRATOUT", L"]");
XmlUtils::replace_all( expr, L"PROBEL", L" ");
XmlUtils::replace_all( expr, L"APOSTROF", L"'");
XmlUtils::replace_all( expr, L"KAVYCHKA", L"\"");
//XmlUtils::replace_all( expr, L"APOSTROF", L"'");
//XmlUtils::replace_all( expr, L"KAVYCHKA", L"\"");
}
static void replace_tmp(std::wstring &expr)
{
XmlUtils::replace_all( expr, L".", L"ТОСHKA");
XmlUtils::replace_all( expr, L"!", L"VOSKL");
// XmlUtils::replace_all( expr, L".", L"ТОСHKA");
// XmlUtils::replace_all( expr, L"!", L"VOSKL");
XmlUtils::replace_all( expr, L"(", L"SCOBCAIN");
XmlUtils::replace_all( expr, L")", L"SCOBCAOUT");
// XmlUtils::replace_all( expr, L"(", L"SCOBCAIN");
// XmlUtils::replace_all( expr, L")", L"SCOBCAOUT");
//XmlUtils::replace_all( expr, L"[", L"KVADRATIN");
//XmlUtils::replace_all( expr, L"]", L"KVADRATOUT");
XmlUtils::replace_all( expr, L" ", L"PROBEL");
// XmlUtils::replace_all( expr, L"'", L"APOSTROF");
// XmlUtils::replace_all( expr, L"\"", L"KAVYCHKA");
// //XmlUtils::replace_all( expr, L"[", L"KVADRATIN");
// //XmlUtils::replace_all( expr, L"]", L"KVADRATOUT");
//
// XmlUtils::replace_all( expr, L" ", L"PROBEL");
//// XmlUtils::replace_all( expr, L"'", L"APOSTROF");
//// XmlUtils::replace_all( expr, L"\"", L"KAVYCHKA");
std::wstring result;
size_t pos = 0, size = expr.length();
while(pos < size)
{
switch(expr[pos])
{
case '.':
{
result += L"ТОСHKA";
}break;
case '!':
{
result += L"VOSKL";
}break;
case '(':
{
result += L"SCOBCAIN";
}break;
case ')':
{
result += L"SCOBCAOUT";
}break;
case ' ':
{
result += L"PROBEL";
}break;
default:
{
result += expr[pos];
}break;
}
pos++;
}
expr = result;
}
static std::wstring convert_scobci(boost::wsmatch const & what)
{

View File

@ -133,36 +133,202 @@ public:
}
static void oox_replace_tmp_back(std::wstring &expr)
{
XmlUtils::replace_all( expr, L"MINYS", L"-");
XmlUtils::replace_all( expr, L"ТОСHKA", L".");
XmlUtils::replace_all( expr, L"VOSKL", L"!");
std::wstring result;
XmlUtils::replace_all( expr, L"SCOBCAIN", L"(");
XmlUtils::replace_all( expr, L"SCOBCAOUT", L")");
size_t pos = 0, size = expr.length();
XmlUtils::replace_all( expr, L"KVADRATIN", L"[");
XmlUtils::replace_all( expr, L"KVADRATOUT", L"]");
XmlUtils::replace_all( expr, L"PROBEL", L" ");
XmlUtils::replace_all( expr, L"APOSTROF", L"'");
XmlUtils::replace_all( expr, L"KAVYCHKA", L"\"");
while(pos < size)
{
if (pos + 5 > size)
{
result += expr[pos++];
continue;
}
switch(expr[pos])
{
case 'M':
{
if ((pos + 5 < size) && (expr.substr(pos, 5) == L"MINYS"))
{
result += L"-"; pos += 5;
}
else
{
result += expr[pos++];
}
}break;
case 'T':
{
if ((pos + 6 < size) && (expr.substr(pos, 6) == L"ТОСHKA"))
{
result += L"."; pos += 6;
}
else
{
result += expr[pos++];
}
}break;
case 'V':
{
if ((pos + 5 < size) && (expr.substr(pos, 5) == L"VOSKL"))
{
result += L"!"; pos += 5;
}
else
{
result += expr[pos++];
}
}break;
case 'S':
{
if ((pos + 8 < size) && (expr.substr(pos, 8) == L"SCOBCAIN"))
{
result += L"("; pos += 8;
}
else if ((pos + 9 < size) && (expr.substr(pos, 9) == L"SCOBCAOUT"))
{
result += L")"; pos += 9;
}
else
{
result += expr[pos++];
}
}break;
case 'K':
{
if ((pos + 9 < size) && (expr.substr(pos, 9) == L"KVADRATIN"))
{
result += L"["; pos += 9;
}
else if ((pos + 10 < size) && (expr.substr(pos, 10) == L"KVADRATOUT"))
{
result += L"]"; pos += 10;
}
else if ((pos + 8 < size) && (expr.substr(pos, 8) == L"KAVYCHKA"))
{
result += L"\""; pos += 8;
}
else
{
result += expr[pos++];
}
}break;
case 'P':
{
if ((pos + 6 < size) && (expr.substr(pos, 6) == L"PROBEL"))
{
result += L" "; pos += 6;
}
else
{
result += expr[pos++];
}
}break;
case 'A':
{
if ((pos + 8 < size) && (expr.substr(pos, 8) == L"APOSTROF"))
{
result += L"'"; pos += 8;
}
else
{
result += expr[pos++];
}
}break;
default:
{
result += expr[pos++];
}break;
}
}
expr = result;
//XmlUtils::replace_all( expr, L"MINYS", L"-");
//XmlUtils::replace_all( expr, L"ТОСHKA", L".");
//XmlUtils::replace_all( expr, L"VOSKL", L"!");
//XmlUtils::replace_all( expr, L"SCOBCAIN", L"(");
//XmlUtils::replace_all( expr, L"SCOBCAOUT", L")");
//XmlUtils::replace_all( expr, L"KVADRATIN", L"[");
//XmlUtils::replace_all( expr, L"KVADRATOUT", L"]");
//
//XmlUtils::replace_all( expr, L"PROBEL", L" ");
//XmlUtils::replace_all( expr, L"APOSTROF", L"'");
//XmlUtils::replace_all( expr, L"KAVYCHKA", L"\"");
}
static void oox_replace_tmp(std::wstring &expr)
{
XmlUtils::replace_all( expr, L"-", L"MINYS");
XmlUtils::replace_all( expr, L".", L"ТОСHKA");
XmlUtils::replace_all( expr, L"!", L"VOSKL");
std::wstring result;
XmlUtils::replace_all( expr, L"(", L"SCOBCAIN");
XmlUtils::replace_all( expr, L")", L"SCOBCAOUT");
size_t pos = 0, size = expr.length();
XmlUtils::replace_all( expr, L"[", L"KVADRATIN");
XmlUtils::replace_all( expr, L"]", L"KVADRATOUT");
XmlUtils::replace_all( expr, L" ", L"PROBEL");
XmlUtils::replace_all( expr, L"'", L"APOSTROF");
XmlUtils::replace_all( expr, L"\"", L"KAVYCHKA");
while(pos < size)
{
switch(expr[pos])
{
case '-':
{
result += L"MINYS";
}break;
case '.':
{
result += L"ТОСHKA";
}break;
case '!':
{
result += L"VOSKL";
}break;
case '(':
{
result += L"SCOBCAIN";
}break;
case ')':
{
result += L"SCOBCAOUT";
}break;
case '[':
{
result += L"KVADRATIN";
}break;
case ']':
{
result += L"KVADRATOUT";
}break;
case ' ':
{
result += L"PROBEL";
}break;
case '\'':
{
result += L"APOSTROF";
}break;
case '\"':
{
result += L"KAVYCHKA";
}break;
default:
{
result += expr[pos];
}break;
}
pos++;
}
expr = result;
//XmlUtils::replace_all( expr, L"-", L"MINYS");
//XmlUtils::replace_all( expr, L".", L"ТОСHKA");
//XmlUtils::replace_all( expr, L"!", L"VOSKL");
//XmlUtils::replace_all( expr, L"(", L"SCOBCAIN");
//XmlUtils::replace_all( expr, L")", L"SCOBCAOUT");
//XmlUtils::replace_all( expr, L"[", L"KVADRATIN");
//XmlUtils::replace_all( expr, L"]", L"KVADRATOUT");
//
//XmlUtils::replace_all( expr, L" ", L"PROBEL");
//XmlUtils::replace_all( expr, L"'", L"APOSTROF");
//XmlUtils::replace_all( expr, L"\"", L"KAVYCHKA");
}
static bool is_forbidden1(const std::wstring & formula)

View File

@ -968,7 +968,7 @@ void ods_table_state::set_cell_formula(std::wstring & formula)
XmlUtils::replace_all(odfFormula, L"EXTERNALREF", L"file://");//снятие экранирования
if (std::wstring::npos != odfFormula.find(L"["))
if ((false == table_parts_.empty()) && (std::wstring::npos != odfFormula.find(L"[")))
{
for (size_t i = 0; i < table_parts_.size(); i++)
{
@ -1049,12 +1049,12 @@ void ods_table_state::add_or_find_cell_shared_formula(std::wstring & formula, st
int moving_type = 0;
std::vector<std::wstring> distance;
boost::algorithm::split(distance, ref,boost::algorithm::is_any_of(L":"), boost::algorithm::token_compress_on);
boost::algorithm::split(distance, ref, boost::algorithm::is_any_of(L":"), boost::algorithm::token_compress_on);
if (distance.size() > 1)
{
int col1, row1, col2, row2;
utils::parsing_ref(distance[0],col1,row1);
utils::parsing_ref(distance[1],col2,row2);
utils::parsing_ref(distance[0], col1, row1);
utils::parsing_ref(distance[1], col2, row2);
if (row2 - row1 > 0) moving_type = 2;
if (col2 - col1 > 0)moving_type = 1;

View File

@ -453,12 +453,12 @@ private:
std::vector<ods_cell_state> cells_;
long cells_size_;
std::vector<ods_hyperlink_state> hyperlinks_;
std::map<unsigned int, ods_shared_formula_state> shared_formulas_;
std::vector<ods_hyperlink_state> hyperlinks_;
std::map<unsigned int, ods_shared_formula_state> shared_formulas_;
std::vector<table_part_state> table_parts_;
std::vector<table_part_state> table_parts_;
std::vector<data_validation_state> data_validations_;
std::vector<data_validation_state> data_validations_;
odf_drawing_context drawing_context_;
odf_controls_context controls_context_;

View File

@ -1417,7 +1417,12 @@ void DocxConverter::convert(OOX::Logic::CParagraphProperty *oox_paragraph_pr, cp
void DocxConverter::convert( ComplexTypes::Word::CShading* shading, _CP_OPT(odf_types::color)& odf_color)
{
if (!shading) return;
if ((shading->m_oVal.IsInit()) && ( shading->m_oVal->GetValue() == SimpleTypes::shdClear ||
shading->m_oVal->GetValue() == SimpleTypes::shdNil))
{
return;
}
convert(shading->m_oFill.GetPointer(), shading->m_oThemeFill.GetPointer(),
shading->m_oThemeFillTint.GetPointer(), shading->m_oThemeShade.GetPointer(), odf_color);

View File

@ -191,7 +191,6 @@ namespace Oox2Odf
void convert(OOX::Logic::CParagraphProperty *oox_para_prop, odf_writer::style_paragraph_properties *paragraph_properties);
void convert(ComplexTypes::Word::CFramePr *oox_frame_pr, odf_writer::style_paragraph_properties *paragraph_properties);
void convert(OOX::Logic::CRunProperty *oox_run_prop, odf_writer::style_text_properties *text_properties, bool is_list_styles = false);
void convert(ComplexTypes::Word::CShading *oox_shading, odf_writer::style_text_properties *text_properties );
void convert(OOX::Logic::CFldSimple *oox_fld);
void convert(OOX::Logic::CFldChar *oox_fld);
void convert(OOX::Logic::CInstrText *oox_instrText);

View File

@ -3042,8 +3042,19 @@ void CDrawingConverter::doc_LoadGroup(PPTX::Logic::SpTreeElem *result, XmlUtils:
{
AddShapeType(oNodeT);
}
else if (
L"shape" == strNameP ||
}
}
if (oNode.GetNodes(L"*", oNodes))
{
int nCount = oNodes.GetCount();
for (int i = 0; i < nCount; ++i)
{
XmlUtils::CXmlNode oNodeT;
oNodes.GetAt(i, oNodeT);
std::wstring strNameP = XmlUtils::GetNameNoNS(oNodeT.GetName());
if (L"shape" == strNameP ||
L"rect" == strNameP ||
L"oval" == strNameP ||
L"line" == strNameP ||

View File

@ -2246,7 +2246,9 @@ public:
COMMAND_RTF_INT( "levelnorestart", m_oListLevelProp.m_nNoRestart, sCommand, hasParameter, parameter )
COMMAND_RTF_INT( "levellegal", m_oListLevelProp.m_nLegal, sCommand, hasParameter, parameter )
COMMAND_RTF_INT( "levelpicture", m_oListLevelProp.m_nPictureIndex, sCommand, hasParameter, parameter )
COMMAND_RTF_INT( "li", m_oListLevelProp.m_nIndent, sCommand, hasParameter, parameter )
COMMAND_RTF_INT( "levelspace", m_oListLevelProp.m_nSpace, sCommand, hasParameter, parameter )
COMMAND_RTF_INT( "levelindent", m_oListLevelProp.m_nIndent, sCommand, hasParameter, parameter )
COMMAND_RTF_INT( "li", m_oListLevelProp.m_nIndent, sCommand, hasParameter, parameter )
COMMAND_RTF_INT( "lin", m_oListLevelProp.m_nIndentStart, sCommand, hasParameter, parameter )
COMMAND_RTF_INT( "fi", m_oListLevelProp.m_nFirstIndent, sCommand, hasParameter, parameter )
else if( "tx" == sCommand )
@ -2305,7 +2307,13 @@ public:
{
RtfListLevelProperty oListLevelProp;
ListLevelReader oListLevelReader( oListLevelProp );
oReader.m_oState->m_oCharProp.m_bListLevel = true;
oReader.m_oState->m_oCharProp.SetDefaultRtf();
bool bResult = StartSubReader( oListLevelReader, oDocument, oReader );
oReader.m_oState->m_oCharProp.m_bListLevel = false;
if( true == bResult )
{
oListLevelProp.m_nLevel = m_oListProp.GetCount();
@ -2356,8 +2364,15 @@ public:
else if( "list" == sCommand )
{
RtfListProperty oListProp;
ListReader oListReader(oListProp);
oReader.m_oState->m_oCharProp.m_bListLevel = true;
bool bResult = StartSubReader( oListReader, oDocument, oReader );
oReader.m_oState->m_oCharProp.m_bListLevel = false;
if( true == bResult )
{
oDocument.m_oListTable.AddItem( oListProp );

View File

@ -136,8 +136,8 @@ bool OOXShapeReader::ParseVmlStyle(RtfShapePtr pShape, SimpleTypes::Vml::CCssPro
{
case SimpleTypes::Vml::cssmsoposhorrelMargin: pShape->m_eXAnchor = RtfShape::ax_margin; break;
case SimpleTypes::Vml::cssmsoposhorrelPage: pShape->m_eXAnchor = RtfShape::ax_page; break;
case SimpleTypes::Vml::cssmsoposhorrelText:
case SimpleTypes::Vml::cssmsoposhorrelChar: break;//inline
case SimpleTypes::Vml::cssmsoposhorrelText: break; //???
case SimpleTypes::Vml::cssmsoposhorrelChar: pShape->m_eAnchorTypeShape = RtfShape::st_inline; break;//inline
}
}break;
case SimpleTypes::Vml::cssptMsoPositionVertical:
@ -194,7 +194,10 @@ bool OOXShapeReader::ParseVmlStyle(RtfShapePtr pShape, SimpleTypes::Vml::CCssPro
break;
case SimpleTypes::Vml::cssptZIndex :
{
pShape->m_eAnchorTypeShape = RtfShape::st_anchor;
if (pShape->m_eAnchorTypeShape == RtfShape::st_none)
{
pShape->m_eAnchorTypeShape = RtfShape::st_anchor;
}
int nValue = prop->get_Value().oZIndex.nOrder;
pShape->m_nZOrder = nValue;

View File

@ -579,52 +579,63 @@ std::wstring RtfBorder::RenderToOOX(RenderParameter oRenderParameter)
{
RtfDocument* poRtfDocument = static_cast<RtfDocument*>(oRenderParameter.poDocument);
std::wstring sResult;
if( PROP_DEF != m_nColor )
{
RtfColor oColor;
RenderParameter oNewParam = oRenderParameter;
oNewParam.nType = RENDER_TO_OOX_PARAM_COLOR_VALUE;
if( true == poRtfDocument->m_oColorTable.GetColor( m_nColor, oColor ) )
sResult += L" w:color=\"" + oColor.RenderToOOX(oNewParam) + L"\"";
}
if( PROP_DEF != m_nWidth ) //w:sz 1/8 twips (equivalent to 1/576th of an inch)
sResult += L" w:sz=\"" + std::to_wstring(2 * m_nWidth / 5 ) + L"\"";
if( PROP_DEF != m_nSpace )
sResult += L" w:space=\"" + std::to_wstring((int)RtfUtility::Twip2pt( m_nSpace )) + L"\"";
switch( m_eType )
{
case bt_brdrs: sResult += L" w:val=\"single\""; break;
case bt_brdrs: sResult += L" w:val=\"single\""; break;
case bt_brdrth: sResult += L" w:val=\"thick\""; break;
case bt_brdrsh: sResult += L" w:val=\"\"thin"; break;
case bt_brdrdb: sResult += L" w:val=\"double\""; break;
case bt_brdrdot: sResult += L" w:val=\"dotted\""; break;
case bt_brdrdash: sResult += L" w:val=\"dashed\""; break;
case bt_brdrdb: sResult += L" w:val=\"double\""; break;
case bt_brdrdot: sResult += L" w:val=\"dotted\""; break;
case bt_brdrdash: sResult += L" w:val=\"dashed\""; break;
case bt_brdrhair: sResult += L" w:val=\"hair\""; break;
case bt_brdrdashsm: sResult += L" w:val=\"dashSmallGap\""; break;
case bt_brdrdashd: sResult += L" w:val=\"dotDash\""; break;
case bt_brdrdashdd: sResult += L" w:val=\"dotDotDash\""; break;
case bt_brdrdashdd: sResult += L" w:val=\"dotDotDash\""; break;
case bt_brdrinset: sResult += L" w:val=\"inset\""; break;
case bt_brdrnone: sResult += L" w:val=\"nil\""; break;
case bt_brdroutset: sResult += L" w:val=\"outset\""; break;
case bt_brdrtriple: sResult += L" w:val=\"triple\""; break;
case bt_brdrnone: sResult += L" w:val=\"none\""; break;
case bt_brdroutset: sResult += L" w:val=\"outset\""; break;
case bt_brdrtriple: sResult += L" w:val=\"triple\""; break;
case bt_brdrtnthsg: sResult += L" w:val=\"thinThickSmallGap\""; break;
case bt_brdrthtnsg: sResult += L" w:val=\"thickThinSmallGap\""; break;
case bt_brdrtnthtnsg: sResult += L" w:val=\"thinThickThinSmallGap\""; break;
case bt_brdrtnthtnmg: sResult += L" w:val=\"thinThickThinMediumGap\""; break;
case bt_brdrtnthmg: sResult += L" w:val=\"thinThickMediumGap\""; break;
case bt_brdrthtnmg: sResult += L" w:val=\"thickThinMediumGap\""; break;
case bt_brdrtnthtnsg: sResult += L" w:val=\"thinThickThinSmallGap\""; break;
case bt_brdrtnthtnmg: sResult += L" w:val=\"thinThickThinMediumGap\"";break;
case bt_brdrtnthmg: sResult += L" w:val=\"thinThickMediumGap\""; break;
case bt_brdrthtnmg: sResult += L" w:val=\"thickThinMediumGap\""; break;
case bt_brdrtnthlg: sResult += L" w:val=\"thinThickLargeGap\""; break;
case bt_brdrthtnlg: sResult += L" w:val=\"thickThinLargeGap\""; break;
case bt_brdrtnthtnlg: sResult += L" w:val=\"thinThickThinLargeGap\""; break;
case bt_brdrwavy: sResult += L" w:val=\"wave\""; break;
case bt_brdrwavydb: sResult += L" w:val=\"doubleWave\""; break;
case bt_brdrdashdotstr: sResult += L" w:val=\"dashDotStroked\""; break;
case bt_brdrwavydb: sResult += L" w:val=\"doubleWave\""; break;
case bt_brdrdashdotstr: sResult += L" w:val=\"dashDotStroked\""; break;
case bt_brdremboss: sResult += L" w:val=\"threeDEmboss\""; break;
case bt_brdrengrave: sResult += L" w:val=\"threeDEngrave\""; break;
default:
break;
}
if( PROP_DEF != m_nColor )
{
RtfColor oColor;
RenderParameter oNewParam = oRenderParameter;
oNewParam.nType = RENDER_TO_OOX_PARAM_COLOR_VALUE;
if (m_nColor == -1)
{
oColor.m_bAuto = true;
sResult += L" w:color=\"auto\"";
}
else if( true == poRtfDocument->m_oColorTable.GetColor( m_nColor, oColor ) )
sResult += L" w:color=\"" + oColor.RenderToOOX(oNewParam) + L"\"";
}
if( PROP_DEF != m_nWidth ) //w:sz 1/8 twips (equivalent to 1/576th of an inch)
{
sResult += L" w:sz=\"" + std::to_wstring(2 * m_nWidth / 5 ) + L"\"";
}
if( PROP_DEF != m_nSpace )
{
sResult += L" w:space=\"" + std::to_wstring((int)RtfUtility::Twip2pt( m_nSpace )) + L"\"";
}
if( false == sResult.empty() )
{
if( RENDER_TO_OOX_PARAM_BORDER_ATTRIBUTE == oRenderParameter.nType )

View File

@ -848,7 +848,7 @@ public:
m_eType = bt_brdrnone;
m_nWidth = 0;
m_nSpace = 0;
m_nColor = PROP_DEF;
m_nColor = -1; //auto
}
void Merge( RtfBorder& oBorPr )
{
@ -987,6 +987,8 @@ typedef boost::shared_ptr<RtfCharProperty> RtfCharPropertyPtr;
class RtfCharProperty: public IRenderableProperty
{
public:
bool m_bListLevel;
enum _UnderlineStyle {uls_none, uls_Single, uls_Dotted,uls_Dashed ,uls_Dash_dotted,uls_Dash_dot_dotted,uls_Double,uls_Heavy_wave,uls_Long_dashe,uls_Stops_all,uls_Thick,uls_Thick_dotted,uls_Thick_dashed,uls_Thick_dash_dotted,uls_Thick_dash_dot_dotted,uls_Thick_long_dashed,uls_Double_wave,uls_Word,uls_Wave};
int m_nAnimated; //animtextN Animated text properties (note: Word 2007 ignores this control word):
@ -1060,6 +1062,7 @@ public:
RtfCharProperty()
{
m_bListLevel = false;
SetDefault();
}
int GetType()
@ -1073,7 +1076,8 @@ public:
m_poShading.SetDefaultRtf();
m_poBorder.SetDefaultRtf();
m_nFontSize = 24;
if (false == m_bListLevel)
m_nFontSize = 24;
}
void SetDefaultOOX()
{
@ -1082,7 +1086,8 @@ public:
m_poShading.SetDefaultOOX();
m_poBorder.SetDefaultOOX();
m_nFontSize = 20;
if (false == m_bListLevel)
m_nFontSize = 20;
}
void SetDefault()
{
@ -1214,11 +1219,14 @@ public:
int m_nFirstIndent;
int m_nIndent;
int m_nIndentStart;
int m_nSpace;
RtfCharProperty m_oCharProp; //Char
RtfListLevelProperty()
{
m_oCharProp.m_bListLevel = true;
SetDefault();
}
bool IsValid()
@ -1250,6 +1258,7 @@ public:
}
void SetDefault()
{
DEFAULT_PROPERTY ( m_nSpace )
DEFAULT_PROPERTY ( m_nLevel )
DEFAULT_PROPERTY ( m_nNumberType )
DEFAULT_PROPERTY ( m_bTentative )
@ -2416,18 +2425,18 @@ public:
void SetDefaultOOX()
{
SetDefault();
}
void SetDefault()
{
RtfTableProperty::SetDefault();
//не SetEmpty() !!!
m_oBorderLeft.SetDefault();
m_oBorderRight.SetDefault();
m_oBorderTop.SetDefault();
m_oBorderBottom.SetDefault();
m_oBorderVert.SetDefault();
m_oBorderHor.SetDefault();
m_oBorderHor.SetDefault();
}
//5.5 Доверенность_MO_Q139.rtf
void SetDefault()
{
RtfTableProperty::SetDefault();
DEFAULT_PROPERTY( m_nIndex )
DEFAULT_PROPERTY( m_nBandIndex )
DEFAULT_PROPERTY( m_bLastRow )
@ -2649,6 +2658,10 @@ public:
void SetDefaultRtf()
{
SetDefault();
//4.1 Наряд_R7_M133.rtf
m_nSpaceAfter = 0;
m_nSpaceBetween = 240;
}
void SetDefaultOOX()
{
@ -2701,7 +2714,7 @@ public:
m_oBorderTop.SetDefault();
m_oBorderLeft.SetDefault();
m_oBorderBottom.SetDefault();
m_oBorderRight.SetDefault();
m_oBorderRight.SetDefault();
m_oBorderBox.SetDefault();
m_oBorderBar.SetDefault();

View File

@ -1596,10 +1596,18 @@
RelativePath="..\Source\XlsxFormat\SharedStrings\SharedStrings.h"
>
</File>
<File
RelativePath="..\Source\XlsxFormat\SharedStrings\Si.cpp"
>
</File>
<File
RelativePath="..\Source\XlsxFormat\SharedStrings\Si.h"
>
</File>
<File
RelativePath="..\Source\XlsxFormat\SharedStrings\Text.cpp"
>
</File>
<File
RelativePath="..\Source\XlsxFormat\SharedStrings\Text.h"
>
@ -1636,6 +1644,10 @@
RelativePath="..\Source\XlsxFormat\Styles\NumFmts.h"
>
</File>
<File
RelativePath="..\Source\XlsxFormat\Styles\rPr.cpp"
>
</File>
<File
RelativePath="..\Source\XlsxFormat\Styles\rPr.h"
>

View File

@ -196,7 +196,7 @@ namespace NExtractTools
namespace NExtractTools
{
_UINT32 odf2oox_dir(const std::wstring &sFrom, const std::wstring &sTo, const std::wstring & sTemp, InputParams& params)
_UINT32 __odf2oox_dir(const std::wstring &sFrom, const std::wstring &sTo, const std::wstring & sTemp, InputParams& params)
{
std::wstring sTempUnpackedOdf = sTemp + FILE_SEPARATOR_STR + _T("odf_unpacked");
NSDirectory::CreateDirectory(sTempUnpackedOdf);
@ -210,12 +210,12 @@ namespace NExtractTools
return nRes;
}
_UINT32 odf2oox(const std::wstring &sFrom, const std::wstring &sTo, const std::wstring & sTemp, InputParams& params)
_UINT32 __odf2oox(const std::wstring &sFrom, const std::wstring &sTo, const std::wstring & sTemp, InputParams& params)
{
std::wstring sTempUnpackedOox = sTemp + FILE_SEPARATOR_STR + _T("oox_unpacked");
NSDirectory::CreateDirectory(sTempUnpackedOox);
_UINT32 nRes = odf2oox_dir(sFrom, sTempUnpackedOox, sTemp, params);
_UINT32 nRes = __odf2oox_dir(sFrom, sTempUnpackedOox, sTemp, params);
if(SUCCEEDED_X2T(nRes))
{
COfficeUtils oCOfficeUtils(NULL);
@ -288,7 +288,7 @@ namespace NExtractTools
oInputParams.m_sPassword = new std::wstring(NExtractTools::nsstring_to_wstring(self.password));
}
return NExtractTools::odf2oox(from, to, temp, oInputParams);
return NExtractTools::__odf2oox(from, to, temp, oInputParams);
}
- (int)odt2docx:(NSString*)nsFrom nsTo:(NSString*)nsTo nsTemp:(NSString*)nsTemp nsFontPath:(NSString*)nsFontPath {
@ -304,7 +304,7 @@ namespace NExtractTools
oInputParams.m_sPassword = new std::wstring(NExtractTools::nsstring_to_wstring(self.password));
}
return NExtractTools::odf2oox(from, to, temp, oInputParams);
return NExtractTools::__odf2oox(from, to, temp, oInputParams);
}
- (int)ods2xlsx:(NSString*)nsFrom nsTo:(NSString*)nsTo nsTemp:(NSString*)nsTemp nsFontPath:(NSString*)nsFontPath {
@ -320,7 +320,7 @@ namespace NExtractTools
oInputParams.m_sPassword = new std::wstring(NExtractTools::nsstring_to_wstring(self.password));
}
return NExtractTools::odf2oox(from, to, temp, oInputParams);
return NExtractTools::__odf2oox(from, to, temp, oInputParams);
}
- (int)odp2pptx:(NSString*)nsFrom nsTo:(NSString*)nsTo nsTemp:(NSString*)nsTemp nsFontPath:(NSString*)nsFontPath {
@ -336,7 +336,7 @@ namespace NExtractTools
oInputParams.m_sPassword = new std::wstring(NExtractTools::nsstring_to_wstring(self.password));
}
return NExtractTools::odf2oox(from, to, temp, oInputParams);
return NExtractTools::__odf2oox(from, to, temp, oInputParams);
}
@end