Compare commits

..

13 Commits

24 changed files with 721 additions and 112 deletions

View File

@ -67,7 +67,7 @@ namespace DocFileFormat
XMLTools::XMLAttribute layoutType ( L"w:type", L"fixed");
bool bLayoutFixed = true;
short tblIndent = 0;
_CP_OPT(short) tblIndent;
short gabHalf = 0;
short marginLeft = 0;
short marginRight = 0;
@ -98,8 +98,7 @@ namespace DocFileFormat
//For this cases we can calculate the indent of the table by getting the
//first boundary of the TDef and adding the padding of the cells
tblIndent = FormatUtils::BytesToInt16( iter->Arguments, 1, iter->argumentsSize );
tblIndent += gabHalf;
tblIndent = gabHalf + FormatUtils::BytesToInt16( iter->Arguments, 1, iter->argumentsSize );
//If there follows a real sprmTWidthIndent, this value will be overwritten
//tblIndent = (std::max)((int)tblIndent,0); //cerere.doc
@ -404,11 +403,11 @@ namespace DocFileFormat
}
//indent
if ( tblIndent != 0 )
if ( tblIndent )
{
XMLTools::XMLElement tblInd( L"w:tblInd");
XMLTools::XMLAttribute tblIndW( L"w:w", FormatUtils::IntToWideString( tblIndent ) );
XMLTools::XMLAttribute tblIndW( L"w:w", FormatUtils::IntToWideString( *tblIndent ) );
tblInd.AppendAttribute( tblIndW );
XMLTools::XMLAttribute tblIndType( L"w:type", L"dxa");

View File

@ -2624,7 +2624,7 @@ int Binary_tblPrReader::ReadTrPrChange(BYTE type, long length, void* poResult)
int res = c_oSerConstants::ReadOk;
TrackRevision* pTrackRevision = static_cast<TrackRevision*>(poResult);
READ1_TRACKREV(type, length, pTrackRevision)
else if (c_oSerProp_RevisionType::tblPrChange == type)
else if (c_oSerProp_RevisionType::trPrChange == type)
{
pTrackRevision->trPr = new NSStringUtils::CStringBuilder();
READ2_DEF(length, res, this->Read_RowPr, pTrackRevision->trPr);
@ -4080,6 +4080,30 @@ int Binary_DocumentTableReader::ReadDocumentContent(BYTE type, long length, void
READ1_DEF(length, res, this->ReadBookmarkEnd, &oBookmarkEnd);
m_oDocumentWriter.m_oContent.WriteString(oBookmarkEnd.toXML());
}
else if ( c_oSerParType::MoveFromRangeStart == type )
{
OOX::Logic::CMoveFromRangeStart oMoveFromRangeStart;
READ1_DEF(length, res, this->ReadMoveFromRangeStart, &oMoveFromRangeStart);
m_oDocumentWriter.m_oContent.WriteString(oMoveFromRangeStart.toXML());
}
else if ( c_oSerParType::MoveFromRangeEnd == type )
{
OOX::Logic::CMoveFromRangeEnd oMoveToRangeEnd;
READ1_DEF(length, res, this->ReadMoveFromRangeEnd, &oMoveToRangeEnd);
m_oDocumentWriter.m_oContent.WriteString(oMoveToRangeEnd.toXML());
}
else if ( c_oSerParType::MoveToRangeStart == type )
{
OOX::Logic::CMoveToRangeStart oMoveToRangeStart;
READ1_DEF(length, res, this->ReadMoveToRangeStart, &oMoveToRangeStart);
m_oDocumentWriter.m_oContent.WriteString(oMoveToRangeStart.toXML());
}
else if ( c_oSerParType::MoveToRangeEnd == type )
{
OOX::Logic::CMoveToRangeEnd oMoveToRangeEnd;
READ1_DEF(length, res, this->ReadMoveToRangeEnd, &oMoveToRangeEnd);
m_oDocumentWriter.m_oContent.WriteString(oMoveToRangeEnd.toXML());
}
else if(c_oSerParType::JsaProject == type)
{
BYTE* pData = m_oBufferedStream.GetPointer(length);
@ -4922,6 +4946,30 @@ int Binary_DocumentTableReader::ReadMathArg(BYTE type, long length, void* poResu
READ1_DEF(length, res, this->ReadBookmarkEnd, &oBookmarkEnd);
GetRunStringWriter().WriteString(oBookmarkEnd.toXML());
}
else if ( c_oSer_OMathContentType::MoveFromRangeStart == type )
{
OOX::Logic::CMoveFromRangeStart oMoveFromRangeStart;
READ1_DEF(length, res, this->ReadMoveFromRangeStart, &oMoveFromRangeStart);
GetRunStringWriter().WriteString(oMoveFromRangeStart.toXML());
}
else if ( c_oSer_OMathContentType::MoveFromRangeEnd == type )
{
OOX::Logic::CMoveFromRangeEnd oMoveToRangeEnd;
READ1_DEF(length, res, this->ReadMoveFromRangeEnd, &oMoveToRangeEnd);
GetRunStringWriter().WriteString(oMoveToRangeEnd.toXML());
}
else if ( c_oSer_OMathContentType::MoveToRangeStart == type )
{
OOX::Logic::CMoveToRangeStart oMoveToRangeStart;
READ1_DEF(length, res, this->ReadMoveToRangeStart, &oMoveToRangeStart);
GetRunStringWriter().WriteString(oMoveToRangeStart.toXML());
}
else if ( c_oSer_OMathContentType::MoveToRangeEnd == type )
{
OOX::Logic::CMoveToRangeEnd oMoveToRangeEnd;
READ1_DEF(length, res, this->ReadMoveToRangeEnd, &oMoveToRangeEnd);
GetRunStringWriter().WriteString(oMoveToRangeEnd.toXML());
}
else
res = c_oSerConstants::ReadUnknown;
return res;
@ -7161,7 +7209,7 @@ int Binary_DocumentTableReader::ReadRunContent(BYTE type, long length, void* poR
if(NULL != m_pComments)
{
CComment* pComment = m_pComments->get(nId);
if(NULL != pComment && pComment->bIdFormat)
if(NULL != pComment) // могут быть и без start/end
{
GetRunStringWriter().WriteString(pComment->writeRef(std::wstring(_T("")), std::wstring(_T("w:commentReference")), std::wstring(_T(""))));
}
@ -7407,6 +7455,30 @@ int Binary_DocumentTableReader::Read_TableContent(BYTE type, long length, void*
READ1_DEF(length, res, this->ReadBookmarkEnd, &oBookmarkEnd);
pCStringWriter->WriteString(oBookmarkEnd.toXML());
}
else if ( c_oSerDocTableType::MoveFromRangeStart == type )
{
OOX::Logic::CMoveFromRangeStart oMoveFromRangeStart;
READ1_DEF(length, res, this->ReadMoveFromRangeStart, &oMoveFromRangeStart);
pCStringWriter->WriteString(oMoveFromRangeStart.toXML());
}
else if ( c_oSerDocTableType::MoveFromRangeEnd == type )
{
OOX::Logic::CMoveFromRangeEnd oMoveToRangeEnd;
READ1_DEF(length, res, this->ReadMoveFromRangeEnd, &oMoveToRangeEnd);
pCStringWriter->WriteString(oMoveToRangeEnd.toXML());
}
else if ( c_oSerDocTableType::MoveToRangeStart == type )
{
OOX::Logic::CMoveToRangeStart oMoveToRangeStart;
READ1_DEF(length, res, this->ReadMoveToRangeStart, &oMoveToRangeStart);
pCStringWriter->WriteString(oMoveToRangeStart.toXML());
}
else if ( c_oSerDocTableType::MoveToRangeEnd == type )
{
OOX::Logic::CMoveToRangeEnd oMoveToRangeEnd;
READ1_DEF(length, res, this->ReadMoveToRangeEnd, &oMoveToRangeEnd);
pCStringWriter->WriteString(oMoveToRangeEnd.toXML());
}
else
res = c_oSerConstants::ReadUnknown;
return res;
@ -7456,6 +7528,30 @@ int Binary_DocumentTableReader::ReadRowContent(BYTE type, long length, void* poR
READ1_DEF(length, res, this->ReadBookmarkEnd, &oBookmarkEnd);
pCStringWriter->WriteString(oBookmarkEnd.toXML());
}
else if ( c_oSerDocTableType::MoveFromRangeStart == type )
{
OOX::Logic::CMoveFromRangeStart oMoveFromRangeStart;
READ1_DEF(length, res, this->ReadMoveFromRangeStart, &oMoveFromRangeStart);
pCStringWriter->WriteString(oMoveFromRangeStart.toXML());
}
else if ( c_oSerDocTableType::MoveFromRangeEnd == type )
{
OOX::Logic::CMoveFromRangeEnd oMoveToRangeEnd;
READ1_DEF(length, res, this->ReadMoveFromRangeEnd, &oMoveToRangeEnd);
pCStringWriter->WriteString(oMoveToRangeEnd.toXML());
}
else if ( c_oSerDocTableType::MoveToRangeStart == type )
{
OOX::Logic::CMoveToRangeStart oMoveToRangeStart;
READ1_DEF(length, res, this->ReadMoveToRangeStart, &oMoveToRangeStart);
pCStringWriter->WriteString(oMoveToRangeStart.toXML());
}
else if ( c_oSerDocTableType::MoveToRangeEnd == type )
{
OOX::Logic::CMoveToRangeEnd oMoveToRangeEnd;
READ1_DEF(length, res, this->ReadMoveToRangeEnd, &oMoveToRangeEnd);
pCStringWriter->WriteString(oMoveToRangeEnd.toXML());
}
else
res = c_oSerConstants::ReadUnknown;
return res;

View File

@ -524,7 +524,11 @@ extern int g_nCurFormatVersion;
Sdt = 10,
BookmarkStart = 11,
BookmarkEnd = 12,
tblGrid_ItemTwips = 13
tblGrid_ItemTwips = 13,
MoveFromRangeStart = 14,
MoveFromRangeEnd = 15,
MoveToRangeStart = 16,
MoveToRangeEnd = 17
};}
namespace c_oSerRunType{enum c_oSerRunType
{
@ -979,7 +983,11 @@ extern int g_nCurFormatVersion;
columnbreak = 64,
ARPr = 65,
BookmarkStart = 66,
BookmarkEnd = 67
BookmarkEnd = 67,
MoveFromRangeStart = 68,
MoveFromRangeEnd = 69,
MoveToRangeStart = 70,
MoveToRangeEnd = 71
};}
namespace c_oSer_FramePrType{ enum c_oSer_FramePrType
{

View File

@ -3082,6 +3082,34 @@ void BinaryDocumentTableWriter::WriteDocumentContent(const std::vector<OOX::Writ
WriteBookmarkEnd(*pBookmarkEnd);
m_oBcw.WriteItemWithLengthEnd(nCurPos);
}break;
case OOX::et_w_moveFromRangeStart:
{
OOX::Logic::CMoveFromRangeStart* pMoveFromRangeStart = static_cast<OOX::Logic::CMoveFromRangeStart*>(item);
nCurPos = m_oBcw.WriteItemStart(c_oSerParType::MoveFromRangeStart);
WriteMoveRangeStart(*pMoveFromRangeStart);
m_oBcw.WriteItemEnd(nCurPos);
}break;
case OOX::et_w_moveFromRangeEnd:
{
OOX::Logic::CMoveFromRangeEnd* pMoveFromRangeEnd = static_cast<OOX::Logic::CMoveFromRangeEnd*>(item);
nCurPos = m_oBcw.WriteItemStart(c_oSerParType::MoveFromRangeEnd);
WriteMoveRangeEnd(*pMoveFromRangeEnd);
m_oBcw.WriteItemEnd(nCurPos);
}break;
case OOX::et_w_moveToRangeStart:
{
OOX::Logic::CMoveToRangeStart* pMoveToRangeStart = static_cast<OOX::Logic::CMoveToRangeStart*>(item);
nCurPos = m_oBcw.WriteItemStart(c_oSerParType::MoveToRangeStart);
WriteMoveRangeStart(*pMoveToRangeStart);
m_oBcw.WriteItemEnd(nCurPos);
}break;
case OOX::et_w_moveToRangeEnd:
{
OOX::Logic::CMoveToRangeEnd* pMoveToRangeEnd = static_cast<OOX::Logic::CMoveToRangeEnd*>(item);
nCurPos = m_oBcw.WriteItemStart(c_oSerParType::MoveToRangeEnd);
WriteMoveRangeEnd(*pMoveToRangeEnd);
m_oBcw.WriteItemEnd(nCurPos);
}break;
default:
break;
}
@ -3285,39 +3313,38 @@ void BinaryDocumentTableWriter::WriteParagraphContent(const std::vector<OOX::Wri
m_oBcw.WriteItemEnd(nCurPos);
break;
}
//todo moveRange on all levels(body, p ...)
// case OOX::et_w_moveFromRangeStart:
// {
// OOX::Logic::CMoveFromRangeStart* pMoveFromRangeStart = static_cast<OOX::Logic::CMoveFromRangeStart*>(item);
// nCurPos = m_oBcw.WriteItemStart(c_oSerParType::MoveFromRangeStart);
// WriteMoveRangeStart(*pMoveFromRangeStart);
// m_oBcw.WriteItemEnd(nCurPos);
// break;
// }
// case OOX::et_w_moveFromRangeEnd:
// {
// OOX::Logic::CMoveFromRangeEnd* pMoveFromRangeEnd = static_cast<OOX::Logic::CMoveFromRangeEnd*>(item);
// nCurPos = m_oBcw.WriteItemStart(c_oSerParType::MoveFromRangeEnd);
// WriteMoveRangeEnd(*pMoveFromRangeEnd);
// m_oBcw.WriteItemEnd(nCurPos);
// break;
// }
// case OOX::et_w_moveToRangeStart:
// {
// OOX::Logic::CMoveToRangeStart* pMoveToRangeStart = static_cast<OOX::Logic::CMoveToRangeStart*>(item);
// nCurPos = m_oBcw.WriteItemStart(c_oSerParType::MoveToRangeStart);
// WriteMoveRangeStart(*pMoveToRangeStart);
// m_oBcw.WriteItemEnd(nCurPos);
// break;
// }
// case OOX::et_w_moveToRangeEnd:
// {
// OOX::Logic::CMoveToRangeEnd* pMoveToRangeEnd = static_cast<OOX::Logic::CMoveToRangeEnd*>(item);
// nCurPos = m_oBcw.WriteItemStart(c_oSerParType::MoveToRangeEnd);
// WriteMoveRangeEnd(*pMoveToRangeEnd);
// m_oBcw.WriteItemEnd(nCurPos);
// break;
// }
case OOX::et_w_moveFromRangeStart:
{
OOX::Logic::CMoveFromRangeStart* pMoveFromRangeStart = static_cast<OOX::Logic::CMoveFromRangeStart*>(item);
nCurPos = m_oBcw.WriteItemStart(c_oSerParType::MoveFromRangeStart);
WriteMoveRangeStart(*pMoveFromRangeStart);
m_oBcw.WriteItemEnd(nCurPos);
break;
}
case OOX::et_w_moveFromRangeEnd:
{
OOX::Logic::CMoveFromRangeEnd* pMoveFromRangeEnd = static_cast<OOX::Logic::CMoveFromRangeEnd*>(item);
nCurPos = m_oBcw.WriteItemStart(c_oSerParType::MoveFromRangeEnd);
WriteMoveRangeEnd(*pMoveFromRangeEnd);
m_oBcw.WriteItemEnd(nCurPos);
break;
}
case OOX::et_w_moveToRangeStart:
{
OOX::Logic::CMoveToRangeStart* pMoveToRangeStart = static_cast<OOX::Logic::CMoveToRangeStart*>(item);
nCurPos = m_oBcw.WriteItemStart(c_oSerParType::MoveToRangeStart);
WriteMoveRangeStart(*pMoveToRangeStart);
m_oBcw.WriteItemEnd(nCurPos);
break;
}
case OOX::et_w_moveToRangeEnd:
{
OOX::Logic::CMoveToRangeEnd* pMoveToRangeEnd = static_cast<OOX::Logic::CMoveToRangeEnd*>(item);
nCurPos = m_oBcw.WriteItemStart(c_oSerParType::MoveToRangeEnd);
WriteMoveRangeEnd(*pMoveToRangeEnd);
m_oBcw.WriteItemEnd(nCurPos);
break;
}
case OOX::et_m_oMathPara:
{
OOX::Logic::COMathPara* pOMathPara = static_cast<OOX::Logic::COMathPara*>(item);
@ -4222,6 +4249,38 @@ void BinaryDocumentTableWriter::WriteMathArgNodes(const std::vector<OOX::Writing
m_oBcw.WriteItemEnd(nCurPos);
break;
}
case OOX::et_w_moveFromRangeStart:
{
OOX::Logic::CMoveFromRangeStart* pMoveFromRangeStart = static_cast<OOX::Logic::CMoveFromRangeStart*>(item);
nCurPos = m_oBcw.WriteItemStart(c_oSer_OMathContentType::MoveFromRangeStart);
WriteMoveRangeStart(*pMoveFromRangeStart);
m_oBcw.WriteItemEnd(nCurPos);
break;
}
case OOX::et_w_moveFromRangeEnd:
{
OOX::Logic::CMoveFromRangeEnd* pMoveFromRangeEnd = static_cast<OOX::Logic::CMoveFromRangeEnd*>(item);
nCurPos = m_oBcw.WriteItemStart(c_oSer_OMathContentType::MoveFromRangeEnd);
WriteMoveRangeEnd(*pMoveFromRangeEnd);
m_oBcw.WriteItemEnd(nCurPos);
break;
}
case OOX::et_w_moveToRangeStart:
{
OOX::Logic::CMoveToRangeStart* pMoveToRangeStart = static_cast<OOX::Logic::CMoveToRangeStart*>(item);
nCurPos = m_oBcw.WriteItemStart(c_oSer_OMathContentType::MoveToRangeStart);
WriteMoveRangeStart(*pMoveToRangeStart);
m_oBcw.WriteItemEnd(nCurPos);
break;
}
case OOX::et_w_moveToRangeEnd:
{
OOX::Logic::CMoveToRangeEnd* pMoveToRangeEnd = static_cast<OOX::Logic::CMoveToRangeEnd*>(item);
nCurPos = m_oBcw.WriteItemStart(c_oSer_OMathContentType::MoveToRangeEnd);
WriteMoveRangeEnd(*pMoveToRangeEnd);
m_oBcw.WriteItemEnd(nCurPos);
break;
}
default:
break;
}
@ -6806,6 +6865,34 @@ void BinaryDocumentTableWriter::WriteTableContent(std::vector<OOX::WritingElemen
WriteBookmarkEnd(*pBookmarkEnd);
m_oBcw.WriteItemWithLengthEnd(nCurPos);
}
else if(OOX::et_w_moveFromRangeStart == item->getType())
{
OOX::Logic::CMoveFromRangeStart* pMoveFromRangeStart = static_cast<OOX::Logic::CMoveFromRangeStart*>(item);
nCurPos = m_oBcw.WriteItemStart(c_oSerDocTableType::MoveFromRangeStart);
WriteMoveRangeStart(*pMoveFromRangeStart);
m_oBcw.WriteItemEnd(nCurPos);
}
else if(OOX::et_w_moveFromRangeEnd == item->getType())
{
OOX::Logic::CMoveFromRangeEnd* pMoveFromRangeEnd = static_cast<OOX::Logic::CMoveFromRangeEnd*>(item);
nCurPos = m_oBcw.WriteItemStart(c_oSerDocTableType::MoveFromRangeEnd);
WriteMoveRangeEnd(*pMoveFromRangeEnd);
m_oBcw.WriteItemEnd(nCurPos);
}
else if(OOX::et_w_moveToRangeStart == item->getType())
{
OOX::Logic::CMoveToRangeStart* pMoveToRangeStart = static_cast<OOX::Logic::CMoveToRangeStart*>(item);
nCurPos = m_oBcw.WriteItemStart(c_oSerDocTableType::MoveToRangeStart);
WriteMoveRangeStart(*pMoveToRangeStart);
m_oBcw.WriteItemEnd(nCurPos);
}
else if(OOX::et_w_moveToRangeEnd == item->getType())
{
OOX::Logic::CMoveToRangeEnd* pMoveToRangeEnd = static_cast<OOX::Logic::CMoveToRangeEnd*>(item);
nCurPos = m_oBcw.WriteItemStart(c_oSerDocTableType::MoveToRangeEnd);
WriteMoveRangeEnd(*pMoveToRangeEnd);
m_oBcw.WriteItemEnd(nCurPos);
}
}
}
void BinaryDocumentTableWriter::WriteRow(const OOX::Logic::CTr& Row, OOX::Logic::CTableProperty* pTblPr, int nCurRowIndex, int nRows, int nCols)
@ -6880,6 +6967,34 @@ void BinaryDocumentTableWriter::WriteRowContent(const std::vector<OOX::WritingEl
WriteBookmarkEnd(*pBookmarkEnd);
m_oBcw.WriteItemWithLengthEnd(nCurPos);
}
else if(OOX::et_w_moveFromRangeStart == item->getType())
{
OOX::Logic::CMoveFromRangeStart* pMoveFromRangeStart = static_cast<OOX::Logic::CMoveFromRangeStart*>(item);
nCurPos = m_oBcw.WriteItemStart(c_oSerDocTableType::MoveFromRangeStart);
WriteMoveRangeStart(*pMoveFromRangeStart);
m_oBcw.WriteItemEnd(nCurPos);
}
else if(OOX::et_w_moveFromRangeEnd == item->getType())
{
OOX::Logic::CMoveFromRangeEnd* pMoveFromRangeEnd = static_cast<OOX::Logic::CMoveFromRangeEnd*>(item);
nCurPos = m_oBcw.WriteItemStart(c_oSerDocTableType::MoveFromRangeEnd);
WriteMoveRangeEnd(*pMoveFromRangeEnd);
m_oBcw.WriteItemEnd(nCurPos);
}
else if(OOX::et_w_moveToRangeStart == item->getType())
{
OOX::Logic::CMoveToRangeStart* pMoveToRangeStart = static_cast<OOX::Logic::CMoveToRangeStart*>(item);
nCurPos = m_oBcw.WriteItemStart(c_oSerDocTableType::MoveToRangeStart);
WriteMoveRangeStart(*pMoveToRangeStart);
m_oBcw.WriteItemEnd(nCurPos);
}
else if(OOX::et_w_moveToRangeEnd == item->getType())
{
OOX::Logic::CMoveToRangeEnd* pMoveToRangeEnd = static_cast<OOX::Logic::CMoveToRangeEnd*>(item);
nCurPos = m_oBcw.WriteItemStart(c_oSerDocTableType::MoveToRangeEnd);
WriteMoveRangeEnd(*pMoveToRangeEnd);
m_oBcw.WriteItemEnd(nCurPos);
}
}
}
void BinaryDocumentTableWriter::WriteCell(OOX::Logic::CTc& tc, OOX::Logic::CTableProperty* pTblPr, int nCurRowIndex, int nCurColIndex, int nRows, int nCols)

View File

@ -143,7 +143,7 @@ docx_conversion_context::docx_conversion_context(odf_reader::odf_document * OdfD
text_tracked_context_ (*this),
table_context_ (*this),
output_document_ (NULL),
process_note_ (noNote),
current_process_note_ (noNote),
new_list_style_number_ (0),
current_margin_left_ (0),
current_outline_level_ (-1),
@ -151,7 +151,7 @@ docx_conversion_context::docx_conversion_context(odf_reader::odf_document * OdfD
is_delete_text_ (false),
delayed_converting_ (false),
process_headers_footers_ (false),
process_comment_ (false),
current_process_comment_ (false),
mediaitems_ (OdfDocument->get_folder() ),
math_context_ (OdfDocument->odf_context().fontContainer(), false),
odf_document_ (OdfDocument)
@ -619,9 +619,9 @@ std::wstring docx_conversion_context::add_hyperlink(const std::wstring & href, b
{
hyperlinks::_type_place type = hyperlinks::document_place;
if (process_comment_ == true) type = hyperlinks::comment_place;
else if (process_note_ == footNote || process_note_ == footNoteRefSet) type = hyperlinks::footnote_place;
else if (process_note_ == endNote || process_note_ == endNoteRefSet ) type = hyperlinks::endnote_place;
if (current_process_comment_ == true) type = hyperlinks::comment_place;
else if (current_process_note_ == footNote || current_process_note_ == footNoteRefSet) type = hyperlinks::footnote_place;
else if (current_process_note_ == endNote || current_process_note_ == endNoteRefSet ) type = hyperlinks::endnote_place;
std::wstring href_correct = xml::utils::replace_text_to_xml(href);
XmlUtils::replace_all( href_correct, L" .", L".");//1 (130).odt
@ -1566,6 +1566,9 @@ int docx_conversion_context::process_paragraph_attr(odf_reader::text::paragraph_
root()->odf_context().styleContainer().style_by_name(Attr->text_style_name_, odf_types::style_family::Paragraph, process_headers_footers_)
)
{
double font_size = odf_reader::text_format_properties_content::process_font_size_impl(odf_types::font_size(odf_types::percent(100.0)), styleInst);
if (font_size > 0) current_fontSize.push_back(font_size);
process_page_break_after(styleInst);
if (styleInst->is_automatic())
@ -1938,12 +1941,12 @@ void notes_context::dump_rels(rels & Rels) const
void docx_conversion_context::add_note_reference ()
{
if (process_note_ == footNote || process_note_ == endNote)
if (current_process_note_ == footNote || current_process_note_ == endNote)
{
add_element_to_run(_T(""));
output_stream() << ((process_note_ == footNote) ? L"<w:footnoteRef />" : L"<w:endnoteRef />");
output_stream() << ((current_process_note_ == footNote) ? L"<w:footnoteRef />" : L"<w:endnoteRef />");
finish_run();
process_note_ = (NoteType) (process_note_ + 1); //add ref set
current_process_note_ = (NoteType) (current_process_note_ + 1); //add ref set
}
}
@ -1992,7 +1995,7 @@ void docx_conversion_context::start_text_changes (const std::wstring &id)
void docx_conversion_context::start_changes()
{
if (map_current_changes_.empty()) return;
if (process_comment_) return;
if (current_process_comment_) return;
text_tracked_context_.dumpPPr_.clear();
text_tracked_context_.dumpRPr_.clear();
@ -2091,7 +2094,7 @@ void docx_conversion_context::start_changes()
void docx_conversion_context::end_changes()
{
if (process_comment_) return;
if (current_process_comment_) return;
for (map_changes_iterator it = map_current_changes_.begin(); it != map_current_changes_.end(); ++it)
{

View File

@ -910,26 +910,28 @@ public:
StreamsManPtr get_stream_man() const { return streams_man_; }
void set_stream_man(StreamsManPtr Sm) { streams_man_ = Sm; }
void set_rtl(bool val) { is_rtl_ = val; }
bool get_rtl() const {return is_rtl_;}
void set_rtl(bool val) { is_rtl_ = val; }
bool get_rtl() const {return is_rtl_;}
double get_current_fontSize() {return current_fontSize.empty() ? 0 : current_fontSize.back();}
void pop_current_fontSize() {if (!current_fontSize.empty()) current_fontSize.pop_back();}
void set_margin_left(int val) {current_margin_left_ = val;}
int get_margin_left() {return current_margin_left_;}
void set_outline_level(int val) {current_outline_level_ = val;}
int get_outline_level() {return current_outline_level_;}
void set_process_note (NoteType Val) { process_note_ = Val; }
NoteType get_process_note () const { return process_note_; }
void set_process_note (NoteType Val) { current_process_note_ = Val; }
NoteType get_process_note () const { return current_process_note_; }
void add_note_reference ();
oox_chart_context & current_chart();
void start_chart(std::wstring name);
void end_chart ();
void start_comment () {process_comment_ = true;}
void end_comment () {process_comment_ = false;}
bool process_comment_;
void start_comment () {current_process_comment_ = true;}
void end_comment () {current_process_comment_ = false;}
void start_math_formula ();
void end_math_formula ();
@ -959,6 +961,7 @@ public:
void end_changes();
void add_jsaProject(const std::string &content);
private:
struct _context_state
@ -1011,14 +1014,14 @@ private:
std::vector<oox_chart_context_ptr> charts_;
headers_footers headers_footers_;
std::wstring automatic_parent_style_;
std::wstring current_master_page_name_;
std::wstring text_list_style_name_;
std::vector<std::wstring> list_style_stack_;
std::vector<std::wstring> fields_names_stack_;
std::wstring automatic_parent_style_;
std::wstring current_master_page_name_;
std::wstring text_list_style_name_;
bool first_element_list_item_;
std::vector<std::wstring> list_style_stack_;
std::vector<std::wstring> fields_names_stack_;
bool first_element_list_item_;
bool page_break_after_;
bool page_break_before_;
@ -1032,11 +1035,13 @@ private:
bool is_delete_text_;
bool is_rtl_; // right-to-left
std::wstring current_alphabetic_index_;
int current_margin_left_;
int current_outline_level_;
int new_list_style_number_; // счетчик для нумерации имен созданных в процессе конвертации стилей
NoteType process_note_;
NoteType current_process_note_;
bool current_process_comment_;
std::vector<double> current_fontSize;
std::wstring current_alphabetic_index_;
int current_margin_left_;
int current_outline_level_;
int new_list_style_number_; // счетчик для нумерации имен созданных в процессе конвертации стилей
std::vector<odf_reader::office_element*> delayed_elements_;

View File

@ -193,7 +193,14 @@ std::wstring mediaitems::detectImageFileExtension(const std::wstring &fileName)
CImageFileFormatChecker image_checker;
sExt = image_checker.DetectFormatByData(buffer, buffer_size);
if (!sExt.empty()) sExt = std::wstring(L".") + sExt;
if (sExt.empty())
{
size_t n = fileName.rfind(L".");
if (n != std::wstring::npos)
sExt = XmlUtils::GetLower(fileName.substr(n));
}
else sExt = std::wstring(L".") + sExt;
}
return XmlUtils::GetLower(sExt);
}

View File

@ -493,6 +493,10 @@ void pptx_slide_context::set_image(const std::wstring & path)
impl_->object_description_.type_ = typeImage;
impl_->object_description_.xlink_href_ = path;
}
else if (impl_->object_description_.type_ == typeImage && impl_->object_description_.xlink_href_.rfind(L".svg") != std::wstring::npos)
{
impl_->object_description_.xlink_href_ = path;
}
else if (impl_->use_image_replacement_)
{
impl_->object_description_.fill_.type = 2;

View File

@ -1204,7 +1204,10 @@ void text_format_properties_content::docx_convert(oox::docx_conversion_context &
double fontSizeVal = (fo_font_size_) ? process_font_size_impl(fo_font_size_, Context.get_styles_context().get_current_processed_style()) :
process_font_size_impl(font_size(percent(100.0)), Context.get_styles_context().get_current_processed_style());
if (style_text_position_->get_type() == text_position::Percent)
if (fontSizeVal <= 0)
fontSizeVal = Context.get_current_fontSize();
if (style_text_position_->get_type() == text_position::Percent)
{
const double mul = style_text_position_->get_position().get_value() / 100.0;
if (fontSizeVal > 0)

View File

@ -90,11 +90,9 @@ public:
int process_font_size (const _CP_OPT(odf_types::font_size) & FontSize, const style_instance * currnetStyle, bool Complex = false, double Mul = 1.0);
private:
static double process_font_size_impl (const _CP_OPT(odf_types::font_size) & FontSize, const style_instance * currnetStyle, bool Complex = false, double Mul = 1.0);
static int process_font_weight (const _CP_OPT(odf_types::font_weight) & FontWeight);
static int process_font_style (const _CP_OPT(odf_types::font_style) & FontStyle);
public:
_CP_OPT(std::wstring) r_style_;
_CP_OPT(odf_types::font_variant) fo_font_variant_;

View File

@ -370,7 +370,9 @@ void paragraph::docx_convert(oox::docx_conversion_context & Context)
if (textStyle > 0)
{
is_empty = false;
if (textStyle==1) Context.pop_text_properties();
if (textStyle == 1) Context.pop_text_properties();
Context.pop_current_fontSize();
}
Context.finish_run();

View File

@ -885,7 +885,8 @@ bool odf_drawing_context::change_text_box_2_wordart()
draw_base* draw_old = dynamic_cast<draw_base*>(impl_->current_level_[sz - 1].get());
if (draw_old)
{
draw_old->content_[draw_old->content_.size() - 1] = draw_elm;
if (draw_old->content_.size() > 1)
draw_old->content_[draw_old->content_.size() - 1] = draw_elm;
}
}
//----------------------------------------------

View File

@ -874,8 +874,10 @@ void ods_table_state::set_cell_formula(std::wstring & formula)
{
if (formula.empty())return;
ods_conversion_context* ods_context = dynamic_cast<ods_conversion_context*>(context_);
//test external link
bool bExternal = true;
bool bExternal = !ods_context->externals_.empty();
boost::wregex re(L"([\[]\\d+[\]])+");
while(bExternal)
@ -884,11 +886,12 @@ void ods_table_state::set_cell_formula(std::wstring & formula)
bExternal = boost::regex_search(formula, result, re);
if (!bExternal) break;
ods_conversion_context* ods_context = dynamic_cast<ods_conversion_context*>(context_);
std::wstring refExternal = result[1].str();
int idExternal = XmlUtils::GetInteger(refExternal.substr(1, refExternal.length() - 1)) - 1;
bExternal = idExternal >= 0 && idExternal < ods_context->externals_.size();
while(idExternal >= 0 && idExternal < ods_context->externals_.size())
{
size_t pos = formula.find(refExternal);

View File

@ -3009,7 +3009,7 @@ void CDrawingConverter::doc_LoadShape(PPTX::Logic::SpTreeElem *elem, XmlUtils::C
if (bStroked)
{
CheckPenShape(elem, oNodeShape, pPPTShape);
CheckPenShape(elem, oNodeShape, pPPTShape);
}
CheckBrushShape(elem, oNodeShape, pPPTShape);
@ -4104,18 +4104,21 @@ void CDrawingConverter::CheckBorderShape(PPTX::Logic::SpTreeElem* oElem, XmlUtil
if (oNodeBorder.IsValid())
{
pSpPr->ln.Init();
nullable_int nWidthBorder;
XmlMacroReadAttributeBase(oNode, L"width", nWidthBorder);
nullable_string sTypeBorder;
XmlMacroReadAttributeBase(oNode, L"type", sTypeBorder);
XmlMacroReadAttributeBase(oNodeBorder, L"type", sTypeBorder);
SimpleTypes::CBorderType<> borderType;
if (sTypeBorder.IsInit())
{
SimpleTypes::CBorderType<> borderType;
borderType.FromString(sTypeBorder.get());
}
if (borderType.GetValue() != SimpleTypes::bordertypeNone)
{
pSpPr->ln.Init();
nullable_int nWidthBorder;
XmlMacroReadAttributeBase(oNodeBorder, L"width", nWidthBorder);
if (borderType.GetValue() > 0 &&
borderType.GetValue() < 6)
{
@ -4131,30 +4134,29 @@ void CDrawingConverter::CheckBorderShape(PPTX::Logic::SpTreeElem* oElem, XmlUtil
case SimpleTypes::bordertypeDotDash: pSpPr->ln->prstDash->val->SetBYTECode(1); break;
}
}
}
if (nWidthBorder.IsInit())
{
pSpPr->ln->w = (int)(*nWidthBorder * g_emu_koef);//pt to emu
}
if (sColorBorder.IsInit())
{
PPTX::Logic::SolidFill* pSolid = new PPTX::Logic::SolidFill();
pSolid->m_namespace = L"a";
pSolid->Color.Color = new PPTX::Logic::SrgbClr();
if (std::wstring::npos != sColorBorder->find(L"#"))
if (nWidthBorder.IsInit())
{
pSolid->Color.Color->SetHexString(sColorBorder->substr(1));
pSpPr->ln->w = (int)(*nWidthBorder * g_emu_koef);//pt to emu
}
else
if (sColorBorder.IsInit())
{
//"red", L"black" , .. to color
PPTX::Logic::SolidFill* pSolid = new PPTX::Logic::SolidFill();
pSolid->m_namespace = L"a";
pSolid->Color.Color = new PPTX::Logic::SrgbClr();
if (std::wstring::npos != sColorBorder->find(L"#"))
{
pSolid->Color.Color->SetHexString(sColorBorder->substr(1));
}
else
{
//"red", L"black" , .. to color
}
pSpPr->ln->Fill.m_type = PPTX::Logic::UniFill::solidFill;
pSpPr->ln->Fill.Fill = pSolid;
}
pSpPr->ln->Fill.m_type = PPTX::Logic::UniFill::solidFill;
pSpPr->ln->Fill.Fill = pSolid;
}
}
}

View File

@ -0,0 +1,84 @@
/*
* (c) Copyright Ascensio System SIA 2010-2019
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
* street, Riga, Latvia, EU, LV-1050.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#ifndef _BUILDER_COMMON_H
#define _BUILDER_COMMON_H
#ifndef Q_DECL_EXPORT
#define Q_BUILDCUSTOM_VISIBILITY_AVAILABLE
#ifndef Q_BUILDCUSTOM_VISIBILITY_AVAILABLE
#ifdef QT_VISIBILITY_AVAILABLE
#define Q_BUILDCUSTOM_VISIBILITY_AVAILABLE
#endif
#endif
#if defined(_WIN32) || defined(_WIN32_WCE) || defined(_WIN64)
#define Q_DECL_EXPORT __declspec(dllexport)
#define Q_DECL_IMPORT __declspec(dllimport)
#elif defined(Q_BUILDCUSTOM_VISIBILITY_AVAILABLE)
#define Q_DECL_EXPORT __attribute__((visibility("default")))
#define Q_DECL_IMPORT __attribute__((visibility("default")))
#endif
#ifndef Q_DECL_EXPORT
#define Q_DECL_EXPORT
#endif
#ifndef Q_DECL_IMPORT
#define Q_DECL_IMPORT
#endif
#endif
#define OFFICESTUDIO_FILE_DOCUMENT 0x0040
#define OFFICESTUDIO_FILE_DOCUMENT_DOCX OFFICESTUDIO_FILE_DOCUMENT + 0x0001
#define OFFICESTUDIO_FILE_DOCUMENT_ODT OFFICESTUDIO_FILE_DOCUMENT + 0x0003
#define OFFICESTUDIO_FILE_DOCUMENT_RTF OFFICESTUDIO_FILE_DOCUMENT + 0x0004
#define OFFICESTUDIO_FILE_DOCUMENT_TXT OFFICESTUDIO_FILE_DOCUMENT + 0x0005
#define OFFICESTUDIO_FILE_PRESENTATION 0x0080
#define OFFICESTUDIO_FILE_PRESENTATION_PPTX OFFICESTUDIO_FILE_PRESENTATION + 0x0001
#define OFFICESTUDIO_FILE_SPREADSHEET 0x0100
#define OFFICESTUDIO_FILE_SPREADSHEET_XLSX OFFICESTUDIO_FILE_SPREADSHEET + 0x0001
#define OFFICESTUDIO_FILE_SPREADSHEET_ODS OFFICESTUDIO_FILE_SPREADSHEET + 0x0003
#define OFFICESTUDIO_FILE_SPREADSHEET_CSV OFFICESTUDIO_FILE_SPREADSHEET + 0x0004
#define OFFICESTUDIO_FILE_CROSSPLATFORM 0x0200
#define OFFICESTUDIO_FILE_CROSSPLATFORM_PDF OFFICESTUDIO_FILE_CROSSPLATFORM + 0x0001
#define OFFICESTUDIO_FILE_IMAGE 0x0400
#define OFFICESTUDIO_FILE_IMAGE_JPG OFFICESTUDIO_FILE_IMAGE + 0x0001
#define OFFICESTUDIO_FILE_IMAGE_PNG OFFICESTUDIO_FILE_IMAGE + 0x0005
#endif // _BUILDER_COMMON_H

View File

@ -0,0 +1,54 @@
QT -= core
QT -= gui
TARGET = docbuilder
CONFIG += console
CONFIG -= app_bundle
PRODUCT_VERSION=$$(PRODUCT_VERSION)
BUILD_NUMBER=$$(BUILD_NUMBER)
isEmpty(PRODUCT_VERSION) {
BINARYVERSION = 0.0.0.0
}
else {
BINARYVERSION = $$(PRODUCT_VERSION).$$(BUILD_NUMBER)
}
DEFINES += INTVER=$$BINARYVERSION
TEMPLATE = app
CONFIG += core_static_link_libstd
CORE_ROOT_DIR = $$PWD/../../../../core
PWD_ROOT_DIR = $$PWD
include($$CORE_ROOT_DIR/Common/base.pri)
include($$CORE_ROOT_DIR/Common/3dParty/icu/icu.pri)
core_linux {
QMAKE_LFLAGS += -Wl,--rpath=./:./system
}
core_win_64 {
QMAKE_LFLAGS_CONSOLE = /SUBSYSTEM:CONSOLE,5.02
}
core_win_32 {
QMAKE_LFLAGS_CONSOLE = /SUBSYSTEM:CONSOLE,5.01
}
core_windows {
RC_FILE = version.rc
}
############### destination path ###############
DESTDIR = $$CORE_ROOT_DIR/build/bin/$$CORE_BUILDS_PLATFORM_PREFIX
################################################
LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH -ldoctrenderer -lkernel -lgraphics -lUnicodeConverter
core_linux {
LIBS += -ldl
}
SOURCES += main.cpp

Binary file not shown.

After

Width:  |  Height:  |  Size: 279 KiB

View File

@ -0,0 +1,146 @@
/*
* (c) Copyright Ascensio System SIA 2010-2019
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
* street, Riga, Latvia, EU, LV-1050.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#include "./common.h"
#include "../docbuilder.h"
#include "../../common/File.h"
#ifdef LINUX
#include "../../../DesktopEditor/common/File.h"
#endif
#include <iostream>
#include <string>
#define VALUE_TO_STRING(x) #x
#define VALUE(x) VALUE_TO_STRING(x)
#ifdef WIN32
int wmain(int argc, wchar_t *argv[])
#else
int main(int argc, char *argv[])
#endif
{
if (argc <= 0)
return 0;
bool bIsHelp = false;
for (int i = 0; i < argc; ++i)
{
#ifdef WIN32
std::wstring sW(argv[i]);
std::string sParam(sW.begin(), sW.end());
#else
std::string sParam(argv[i]);
#endif
if (sParam == "-v" ||
sParam == "-version")
{
std::cout << "v" VALUE(INTVER) << std::endl;
NSDoctRenderer::CDocBuilder oBuilder;
oBuilder.ExecuteCommand(L"checkL");
char* sSdkVer = oBuilder.GetVersion();
if (NULL != sSdkVer)
{
std::string sSdkVerStd(sSdkVer);
std::cout << "sdk version: " << sSdkVerStd << std::endl;
delete [] sSdkVer;
}
return 0;
}
if (sParam == "-h" ||
sParam == "-help")
{
bIsHelp = true;
}
}
if (argc < 2 || bIsHelp)
{
std::cout << "USAGE: documentbuilder \"path_to_script_file\"" << std::endl;
NSDoctRenderer::CDocBuilder oBuilder;
oBuilder.ExecuteCommand(L"checkL");
return 0;
}
#ifdef WIN32
std::wstring sBuildFile(argv[argc - 1]);
#else
std::string sBuildFileA(argv[argc - 1]);
std::wstring sBuildFile = NSFile::CUtf8Converter::GetUnicodeStringFromUTF8((BYTE*)sBuildFileA.c_str(), (LONG)sBuildFileA.length());
#endif
NSDoctRenderer::CDocBuilder::Initialize();
if (true)
{
NSDoctRenderer::CDocBuilder oBuilder;
oBuilder.SetProperty("--check-fonts", L"");
//oBuilder.SetProperty("--use-doctrenderer-scheme", L"");
//oBuilder.SetProperty("--work-directory", L"builder");
for (int i = 0; i < (argc - 1); ++i)
{
#ifdef WIN32
std::wstring sW(argv[i]);
std::string sParam = U_TO_UTF8(sW);
#else
std::string sParam(argv[i]);
#endif
if (sParam.find("--") == 0)
{
std::string::size_type _pos = sParam.find('=');
if (std::string::npos == _pos)
oBuilder.SetProperty(sParam.c_str(), L"");
else
{
std::string sName = sParam.substr(0, _pos);
std::string sValue = sParam.substr(_pos + 1);
std::wstring sValueW = NSFile::CUtf8Converter::GetUnicodeStringFromUTF8((BYTE*)sValue.c_str(), (LONG)sValue.length());
oBuilder.SetProperty(sName.c_str(), sValueW.c_str());
}
}
else
continue;
}
oBuilder.Run(sBuildFile.c_str());
}
NSDoctRenderer::CDocBuilder::Dispose();
return 0;
}

View File

@ -0,0 +1,30 @@
#ifndef VERSION_H
#define VERSION_H
#define VER_FILEVERSION 1,0,0,2
#define VER_FILEVERSION_STR "1.0.0.2\0"
#define VER_PRODUCTVERSION VER_FILEVERSION
#define VER_PRODUCTVERSION_STR "1.0\0"
#ifdef ONLY_RU
#define VER_COMPANYNAME_STR "Novie kommunikacionnie tehnologii CJSC\0"
#define VER_LEGALCOPYRIGHT_STR "Novie kommunikacionnie tehnologii CJSC, 2016\0"
#define VER_COMPANYDOMAIN_STR "www.onlyoffice.ru\0"
#define ABOUT_COPYRIGHT_STR "1999-2016 ЗАО 'НКТ'\0"
#else
#define VER_COMPANYNAME_STR "Ascensio System SIA\0"
#define VER_LEGALCOPYRIGHT_STR "Ascensio System SIA 2016\0"
#define VER_COMPANYDOMAIN_STR "www.onlyoffice.com\0"
#define ABOUT_COPYRIGHT_STR VER_LEGALCOPYRIGHT_STR
#endif
#define VER_FILEDESCRIPTION_STR "ONLYOFFICE Document Builder\0"
#define VER_INTERNALNAME_STR "Document Builder\0"
#define VER_LEGALTRADEMARKS1_STR "All Rights Reserved\0"
#define VER_LEGALTRADEMARKS2_STR VER_LEGALTRADEMARKS1_STR
#define VER_ORIGINALFILENAME_STR "docbuilder.exe\0"
#define VER_PRODUCTNAME_STR "ONLYOFFICE Document Builder\0"
#endif

View File

@ -0,0 +1,32 @@
MAINICON ICON DISCARDABLE "./icons.ico"
#include <windows.h>
#include "./version.h"
VS_VERSION_INFO VERSIONINFO
FILEVERSION VER_FILEVERSION
PRODUCTVERSION VER_PRODUCTVERSION
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904E4"
BEGIN
VALUE "CompanyName", VER_COMPANYNAME_STR
VALUE "FileDescription", VER_FILEDESCRIPTION_STR
VALUE "FileVersion", VER_FILEVERSION_STR
VALUE "InternalName", VER_INTERNALNAME_STR
VALUE "LegalCopyright", VER_LEGALCOPYRIGHT_STR
VALUE "LegalTrademarks1", VER_LEGALTRADEMARKS1_STR
VALUE "LegalTrademarks2", VER_LEGALTRADEMARKS2_STR
VALUE "OriginalFilename", VER_ORIGINALFILENAME_STR
VALUE "ProductName", VER_PRODUCTNAME_STR
VALUE "ProductVersion", VER_PRODUCTVERSION_STR
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1252
END
END

View File

@ -322,7 +322,21 @@ bool CImageFileFormatChecker::isSvmFile(BYTE* pBuffer,DWORD dwBytes)
return false;
}
bool CImageFileFormatChecker::isSvgFile(BYTE* pBuffer,DWORD dwBytes)
{
if (eFileType)return false;
if ( (6 <= dwBytes) &&(0x3C == pBuffer[0] && 0x3F == pBuffer[1] && 0x78 == pBuffer[2] && 0x6D == pBuffer[3]
&& 0x6C == pBuffer[4] && 0x20 == pBuffer[5]))
{
std::string sXml_part = std::string((char*)pBuffer, dwBytes);
if (sXml_part.find(std::string("svg")) != std::string::npos)
{
return true;
}
}
return false;
}
bool CImageFileFormatChecker::isJ2kFile(BYTE* pBuffer,DWORD dwBytes)
{
@ -602,6 +616,7 @@ std::wstring CImageFileFormatChecker::DetectFormatByData(BYTE *Data, int DataSiz
else if (isTiffFile(Data,DataSize))return L"tif";
else if (isWmfFile(Data,DataSize)) return L"wmf";
else if (isSvmFile(Data,DataSize)) return L"svm";
else if (isSvgFile(Data,DataSize)) return L"svg";
return L"jpg";
return L"";
}

View File

@ -103,6 +103,7 @@ public:
bool isMj2File(BYTE* pBuffer,DWORD dwBytes);
bool isIpodFile(BYTE* pBuffer,DWORD dwBytes);
bool isPgxFile(BYTE* pBuffer,DWORD dwBytes);
bool isSvgFile(BYTE* pBuffer,DWORD dwBytes);
std::wstring DetectFormatByData(BYTE *Data, int DataSize);

View File

@ -104,7 +104,7 @@ TARGETS += $(VIDEOPLAYERLIB)
X2T_PRO := $(abspath X2tConverter/build/Qt/X2tSLN.pro)
HTMLFILEINTERNAL_PRO := $(abspath ../desktop-sdk/HtmlFile/Internal/Internal.pro)
ALLFONTSGEN_PRO := $(abspath DesktopEditor/AllFontsGen/AllFontsGen.pro)
DOCBUILDER_PRO := $(abspath ../core-ext/docbuilder/test_builder/docbuilder.pro)
DOCBUILDER_PRO := $(abspath DesktopEditor/doctrenderer/app_builder/docbuilder.pro)
PDFWRITER_PRO := $(abspath PdfWriter/PdfWriter.pro)
GRAPHICS_PRO := $(abspath DesktopEditor/graphics/pro/graphics.pro)
DOCTRENDERER_PRO := $(abspath DesktopEditor/doctrenderer/doctrenderer.pro)
@ -120,7 +120,8 @@ OOXMLSIGNATURE_PRO := $(abspath DesktopEditor/xmlsec/src/ooxmlsignature.pro)
HUNSPELL_PRO := $(abspath DesktopEditor/hunspell-1.3.3/src/qt/hunspell.pro)
KERNEL_PRO := $(abspath Common/kernel.pro)
CRYPTOPP_PRO := $(abspath Common/3dParty/cryptopp/project/cryptopp.pro)
VIDEOPLAYERLIB_PRO := $(abspath ../core-ext/multimedia/videoplayer/lib/VideoPlayerLib.pro)
#VIDEOPLAYERLIB_PRO := $(abspath ../core-ext/multimedia/videoplayer/lib/VideoPlayerLib.pro)
VIDEOPLAYERLIB_PRO := $(abspath ../desktop-sdk/ChromiumBasedEditors/videoplayerlib/videoplayerlib.pro)
# PROS += $(basename $(X2T_PRO)).build
# PROS += ALLFONTSGEN_PRO
@ -270,7 +271,7 @@ all: $(CORE_TARGET)
ext: $(EXT_TARGET)
desktop: $(ASCDOCUMENTSCORE)
desktop: $(ASCDOCUMENTSCORE) $(VIDEOPLAYERLIB)
video: $(VIDEOPLAYERLIB)

View File

@ -2998,7 +2998,7 @@ void BinaryWorksheetTableWriter::WriteCell(const OOX::Spreadsheet::CCell& oCell)
m_oBcw.WriteItemEnd(nCurPos);
}
//Value
if(oCell.m_oValue.IsInit())
if(oCell.m_oValue.IsInit() && !oCell.m_oValue->ToString().empty())
{
double dValue = 0;