Author: hdu Date: Thu Jan 3 16:04:38 2013 New Revision: 1428424 URL: http://svn.apache.org/viewvc?rev=1428424&view=rev Log: #i68503# a SwHolePortion must not be decorated for a consistent visual appearance
Modified: openoffice/trunk/main/sw/source/core/text/portxt.cxx Modified: openoffice/trunk/main/sw/source/core/text/portxt.cxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sw/source/core/text/portxt.cxx?rev=1428424&r1=1428423&r2=1428424&view=diff ============================================================================== --- openoffice/trunk/main/sw/source/core/text/portxt.cxx (original) +++ openoffice/trunk/main/sw/source/core/text/portxt.cxx Thu Jan 3 16:04:38 2013 @@ -49,6 +49,7 @@ #include <pam.hxx> #include <doc.hxx> #include <xmloff/odffields.hxx> +#include <vcl/pdfextoutdevdata.hxx> #if OSL_DEBUG_LEVEL > 1 const sal_Char *GetLangName( const MSHORT nLang ); @@ -739,13 +740,34 @@ SwLinePortion *SwHolePortion::Compress() void SwHolePortion::Paint( const SwTxtPaintInfo &rInf ) const { - // --> FME 2004-06-24 #i16816# tagged pdf support - if( rInf.GetVsh() && rInf.GetVsh()->GetViewOptions()->IsPDFExport() ) - { - const XubString aTxt( ' ' ); - rInf.DrawText( aTxt, *this, 0, 1, false ); + if( !rInf.GetOut() ) + return; + + // #i16816# export stuff only needed for tagged pdf support + const vcl::PDFExtOutDevData* pPDFExt = dynamic_cast<const vcl::PDFExtOutDevData*>( rInf.GetOut()->GetExtOutDevData() ); + if( !pPDFExt || !pPDFExt->GetIsExportTaggedPDF()) + return; + + // #i68503# the hole must have no decoration for a consistent visual appearance + const SwFont* pOrigFont = rInf.GetFont(); + SwFont* pHoleFont = NULL; + SwFontSave* pFontSave = NULL; + if( pOrigFont->GetUnderline() != UNDERLINE_NONE + || pOrigFont->GetOverline() != UNDERLINE_NONE + || pOrigFont->GetStrikeout() != STRIKEOUT_NONE ) + { + pHoleFont = new SwFont( *pOrigFont ); + pHoleFont->SetUnderline( UNDERLINE_NONE ); + pHoleFont->SetOverline( UNDERLINE_NONE ); + pHoleFont->SetStrikeout( STRIKEOUT_NONE ); + pFontSave = new SwFontSave( rInf, pHoleFont ); } - // <-- + + const XubString aTxt( ' ' ); + rInf.DrawText( aTxt, *this, 0, 1, false ); + + delete pFontSave; + delete pHoleFont; } /*************************************************************************