Commit a1e41d20 authored by Elen.Subbotina's avatar Elen.Subbotina Committed by Alexander Trofimov

OdfFileReader включен в x2t (stable)

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@62938 954022d7-b5bf-4e40-9824-e11837661b57
parent e3a40816
......@@ -2,6 +2,7 @@
#include <iosfwd>
namespace cpdoccore
{
template <class Ostream>
......@@ -14,17 +15,20 @@ namespace cpdoccore
template <class T>
Ostream & operator << (const T & t)
{
#if _DEBUG
return (ostream_ << t );
#endif
ostream_ << t;
return ostream_;
}
private:
Ostream & ostream_;
};
extern logging< std::wostream > logging_cout;
extern logging< std::wostream > logging_cout;
extern logging< std::wstringstream >logging_log;
}
#define _CP_LOG cpdoccore::logging_cout
#ifdef _DEBUG
#define _CP_LOG cpdoccore::logging_cout
#else
#define _CP_LOG cpdoccore::logging_log
#endif
......@@ -27,6 +27,7 @@ INCLUDEPATH += ../../../ServerComponents/DesktopEditor/freetype-2.5.2/include
CONFIG(debug, debug|release){
DEFINES += _DEBUG
}
SOURCES += \
../formulasconvert/formulasconvert_odf.cpp \
../formulasconvert/formulasconvert_oox.cpp \
......
......@@ -15,7 +15,7 @@ bool read_doc_element::read_sax( xml::sax * Reader )
if (!attrb->check())
{
std::wcerr << " -- end (" << Reader->nodeQualifiedName() << ")\n";
//std::wcerr << " -- attr check error (" << Reader->nodeQualifiedName() << ")\n";
}
//const std::wstring value = Reader->value();
......
......@@ -9,16 +9,16 @@ namespace oox {
void conversion_element::docx_convert(docx_conversion_context & Context)
{
_CP_LOG << L"[warning] empty conversion_element::docx_convert: \"" << typeid(*this).name() << L"\"\n";
//_CP_LOG << L"[warning] empty conversion_element::docx_convert: \"" << typeid(*this).name() << L"\"\n";
}
void conversion_element::xlsx_convert(xlsx_conversion_context & Context)
{
_CP_LOG << L"[warning] empty conversion_element::xlsx_convert: \"" << typeid(*this).name() << L"\"\n";
//_CP_LOG << L"[warning] empty conversion_element::xlsx_convert: \"" << typeid(*this).name() << L"\"\n";
}
void conversion_element::pptx_convert(pptx_conversion_context & Context)
{
_CP_LOG << L"[warning] empty conversion_element::pptx_convert: \"" << typeid(*this).name() << L"\"\n";
// _CP_LOG << L"[warning] empty conversion_element::pptx_convert: \"" << typeid(*this).name() << L"\"\n";
}
}
......
#include <logging.h>
#include <iostream>
#include <sstream>
namespace cpdoccore
{
logging< std::wostream > logging_cout(std::wcout);
std::wstringstream log_stringstream;
logging< std::wostream > logging_cout (std::wcout);
logging< std::wstringstream > logging_log (log_stringstream);
}
......@@ -89,7 +89,7 @@ public:
if (!values_.access()[i->second])
{
res = false;
std::wcerr << L"[attributes] : " << i->first << std::endl;
//std::wcerr << L"[attributes] : " << i->first << std::endl;
}
}
}
......
......@@ -360,7 +360,7 @@ bool ParagraphPropDestination::ExecuteCommand(RtfDocument& oDocument, RtfReader&
ITextItemPtr piCurContainer;
oParagraphReader.m_oParPropDest.m_oTextItems->GetItem( piCurContainer, 0 );
if( NULL != piCurContainer && TYPE_RTF_PARAGRAPH == piCurContainer->GetType() )
oReader.m_oState->m_oCurOldList.m_oText = boost::shared_static_cast<RtfParagraph, ITextItem>( piCurContainer ) ;
oReader.m_oState->m_oCurOldList.m_oText = boost::static_pointer_cast<RtfParagraph, ITextItem>( piCurContainer ) ;
}
}
}
......
......@@ -2544,14 +2544,14 @@ public:
// {
// case RtfStyle::stCharacter:
// {
// RtfCharStylePtr m_oCurCharStyle = boost::shared_static_cast< RtfCharStyle, RtfStyle >( m_oCurStyle );
// RtfCharStylePtr m_oCurCharStyle = boost::static_pointer_cast< RtfCharStyle, RtfStyle >( m_oCurStyle );
// m_oCurCharStyle->m_oCharProp = oReader.m_oState->m_oCharProp;
// oDocument.m_oStyleTable.AddItem( m_oCurStyle );
// break;
// }
// case RtfStyle::stParagraph:
// {
// RtfParagraphStylePtr m_oCurParStyle = boost::shared_static_cast< RtfParagraphStyle, RtfStyle >( m_oCurStyle );
// RtfParagraphStylePtr m_oCurParStyle = boost::static_pointer_cast< RtfParagraphStyle, RtfStyle >( m_oCurStyle );
// m_oCurParStyle->m_oCharProp = oReader.m_oState->m_oCharProp;
// m_oCurParStyle->m_oParProp = oReader.m_oState->m_oParagraphProp;
// oDocument.m_oStyleTable.AddItem( m_oCurStyle );
......@@ -2559,7 +2559,7 @@ public:
// }
// case RtfStyle::stTable:
// {
// RtfTableStylePtr m_oCurTableStyle = boost::shared_static_cast< RtfTableStyle, RtfStyle >( m_oCurStyle );
// RtfTableStylePtr m_oCurTableStyle = boost::static_pointer_cast< RtfTableStyle, RtfStyle >( m_oCurStyle );
// m_oCurTableStyle->m_oCharProp = oReader.m_oState->m_oCharProp;
// m_oCurTableStyle->m_oParProp = oReader.m_oState->m_oParagraphProp;
// if( PROP_DEF == m_oCurTableStyle->m_oParProp.m_nSpaceBetween )
......@@ -2573,7 +2573,7 @@ public:
// {
// if( oStyle->m_eType == RtfStyle::stTable )
// {//определяем какой это conditionalFormating
// RtfTableStylePtr oStyleTable = boost::shared_static_cast<RtfTableStyle, RtfStyle>(oStyle);
// RtfTableStylePtr oStyleTable = boost::static_pointer_cast<RtfTableStyle, RtfStyle>(oStyle);
// if( 1 == m_oCurTableStyle->m_oParProp.m_bStyleFirstRow )
// oStyleTable->m_oFirstRow = m_oCurTableStyle;
// else if( 1 == m_oCurTableStyle->m_oParProp.m_bStyleLastRow )
......
......@@ -324,7 +324,7 @@ bool OOXRunReader::Parse( ReaderParameter oParam , RtfParagraph& oOutputParagrap
//применяем внешний стиль
if( NULL != poStyle && TYPE_RTF_PROPERTY_STYLE_CHAR == poStyle->GetType() )
{
RtfCharStylePtr oCharStyle = boost::shared_static_cast<RtfCharStyle, RtfStyle>( poStyle );
RtfCharStylePtr oCharStyle = boost::static_pointer_cast<RtfCharStyle, RtfStyle>( poStyle );
oNewProperty.Merge( oCharStyle->m_oCharProp );
}
......@@ -770,7 +770,7 @@ bool OOXpPrReader::Parse( ReaderParameter oParam ,RtfParagraphProperty& oOutputP
if( oCurStyle->GetType() == TYPE_RTF_PROPERTY_STYLE_PARAGRAPH )
{
RtfStylePtr oResultStyle = oParam.oRtf->m_oStyleTable.GetStyleResulting( oCurStyle );
RtfParagraphStylePtr oParagraphStyle = boost::shared_static_cast<RtfParagraphStyle, RtfStyle>( oResultStyle );
RtfParagraphStylePtr oParagraphStyle = boost::static_pointer_cast<RtfParagraphStyle, RtfStyle>( oResultStyle );
oOutputProperty.Merge( oParagraphStyle->m_oParProp );
oOutputProperty.m_oCharProperty.Merge( oParagraphStyle->m_oCharProp );
oOutputProperty.m_nStyle = oCurStyle->m_nID;
......@@ -1076,7 +1076,7 @@ bool OOXrPrReader::Parse( ReaderParameter oParam ,RtfCharProperty& oOutputProper
if( oCurStyle->GetType() == TYPE_RTF_PROPERTY_STYLE_CHAR )
{
oCurStyle = oParam.oRtf->m_oStyleTable.GetStyleResulting( oCurStyle );
RtfCharStylePtr oCharStyle = boost::shared_static_cast<RtfCharStyle, RtfStyle>( oCurStyle );
RtfCharStylePtr oCharStyle = boost::static_pointer_cast<RtfCharStyle, RtfStyle>( oCurStyle );
oOutputProperty.m_nCharStyle = oCharStyle->m_nID;
oOutputProperty.Merge( oCharStyle->m_oCharProp );
}
......
......@@ -96,7 +96,7 @@ public:
{
if (m_vmlGroup == NULL) return false;
//RtfShapePtr oBaseShape = boost::shared_static_cast<RtfShape, RtfShapeGroup>( oOutput );
//RtfShapePtr oBaseShape = boost::static_pointer_cast<RtfShape, RtfShapeGroup>( oOutput );
//
//OOXShapeReader oShapeReader(m_vmlGroup);
//oShapeReader.Parse( oParam, oBaseShape );
......
......@@ -25,7 +25,7 @@ bool OOXTableReader::Parse( ReaderParameter oParam, RtfTable& oOutputTable )
RtfStylePtr oResultStyle = oParam.oRtf->m_oStyleTable.GetStyleResulting( oTempStyle );
if( RtfStyle::stTable == oResultStyle->m_eType )
{
poTableStyle = boost::shared_static_cast<RtfTableStyle, RtfStyle>( oResultStyle );
poTableStyle = boost::static_pointer_cast<RtfTableStyle, RtfStyle>( oResultStyle );
poTableStyle->m_oTableProp = oOutputTable.m_oProperty; //TableProperty ставим как уже прочитали чтобы не терять порядок применения свойст
//например индент последовательно затирает друг друга в стилях, numbering, просто в свойствах
}
......@@ -88,7 +88,7 @@ void OOXTableReader::ApplyParagraphProperty( RtfTable& oOutputTable )
oCurCell->GetItem(pCurTextItem, k);
if( NULL != pCurTextItem && pCurTextItem->GetType() == TYPE_RTF_PARAGRAPH )
{
boost::shared_ptr<RtfParagraph> oCurParagraph = boost::shared_static_cast<RtfParagraph,ITextItem>( pCurTextItem );
boost::shared_ptr<RtfParagraph> oCurParagraph = boost::static_pointer_cast<RtfParagraph,ITextItem>( pCurTextItem );
oCurParagraph->m_oProperty.m_oFrame.ApplyParagraphProp( oOutputTable.m_oProperty );
}
}
......
......@@ -41,7 +41,7 @@ public:
if( true == oParam.oRtf->m_oStyleTable.GetStyle(sStyle, oStyle) )
{
RtfStylePtr oResultStyle = oParam.oRtf->m_oStyleTable.GetStyleResulting( oStyle );
RtfTableStylePtr oTableStyle = boost::shared_static_cast<RtfTableStyle, RtfStyle>( oResultStyle );
RtfTableStylePtr oTableStyle = boost::static_pointer_cast<RtfTableStyle, RtfStyle>( oResultStyle );
oOutputProperty = oTableStyle->m_oTableProp;
oOutputProperty.m_nStyle = oTableStyle->m_nID;
}
......
......@@ -52,8 +52,8 @@ public:
{
if( m_aArray.size() > 0 && TYPE_RTF_CHAR == m_aArray[ m_aArray.size() - 1 ]->GetType() )//соединяем два текста с одинаковыми свойствами
{
RtfCharPtr oCurChar = boost::shared_static_cast<RtfChar,IDocumentElement>( piRend );
RtfCharPtr oPrevChar = boost::shared_static_cast<RtfChar,IDocumentElement>( m_aArray[ m_aArray.size() - 1 ] );
RtfCharPtr oCurChar = boost::static_pointer_cast<RtfChar,IDocumentElement>( piRend );
RtfCharPtr oPrevChar = boost::static_pointer_cast<RtfChar,IDocumentElement>( m_aArray[ m_aArray.size() - 1 ] );
if( oCurChar->m_oProperty == oPrevChar->m_oProperty )
{
oPrevChar->AddText( oCurChar->GetText() );
......
......@@ -2865,17 +2865,17 @@ void RtfCharStyle::Merge( RtfStylePtr oStyle )
RtfStyle::Merge( oStyle );
if( TYPE_RTF_PROPERTY_STYLE_CHAR == oStyle->GetType() )
{
RtfCharStylePtr oCharStyle = boost::shared_static_cast<RtfCharStyle, RtfStyle>( oStyle );
RtfCharStylePtr oCharStyle = boost::static_pointer_cast<RtfCharStyle, RtfStyle>( oStyle );
m_oCharProp.Merge( oCharStyle->m_oCharProp );
}
else if( TYPE_RTF_PROPERTY_STYLE_PARAGRAPH == oStyle->GetType() )
{
RtfParagraphStylePtr oParagraphStyle = boost::shared_static_cast<RtfParagraphStyle, RtfStyle>( oStyle );
RtfParagraphStylePtr oParagraphStyle = boost::static_pointer_cast<RtfParagraphStyle, RtfStyle>( oStyle );
m_oCharProp.Merge( oParagraphStyle->m_oCharProp );
}
else if( TYPE_RTF_PROPERTY_STYLE_TABLE == oStyle->GetType() )
{
RtfTableStylePtr oTableStyle = boost::shared_static_cast<RtfTableStyle, RtfStyle>( oStyle );
RtfTableStylePtr oTableStyle = boost::static_pointer_cast<RtfTableStyle, RtfStyle>( oStyle );
m_oCharProp.Merge( oTableStyle->m_oCharProp );
}
}
......@@ -2885,18 +2885,18 @@ void RtfParagraphStyle::Merge( RtfStylePtr oStyle )
RtfStyle::Merge( oStyle );
if( TYPE_RTF_PROPERTY_STYLE_CHAR == oStyle->GetType() )
{
RtfCharStylePtr oCharStyle = boost::shared_static_cast<RtfCharStyle, RtfStyle>( oStyle );
RtfCharStylePtr oCharStyle = boost::static_pointer_cast<RtfCharStyle, RtfStyle>( oStyle );
m_oCharProp.Merge( oCharStyle->m_oCharProp );
}
else if( TYPE_RTF_PROPERTY_STYLE_PARAGRAPH == oStyle->GetType() )
{
RtfParagraphStylePtr oParagraphStyle = boost::shared_static_cast<RtfParagraphStyle, RtfStyle>( oStyle );
RtfParagraphStylePtr oParagraphStyle = boost::static_pointer_cast<RtfParagraphStyle, RtfStyle>( oStyle );
m_oParProp.Merge( oParagraphStyle->m_oParProp );
m_oCharProp.Merge( oParagraphStyle->m_oCharProp );
}
else if( TYPE_RTF_PROPERTY_STYLE_TABLE == oStyle->GetType() )
{
RtfTableStylePtr oTableStyle = boost::shared_static_cast<RtfTableStyle, RtfStyle>( oStyle );
RtfTableStylePtr oTableStyle = boost::static_pointer_cast<RtfTableStyle, RtfStyle>( oStyle );
m_oParProp.Merge( oTableStyle->m_oParProp );
m_oCharProp.Merge( oTableStyle->m_oCharProp );
}
......@@ -2906,18 +2906,18 @@ void RtfTableStyle::Merge( RtfStylePtr oStyle )
RtfStyle::Merge( oStyle );
if( TYPE_RTF_PROPERTY_STYLE_CHAR == oStyle->GetType() )
{
RtfCharStylePtr oCharStyle = boost::shared_static_cast<RtfCharStyle, RtfStyle>( oStyle );
RtfCharStylePtr oCharStyle = boost::static_pointer_cast<RtfCharStyle, RtfStyle>( oStyle );
m_oCharProp.Merge( oCharStyle->m_oCharProp );
}
else if( TYPE_RTF_PROPERTY_STYLE_PARAGRAPH == oStyle->GetType() )
{
RtfParagraphStylePtr oParagraphStyle = boost::shared_static_cast<RtfParagraphStyle, RtfStyle>( oStyle );
RtfParagraphStylePtr oParagraphStyle = boost::static_pointer_cast<RtfParagraphStyle, RtfStyle>( oStyle );
m_oParProp.Merge( oParagraphStyle->m_oParProp );
m_oCharProp.Merge( oParagraphStyle->m_oCharProp );
}
if( TYPE_RTF_PROPERTY_STYLE_TABLE == oStyle->GetType() )
{
RtfTableStylePtr oTableStyle = boost::shared_static_cast<RtfTableStyle, RtfStyle>( oStyle );
RtfTableStylePtr oTableStyle = boost::static_pointer_cast<RtfTableStyle, RtfStyle>( oStyle );
m_oTableProp.Merge( oTableStyle->m_oTableProp );
m_oRowProp.Merge( oTableStyle->m_oRowProp );
m_oCellProp.Merge( oTableStyle->m_oCellProp );
......
......@@ -666,7 +666,7 @@ CString RtfShape::RenderToOOX(RenderParameter oRenderParameter)
aTempTextItems->GetItem( piCurTextItem, i );
if( NULL != piCurTextItem && TYPE_RTF_PARAGRAPH == piCurTextItem->GetType() )
{
RtfParagraphPtr poCurParagraph = boost::shared_static_cast< RtfParagraph, ITextItem >( piCurTextItem );
RtfParagraphPtr poCurParagraph = boost::static_pointer_cast< RtfParagraph, ITextItem >( piCurTextItem );
if( NULL != poCurParagraph )
{
bool bBreak = false;
......@@ -681,7 +681,7 @@ CString RtfShape::RenderToOOX(RenderParameter oRenderParameter)
oNewParam.nType = RENDER_TO_OOX_PARAM_OLE_ONLY;
oNewParam.nValue = m_nID;
RtfOlePtr poCurOle = boost::shared_static_cast< RtfOle, IDocumentElement >( piCurIDocumentElement );
RtfOlePtr poCurOle = boost::static_pointer_cast< RtfOle, IDocumentElement >( piCurIDocumentElement );
if( NULL != poCurOle )
{
sOle.Append( poCurOle->RenderToOOX( oNewParam ) );
......
......@@ -880,7 +880,4 @@ unix {
INSTALLS += target
}
DISTFILES += \
../../../cximage/libpsd/ChangeLog \
../../../cximage/libpsd/COPYING \
../../../cximage/libpsd/CUSTOMIZE
DISTFILES +=
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