Compare commits

..

1 Commits

Author SHA1 Message Date
194cc2b0ad Create XFAScanner 2026-03-19 16:08:41 +03:00
13 changed files with 176 additions and 145 deletions

View File

@ -622,7 +622,10 @@ HEADERS += $$files($$PDF_ROOT_DIR/lib/*.h, true)
SOURCES += $$files($$PDF_ROOT_DIR/lib/*.c, true)
SOURCES += $$files($$PDF_ROOT_DIR/lib/*.cc, true)
HEADERS -= $$PDF_ROOT_DIR/lib/xpdf/XFAScanner.h
SOURCES -= \
$$PDF_ROOT_DIR/lib/xpdf/XFAScanner.cc \
$$PDF_ROOT_DIR/lib/xpdf/HTMLGen.cc \
$$PDF_ROOT_DIR/lib/xpdf/pdftohtml.cc \
$$PDF_ROOT_DIR/lib/xpdf/pdftopng.cc \
@ -640,6 +643,7 @@ SOURCES += \
$$PDF_ROOT_DIR/SrcReader/GfxClip.cpp \
$$PDF_ROOT_DIR/SrcReader/PdfAnnot.cpp \
$$PDF_ROOT_DIR/SrcReader/PdfFont.cpp \
$$PDF_ROOT_DIR/SrcReader/PdfXFAScanner.cpp \
$$PDF_ROOT_DIR/Resources/BaseFonts.cpp \
$$PDF_ROOT_DIR/Resources/CMapMemory/cmap_memory.cpp
@ -666,6 +670,7 @@ HEADERS +=\
$$PDF_ROOT_DIR/SrcReader/GfxClip.h \
$$PDF_ROOT_DIR/SrcReader/FontsWasm.h \
$$PDF_ROOT_DIR/SrcReader/PdfFont.h \
$$PDF_ROOT_DIR/SrcReader/PdfXFAScanner.h \
$$PDF_ROOT_DIR/SrcReader/PdfAnnot.h
DEFINES += CRYPTOPP_DISABLE_ASM

View File

@ -45,7 +45,10 @@ SOURCES += $$files(lib/*.c, true)
SOURCES += $$files(lib/*.cpp, true)
SOURCES += $$files(lib/*.cc, true)
HEADERS -= $$PDF_ROOT_DIR/lib/xpdf/XFAScanner.h
SOURCES -= \
lib/xpdf/XFAScanner.cc \
lib/xpdf/HTMLGen.cc \
lib/xpdf/pdftohtml.cc \
lib/xpdf/pdftopng.cc \
@ -62,6 +65,7 @@ SOURCES += \
SrcReader/Adaptors.cpp \
SrcReader/PdfAnnot.cpp \
SrcReader/PdfFont.cpp \
SrcReader/PdfXFAScanner.cpp \
SrcReader/GfxClip.cpp
HEADERS += \
@ -70,6 +74,7 @@ HEADERS += \
SrcReader/MemoryUtils.h \
SrcReader/PdfAnnot.h \
SrcReader/PdfFont.h \
SrcReader/PdfXFAScanner.h \
SrcReader/GfxClip.h
# Base fonts

View File

@ -597,9 +597,8 @@ std::wstring GetFontData(PDFDoc* pdfDoc, NSFonts::IFontManager* pFontManager, CP
}
else
{
double dStretch = 1.0;
std::wstring wsFBN = wsFontBaseName;
NSFonts::CFontInfo* pFontInfo = RendererOutputDev::GetFontByParams(xref, pFontManager, gfxFont, wsFBN, dStretch);
NSFonts::CFontInfo* pFontInfo = RendererOutputDev::GetFontByParams(xref, pFontManager, gfxFont, wsFBN);
if (pFontInfo && !pFontInfo->m_wsFontPath.empty())
{
EraseSubsetTag(wsFontBaseName);
@ -1065,7 +1064,7 @@ void CollectFontWidths(GfxFont* gfxFont, Dict* pFontDict, std::map<unsigned int,
}
oDescendantFonts.free();
}
double CheckFontStylePDF(std::wstring& sName, bool& bBold, bool& bItalic)
void CheckFontStylePDF(std::wstring& sName, bool& bBold, bool& bItalic)
{
EraseSubsetTag(sName);
@ -1073,18 +1072,16 @@ double CheckFontStylePDF(std::wstring& sName, bool& bBold, bool& bItalic)
CheckFontNameStyle(sName, L"semibold");
CheckFontNameStyle(sName, L"regular");
double dStretch = 1.0;
CheckFontNameStyle(sName, L"ultraexpanded");
CheckFontNameStyle(sName, L"extraexpanded");
CheckFontNameStyle(sName, L"semiexpanded");
CheckFontNameStyle(sName, L"expanded");
if (CheckFontNameStyle(sName, L"ultraexpanded")) dStretch = 2.0;
if (CheckFontNameStyle(sName, L"extraexpanded")) dStretch = 1.5;
if (CheckFontNameStyle(sName, L"semiexpanded")) dStretch = 1.125;
if (CheckFontNameStyle(sName, L"expanded")) dStretch = 1.25;
if (CheckFontNameStyle(sName, L"ultracondensed")) dStretch = 0.5;
if (CheckFontNameStyle(sName, L"extracondensed")) dStretch = 0.625;
if (CheckFontNameStyle(sName, L"semicondensed")) dStretch = 0.875;
if (CheckFontNameStyle(sName, L"condensedlight")) dStretch = 0.75;
if (CheckFontNameStyle(sName, L"condensed")) dStretch = 0.75;
CheckFontNameStyle(sName, L"ultracondensed");
CheckFontNameStyle(sName, L"extracondensed");
CheckFontNameStyle(sName, L"semicondensed");
CheckFontNameStyle(sName, L"condensedlight");
CheckFontNameStyle(sName, L"condensed");
//CheckFontNameStyle(sName, L"light");
if (CheckFontNameStyle(sName, L"bold_italic")) { bBold = true; bItalic = true; }
@ -1100,8 +1097,6 @@ double CheckFontStylePDF(std::wstring& sName, bool& bBold, bool& bItalic)
//if (CheckFontNameStyle(sName, L"bolditalicmt")) { bBold = true; bItalic = true; }
//if (CheckFontNameStyle(sName, L"bolditalic")) { bBold = true; bItalic = true; }
//if (CheckFontNameStyle(sName, L"boldoblique")) { bBold = true; bItalic = true; }
return dStretch;
}
bool EraseSubsetTag(std::wstring& sFontName)
{

View File

@ -65,7 +65,7 @@ std::vector<CAnnotFontInfo> GetAnnotFontInfos(PDFDoc* pdfDoc, NSFonts::IFontMana
std::map<std::wstring, std::wstring> GetFreeTextFont(PDFDoc* pdfDoc, NSFonts::IFontManager* pFontManager, CPdfFontList* pFontList, Object* oAnnotRef, std::vector<CAnnotMarkup::CFontData*>& arrRC);
bool FindFonts(Object* oStream, int nDepth, Object* oResFonts);
void CollectFontWidths(GfxFont* gfxFont, Dict* pFontDict, std::map<unsigned int, unsigned int>& mGIDToWidth);
double CheckFontStylePDF(std::wstring& sName, bool& bBold, bool& bItalic);
void CheckFontStylePDF(std::wstring& sName, bool& bBold, bool& bItalic);
bool EraseSubsetTag(std::wstring& sFontName);
}

View File

@ -0,0 +1,79 @@
/*
* (c) Copyright Ascensio System SIA 2010-2023
*
* 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-6 Ernesta Birznieka-Upish
* 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 "../../DesktopEditor/common/File.h"
#include "PdfXFAScanner.h"
GString* XFAScanner::readXFAStreams(Object* xfaObj)
{
GString* data = new GString();
char buf[4096];
int n;
if (xfaObj->isStream())
{
xfaObj->streamReset();
while ((n = xfaObj->getStream()->getBlock(buf, sizeof(buf))) > 0)
data->append(buf, n);
}
else if (xfaObj->isArray())
{
for (int i = 1; i < xfaObj->arrayGetLength(); i += 2)
{
Object obj;
if (!xfaObj->arrayGet(i, &obj)->isStream())
{
obj.free();
delete data;
return NULL;
}
obj.streamReset();
while ((n = obj.getStream()->getBlock(buf, sizeof(buf))) > 0)
data->append(buf, n);
obj.free();
}
}
else
{
delete data;
return NULL;
}
return data;
}
void XFAScanner::load(GString* sXFA)
{
NSFile::CFileBinary oFile;
oFile.CreateFileW(NSFile::GetProcessDirectory() + L"/xfa.xml");
oFile.WriteFile(sXFA->getCString(), sXFA->getLength());
oFile.CloseFile();
}

View File

@ -0,0 +1,45 @@
/*
* (c) Copyright Ascensio System SIA 2010-2023
*
* 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-6 Ernesta Birznieka-Upish
* 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 _PDF_READER_XFA_H
#define _PDF_READER_XFA_H
#include "../lib/goo/GString.h"
#include "../lib/xpdf/Object.h"
class XFAScanner
{
public:
static GString* readXFAStreams(Object* xfaObj);
static void load(GString* sXFA);
};
#endif // _PDF_READER_XFA_H

View File

@ -77,12 +77,12 @@
namespace PdfReader
{
double CheckFontNamePDF(std::wstring& sName, NSFonts::CFontSelectFormat* format)
void CheckFontNamePDF(std::wstring& sName, NSFonts::CFontSelectFormat* format)
{
bool bBold = false;
bool bItalic = false;
double dStretch = CheckFontStylePDF(sName, bBold, bItalic);
CheckFontStylePDF(sName, bBold, bItalic);
if (format)
{
@ -91,20 +91,6 @@ namespace PdfReader
if (bItalic)
format->bItalic = new INT(1);
}
return dStretch;
}
USHORT StretchToWidthClass(double fStretch)
{
if (fStretch <= 0.50) return 1; // Ultra-condensed
if (fStretch <= 0.625) return 2; // Extra-condensed
if (fStretch <= 0.75) return 3; // Condensed
if (fStretch <= 0.875) return 4; // Semi-condensed
if (fStretch <= 1.0) return 5; // Normal
if (fStretch <= 1.125) return 6; // Semi-expanded
if (fStretch <= 1.25) return 7; // Expanded
if (fStretch <= 1.50) return 8; // Extra-expanded
return 9; // Ultra-expanded
}
void Transform(double* pMatrix, double dUserX, double dUserY, double* pdDeviceX, double* pdDeviceY)
@ -752,7 +738,7 @@ namespace PdfReader
{
}
NSFonts::CFontInfo* RendererOutputDev::GetFontByParams(XRef* pXref, NSFonts::IFontManager* pFontManager, GfxFont* pFont, std::wstring& wsFontBaseName, double& dStretch)
NSFonts::CFontInfo* RendererOutputDev::GetFontByParams(XRef* pXref, NSFonts::IFontManager* pFontManager, GfxFont* pFont, std::wstring& wsFontBaseName)
{
NSFonts::CFontInfo* pFontInfo = NULL;
if (!pFontManager)
@ -765,9 +751,7 @@ namespace PdfReader
oRefObject.free();
NSFonts::CFontSelectFormat oFontSelect;
dStretch = CheckFontNamePDF(wsFontBaseName, &oFontSelect);
if (std::abs(dStretch - 1.0f) > 1e-5f)
oFontSelect.usWidth = new USHORT(StretchToWidthClass(dStretch));
CheckFontNamePDF(wsFontBaseName, &oFontSelect);
if (oFontObject.isDict())
{
Dict* pFontDict = oFontObject.getDict();
@ -841,7 +825,7 @@ namespace PdfReader
oDictItem.free();
oFontDescriptor.dictLookup("StemV", &oDictItem);
if (oDictItem.isNum() && !oFontSelect.usWidth)
if (oDictItem.isNum())
{
double dStemV = oDictItem.getNum();
if (dStemV > 50.5)
@ -900,7 +884,6 @@ namespace PdfReader
wsFontBaseName = L"Helvetica";
const BYTE* pData14 = NULL;
unsigned int nSize14 = 0;
double dStretch = 1.0;
#ifdef FONTS_USE_ONLY_MEMORY_STREAMS
CMemoryFontStream oMemoryFontStream;
#endif
@ -1211,7 +1194,7 @@ namespace PdfReader
else if (!pFont->locateFont(pXref, false) ||
(wsFileName = NSStrings::GetStringFromUTF32(pFont->locateFont(pXref, false)->path)).length() == 0)
{
NSFonts::CFontInfo* pFontInfo = GetFontByParams(pXref, pFontManager, pFont, wsFontBaseName, dStretch);
NSFonts::CFontInfo* pFontInfo = GetFontByParams(pXref, pFontManager, pFont, wsFontBaseName);
if (pFontInfo && L"" != pFontInfo->m_wsFontPath)
{
@ -1610,7 +1593,6 @@ namespace PdfReader
pEntry->unLenGID = (unsigned int)nLen;
pEntry->unLenUnicode = (unsigned int)nToUnicodeLen;
pEntry->bAvailable = true;
pEntry->dStretch = dStretch;
pEntry->bFontSubstitution = bFontSubstitution;
pEntry->bIsIdentity = pFont->isCIDFont() == gTrue ? ((GfxCIDFont*)pFont)->usesIdentityEncoding() || ((GfxCIDFont*)pFont)->usesIdentityCIDToGID() || ((GfxCIDFont*)pFont)->ctuUsesCharCodeToUnicode() || pFont->getType() == fontCIDType0C : false;
}
@ -2511,12 +2493,6 @@ namespace PdfReader
}
}
if (oEntry.dStretch != 1.0 && oEntry.bFontSubstitution)
{
arrMatrix[0] *= oEntry.dStretch;
arrMatrix[1] *= oEntry.dStretch;
}
double dShiftX = 0, dShiftY = 0;
DoTransform(arrMatrix, &dShiftX, &dShiftY, true);

View File

@ -57,7 +57,6 @@ namespace PdfReader
bool bAvailable; // Доступен ли шрифт. Сделано для многопотоковости
bool bFontSubstitution = false;
bool bIsIdentity = false;
double dStretch = 1.0;
};
@ -245,7 +244,7 @@ namespace PdfReader
{
m_pbBreak = pbBreak;
}
static NSFonts::CFontInfo* GetFontByParams(XRef* pXref, NSFonts::IFontManager* pFontManager, GfxFont* pFont, std::wstring& wsFontBaseName, double& dStretch);
static NSFonts::CFontInfo* GetFontByParams(XRef* pXref, NSFonts::IFontManager* pFontManager, GfxFont* pFont, std::wstring& wsFontBaseName);
static void GetFont(XRef* pXref, NSFonts::IFontManager* pFontManager, CPdfFontList *pFontList, GfxFont* pFont, std::wstring& wsFileName, std::wstring& wsFontName, bool bNotFullName = true);
private:

View File

@ -27,10 +27,11 @@
#include "OptionalContent.h"
#include "Annot.h"
#include "Lexer.h"
#include "XFAScanner.h"
#include "../../SrcReader/PdfXFAScanner.h"
#include "UTF8.h"
#include "PDF417Barcode.h"
#include "AcroForm.h"
#include "GlobalParams.h"
//------------------------------------------------------------------------
@ -343,13 +344,16 @@ AcroForm *AcroForm::load(PDFDoc *docA, Catalog *catalog, Object *acroFormObjA) {
AcroFormField *field;
Object xfaObj, fieldsObj, annotsObj, annotRef, annotObj, obj1, obj2;
int pageNum, i, j;
GString* sXFA = NULL;
// this is the normal case: acroFormObj is a dictionary, as expected
if (acroFormObjA->isDict()) {
acroForm = new AcroForm(docA, acroFormObjA);
if (!acroFormObjA->dictLookup("XFA", &xfaObj)->isNull()) {
acroForm->xfaScanner = XFAScanner::load(&xfaObj);
if (!acroFormObjA->dictLookup("XFA", &xfaObj)->isNull()) {
sXFA = XFAScanner::readXFAStreams(&xfaObj);
XFAScanner::load(sXFA);
acroForm->xfaScanner = NULL;
if (!catalog->getNeedsRendering()) {
acroForm->isStaticXFA = gTrue;
}
@ -719,7 +723,7 @@ AcroFormField *AcroFormField::load(AcroForm *acroFormA, Object *fieldRefA) {
i0 = i1;
}
}
xfaFieldA = acroFormA->xfaScanner->findField(xfaName);
xfaFieldA = NULL; // acroFormA->xfaScanner->findField(xfaName);
delete xfaName;
}
@ -743,9 +747,10 @@ AcroFormField *AcroFormField::load(AcroForm *acroFormA, Object *fieldRefA) {
typeA = acroFormFieldCheckbox;
}
} else if (!typeStr->cmp("Tx")) {
if (xfaFieldA && xfaFieldA->getBarcodeInfo()) {
typeA = acroFormFieldBarcode;
} else if (flagsA & acroFormFlagFileSelect) {
// if (xfaFieldA && xfaFieldA->getBarcodeInfo()) {
// typeA = acroFormFieldBarcode;
// } else
if (flagsA & acroFormFlagFileSelect) {
typeA = acroFormFieldFileSelect;
} else if (flagsA & acroFormFlagMultiline) {
typeA = acroFormFieldMultilineText;
@ -860,9 +865,9 @@ Unicode *AcroFormField::getValue(int *length) {
// from the XFA field (NB: an XFA field with no value overrides the
// AcroForm value)
if (xfaField) {
if (xfaField->getValue()) {
u = utf8ToUnicode(xfaField->getValue(), length);
}
// if (xfaField->getValue()) {
// u = utf8ToUnicode(xfaField->getValue(), length);
// }
// no XFA form - take the AcroForm value
} else {
@ -1220,8 +1225,8 @@ void AcroFormField::drawAnnot(int pageNum, Gfx *gfx, GBool printing,
render = gFalse;
if (acroForm->needAppearances) {
render = gTrue;
} else if (xfaField && xfaField->getValue()) {
render = gTrue;
// } else if (xfaField && xfaField->getValue()) {
// render = gTrue;
} else {
if (!annotObj->dictLookup("AP", &obj1)->isDict()) {
render = gTrue;
@ -1620,6 +1625,7 @@ void AcroFormField::drawNewAppearance(Gfx *gfx, Dict *annot,
if (caption) {
delete caption;
}
/*
} else if (ftObj.isName("Tx")) {
XFAFieldBarcodeInfo *barcodeInfo = xfaField ? xfaField->getBarcodeInfo()
: (XFAFieldBarcodeInfo *)NULL;
@ -1816,6 +1822,7 @@ void AcroFormField::drawNewAppearance(Gfx *gfx, Dict *annot,
}
obj1.free();
}
*/
} else if (ftObj.isName("Sig")) {
//~ check to see if background is already drawn
gfxStateDict.initDict(acroForm->doc->getXRef());
@ -2801,6 +2808,7 @@ void AcroFormField::drawBarcode(GString *value, GString *da,
double xMax, double yMax,
XFAFieldBarcodeInfo *barcodeInfo,
GString *appearBuf) {
/*
//--- handle rotation
double w, h;
appearBuf->append("q\n");
@ -2990,6 +2998,7 @@ void AcroFormField::drawBarcode(GString *value, GString *da,
err:
delete value2;
*/
}
GList *AcroFormField::tokenize(GString *s) {

View File

@ -3105,14 +3105,6 @@ void RtfShapeReader::ShapePropertyReader::ShapePropertyValueReader::PopState( Rt
else if (L"borderLeftColor" == m_sPropName) m_oShape.m_nBorderLeftColor = nValue;
else if (L"borderBottomColor" == m_sPropName) m_oShape.m_nBorderBottomColor = nValue;
else if (L"borderRightColor" == m_sPropName) m_oShape.m_nBorderRightColor= nValue;
else if (L"fHorizRule" == m_sPropName) m_oShape.m_bHr = (nValue == 1);
else if (L"fStandardHR" == m_sPropName) m_oShape.m_bHrStd = (nValue == 1);
else if (L"alignHR" == m_sPropName) m_oShape.m_nHrAlign = nValue; // 0-left,1-center,2-right
else if (L"dxHeightHR" == m_sPropName) m_oShape.m_oPicture->m_nHeight = nValue;
else if (L"dxWidthHR" == m_sPropName) m_oShape.m_oPicture->m_nWidth = nValue;
else if (L"pctHR" == m_sPropName) m_oShape.m_nHrPct = nValue;
else if (L"fNoShadeHR" == m_sPropName) m_oShape.m_bHrNoShade = (nValue == 1);
else if ( L"cxstyle" == m_sPropName ) m_oShape.m_nConnectorStyle = nValue;
else if ( L"cxk" == m_sPropName ) m_oShape.m_nConnectionType = nValue;

View File

@ -240,10 +240,6 @@ void RtfShape::SetDefault()
DEFAULT_PROPERTY( m_nLineEndArrowLength )
DEFAULT_PROPERTY( m_nLineWidth )
DEFAULT_PROPERTY( m_nLineDashing )
DEFAULT_PROPERTY( m_nHrAlign )
DEFAULT_PROPERTY( m_nHrPct )
DEFAULT_PROPERTY( m_nHrHeight )
DEFAULT_PROPERTY( m_nHrWeight )
DEFAULT_PROPERTY( m_nGtextSize )
DEFAULT_PROPERTY( m_bGtext )
@ -262,9 +258,6 @@ void RtfShape::SetDefault()
m_bInGroup = false;
m_bIsGroup = false;
m_bIsOle = false;
m_bHr = false;
m_bHrNoShade = false;
m_bHrStd = false;
m_oCharProperty.SetDefault();
}
@ -351,30 +344,13 @@ std::wstring RtfShape::RenderToRtf(RenderParameter oRenderParameter)
sResult += L"}";
}
}
else if (m_bHr)
{
sResult+=L"{\\pict";
sResult+=L"{\\*\\picprop";
RENDER_RTF_INT( m_nID, sResult, L"shplid" );
if (m_nBottom != PROP_DEF)
{
sResult += L"{\\sp{\\sn dxHeightHR}{\\sv " + std::to_wstring(m_nBottom) + L"}}";
}
if (m_nRight != PROP_DEF)
{
sResult += L"{\\sp{\\sn dxWidthHR}{\\sv " + std::to_wstring(m_nRight) + L"}}";
}
sResult += RenderToRtfShapeProperty( oRenderParameter );
sResult += L"}";
sResult += L"}";
}
else
{
if (m_bBackground)
sResult += L"{\\*\\background";
sResult += L"{\\shp";
sResult += L"{\\*\\shpinst";
sResult += L"{\\shp";
sResult += L"{\\*\\shpinst";
if (!m_bInGroup)
{
@ -716,12 +692,6 @@ std::wstring RtfShape::RenderToRtfShapeProperty(RenderParameter oRenderParameter
RENDER_RTF_SHAPE_PROP(L"lineEndArrowLength", sResult, m_nLineEndArrowLength );
RENDER_RTF_SHAPE_PROP(L"lineWidth", sResult, m_nLineWidth );
RENDER_RTF_SHAPE_PROP(L"lineDashing", sResult, m_nLineDashing );
RENDER_RTF_SHAPE_PROP(L"alignHR", sResult, m_nHrAlign);
if (m_bHr)
sResult += L"{\\sp{\\sn fHorizRule}{\\sv 1}}";
if (m_bHrStd)
sResult += L"{\\sp{\\sn fStandardHR}{\\sv 1}}";
//pWrapPolygonVertices Points of the text wrap polygon.
if ( !m_aWrapPoints.empty())
@ -1286,29 +1256,6 @@ std::wstring RtfShape::RenderToOOXBegin(RenderParameter oRenderParameter)
else
{
}
if (m_bHr)
{
sShapeStart += L" o:hr=\"t\"";
if (m_bHrStd)
sShapeStart += L" o:hrstd=\"t\"";
if (m_nHrAlign != PROP_DEF)
{
switch (m_nHrAlign)
{
case 0: sShapeStart += L" o:hralign=\"left\""; break;
case 1: sShapeStart += L" o:hralign=\"center\""; break;
case 2: sShapeStart += L" o:hralign=\"right\""; break;
}
}
if (m_bHrNoShade)
sShapeStart += L" o:hrnoshade=\"t\"";
if (m_nHrPct != PROP_DEF && m_nHrPct > 0)
sShapeStart += L" o:hrpct=\"" + std::to_wstring(m_nHrPct) + L"\"";
}
if (oRenderParameter.nType != RENDER_TO_OOX_PARAM_SHAPE_CHILD)
{

View File

@ -211,13 +211,6 @@ public:
int m_nLineEndArrowLength; //lineEndArrowLength End arrow length (for acceptable values see meaning for lineStartArrowLength).
int m_nLineWidth; //lineWidth Width of the line.
int m_nLineDashing;
bool m_bHr;
bool m_bHrStd;
int m_nHrAlign;
bool m_bHrNoShade;
int m_nHrPct;
int m_nHrHeight;
int m_nHrWeight;
//WordArt
std::wstring m_sGtextUNICODE;

View File

@ -1828,20 +1828,6 @@ bool OOXShapeReader::ParseVml(ReaderParameter oParam, RtfShapePtr& pOutput, bool
default: break;
}
}
if (m_vmlElement->m_oHr.IsInit())
pOutput->m_bHr = m_vmlElement->m_oHr.get();
if (m_vmlElement->m_oHrStd.IsInit())
pOutput->m_bHrStd = m_vmlElement->m_oHrStd.get();
if (m_vmlElement->m_oHrAlign.IsInit())
{
SimpleTypes::EHrAlign eVal = m_vmlElement->m_oHrAlign->GetValue();
switch (eVal)
{
case SimpleTypes::hralignLeft: pOutput->m_nHrAlign = 0; break;
case SimpleTypes::hralignCenter: pOutput->m_nHrAlign = 1; break;
case SimpleTypes::hralignRight: pOutput->m_nHrAlign = 2; break;
}
}
bool res = ParseVmlChild(oParam, pOutput);