Compare commits

...

4 Commits

Author SHA1 Message Date
f467912988 Merge remote-tracking branch 'origin/hotfix/v5.2.4' into develop 2018-11-16 15:53:13 +03:00
292781e6fb DocFormat - fix after testing
x2t version up - 2.4.556
2018-11-16 15:50:05 +03:00
9cd97d48b8 MetaFile - fix bugs #39745, #39747 2018-11-16 14:10:37 +03:00
579b441edc . 2018-11-16 12:05:22 +03:00
6 changed files with 86 additions and 51 deletions

View File

@ -1071,7 +1071,9 @@ namespace DocFileFormat
int cpPic = searchNextTextMark(m_document->Text, cpFieldStart, TextMark::Picture);
int cpFieldEnd = searchNextTextMark( m_document->Text, cpFieldStart, TextMark::FieldEndMark );
if (cpFieldStart < cpPic && cpPic < cpFieldEnd)
bool bStartField = _fieldLevels.empty() ? false : (_fieldLevels.back().bBegin && !_fieldLevels.back().bSeparate);
if (cpFieldStart < cpPic && cpPic < cpFieldEnd && !bStartField)
{
writeField(text, cpFieldStart, cpFieldEnd);
text.clear();

View File

@ -31,6 +31,7 @@
*/
#include "MainDocumentMapping.h"
#include "OfficeDrawing/FillStyleBooleanProperties.h"
namespace DocFileFormat
{
@ -83,16 +84,27 @@ namespace DocFileFormat
if ((m_document->GetOfficeArt()) && (m_document->GetOfficeArt()->GetShapeBackgound()))
{
bool bFilled = true;
m_document->DocProperties->bDisplayBackgroundShape = true;
ShapeContainer* pShape = m_document->GetOfficeArt()->GetShapeBackgound();
m_pXmlWriter->WriteNodeBegin ( L"w:background", TRUE);
m_pXmlWriter->WriteAttribute ( L"w:color", L"FFFFFF");
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
VMLShapeMapping oVmlWriter (m_context, m_pXmlWriter, NULL, NULL, _caller);
pShape->Convert(&oVmlWriter);
m_pXmlWriter->WriteNodeEnd (L"w:background");
OptionEntryPtr boolFill = pShape->ExtractOption(fillStyleBooleanProperties);
FillStyleBooleanProperties booleans(boolFill ? boolFill->op : 0);
if (booleans.fUsefFilled && !booleans.fFilled)
{
bFilled = false;
}
if (bFilled)
{
m_pXmlWriter->WriteNodeBegin ( L"w:background", TRUE);
m_pXmlWriter->WriteAttribute ( L"w:color", L"FFFFFF");
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
VMLShapeMapping oVmlWriter (m_context, m_pXmlWriter, NULL, NULL, _caller);
pShape->Convert(&oVmlWriter);
m_pXmlWriter->WriteNodeEnd (L"w:background");
}
}
m_pXmlWriter->WriteNodeBegin( L"w:body", FALSE );

View File

@ -101,6 +101,24 @@ namespace DocFileFormat
return new ShapeContainer( _reader, bodySize, typeCode, version, instance );
}
OptionEntryPtr ExtractOption(const PropertyId & prop) const
{
OptionEntryPtr ret;
for ( size_t i = 0; i < this->Children.size(); ++i )
{
ShapeOptions* opt = dynamic_cast<ShapeOptions*>( this->Children[i] );
if ( opt == NULL ) continue;
std::map<PropertyId, OptionEntryPtr>::iterator pFind = opt->OptionsByID.find(prop);
if (pFind != opt->OptionsByID.end())
{
ret = pFind->second;
}
}
return ret;
}
std::vector<OptionEntryPtr> ExtractOptions() const
{
std::vector<OptionEntryPtr> ret;

View File

@ -262,7 +262,7 @@ std::wstring COfficeFileFormatChecker::getDocumentID (const std::wstring & _file
}
else
{
if ( false == isOpenOfficeFormatFile(fileName, sDocumentID))
if ( false == isOpenOfficeFormatFile(fileName, documentID))
{
NSFile::CFileBinary file;
if (!file.OpenFile(fileName))
@ -275,12 +275,13 @@ std::wstring COfficeFileFormatChecker::getDocumentID (const std::wstring & _file
file.ReadFile(buffer, MIN_SIZE_BUFFER, dwReadBytes);
file.CloseFile();
if (isPdfFormatFile(buffer, (int)dwReadBytes, sDocumentID) )
if (isPdfFormatFile(buffer, (int)dwReadBytes, documentID) )
{
nFileType = AVS_OFFICESTUDIO_FILE_CROSSPLATFORM_PDF;
}
}
}
sDocumentID = documentID;
return documentID;
}

View File

@ -1 +1 @@
2.4.555.0
2.4.556.0

View File

@ -177,47 +177,49 @@ namespace MetaFile
{
return m_lType;
}
void CMetaFile::GetBounds(double* pdX, double* pdY, double* pdW, double* pdH)
{
if (c_lMetaWmf == m_lType)
{
const TRectD& oRect = m_oWmfFile.GetBounds();
*pdX = oRect.dLeft;
*pdY = oRect.dTop;
*pdW = oRect.dRight - oRect.dLeft;
*pdH = oRect.dBottom - oRect.dTop;
}
else if (c_lMetaEmf == m_lType)
{
TEmfRectL* pRect = m_oEmfFile.GetBounds();
*pdX = pRect->lLeft;
*pdY = pRect->lTop;
*pdW = pRect->lRight - pRect->lLeft;
*pdH = pRect->lBottom - pRect->lTop;
}
else if (c_lMetaSvm == m_lType)
{
TRect* pRect = m_oSvmFile.GetBounds();
*pdX = pRect->nLeft;
*pdY = pRect->nTop;
*pdW = pRect->nRight - pRect->nLeft;
*pdH = pRect->nBottom - pRect->nTop;
void CMetaFile::GetBounds(double* pdX, double* pdY, double* pdW, double* pdH)
{
if (c_lMetaWmf == m_lType)
{
const TRectD& oRect = m_oWmfFile.GetBounds();
*pdX = oRect.dLeft;
*pdY = oRect.dTop;
*pdW = oRect.dRight - oRect.dLeft;
*pdH = oRect.dBottom - oRect.dTop;
}
else if (c_lMetaEmf == m_lType)
{
TEmfRectL* pRect = m_oEmfFile.GetBounds();
*pdX = pRect->lLeft;
*pdY = pRect->lTop;
*pdW = pRect->lRight - pRect->lLeft;
*pdH = pRect->lBottom - pRect->lTop;
}
else if (c_lMetaSvm == m_lType)
{
TRect* pRect = m_oSvmFile.GetBounds();
*pdX = pRect->nLeft;
*pdY = pRect->nTop;
*pdW = pRect->nRight - pRect->nLeft;
*pdH = pRect->nBottom - pRect->nTop;
if (*pdW > 10000 || *pdH > 10000)
{
*pdW /= 10;
*pdH /= 10;
}
}
else
{
*pdX = 0;
*pdY = 0;
*pdW = 0;
*pdH = 0;
}
};
void CMetaFile::ConvertToRaster(const wchar_t* wsOutFilePath, unsigned int unFileType, int nWidth, int nHeight)
if (*pdW > 10000 || *pdH > 10000)
{
*pdW /= 10;
*pdH /= 10;
}
}
else
{
*pdX = 0;
*pdY = 0;
*pdW = 0;
*pdH = 0;
}
if (*pdW < 0) *pdW = -*pdW;
if (*pdH < 0) *pdH = -*pdH;
};
void CMetaFile::ConvertToRaster(const wchar_t* wsOutFilePath, unsigned int unFileType, int nWidth, int nHeight)
{
CFontManager *pFontManager = (CFontManager*)m_pAppFonts->GenerateFontManager();
CFontsCache* pFontCache = new CFontsCache();