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

DocFormat fix реализации embed, верт текст в text_box (word art)

PPTFormat release version 

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@65822 954022d7-b5bf-4e40-9824-e11837661b57
parent 8c52d88d
......@@ -504,60 +504,25 @@ namespace DocFileFormat
}
else if (( search(f.begin(), f.end(), mergeformat.begin(), mergeformat.end()) != f.end()) ||
(( search(f.begin(), f.end(), excel.begin(), excel.end()) != f.end() ||
search(f.begin(), f.end(), equation.begin(), equation.end()) != f.end() ||
search(f.begin(), f.end(), word.begin(), word.end()) != f.end())
&&
search(f.begin(), f.end(), embed.begin(), embed.end()) != f.end()))
( search(f.begin(), f.end(), embed.begin(), embed.end()) != f.end() ||
search( f.begin(), f.end(), link.begin(), link.end() ) != f.end()) ))
{
int cpPic = searchNextTextMark(m_document->Text, cpFieldStart, TextMark::Picture);
int cpFieldSep = searchNextTextMark(m_document->Text, cpFieldStart, TextMark::FieldSeparator);
if (cpPic < cpFieldEnd)
{
int fcPic = m_document->m_PieceTable->FileCharacterPositions->operator []( cpPic );
list<CharacterPropertyExceptions*>* chpxs = m_document->GetCharacterPropertyExceptions(fcPic, fcPic + 1);
CharacterPropertyExceptions* chpxPic = chpxs->front();
//PictureDescriptor pic(chpxPic, m_document->DataStream, cpFieldEnd - cpPic );
RevisionData oData = RevisionData(chpxPic);
/// <w:rPr>
CharacterPropertiesMapping* rPr = new CharacterPropertiesMapping(m_pXmlWriter, m_document, &oData, _lastValidPapx, false);
if(rPr)
{
chpxPic->Convert(rPr);
RELEASEOBJECT(rPr);
}
m_pXmlWriter->WriteNodeBegin (_T( "w:object" ), TRUE);
//append the origin attributes
m_pXmlWriter->WriteAttribute( _T( "w:dxaOrig" ), FormatUtils::IntToWideString( 0 ).c_str() );
m_pXmlWriter->WriteAttribute( _T( "w:dyaOrig" ), FormatUtils::IntToWideString( 0 ).c_str() );
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE );
m_pXmlWriter->WriteNodeBegin( _T( "w:fldChar" ), TRUE );
m_pXmlWriter->WriteAttribute( _T( "w:fldCharType" ), _T( "begin" ) );
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE );
VMLPictureMapping oVmlMapper (m_context, m_pXmlWriter, true, _caller);
//pic.Convert(&oVmlMapper);
RELEASEOBJECT(chpxs);
int cpPic = searchNextTextMark( m_document->Text, cpFieldStart, TextMark::Picture );
if ( cpFieldSep < cpFieldEnd )
{
int fcFieldSep = m_document->m_PieceTable->FileCharacterPositions->operator []( cpFieldSep );
list<CharacterPropertyExceptions*>* chpxs = m_document->GetCharacterPropertyExceptions( fcFieldSep, ( fcFieldSep + 1 ) );
CharacterPropertyExceptions* chpxSep = chpxs->front();
OleObject ole ( chpxSep, m_document->GetStorage() );
OleObjectMapping oleObjectMapping( m_pXmlWriter, m_context, NULL, _caller, oVmlMapper.GetShapeId() );
ole.Convert( &oleObjectMapping );
RELEASEOBJECT( chpxs );
}
m_pXmlWriter->WriteNodeEnd( _T( "w:fldChar" ) );
m_pXmlWriter->WriteNodeEnd( _T( "w:object" ) );
}
this->_writeInstrText = true;
this->_skipRuns = 5;
this->_fldCharCounter++;
}
else if ((search(f.begin(), f.end(), embed.begin(), embed.end()) != f.end()) || (search( f.begin(), f.end(), link.begin(), link.end() ) != f.end()))
else if ( search(f.begin(), f.end(), embed.begin(), embed.end()) != f.end()
|| search( f.begin(), f.end(), link.begin(), link.end() ) != f.end())
{
int cpPic = searchNextTextMark(m_document->Text, cpFieldStart, TextMark::Picture);
int cpFieldSep = searchNextTextMark(m_document->Text, cpFieldStart, TextMark::FieldSeparator);
......@@ -566,8 +531,10 @@ namespace DocFileFormat
{
int fcPic = m_document->m_PieceTable->FileCharacterPositions->operator []( cpPic );
list<CharacterPropertyExceptions*>* chpxs = m_document->GetCharacterPropertyExceptions(fcPic, fcPic + 1);
CharacterPropertyExceptions* chpxPic = chpxs->front();
PictureDescriptor pic(chpxPic, m_document->DataStream, cpFieldEnd - cpPic );
PictureDescriptor pic(chpxPic, m_document->DataStream);
RevisionData oData = RevisionData(chpxPic);
......@@ -681,7 +648,7 @@ namespace DocFileFormat
}
else if ((TextMark::Picture == c) && fSpec)
{
PictureDescriptor oPicture (chpx, m_document->DataStream, 0x7fffffff);
PictureDescriptor oPicture (chpx, m_document->DataStream);
if ((oPicture.mfp.mm > 98) && (NULL != oPicture.shapeContainer))
{
......
......@@ -12,6 +12,7 @@ namespace DocFileFormat
//Get start and length of the PICT
int fc = GetFcPic( chpx );
if ( fc >= 0 )
{
parse( stream, fc, size );
......@@ -40,6 +41,9 @@ namespace DocFileFormat
int lcb = reader.ReadInt32();
if (lcb > 10000000)
return;
if (lcb > sz)
{
unsigned char* bytes = reader.ReadBytes(sz - fc - 4, false);
......
......@@ -50,7 +50,7 @@ namespace DocFileFormat
public:
/// Parses the CHPX for a fcPic an loads the PictureDescriptor at this offset
PictureDescriptor( CharacterPropertyExceptions* chpx, POLE::Stream* stream, int size );
PictureDescriptor( CharacterPropertyExceptions* chpx, POLE::Stream* stream, int size = 0x7fffffff);
virtual ~PictureDescriptor();
private:
......
......@@ -30,6 +30,11 @@ namespace DocFileFormat
namespace DocFileFormat
{
void TextboxMapping::SetTextboxStyle(const std::wstring & style)
{
m_sTextBoxStyle = style;
}
void TextboxMapping::SetInset (int nLeft, int nTop, int nRight, int nBottom)
{
m_ndxTextLeft = nLeft;
......@@ -47,11 +52,20 @@ namespace DocFileFormat
//if (m_nTBIndex < m_document->TextboxBreakPlex->Elements.size())
// return;
//TODO , inset
if(m_ndxTextLeft >= 0 && m_ndyTextTop >= 0 && m_ndxTextRight >= 0 && m_ndyTextBottom >= 0)
m_pXmlWriter->WriteNodeBegin( (_T("v:textbox inset=\"")+FormatUtils::IntToWideString(m_ndxTextLeft)+_T(",")+FormatUtils::IntToWideString(m_ndyTextTop)+_T(",")+FormatUtils::IntToWideString(m_ndxTextRight)+_T(",")+FormatUtils::IntToWideString(m_ndyTextBottom)+_T("\"")).c_str() );
else
m_pXmlWriter->WriteNodeBegin( _T( "v:textbox" ) );
m_pXmlWriter->WriteNodeBegin(_T("v:textbox"), true);
if(m_ndxTextLeft >= 0 && m_ndyTextTop >= 0 && m_ndxTextRight >= 0 && m_ndyTextBottom >= 0)
{
m_pXmlWriter->WriteAttribute( _T( "inset" ), std_string2string(
FormatUtils::IntToWideString(m_ndxTextLeft) +
_T(",") + FormatUtils::IntToWideString(m_ndyTextTop) +
_T(",") + FormatUtils::IntToWideString(m_ndxTextRight) +
_T(",") + FormatUtils::IntToWideString(m_ndyTextBottom)));
}
if (!m_sTextBoxStyle.empty())
{
m_pXmlWriter->WriteAttribute( _T( "style" ), std_string2string(m_sTextBoxStyle));
}
m_pXmlWriter->WriteNodeEnd( _T( "" ), true, false );
m_pXmlWriter->WriteNodeBegin( _T( "w:txbxContent" ) );
......
......@@ -11,19 +11,24 @@ namespace DocFileFormat
TextboxMapping(ConversionContext* ctx, int textboxIndex, XmlUtils::CXmlWriter* writer, IMapping* caller);
TextboxMapping(ConversionContext* ctx, XmlUtils::CXmlWriter* writer, IMapping* caller);
virtual ~TextboxMapping();
virtual void Apply(IVisitable* visited);
void SetInset(int nLeft, int nTop, int nRight, int nBottom);
void SetInset (int nLeft, int nTop, int nRight, int nBottom);
void SetTextboxStyle(const std::wstring & style);
private:
static int TextboxCount;
int m_nTBIndex;
int m_nTBIndex;
int m_ndxTextLeft;
int m_ndyTextTop;
int m_ndxTextRight;
int m_ndyTextBottom;
int m_ndxTextLeft;
int m_ndyTextTop;
int m_ndxTextRight;
int m_ndyTextBottom;
std::wstring m_sTextBoxStyle;
};
}
\ No newline at end of file
......@@ -227,13 +227,17 @@ namespace DocFileFormat
bool filled = true;
bool hasTextbox = false;
bool layoutInCell = false;
int ndxTextLeft = -1;
int ndyTextTop = -1;
int ndxTextRight = -1;
int ndyTextBottom = -1;
bool bHavePath = false;
int nAdjValues = 0;
int nLTxID = -1;
std::wstring sTextboxStyle;
std::wstring adjValues[8];
ShadowStyleBooleanProperties shadowBoolean(0);
......@@ -694,7 +698,23 @@ namespace DocFileFormat
case dyTextTop: {ndyTextTop = (int)iter->op;break;}
case dxTextRight: {ndxTextRight = (int)iter->op;break;}
case dyTextBottom: {ndyTextBottom = (int)iter->op;break;}
case txflTextFlow:
{
switch(iter->op)
{
case 0:
case 4://
break;
case 1:
case 5:// ( )
appendStyleProperty(&sTextboxStyle, L"layout-flow", L"vertical");
break;
case 2:// ( )
appendStyleProperty(&sTextboxStyle, L"layout-flow", L"vertical");
appendStyleProperty(&sTextboxStyle, L"mso-layout-flow-alt", L"bottom-to-top");
break;
}
}break;
// TEXT PATH (Word Art)
case gtextUNICODE:
......@@ -997,6 +1017,8 @@ namespace DocFileFormat
{
TextboxMapping textboxMapping(m_ctx, nIndex - 1, m_pXmlWriter, m_pCaller);
textboxMapping.SetInset(ndxTextLeft, ndyTextTop, ndxTextRight, ndyTextBottom);
textboxMapping.SetTextboxStyle(sTextboxStyle);
m_ctx->_doc->Convert(&textboxMapping);
}
}
......
......@@ -81,15 +81,16 @@ namespace DocFileFormat
std::vector<CString> GetTextRectangles(const OptionEntry& inscribe) const;
private:
bool m_bBullet;
Spa* m_pSpa;
IMapping* m_pCaller;
BlipStoreContainer* m_pBlipStore;
int m_nImageId;
std::wstring m_textPathStyle;
ConversionContext* m_ctx;
PictureDescriptor* m_pict;
XMLTools::XMLElement<wchar_t> m_fill;
bool m_bBullet;
Spa* m_pSpa;
IMapping* m_pCaller;
BlipStoreContainer* m_pBlipStore;
int m_nImageId;
std::wstring m_textPathStyle;
ConversionContext* m_ctx;
PictureDescriptor* m_pict;
XMLTools::XMLElement<wchar_t> m_fill;
XMLTools::XMLElement<wchar_t> m_stroke;
XMLTools::XMLElement<wchar_t> m_shadow;
XMLTools::XMLElement<wchar_t> m_imagedata;
......
......@@ -903,7 +903,7 @@ void NSPresentationEditor::CShapeWriter::WriteTextInfo()
set = true;
}
if (!set && pParagraph->m_lTextLevel == 0)
if (!set)
{
wchar_t bu = 0x2022;
m_oWriter.WriteString(std::wstring(L"<a:buChar char=\""));
......
......@@ -84,16 +84,10 @@ void CRecordOfficeArtBlip::ReadFromStream(SRecordHeader & oHeader, POLE::Stream*
lOffset += 34;
oMetaFile.m_bIsValid = TRUE;
oMetaFile.m_sExtension = L".pct";
oMetaFile.m_sExtension = L".wmf";//L".pct"; - pct(pic) !!!
CMetaHeader oMetaHeader;
oMetaHeader.FromStream(pStream);
//int lLenHeader = 512;
//BYTE* pMetaHeader = new BYTE[lLenHeader]; // oMetaFile
//
//oMetaHeader.ToPICTHeader(pMetaHeader, lLenHeader);
//oMetaFile.SetHeader(pMetaHeader, lLenHeader);
oMetaHeader.FromStream(pStream); // .. ""
BYTE* pData = new BYTE[oHeader.RecLen - lOffset];
pStream->read(pData, oHeader.RecLen - lOffset);
......
......@@ -1262,7 +1262,7 @@ public:
if (NULL != pSlide)
{
bool bIsMaster = oArrayShape[0]->m_bHaveMaster;
if (bIsMaster)
if (bIsMaster && elType !=etPicture)
{
for (int i = 0; i < oArrayOptions[0]->m_oProperties.m_lCount; ++i)
{
......@@ -2110,7 +2110,7 @@ protected:
}
else
{
pTextSettings->m_lStyleThemeIndex = 0; //???
pTextSettings->m_lStyleThemeIndex = -1;
}
// (persist own) - m_oStyles
......
......@@ -4,32 +4,12 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ASCOfficePPTXFile", "ASCOff
ProjectSection(ProjectDependencies) = postProject
{21663823-DE45-479B-91D0-B4FEF4916EF0} = {21663823-DE45-479B-91D0-B4FEF4916EF0}
{3F3CB5A1-BB01-49C1-9342-4A69E30F9EF6} = {3F3CB5A1-BB01-49C1-9342-4A69E30F9EF6}
{DC24710E-8DF2-4A7A-B7C3-2313E294143C} = {DC24710E-8DF2-4A7A-B7C3-2313E294143C}
{36636678-AE25-4BE6-9A34-2561D1BCF302} = {36636678-AE25-4BE6-9A34-2561D1BCF302}
{A100103A-353E-45E8-A9B8-90B87CC5C0B0} = {A100103A-353E-45E8-A9B8-90B87CC5C0B0}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PPTXFormat", "PPTXLib\PPTXFormat.vcproj", "{36636678-AE25-4BE6-9A34-2561D1BCF302}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ASCHTMLRenderer", "..\ASCHTMLRenderer\ASCHTMLRendererLib.vcproj", "{DC24710E-8DF2-4A7A-B7C3-2313E294143C}"
ProjectSection(ProjectDependencies) = postProject
{C739151F-5384-41DF-A1A6-F089E2C1AD56} = {C739151F-5384-41DF-A1A6-F089E2C1AD56}
{37CA072A-5BDE-498B-B3A7-5E404F5F9BF2} = {37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}
{764C3A2D-FB0F-428E-B1C7-62D1DD2CE239} = {764C3A2D-FB0F-428E-B1C7-62D1DD2CE239}
{DF861D33-9BC1-418C-82B1-581F590FE169} = {DF861D33-9BC1-418C-82B1-581F590FE169}
{617F9069-5E37-4B80-9A3A-E77AFC4CC7AD} = {617F9069-5E37-4B80-9A3A-E77AFC4CC7AD}
{BC52A07C-A797-423D-8C4F-8678805BBB36} = {BC52A07C-A797-423D-8C4F-8678805BBB36}
{FFDA5DA1-BB65-4695-B678-BE59B4A1355D} = {FFDA5DA1-BB65-4695-B678-BE59B4A1355D}
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B} = {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}
{7B53D2C7-1B4A-4A53-A7D3-E25B92470B81} = {7B53D2C7-1B4A-4A53-A7D3-E25B92470B81}
{0588563C-F05C-428C-B21A-DD74756628B3} = {0588563C-F05C-428C-B21A-DD74756628B3}
{9CAA294E-58C3-4CEB-ABA0-CB9786CA5540} = {9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}
{43A0E60E-5C4A-4C09-A29B-7683F503BBD7} = {43A0E60E-5C4A-4C09-A29B-7683F503BBD7}
{40A69F40-063E-43FD-8543-455495D8733E} = {40A69F40-063E-43FD-8543-455495D8733E}
{9A037A69-D1DF-4505-AB2A-6CB3641C476E} = {9A037A69-D1DF-4505-AB2A-6CB3641C476E}
{818753F2-DBB9-4D3B-898A-A604309BE470} = {818753F2-DBB9-4D3B-898A-A604309BE470}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "agg2d", "..\DesktopEditor\agg-2.4\agg_vs2005.vcproj", "{617F9069-5E37-4B80-9A3A-E77AFC4CC7AD}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cximage", "..\DesktopEditor\cximage\CxImage\cximage_vs2005.vcproj", "{BC52A07C-A797-423D-8C4F-8678805BBB36}"
......@@ -150,36 +130,6 @@ Global
{36636678-AE25-4BE6-9A34-2561D1BCF302}.Unicode Release|Win32.ActiveCfg = Release|Win32
{36636678-AE25-4BE6-9A34-2561D1BCF302}.Unicode Release|Win32.Build.0 = Release|Win32
{36636678-AE25-4BE6-9A34-2561D1BCF302}.Unicode Release|x64.ActiveCfg = Release|Win32
{DC24710E-8DF2-4A7A-B7C3-2313E294143C}.Debug Multithreaded|Win32.ActiveCfg = Debug|Win32
{DC24710E-8DF2-4A7A-B7C3-2313E294143C}.Debug Multithreaded|Win32.Build.0 = Debug|Win32
{DC24710E-8DF2-4A7A-B7C3-2313E294143C}.Debug Multithreaded|x64.ActiveCfg = Debug|Win32
{DC24710E-8DF2-4A7A-B7C3-2313E294143C}.Debug Singlethreaded|Win32.ActiveCfg = Debug|Win32
{DC24710E-8DF2-4A7A-B7C3-2313E294143C}.Debug Singlethreaded|Win32.Build.0 = Debug|Win32
{DC24710E-8DF2-4A7A-B7C3-2313E294143C}.Debug Singlethreaded|x64.ActiveCfg = Debug|Win32
{DC24710E-8DF2-4A7A-B7C3-2313E294143C}.Debug|Win32.ActiveCfg = Debug|Win32
{DC24710E-8DF2-4A7A-B7C3-2313E294143C}.Debug|Win32.Build.0 = Debug|Win32
{DC24710E-8DF2-4A7A-B7C3-2313E294143C}.Debug|x64.ActiveCfg = Debug|Win32
{DC24710E-8DF2-4A7A-B7C3-2313E294143C}.Release Multithreaded|Win32.ActiveCfg = Release|Win32
{DC24710E-8DF2-4A7A-B7C3-2313E294143C}.Release Multithreaded|Win32.Build.0 = Release|Win32
{DC24710E-8DF2-4A7A-B7C3-2313E294143C}.Release Multithreaded|x64.ActiveCfg = Release|Win32
{DC24710E-8DF2-4A7A-B7C3-2313E294143C}.Release Singlethreaded|Win32.ActiveCfg = Release|Win32
{DC24710E-8DF2-4A7A-B7C3-2313E294143C}.Release Singlethreaded|Win32.Build.0 = Release|Win32
{DC24710E-8DF2-4A7A-B7C3-2313E294143C}.Release Singlethreaded|x64.ActiveCfg = Release|Win32
{DC24710E-8DF2-4A7A-B7C3-2313E294143C}.Release|Win32.ActiveCfg = Release|Win32
{DC24710E-8DF2-4A7A-B7C3-2313E294143C}.Release|Win32.Build.0 = Release|Win32
{DC24710E-8DF2-4A7A-B7C3-2313E294143C}.Release|x64.ActiveCfg = Release|Win32
{DC24710E-8DF2-4A7A-B7C3-2313E294143C}.ReleaseASC|Win32.ActiveCfg = Release|Win32
{DC24710E-8DF2-4A7A-B7C3-2313E294143C}.ReleaseASC|Win32.Build.0 = Release|Win32
{DC24710E-8DF2-4A7A-B7C3-2313E294143C}.ReleaseASC|x64.ActiveCfg = Release|Win32
{DC24710E-8DF2-4A7A-B7C3-2313E294143C}.ReleaseOpenSource|Win32.ActiveCfg = Release|Win32
{DC24710E-8DF2-4A7A-B7C3-2313E294143C}.ReleaseOpenSource|Win32.Build.0 = Release|Win32
{DC24710E-8DF2-4A7A-B7C3-2313E294143C}.ReleaseOpenSource|x64.ActiveCfg = Release|Win32
{DC24710E-8DF2-4A7A-B7C3-2313E294143C}.Unicode Debug|Win32.ActiveCfg = Debug|Win32
{DC24710E-8DF2-4A7A-B7C3-2313E294143C}.Unicode Debug|Win32.Build.0 = Debug|Win32
{DC24710E-8DF2-4A7A-B7C3-2313E294143C}.Unicode Debug|x64.ActiveCfg = Debug|Win32
{DC24710E-8DF2-4A7A-B7C3-2313E294143C}.Unicode Release|Win32.ActiveCfg = Release|Win32
{DC24710E-8DF2-4A7A-B7C3-2313E294143C}.Unicode Release|Win32.Build.0 = Release|Win32
{DC24710E-8DF2-4A7A-B7C3-2313E294143C}.Unicode Release|x64.ActiveCfg = Release|Win32
{617F9069-5E37-4B80-9A3A-E77AFC4CC7AD}.Debug Multithreaded|Win32.ActiveCfg = Debug|Win32
{617F9069-5E37-4B80-9A3A-E77AFC4CC7AD}.Debug Multithreaded|Win32.Build.0 = Debug|Win32
{617F9069-5E37-4B80-9A3A-E77AFC4CC7AD}.Debug Multithreaded|x64.ActiveCfg = Debug|Win32
......
......@@ -17,7 +17,9 @@ namespace NSPresentationEditor
LONG m_lTextMasterType; // only ppt property
public:
DWORD m_lTextType;
DWORD m_lStyleThemeIndex;
int m_lStyleThemeIndex;
int m_lPlaceholderType;
int m_lPlaceholderID;
......
#pragma once
#ifdef _WIN32
#include "../../Common/BaseThread.h"
#include "BaseThread.h"
#include <wininet.h>
#pragma comment(lib, "Wininet")
......
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