mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-04-07 13:55:33 +08:00
XlsFormat - wordart (пока как текст в текстбоксе)
git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@67695 954022d7-b5bf-4e40-9824-e11837661b57
This commit is contained in:
committed by
Alexander Trofimov
parent
75984f1ffb
commit
3d525eef17
@ -66,25 +66,31 @@ OfficeArtFOPTEPtr OfficeArtFOPTE::load_and_create(XLS::CFRecord& record)
|
||||
case 0x007F:
|
||||
fopte = OfficeArtFOPTEPtr(new ProtectionBooleanProperties);
|
||||
break;
|
||||
/*todo*/case 0x0080://lTxid
|
||||
case 0x0081://dxTextLeft
|
||||
case 0x0082://dyTextTop
|
||||
case 0x0083://dxTextRight
|
||||
case 0x0084://dyTextBottom
|
||||
case 0x0085://WrapText
|
||||
case 0x0086://unused134
|
||||
case 0x0087://anchorText
|
||||
case 0x0088://txflTextFlow
|
||||
case 0x0089://cdirFont
|
||||
case 0x008a://hspNext
|
||||
case 0x008b://txdir
|
||||
case 0x008c://unused140
|
||||
case 0x008d://unused141
|
||||
case NSOfficeDrawing::lTxid:
|
||||
case NSOfficeDrawing::dxTextLeft:
|
||||
case NSOfficeDrawing::dyTextTop:
|
||||
case NSOfficeDrawing::dxTextRight:
|
||||
case NSOfficeDrawing::dyTextBottom:
|
||||
case NSOfficeDrawing::WrapText:
|
||||
case NSOfficeDrawing::anchorText:
|
||||
case NSOfficeDrawing::txflTextFlow:
|
||||
case NSOfficeDrawing::cdirFont:
|
||||
case NSOfficeDrawing::hspNext:
|
||||
case NSOfficeDrawing::txdir:
|
||||
case NSOfficeDrawing::gtextRTF:
|
||||
case NSOfficeDrawing::gtextAlign:
|
||||
case NSOfficeDrawing::gtextSize:
|
||||
case NSOfficeDrawing::gtextSpacing:
|
||||
case NSOfficeDrawing::gtextFont:
|
||||
case NSOfficeDrawing::gtextCSSFont:
|
||||
fopte = OfficeArtFOPTEPtr(new OfficeArtFOPTE);
|
||||
break;
|
||||
case 0x00BF:
|
||||
case NSOfficeDrawing::fFitTextToShape:
|
||||
fopte = OfficeArtFOPTEPtr(new TextBooleanProperties);
|
||||
break;
|
||||
case NSOfficeDrawing::gtextUNICODE:
|
||||
fopte = OfficeArtFOPTEPtr(new anyString);
|
||||
break;
|
||||
case 0x0100:
|
||||
fopte = OfficeArtFOPTEPtr(new cropFromTop);
|
||||
break;
|
||||
@ -402,6 +408,16 @@ void anyString::ReadComplexData(XLS::CFRecord& record)
|
||||
#else
|
||||
string_ = XLS::convertUtf16ToWString(record.getCurData<UTF16>(), op);
|
||||
#endif
|
||||
if (!string_.empty())
|
||||
{
|
||||
int i, length = min(op, string_.length());
|
||||
|
||||
for (i = 0; i < length; i++)
|
||||
{
|
||||
if (string_.at(i) < 14 ) break;
|
||||
}
|
||||
string_ = string_.substr(0, i);
|
||||
}
|
||||
record.skipNunBytes(op);
|
||||
}
|
||||
|
||||
|
||||
@ -9,6 +9,8 @@
|
||||
#include "MSO_enums.h"
|
||||
#include <Logic/Biff_structures/HyperlinkObject.h>
|
||||
|
||||
#include "../../../ascofficepptxfile/editor/drawing/shapes/baseshape/pptshape/enums.h"
|
||||
|
||||
namespace XLS
|
||||
{
|
||||
class CFRecord;
|
||||
|
||||
@ -814,7 +814,7 @@ void XlsConverter::convert_fill_style(std::vector<ODRAW::OfficeArtFOPTEPtr> & pr
|
||||
ODRAW::FillStyleBooleanProperties * fill = (ODRAW::FillStyleBooleanProperties *)(props[i].get());
|
||||
if (fill)
|
||||
{
|
||||
if (fill->fFilled == false)
|
||||
if (fill->fUsefFilled && fill->fFilled == false)
|
||||
xlsx_context->get_drawing_context().set_fill_type(0);
|
||||
}
|
||||
}break;
|
||||
@ -1000,10 +1000,101 @@ void XlsConverter::convert_geometry_text(std::vector<ODRAW::OfficeArtFOPTEPtr> &
|
||||
{
|
||||
for (int i = 0 ; i < props.size() ; i++)
|
||||
{
|
||||
switch(props[i]->opid)
|
||||
{
|
||||
case NSOfficeDrawing::gtextUNICODE://word art text
|
||||
{
|
||||
ODRAW::anyString *str = dynamic_cast<ODRAW::anyString*>(props[i].get());
|
||||
xlsx_context->get_drawing_context().set_wordart_text(str->string_);
|
||||
}break;
|
||||
case NSOfficeDrawing::gtextFont:
|
||||
{
|
||||
ODRAW::anyString *str = dynamic_cast<ODRAW::anyString*>(props[i].get());
|
||||
//xlsx_context->get_drawing_context().set_text_font(str->string_);
|
||||
}break;
|
||||
case NSOfficeDrawing::gtextSize:
|
||||
//xlsx_context->get_drawing_context().set_text_font_size((INT)((props[i]->op >> 16) & 0x0000FFFF));
|
||||
break;
|
||||
case NSOfficeDrawing::gtextAlign:
|
||||
{
|
||||
//switch (props[i]->op)
|
||||
//{
|
||||
//case NSOfficeDrawing::alignTextLeft:
|
||||
// pParentShape->m_oText.m_oAttributes.m_nTextAlignHorizontal = 0; break;
|
||||
//case NSOfficeDrawing::alignTextCenter:
|
||||
// pParentShape->m_oText.m_oAttributes.m_nTextAlignHorizontal = 1; break;
|
||||
//case NSOfficeDrawing::alignTextRight:
|
||||
// pParentShape->m_oText.m_oAttributes.m_nTextAlignHorizontal = 2; break;
|
||||
//default:
|
||||
// pParentShape->m_oText.m_oAttributes.m_nTextAlignHorizontal = 1;
|
||||
//}
|
||||
}break;
|
||||
}
|
||||
}
|
||||
}
|
||||
void XlsConverter::convert_text(std::vector<ODRAW::OfficeArtFOPTEPtr> & props)
|
||||
{
|
||||
for (int i = 0 ; i < props.size() ; i++)
|
||||
{
|
||||
switch(props[i]->opid)
|
||||
{
|
||||
case NSOfficeDrawing::lTxid:
|
||||
|
||||
break;
|
||||
case NSOfficeDrawing::dxTextLeft:
|
||||
//pParentShape->m_dTextMarginX = (double)pProperty->m_lValue / EMU_MM; break;
|
||||
case NSOfficeDrawing::dxTextRight:
|
||||
//pParentShape->m_dTextMarginRight = (double)pProperty->m_lValue / EMU_MM; break;
|
||||
case NSOfficeDrawing::dyTextTop:
|
||||
//pParentShape->m_dTextMarginY = (double)pProperty->m_lValue / EMU_MM; break;
|
||||
case NSOfficeDrawing::dyTextBottom:
|
||||
//pParentShape->m_dTextMarginBottom = (double)pProperty->m_lValue / EMU_MM; break;
|
||||
case NSOfficeDrawing::WrapText:
|
||||
{
|
||||
int lWrapMode = props[i]->op;
|
||||
}break;
|
||||
case NSOfficeDrawing::anchorText:
|
||||
{
|
||||
//switch (props[i]->op)
|
||||
//{
|
||||
//case NSOfficeDrawing::anchorTop:
|
||||
//case NSOfficeDrawing::anchorTopBaseline:
|
||||
// pParentShape->m_oText.m_oAttributes.m_nTextAlignVertical = 0; break;
|
||||
//case NSOfficeDrawing::anchorMiddle:
|
||||
// pParentShape->m_oText.m_oAttributes.m_nTextAlignVertical = 1; break;
|
||||
//
|
||||
//case NSOfficeDrawing::anchorBottom:
|
||||
//case NSOfficeDrawing::anchorBottomBaseline:
|
||||
// {
|
||||
// pParentShape->m_oText.m_oAttributes.m_nTextAlignHorizontal = 0;
|
||||
// pParentShape->m_oText.m_oAttributes.m_nTextAlignVertical = 2;
|
||||
// }break;
|
||||
//case NSOfficeDrawing::anchorTopCentered:
|
||||
//case NSOfficeDrawing::anchorTopCenteredBaseline:
|
||||
// {
|
||||
// pParentShape->m_oText.m_oAttributes.m_nTextAlignHorizontal = 1;
|
||||
// pParentShape->m_oText.m_oAttributes.m_nTextAlignVertical = 0;
|
||||
// }break;
|
||||
//case NSOfficeDrawing::anchorMiddleCentered:
|
||||
// {
|
||||
// pParentShape->m_oText.m_oAttributes.m_nTextAlignHorizontal = 1;
|
||||
// pParentShape->m_oText.m_oAttributes.m_nTextAlignVertical = 1;
|
||||
// }break;
|
||||
//case NSOfficeDrawing::anchorBottomCentered:
|
||||
//case NSOfficeDrawing::anchorBottomCenteredBaseline:
|
||||
// {
|
||||
// pParentShape->m_oText.m_oAttributes.m_nTextAlignHorizontal = 1;
|
||||
// pParentShape->m_oText.m_oAttributes.m_nTextAlignVertical = 2;
|
||||
// }break;
|
||||
//default:
|
||||
// {
|
||||
// pParentShape->m_oText.m_oAttributes.m_nTextAlignHorizontal = 1;
|
||||
// pParentShape->m_oText.m_oAttributes.m_nTextAlignVertical = -1; // not set
|
||||
// }break;
|
||||
//}
|
||||
}break;
|
||||
}
|
||||
}
|
||||
}
|
||||
void XlsConverter::convert_shadow(std::vector<ODRAW::OfficeArtFOPTEPtr> & props)
|
||||
{
|
||||
|
||||
@ -1124,12 +1124,12 @@ void xlsx_drawing_context::set_fill_color (int index, int type, bool background)
|
||||
}
|
||||
else
|
||||
{
|
||||
// color.index = index;
|
||||
// color.sRGB = L"";
|
||||
// color.bScheme = true;
|
||||
color.nRGB = shemeDefaultColor[index];
|
||||
if (index < 64)
|
||||
{
|
||||
color.nRGB = shemeDefaultColor[index];
|
||||
color.sRGB = STR::toRGB(color.nRGB);
|
||||
}
|
||||
color.index = -1;
|
||||
color.sRGB = STR::toRGB(color.nRGB);
|
||||
}
|
||||
|
||||
if (background) current_drawing_states->back()->fill.color2 = color;
|
||||
@ -1243,6 +1243,28 @@ void xlsx_drawing_context::set_path (const std::wstring & path)
|
||||
current_drawing_states->back()->path = path;
|
||||
}
|
||||
|
||||
void xlsx_drawing_context::set_wordart_text(const std::wstring & text)
|
||||
{
|
||||
if (current_drawing_states == NULL) return;
|
||||
std::wstringstream strm;
|
||||
|
||||
CP_XML_WRITER(strm)
|
||||
{
|
||||
CP_XML_NODE(L"a:r")
|
||||
{
|
||||
//Fmt = run->formatRun.ifnt;
|
||||
//serialize_rPr(CP_XML_STREAM(), Fmt );
|
||||
|
||||
CP_XML_NODE(L"a:t")
|
||||
{
|
||||
CP_XML_STREAM() << xml::utils::replace_text_to_xml(text);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
set_text(strm.str());
|
||||
}
|
||||
|
||||
void xlsx_drawing_context::set_text (const std::wstring & text)
|
||||
{
|
||||
if (current_drawing_states == NULL) return;
|
||||
|
||||
@ -238,6 +238,7 @@ public:
|
||||
void set_path (const std::wstring & path);
|
||||
|
||||
void set_text (const std::wstring & text);
|
||||
void set_wordart_text(const std::wstring & text);
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
void serialize_shape (_drawing_state_ptr & drawing_state);
|
||||
|
||||
Reference in New Issue
Block a user