Commit 635a5d23 authored by ElenaSubbotina's avatar ElenaSubbotina

DocFormatReader - background page

parent 6fa18eb2
...@@ -43,7 +43,8 @@ namespace DocFileFormat ...@@ -43,7 +43,8 @@ namespace DocFileFormat
/*========================================================================================================*/ /*========================================================================================================*/
WordDocumentProperties::WordDocumentProperties(FileInformationBlock* fib, POLE::Stream* tableStream) : doptypography(NULL), dogrid(NULL), asumyi(NULL) WordDocumentProperties::WordDocumentProperties(FileInformationBlock* fib, POLE::Stream* tableStream) :
doptypography(NULL), dogrid(NULL), asumyi(NULL), bDisplayBackgroundShape(false)
{ {
Initialize(); Initialize();
...@@ -226,7 +227,7 @@ namespace DocFileFormat ...@@ -226,7 +227,7 @@ namespace DocFileFormat
dywDispPag = FormatUtils::BytesToInt16( bytes, 498, size ); dywDispPag = FormatUtils::BytesToInt16( bytes, 498, size );
//WORD 2000, 2002, 2003 PART //WORD 2000, 2002, 2003 PART
if ( size > 500 ) if ( size > 500/* && fib->m_FibNew.nFibNew > Fib1997*/)
{ {
ilvlLastBulletMain = bytes[500]; ilvlLastBulletMain = bytes[500];
ilvlLastNumberMain = bytes[501]; ilvlLastNumberMain = bytes[501];
...@@ -266,138 +267,158 @@ namespace DocFileFormat ...@@ -266,138 +267,158 @@ namespace DocFileFormat
fDntULTrlSpc = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 14 ); fDntULTrlSpc = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 14 );
fDntBlnSbDbWid = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 15 ); fDntBlnSbDbWid = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 15 );
fSuppressTopSpacingMac5 = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 16 ); fSuppressTopSpacingMac5 = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 16 );
fTruncDxaExpand = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 17 ); fTruncDxaExpand = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 17 );
fPrintBodyBeforeHdr = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 18 ); fPrintBodyBeforeHdr = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 18 );
fNoLeading = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 19 ); fNoLeading = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 19 );
fMakeSpaceForUL = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 20 ); fMakeSpaceForUL = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 20 );
fMWSmallCaps = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 21 ); fMWSmallCaps = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 21 );
f2ptExtLeadingOnly = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 22 ); f2ptExtLeadingOnly = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 22 );
fTruncFontHeight = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 23 ); fTruncFontHeight = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 23 );
fSubOnSize = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 24 ); fSubOnSize = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 24 );
fLineWrapLikeWord6 = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 25 ); fLineWrapLikeWord6 = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 25 );
fWW6BorderRules = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 26 ); fWW6BorderRules = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 26 );
fExactOnTop = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 27 ); fExactOnTop = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 27 );
fExtraAfter = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 28 ); fExtraAfter = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 28 );
fWPSpace = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 29 ); fWPSpace = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 29 );
fWPJust = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 30 ); fWPJust = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 30 );
fPrintMet = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 31 ); fPrintMet = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 31 );
//split bytes 512,513,514,515 into bits //split bytes 512,513,514,515 into bits
fSpLayoutLikeWW8 = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 0 ); fSpLayoutLikeWW8 = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 0 );
fFtnLayoutLikeWW8 = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 1 ); fFtnLayoutLikeWW8 = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 1 );
fDontUseHTMLParagraphAutoSpacing = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 2 ); fDontUseHTMLParagraphAutoSpacing = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 2 );
fDontAdjustLineHeightInTable = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 3 ); fDontAdjustLineHeightInTable = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 3 );
fForgetLastTabAlign = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 4 ); fForgetLastTabAlign = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 4 );
fUseAutoSpaceForFullWidthAlpha = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 5 ); fUseAutoSpaceForFullWidthAlpha = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 5 );
fAlignTablesRowByRow = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 6 ); fAlignTablesRowByRow = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 6 );
fLayoutRawTableWidth = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 7 ); fLayoutRawTableWidth = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 7 );
fLayoutTableRowsApart = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 8 ); fLayoutTableRowsApart = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 8 );
fUserWord97LineBreakingRules = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 9 ); fUserWord97LineBreakingRules = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 9 );
fDontBreakWrappedTables = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 10 ); fDontBreakWrappedTables = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 10 );
fDontSnapToGridInCell = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 11 ); fDontSnapToGridInCell = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 11 );
fDontAllowFieldEndSelect = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 12 ); fDontAllowFieldEndSelect = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 12 );
fApplyBreakingRules = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 13 ); fApplyBreakingRules = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 13 );
fDontWrapTextWithPunct = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 14 ); fDontWrapTextWithPunct = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 14 );
fDontUseAsianBreakRules = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 15 ); fDontUseAsianBreakRules = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 15 );
fUseWord2002TableStyleRules = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 16 ); fUseWord2002TableStyleRules = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 16 );
fGrowAutofit = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 17 ); fGrowAutofit = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 17 );
fUseNormalStyleForList = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 18 ); fUseNormalStyleForList = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 18 );
fDontUseIndentAsNumberingTabStop = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 19 ); fDontUseIndentAsNumberingTabStop = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 19 );
fFELineBreak11 = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 20 ); fFELineBreak11 = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 20 );
fAllowSpaceOfSameStyleInTable = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 21 ); fAllowSpaceOfSameStyleInTable = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 21 );
fWW11IndentRules = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 22 ); fWW11IndentRules = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 22 );
fDontAutofitConstrainedTables = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 23 ); fDontAutofitConstrainedTables = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 23 );
fAutofitLikeWW11 = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 24 ); fAutofitLikeWW11 = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 24 );
fUnderlineTabInNumList = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 25 ); fUnderlineTabInNumList = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 25 );
fHangulWidthLikeWW11 = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 26 ); fHangulWidthLikeWW11 = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 26 );
fSplitPgBreakAndParaMark = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 27 ); fSplitPgBreakAndParaMark = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 27 );
fDontVertAlignCellWithSp = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 28 ); fDontVertAlignCellWithSp = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 28 );
fDontBreakConstrainedForcedTables = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 29 ); fDontBreakConstrainedForcedTables = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 29 );
fDontVertAlignInTxbx = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 30 ); fDontVertAlignInTxbx = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 30 );
fWord11KerningPairs = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 31 ); fWord11KerningPairs = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 31 );
fCachedColBalance = FormatUtils::GetBitFromBytes( ( bytes + 516 ), 4, 0 );
fCachedColBalance = FormatUtils::GetBitFromBytes( ( bytes + 516 ), 4, 0 );
//bytes 517-539 are unused //bytes 517-539 are unused
verCompatPreW10 = (unsigned short)FormatUtils::GetUIntFromBytesBits( ( bytes + 540 ), 4, 0, 16 ); verCompatPreW10 = (unsigned short)FormatUtils::GetUIntFromBytesBits( ( bytes + 540 ), 4, 0, 16 );
fNoMargPgvwSaved = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 16 ); fNoMargPgvwSaved = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 16 );
fNoMargPgvWPag = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 17 ); fNoMargPgvWPag = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 17 );
fWebViewPag = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 18 ); fWebViewPag = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 18 );
fSeeDrawingsPag = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 19 ); fSeeDrawingsPag = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 19 );
fBulletProofed = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 20 ); fBulletProofed = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 20 );
fCorrupted = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 21 ); fCorrupted = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 21 );
fSaveUim = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 22 ); fSaveUim = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 22 );
fFilterPrivacy = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 23 ); fFilterPrivacy = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 23 );
fInFReplaceNoRM = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 24 ); fInFReplaceNoRM = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 24 );
fSeenRepairs = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 25 ); fSeenRepairs = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 25 );
fHasXML = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 26 ); fHasXML = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 26 );
fSeeScriptAnchorsPag = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 27 ); fSeeScriptAnchorsPag = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 27 );
fValidateXML = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 28 ); fValidateXML = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 28 );
fSaveIfInvalidXML = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 29 ); fSaveIfInvalidXML = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 29 );
fShowXMLErrors = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 30 ); fShowXMLErrors = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 30 );
fAlwaysMergeEmptyNamespace = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 31 ); fAlwaysMergeEmptyNamespace = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 31 );
cpMaxListCacheMainDoc = FormatUtils::BytesToInt32( bytes, 544, size ); if ( size > 544/* && fib->m_FibNew.nFibNew > Fib2000*/)
{
//split bytes 548,549 into bits cpMaxListCacheMainDoc = FormatUtils::BytesToInt32( bytes, 544, size ); //unused
fDoNotEmbedSystemFont = FormatUtils::GetBitFromBytes( ( bytes + 548 ), 2, 0 );
fWordCompact = FormatUtils::GetBitFromBytes( ( bytes + 548 ), 2, 1 ); //split bytes 548,549 into bits
fLiveRecover = FormatUtils::GetBitFromBytes( ( bytes + 548 ), 2, 2 ); fDoNotEmbedSystemFont = FormatUtils::GetBitFromBytes( ( bytes + 548 ), 2, 0 );
fEmbedFactoids = FormatUtils::GetBitFromBytes( ( bytes + 548 ), 2, 3 ); fWordCompact = FormatUtils::GetBitFromBytes( ( bytes + 548 ), 2, 1 );
fFactoidXML = FormatUtils::GetBitFromBytes( ( bytes + 548 ), 2, 4 ); fLiveRecover = FormatUtils::GetBitFromBytes( ( bytes + 548 ), 2, 2 );
fFactoidAllDone = FormatUtils::GetBitFromBytes( ( bytes + 548 ), 2, 5 ); fEmbedFactoids = FormatUtils::GetBitFromBytes( ( bytes + 548 ), 2, 3 );
fFolioPrint = FormatUtils::GetBitFromBytes( ( bytes + 548 ), 2, 6 ); fFactoidXML = FormatUtils::GetBitFromBytes( ( bytes + 548 ), 2, 4 );
fReverseFolio = FormatUtils::GetBitFromBytes( ( bytes + 548 ), 2, 7 ); fFactoidAllDone = FormatUtils::GetBitFromBytes( ( bytes + 548 ), 2, 5 );
iTextLineEnding = (short)FormatUtils::GetUIntFromBytesBits( ( bytes + 548 ), 2, 8, 3 ); fFolioPrint = FormatUtils::GetBitFromBytes( ( bytes + 548 ), 2, 6 );
fHideFcc = FormatUtils::GetBitFromBytes( ( bytes + 548 ), 2, 11 ); fReverseFolio = FormatUtils::GetBitFromBytes( ( bytes + 548 ), 2, 7 );
fAcetateShowMarkup = FormatUtils::GetBitFromBytes( ( bytes + 548 ), 2, 12 ); iTextLineEnding = (short)FormatUtils::GetUIntFromBytesBits( ( bytes + 548 ), 2, 8, 3 );
fAcetateShowAtn = FormatUtils::GetBitFromBytes( ( bytes + 548 ), 2, 13 ); fHideFcc = FormatUtils::GetBitFromBytes( ( bytes + 548 ), 2, 11 );
fAcetateShowInsDel = FormatUtils::GetBitFromBytes( ( bytes + 548 ), 2, 14 ); fAcetateShowMarkup = FormatUtils::GetBitFromBytes( ( bytes + 548 ), 2, 12 );
fAcetateShowProps = FormatUtils::GetBitFromBytes( ( bytes + 548 ), 2, 15 ); fAcetateShowAtn = FormatUtils::GetBitFromBytes( ( bytes + 548 ), 2, 13 );
fAcetateShowInsDel = FormatUtils::GetBitFromBytes( ( bytes + 548 ), 2, 14 );
istdTableDflt = FormatUtils::BytesToUInt16( bytes, 550, size ); fAcetateShowProps = FormatUtils::GetBitFromBytes( ( bytes + 548 ), 2, 15 );
verCompat = FormatUtils::BytesToUInt16( bytes, 552, size );
grfFmtFilter = FormatUtils::BytesToUInt16( bytes, 554, size ); istdTableDflt = FormatUtils::BytesToUInt16( bytes, 550, size );
iFolioPages = FormatUtils::BytesToInt16( bytes, 556, size ); verCompat = FormatUtils::BytesToUInt16( bytes, 552, size );
cpgText = FormatUtils::BytesToUInt16( bytes, 558, size ); grfFmtFilter = FormatUtils::BytesToUInt16( bytes, 554, size );
cpMinRMText = FormatUtils::BytesToInt32( bytes, 560, size ); iFolioPages = FormatUtils::BytesToInt16 ( bytes, 556, size );
cpMinRMFtn = FormatUtils::BytesToInt32( bytes, 564, size ); cpgText = FormatUtils::BytesToUInt16( bytes, 558, size );
cpMinRMHdd = FormatUtils::BytesToInt32( bytes, 568, size ); cpMinRMText = FormatUtils::BytesToInt32 ( bytes, 560, size );
cpMinRMAtn = FormatUtils::BytesToInt32( bytes, 572, size ); cpMinRMFtn = FormatUtils::BytesToInt32 ( bytes, 564, size );
cpMinRMEdn = FormatUtils::BytesToInt32( bytes, 576, size ); cpMinRMHdd = FormatUtils::BytesToInt32 ( bytes, 568, size );
cpMinRMTxbx = FormatUtils::BytesToInt32( bytes, 580, size ); cpMinRMAtn = FormatUtils::BytesToInt32 ( bytes, 572, size );
cpMinRMHdrTxbx = FormatUtils::BytesToInt32( bytes, 584, size ); cpMinRMEdn = FormatUtils::BytesToInt32 ( bytes, 576, size );
rsidRoot = FormatUtils::BytesToInt32( bytes, 588, size ); cpMinRMTxbx = FormatUtils::BytesToInt32 ( bytes, 580, size );
cpMinRMHdrTxbx = FormatUtils::BytesToInt32 ( bytes, 584, size );
if ( size == 610 ) rsidRoot = FormatUtils::BytesToInt32 ( bytes, 588, size );
{ //unused 2
//split bytes 592,593,594,595 into bits
fTreatLockAtnAsReadOnly = FormatUtils::GetBitFromBytes( ( bytes + 592 ), 4, 0 ); if ( size > 594/* && fib->m_FibNew.nFibNew > Fib2002*/)
fStyleLock = FormatUtils::GetBitFromBytes( ( bytes + 592 ), 4, 1 ); {
fAutoFmtOverride = FormatUtils::GetBitFromBytes( ( bytes + 592 ), 4, 2 ); //split bytes 592,593,594,595 into bits
fRemoveWordML = FormatUtils::GetBitFromBytes( ( bytes + 592 ), 4, 3 ); fTreatLockAtnAsReadOnly = FormatUtils::GetBitFromBytes( ( bytes + 592 ), 4, 0 );
fApplyCustomXForm = FormatUtils::GetBitFromBytes( ( bytes + 592 ), 4, 4 ); fStyleLock = FormatUtils::GetBitFromBytes( ( bytes + 592 ), 4, 1 );
fStyeLockEnforced = FormatUtils::GetBitFromBytes( ( bytes + 592 ), 4, 5 ); fAutoFmtOverride = FormatUtils::GetBitFromBytes( ( bytes + 592 ), 4, 2 );
fFakeLockAtn = FormatUtils::GetBitFromBytes( ( bytes + 592 ), 4, 6 ); fRemoveWordML = FormatUtils::GetBitFromBytes( ( bytes + 592 ), 4, 3 );
fIgnoreMixedContent = FormatUtils::GetBitFromBytes( ( bytes + 592 ), 4, 7 ); fApplyCustomXForm = FormatUtils::GetBitFromBytes( ( bytes + 592 ), 4, 4 );
fShowPlaceholderText = FormatUtils::GetBitFromBytes( ( bytes + 592 ), 4, 8 ); fStyeLockEnforced = FormatUtils::GetBitFromBytes( ( bytes + 592 ), 4, 5 );
grf = FormatUtils::GetUIntFromBytesBits( ( bytes + 592 ), 4, 9, 23 ); fFakeLockAtn = FormatUtils::GetBitFromBytes( ( bytes + 592 ), 4, 6 );
fIgnoreMixedContent = FormatUtils::GetBitFromBytes( ( bytes + 592 ), 4, 7 );
//split bytes 596 and 597 into bits fShowPlaceholderText = FormatUtils::GetBitFromBytes( ( bytes + 592 ), 4, 8 );
fReadingModeInkLockDown = FormatUtils::GetBitFromBytes( ( bytes + 596 ), 2, 0 ); grf = FormatUtils::GetUIntFromBytesBits( ( bytes + 592 ), 4, 9, 23 );
fAcetateShowInkAtn = FormatUtils::GetBitFromBytes( ( bytes + 596 ), 2, 1 );
fFilterDttm = FormatUtils::GetBitFromBytes( ( bytes + 596 ), 2, 2 ); //split bytes 596 and 597 into bits
fEnforceDocProt = FormatUtils::GetBitFromBytes( ( bytes + 596 ), 2, 3 ); fReadingModeInkLockDown = FormatUtils::GetBitFromBytes( ( bytes + 596 ), 2, 0 );
iDocProtCur = (unsigned short)FormatUtils::GetUIntFromBytesBits( ( bytes + 596 ), 2, 4, 3 ); fAcetateShowInkAtn = FormatUtils::GetBitFromBytes( ( bytes + 596 ), 2, 1 );
fDispBkSpSaved = FormatUtils::GetBitFromBytes( ( bytes + 596 ), 2, 7 ); fFilterDttm = FormatUtils::GetBitFromBytes( ( bytes + 596 ), 2, 2 );
fEnforceDocProt = FormatUtils::GetBitFromBytes( ( bytes + 596 ), 2, 3 );
dxaPageLock = FormatUtils::BytesToInt16( bytes, 598, size ); iDocProtCur = (unsigned short)FormatUtils::GetUIntFromBytesBits( ( bytes + 596 ), 2, 4, 3 );
dyaPageLock = FormatUtils::BytesToInt16( bytes, 600, size ); fDispBkSpSaved = FormatUtils::GetBitFromBytes( ( bytes + 596 ), 2, 7 );
pctFontLock = FormatUtils::BytesToInt32( bytes, 602, size );
grfitbid = bytes[606]; dxaPageLock = FormatUtils::BytesToInt16( bytes, 598, size );
//unsigned char 607 is unused dyaPageLock = FormatUtils::BytesToInt16( bytes, 600, size );
ilfoMacAtCleanup = FormatUtils::BytesToUInt16( bytes, 608, size ); pctFontLock = FormatUtils::BytesToInt32( bytes, 602, size );
} grfitbid = bytes[606];
//unsigned char 607 is unused
ilfoMacAtCleanup = FormatUtils::BytesToUInt16( bytes, 608, size );
if ( size > 616/* && fib->m_FibNew.nFibNew > Fib2003*/)
{
//4 bytes reserved
bool fRMTrackFormatting = FormatUtils::GetBitFromBytes( ( bytes + 620 ), 2, 0 );
bool fRMTrackMoves = FormatUtils::GetBitFromBytes( ( bytes + 620 ), 2, 1 );
//dopMth = 34 bytes from 624 = 658
if ( size > 674/* && fib->m_FibNew.nFibNew > Fib2007*/)
{
if ( size > 690/* && fib->m_FibNew.nFibNew > Fib2010*/)
{
}
}
}
}
}
} }
} }
} }
......
...@@ -54,6 +54,7 @@ namespace DocFileFormat ...@@ -54,6 +54,7 @@ namespace DocFileFormat
friend class SettingsMapping; friend class SettingsMapping;
bool bDisplayBackgroundShape;
private: private:
// True when facing pages should be printed // True when facing pages should be printed
bool fFacingPages; bool fFacingPages;
......
...@@ -1162,6 +1162,8 @@ namespace DocFileFormat ...@@ -1162,6 +1162,8 @@ namespace DocFileFormat
{ {
//Read the FibRgCswNew //Read the FibRgCswNew
m_FibNew.nFibNew = (FibVersion)reader.ReadUInt16(); m_FibNew.nFibNew = (FibVersion)reader.ReadUInt16();
if (m_FibNew.nFibNew == 0) m_FibNew.nFibNew = Fib1997;
m_FibNew.cQuickSavesNew = reader.ReadUInt16(); m_FibNew.cQuickSavesNew = reader.ReadUInt16();
} }
} }
......
...@@ -53,33 +53,47 @@ namespace DocFileFormat ...@@ -53,33 +53,47 @@ namespace DocFileFormat
m_context->_docx->RegisterDocument(); m_context->_docx->RegisterDocument();
// Header // Header
m_pXmlWriter->WriteNodeBegin(_T("?xml version=\"1.0\" encoding=\"UTF-8\"?")); m_pXmlWriter->WriteNodeBegin(L"?xml version=\"1.0\" encoding=\"UTF-8\"?");
m_pXmlWriter->WriteNodeBegin(_T("w:document"), TRUE ); m_pXmlWriter->WriteNodeBegin(L"w:document", TRUE );
// Namespaces // Namespaces
m_pXmlWriter->WriteAttribute(_T("xmlns:w"), OpenXmlNamespaces::WordprocessingML ); m_pXmlWriter->WriteAttribute(L"xmlns:w", OpenXmlNamespaces::WordprocessingML );
m_pXmlWriter->WriteAttribute(_T("xmlns:v"), OpenXmlNamespaces::VectorML ); m_pXmlWriter->WriteAttribute(L"xmlns:v", OpenXmlNamespaces::VectorML );
m_pXmlWriter->WriteAttribute(_T("xmlns:o"), OpenXmlNamespaces::Office ); m_pXmlWriter->WriteAttribute(L"xmlns:o", OpenXmlNamespaces::Office );
m_pXmlWriter->WriteAttribute(_T("xmlns:w10"), OpenXmlNamespaces::OfficeWord ); m_pXmlWriter->WriteAttribute(L"xmlns:w10", OpenXmlNamespaces::OfficeWord );
m_pXmlWriter->WriteAttribute(_T("xmlns:r"), OpenXmlNamespaces::Relationships ); m_pXmlWriter->WriteAttribute(L"xmlns:r", OpenXmlNamespaces::Relationships );
m_pXmlWriter->WriteAttribute(_T("xmlns:m"), _T("http://schemas.openxmlformats.org/officeDocument/2006/math")); m_pXmlWriter->WriteAttribute(L"xmlns:m", L"http://schemas.openxmlformats.org/officeDocument/2006/math");
//m_pXmlWriter->WriteAttribute(_T("xmlns:wpc"), _T("http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas")); //m_pXmlWriter->WriteAttribute(L"xmlns:wpc", L"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas");
//m_pXmlWriter->WriteAttribute(_T("xmlns:mc"), _T("http://schemas.openxmlformats.org/markup-compatibility/2006")); //m_pXmlWriter->WriteAttribute(L"xmlns:mc", L"http://schemas.openxmlformats.org/markup-compatibility/2006");
//m_pXmlWriter->WriteAttribute(_T("xmlns:wp14"),_T("http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing")); //m_pXmlWriter->WriteAttribute(L"xmlns:wp14", L"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing");
//m_pXmlWriter->WriteAttribute(_T("xmlns:wp"), _T("http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing")); //m_pXmlWriter->WriteAttribute(L"xmlns:wp", L"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing");
//m_pXmlWriter->WriteAttribute(_T("xmlns:w14"), _T("http://schemas.microsoft.com/office/word/2010/wordml")); //m_pXmlWriter->WriteAttribute(L"xmlns:w14", L"http://schemas.microsoft.com/office/word/2010/wordml");
//m_pXmlWriter->WriteAttribute(_T("xmlns:wpg"), _T("http://schemas.microsoft.com/office/word/2010/wordprocessingGroup")); //m_pXmlWriter->WriteAttribute(L"xmlns:wpg", L"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup");
//m_pXmlWriter->WriteAttribute(_T("xmlns:wpi"), _T("http://schemas.microsoft.com/office/word/2010/wordprocessingInk")); //m_pXmlWriter->WriteAttribute(L"xmlns:wpi", L"http://schemas.microsoft.com/office/word/2010/wordprocessingInk");
//m_pXmlWriter->WriteAttribute(_T("xmlns:wne"), _T("http://schemas.microsoft.com/office/word/2006/wordml")); //m_pXmlWriter->WriteAttribute(L"xmlns:wne", L"http://schemas.microsoft.com/office/word/2006/wordml");
//m_pXmlWriter->WriteAttribute(_T("xmlns:wps"), _T("http://schemas.microsoft.com/office/word/2010/wordprocessingShape")); //m_pXmlWriter->WriteAttribute(L"xmlns:wps", L"http://schemas.microsoft.com/office/word/2010/wordprocessingShape");
//m_pXmlWriter->WriteAttribute(_T("mc:Ignorable"), _T("w14 wp14")); //m_pXmlWriter->WriteAttribute(L"mc:Ignorable", L"w14 wp14");
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE ); m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
m_pXmlWriter->WriteNodeBegin( _T("w:body"), FALSE ); if ((m_document->GetOfficeArt()) && (m_document->GetOfficeArt()->GetShapeBackgound()))
{
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");
}
m_pXmlWriter->WriteNodeBegin( L"w:body", FALSE );
// Convert the document // Convert the document
_lastValidPapx = NULL; _lastValidPapx = NULL;
if (m_document->AllPapxFkps->empty() == false) if (m_document->AllPapxFkps->empty() == false)
{ {
...@@ -175,8 +189,8 @@ namespace DocFileFormat ...@@ -175,8 +189,8 @@ namespace DocFileFormat
} }
} }
m_pXmlWriter->WriteNodeEnd( _T( "w:body" ) ); m_pXmlWriter->WriteNodeEnd( L"w:body" );
m_pXmlWriter->WriteNodeEnd( _T( "w:document" ) ); m_pXmlWriter->WriteNodeEnd( L"w:document" );
m_context->_docx->DocumentXML = std::wstring(m_pXmlWriter->GetXmlString()); m_context->_docx->DocumentXML = std::wstring(m_pXmlWriter->GetXmlString());
} }
......
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
#include "OfficeDrawing/RecordFactory.h" #include "OfficeDrawing/RecordFactory.h"
#include "OfficeDrawing/DrawingContainer.h" #include "OfficeDrawing/DrawingContainer.h"
#include "OfficeDrawing/DrawingRecord.h"
#include "OfficeDrawing/DrawingGroup.h" #include "OfficeDrawing/DrawingGroup.h"
#include "OfficeDrawing/GroupContainer.h" #include "OfficeDrawing/GroupContainer.h"
#include "OfficeDrawing/Shape.h" #include "OfficeDrawing/Shape.h"
...@@ -57,7 +58,7 @@ namespace DocFileFormat ...@@ -57,7 +58,7 @@ namespace DocFileFormat
public: public:
OfficeArtContent (const FileInformationBlock* pFIB, POLE::Stream* pStream): m_pDrawingGroupData(NULL) OfficeArtContent (const FileInformationBlock* pFIB, POLE::Stream* pStream): m_pDrawingGroupData(NULL), m_pBackgroud(NULL)
{ {
VirtualStreamReader oStearmReader(pStream, 0 , pFIB->m_bOlderVersion); VirtualStreamReader oStearmReader(pStream, 0 , pFIB->m_bOlderVersion);
...@@ -87,15 +88,23 @@ namespace DocFileFormat ...@@ -87,15 +88,23 @@ namespace DocFileFormat
{ {
// the child is a subgroup // the child is a subgroup
GroupContainer* group = static_cast<GroupContainer*>(groupChild); GroupContainer* group = static_cast<GroupContainer*>(groupChild);
group->Index = i; if (group)
drawing.container->Children[i] = group; {
group->Index = i;
}
} }
else if (ShapeContainer::TYPE_CODE_0xF004 == groupChild->TypeCode) else if (ShapeContainer::TYPE_CODE_0xF004 == groupChild->TypeCode)
{ {
// the child is a shape // the child is a shape
ShapeContainer* shape = static_cast<ShapeContainer*>(groupChild); ShapeContainer* shape = static_cast<ShapeContainer*>(groupChild);
shape->Index = i; if (shape)
drawing.container->Children[i] = shape; {
shape->Index = i;
if (shape->isBackground())
{
m_pBackgroud = shape;
}
}
} }
} }
} }
...@@ -112,7 +121,10 @@ namespace DocFileFormat ...@@ -112,7 +121,10 @@ namespace DocFileFormat
for ( std::list<OfficeArtWordDrawing>::iterator iter = m_arrDrawings.begin(); iter != m_arrDrawings.end(); ++iter) for ( std::list<OfficeArtWordDrawing>::iterator iter = m_arrDrawings.begin(); iter != m_arrDrawings.end(); ++iter)
RELEASEOBJECT(iter->container); RELEASEOBJECT(iter->container);
} }
inline ShapeContainer* GetShapeBackgound()
{
return m_pBackgroud;
}
inline ShapeContainer* GetShapeContainer (int spid) inline ShapeContainer* GetShapeContainer (int spid)
{ {
ShapeContainer* ret = NULL; ShapeContainer* ret = NULL;
...@@ -138,7 +150,6 @@ namespace DocFileFormat ...@@ -138,7 +150,6 @@ namespace DocFileFormat
if (shape->GetShapeID() == spid) if (shape->GetShapeID() == spid)
{ {
ret = container; ret = container;
break; break;
} }
} }
...@@ -150,7 +161,7 @@ namespace DocFileFormat ...@@ -150,7 +161,7 @@ namespace DocFileFormat
if (shape->GetShapeID() == spid) if (shape->GetShapeID() == spid)
{ {
ret = container; ret = container;
break; break;
} }
} }
...@@ -174,7 +185,7 @@ namespace DocFileFormat ...@@ -174,7 +185,7 @@ namespace DocFileFormat
} }
private: private:
ShapeContainer* m_pBackgroud;
DrawingGroup* m_pDrawingGroupData; DrawingGroup* m_pDrawingGroupData;
std::list<OfficeArtWordDrawing> m_arrDrawings; std::list<OfficeArtWordDrawing> m_arrDrawings;
}; };
......
...@@ -39,11 +39,9 @@ namespace DocFileFormat ...@@ -39,11 +39,9 @@ namespace DocFileFormat
{ {
public: public:
static const unsigned short TYPE_CODE_0xF008 = 0xF008; static const unsigned short TYPE_CODE_0xF008 = 0xF008;
/// The number of shapes in this drawing unsigned int csp; // The number of shapes in this drawing
unsigned int csp; int spidCur; // The last MSOSPID given to an SP in this DG
/// The last MSOSPID given to an SP in this DG
int spidCur;
DrawingRecord(): DrawingRecord():
Record(), csp(0), spidCur(0) Record(), csp(0), spidCur(0)
...@@ -53,8 +51,8 @@ namespace DocFileFormat ...@@ -53,8 +51,8 @@ namespace DocFileFormat
DrawingRecord( IBinaryReader* _reader, unsigned int size, unsigned int typeCode, unsigned int version, unsigned int instance ): DrawingRecord( IBinaryReader* _reader, unsigned int size, unsigned int typeCode, unsigned int version, unsigned int instance ):
Record( _reader, size, typeCode, version, instance ) Record( _reader, size, typeCode, version, instance )
{ {
this->csp = this->Reader->ReadUInt32(); csp = Reader->ReadUInt32();
this->spidCur = this->Reader->ReadInt32(); spidCur = Reader->ReadInt32();
} }
virtual ~DrawingRecord() virtual ~DrawingRecord()
......
...@@ -93,29 +93,23 @@ namespace DocFileFormat ...@@ -93,29 +93,23 @@ namespace DocFileFormat
{ {
case ShapeContainer::TYPE_CODE_0xF004: case ShapeContainer::TYPE_CODE_0xF004:
return new ShapeContainer(); return new ShapeContainer();
break;
case Shape::TYPE_CODE_0xF00A: case Shape::TYPE_CODE_0xF00A:
return new Shape(); return new Shape();
break;
case ShapeOptions::TYPE_CODE_0xF00B: case ShapeOptions::TYPE_CODE_0xF00B:
case ShapeOptions::TYPE_CODE_0xF121: case ShapeOptions::TYPE_CODE_0xF121:
case ShapeOptions::TYPE_CODE_0xF122: case ShapeOptions::TYPE_CODE_0xF122:
return new ShapeOptions(); return new ShapeOptions();
break;
case ClientAnchor::TYPE_CODE_0xF010: case ClientAnchor::TYPE_CODE_0xF010:
return new ClientAnchor(); return new ClientAnchor();
break;
case ChildAnchor::TYPE_CODE_0xF00F: case ChildAnchor::TYPE_CODE_0xF00F:
return new ChildAnchor(); return new ChildAnchor();
break;
case BlipStoreEntry::TYPE_CODE_0xF007: case BlipStoreEntry::TYPE_CODE_0xF007:
return new BlipStoreEntry(); return new BlipStoreEntry();
break;
case BitmapBlip::TYPE_CODE_0xF01D: //OfficeArtBlipJPEG case BitmapBlip::TYPE_CODE_0xF01D: //OfficeArtBlipJPEG
case BitmapBlip::TYPE_CODE_0xF01E: //OfficeArtBlipPNG case BitmapBlip::TYPE_CODE_0xF01E: //OfficeArtBlipPNG
...@@ -125,25 +119,25 @@ namespace DocFileFormat ...@@ -125,25 +119,25 @@ namespace DocFileFormat
case BitmapBlip::TYPE_CODE_0xF029: //OfficeArtBlipTIFF case BitmapBlip::TYPE_CODE_0xF029: //OfficeArtBlipTIFF
case BitmapBlip::TYPE_CODE_0xF02A: //OfficeArtBlipJPEG case BitmapBlip::TYPE_CODE_0xF02A: //OfficeArtBlipJPEG
return new BitmapBlip(); return new BitmapBlip();
break;
case MetafilePictBlip::TYPE_CODE_0xF01A: //OfficeArtBlipEMF case MetafilePictBlip::TYPE_CODE_0xF01A: //OfficeArtBlipEMF
case MetafilePictBlip::TYPE_CODE_0xF01B: //OfficeArtBlipWMF case MetafilePictBlip::TYPE_CODE_0xF01B: //OfficeArtBlipWMF
case MetafilePictBlip::TYPE_CODE_0xF01C : //OfficeArtBlipPICT case MetafilePictBlip::TYPE_CODE_0xF01C : //OfficeArtBlipPICT
return new MetafilePictBlip(); break; return new MetafilePictBlip();
case DrawingGroup::TYPE_CODE_0xF000 : return new DrawingGroup(); break; case DrawingGroup::TYPE_CODE_0xF000 : return new DrawingGroup();
case DrawingGroupRecord::TYPE_CODE_0xF006 : return new DrawingGroupRecord(); break; case DrawingGroupRecord::TYPE_CODE_0xF006 : return new DrawingGroupRecord();
case BlipStoreContainer::TYPE_CODE_0xF001 : return new BlipStoreContainer(); break; case BlipStoreContainer::TYPE_CODE_0xF001 : return new BlipStoreContainer();
case SplitMenuColorContainer::TYPE_CODE_0xF11E : return new SplitMenuColorContainer(); break; case SplitMenuColorContainer::TYPE_CODE_0xF11E : return new SplitMenuColorContainer();
case ClientData::TYPE_CODE_0xF011 : return new ClientData(); break; case ClientData::TYPE_CODE_0xF011 : return new ClientData();
case DrawingContainer::TYPE_CODE_0xF002 : return new DrawingContainer(); break; case DrawingContainer::TYPE_CODE_0xF002 : return new DrawingContainer();
case DrawingRecord::TYPE_CODE_0xF008 : return new DrawingRecord(); break; case DrawingRecord::TYPE_CODE_0xF008 : return new DrawingRecord();
case GroupContainer::TYPE_CODE_0xF003 : return new GroupContainer(); break; case GroupContainer::TYPE_CODE_0xF003 : return new GroupContainer();
case GroupShapeRecord::TYPE_CODE_0xF009 : return new GroupShapeRecord (); break; case GroupShapeRecord::TYPE_CODE_0xF009 : return new GroupShapeRecord ();
case OfficeArtClientTextbox::TYPE_CODE_0xF00D : return new OfficeArtClientTextbox (); break; case OfficeArtClientTextbox::TYPE_CODE_0xF00D : return new OfficeArtClientTextbox ();
default: return new UnknownRecord(); break; default:
return new UnknownRecord();
} }
} }
} }
...@@ -39,33 +39,20 @@ namespace DocFileFormat ...@@ -39,33 +39,20 @@ namespace DocFileFormat
class Shape: public Record class Shape: public Record
{ {
public: public:
int spid; int spid;
/// This shape is a group shape bool fGroup;
bool fGroup; bool fChild;
/// Not a top-level shape bool fPatriarch; // This is the topmost group shape. Exactly one of these per drawing.
bool fChild; bool fDeleted; // The shape has been deleted
/// This is the topmost group shape. bool fOleShape; // The shape is an OLE object
/// Exactly one of these per drawing. bool fHaveMaster;
bool fPatriarch; bool fFlipH;
/// The shape has been deleted bool fFlipV;
bool fDeleted; bool fConnector;
/// The shape is an OLE object bool fHaveAnchor;
bool fOleShape; bool fBackground;
/// Shape has a hspMaster property bool fHaveSpt;
bool fHaveMaster;
/// Shape is flipped horizontally
bool fFlipH;
/// Shape is flipped vertically
bool fFlipV;
/// Connector type of shape
bool fConnector;
/// Shape has an anchor of some kind
bool fHaveAnchor;
/// Background shape
bool fBackground;
/// Shape has a shape type property
bool fHaveSpt;
/// The shape type of the shape
ShapeType* shapeType; ShapeType* shapeType;
public: public:
......
...@@ -69,7 +69,20 @@ namespace DocFileFormat ...@@ -69,7 +69,20 @@ namespace DocFileFormat
} }
return 0; return 0;
} }
bool isBackground()
{
int ret = 0;
for ( std::vector<Record*>::const_iterator iter = this->Children.begin(); iter != this->Children.end(); iter++ )
{
Shape* sh = dynamic_cast<Shape*>( *iter );
if (sh)
{
return sh->fBackground;
}
}
return false;
}
virtual ~ShapeContainer() virtual ~ShapeContainer()
{ {
} }
...@@ -79,7 +92,6 @@ namespace DocFileFormat ...@@ -79,7 +92,6 @@ namespace DocFileFormat
return new ShapeContainer( _reader, bodySize, typeCode, version, instance ); return new ShapeContainer( _reader, bodySize, typeCode, version, instance );
} }
/// Searches all OptionEntry in the ShapeContainer and puts them into a list.
std::list<OptionEntry> ExtractOptions() const std::list<OptionEntry> ExtractOptions() const
{ {
std::list<OptionEntry> ret; std::list<OptionEntry> ret;
......
...@@ -476,6 +476,7 @@ namespace DocFileFormat ...@@ -476,6 +476,7 @@ namespace DocFileFormat
default: default:
{ {
int sz = iter->argumentsSize;
}break; }break;
} }
} }
......
...@@ -44,27 +44,31 @@ namespace DocFileFormat ...@@ -44,27 +44,31 @@ namespace DocFileFormat
{ {
WordDocumentProperties* dop = static_cast<WordDocumentProperties*>( visited ); WordDocumentProperties* dop = static_cast<WordDocumentProperties*>( visited );
this->_ctx->_docx->RegisterSettings(); _ctx->_docx->RegisterSettings();
//start w:settings //start w:settings
m_oXmlWriter.WriteNodeBegin( _T( "?xml version=\"1.0\" encoding=\"UTF-8\"?" ) ); m_oXmlWriter.WriteNodeBegin( L"?xml version=\"1.0\" encoding=\"UTF-8\"?" );
m_oXmlWriter.WriteNodeBegin( _T( "w:settings" ), TRUE ); m_oXmlWriter.WriteNodeBegin( L"w:settings", TRUE );
//write namespaces //write namespaces
m_oXmlWriter.WriteAttribute( _T( "xmlns:w" ), OpenXmlNamespaces::WordprocessingML ); m_oXmlWriter.WriteAttribute( L"xmlns:w", OpenXmlNamespaces::WordprocessingML );
m_oXmlWriter.WriteNodeEnd( L"", TRUE, FALSE );
m_oXmlWriter.WriteNodeEnd( _T( "" ), TRUE, FALSE );
//zoom //zoom
m_oXmlWriter.WriteNodeBegin( _T( "w:zoom" ), TRUE ); m_oXmlWriter.WriteNodeBegin ( L"w:zoom", TRUE );
m_oXmlWriter.WriteAttribute( _T( "w:percent" ), FormatUtils::IntToWideString( dop->wScaleSaved ).c_str() ); m_oXmlWriter.WriteAttribute ( L"w:percent", FormatUtils::IntToWideString( dop->wScaleSaved ).c_str() );
if ( dop->zkSaved != 0 ) if ( dop->zkSaved != 0 )
{ {
m_oXmlWriter.WriteAttribute( _T( "w:val" ), FormatUtils::MapValueToWideString( dop->zkSaved, &ZoomTypeMap[0][0], 3, 9 ).c_str() ); m_oXmlWriter.WriteAttribute( L"w:val", FormatUtils::MapValueToWideString( dop->zkSaved, &ZoomTypeMap[0][0], 3, 9 ).c_str() );
} }
m_oXmlWriter.WriteNodeEnd( L"", TRUE );
m_oXmlWriter.WriteNodeEnd( _T( "" ), TRUE ); if (dop->bDisplayBackgroundShape)
{
m_oXmlWriter.WriteNodeBegin ( L"w:displayBackgroundShape", TRUE );
m_oXmlWriter.WriteNodeEnd ( L"", TRUE );
}
//doc protection //doc protection
//<w:documentProtection w:edit="forms" w:enforcement="1"/> //<w:documentProtection w:edit="forms" w:enforcement="1"/>
...@@ -72,30 +76,30 @@ namespace DocFileFormat ...@@ -72,30 +76,30 @@ namespace DocFileFormat
//embed system fonts //embed system fonts
if( !dop->fDoNotEmbedSystemFont ) if( !dop->fDoNotEmbedSystemFont )
{ {
m_oXmlWriter.WriteNodeBegin( _T( "w:embedSystemFonts" ), TRUE ); m_oXmlWriter.WriteNodeBegin( L"w:embedSystemFonts", TRUE );
m_oXmlWriter.WriteNodeEnd( _T( "" ), TRUE ); m_oXmlWriter.WriteNodeEnd( L"", TRUE );
} }
//mirror margins //mirror margins
if ( dop->fMirrorMargins ) if ( dop->fMirrorMargins )
{ {
m_oXmlWriter.WriteNodeBegin( _T( "w:mirrorMargins" ), TRUE ); m_oXmlWriter.WriteNodeBegin( L"w:mirrorMargins", TRUE );
m_oXmlWriter.WriteNodeEnd( _T( "" ), TRUE ); m_oXmlWriter.WriteNodeEnd( L"", TRUE );
} }
//evenAndOddHeaders //evenAndOddHeaders
if ( dop->fFacingPages ) if ( dop->fFacingPages )
{ {
m_oXmlWriter.WriteNodeBegin( _T( "w:evenAndOddHeaders" ), TRUE ); m_oXmlWriter.WriteNodeBegin( L"w:evenAndOddHeaders", TRUE );
m_oXmlWriter.WriteNodeEnd( _T( "" ), TRUE ); m_oXmlWriter.WriteNodeEnd( L"", TRUE );
} }
//proof state //proof state
XMLTools::XMLElement<wchar_t> proofState( _T( "w:proofState" ) ); XMLTools::XMLElement<wchar_t> proofState( L"w:proofState" );
if ( dop->fGramAllClean ) if ( dop->fGramAllClean )
{ {
appendValueAttribute( &proofState, _T( "w:grammar" ), _T( "clean" ) ); appendValueAttribute( &proofState, L"w:grammar", L"clean" );
} }
if ( proofState.GetAttributeCount() > 0 ) if ( proofState.GetAttributeCount() > 0 )
...@@ -106,31 +110,31 @@ namespace DocFileFormat ...@@ -106,31 +110,31 @@ namespace DocFileFormat
//stylePaneFormatFilter //stylePaneFormatFilter
if ( dop->grfFmtFilter != 0 ) if ( dop->grfFmtFilter != 0 )
{ {
m_oXmlWriter.WriteNodeBegin( _T( "w:stylePaneFormatFilter" ), TRUE ); m_oXmlWriter.WriteNodeBegin( L"w:stylePaneFormatFilter", TRUE );
m_oXmlWriter.WriteAttribute( _T( "w:val" ), FormatUtils::IntToFormattedWideString( dop->grfFmtFilter, _T( "%04x" ) ).c_str() ); m_oXmlWriter.WriteAttribute( L"w:val", FormatUtils::IntToFormattedWideString( dop->grfFmtFilter, L"%04x" ).c_str() );
m_oXmlWriter.WriteNodeEnd( _T( "" ), TRUE ); m_oXmlWriter.WriteNodeEnd( L"", TRUE );
} }
//default tab stop //default tab stop
m_oXmlWriter.WriteNodeBegin( _T( "w:defaultTabStop" ), TRUE ); m_oXmlWriter.WriteNodeBegin( L"w:defaultTabStop", TRUE );
m_oXmlWriter.WriteAttribute( _T( "w:val" ), FormatUtils::IntToWideString( dop->dxaTab ).c_str() ); m_oXmlWriter.WriteAttribute( L"w:val", FormatUtils::IntToWideString( dop->dxaTab ).c_str() );
m_oXmlWriter.WriteNodeEnd( _T( "" ), TRUE ); m_oXmlWriter.WriteNodeEnd( L"", TRUE );
//drawing grid //drawing grid
if( dop->dogrid != NULL ) if( dop->dogrid != NULL )
{ {
m_oXmlWriter.WriteNodeBegin( _T( "w:displayHorizontalDrawingGridEvery" ), TRUE ); m_oXmlWriter.WriteNodeBegin( L"w:displayHorizontalDrawingGridEvery", TRUE );
m_oXmlWriter.WriteAttribute( _T( "w:val" ), FormatUtils::IntToWideString( dop->dogrid->dxGridDisplay ).c_str() ); m_oXmlWriter.WriteAttribute( L"w:val", FormatUtils::IntToWideString( dop->dogrid->dxGridDisplay ).c_str() );
m_oXmlWriter.WriteNodeEnd( _T( "" ), TRUE ); m_oXmlWriter.WriteNodeEnd( L"", TRUE );
m_oXmlWriter.WriteNodeBegin( _T( "w:displayVerticalDrawingGridEvery" ), TRUE ); m_oXmlWriter.WriteNodeBegin( L"w:displayVerticalDrawingGridEvery", TRUE );
m_oXmlWriter.WriteAttribute( _T( "w:val" ), FormatUtils::IntToWideString( dop->dogrid->dyGridDisplay ).c_str() ); m_oXmlWriter.WriteAttribute( L"w:val", FormatUtils::IntToWideString( dop->dogrid->dyGridDisplay ).c_str() );
m_oXmlWriter.WriteNodeEnd( _T( "" ), TRUE ); m_oXmlWriter.WriteNodeEnd( L"", TRUE );
if ( dop->dogrid->fFollowMargins == false ) if ( dop->dogrid->fFollowMargins == false )
{ {
m_oXmlWriter.WriteNodeBegin( _T( "w:doNotUseMarginsForDrawingGridOrigin" ), TRUE ); m_oXmlWriter.WriteNodeBegin( L"w:doNotUseMarginsForDrawingGridOrigin", TRUE );
m_oXmlWriter.WriteNodeEnd( _T( "" ), TRUE ); m_oXmlWriter.WriteNodeEnd( L"", TRUE );
} }
} }
...@@ -139,27 +143,27 @@ namespace DocFileFormat ...@@ -139,27 +143,27 @@ namespace DocFileFormat
{ {
if ( dop->doptypography->fKerningPunct == false ) if ( dop->doptypography->fKerningPunct == false )
{ {
m_oXmlWriter.WriteNodeBegin( _T( "w:noPunctuationKerning" ), TRUE ); m_oXmlWriter.WriteNodeBegin( L"w:noPunctuationKerning", TRUE );
m_oXmlWriter.WriteNodeEnd( _T( "" ), TRUE ); m_oXmlWriter.WriteNodeEnd( L"", TRUE );
} }
} }
//footnote properties //footnote properties
XMLTools::XMLElement<wchar_t> footnotePr( _T( "w:footnotePr" ) ); XMLTools::XMLElement<wchar_t> footnotePr( L"w:footnotePr" );
if ( dop->nFtn != 0 ) if ( dop->nFtn != 0 )
{ {
appendValueAttribute( &footnotePr, _T( "w:numStart" ), FormatUtils::IntToWideString( dop->nFtn ).c_str() ); appendValueAttribute( &footnotePr, L"w:numStart", FormatUtils::IntToWideString( dop->nFtn ).c_str() );
} }
if ( dop->rncFtn != 0 ) if ( dop->rncFtn != 0 )
{ {
appendValueAttribute( &footnotePr, _T( "w:numRestart" ), FormatUtils::IntToWideString( dop->rncFtn ).c_str() ); appendValueAttribute( &footnotePr, L"w:numRestart", FormatUtils::IntToWideString( dop->rncFtn ).c_str() );
} }
if ( dop->Fpc != 0 ) if ( dop->Fpc != 0 )
{ {
appendValueAttribute( &footnotePr, _T( "w:pos" ), FormatUtils::MapValueToWideString( dop->Fpc, &FootnotePositionMap[0][0], 4, 12 ).c_str() ); appendValueAttribute( &footnotePr, L"w:pos", FormatUtils::MapValueToWideString( dop->Fpc, &FootnotePositionMap[0][0], 4, 12 ).c_str() );
} }
if ( footnotePr.GetAttributeCount() > 0 ) if ( footnotePr.GetAttributeCount() > 0 )
...@@ -173,7 +177,7 @@ namespace DocFileFormat ...@@ -173,7 +177,7 @@ namespace DocFileFormat
writeRsidList(); writeRsidList();
//close w:settings //close w:settings
m_oXmlWriter.WriteNodeEnd( _T( "w:settings" ) ); m_oXmlWriter.WriteNodeEnd( L"w:settings" );
this->_ctx->_docx->SettingsXML = std::wstring( m_oXmlWriter.GetXmlString() ); this->_ctx->_docx->SettingsXML = std::wstring( m_oXmlWriter.GetXmlString() );
} }
...@@ -181,368 +185,368 @@ namespace DocFileFormat ...@@ -181,368 +185,368 @@ namespace DocFileFormat
void SettingsMapping::writeRsidList() void SettingsMapping::writeRsidList()
{ {
//convert the rsid list //convert the rsid list
m_oXmlWriter.WriteNodeBegin( _T( "w:rsids" ) ); m_oXmlWriter.WriteNodeBegin( L"w:rsids" );
for ( std::set<std::wstring>::iterator iter = this->_ctx->AllRsids.begin(); iter != this->_ctx->AllRsids.end(); iter++ ) for ( std::set<std::wstring>::iterator iter = this->_ctx->AllRsids.begin(); iter != this->_ctx->AllRsids.end(); iter++ )
{ {
m_oXmlWriter.WriteNodeBegin( _T( "w:rsid" ), TRUE ); m_oXmlWriter.WriteNodeBegin( L"w:rsid", TRUE );
m_oXmlWriter.WriteAttribute( _T( "w:val" ), iter->c_str() ); m_oXmlWriter.WriteAttribute( L"w:val", iter->c_str() );
m_oXmlWriter.WriteNodeEnd( _T( "" ), TRUE ); m_oXmlWriter.WriteNodeEnd( L"", TRUE );
} }
m_oXmlWriter.WriteNodeEnd( _T( "w:rsids" ) ); m_oXmlWriter.WriteNodeEnd( L"w:rsids" );
} }
void SettingsMapping::writeCompatibilitySettings(const WordDocumentProperties* dop) void SettingsMapping::writeCompatibilitySettings(const WordDocumentProperties* dop)
{ {
//compatibility settings //compatibility settings
m_oXmlWriter.WriteNodeBegin( _T( "w:compat" ) ); m_oXmlWriter.WriteNodeBegin( L"w:compat" );
//some settings must always be written //some settings must always be written
if ( dop->fUseNormalStyleForList ) if ( dop->fUseNormalStyleForList )
{ {
m_oXmlWriter.WriteNodeBegin( _T( "w:useNormalStyleForList" ), TRUE ); m_oXmlWriter.WriteNodeBegin( L"w:useNormalStyleForList", TRUE );
m_oXmlWriter.WriteNodeEnd( _T( "" ), TRUE ); m_oXmlWriter.WriteNodeEnd( L"", TRUE );
} }
if ( dop->fDontUseIndentAsNumberingTabStop ) if ( dop->fDontUseIndentAsNumberingTabStop )
{ {
m_oXmlWriter.WriteNodeBegin( _T( "w:doNotUseIndentAsNumberingTabStop" ), TRUE ); m_oXmlWriter.WriteNodeBegin( L"w:doNotUseIndentAsNumberingTabStop", TRUE );
m_oXmlWriter.WriteNodeEnd( _T( "" ), TRUE ); m_oXmlWriter.WriteNodeEnd( L"", TRUE );
} }
if ( dop->fFELineBreak11 ) if ( dop->fFELineBreak11 )
{ {
m_oXmlWriter.WriteNodeBegin( _T( "w:useAltKinsokuLineBreakRules" ), TRUE ); m_oXmlWriter.WriteNodeBegin( L"w:useAltKinsokuLineBreakRules", TRUE );
m_oXmlWriter.WriteNodeEnd( _T( "" ), TRUE ); m_oXmlWriter.WriteNodeEnd( L"", TRUE );
} }
if ( dop->fAllowSpaceOfSameStyleInTable ) if ( dop->fAllowSpaceOfSameStyleInTable )
{ {
m_oXmlWriter.WriteNodeBegin( _T( "w:allowSpaceOfSameStyleInTable" ), TRUE ); m_oXmlWriter.WriteNodeBegin( L"w:allowSpaceOfSameStyleInTable", TRUE );
m_oXmlWriter.WriteNodeEnd( _T( "" ), TRUE ); m_oXmlWriter.WriteNodeEnd( L"", TRUE );
} }
if ( dop->fWW11IndentRules ) if ( dop->fWW11IndentRules )
{ {
m_oXmlWriter.WriteNodeBegin( _T( "w:doNotSuppressIndentation" ), TRUE ); m_oXmlWriter.WriteNodeBegin( L"w:doNotSuppressIndentation", TRUE );
m_oXmlWriter.WriteNodeEnd( _T( "" ), TRUE ); m_oXmlWriter.WriteNodeEnd( L"", TRUE );
} }
if ( dop->fDontAutofitConstrainedTables ) if ( dop->fDontAutofitConstrainedTables )
{ {
m_oXmlWriter.WriteNodeBegin( _T( "w:doNotAutofitConstrainedTables" ), TRUE ); m_oXmlWriter.WriteNodeBegin( L"w:doNotAutofitConstrainedTables", TRUE );
m_oXmlWriter.WriteNodeEnd( _T( "" ), TRUE ); m_oXmlWriter.WriteNodeEnd( L"", TRUE );
} }
if ( dop->fAutofitLikeWW11 ) if ( dop->fAutofitLikeWW11 )
{ {
m_oXmlWriter.WriteNodeBegin( _T( "w:autofitToFirstFixedWidthCell" ), TRUE ); m_oXmlWriter.WriteNodeBegin( L"w:autofitToFirstFixedWidthCell", TRUE );
m_oXmlWriter.WriteNodeEnd( _T( "" ), TRUE ); m_oXmlWriter.WriteNodeEnd( L"", TRUE );
} }
if ( dop->fUnderlineTabInNumList ) if ( dop->fUnderlineTabInNumList )
{ {
m_oXmlWriter.WriteNodeBegin( _T( "w:underlineTabInNumList" ), TRUE ); m_oXmlWriter.WriteNodeBegin( L"w:underlineTabInNumList", TRUE );
m_oXmlWriter.WriteNodeEnd( _T( "" ), TRUE ); m_oXmlWriter.WriteNodeEnd( L"", TRUE );
} }
if ( dop->fHangulWidthLikeWW11 ) if ( dop->fHangulWidthLikeWW11 )
{ {
m_oXmlWriter.WriteNodeBegin( _T( "w:displayHangulFixedWidth" ), TRUE ); m_oXmlWriter.WriteNodeBegin( L"w:displayHangulFixedWidth", TRUE );
m_oXmlWriter.WriteNodeEnd( _T( "" ), TRUE ); m_oXmlWriter.WriteNodeEnd( L"", TRUE );
} }
if ( dop->fSplitPgBreakAndParaMark ) if ( dop->fSplitPgBreakAndParaMark )
{ {
m_oXmlWriter.WriteNodeBegin( _T( "w:splitPgBreakAndParaMark" ), TRUE ); m_oXmlWriter.WriteNodeBegin( L"w:splitPgBreakAndParaMark", TRUE );
m_oXmlWriter.WriteNodeEnd( _T( "" ), TRUE ); m_oXmlWriter.WriteNodeEnd( L"", TRUE );
} }
if ( dop->fDontVertAlignCellWithSp ) if ( dop->fDontVertAlignCellWithSp )
{ {
m_oXmlWriter.WriteNodeBegin( _T( "w:doNotVertAlignCellWithSp" ), TRUE ); m_oXmlWriter.WriteNodeBegin( L"w:doNotVertAlignCellWithSp", TRUE );
m_oXmlWriter.WriteNodeEnd( _T( "" ), TRUE ); m_oXmlWriter.WriteNodeEnd( L"", TRUE );
} }
if ( dop->fDontBreakConstrainedForcedTables ) if ( dop->fDontBreakConstrainedForcedTables )
{ {
m_oXmlWriter.WriteNodeBegin( _T( "w:doNotBreakConstrainedForcedTable" ), TRUE ); m_oXmlWriter.WriteNodeBegin( L"w:doNotBreakConstrainedForcedTable", TRUE );
m_oXmlWriter.WriteNodeEnd( _T( "" ), TRUE ); m_oXmlWriter.WriteNodeEnd( L"", TRUE );
} }
if ( dop->fDontVertAlignInTxbx ) if ( dop->fDontVertAlignInTxbx )
{ {
m_oXmlWriter.WriteNodeBegin( _T( "w:doNotVertAlignInTxbx" ), TRUE ); m_oXmlWriter.WriteNodeBegin( L"w:doNotVertAlignInTxbx", TRUE );
m_oXmlWriter.WriteNodeEnd( _T( "" ), TRUE ); m_oXmlWriter.WriteNodeEnd( L"", TRUE );
} }
if ( dop->fWord11KerningPairs ) if ( dop->fWord11KerningPairs )
{ {
m_oXmlWriter.WriteNodeBegin( _T( "w:useAnsiKerningPairs" ), TRUE ); m_oXmlWriter.WriteNodeBegin( L"w:useAnsiKerningPairs", TRUE );
m_oXmlWriter.WriteNodeEnd( _T( "" ), TRUE ); m_oXmlWriter.WriteNodeEnd( L"", TRUE );
} }
if ( dop->fCachedColBalance ) if ( dop->fCachedColBalance )
{ {
m_oXmlWriter.WriteNodeBegin( _T( "w:cachedColBalance" ), TRUE ); m_oXmlWriter.WriteNodeBegin( L"w:cachedColBalance", TRUE );
m_oXmlWriter.WriteNodeEnd( _T( "" ), TRUE ); m_oXmlWriter.WriteNodeEnd( L"", TRUE );
} }
//others are saved in the file //others are saved in the file
if ( !dop->fDontAdjustLineHeightInTable ) if ( !dop->fDontAdjustLineHeightInTable )
{ {
m_oXmlWriter.WriteNodeBegin( _T( "w:adjustLineHeightInTable" ), TRUE ); m_oXmlWriter.WriteNodeBegin( L"w:adjustLineHeightInTable", TRUE );
m_oXmlWriter.WriteNodeEnd( _T( "" ), TRUE ); m_oXmlWriter.WriteNodeEnd( L"", TRUE );
} }
if ( dop->fAlignTablesRowByRow ) if ( dop->fAlignTablesRowByRow )
{ {
m_oXmlWriter.WriteNodeBegin( _T( "w:alignTablesRowByRow" ), TRUE ); m_oXmlWriter.WriteNodeBegin( L"w:alignTablesRowByRow", TRUE );
m_oXmlWriter.WriteNodeEnd( _T( "" ), TRUE ); m_oXmlWriter.WriteNodeEnd( L"", TRUE );
} }
if ( dop->fApplyBreakingRules ) if ( dop->fApplyBreakingRules )
{ {
m_oXmlWriter.WriteNodeBegin( _T( "w:applyBreakingRules" ), TRUE ); m_oXmlWriter.WriteNodeBegin( L"w:applyBreakingRules", TRUE );
m_oXmlWriter.WriteNodeEnd( _T( "" ), TRUE ); m_oXmlWriter.WriteNodeEnd( L"", TRUE );
} }
if ( dop->fUseAutoSpaceForFullWidthAlpha ) if ( dop->fUseAutoSpaceForFullWidthAlpha )
{ {
m_oXmlWriter.WriteNodeBegin( _T( "w:autoSpaceLikeWord95" ), TRUE ); m_oXmlWriter.WriteNodeBegin( L"w:autoSpaceLikeWord95", TRUE );
m_oXmlWriter.WriteNodeEnd( _T( "" ), TRUE ); m_oXmlWriter.WriteNodeEnd( L"", TRUE );
} }
if ( !dop->fDntBlnSbDbWid ) if ( !dop->fDntBlnSbDbWid )
{ {
m_oXmlWriter.WriteNodeBegin( _T( "w:balanceSingleByteDoubleByteWidth" ), TRUE ); m_oXmlWriter.WriteNodeBegin( L"w:balanceSingleByteDoubleByteWidth", TRUE );
m_oXmlWriter.WriteNodeEnd( _T( "" ), TRUE ); m_oXmlWriter.WriteNodeEnd( L"", TRUE );
} }
if ( dop->fConvMailMergeEsc ) if ( dop->fConvMailMergeEsc )
{ {
m_oXmlWriter.WriteNodeBegin( _T( "w:convMailMergeEsc" ), TRUE ); m_oXmlWriter.WriteNodeBegin( L"w:convMailMergeEsc", TRUE );
m_oXmlWriter.WriteNodeEnd( _T( "" ), TRUE ); m_oXmlWriter.WriteNodeEnd( L"", TRUE );
} }
if ( dop->fDontBreakWrappedTables ) if ( dop->fDontBreakWrappedTables )
{ {
m_oXmlWriter.WriteNodeBegin( _T( "w:doNotBreakWrappedTables" ), TRUE ); m_oXmlWriter.WriteNodeBegin( L"w:doNotBreakWrappedTables", TRUE );
m_oXmlWriter.WriteNodeEnd( _T( "" ), TRUE ); m_oXmlWriter.WriteNodeEnd( L"", TRUE );
} }
if ( !dop->fExpShRtn ) if ( !dop->fExpShRtn )
{ {
m_oXmlWriter.WriteNodeBegin( _T( "w:doNotExpandShiftReturn" ), TRUE ); m_oXmlWriter.WriteNodeBegin( L"w:doNotExpandShiftReturn", TRUE );
m_oXmlWriter.WriteNodeEnd( _T( "" ), TRUE ); m_oXmlWriter.WriteNodeEnd( L"", TRUE );
} }
if ( !dop->fLeaveBackslashAlone ) if ( !dop->fLeaveBackslashAlone )
{ {
m_oXmlWriter.WriteNodeBegin( _T( "w:doNotLeaveBackslashAlone" ), TRUE ); m_oXmlWriter.WriteNodeBegin( L"w:doNotLeaveBackslashAlone", TRUE );
m_oXmlWriter.WriteNodeEnd( _T( "" ), TRUE ); m_oXmlWriter.WriteNodeEnd( L"", TRUE );
} }
if ( dop->fDontSnapToGridInCell ) if ( dop->fDontSnapToGridInCell )
{ {
m_oXmlWriter.WriteNodeBegin( _T( "w:doNotSnapToGridInCell" ), TRUE ); m_oXmlWriter.WriteNodeBegin( L"w:doNotSnapToGridInCell", TRUE );
m_oXmlWriter.WriteNodeEnd( _T( "" ), TRUE ); m_oXmlWriter.WriteNodeEnd( L"", TRUE );
} }
if ( dop->fDontUseAsianBreakRules ) if ( dop->fDontUseAsianBreakRules )
{ {
m_oXmlWriter.WriteNodeBegin( _T( "w:doNotUseEastAsianBreakRules" ), TRUE ); m_oXmlWriter.WriteNodeBegin( L"w:doNotUseEastAsianBreakRules", TRUE );
m_oXmlWriter.WriteNodeEnd( _T( "" ), TRUE ); m_oXmlWriter.WriteNodeEnd( L"", TRUE );
} }
if ( dop->fDontUseHTMLParagraphAutoSpacing ) if ( dop->fDontUseHTMLParagraphAutoSpacing )
{ {
m_oXmlWriter.WriteNodeBegin( _T( "w:doNotUseHTMLParagraphAutoSpacing" ), TRUE ); m_oXmlWriter.WriteNodeBegin( L"w:doNotUseHTMLParagraphAutoSpacing", TRUE );
m_oXmlWriter.WriteNodeEnd( _T( "" ), TRUE ); m_oXmlWriter.WriteNodeEnd( L"", TRUE );
} }
if ( dop->fDontWrapTextWithPunct ) if ( dop->fDontWrapTextWithPunct )
{ {
m_oXmlWriter.WriteNodeBegin( _T( "w:doNotWrapTextWithPunct" ), TRUE ); m_oXmlWriter.WriteNodeBegin( L"w:doNotWrapTextWithPunct", TRUE );
m_oXmlWriter.WriteNodeEnd( _T( "" ), TRUE ); m_oXmlWriter.WriteNodeEnd( L"", TRUE );
} }
if ( dop->fFtnLayoutLikeWW8 ) if ( dop->fFtnLayoutLikeWW8 )
{ {
m_oXmlWriter.WriteNodeBegin( _T( "w:footnoteLayoutLikeWW8" ), TRUE ); m_oXmlWriter.WriteNodeBegin( L"w:footnoteLayoutLikeWW8", TRUE );
m_oXmlWriter.WriteNodeEnd( _T( "" ), TRUE ); m_oXmlWriter.WriteNodeEnd( L"", TRUE );
} }
if ( dop->fForgetLastTabAlign ) if ( dop->fForgetLastTabAlign )
{ {
m_oXmlWriter.WriteNodeBegin( _T( "w:forgetLastTabAlignment" ), TRUE ); m_oXmlWriter.WriteNodeBegin( L"w:forgetLastTabAlignment", TRUE );
m_oXmlWriter.WriteNodeEnd( _T( "" ), TRUE ); m_oXmlWriter.WriteNodeEnd( L"", TRUE );
} }
if ( dop->fGrowAutofit ) if ( dop->fGrowAutofit )
{ {
m_oXmlWriter.WriteNodeBegin( _T( "w:growAutofit" ), TRUE ); m_oXmlWriter.WriteNodeBegin( L"w:growAutofit", TRUE );
m_oXmlWriter.WriteNodeEnd( _T( "" ), TRUE ); m_oXmlWriter.WriteNodeEnd( L"", TRUE );
} }
if ( dop->fLayoutRawTableWidth ) if ( dop->fLayoutRawTableWidth )
{ {
m_oXmlWriter.WriteNodeBegin( _T( "w:layoutRawTableWidth" ), TRUE ); m_oXmlWriter.WriteNodeBegin( L"w:layoutRawTableWidth", TRUE );
m_oXmlWriter.WriteNodeEnd( _T( "" ), TRUE ); m_oXmlWriter.WriteNodeEnd( L"", TRUE );
} }
if ( dop->fLayoutTableRowsApart ) if ( dop->fLayoutTableRowsApart )
{ {
m_oXmlWriter.WriteNodeBegin( _T( "w:layoutTableRowsApart" ), TRUE ); m_oXmlWriter.WriteNodeBegin( L"w:layoutTableRowsApart", TRUE );
m_oXmlWriter.WriteNodeEnd( _T( "" ), TRUE ); m_oXmlWriter.WriteNodeEnd( L"", TRUE );
} }
if ( dop->fLineWrapLikeWord6 ) if ( dop->fLineWrapLikeWord6 )
{ {
m_oXmlWriter.WriteNodeBegin( _T( "w:lineWrapLikeWord6" ), TRUE ); m_oXmlWriter.WriteNodeBegin( L"w:lineWrapLikeWord6", TRUE );
m_oXmlWriter.WriteNodeEnd( _T( "" ), TRUE ); m_oXmlWriter.WriteNodeEnd( L"", TRUE );
} }
if ( dop->fMWSmallCaps ) if ( dop->fMWSmallCaps )
{ {
m_oXmlWriter.WriteNodeBegin( _T( "w:mwSmallCaps" ), TRUE ); m_oXmlWriter.WriteNodeBegin( L"w:mwSmallCaps", TRUE );
m_oXmlWriter.WriteNodeEnd( _T( "" ), TRUE ); m_oXmlWriter.WriteNodeEnd( L"", TRUE );
} }
if ( dop->fNoColumnBalance ) if ( dop->fNoColumnBalance )
{ {
m_oXmlWriter.WriteNodeBegin( _T( "w:noColumnBalance" ), TRUE ); m_oXmlWriter.WriteNodeBegin( L"w:noColumnBalance", TRUE );
m_oXmlWriter.WriteNodeEnd( _T( "" ), TRUE ); m_oXmlWriter.WriteNodeEnd( L"", TRUE );
} }
if ( dop->fNoLeading ) if ( dop->fNoLeading )
{ {
m_oXmlWriter.WriteNodeBegin( _T( "w:noLeading" ), TRUE ); m_oXmlWriter.WriteNodeBegin( L"w:noLeading", TRUE );
m_oXmlWriter.WriteNodeEnd( _T( "" ), TRUE ); m_oXmlWriter.WriteNodeEnd( L"", TRUE );
} }
if ( dop->fNoSpaceRaiseLower ) if ( dop->fNoSpaceRaiseLower )
{ {
m_oXmlWriter.WriteNodeBegin( _T( "w:noSpaceRaiseLower" ), TRUE ); m_oXmlWriter.WriteNodeBegin( L"w:noSpaceRaiseLower", TRUE );
m_oXmlWriter.WriteNodeEnd( _T( "" ), TRUE ); m_oXmlWriter.WriteNodeEnd( L"", TRUE );
} }
if ( dop->fNoTabForInd ) if ( dop->fNoTabForInd )
{ {
m_oXmlWriter.WriteNodeBegin( _T( "w:noTabHangInd" ), TRUE ); m_oXmlWriter.WriteNodeBegin( L"w:noTabHangInd", TRUE );
m_oXmlWriter.WriteNodeEnd( _T( "" ), TRUE ); m_oXmlWriter.WriteNodeEnd( L"", TRUE );
} }
if ( dop->fPrintBodyBeforeHdr ) if ( dop->fPrintBodyBeforeHdr )
{ {
m_oXmlWriter.WriteNodeBegin( _T( "w:printBodyTextBeforeHeader" ), TRUE ); m_oXmlWriter.WriteNodeBegin( L"w:printBodyTextBeforeHeader", TRUE );
m_oXmlWriter.WriteNodeEnd( _T( "" ), TRUE ); m_oXmlWriter.WriteNodeEnd( L"", TRUE );
} }
if ( dop->fMapPrintTextColor ) if ( dop->fMapPrintTextColor )
{ {
m_oXmlWriter.WriteNodeBegin( _T( "w:printColBlack" ), TRUE ); m_oXmlWriter.WriteNodeBegin( L"w:printColBlack", TRUE );
m_oXmlWriter.WriteNodeEnd( _T( "" ), TRUE ); m_oXmlWriter.WriteNodeEnd( L"", TRUE );
} }
if ( dop->fDontAllowFieldEndSelect ) if ( dop->fDontAllowFieldEndSelect )
{ {
m_oXmlWriter.WriteNodeBegin( _T( "w:selectFldWithFirstOrLastChar" ), TRUE ); m_oXmlWriter.WriteNodeBegin( L"w:selectFldWithFirstOrLastChar", TRUE );
m_oXmlWriter.WriteNodeEnd( _T( "" ), TRUE ); m_oXmlWriter.WriteNodeEnd( L"", TRUE );
} }
if ( dop->fSpLayoutLikeWW8 ) if ( dop->fSpLayoutLikeWW8 )
{ {
m_oXmlWriter.WriteNodeBegin( _T( "w:shapeLayoutLikeWW8" ), TRUE ); m_oXmlWriter.WriteNodeBegin( L"w:shapeLayoutLikeWW8", TRUE );
m_oXmlWriter.WriteNodeEnd( _T( "" ), TRUE ); m_oXmlWriter.WriteNodeEnd( L"", TRUE );
} }
if ( dop->fShowBreaksInFrames ) if ( dop->fShowBreaksInFrames )
{ {
m_oXmlWriter.WriteNodeBegin( _T( "w:showBreaksInFrames" ), TRUE ); m_oXmlWriter.WriteNodeBegin( L"w:showBreaksInFrames", TRUE );
m_oXmlWriter.WriteNodeEnd( _T( "" ), TRUE ); m_oXmlWriter.WriteNodeEnd( L"", TRUE );
} }
if ( dop->fMakeSpaceForUL ) if ( dop->fMakeSpaceForUL )
{ {
m_oXmlWriter.WriteNodeBegin( _T( "w:spaceForUL" ), TRUE ); m_oXmlWriter.WriteNodeBegin( L"w:spaceForUL", TRUE );
m_oXmlWriter.WriteNodeEnd( _T( "" ), TRUE ); m_oXmlWriter.WriteNodeEnd( L"", TRUE );
} }
if ( dop->fTruncDxaExpand ) if ( dop->fTruncDxaExpand )
{ {
m_oXmlWriter.WriteNodeBegin( _T( "w:spacingInWholePoints" ), TRUE ); m_oXmlWriter.WriteNodeBegin( L"w:spacingInWholePoints", TRUE );
m_oXmlWriter.WriteNodeEnd( _T( "" ), TRUE ); m_oXmlWriter.WriteNodeEnd( L"", TRUE );
} }
if ( dop->fSubOnSize ) if ( dop->fSubOnSize )
{ {
m_oXmlWriter.WriteNodeBegin( _T( "w:subFontBySize" ), TRUE ); m_oXmlWriter.WriteNodeBegin( L"w:subFontBySize", TRUE );
m_oXmlWriter.WriteNodeEnd( _T( "" ), TRUE ); m_oXmlWriter.WriteNodeEnd( L"", TRUE );
} }
if ( dop->fSuppressSpbfAfterPageBreak ) if ( dop->fSuppressSpbfAfterPageBreak )
{ {
m_oXmlWriter.WriteNodeBegin( _T( "w:suppressSpBfAfterPgBrk" ), TRUE ); m_oXmlWriter.WriteNodeBegin( L"w:suppressSpBfAfterPgBrk", TRUE );
m_oXmlWriter.WriteNodeEnd( _T( "" ), TRUE ); m_oXmlWriter.WriteNodeEnd( L"", TRUE );
} }
if ( dop->fSuppressTopSpacing ) if ( dop->fSuppressTopSpacing )
{ {
m_oXmlWriter.WriteNodeBegin( _T( "w:suppressTopSpacing" ), TRUE ); m_oXmlWriter.WriteNodeBegin( L"w:suppressTopSpacing", TRUE );
m_oXmlWriter.WriteNodeEnd( _T( "" ), TRUE ); m_oXmlWriter.WriteNodeEnd( L"", TRUE );
} }
if ( dop->fSwapBordersFacingPgs ) if ( dop->fSwapBordersFacingPgs )
{ {
m_oXmlWriter.WriteNodeBegin( _T( "w:swapBordersFacingPages" ), TRUE ); m_oXmlWriter.WriteNodeBegin( L"w:swapBordersFacingPages", TRUE );
m_oXmlWriter.WriteNodeEnd( _T( "" ), TRUE ); m_oXmlWriter.WriteNodeEnd( L"", TRUE );
} }
if ( !dop->fDntULTrlSpc ) if ( !dop->fDntULTrlSpc )
{ {
m_oXmlWriter.WriteNodeBegin( _T( "w:ulTrailSpace" ), TRUE ); m_oXmlWriter.WriteNodeBegin( L"w:ulTrailSpace", TRUE );
m_oXmlWriter.WriteNodeEnd( _T( "" ), TRUE ); m_oXmlWriter.WriteNodeEnd( L"", TRUE );
} }
if ( dop->fPrintMet ) if ( dop->fPrintMet )
{ {
m_oXmlWriter.WriteNodeBegin( _T( "w:usePrinterMetrics" ), TRUE ); m_oXmlWriter.WriteNodeBegin( L"w:usePrinterMetrics", TRUE );
m_oXmlWriter.WriteNodeEnd( _T( "" ), TRUE ); m_oXmlWriter.WriteNodeEnd( L"", TRUE );
} }
if ( dop->fUseWord2002TableStyleRules ) if ( dop->fUseWord2002TableStyleRules )
{ {
m_oXmlWriter.WriteNodeBegin( _T( "w:useWord2002TableStyleRules" ), TRUE ); m_oXmlWriter.WriteNodeBegin( L"w:useWord2002TableStyleRules", TRUE );
m_oXmlWriter.WriteNodeEnd( _T( "" ), TRUE ); m_oXmlWriter.WriteNodeEnd( L"", TRUE );
} }
if ( dop->fUserWord97LineBreakingRules ) if ( dop->fUserWord97LineBreakingRules )
{ {
m_oXmlWriter.WriteNodeBegin( _T( "w:useWord97LineBreakRules" ), TRUE ); m_oXmlWriter.WriteNodeBegin( L"w:useWord97LineBreakRules", TRUE );
m_oXmlWriter.WriteNodeEnd( _T( "" ), TRUE ); m_oXmlWriter.WriteNodeEnd( L"", TRUE );
} }
if ( dop->fWPJust ) if ( dop->fWPJust )
{ {
m_oXmlWriter.WriteNodeBegin( _T( "w:wpJustification" ), TRUE ); m_oXmlWriter.WriteNodeBegin( L"w:wpJustification", TRUE );
m_oXmlWriter.WriteNodeEnd( _T( "" ), TRUE ); m_oXmlWriter.WriteNodeEnd( L"", TRUE );
} }
if ( dop->fWPSpace ) if ( dop->fWPSpace )
{ {
m_oXmlWriter.WriteNodeBegin( _T( "w:wpSpaceWidth" ), TRUE ); m_oXmlWriter.WriteNodeBegin( L"w:wpSpaceWidth", TRUE );
m_oXmlWriter.WriteNodeEnd( _T( "" ), TRUE ); m_oXmlWriter.WriteNodeEnd( L"", TRUE );
} }
if ( dop->fWrapTrailSpaces ) if ( dop->fWrapTrailSpaces )
{ {
m_oXmlWriter.WriteNodeBegin( _T( "w:wrapTrailSpaces" ), TRUE ); m_oXmlWriter.WriteNodeBegin( L"w:wrapTrailSpaces", TRUE );
m_oXmlWriter.WriteNodeEnd( _T( "" ), TRUE ); m_oXmlWriter.WriteNodeEnd( L"", TRUE );
} }
m_oXmlWriter.WriteNodeEnd( _T( "w:compat" ) ); m_oXmlWriter.WriteNodeEnd( L"w:compat" );
} }
} }
\ No newline at end of file
...@@ -112,23 +112,14 @@ namespace DocFileFormat ...@@ -112,23 +112,14 @@ namespace DocFileFormat
friend class PropertiesMapping; friend class PropertiesMapping;
private: private:
/// 24-bit foreground color unsigned int cvFore; // 24-bit foreground color
unsigned int cvFore; bool cvForeAuto;
bool cvForeAuto; int icoFore; // Foreground color.
/// Foreground color. unsigned int cvBack;
/// Only used if cvFore is not set bool cvBackAuto;
int icoFore; int icoBack;
/// 24-bit background color ShadingPattern ipat;
unsigned int cvBack; ShadingType shadingType;
bool cvBackAuto;
/// Background color.
/// Only used if cvBack is not set.
int icoBack;
/// Shading pattern
ShadingPattern ipat;
/// Shading type
ShadingType shadingType;
/// Shading special vale
ShadingSpecialValue shadingSpecialValue; ShadingSpecialValue shadingSpecialValue;
public: public:
...@@ -236,7 +227,7 @@ namespace DocFileFormat ...@@ -236,7 +227,7 @@ namespace DocFileFormat
else if (0x0F == icoBack) { cvBack = RGB2 (0x80, 0x80, 0x80); } else if (0x0F == icoBack) { cvBack = RGB2 (0x80, 0x80, 0x80); }
else if (0x10 == icoBack) { cvBack = RGB2 (0xC0, 0xC0, 0xC0); } else if (0x10 == icoBack) { cvBack = RGB2 (0xC0, 0xC0, 0xC0); }
// TODO : если будут документы с такими цветовыми палитрами // .... если будут документы с такими цветовыми палитрами
//if ((cvFore == 0) && (icoFore == 0x0) && (cvBack == 0) && (icoBack == 0x0) && (ipat == Automatic)) //if ((cvFore == 0) && (icoFore == 0x0) && (cvBack == 0) && (icoBack == 0x0) && (ipat == Automatic))
//{ //{
...@@ -250,7 +241,6 @@ namespace DocFileFormat ...@@ -250,7 +241,6 @@ namespace DocFileFormat
} }
else else
{ {
//throw new ByteParseException("Cannot parse the struct SHD, the length of the struct doesn't match");
} }
} }
} }
......
...@@ -73,12 +73,12 @@ namespace DocFileFormat ...@@ -73,12 +73,12 @@ namespace DocFileFormat
m_pict = pPicture; m_pict = pPicture;
m_nImageId = 0; m_nImageId = 0;
m_imagedata = XMLTools::XMLElement<wchar_t>(_T("v:imagedata")); m_imagedata = XMLTools::XMLElement<wchar_t>(L"v:imagedata");
m_fill = XMLTools::XMLElement<wchar_t>(_T("v:fill")); m_fill = XMLTools::XMLElement<wchar_t>(L"v:fill");
m_stroke = XMLTools::XMLElement<wchar_t>(_T("v:stroke")); m_stroke = XMLTools::XMLElement<wchar_t>(L"v:stroke");
m_shadow = XMLTools::XMLElement<wchar_t>(_T("v:shadow")); m_shadow = XMLTools::XMLElement<wchar_t>(L"v:shadow");
m_3dstyle = XMLTools::XMLElement<wchar_t>(_T("o:extrusion")); m_3dstyle = XMLTools::XMLElement<wchar_t>(L"o:extrusion");
m_textpath = XMLTools::XMLElement<wchar_t>(_T("v:textpath")); m_textpath = XMLTools::XMLElement<wchar_t>(L"v:textpath");
Record* recBs = NULL; Record* recBs = NULL;
if ((m_ctx) && (m_ctx->_doc)) if ((m_ctx) && (m_ctx->_doc))
...@@ -146,11 +146,11 @@ namespace DocFileFormat ...@@ -146,11 +146,11 @@ namespace DocFileFormat
std::list<OptionEntry> options = groupShape->ExtractOptions(); std::list<OptionEntry> options = groupShape->ExtractOptions();
ChildAnchor* anchor = groupShape->FirstChildWithType<ChildAnchor>(); ChildAnchor* anchor = groupShape->FirstChildWithType<ChildAnchor>();
m_pXmlWriter->WriteNodeBegin( _T( "v:group" ), TRUE ); m_pXmlWriter->WriteNodeBegin( L"v:group", true );
m_pXmlWriter->WriteAttribute( _T( "id" ), GetShapeID(shape).c_str()); m_pXmlWriter->WriteAttribute( L"id", GetShapeID(shape).c_str());
m_pXmlWriter->WriteAttribute( _T( "style" ), FormatUtils::XmlEncode(buildStyle(shape, anchor, options, container->Index)).c_str() ); m_pXmlWriter->WriteAttribute( L"style", FormatUtils::XmlEncode(buildStyle(shape, anchor, options, container->Index)).c_str() );
m_pXmlWriter->WriteAttribute( _T( "coordorigin" ), ( FormatUtils::IntToWideString(gsr->rcgBounds.topLeftAngle.x) + _T( "," ) + FormatUtils::IntToWideString( gsr->rcgBounds.topLeftAngle.y)).c_str() ); m_pXmlWriter->WriteAttribute( L"coordorigin", ( FormatUtils::IntToWideString(gsr->rcgBounds.topLeftAngle.x) + L"," + FormatUtils::IntToWideString( gsr->rcgBounds.topLeftAngle.y)).c_str() );
m_pXmlWriter->WriteAttribute( _T( "coordsize" ), ( FormatUtils::IntToWideString(gsr->rcgBounds.size.cx) + _T( "," ) + FormatUtils::IntToWideString(gsr->rcgBounds.size.cy)).c_str() ); m_pXmlWriter->WriteAttribute( L"coordsize", ( FormatUtils::IntToWideString(gsr->rcgBounds.size.cx) + L"," + FormatUtils::IntToWideString(gsr->rcgBounds.size.cy)).c_str() );
// Write wrap coords // Write wrap coords
std::list<OptionEntry>::const_iterator end = options.end(); std::list<OptionEntry>::const_iterator end = options.end();
...@@ -162,13 +162,13 @@ namespace DocFileFormat ...@@ -162,13 +162,13 @@ namespace DocFileFormat
{ {
std::wstring wrapCoords = getWrapCoords(*iter); std::wstring wrapCoords = getWrapCoords(*iter);
if (wrapCoords.length()) if (wrapCoords.length())
m_pXmlWriter->WriteAttribute(_T( "wrapcoords" ), wrapCoords.c_str()); m_pXmlWriter->WriteAttribute(L"wrapcoords", wrapCoords.c_str());
} }
break; break;
} }
} }
m_pXmlWriter->WriteNodeEnd(_T( "" ), TRUE, FALSE); m_pXmlWriter->WriteNodeEnd(L"", true, false);
// Convert the shapes/groups in the group // Convert the shapes/groups in the group
...@@ -200,15 +200,15 @@ namespace DocFileFormat ...@@ -200,15 +200,15 @@ namespace DocFileFormat
if (m_pSpa) if (m_pSpa)
{ {
std::wstring wrap = getWrapType(m_pSpa); std::wstring wrap = getWrapType(m_pSpa);
if (wrap != _T( "through" )) if (wrap != L"through")
{ {
m_pXmlWriter->WriteNodeBegin( _T( "w10:wrap" ), TRUE ); m_pXmlWriter->WriteNodeBegin( L"w10:wrap", true );
m_pXmlWriter->WriteAttribute( _T( "type" ), wrap.c_str() ); m_pXmlWriter->WriteAttribute( L"type", wrap.c_str() );
m_pXmlWriter->WriteNodeEnd ( _T( "w10:wrap" ), TRUE ); m_pXmlWriter->WriteNodeEnd ( L"w10:wrap", true );
} }
} }
m_pXmlWriter->WriteNodeEnd( _T( "v:group" ) ); m_pXmlWriter->WriteNodeEnd( L"v:group" );
} }
} }
...@@ -217,10 +217,10 @@ namespace DocFileFormat ...@@ -217,10 +217,10 @@ namespace DocFileFormat
{ {
if ((NULL != pContainer) && (!pContainer->Children.empty())) if ((NULL != pContainer) && (!pContainer->Children.empty()))
{ {
Shape* pShape = static_cast<Shape*>(pContainer->Children[0]); Shape* pShape = static_cast<Shape*>(pContainer->Children[0]);
if (pShape) if (pShape)
{ {
bool freeform = true; bool freeform = true;
std::list<OptionEntry> options = pContainer->ExtractOptions(); std::list<OptionEntry> options = pContainer->ExtractOptions();
ChildAnchor* pAnchor = pContainer->FirstChildWithType<ChildAnchor>(); ChildAnchor* pAnchor = pContainer->FirstChildWithType<ChildAnchor>();
...@@ -228,26 +228,26 @@ namespace DocFileFormat ...@@ -228,26 +228,26 @@ namespace DocFileFormat
WriteBeginShapeNode (pShape); WriteBeginShapeNode (pShape);
m_pXmlWriter->WriteAttribute ( _T( "id"), GetShapeID(pShape).c_str()); m_pXmlWriter->WriteAttribute ( L"id", GetShapeID(pShape).c_str());
if (pShape->GetShapeType()) if (pShape->GetShapeType() && !pShape->fBackground )
{ {
freeform = false; freeform = false;
m_pXmlWriter->WriteAttribute( _T("type"), (std::wstring(_T("#")) + VMLShapeTypeMapping::GenerateTypeId(pShape->GetShapeType())).c_str()); m_pXmlWriter->WriteAttribute( L"type", (std::wstring(L"#") + VMLShapeTypeMapping::GenerateTypeId(pShape->GetShapeType())).c_str());
} }
m_pXmlWriter->WriteAttribute( _T("style"), FormatUtils::XmlEncode(buildStyle(pShape, pAnchor, options, pContainer->Index)).c_str()); m_pXmlWriter->WriteAttribute( L"style", FormatUtils::XmlEncode(buildStyle(pShape, pAnchor, options, pContainer->Index)).c_str());
if (pShape->is<LineType>()) if (pShape->is<LineType>())
{ {
//append "from" and "to" attributes //append "from" and "to" attributes
m_pXmlWriter->WriteAttribute(_T("from"), GetLineFrom(pAnchor).c_str()); m_pXmlWriter->WriteAttribute(L"from", GetLineFrom(pAnchor).c_str());
m_pXmlWriter->WriteAttribute(_T("to"), GetLineTo(pAnchor).c_str()); m_pXmlWriter->WriteAttribute(L"to", GetLineTo(pAnchor).c_str());
} }
if (m_isBullete) if (m_isBullete)
{ {
m_pXmlWriter->WriteAttribute(_T("o:bullet"), _T("t")); m_pXmlWriter->WriteAttribute(L"o:bullet", L"t");
} }
...@@ -397,7 +397,7 @@ namespace DocFileFormat ...@@ -397,7 +397,7 @@ namespace DocFileFormat
if (!wrapCoords.empty()) if (!wrapCoords.empty())
{ {
m_pXmlWriter->WriteAttribute( _T( "wrapcoords" ), wrapCoords.c_str() ); m_pXmlWriter->WriteAttribute( L"wrapcoords", wrapCoords.c_str() );
} }
}break; }break;
case geoRight: case geoRight:
...@@ -419,79 +419,79 @@ namespace DocFileFormat ...@@ -419,79 +419,79 @@ namespace DocFileFormat
case lineColor: case lineColor:
{ {
RGBColor lineColor((int)iter->op, RedFirst); RGBColor lineColor((int)iter->op, RedFirst);
m_pXmlWriter->WriteAttribute( _T("strokecolor"), (std::wstring(_T("#")) + lineColor.SixDigitHexCode).c_str()); m_pXmlWriter->WriteAttribute( L"strokecolor", (std::wstring(L"#") + lineColor.SixDigitHexCode).c_str());
}break; }break;
case lineWidth: case lineWidth:
{ {
if (iter->op > 0) if (iter->op > 0)
{ {
EmuValue eLineWidth ((int)iter->op ); EmuValue eLineWidth ((int)iter->op );
m_pXmlWriter->WriteAttribute(_T("strokeweight"), FormatUtils::DoubleToWideString(eLineWidth.ToPoints()) + _T("pt")); m_pXmlWriter->WriteAttribute(L"strokeweight", FormatUtils::DoubleToWideString(eLineWidth.ToPoints()) + L"pt");
} }
}break; }break;
case lineDashing: case lineDashing:
{ {
appendValueAttribute(&m_stroke, _T( "dashstyle" ), FormatUtils::MapValueToWideString( iter->op, &Global::DashStyleMap[0][0], 11, 16 ).c_str() ); appendValueAttribute(&m_stroke, L"dashstyle", FormatUtils::MapValueToWideString( iter->op, &Global::DashStyleMap[0][0], 11, 16 ).c_str() );
}break; }break;
case lineStyle: case lineStyle:
{ {
appendValueAttribute(&m_stroke, _T( "linestyle" ), getLineStyle( iter->op ).c_str()); appendValueAttribute(&m_stroke, L"linestyle", getLineStyle( iter->op ).c_str());
}break; }break;
case lineEndArrowhead: case lineEndArrowhead:
{ {
appendValueAttribute(&m_stroke, _T( "endarrow" ), getArrowStyle( iter->op ).c_str()); appendValueAttribute(&m_stroke, L"endarrow", getArrowStyle( iter->op ).c_str());
}break; }break;
case lineEndArrowLength: case lineEndArrowLength:
{ {
appendValueAttribute(&m_stroke, _T( "endarrowlength" ), getArrowLength( iter->op ).c_str()); appendValueAttribute(&m_stroke, L"endarrowlength", getArrowLength( iter->op ).c_str());
}break; }break;
case lineEndArrowWidth: case lineEndArrowWidth:
{ {
appendValueAttribute(&m_stroke, _T( "endarrowwidth" ), getArrowWidth( iter->op ).c_str()); appendValueAttribute(&m_stroke, L"endarrowwidth", getArrowWidth( iter->op ).c_str());
}break; }break;
case lineStartArrowhead: case lineStartArrowhead:
{ {
appendValueAttribute(&m_stroke, _T( "startarrow" ), getArrowStyle( iter->op ).c_str()); appendValueAttribute(&m_stroke, L"startarrow", getArrowStyle( iter->op ).c_str());
}break; }break;
case lineStartArrowLength: case lineStartArrowLength:
{ {
appendValueAttribute(&m_stroke, _T( "startarrowlength" ), getArrowLength( iter->op ).c_str()); appendValueAttribute(&m_stroke, L"startarrowlength", getArrowLength( iter->op ).c_str());
}break; }break;
case lineStartArrowWidth: case lineStartArrowWidth:
{ {
appendValueAttribute(&m_stroke, _T( "startarrowwidth" ), getArrowWidth( iter->op ).c_str()); appendValueAttribute(&m_stroke, L"startarrowwidth", getArrowWidth( iter->op ).c_str());
}break; }break;
// FILL // FILL
case fillColor: case fillColor:
{ {
RGBColor fillColor((int)iter->op, RedFirst); RGBColor fillColor((int)iter->op, RedFirst);
m_pXmlWriter->WriteAttribute(_T( "fillcolor" ), ( std::wstring( _T( "#" ) ) + fillColor.SixDigitHexCode ).c_str()); m_pXmlWriter->WriteAttribute(L"fillcolor", ( std::wstring( L"#" ) + fillColor.SixDigitHexCode ).c_str());
}break; }break;
case fillBackColor: case fillBackColor:
{ {
RGBColor fillBackColor( (int)iter->op, RedFirst ); RGBColor fillBackColor( (int)iter->op, RedFirst );
appendValueAttribute(&m_fill, _T( "color2" ), ( std::wstring( _T( "#" ) ) + fillBackColor.SixDigitHexCode ).c_str()); appendValueAttribute(&m_fill, L"color2", ( std::wstring( L"#" ) + fillBackColor.SixDigitHexCode ).c_str());
}break; }break;
case fillAngle: case fillAngle:
{ {
FixedPointNumber fllAngl( iter->op ); FixedPointNumber fllAngl( iter->op );
appendValueAttribute(&m_fill, _T( "angle" ), FormatUtils::DoubleToWideString( fllAngl.ToAngle() ).c_str()); appendValueAttribute(&m_fill, L"angle", FormatUtils::DoubleToWideString( fllAngl.ToAngle() ).c_str());
}break; }break;
case fillShadeType: case fillShadeType:
{ {
appendValueAttribute(&m_fill, _T( "method" ), getFillMethod( iter->op ).c_str()); appendValueAttribute(&m_fill, L"method", getFillMethod( iter->op ).c_str());
}break; }break;
case fillShadeColors: case fillShadeColors:
{ {
appendValueAttribute(&m_fill, _T( "colors" ), getFillColorString( iter->opComplex, iter->op ).c_str()); appendValueAttribute(&m_fill, L"colors", getFillColorString( iter->opComplex, iter->op ).c_str());
}break; }break;
case fillFocus: case fillFocus:
{ {
appendValueAttribute(&m_fill, _T( "focus" ), ( FormatUtils::IntToWideString( iter->op ) + _T( "%" ) ).c_str()); appendValueAttribute(&m_fill, L"focus", ( FormatUtils::IntToWideString( iter->op ) + L"%" ).c_str());
}break; }break;
case fillType: case fillType:
{ {
appendValueAttribute(&m_fill, _T( "type" ), getFillType( iter->op ).c_str()); appendValueAttribute(&m_fill, L"type", getFillType( iter->op ).c_str());
}break; }break;
case fillBlip: case fillBlip:
{ {
...@@ -509,29 +509,28 @@ namespace DocFileFormat ...@@ -509,29 +509,28 @@ namespace DocFileFormat
if ( (pFillBlip != NULL) && copyPicture(pFillBlip) ) if ( (pFillBlip != NULL) && copyPicture(pFillBlip) )
{ {
appendValueAttribute(&m_fill, _T( "r:id" ), ( std::wstring( _T( "rId" ) ) + FormatUtils::IntToWideString(m_nImageId) ).c_str()); appendValueAttribute(&m_fill, L"r:id", std::wstring(( L"rId" ) + FormatUtils::IntToWideString(m_nImageId) ).c_str());
appendValueAttribute(&m_imagedata, _T( "o:title" ), _T( "" ));
} }
}break; }break;
case fillOpacity: case fillOpacity:
{ {
appendValueAttribute(&m_fill, _T( "opacity" ), ( FormatUtils::IntToWideString( iter->op ) + _T( "f" ) ).c_str()); appendValueAttribute(&m_fill, L"opacity", ( FormatUtils::IntToWideString( iter->op ) + L"f" ).c_str());
} }
break; break;
case fillBackOpacity: case fillBackOpacity:
{ {
appendValueAttribute(&m_fill, _T("opacity2"), (FormatUtils::IntToWideString(iter->op) + _T("f")).c_str()); appendValueAttribute(&m_fill, L"opacity2", (FormatUtils::IntToWideString(iter->op) + L"f").c_str());
}break; }break;
// SHADOW // SHADOW
case shadowType: case shadowType:
{ {
appendValueAttribute(&m_shadow, _T("type"), getShadowType(iter->op).c_str()); appendValueAttribute(&m_shadow, L"type", getShadowType(iter->op).c_str());
}break; }break;
case shadowColor: case shadowColor:
{ {
RGBColor shadowColor((int)iter->op, RedFirst); RGBColor shadowColor((int)iter->op, RedFirst);
appendValueAttribute(&m_shadow, _T( "color" ), ( std::wstring( _T( "#" ) ) + shadowColor.SixDigitHexCode ).c_str()); appendValueAttribute(&m_shadow, L"color", ( std::wstring( L"#" ) + shadowColor.SixDigitHexCode ).c_str());
}break; }break;
case shadowOffsetX: case shadowOffsetX:
{ {
...@@ -561,7 +560,7 @@ namespace DocFileFormat ...@@ -561,7 +560,7 @@ namespace DocFileFormat
{ {
double shadowOpa = (iter->op / pow( (double)2, (double)16)); double shadowOpa = (iter->op / pow( (double)2, (double)16));
appendValueAttribute(&m_shadow, _T( "opacity" ), FormatUtils::DoubleToFormattedWideString( shadowOpa, _T( "%.2f" ) ).c_str()); appendValueAttribute(&m_shadow, L"opacity", FormatUtils::DoubleToFormattedWideString( shadowOpa, L"%.2f" ).c_str());
}break; }break;
case shadowStyleBooleanProperties: case shadowStyleBooleanProperties:
{ {
...@@ -577,7 +576,7 @@ namespace DocFileFormat ...@@ -577,7 +576,7 @@ namespace DocFileFormat
BlipStoreEntry* oBlip = static_cast<BlipStoreEntry*>(m_pBlipStore->Children[index]); BlipStoreEntry* oBlip = static_cast<BlipStoreEntry*>(m_pBlipStore->Children[index]);
if (copyPicture(oBlip)) if (copyPicture(oBlip))
{ {
appendValueAttribute(&m_imagedata, _T( "r:id" ), ( std::wstring( _T( "rId" ) ) + FormatUtils::IntToWideString(m_nImageId) ).c_str()); appendValueAttribute(&m_imagedata, L"r:id", ( std::wstring( L"rId" ) + FormatUtils::IntToWideString(m_nImageId) ).c_str());
} }
} }
}break; }break;
...@@ -585,7 +584,8 @@ namespace DocFileFormat ...@@ -585,7 +584,8 @@ namespace DocFileFormat
{ {
std::wstring name; std::wstring name;
FormatUtils::GetSTLCollectionFromBytes<std::wstring>(&name, iter->opComplex, iter->op, ENCODING_UTF16); FormatUtils::GetSTLCollectionFromBytes<std::wstring>(&name, iter->opComplex, iter->op, ENCODING_UTF16);
appendValueAttribute(&m_imagedata, _T( "o:title" ), FormatUtils::XmlEncode(name).c_str()); if (!name.empty())
appendValueAttribute(&m_imagedata, L"o:title", FormatUtils::XmlEncode(name).c_str());
}break; }break;
// 3D STYLE // 3D STYLE
case f3D: case f3D:
...@@ -597,37 +597,37 @@ namespace DocFileFormat ...@@ -597,37 +597,37 @@ namespace DocFileFormat
{ {
EmuValue backwardValue( (int)iter->op ); EmuValue backwardValue( (int)iter->op );
std::wstring depth = FormatUtils::DoubleToWideString( backwardValue.ToPoints() ) + L"pt"; std::wstring depth = FormatUtils::DoubleToWideString( backwardValue.ToPoints() ) + L"pt";
appendValueAttribute(&m_3dstyle, _T( "backdepth" ), depth.c_str()); appendValueAttribute(&m_3dstyle, L"backdepth", depth.c_str());
}break; }break;
case c3DAmbientIntensity: case c3DAmbientIntensity:
{ {
std::wstring intens = FormatUtils::IntToWideString((int)iter->op) + L"f"; std::wstring intens = FormatUtils::IntToWideString((int)iter->op) + L"f";
appendValueAttribute(&m_3dstyle, _T( "brightness" ), intens.c_str()); appendValueAttribute(&m_3dstyle, L"brightness", intens.c_str());
}break; }break;
case c3DSpecularAmt: case c3DSpecularAmt:
{ {
std::wstring amt = FormatUtils::IntToWideString((int)iter->op) + L"f"; std::wstring amt = FormatUtils::IntToWideString((int)iter->op) + L"f";
appendValueAttribute(&m_3dstyle, _T( "specularity" ), amt.c_str()); appendValueAttribute(&m_3dstyle, L"specularity", amt.c_str());
}break; }break;
case c3DDiffuseAmt: case c3DDiffuseAmt:
{ {
std::wstring amt = FormatUtils::IntToWideString((int)iter->op) + L"f"; std::wstring amt = FormatUtils::IntToWideString((int)iter->op) + L"f";
appendValueAttribute(&m_3dstyle, _T( "diffusity" ), amt.c_str()); appendValueAttribute(&m_3dstyle, L"diffusity", amt.c_str());
}break; }break;
case c3DKeyIntensity: case c3DKeyIntensity:
{ {
std::wstring amt = FormatUtils::IntToWideString((int)iter->op); std::wstring amt = FormatUtils::IntToWideString((int)iter->op);
appendValueAttribute(&m_3dstyle, _T( "lightlevel" ), amt.c_str()); appendValueAttribute(&m_3dstyle, L"lightlevel", amt.c_str());
}break; }break;
case c3DExtrusionColor: case c3DExtrusionColor:
{ {
std::wstring color = FormatUtils::IntToFormattedWideString(iter->op, L"#%06x"); std::wstring color = FormatUtils::IntToFormattedWideString(iter->op, L"#%06x");
appendValueAttribute(&m_3dstyle, _T( "color" ), color.c_str()); appendValueAttribute(&m_3dstyle, L"color", color.c_str());
}break; }break;
case c3DSkewAngle: case c3DSkewAngle:
{ {
FixedPointNumber skewAngle( iter->op ); FixedPointNumber skewAngle( iter->op );
appendValueAttribute(&m_3dstyle, _T( "skewangle" ), FormatUtils::DoubleToWideString( skewAngle.ToAngle() ).c_str()); appendValueAttribute(&m_3dstyle, L"skewangle", FormatUtils::DoubleToWideString( skewAngle.ToAngle() ).c_str());
}break; }break;
case c3DXViewpoint: case c3DXViewpoint:
{ {
...@@ -685,11 +685,11 @@ namespace DocFileFormat ...@@ -685,11 +685,11 @@ namespace DocFileFormat
text = FormatUtils::XmlEncode(text); text = FormatUtils::XmlEncode(text);
if (0 <= text.find(_T("\n"))) if (0 <= text.find(L"\n"))
{ {
m_textpath.AppendText(text.c_str()); m_textpath.AppendText(text.c_str());
} }
text = ReplaceString(text, _T("\n") , _T("&#xA;")); text = ReplaceString(text, L"\n", L"&#xA;");
appendValueAttribute(&m_textpath, L"string", text.c_str()); appendValueAttribute(&m_textpath, L"string", text.c_str());
}break; }break;
case gtextFont: case gtextFont:
...@@ -703,7 +703,7 @@ namespace DocFileFormat ...@@ -703,7 +703,7 @@ namespace DocFileFormat
} }
if (i < font.size()) font.erase(font.begin() + i, font.end()); if (i < font.size()) font.erase(font.begin() + i, font.end());
font = std::wstring(_T("\"")) + font + std::wstring(_T("\"")); font = std::wstring(L"\"") + font + std::wstring(L"\"");
appendStyleProperty(&m_textPathStyle, L"font-family", font); appendStyleProperty(&m_textPathStyle, L"font-family", font);
}break; }break;
case gtextSize: case gtextSize:
...@@ -721,11 +721,11 @@ namespace DocFileFormat ...@@ -721,11 +721,11 @@ namespace DocFileFormat
GeometryTextBooleanProperties props(iter->op); GeometryTextBooleanProperties props(iter->op);
if (props.fUsegtextFBestFit && props.gtextFBestFit) if (props.fUsegtextFBestFit && props.gtextFBestFit)
{ {
appendValueAttribute(&m_textpath, L"fitshape", _T("t")); appendValueAttribute(&m_textpath, L"fitshape", L"t");
} }
if (props.fUsegtextFShrinkFit && props.gtextFShrinkFit) if (props.fUsegtextFShrinkFit && props.gtextFShrinkFit)
{ {
appendValueAttribute(&m_textpath, L"trim", _T("t")); appendValueAttribute(&m_textpath, L"trim", L"t");
} }
if (props.fUsegtextFVertical && props.gtextFVertical) if (props.fUsegtextFVertical && props.gtextFVertical)
{ {
...@@ -753,7 +753,7 @@ namespace DocFileFormat ...@@ -753,7 +753,7 @@ namespace DocFileFormat
std::wstring path = ParsePath(options); std::wstring path = ParsePath(options);
if (false == path.empty()) if (false == path.empty())
m_pXmlWriter->WriteAttribute (_T( "path" ), path.c_str()); m_pXmlWriter->WriteAttribute (L"path", path.c_str());
}break; }break;
default: default:
{ {
...@@ -767,27 +767,27 @@ namespace DocFileFormat ...@@ -767,27 +767,27 @@ namespace DocFileFormat
std::wstring path = ParsePath(options); std::wstring path = ParsePath(options);
if (false == path.empty()) if (false == path.empty())
m_pXmlWriter->WriteAttribute (_T( "path" ), path.c_str()); m_pXmlWriter->WriteAttribute (L"path", path.c_str());
} }
if ( !filled ) if ( !filled )
{ {
m_pXmlWriter->WriteAttribute( _T( "filled" ), _T( "f" ) ); m_pXmlWriter->WriteAttribute( L"filled", L"f" );
} }
if ( !stroked ) if ( !stroked )
{ {
m_pXmlWriter->WriteAttribute( _T( "stroked" ), _T( "f" ) ); m_pXmlWriter->WriteAttribute( L"stroked", L"f" );
} }
if (!layoutInCell) if (!layoutInCell)
{ {
m_pXmlWriter->WriteAttribute(_T("o:allowincell"), _T("f")); m_pXmlWriter->WriteAttribute(L"o:allowincell", L"f");
} }
if ( ( xCoord > 0 ) && ( yCoord > 0 ) ) if ( ( xCoord > 0 ) && ( yCoord > 0 ) )
{ {
m_pXmlWriter->WriteAttribute( _T( "coordsize" ), ( FormatUtils::IntToWideString( xCoord ) + _T( "," ) + FormatUtils::IntToWideString( yCoord ) ).c_str() ); m_pXmlWriter->WriteAttribute( L"coordsize", ( FormatUtils::IntToWideString( xCoord ) + L"," + FormatUtils::IntToWideString( yCoord ) ).c_str() );
} }
int nCode = 0; int nCode = 0;
...@@ -816,7 +816,7 @@ namespace DocFileFormat ...@@ -816,7 +816,7 @@ namespace DocFileFormat
} }
} }
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE ); m_pXmlWriter->WriteNodeEnd( L"", true, false );
//build shadow offsets //build shadow offsets
std::wstring offset; std::wstring offset;
...@@ -824,17 +824,17 @@ namespace DocFileFormat ...@@ -824,17 +824,17 @@ namespace DocFileFormat
if ( ShadowOffsetX != 0 ) if ( ShadowOffsetX != 0 )
{ {
offset += FormatUtils::DoubleToWideString( ShadowOffsetX.ToPoints() ); offset += FormatUtils::DoubleToWideString( ShadowOffsetX.ToPoints() );
offset += _T( "pt" ); offset += L"pt";
} }
if ( ShadowOffsetY != 0 ) if ( ShadowOffsetY != 0 )
{ {
offset += _T( "," ); offset += L",";
offset += FormatUtils::DoubleToWideString( ShadowOffsetY.ToPoints() ); offset += FormatUtils::DoubleToWideString( ShadowOffsetY.ToPoints() );
offset += _T( "pt" ); offset += L"pt";
} }
if ( !offset.empty() ) if ( !offset.empty() )
{ {
appendValueAttribute(&m_shadow, _T( "offset" ), offset.c_str()); appendValueAttribute(&m_shadow, L"offset", offset.c_str());
} }
std::wstring offset2; std::wstring offset2;
...@@ -842,25 +842,25 @@ namespace DocFileFormat ...@@ -842,25 +842,25 @@ namespace DocFileFormat
if ( SecondShadowOffsetX != 0 ) if ( SecondShadowOffsetX != 0 )
{ {
offset2 += FormatUtils::DoubleToWideString( SecondShadowOffsetX.ToPoints() ); offset2 += FormatUtils::DoubleToWideString( SecondShadowOffsetX.ToPoints() );
offset2 += _T( "pt" ); offset2 += L"pt";
} }
if ( SecondShadowOffsetY != 0 ) if ( SecondShadowOffsetY != 0 )
{ {
offset2 += _T( "," ); offset2 += L",";
offset2 += FormatUtils::DoubleToWideString(SecondShadowOffsetY.ToPoints()); offset2 += FormatUtils::DoubleToWideString(SecondShadowOffsetY.ToPoints());
offset2 += _T( "pt" ); offset2 += L"pt";
} }
if (!offset2.empty()) if (!offset2.empty())
{ {
appendValueAttribute(&m_shadow, _T("offset2"), offset2.c_str()); appendValueAttribute(&m_shadow, L"offset2", offset2.c_str());
} }
//build shadow origin //build shadow origin
if ( ( ShadowOriginX != 0 ) && ( ShadowOriginY != 0 ) ) if ( ( ShadowOriginX != 0 ) && ( ShadowOriginY != 0 ) )
{ {
appendValueAttribute(&m_shadow, _T("origin"), (FormatUtils::DoubleToWideString(shadowOriginX) + std::wstring(_T( "," )) + FormatUtils::DoubleToWideString(shadowOriginY)).c_str()); appendValueAttribute(&m_shadow, L"origin", (FormatUtils::DoubleToWideString(shadowOriginX) + std::wstring(L"," ) + FormatUtils::DoubleToWideString(shadowOriginY)).c_str());
} }
// write shadow // write shadow
...@@ -868,7 +868,7 @@ namespace DocFileFormat ...@@ -868,7 +868,7 @@ namespace DocFileFormat
{ {
if (shadowBoolean.fShadow) if (shadowBoolean.fShadow)
{ {
appendValueAttribute(&m_shadow, _T( "on" ), _T( "t" )); appendValueAttribute(&m_shadow, L"on", L"t" );
} }
m_pXmlWriter->WriteString(m_shadow.GetXMLString().c_str()); m_pXmlWriter->WriteString(m_shadow.GetXMLString().c_str());
...@@ -876,8 +876,8 @@ namespace DocFileFormat ...@@ -876,8 +876,8 @@ namespace DocFileFormat
//write 3d style //write 3d style
if (m_3dstyle.GetAttributeCount() > 0) if (m_3dstyle.GetAttributeCount() > 0)
{ {
appendValueAttribute(&m_3dstyle, _T( "v:ext" ), _T( "view" )); appendValueAttribute(&m_3dstyle, L"v:ext", L"view" );
appendValueAttribute(&m_3dstyle, _T( "on" ), _T( "t" )); appendValueAttribute(&m_3dstyle, L"on", L"t" );
//write the viewpoint //write the viewpoint
if ( ( ViewPointX != 0 ) || ( ViewPointY != 0 ) || ( ViewPointZ != 0 ) ) if ( ( ViewPointX != 0 ) || ( ViewPointY != 0 ) || ( ViewPointZ != 0 ) )
...@@ -888,18 +888,18 @@ namespace DocFileFormat ...@@ -888,18 +888,18 @@ namespace DocFileFormat
{ {
viewPoint += FormatUtils::IntToWideString( ViewPointX ) + L"pt"; viewPoint += FormatUtils::IntToWideString( ViewPointX ) + L"pt";
} }
viewPoint += _T( "," ); viewPoint += L",";
if ( ViewPointY != 0 ) if ( ViewPointY != 0 )
{ {
viewPoint += FormatUtils::IntToWideString( ViewPointY ) + L"pt"; viewPoint += FormatUtils::IntToWideString( ViewPointY ) + L"pt";
} }
viewPoint += _T( "," ); viewPoint += L",";
if ( ViewPointZ != 0 ) if ( ViewPointZ != 0 )
{ {
viewPoint += FormatUtils::IntToWideString( ViewPointZ ) + L"pt"; viewPoint += FormatUtils::IntToWideString( ViewPointZ ) + L"pt";
} }
appendValueAttribute(&m_3dstyle, _T( "viewpoint" ), viewPoint.c_str()); appendValueAttribute(&m_3dstyle, L"viewpoint", viewPoint.c_str());
} }
// write the viewpointorigin // write the viewpointorigin
if ( ( viewPointOriginX != 0 ) || ( viewPointOriginY != 0 ) ) if ( ( viewPointOriginX != 0 ) || ( viewPointOriginY != 0 ) )
...@@ -908,16 +908,16 @@ namespace DocFileFormat ...@@ -908,16 +908,16 @@ namespace DocFileFormat
if ( viewPointOriginX != 0 ) if ( viewPointOriginX != 0 )
{ {
viewPointOrigin += FormatUtils::DoubleToFormattedWideString( viewPointOriginX, _T( "%.2f" ) ); viewPointOrigin += FormatUtils::DoubleToFormattedWideString( viewPointOriginX, L"%.2f" );
} }
if ( viewPointOriginY != 0 ) if ( viewPointOriginY != 0 )
{ {
viewPointOrigin += _T( "," ); viewPointOrigin += L",";
viewPointOrigin += FormatUtils::DoubleToFormattedWideString( viewPointOriginY, _T( "%.2f" ) ); viewPointOrigin += FormatUtils::DoubleToFormattedWideString( viewPointOriginY, L"%.2f" );
} }
appendValueAttribute(&m_3dstyle, _T( "viewpointorigin" ), viewPointOrigin.c_str()); appendValueAttribute(&m_3dstyle, L"viewpointorigin", viewPointOrigin.c_str());
} }
m_pXmlWriter->WriteString(m_3dstyle.GetXMLString().c_str()); m_pXmlWriter->WriteString(m_3dstyle.GetXMLString().c_str());
...@@ -927,11 +927,11 @@ namespace DocFileFormat ...@@ -927,11 +927,11 @@ namespace DocFileFormat
{ {
std::wstring wrap = getWrapType(m_pSpa); std::wstring wrap = getWrapType(m_pSpa);
if (wrap != _T("through")) if (wrap != L"through")
{ {
m_pXmlWriter->WriteNodeBegin( _T( "w10:wrap" ), TRUE ); m_pXmlWriter->WriteNodeBegin( L"w10:wrap", true );
m_pXmlWriter->WriteAttribute( _T( "type" ), wrap.c_str() ); m_pXmlWriter->WriteAttribute( L"type", wrap.c_str() );
m_pXmlWriter->WriteNodeEnd ( _T( "w10:wrap" ), TRUE ); m_pXmlWriter->WriteNodeEnd ( L"w10:wrap", true );
} }
} }
// write stroke // write stroke
...@@ -947,7 +947,7 @@ namespace DocFileFormat ...@@ -947,7 +947,7 @@ namespace DocFileFormat
// text path // text path
if (m_textpath.GetAttributeCount()) if (m_textpath.GetAttributeCount())
{ {
appendValueAttribute(&m_textpath, _T( "style" ), FormatUtils::XmlEncode(m_textPathStyle).c_str()); appendValueAttribute(&m_textpath, L"style", FormatUtils::XmlEncode(m_textPathStyle).c_str());
m_pXmlWriter->WriteString(m_textpath.GetXMLString().c_str()); m_pXmlWriter->WriteString(m_textpath.GetXMLString().c_str());
} }
// write imagedata // write imagedata
...@@ -1008,7 +1008,7 @@ namespace DocFileFormat ...@@ -1008,7 +1008,7 @@ namespace DocFileFormat
WriteEndShapeNode(pShape); WriteEndShapeNode(pShape);
//ShapeType //ShapeType
if (NULL != pShape->GetShapeType()/* && !m_isInlineShape*/) //bullete only??? if (NULL != pShape->GetShapeType() && !pShape->fBackground /* && !m_isInlineShape*/) //bullete only???
{ {
VMLShapeTypeMapping oXmlMapper(m_pXmlWriter); VMLShapeTypeMapping oXmlMapper(m_pXmlWriter);
pShape->GetShapeType()->Convert(&oXmlMapper); pShape->GetShapeType()->Convert(&oXmlMapper);
...@@ -1022,29 +1022,33 @@ namespace DocFileFormat ...@@ -1022,29 +1022,33 @@ namespace DocFileFormat
{ {
if (NULL != pShape) if (NULL != pShape)
{ {
if (pShape->is<OvalType>()) if (pShape->fBackground)
{
m_pXmlWriter->WriteNodeBegin( L"v:background", true );
}
else if (pShape->is<OvalType>())
{ {
//OVAL //OVAL
m_pXmlWriter->WriteNodeBegin( _T( "v:oval" ), TRUE ); m_pXmlWriter->WriteNodeBegin( L"v:oval", true );
} }
else if (pShape->is<RoundedRectangleType>()) else if (pShape->is<RoundedRectangleType>())
{ {
//ROUNDED RECT //ROUNDED RECT
m_pXmlWriter->WriteNodeBegin( _T( "v:roundrect" ), TRUE ); m_pXmlWriter->WriteNodeBegin( L"v:roundrect", true );
} }
else if (pShape->is<RectangleType>()) else if (pShape->is<RectangleType>())
{ {
//RECT //RECT
m_pXmlWriter->WriteNodeBegin( _T( "v:rect" ), TRUE ); m_pXmlWriter->WriteNodeBegin( L"v:rect", true );
} }
else if (pShape->is<LineType>()) else if (pShape->is<LineType>())
{ {
//LINE //LINE
m_pXmlWriter->WriteNodeBegin(_T( "v:line" ), TRUE); m_pXmlWriter->WriteNodeBegin(L"v:line", true);
} }
else else
{ {
m_pXmlWriter->WriteNodeBegin(_T( "v:shape" ), TRUE); m_pXmlWriter->WriteNodeBegin(L"v:shape", true);
} }
} }
} }
...@@ -1053,25 +1057,29 @@ namespace DocFileFormat ...@@ -1053,25 +1057,29 @@ namespace DocFileFormat
{ {
if (NULL != pShape) if (NULL != pShape)
{ {
if (pShape->is<OvalType>()) if (pShape->fBackground)
{ {
m_pXmlWriter->WriteNodeEnd( _T( "v:oval" ) ); m_pXmlWriter->WriteNodeEnd( L"v:background" );
}
else if (pShape->is<OvalType>())
{
m_pXmlWriter->WriteNodeEnd( L"v:oval" );
} }
else if (pShape->is<RoundedRectangleType>()) else if (pShape->is<RoundedRectangleType>())
{ {
m_pXmlWriter->WriteNodeEnd( _T( "v:roundrect" ) ); m_pXmlWriter->WriteNodeEnd( L"v:roundrect" );
} }
else if (pShape->is<RectangleType>()) else if (pShape->is<RectangleType>())
{ {
m_pXmlWriter->WriteNodeEnd( _T( "v:rect" ) ); m_pXmlWriter->WriteNodeEnd( L"v:rect" );
} }
else if (pShape->is<LineType>()) else if (pShape->is<LineType>())
{ {
m_pXmlWriter->WriteNodeEnd( _T( "v:line" ) ); m_pXmlWriter->WriteNodeEnd( L"v:line" );
} }
else else
{ {
m_pXmlWriter->WriteNodeEnd( _T( "v:shape" ) ); m_pXmlWriter->WriteNodeEnd( L"v:shape" );
} }
} }
} }
...@@ -1082,7 +1090,7 @@ namespace DocFileFormat ...@@ -1082,7 +1090,7 @@ namespace DocFileFormat
if (NULL != pShape) if (NULL != pShape)
{ {
strXmlAttr += std::wstring(_T("_x0000_s" )); strXmlAttr += std::wstring(L"_x0000_s");
strXmlAttr += FormatUtils::IntToWideString(pShape->GetShapeID()); strXmlAttr += FormatUtils::IntToWideString(pShape->GetShapeID());
} }
...@@ -1099,7 +1107,7 @@ namespace DocFileFormat ...@@ -1099,7 +1107,7 @@ namespace DocFileFormat
if (NULL != pAnchor) if (NULL != pAnchor)
{ {
strXmlFrom += FormatUtils::IntToWideString(pAnchor->rcgBounds.topLeftAngle.x); strXmlFrom += FormatUtils::IntToWideString(pAnchor->rcgBounds.topLeftAngle.x);
strXmlFrom += _T( "," ); strXmlFrom += L",";
strXmlFrom += FormatUtils::IntToWideString(pAnchor->rcgBounds.topLeftAngle.y); strXmlFrom += FormatUtils::IntToWideString(pAnchor->rcgBounds.topLeftAngle.y);
} }
else if (m_pSpa) else if (m_pSpa)
...@@ -1108,9 +1116,9 @@ namespace DocFileFormat ...@@ -1108,9 +1116,9 @@ namespace DocFileFormat
TwipsValue oTop(m_pSpa->yaTop); TwipsValue oTop(m_pSpa->yaTop);
strXmlFrom += FormatUtils::DoubleToWideString(oLeft.ToPoints()); strXmlFrom += FormatUtils::DoubleToWideString(oLeft.ToPoints());
strXmlFrom += _T( "pt," ); strXmlFrom += L"pt,";
strXmlFrom += FormatUtils::DoubleToWideString(oTop.ToPoints()); strXmlFrom += FormatUtils::DoubleToWideString(oTop.ToPoints());
strXmlFrom += _T( "pt" ); strXmlFrom += L"pt";
} }
return strXmlFrom; return strXmlFrom;
...@@ -1118,7 +1126,6 @@ namespace DocFileFormat ...@@ -1118,7 +1126,6 @@ namespace DocFileFormat
std::wstring VMLShapeMapping::GetLineTo(const ChildAnchor* pAnchor) const std::wstring VMLShapeMapping::GetLineTo(const ChildAnchor* pAnchor) const
{ {
//Если линия находится в группе, то координаты должны быть в Twips
//Если линия находится в группе, то координаты должны быть в других единицах измерения (например в twips) //Если линия находится в группе, то координаты должны быть в других единицах измерения (например в twips)
std::wstring strXmlTo; std::wstring strXmlTo;
...@@ -1126,7 +1133,7 @@ namespace DocFileFormat ...@@ -1126,7 +1133,7 @@ namespace DocFileFormat
if (NULL != pAnchor) if (NULL != pAnchor)
{ {
strXmlTo += FormatUtils::IntToWideString(pAnchor->rcgBounds.topLeftAngle.x + pAnchor->rcgBounds.size.cx); strXmlTo += FormatUtils::IntToWideString(pAnchor->rcgBounds.topLeftAngle.x + pAnchor->rcgBounds.size.cx);
strXmlTo += _T( "," ); strXmlTo += L",";
strXmlTo += FormatUtils::IntToWideString(pAnchor->rcgBounds.topLeftAngle.y + pAnchor->rcgBounds.size.cy); strXmlTo += FormatUtils::IntToWideString(pAnchor->rcgBounds.topLeftAngle.y + pAnchor->rcgBounds.size.cy);
} }
else if (m_pSpa) else if (m_pSpa)
...@@ -1135,9 +1142,9 @@ namespace DocFileFormat ...@@ -1135,9 +1142,9 @@ namespace DocFileFormat
TwipsValue oBottom (m_pSpa->yaBottom); TwipsValue oBottom (m_pSpa->yaBottom);
strXmlTo += FormatUtils::DoubleToWideString(oRight.ToPoints()); strXmlTo += FormatUtils::DoubleToWideString(oRight.ToPoints());
strXmlTo += _T( "pt," ); strXmlTo += L"pt,";
strXmlTo += FormatUtils::DoubleToWideString(oBottom.ToPoints()); strXmlTo += FormatUtils::DoubleToWideString(oBottom.ToPoints());
strXmlTo += _T( "pt" ); strXmlTo += L"pt";
} }
return strXmlTo; return strXmlTo;
...@@ -1167,7 +1174,7 @@ namespace DocFileFormat ...@@ -1167,7 +1174,7 @@ namespace DocFileFormat
for (std::list<int>::const_iterator iter = arrVertices.begin(); iter != end; ++iter) for (std::list<int>::const_iterator iter = arrVertices.begin(); iter != end; ++iter)
{ {
coords += FormatUtils::IntToWideString(*iter); coords += FormatUtils::IntToWideString(*iter);
coords += _T( "," ); coords += L",";
} }
coords.erase(coords.size() - 1); coords.erase(coords.size() - 1);
...@@ -1250,35 +1257,35 @@ namespace DocFileFormat ...@@ -1250,35 +1257,35 @@ namespace DocFileFormat
switch ( _type ) switch ( _type )
{ {
case Global::msoblipDIB: case Global::msoblipDIB:
return std::wstring( _T( ".bmp" ) ); return std::wstring( L".bmp" );
case Global::msoblipEMF: case Global::msoblipEMF:
return std::wstring( _T( ".emf" ) ); return std::wstring( L".emf" );
//case msoblipGIF: //case msoblipGIF:
// return std::wstring( _T( ".gif" ) ); // return std::wstring( L".gif" );
//case msoblipICON: //case msoblipICON:
// return std::wstring( _T( ".ico" ) ); // return std::wstring( L".ico" );
case Global::msoblipJPEG: case Global::msoblipJPEG:
case Global::msoblipCMYKJPEG: case Global::msoblipCMYKJPEG:
return std::wstring( _T( ".jpg" ) ); return std::wstring( L".jpg" );
//case msoblipPCX: //case msoblipPCX:
// return std::wstring( _T( ".pcx" ) ); // return std::wstring( L".pcx" );
case Global::msoblipPNG: case Global::msoblipPNG:
return std::wstring( _T( ".png" ) ); return std::wstring( L".png" );
case Global::msoblipTIFF: case Global::msoblipTIFF:
return std::wstring( _T( ".tif" ) ); return std::wstring( L".tif" );
case Global::msoblipWMF: case Global::msoblipWMF:
return std::wstring( _T( ".wmf" ) ); return std::wstring( L".wmf" );
default: default:
return std::wstring( _T( ".png" ) ); return std::wstring( L".png" );
} }
} }
...@@ -1301,8 +1308,8 @@ namespace DocFileFormat ...@@ -1301,8 +1308,8 @@ namespace DocFileFormat
std::wstring widthString = FormatUtils::DoubleToWideString( width.ToPoints() ); std::wstring widthString = FormatUtils::DoubleToWideString( width.ToPoints() );
std::wstring heightString = FormatUtils::DoubleToWideString( height.ToPoints() ); std::wstring heightString = FormatUtils::DoubleToWideString( height.ToPoints() );
style->operator += ( std::wstring( _T( "width:" ) ) + widthString + std::wstring( _T( "pt;" ) ) ); style->operator += ( std::wstring( L"width:" ) + widthString + std::wstring( L"pt;" ) );
style->operator += ( std::wstring( _T( "height:" ) ) + heightString + std::wstring( _T( "pt;" ) ) ); style->operator += ( std::wstring( L"height:" ) + heightString + std::wstring( L"pt;" ) );
} }
} }
...@@ -1315,11 +1322,11 @@ namespace DocFileFormat ...@@ -1315,11 +1322,11 @@ namespace DocFileFormat
//if (pSpa->fAnchorLock ) //if (pSpa->fAnchorLock )
//if (pSpa->bx == TEXT && pSpa->by == TEXT) //if (pSpa->bx == TEXT && pSpa->by == TEXT)
//{ //{
// appendStyleProperty( style, _T( "position" ), _T( "static" ) ); // appendStyleProperty( style, L"position", L"static" );
//} //}
//else //else
//{ //{
appendStyleProperty( style, _T( "position" ), _T( "absolute" ) ); appendStyleProperty( style, L"position", L"absolute" );
//} //}
TwipsValue left (pSpa->xaLeft); TwipsValue left (pSpa->xaLeft);
...@@ -1336,10 +1343,10 @@ namespace DocFileFormat ...@@ -1336,10 +1343,10 @@ namespace DocFileFormat
top = TwipsValue((pSpa->yaBottom + pSpa->yaTop) * 0.5 - (pSpa->xaRight - pSpa->xaLeft) * 0.5); top = TwipsValue((pSpa->yaBottom + pSpa->yaTop) * 0.5 - (pSpa->xaRight - pSpa->xaLeft) * 0.5);
} }
appendStyleProperty (style, _T( "margin-left" ), ( FormatUtils::DoubleToWideString(left.ToPoints()) + std::wstring( _T( "pt" ) ) )); appendStyleProperty (style, L"margin-left", ( FormatUtils::DoubleToWideString(left.ToPoints()) + std::wstring( L"pt" ) ));
appendStyleProperty (style, _T( "margin-top" ), ( FormatUtils::DoubleToWideString(top.ToPoints()) + std::wstring( _T( "pt" ) ) )); appendStyleProperty (style, L"margin-top", ( FormatUtils::DoubleToWideString(top.ToPoints()) + std::wstring( L"pt" ) ));
appendStyleProperty (style, _T( "width" ), ( FormatUtils::DoubleToWideString(width.ToPoints()) + std::wstring( _T( "pt" ) ) )); appendStyleProperty (style, L"width", ( FormatUtils::DoubleToWideString(width.ToPoints()) + std::wstring( L"pt" ) ));
appendStyleProperty (style, _T( "height" ), ( FormatUtils::DoubleToWideString(height.ToPoints()) + std::wstring( _T( "pt" ) ) )); appendStyleProperty (style, L"height", ( FormatUtils::DoubleToWideString(height.ToPoints()) + std::wstring( L"pt" ) ));
} }
} }
...@@ -1355,19 +1362,19 @@ namespace DocFileFormat ...@@ -1355,19 +1362,19 @@ namespace DocFileFormat
bounds.topLeftAngle.y = static_cast<LONG>(((anchor->Bottom + anchor->Top) * 0.5 - (anchor->Right - anchor->Left) * 0.5)); bounds.topLeftAngle.y = static_cast<LONG>(((anchor->Bottom + anchor->Top) * 0.5 - (anchor->Right - anchor->Left) * 0.5));
} }
appendStyleProperty(style, _T("position"), _T("absolute")); appendStyleProperty(style, L"position", L"absolute");
appendStyleProperty(style, _T("left"), FormatUtils::IntToWideString(bounds.topLeftAngle.x)); appendStyleProperty(style, L"left", FormatUtils::IntToWideString(bounds.topLeftAngle.x));
appendStyleProperty(style, _T("top"), FormatUtils::IntToWideString(bounds.topLeftAngle.y)); appendStyleProperty(style, L"top", FormatUtils::IntToWideString(bounds.topLeftAngle.y));
if (twistDimensions) if (twistDimensions)
{ {
appendStyleProperty(style, _T("width"), FormatUtils::IntToWideString(bounds.size.cy)); appendStyleProperty(style, L"width", FormatUtils::IntToWideString(bounds.size.cy));
appendStyleProperty(style, _T("height"), FormatUtils::IntToWideString(bounds.size.cx)); appendStyleProperty(style, L"height", FormatUtils::IntToWideString(bounds.size.cx));
} }
else else
{ {
appendStyleProperty(style, _T("width"), FormatUtils::IntToWideString(bounds.size.cx)); appendStyleProperty(style, L"width", FormatUtils::IntToWideString(bounds.size.cx));
appendStyleProperty(style, _T("height"), FormatUtils::IntToWideString(bounds.size.cy)); appendStyleProperty(style, L"height", FormatUtils::IntToWideString(bounds.size.cy));
} }
} }
} }
...@@ -1377,9 +1384,9 @@ namespace DocFileFormat ...@@ -1377,9 +1384,9 @@ namespace DocFileFormat
if ( b != NULL ) if ( b != NULL )
{ {
b->operator += ( propName ); b->operator += ( propName );
b->operator += ( _T( ":" ) ); b->operator += ( L":" );
b->operator += ( propValue ); b->operator += ( propValue );
b->operator +=( _T( ";" ) ); b->operator +=( L";" );
} }
} }
...@@ -1387,18 +1394,18 @@ namespace DocFileFormat ...@@ -1387,18 +1394,18 @@ namespace DocFileFormat
{ {
switch ( anchor ) switch ( anchor )
{ {
case 0: return _T("top"); case 0: return L"top";
case 1: return _T("middle"); case 1: return L"middle";
case 2: return _T("bottom"); case 2: return L"bottom";
case 3: return _T("top-center"); case 3: return L"top-center";
case 4: return _T("middle-center"); case 4: return L"middle-center";
case 5: return _T("bottom-center"); case 5: return L"bottom-center";
case 6: return _T("top-baseline"); case 6: return L"top-baseline";
case 7: return _T("bottom-baseline"); case 7: return L"bottom-baseline";
case 8: return _T("top-center-baseline"); case 8: return L"top-center-baseline";
case 9: return _T("bottom-center-baseline"); case 9: return L"bottom-center-baseline";
default: default:
return _T("top"); return L"top";
} }
} }
...@@ -1406,14 +1413,14 @@ namespace DocFileFormat ...@@ -1406,14 +1413,14 @@ namespace DocFileFormat
{ {
switch ( vPos ) switch ( vPos )
{ {
/*case msopvAbs: return _T( "absolute" );*/ /*case msopvAbs: return L"absolute" );*/
case msopvTop: return _T( "top" ); case msopvTop: return L"top";
case msopvCenter: return _T( "center" ); case msopvCenter: return L"center";
case msopvBottom: return _T( "bottom" ); case msopvBottom: return L"bottom";
case msopvInside: return _T( "inside" ); case msopvInside: return L"inside";
case msopvOutside: return _T( "outside" ); case msopvOutside: return L"outside";
default: default:
return _T( "absolute" ); return L"absolute";
} }
} }
...@@ -1422,12 +1429,12 @@ namespace DocFileFormat ...@@ -1422,12 +1429,12 @@ namespace DocFileFormat
PositionVerticalRelative vRel = (PositionVerticalRelative)vRel_; PositionVerticalRelative vRel = (PositionVerticalRelative)vRel_;
switch ( vRel ) switch ( vRel )
{ {
case msoprvMargin: return _T( "margin" ); case msoprvMargin: return L"margin";
case msoprvPage: return _T( "page" ); case msoprvPage: return L"page";
case msoprvText: return _T( "text" ); case msoprvText: return L"text";
case msoprvLine: return _T( "line" ); case msoprvLine: return L"line";
default: default:
return _T( "margin" ); return L"margin";
} }
} }
...@@ -1435,14 +1442,14 @@ namespace DocFileFormat ...@@ -1435,14 +1442,14 @@ namespace DocFileFormat
{ {
switch ( hPos ) switch ( hPos )
{ {
/*case msophAbs: return _T( "absolute" );*/ /*case msophAbs: return L"absolute";*/
case msophLeft: return _T( "left" ); case msophLeft: return L"left";
case msophCenter: return _T( "center" ); case msophCenter: return L"center";
case msophRight: return _T( "right" ); case msophRight: return L"right";
case msophInside: return _T( "inside" ); case msophInside: return L"inside";
case msophOutside: return _T( "outside" ); case msophOutside: return L"outside";
default: default:
return _T( "absolute" ); return L"absolute";
} }
} }
...@@ -1451,12 +1458,12 @@ namespace DocFileFormat ...@@ -1451,12 +1458,12 @@ namespace DocFileFormat
PositionHorizontalRelative hRel = (PositionHorizontalRelative )hRel_; PositionHorizontalRelative hRel = (PositionHorizontalRelative )hRel_;
switch ( hRel ) switch ( hRel )
{ {
case msoprhMargin: return _T( "margin" ); case msoprhMargin: return L"margin";
case msoprhPage: return _T( "page" ); case msoprhPage: return L"page";
case msoprhText: return _T( "text" ); case msoprhText: return L"text";
case msoprhChar: return _T( "char" ); case msoprhChar: return L"char";
default: default:
return _T( "margin" ); return L"margin";
} }
} }
...@@ -1478,22 +1485,22 @@ namespace DocFileFormat ...@@ -1478,22 +1485,22 @@ namespace DocFileFormat
// POSITIONING // POSITIONING
case posh: case posh:
{ {
appendStyleProperty(oStyle, _T("mso-position-horizontal"), mapHorizontalPosition((PositionHorizontal)iter->op)); appendStyleProperty(oStyle, L"mso-position-horizontal", mapHorizontalPosition((PositionHorizontal)iter->op));
bPosH = true; bPosH = true;
}break; }break;
case posrelh: case posrelh:
{ {
appendStyleProperty(oStyle, _T("mso-position-horizontal-relative"), mapHorizontalPositionRelative((PositionHorizontalRelative)iter->op)); appendStyleProperty(oStyle, L"mso-position-horizontal-relative", mapHorizontalPositionRelative((PositionHorizontalRelative)iter->op));
bRelH = true; bRelH = true;
}break; }break;
case posv: case posv:
{ {
appendStyleProperty(oStyle, _T("mso-position-vertical"), mapVerticalPosition((PositionVertical)iter->op)); appendStyleProperty(oStyle, L"mso-position-vertical", mapVerticalPosition((PositionVertical)iter->op));
bPosV = true; bPosV = true;
}break; }break;
case posrelv: case posrelv:
{ {
appendStyleProperty(oStyle, _T("mso-position-vertical-relative"), mapVerticalPositionRelative((PositionVerticalRelative)iter->op)); appendStyleProperty(oStyle, L"mso-position-vertical-relative", mapVerticalPositionRelative((PositionVerticalRelative)iter->op));
bRelV = true; bRelV = true;
}break; }break;
// BOOLEANS // BOOLEANS
...@@ -1504,18 +1511,18 @@ namespace DocFileFormat ...@@ -1504,18 +1511,18 @@ namespace DocFileFormat
if (groupShapeBooleans.fUsefBehindDocument && groupShapeBooleans.fBehindDocument && !bZIndex) if (groupShapeBooleans.fUsefBehindDocument && groupShapeBooleans.fBehindDocument && !bZIndex)
{ {
//The shape is behind the text, so the z-index must be negative. //The shape is behind the text, so the z-index must be negative.
appendStyleProperty(oStyle, _T( "z-index" ), _T( "-1" ) ); appendStyleProperty(oStyle, L"z-index", L"-1" );
bZIndex = true; bZIndex = true;
} }
else if (!m_isInlineShape && !bZIndex) else if (!m_isInlineShape && !bZIndex)
{ {
appendStyleProperty( oStyle, _T( "z-index" ), FormatUtils::IntToWideString(zIndex + 0x7ffff)); appendStyleProperty( oStyle, L"z-index", FormatUtils::IntToWideString(zIndex + 0x7ffff));
bZIndex = true; bZIndex = true;
} }
if (groupShapeBooleans.fHidden && groupShapeBooleans.fUsefHidden) if (groupShapeBooleans.fHidden && groupShapeBooleans.fUsefHidden)
{ {
appendStyleProperty(oStyle, _T( "visibility" ), _T( "hidden" )); appendStyleProperty(oStyle, L"visibility", L"hidden" );
} }
}break; }break;
// GEOMETRY // GEOMETRY
...@@ -1526,54 +1533,54 @@ namespace DocFileFormat ...@@ -1526,54 +1533,54 @@ namespace DocFileFormat
if (dAngle < -360.0) if (dAngle < -360.0)
dAngle += 360.0; dAngle += 360.0;
appendStyleProperty(oStyle, _T( "rotation" ), FormatUtils::DoubleToWideString(dAngle)); appendStyleProperty(oStyle, L"rotation", FormatUtils::DoubleToWideString(dAngle));
}break; }break;
// TEXTBOX // TEXTBOX
case anchorText: case anchorText:
{ {
appendStyleProperty(oStyle, _T("v-text-anchor"), getTextboxAnchor(iter->op)); appendStyleProperty(oStyle, L"v-text-anchor", getTextboxAnchor(iter->op));
}break; }break;
// WRAP DISTANCE // WRAP DISTANCE
case dxWrapDistLeft: case dxWrapDistLeft:
{ {
appendStyleProperty(oStyle, _T("mso-wrap-distance-left"), (FormatUtils::DoubleToWideString(EmuValue((int)iter->op).ToPoints()) + std::wstring(_T("pt")))); appendStyleProperty(oStyle, L"mso-wrap-distance-left", (FormatUtils::DoubleToWideString(EmuValue((int)iter->op).ToPoints()) + std::wstring(L"pt")));
}break; }break;
case dxWrapDistRight: case dxWrapDistRight:
{ {
appendStyleProperty(oStyle, _T("mso-wrap-distance-right"), (FormatUtils::DoubleToWideString(EmuValue((int)iter->op).ToPoints()) + std::wstring(_T("pt")))); appendStyleProperty(oStyle, L"mso-wrap-distance-right", (FormatUtils::DoubleToWideString(EmuValue((int)iter->op).ToPoints()) + std::wstring(L"pt")));
}break; }break;
case dyWrapDistBottom: case dyWrapDistBottom:
{ {
appendStyleProperty(oStyle, _T("mso-wrap-distance-bottom"), (FormatUtils::DoubleToWideString(EmuValue((int)iter->op).ToPoints()) + std::wstring(_T("pt")))); appendStyleProperty(oStyle, L"mso-wrap-distance-bottom", (FormatUtils::DoubleToWideString(EmuValue((int)iter->op).ToPoints()) + std::wstring(L"pt")));
}break; }break;
case dyWrapDistTop: case dyWrapDistTop:
{ {
appendStyleProperty(oStyle, _T("mso-wrap-distance-top"), (FormatUtils::DoubleToWideString(EmuValue((int)iter->op).ToPoints()) + std::wstring(_T("pt")))); appendStyleProperty(oStyle, L"mso-wrap-distance-top", (FormatUtils::DoubleToWideString(EmuValue((int)iter->op).ToPoints()) + std::wstring(L"pt")));
}break; }break;
} }
} }
if (!bRelH && m_pSpa) if (!bRelH && m_pSpa)
{ {
appendStyleProperty(oStyle, _T("mso-position-horizontal-relative"), mapHorizontalPositionRelative(m_pSpa->bx)); appendStyleProperty(oStyle, L"mso-position-horizontal-relative", mapHorizontalPositionRelative(m_pSpa->bx));
} }
if (!bRelV && m_pSpa) if (!bRelV && m_pSpa)
{ {
appendStyleProperty(oStyle, _T("mso-position-vertical-relative"), mapVerticalPositionRelative(m_pSpa->bx)); appendStyleProperty(oStyle, L"mso-position-vertical-relative", mapVerticalPositionRelative(m_pSpa->bx));
} }
if (!m_isInlineShape && !bZIndex) if (!m_isInlineShape && !bZIndex)
{ {
appendStyleProperty( oStyle, _T( "z-index" ), FormatUtils::IntToWideString(zIndex + 0x7ffff)); appendStyleProperty( oStyle, L"z-index", FormatUtils::IntToWideString(zIndex + 0x7ffff));
bZIndex = true; bZIndex = true;
} }
//if (!bPosH) //if (!bPosH)
//{ //{
// appendStyleProperty(oStyle, _T("mso-position-horizontal"), _T( "absolute" )); // appendStyleProperty(oStyle, L"mso-position-horizontal", L"absolute" );
//} //}
//if (!bPosV) //if (!bPosV)
//{ //{
// appendStyleProperty(oStyle, _T("mso-position-vertical"), _T( "absolute" )); // appendStyleProperty(oStyle, L"mso-position-vertical", L"absolute" );
//} //}
} }
...@@ -1636,7 +1643,7 @@ namespace DocFileFormat ...@@ -1636,7 +1643,7 @@ namespace DocFileFormat
//если не написать тип позиции, то будет inline //если не написать тип позиции, то будет inline
if ( anchor != NULL ) if ( anchor != NULL )
{ {
appendStyleProperty( &style, _T( "position" ), _T( "absolute" ) ); appendStyleProperty( &style, L"position", L"absolute" );
} }
else if (m_pSpa) else if (m_pSpa)
{ {
...@@ -1645,23 +1652,23 @@ namespace DocFileFormat ...@@ -1645,23 +1652,23 @@ namespace DocFileFormat
//if (m_pSpa->bx == TEXT && m_pSpa->by == TEXT) //if (m_pSpa->bx == TEXT && m_pSpa->by == TEXT)
//{ //{
// appendStyleProperty( &style, _T( "position" ), _T( "static" ) ); // appendStyleProperty( &style, L"position", L"static" );
//} //}
//else //else
{ {
appendStyleProperty( &style, _T( "position" ), _T( "absolute" ) ); appendStyleProperty( &style, L"position", L"absolute" );
} }
} }
} }
if ( shape->fFlipH ) if ( shape->fFlipH )
{ {
appendStyleProperty( &style, _T( "flip" ), _T( "x" ) ); appendStyleProperty( &style, L"flip", L"x" );
} }
if ( shape->fFlipV ) if ( shape->fFlipV )
{ {
appendStyleProperty( &style, _T( "flip" ), _T( "y" ) ); appendStyleProperty( &style, L"flip", L"y" );
} }
AppendOptionsToStyle( &style, options, zIndex ); AppendOptionsToStyle( &style, options, zIndex );
...@@ -1673,12 +1680,12 @@ namespace DocFileFormat ...@@ -1673,12 +1680,12 @@ namespace DocFileFormat
{ {
switch (p) switch (p)
{ {
case 0: return _T( "single" ); case 0: return L"single";
case 1: return _T( "thinThin" ); case 1: return L"thinThin";
case 2: return _T( "thinThick" ); case 2: return L"thinThick";
case 3: return _T( "thickThin" ); case 3: return L"thickThin";
case 4: return _T( "thickBetweenThin" ); case 4: return L"thickBetweenThin";
default: return _T( "single" ); default: return L"single";
} }
} }
...@@ -1686,12 +1693,12 @@ namespace DocFileFormat ...@@ -1686,12 +1693,12 @@ namespace DocFileFormat
{ {
switch ( op ) switch ( op )
{ {
default: return _T( "none" ); default: return L"none";
case 1: return _T( "block" ); case 1: return L"block";
case 2: return _T( "classic" ); case 2: return L"classic";
case 3: return _T( "diamond" ); case 3: return L"diamond";
case 4: return _T( "oval" ); case 4: return L"oval";
case 5: return _T( "open" ); case 5: return L"open";
} }
} }
...@@ -1699,9 +1706,9 @@ namespace DocFileFormat ...@@ -1699,9 +1706,9 @@ namespace DocFileFormat
{ {
switch ( op ) switch ( op )
{ {
default: return _T( "short" ); default: return L"short";
case 1: return _T( "medium" ); case 1: return L"medium";
case 2: return _T( "long" ); case 2: return L"long";
} }
} }
...@@ -1709,9 +1716,9 @@ namespace DocFileFormat ...@@ -1709,9 +1716,9 @@ namespace DocFileFormat
{ {
switch ( op ) switch ( op )
{ {
default: return _T( "narrow" ); default: return L"narrow";
case 1: return _T( "medium" ); case 1: return L"medium";
case 2: return _T( "wide" ); case 2: return L"wide";
} }
} }
...@@ -1721,35 +1728,12 @@ namespace DocFileFormat ...@@ -1721,35 +1728,12 @@ namespace DocFileFormat
switch ( val ) switch ( val )
{ {
case 0: case 0: return L"none";
{ case 1: return L"any";
return _T( "none" ); case 2: return L"linear";
} case 4: return L"linear sigma";
break;
case 1:
{
return _T( "any" );
}
break;
case 2:
{
return _T( "linear" );
}
break;
case 4:
{
return _T( "linear sigma" );
}
break;
default: default:
{ return L"any";
return _T( "any" );
}
break;
} }
} }
...@@ -1772,9 +1756,9 @@ namespace DocFileFormat ...@@ -1772,9 +1756,9 @@ namespace DocFileFormat
int colorPos = FormatUtils::BytesToInt32(p, ( pos + 4 ), size); int colorPos = FormatUtils::BytesToInt32(p, ( pos + 4 ), size);
result += FormatUtils::IntToWideString(colorPos); result += FormatUtils::IntToWideString(colorPos);
result += _T( "f #" ); result += L"f #";
result += color.SixDigitHexCode; result += color.SixDigitHexCode;
result += _T( ";" ); result += L";";
} }
} }
...@@ -1786,58 +1770,17 @@ namespace DocFileFormat ...@@ -1786,58 +1770,17 @@ namespace DocFileFormat
{ {
switch ( p ) switch ( p )
{ {
case 0: case 0: return L"solid";
{ case 1: return L"pattern";
return _T( "solid" ); case 2: return L"tile";
} case 3: return L"frame";
break; case 4: return L"gradient";
case 5: return L"gradientRadial";
case 1: case 6: return L"gradientRadial";
{ case 7: return L"gradient";
return _T( "pattern" );
}
break;
case 2:
{
return _T( "tile" );
}
break;
case 3:
{
return _T( "frame" );
}
break;
case 4:
{
return _T( "gradient" );
}
break;
case 5:
{
return _T( "gradientRadial" );
}
break;
case 6:
{
return _T( "gradientRadial" );
}
break;
case 7:
{
return _T( "gradient" );
}
break;
case 9: case 9:
{
return _T( "solid" );
}
break;
default: default:
{ return L"solid";
return _T( "solid" );
}
break;
} }
} }
...@@ -1845,47 +1788,14 @@ namespace DocFileFormat ...@@ -1845,47 +1788,14 @@ namespace DocFileFormat
{ {
switch ( p ) switch ( p )
{ {
case 0: case 0: return L"single";
{ case 1: return L"double";
return _T( "single" ); case 2: return L"perspective";
} case 3: return L"shaperelative";
break; case 4: return L"drawingrelative";
case 5: return L"emboss";
case 1:
{
return _T( "double" );
}
break;
case 2:
{
return _T( "perspective" );
}
break;
case 3:
{
return _T( "shaperelative" );
}
break;
case 4:
{
return _T( "drawingrelative" );
}
break;
case 5:
{
return _T( "emboss" );
}
break;
default: default:
{ return L"single";
return _T( "single" );
}
break;
} }
} }
...@@ -1900,43 +1810,20 @@ namespace DocFileFormat ...@@ -1900,43 +1810,20 @@ namespace DocFileFormat
// 4 = wrap tightly areound object // 4 = wrap tightly areound object
// 5 = wrap tightly but allow holes // 5 = wrap tightly but allow holes
std::wstring wrapType = _T("none"); std::wstring wrapType = L"none";
if (pSpa != NULL) if (pSpa != NULL)
{ {
switch (pSpa->wr) switch (pSpa->wr)
{ {
case 0: case 0:
case 2: case 2: wrapType = L"square";
{ case 1: wrapType = L"topAndBottom";
wrapType = _T( "square" ); case 3: wrapType = L"through";
} case 4:
break; case 5: wrapType = L"tight";
default:
case 1: wrapType = L"none";
{
wrapType = _T( "topAndBottom" );
}
break;
case 3:
{
wrapType = _T( "through" );
}
break;
case 4:
case 5:
{
wrapType = _T( "tight" );
}
break;
default:
{
wrapType = _T( "none" );
}
break;
} }
} }
...@@ -2025,7 +1912,7 @@ namespace DocFileFormat ...@@ -2025,7 +1912,7 @@ namespace DocFileFormat
DrawingPrimitive *primitive = dynamic_cast<DrawingPrimitive *>(primitives->at(index)); DrawingPrimitive *primitive = dynamic_cast<DrawingPrimitive *>(primitives->at(index));
m_pXmlWriter->WriteNodeBegin(primitive->strVmlType.c_str(), TRUE ); m_pXmlWriter->WriteNodeBegin(primitive->strVmlType.c_str(), true );
if (primitive->type == 0x0007) if (primitive->type == 0x0007)
{ {
...@@ -2090,10 +1977,10 @@ namespace DocFileFormat ...@@ -2090,10 +1977,10 @@ namespace DocFileFormat
TwipsValue h( primitive->dya ); TwipsValue h( primitive->dya );
std::wstring strId = std::wstring(L"_x0000_s") + FormatUtils::IntToWideString(1024 + (count_vml_objects++)); std::wstring strId = std::wstring(L"_x0000_s") + FormatUtils::IntToWideString(1024 + (count_vml_objects++));
//m_pXmlWriter->WriteAttribute ( _T( "id") , strId.c_str()); //m_pXmlWriter->WriteAttribute ( L"id") , strId.c_str());
m_pXmlWriter->WriteAttribute ( _T( "o:spid"), strId.c_str()); m_pXmlWriter->WriteAttribute ( L"o:spid", strId.c_str());
std::wstring strStyle = _T("position:absolute;visibility:visible;mso-wrap-style:square;"); std::wstring strStyle = L"position:absolute;visibility:visible;mso-wrap-style:square;";
DrawingPrimitiveLine * line = dynamic_cast<DrawingPrimitiveLine *>(primitive); DrawingPrimitiveLine * line = dynamic_cast<DrawingPrimitiveLine *>(primitive);
if (line) if (line)
...@@ -2103,83 +1990,83 @@ namespace DocFileFormat ...@@ -2103,83 +1990,83 @@ namespace DocFileFormat
TwipsValue x2( line->xaEnd ); TwipsValue x2( line->xaEnd );
TwipsValue y2( line->yaEnd ); TwipsValue y2( line->yaEnd );
std::wstring strStart = FormatUtils::IntToWideString(line->xaStart + primitive->xa) + _T(",") + FormatUtils::IntToWideString(line->yaStart + primitive->ya); std::wstring strStart = FormatUtils::IntToWideString(line->xaStart + primitive->xa) + L"," + FormatUtils::IntToWideString(line->yaStart + primitive->ya);
std::wstring strEnd = FormatUtils::IntToWideString(line->xaEnd + primitive->xa) + _T(",") + FormatUtils::IntToWideString(line->yaEnd + primitive->ya); std::wstring strEnd = FormatUtils::IntToWideString(line->xaEnd + primitive->xa) + L"," + FormatUtils::IntToWideString(line->yaEnd + primitive->ya);
m_pXmlWriter->WriteAttribute(_T("from"), strStart.c_str() ); m_pXmlWriter->WriteAttribute(L"from", strStart.c_str() );
m_pXmlWriter->WriteAttribute(_T("to"), strEnd.c_str()); m_pXmlWriter->WriteAttribute(L"to", strEnd.c_str());
} }
else else
{ {
if (root) if (root)
{ {
//strStyle += _T("left:") + FormatUtils::IntToWideString( x.ToPoints()) + _T("pt;"); //strStyle += L"left:" + FormatUtils::IntToWideString( x.ToPoints()) + L"pt;";
//strStyle += _T("top:") + FormatUtils::IntToWideString( y.ToPoints()) + _T("pt;"); //strStyle += L"top:" + FormatUtils::IntToWideString( y.ToPoints()) + L"pt;";
strStyle += _T("width:") + FormatUtils::IntToWideString( w.ToPoints()) + _T("pt;"); strStyle += L"width:" + FormatUtils::IntToWideString( w.ToPoints()) + L"pt;";
strStyle += _T("height:") + FormatUtils::IntToWideString( h.ToPoints()) + _T("pt;"); strStyle += L"height:" + FormatUtils::IntToWideString( h.ToPoints()) + L"pt;";
strStyle += _T("margin-left:") + FormatUtils::IntToWideString( x.ToPoints()) + _T("pt;"); strStyle += L"margin-left:" + FormatUtils::IntToWideString( x.ToPoints()) + L"pt;";
strStyle += _T("margin-top:") + FormatUtils::IntToWideString( y.ToPoints()) + _T("pt;"); strStyle += L"margin-top:" + FormatUtils::IntToWideString( y.ToPoints()) + L"pt;";
std::wstring xMargin; std::wstring xMargin;
std::wstring yMargin; std::wstring yMargin;
if (m_pSpa->bx == PAGE) xMargin = _T("page;"); if (m_pSpa->bx == PAGE) xMargin = L"page;";
if (m_pSpa->by == PAGE) yMargin = _T("page;"); if (m_pSpa->by == PAGE) yMargin = L"page;";
if (m_pSpa->bx == MARGIN) xMargin = _T("margin;"); if (m_pSpa->bx == MARGIN) xMargin = L"margin;";
if (m_pSpa->by == MARGIN) yMargin = _T("margin;"); if (m_pSpa->by == MARGIN) yMargin = L"margin;";
if (!xMargin.empty()) strStyle += _T("mso-position-horizontal-relative:") + xMargin; if (!xMargin.empty()) strStyle += L"mso-position-horizontal-relative:" + xMargin;
if (!yMargin.empty()) strStyle += _T("mso-position-vertical-relative:") + yMargin; if (!yMargin.empty()) strStyle += L"mso-position-vertical-relative:" + yMargin;
std::wstring strSize = FormatUtils::IntToWideString(primitive->dxa) + _T(",") + FormatUtils::IntToWideString(primitive->dya); std::wstring strSize = FormatUtils::IntToWideString(primitive->dxa) + L"," + FormatUtils::IntToWideString(primitive->dya);
std::wstring strOrigin = FormatUtils::IntToWideString(primitive->xa) + _T(",") + FormatUtils::IntToWideString(primitive->ya); std::wstring strOrigin = FormatUtils::IntToWideString(primitive->xa) + L"," + FormatUtils::IntToWideString(primitive->ya);
m_pXmlWriter->WriteAttribute( _T("coordsize"), strSize.c_str()); m_pXmlWriter->WriteAttribute( L"coordsize", strSize.c_str());
//m_pXmlWriter->WriteAttribute( _T("coordorigin"), strOrigin.c_str()); //m_pXmlWriter->WriteAttribute( L"coordorigin"), strOrigin.c_str());
} }
else else
{ {
strStyle += _T("left:") + FormatUtils::IntToWideString( primitive->xa) + _T(";"); strStyle += L"left:" + FormatUtils::IntToWideString( primitive->xa) + L";";
strStyle += _T("top:") + FormatUtils::IntToWideString( primitive->ya) + _T(";"); strStyle += L"top:" + FormatUtils::IntToWideString( primitive->ya) + L";";
strStyle += _T("width:") + FormatUtils::IntToWideString( primitive->dxa) + _T(";"); strStyle += L"width:" + FormatUtils::IntToWideString( primitive->dxa) + L";";
strStyle += _T("height:") + FormatUtils::IntToWideString( primitive->dya) + _T(";"); strStyle += L"height:" + FormatUtils::IntToWideString( primitive->dya) + L";";
} }
} }
if (primitive->fillPattern == 0) if (primitive->fillPattern == 0)
m_pXmlWriter->WriteAttribute( _T("filled"), _T("f")); m_pXmlWriter->WriteAttribute( L"filled", L"f");
if (primitive->type > 1) if (primitive->type > 1)
{ {
m_pXmlWriter->WriteAttribute( _T("fillColor"), FormatUtils::IntToFormattedWideString(primitive->fillFore, L"#%06x").c_str()); m_pXmlWriter->WriteAttribute( L"fillColor", FormatUtils::IntToFormattedWideString(primitive->fillFore, L"#%06x").c_str());
} }
m_pXmlWriter->WriteAttribute( _T("style"), strStyle.c_str()); m_pXmlWriter->WriteAttribute( L"style", strStyle.c_str());
std::wstring strStrokeWeight = FormatUtils::IntToWideString(primitive->lineWeight / 20) + _T("pt"); std::wstring strStrokeWeight = FormatUtils::IntToWideString(primitive->lineWeight / 20) + L"pt";
if (primitive->lineWeight > 20) if (primitive->lineWeight > 20)
m_pXmlWriter->WriteAttribute( _T("strokeweight"), strStrokeWeight.c_str()); m_pXmlWriter->WriteAttribute( L"strokeweight", strStrokeWeight.c_str());
if (primitive->type > 0) if (primitive->type > 0)
m_pXmlWriter->WriteAttribute( _T("strokecolor"), FormatUtils::IntToFormattedWideString(primitive->lineColor, L"#%06x").c_str()); m_pXmlWriter->WriteAttribute( L"strokecolor", FormatUtils::IntToFormattedWideString(primitive->lineColor, L"#%06x").c_str());
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE ); m_pXmlWriter->WriteNodeEnd( L"", true, false );
if (primitive->type > 1 && primitive->fillPattern > 1) if (primitive->type > 1 && primitive->fillPattern > 1)
{ {
m_pXmlWriter->WriteNodeBegin(_T("v:fill"), TRUE ); m_pXmlWriter->WriteNodeBegin(L"v:fill", true );
m_pXmlWriter->WriteAttribute( _T("color2"), FormatUtils::IntToFormattedWideString(primitive->fillBack, L"#%06x").c_str()); m_pXmlWriter->WriteAttribute( L"color2", FormatUtils::IntToFormattedWideString(primitive->fillBack, L"#%06x").c_str());
m_pXmlWriter->WriteAttribute( _T("type"), _T("pattern")); m_pXmlWriter->WriteAttribute( L"type", L"pattern");
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE ); m_pXmlWriter->WriteNodeEnd( L"", true, false );
m_pXmlWriter->WriteNodeEnd( _T("v:fill") ); m_pXmlWriter->WriteNodeEnd( L"v:fill" );
} }
if (primitive->lineStyle > 1) if (primitive->lineStyle > 1)
{ {
m_pXmlWriter->WriteNodeBegin(_T("v:stroke"), TRUE ); m_pXmlWriter->WriteNodeBegin(L"v:stroke", true );
std::wstring strDashStyle = FormatUtils::IntToWideString(primitive->lineStyle) + _T(" 1"); std::wstring strDashStyle = FormatUtils::IntToWideString(primitive->lineStyle) + L" 1";
m_pXmlWriter->WriteAttribute( _T("dashstyle"), strDashStyle.c_str()); m_pXmlWriter->WriteAttribute( L"dashstyle", strDashStyle.c_str());
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE ); m_pXmlWriter->WriteNodeEnd( L"", true, false );
m_pXmlWriter->WriteNodeEnd( _T("v:stroke") ); m_pXmlWriter->WriteNodeEnd( L"v:stroke" );
} }
} }
......
...@@ -50,8 +50,10 @@ ...@@ -50,8 +50,10 @@
int _tmain(int argc, _TCHAR* argv[]) int _tmain(int argc, _TCHAR* argv[])
{ {
if (argc < 2) return 1;
std::wstring sSrcDoc = argv[1]; std::wstring sSrcDoc = argv[1];
std::wstring sDstDocx = argv[2]; std::wstring sDstDocx = argc > 2 ? argv[2] : sSrcDoc + L"-my.docx";
std::wstring outputDir = FileSystem::Directory::GetFolderPath(sDstDocx); std::wstring outputDir = FileSystem::Directory::GetFolderPath(sDstDocx);
std::wstring dstTempPath = FileSystem::Directory::CreateDirectoryWithUniqueName(outputDir); std::wstring dstTempPath = FileSystem::Directory::CreateDirectoryWithUniqueName(outputDir);
......
...@@ -37,12 +37,21 @@ ...@@ -37,12 +37,21 @@
#include "../../src/ConvertOO2OOX.h" #include "../../src/ConvertOO2OOX.h"
#if defined(_WIN64)
#pragma comment(lib, "../../../build/bin/icu/win_64/icuuc.lib")
#elif defined (_WIN32)
#pragma comment(lib, "../../../build/bin/icu/win_32/icuuc.lib")
#endif
int _tmain(int argc, _TCHAR* argv[]) int _tmain(int argc, _TCHAR* argv[])
{ {
if (argc < 2) return 1;
HRESULT hr = S_OK; HRESULT hr = S_OK;
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
std::wstring srcFileName = argv[1]; std::wstring srcFileName = argv[1];
std::wstring dstPath = argv[2]; std::wstring dstPath = argc > 2 ? argv[2] : sSrcDoc + L"-my.docx"; //xlsx pptx
std::wstring outputDir = FileSystem::Directory::GetFolderPath(dstPath); std::wstring outputDir = FileSystem::Directory::GetFolderPath(dstPath);
std::wstring srcTempPath = FileSystem::Directory::CreateDirectoryWithUniqueName(outputDir); std::wstring srcTempPath = FileSystem::Directory::CreateDirectoryWithUniqueName(outputDir);
......
...@@ -345,10 +345,6 @@ ...@@ -345,10 +345,6 @@
/> />
</FileConfiguration> </FileConfiguration>
</File> </File>
<File
RelativePath="..\..\..\Common\3dParty\icu\win_32\lib\icuuc.lib"
>
</File>
<File <File
RelativePath="..\..\..\Common\3dParty\pole\pole.cpp" RelativePath="..\..\..\Common\3dParty\pole\pole.cpp"
> >
......
...@@ -38,10 +38,10 @@ ...@@ -38,10 +38,10 @@
int _tmain(int argc, _TCHAR* argv[]) int _tmain(int argc, _TCHAR* argv[])
{ {
if (argc < 3) return 3; if (argc < 2) return 1;
std::wstring sSrcPpt = argv[1]; std::wstring sSrcPpt = argv[1];
std::wstring sDstPptx = argv[2]; std::wstring sDstPptx = argc > 2 ? argv[2] : sSrcDoc + L"-my.pptx";
std::wstring outputDir = FileSystem::Directory::GetFolderPath(sDstPptx); std::wstring outputDir = FileSystem::Directory::GetFolderPath(sDstPptx);
std::wstring dstTempPath = FileSystem::Directory::CreateDirectoryWithUniqueName(outputDir); std::wstring dstTempPath = FileSystem::Directory::CreateDirectoryWithUniqueName(outputDir);
......
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