diff options
author | Michael Stahl <mstahl@redhat.com> | 2015-06-19 22:57:43 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2015-06-20 11:42:37 +0200 |
commit | 4eacfbdc7bd327a9ca99af0f87d618ad2dd9be7a (patch) | |
tree | db19cc6cd78bf4df1f653741554d6f5a5bc46c48 /sw | |
parent | ec0401d1548bc4097102478f3c5b749366d9f8d8 (diff) |
sw: WW8 export: remove WW6 export, part4: wwFont::mbWrtWW8
Change-Id: I38dfb4c875c4e28155f152b967878c901a1d5b25
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/filter/ww8/wrtw8num.cxx | 4 | ||||
-rw-r--r-- | sw/source/filter/ww8/wrtw8sty.cxx | 67 | ||||
-rw-r--r-- | sw/source/filter/ww8/wrtww8.hxx | 3 |
3 files changed, 25 insertions, 49 deletions
diff --git a/sw/source/filter/ww8/wrtw8num.cxx b/sw/source/filter/ww8/wrtw8num.cxx index 650743addb67..500014e6d234 100644 --- a/sw/source/filter/ww8/wrtw8num.cxx +++ b/sw/source/filter/ww8/wrtw8num.cxx @@ -506,7 +506,7 @@ void MSWordExportBase::AbstractNumberingDefinitions() sFontName = pBulletFont->GetName(); pPseudoFont = new wwFont( sFontName, pBulletFont->GetPitch(), - eFamily, eChrSet, true ); + eFamily, eChrSet); } else pOutSet = &rFormat.GetCharFormat()->GetAttrSet(); @@ -696,7 +696,7 @@ void WW8Export::BuildAnlvBulletBase(WW8_ANLV& rAnlv, sal_uInt8*& rpCh, */ SubstituteBullet(sNumStr, eChrSet, sFontName); wwFont aPseudoFont(sFontName, rFont.GetPitch(), rFont.GetFamily(), - eChrSet, bWrtWW8); + eChrSet); nFontId = m_aFontHelper.GetId(aPseudoFont); *rpCh = static_cast<sal_uInt8>(sNumStr[0]); } diff --git a/sw/source/filter/ww8/wrtw8sty.cxx b/sw/source/filter/ww8/wrtw8sty.cxx index 31cb74805e95..b56a35992d88 100644 --- a/sw/source/filter/ww8/wrtw8sty.cxx +++ b/sw/source/filter/ww8/wrtw8sty.cxx @@ -729,7 +729,8 @@ const SwNumRule* MSWordStyles::GetSwNumRule(sal_uInt16 nId) const // Fonts wwFont::wwFont(const OUString &rFamilyName, FontPitch ePitch, FontFamily eFamily, - rtl_TextEncoding eChrSet, bool bWrtWW8) : mbAlt(false), mbWrtWW8(bWrtWW8), mePitch(ePitch), meFamily(eFamily), meChrSet(eChrSet) + rtl_TextEncoding eChrSet) + : mbAlt(false), mePitch(ePitch), meFamily(eFamily), meChrSet(eChrSet) { FontMapExport aResult(rFamilyName); msFamilyNm = aResult.msPrimary; @@ -743,18 +744,9 @@ wwFont::wwFont(const OUString &rFamilyName, FontPitch ePitch, FontFamily eFamily memset(maWW8_FFN, 0, sizeof(maWW8_FFN)); - if (bWrtWW8) - { - maWW8_FFN[0] = (sal_uInt8)( 6 - 1 + 0x22 + ( 2 * ( 1 + msFamilyNm.getLength() ) )); - if (mbAlt) - maWW8_FFN[0] = static_cast< sal_uInt8 >(maWW8_FFN[0] + 2 * ( 1 + msAltNm.getLength())); - } - else - { - maWW8_FFN[0] = (sal_uInt8)( 6 - 1 + 1 + msFamilyNm.getLength() ); - if (mbAlt) - maWW8_FFN[0] = static_cast< sal_uInt8 >(maWW8_FFN[0] + 1 + msAltNm.getLength()); - } + maWW8_FFN[0] = (sal_uInt8)( 6 - 1 + 0x22 + ( 2 * ( 1 + msFamilyNm.getLength() ) )); + if (mbAlt) + maWW8_FFN[0] = static_cast< sal_uInt8 >(maWW8_FFN[0] + 2 * ( 1 + msAltNm.getLength())); sal_uInt8 aB = 0; switch(ePitch) @@ -799,9 +791,7 @@ wwFont::wwFont(const OUString &rFamilyName, FontPitch ePitch, FontFamily eFamily //to SHIFTJIS presumably to capture that it's a multi-byte encoding font //but Word95 doesn't do this, and sets it to 0 (ANSI), so we should do the //same - maWW8_FFN[4] = bWrtWW8 ? - sw::ms::rtl_TextEncodingToWinCharset(eChrSet) : - rtl_getBestWindowsCharsetFromTextEncoding(eChrSet); + maWW8_FFN[4] = sw::ms::rtl_TextEncodingToWinCharset(eChrSet); if (mbAlt) maWW8_FFN[5] = static_cast< sal_uInt8 >(msFamilyNm.getLength() + 1); @@ -810,27 +800,14 @@ wwFont::wwFont(const OUString &rFamilyName, FontPitch ePitch, FontFamily eFamily bool wwFont::Write(SvStream *pTableStrm) const { pTableStrm->Write(maWW8_FFN, sizeof(maWW8_FFN)); // fixed part - if (mbWrtWW8) - { - // ab Ver8 sind folgende beiden Felder eingeschoben, - // werden von uns ignoriert. - //char panose[ 10 ]; // 0x6 PANOSE - //char fs[ 24 ]; // 0x10 FONTSIGNATURE - SwWW8Writer::FillCount(*pTableStrm, 0x22); - SwWW8Writer::WriteString16(*pTableStrm, msFamilyNm, true); - if (mbAlt) - SwWW8Writer::WriteString16(*pTableStrm, msAltNm, true); - } - else - { - SwWW8Writer::WriteString8(*pTableStrm, msFamilyNm, true, - RTL_TEXTENCODING_MS_1252); - if (mbAlt) - { - SwWW8Writer::WriteString8( *pTableStrm, msAltNm, true, - RTL_TEXTENCODING_MS_1252); - } - } + // ab Ver8 sind folgende beiden Felder eingeschoben, + // werden von uns ignoriert. + //char panose[ 10 ]; // 0x6 PANOSE + //char fs[ 24 ]; // 0x10 FONTSIGNATURE + SwWW8Writer::FillCount(*pTableStrm, 0x22); + SwWW8Writer::WriteString16(*pTableStrm, msFamilyNm, true); + if (mbAlt) + SwWW8Writer::WriteString16(*pTableStrm, msAltNm, true); return true; } @@ -894,24 +871,24 @@ sal_uInt16 wwFontHelper::GetId(const wwFont &rFont) void wwFontHelper::InitFontTable(const SwDoc& rDoc) { GetId(wwFont(OUString("Times New Roman"), PITCH_VARIABLE, - FAMILY_ROMAN, RTL_TEXTENCODING_MS_1252, true)); + FAMILY_ROMAN, RTL_TEXTENCODING_MS_1252)); GetId(wwFont(OUString("Symbol"), PITCH_VARIABLE, FAMILY_ROMAN, - RTL_TEXTENCODING_SYMBOL, true)); + RTL_TEXTENCODING_SYMBOL)); GetId(wwFont(OUString("Arial"), PITCH_VARIABLE, FAMILY_SWISS, - RTL_TEXTENCODING_MS_1252, true)); + RTL_TEXTENCODING_MS_1252)); const SvxFontItem* pFont = static_cast<const SvxFontItem*>(GetDfltAttr(RES_CHRATR_FONT)); GetId(wwFont(pFont->GetFamilyName(), pFont->GetPitch(), - pFont->GetFamily(), pFont->GetCharSet(), true)); + pFont->GetFamily(), pFont->GetCharSet())); const SfxItemPool& rPool = rDoc.GetAttrPool(); if (0 != (pFont = static_cast<const SvxFontItem*>(rPool.GetPoolDefaultItem(RES_CHRATR_FONT)))) { GetId(wwFont(pFont->GetFamilyName(), pFont->GetPitch(), - pFont->GetFamily(), pFont->GetCharSet(), true)); + pFont->GetFamily(), pFont->GetCharSet())); } if (!bLoadAllFonts) @@ -927,7 +904,7 @@ void wwFontHelper::InitFontTable(const SwDoc& rDoc) if (0 != pFont) { GetId(wwFont(pFont->GetFamilyName(), pFont->GetPitch(), - pFont->GetFamily(), pFont->GetCharSet(), true)); + pFont->GetFamily(), pFont->GetCharSet())); } } } @@ -936,14 +913,14 @@ void wwFontHelper::InitFontTable(const SwDoc& rDoc) sal_uInt16 wwFontHelper::GetId(const vcl::Font& rFont) { wwFont aFont(rFont.GetName(), rFont.GetPitch(), rFont.GetFamily(), - rFont.GetCharSet(), true); + rFont.GetCharSet()); return GetId(aFont); } sal_uInt16 wwFontHelper::GetId(const SvxFontItem& rFont) { wwFont aFont(rFont.GetFamilyName(), rFont.GetPitch(), rFont.GetFamily(), - rFont.GetCharSet(), true); + rFont.GetCharSet()); return GetId(aFont); } diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx index 2c0c6834eef8..4fab6dd26627 100644 --- a/sw/source/filter/ww8/wrtww8.hxx +++ b/sw/source/filter/ww8/wrtww8.hxx @@ -296,13 +296,12 @@ private: OUString msFamilyNm; OUString msAltNm; bool mbAlt; - bool mbWrtWW8; FontPitch mePitch; FontFamily meFamily; rtl_TextEncoding meChrSet; public: wwFont( const OUString &rFamilyName, FontPitch ePitch, FontFamily eFamily, - rtl_TextEncoding eChrSet, bool bWrtWW8 ); + rtl_TextEncoding eChrSet); bool Write( SvStream *pTableStram ) const; void WriteDocx( DocxAttributeOutput* rAttrOutput ) const; void WriteRtf( const RtfAttributeOutput* rAttrOutput ) const; |