summaryrefslogtreecommitdiff
path: root/vcl/source/gdi/pdfwriter_impl.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/source/gdi/pdfwriter_impl.cxx')
-rw-r--r--vcl/source/gdi/pdfwriter_impl.cxx1082
1 files changed, 541 insertions, 541 deletions
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index 8cade3431ee1..2285fed41bdf 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -107,11 +107,11 @@ void doTestCode()
rtl::OUString aTestFile( RTL_CONSTASCII_USTRINGPARAM( "file://" ) );
aTestFile += rtl::OUString( pHome, strlen( pHome ), RTL_TEXTENCODING_MS_1252 );
aTestFile += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/pdf_export_test.pdf" ) );
-
+
PDFWriter::PDFWriterContext aContext;
- aContext.URL = aTestFile;
- aContext.Version = PDFWriter::PDF_1_4;
- aContext.Tagged = true;
+ aContext.URL = aTestFile;
+ aContext.Version = PDFWriter::PDF_1_4;
+ aContext.Tagged = true;
aContext.InitialPage = 2;
PDFWriter aWriter( aContext );
@@ -212,7 +212,7 @@ void doTestCode()
aWriter.BeginStructureElement( PDFWriter::Caption );
aWriter.DrawText( Point( 4500, 9000 ), String( RTL_CONSTASCII_USTRINGPARAM( "Some drawing stuff inside the structure" ) ) );
aWriter.EndStructureElement();
-
+
// test clipping
basegfx::B2DPolyPolygon aClip;
basegfx::B2DPolygon aClipPoly;
@@ -223,7 +223,7 @@ void doTestCode()
aClipPoly.setClosed( true );
//aClipPoly.flip();
aClip.append( aClipPoly );
-
+
aWriter.Push( PUSH_CLIPREGION | PUSH_FILLCOLOR );
aWriter.SetClipRegion( aClip );
aWriter.DrawEllipse( Rectangle( Point( 4500, 9600 ), Size( 12000, 3000 ) ) );
@@ -680,7 +680,7 @@ void PDFWriterImpl::createWidgetFieldName( sal_Int32 i_nWidgetIndex, const PDFWr
appendHex( (sal_Int8)pStr[i], aBuffer );
}
}
-
+
OString aFullName( aBuffer.makeStringAndClear() );
/* #i82785# create hierarchical fields down to the for each dot in i_rName */
@@ -753,7 +753,7 @@ void PDFWriterImpl::createWidgetFieldName( sal_Int32 i_nWidgetIndex, const PDFWr
}
}
} while( nTokenIndex != -1 );
-
+
// insert widget into its hierarchy field
if( aDomain.getLength() )
{
@@ -769,7 +769,7 @@ void PDFWriterImpl::createWidgetFieldName( sal_Int32 i_nWidgetIndex, const PDFWr
}
}
}
-
+
if( aPartialName.getLength() == 0 )
{
// how funny, an empty field name
@@ -785,7 +785,7 @@ void PDFWriterImpl::createWidgetFieldName( sal_Int32 i_nWidgetIndex, const PDFWr
if( ! m_aContext.AllowDuplicateFieldNames )
{
std::hash_map<OString, sal_Int32, OStringHash>::iterator it = m_aFieldNameMap.find( aFullName );
-
+
if( it != m_aFieldNameMap.end() ) // not unique
{
std::hash_map< OString, sal_Int32, OStringHash >::const_iterator check_it;
@@ -823,11 +823,11 @@ static void appendFixedInt( sal_Int32 nValue, OStringBuffer& rBuffer, sal_Int32
while( nDiv-- )
nFactor *= 10;
- sal_Int32 nInt = nValue / nFactor;
+ sal_Int32 nInt = nValue / nFactor;
rBuffer.append( nInt );
if( nFactor > 1 )
{
- sal_Int32 nDecimal = nValue % nFactor;
+ sal_Int32 nDecimal = nValue % nFactor;
if( nDecimal )
{
rBuffer.append( '.' );
@@ -918,7 +918,7 @@ static void appendNonStrokingColor( const Color& rColor, OStringBuffer& rBuffer
// TODO: use basegfx matrix class instead or derive from it
namespace vcl // TODO: use anonymous namespace to keep this class local
{
-/* for sparse matrices of the form (2D linear transformations)
+/* for sparse matrices of the form (2D linear transformations)
* f[0] f[1] 0
* f[2] f[3] 0
* f[4] f[5] 1
@@ -1374,7 +1374,7 @@ void PDFWriterImpl::PDFPage::appendPoint( const Point& rPoint, OStringBuffer& rB
m_pWriter->getReferenceDevice(),
rPoint ) );
- sal_Int32 nValue = aPoint.X();
+ sal_Int32 nValue = aPoint.X();
if( bNeg )
nValue = -nValue;
@@ -1382,7 +1382,7 @@ void PDFWriterImpl::PDFPage::appendPoint( const Point& rPoint, OStringBuffer& rB
rBuffer.append( ' ' );
- nValue = pointToPixel(getHeight()) - aPoint.Y();
+ nValue = pointToPixel(getHeight()) - aPoint.Y();
if( bNeg )
nValue = -nValue;
@@ -1391,13 +1391,13 @@ void PDFWriterImpl::PDFPage::appendPoint( const Point& rPoint, OStringBuffer& rB
void PDFWriterImpl::PDFPage::appendPixelPoint( const basegfx::B2DPoint& rPoint, OStringBuffer& rBuffer ) const
{
- double fValue = pixelToPoint(rPoint.getX());
+ double fValue = pixelToPoint(rPoint.getX());
appendDouble( fValue, rBuffer, nLog10Divisor );
rBuffer.append( ' ' );
- fValue = double(getHeight()) - pixelToPoint(rPoint.getY());
+ fValue = double(getHeight()) - pixelToPoint(rPoint.getY());
appendDouble( fValue, rBuffer, nLog10Divisor );
}
@@ -1423,10 +1423,10 @@ void PDFWriterImpl::PDFPage::convertRect( Rectangle& rRect ) const
m_pWriter->m_aMapMode,
m_pWriter->getReferenceDevice(),
rRect.GetSize() );
- rRect.Left() = aLL.X();
- rRect.Right() = aLL.X() + aSize.Width();
- rRect.Top() = pointToPixel(getHeight()) - aLL.Y();
- rRect.Bottom() = rRect.Top() + aSize.Height();
+ rRect.Left() = aLL.X();
+ rRect.Right() = aLL.X() + aSize.Width();
+ rRect.Top() = pointToPixel(getHeight()) - aLL.Y();
+ rRect.Bottom() = rRect.Top() + aSize.Height();
}
void PDFWriterImpl::PDFPage::appendPolygon( const Polygon& rPoly, OStringBuffer& rBuffer, bool bClose ) const
@@ -1505,7 +1505,7 @@ void PDFWriterImpl::PDFPage::appendPolygon( const basegfx::B2DPolygon& rPoly, OS
if( i != nPoints || aPoly.isClosed() )
{
sal_uInt32 nCurPoint = i % nPoints;
- sal_uInt32 nLastPoint = i-1;
+ sal_uInt32 nLastPoint = i-1;
basegfx::B2DPoint aPoint( aPoly.getB2DPoint( nCurPoint ) );
if( aPoly.isNextControlPointUsed( nLastPoint ) &&
aPoly.isPrevControlPointUsed( nCurPoint ) )
@@ -1588,7 +1588,7 @@ void PDFWriterImpl::PDFPage::appendMappedLength( double fLength, OStringBuffer&
Size aSize( lcl_convert( m_pWriter->m_aGraphicsStack.front().m_aMapMode,
m_pWriter->m_aMapMode,
m_pWriter->getReferenceDevice(),
- Size( 1000, 1000 ) ) );
+ Size( 1000, 1000 ) ) );
if( pOutLength )
*pOutLength = (sal_Int32)(fLength*(double)(bVertical ? aSize.Height() : aSize.Width())/1000.0);
fLength *= pixelToPoint((double)(bVertical ? aSize.Height() : aSize.Width()) / 1000.0);
@@ -1726,16 +1726,16 @@ PDFWriterImpl::PDFWriterImpl( const PDFWriter::PDFWriterContext& rContext )
#endif
m_aContext = rContext;
m_aStructure.push_back( PDFStructureElement() );
- m_aStructure[0].m_nOwnElement = 0;
- m_aStructure[0].m_nParentElement = 0;
+ m_aStructure[0].m_nOwnElement = 0;
+ m_aStructure[0].m_nParentElement = 0;
Font aFont;
aFont.SetName( String( RTL_CONSTASCII_USTRINGPARAM( "Times" ) ) );
aFont.SetSize( Size( 0, 12 ) );
GraphicsState aState;
- aState.m_aMapMode = m_aMapMode;
- aState.m_aFont = aFont;
+ aState.m_aMapMode = m_aMapMode;
+ aState.m_aFont = aFont;
m_aGraphicsStack.push_front( aState );
oslFileError aError = osl_openFile( m_aContext.URL.pData, &m_aFile, osl_File_OpenFlag_Write | osl_File_OpenFlag_Create );
@@ -1808,12 +1808,12 @@ PDFWriterImpl::~PDFWriterImpl()
void PDFWriterImpl::setDocInfo( const PDFDocInfo& rInfo )
{
- m_aDocInfo.Title = rInfo.Title;
- m_aDocInfo.Author = rInfo.Author;
- m_aDocInfo.Subject = rInfo.Subject;
- m_aDocInfo.Keywords = rInfo.Keywords;
- m_aDocInfo.Creator = rInfo.Creator;
- m_aDocInfo.Producer = rInfo.Producer;
+ m_aDocInfo.Title = rInfo.Title;
+ m_aDocInfo.Author = rInfo.Author;
+ m_aDocInfo.Subject = rInfo.Subject;
+ m_aDocInfo.Keywords = rInfo.Keywords;
+ m_aDocInfo.Creator = rInfo.Creator;
+ m_aDocInfo.Producer = rInfo.Producer;
//build the document id
rtl::OString aInfoValuesOut;
@@ -2226,20 +2226,20 @@ void PDFWriterImpl::getFontMetric( ImplFontSelectData* pSelect, ImplFontMetricDa
return;
const BuiltinFont* pBuiltinFont = pFD->GetBuiltinFont();
- pMetric->mnOrientation = sal::static_int_cast<short>(pSelect->mnOrientation);
- pMetric->meFamily = pBuiltinFont->m_eFamily;
- pMetric->mePitch = pBuiltinFont->m_ePitch;
- pMetric->meWeight = pBuiltinFont->m_eWeight;
- pMetric->meItalic = pBuiltinFont->m_eItalic;
- pMetric->mbSymbolFlag = pFD->IsSymbolFont();
- pMetric->mnWidth = pSelect->mnHeight;
- pMetric->mnAscent = ( pSelect->mnHeight * +pBuiltinFont->m_nAscent + 500 ) / 1000;
- pMetric->mnDescent = ( pSelect->mnHeight * -pBuiltinFont->m_nDescent + 500 ) / 1000;
- pMetric->mnIntLeading = 0;
- pMetric->mnExtLeading = 0;
- pMetric->mnSlant = 0;
- pMetric->mbScalableFont = true;
- pMetric->mbDevice = true;
+ pMetric->mnOrientation = sal::static_int_cast<short>(pSelect->mnOrientation);
+ pMetric->meFamily = pBuiltinFont->m_eFamily;
+ pMetric->mePitch = pBuiltinFont->m_ePitch;
+ pMetric->meWeight = pBuiltinFont->m_eWeight;
+ pMetric->meItalic = pBuiltinFont->m_eItalic;
+ pMetric->mbSymbolFlag = pFD->IsSymbolFont();
+ pMetric->mnWidth = pSelect->mnHeight;
+ pMetric->mnAscent = ( pSelect->mnHeight * +pBuiltinFont->m_nAscent + 500 ) / 1000;
+ pMetric->mnDescent = ( pSelect->mnHeight * -pBuiltinFont->m_nDescent + 500 ) / 1000;
+ pMetric->mnIntLeading = 0;
+ pMetric->mnExtLeading = 0;
+ pMetric->mnSlant = 0;
+ pMetric->mbScalableFont = true;
+ pMetric->mbDevice = true;
}
// -----------------------------------------------------------------------
@@ -2512,24 +2512,24 @@ const sal_Char* PDFWriterImpl::getAttributeTag( PDFWriter::StructAttribute eAttr
// fill maps once
if( aAttributeStrings.empty() )
{
- aAttributeStrings[ PDFWriter::Placement ] = "Placement";
- aAttributeStrings[ PDFWriter::WritingMode ] = "WritingMode";
- aAttributeStrings[ PDFWriter::SpaceBefore ] = "SpaceBefore";
- aAttributeStrings[ PDFWriter::SpaceAfter ] = "SpaceAfter";
- aAttributeStrings[ PDFWriter::StartIndent ] = "StartIndent";
- aAttributeStrings[ PDFWriter::EndIndent ] = "EndIndent";
- aAttributeStrings[ PDFWriter::TextIndent ] = "TextIndent";
- aAttributeStrings[ PDFWriter::TextAlign ] = "TextAlign";
- aAttributeStrings[ PDFWriter::Width ] = "Width";
- aAttributeStrings[ PDFWriter::Height ] = "Height";
- aAttributeStrings[ PDFWriter::BlockAlign ] = "BlockAlign";
- aAttributeStrings[ PDFWriter::InlineAlign ] = "InlineAlign";
- aAttributeStrings[ PDFWriter::LineHeight ] = "LineHeight";
- aAttributeStrings[ PDFWriter::BaselineShift ] = "BaselineShift";
- aAttributeStrings[ PDFWriter::TextDecorationType ] = "TextDecorationType";
- aAttributeStrings[ PDFWriter::ListNumbering ] = "ListNumbering";
- aAttributeStrings[ PDFWriter::RowSpan ] = "RowSpan";
- aAttributeStrings[ PDFWriter::ColSpan ] = "ColSpan";
+ aAttributeStrings[ PDFWriter::Placement ] = "Placement";
+ aAttributeStrings[ PDFWriter::WritingMode ] = "WritingMode";
+ aAttributeStrings[ PDFWriter::SpaceBefore ] = "SpaceBefore";
+ aAttributeStrings[ PDFWriter::SpaceAfter ] = "SpaceAfter";
+ aAttributeStrings[ PDFWriter::StartIndent ] = "StartIndent";
+ aAttributeStrings[ PDFWriter::EndIndent ] = "EndIndent";
+ aAttributeStrings[ PDFWriter::TextIndent ] = "TextIndent";
+ aAttributeStrings[ PDFWriter::TextAlign ] = "TextAlign";
+ aAttributeStrings[ PDFWriter::Width ] = "Width";
+ aAttributeStrings[ PDFWriter::Height ] = "Height";
+ aAttributeStrings[ PDFWriter::BlockAlign ] = "BlockAlign";
+ aAttributeStrings[ PDFWriter::InlineAlign ] = "InlineAlign";
+ aAttributeStrings[ PDFWriter::LineHeight ] = "LineHeight";
+ aAttributeStrings[ PDFWriter::BaselineShift ] = "BaselineShift";
+ aAttributeStrings[ PDFWriter::TextDecorationType ] = "TextDecorationType";
+ aAttributeStrings[ PDFWriter::ListNumbering ] = "ListNumbering";
+ aAttributeStrings[ PDFWriter::RowSpan ] = "RowSpan";
+ aAttributeStrings[ PDFWriter::ColSpan ] = "ColSpan";
aAttributeStrings[ PDFWriter::LinkAnnotation ] = "LinkAnnotation";
}
@@ -2550,32 +2550,32 @@ const sal_Char* PDFWriterImpl::getAttributeValueTag( PDFWriter::StructAttributeV
if( aValueStrings.empty() )
{
- aValueStrings[ PDFWriter::NONE ] = "None";
- aValueStrings[ PDFWriter::Block ] = "Block";
- aValueStrings[ PDFWriter::Inline ] = "Inline";
- aValueStrings[ PDFWriter::Before ] = "Before";
- aValueStrings[ PDFWriter::After ] = "After";
- aValueStrings[ PDFWriter::Start ] = "Start";
- aValueStrings[ PDFWriter::End ] = "End";
- aValueStrings[ PDFWriter::LrTb ] = "LrTb";
- aValueStrings[ PDFWriter::RlTb ] = "RlTb";
- aValueStrings[ PDFWriter::TbRl ] = "TbRl";
- aValueStrings[ PDFWriter::Center ] = "Center";
- aValueStrings[ PDFWriter::Justify ] = "Justify";
- aValueStrings[ PDFWriter::Auto ] = "Auto";
- aValueStrings[ PDFWriter::Middle ] = "Middle";
- aValueStrings[ PDFWriter::Normal ] = "Normal";
- aValueStrings[ PDFWriter::Underline ] = "Underline";
- aValueStrings[ PDFWriter::Overline ] = "Overline";
- aValueStrings[ PDFWriter::LineThrough ] = "LineThrough";
- aValueStrings[ PDFWriter::Disc ] = "Disc";
- aValueStrings[ PDFWriter::Circle ] = "Circle";
- aValueStrings[ PDFWriter::Square ] = "Square";
- aValueStrings[ PDFWriter::Decimal ] = "Decimal";
- aValueStrings[ PDFWriter::UpperRoman ] = "UpperRoman";
- aValueStrings[ PDFWriter::LowerRoman ] = "LowerRoman";
- aValueStrings[ PDFWriter::UpperAlpha ] = "UpperAlpha";
- aValueStrings[ PDFWriter::LowerAlpha ] = "LowerAlpha";
+ aValueStrings[ PDFWriter::NONE ] = "None";
+ aValueStrings[ PDFWriter::Block ] = "Block";
+ aValueStrings[ PDFWriter::Inline ] = "Inline";
+ aValueStrings[ PDFWriter::Before ] = "Before";
+ aValueStrings[ PDFWriter::After ] = "After";
+ aValueStrings[ PDFWriter::Start ] = "Start";
+ aValueStrings[ PDFWriter::End ] = "End";
+ aValueStrings[ PDFWriter::LrTb ] = "LrTb";
+ aValueStrings[ PDFWriter::RlTb ] = "RlTb";
+ aValueStrings[ PDFWriter::TbRl ] = "TbRl";
+ aValueStrings[ PDFWriter::Center ] = "Center";
+ aValueStrings[ PDFWriter::Justify ] = "Justify";
+ aValueStrings[ PDFWriter::Auto ] = "Auto";
+ aValueStrings[ PDFWriter::Middle ] = "Middle";
+ aValueStrings[ PDFWriter::Normal ] = "Normal";
+ aValueStrings[ PDFWriter::Underline ] = "Underline";
+ aValueStrings[ PDFWriter::Overline ] = "Overline";
+ aValueStrings[ PDFWriter::LineThrough ] = "LineThrough";
+ aValueStrings[ PDFWriter::Disc ] = "Disc";
+ aValueStrings[ PDFWriter::Circle ] = "Circle";
+ aValueStrings[ PDFWriter::Square ] = "Square";
+ aValueStrings[ PDFWriter::Decimal ] = "Decimal";
+ aValueStrings[ PDFWriter::UpperRoman ] = "UpperRoman";
+ aValueStrings[ PDFWriter::LowerRoman ] = "LowerRoman";
+ aValueStrings[ PDFWriter::UpperAlpha ] = "UpperAlpha";
+ aValueStrings[ PDFWriter::LowerAlpha ] = "LowerAlpha";
}
std::map< PDFWriter::StructAttributeValue, const char* >::const_iterator it =
@@ -3071,19 +3071,19 @@ std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitSystemFont( const ImplFontDa
Int32Vector aGlyphWidths;
Ucs2UIntMap aUnicodeMap;
m_pReferenceDevice->mpGraphics->GetGlyphWidths( pFont, false, aGlyphWidths, aUnicodeMap );
-
+
OUString aTmpName;
osl_createTempFile( NULL, NULL, &aTmpName.pData );
sal_Int32 pGlyphIDs[ 256 ];
sal_uInt8 pEncoding[ 256 ];
sal_Ucs pUnicodes[ 256 ];
sal_Int32 pDuWidths[ 256 ];
-
+
memset( pGlyphIDs, 0, sizeof( pGlyphIDs ) );
memset( pEncoding, 0, sizeof( pEncoding ) );
memset( pUnicodes, 0, sizeof( pUnicodes ) );
memset( pDuWidths, 0, sizeof( pDuWidths ) );
-
+
for( sal_Ucs c = 32; c < 256; c++ )
{
pUnicodes[c] = c;
@@ -3092,7 +3092,7 @@ std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitSystemFont( const ImplFontDa
if( aUnicodeMap.find( c ) != aUnicodeMap.end() )
pWidths[ c ] = aGlyphWidths[ aUnicodeMap[ c ] ];
}
-
+
m_pReferenceDevice->mpGraphics->CreateFontSubset( aTmpName, pFont, pGlyphIDs, pEncoding, pDuWidths, 256, aInfo );
osl_removeFile( aTmpName.pData );
}
@@ -3132,12 +3132,12 @@ std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitSystemFont( const ImplFontDa
aLine.append( " 0 R>>\n"
"endobj\n\n" );
writeBuffer( aLine.getStr(), aLine.getLength() );
-
- nFontObject = nObject;
+
+ nFontObject = nObject;
aRet[ rEmbed.m_nNormalFontID ] = nObject;
}
}
-
+
return aRet;
}
@@ -3218,7 +3218,7 @@ std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitEmbeddedFont( const ImplFont
}
}
}
-
+
FontSubsetInfo aInfo;
sal_Int32 pWidths[256];
const unsigned char* pFontData = NULL;
@@ -3241,13 +3241,13 @@ std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitEmbeddedFont( const ImplFont
if( pFontData[nIndex+1] == 0x03 )
break;
sal_Int32 nBytes =
- ((sal_Int32)pFontData[nIndex+2]) |
- ((sal_Int32)pFontData[nIndex+3]) << 8 |
- ((sal_Int32)pFontData[nIndex+4]) << 16 |
+ ((sal_Int32)pFontData[nIndex+2]) |
+ ((sal_Int32)pFontData[nIndex+3]) << 8 |
+ ((sal_Int32)pFontData[nIndex+4]) << 16 |
((sal_Int32)pFontData[nIndex+5]) << 24;
nIndex += nBytes+6;
}
-
+
// search for eexec
// TODO: use getPfbSegmentLengths() if possible to skip the search thingies below
nIndex = 0;
@@ -3257,7 +3257,7 @@ std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitEmbeddedFont( const ImplFont
do
{
while( nIndex < nFontLen-4 &&
- ( pFontData[nIndex] != 'e' ||
+ ( pFontData[nIndex] != 'e' ||
pFontData[nIndex+1] != 'e' ||
pFontData[nIndex+2] != 'x' ||
pFontData[nIndex+3] != 'e' ||
@@ -3272,7 +3272,7 @@ std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitEmbeddedFont( const ImplFont
// this should end the ascii part
if( nIndex > nFontLen-5 )
throw FontException();
-
+
nEndAsciiIndex = nIndex+4;
// now count backwards until we can account for 512 '0'
// which is the endmarker of the (hopefully) binary data
@@ -3290,19 +3290,19 @@ std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitEmbeddedFont( const ImplFont
// if all fonts complied
if( pFontData[nIndex] == '0' )
nFound++;
- else if( nFound > 0 &&
- pFontData[nIndex] != '\r' &&
- pFontData[nIndex] != '\t' &&
- pFontData[nIndex] != '\n' &&
+ else if( nFound > 0 &&
+ pFontData[nIndex] != '\r' &&
+ pFontData[nIndex] != '\t' &&
+ pFontData[nIndex] != '\n' &&
pFontData[nIndex] != ' ' )
break;
}
nIndex--;
}
-
+
if( nIndex < 1 || nIndex <= nEndAsciiIndex )
throw FontException();
-
+
// nLength3 is the rest of the file - excluding any section headers
// nIndex now points to the first of the 512 '0' characters marking the
// fixed content portion
@@ -3323,7 +3323,7 @@ std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitEmbeddedFont( const ImplFont
}
}
}
-
+
// there may be whitespace to ignore before the 512 '0'
while( pFontData[nIndex] == '\r' || pFontData[nIndex] == '\n' )
{
@@ -3337,7 +3337,7 @@ std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitEmbeddedFont( const ImplFont
}
}
nEndBinaryIndex = nIndex;
-
+
// search for beginning of binary section
nBeginBinaryIndex = nEndAsciiIndex;
do
@@ -3346,10 +3346,10 @@ std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitEmbeddedFont( const ImplFont
for( it = aSections.begin(); it != aSections.end() && (nBeginBinaryIndex < *it || nBeginBinaryIndex > ((*it) + 5) ); ++it )
;
} while( nBeginBinaryIndex < nEndBinaryIndex &&
- ( pFontData[nBeginBinaryIndex] == '\r' ||
- pFontData[nBeginBinaryIndex] == '\n' ||
+ ( pFontData[nBeginBinaryIndex] == '\r' ||
+ pFontData[nBeginBinaryIndex] == '\n' ||
it != aSections.end() ) );
-
+
// it seems to be vital to copy the exact whitespace between binary data
// and eexec, else a invalid font results. so make nEndAsciiIndex
// always immediate in front of nBeginBinaryIndex
@@ -3358,11 +3358,11 @@ std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitEmbeddedFont( const ImplFont
;
if( it != aSections.end() )
nEndAsciiIndex = (*it)-1;
-
+
nLength1 = nEndAsciiIndex+1; // including the last character
for( it = aSections.begin(); it != aSections.end() && *it < nEndAsciiIndex; ++it )
nLength1 -= 6; // decrease by pfb section size
-
+
// if the first four bytes are all ascii hex characters, then binary data
// has to be converted to real binary data
for( nIndex = 0; nIndex < 4 &&
@@ -3405,7 +3405,7 @@ std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitEmbeddedFont( const ImplFont
DBG_ASSERT( !(nLength2 & 1), "uneven number of hex chars in binary pfa section" );
nLength2 /= 2;
}
-
+
// now we can actually write the font stream !
#if OSL_DEBUG_LEVEL > 1
{
@@ -3436,13 +3436,13 @@ std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitEmbeddedFont( const ImplFont
"stream\n" );
if( !writeBuffer( aLine.getStr(), aLine.getLength() ) )
throw FontException();
-
+
sal_uInt64 nBeginStreamPos = 0;
osl_getFilePos( m_aFile, &nBeginStreamPos );
-
+
beginCompression();
checkAndEnableStreamEncryption( nStreamObject );
-
+
// write ascii section
if( aSections.begin() == aSections.end() )
{
@@ -3466,7 +3466,7 @@ std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitEmbeddedFont( const ImplFont
if( ! writeBuffer( pFontData+nIndex, nEndAsciiIndex-nIndex+1 ) )
throw FontException();
}
-
+
// write binary section
if( ! bConvertHexData )
{
@@ -3501,7 +3501,7 @@ std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitEmbeddedFont( const ImplFont
boost::shared_array<unsigned char> pWriteBuffer( new unsigned char[ nLength2 ] );
rtl_zeroMemory( pWriteBuffer.get(), nLength2 );
int nWriteIndex = 0;
-
+
int nNextSectionIndex = 0;
for( it = aSections.begin(); it != aSections.end() && *it < nBeginBinaryIndex; ++it )
;
@@ -3561,17 +3561,17 @@ std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitEmbeddedFont( const ImplFont
}
endCompression();
disableStreamEncryption();
-
-
+
+
sal_uInt64 nEndStreamPos = 0;
osl_getFilePos( m_aFile, &nEndStreamPos );
-
+
// and finally close the stream
aLine.setLength( 0 );
aLine.append( "\nendstream\nendobj\n\n" );
if( ! writeBuffer( aLine.getStr(), aLine.getLength() ) )
throw FontException();
-
+
// write stream length object
aLine.setLength( 0 );
if( ! updateObject( nStreamLengthObject ) )
@@ -3597,21 +3597,21 @@ std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitEmbeddedFont( const ImplFont
aErrorComment.append( sal_Int32(pFont->GetWeight()) );
emitComment( aErrorComment.getStr() );
}
-
+
if( nStreamObject )
// write font descriptor
nFontDescriptor = emitFontDescriptor( pFont, aInfo, 0, nStreamObject );
-
+
if( nFontDescriptor )
{
if( pEncoding )
nToUnicodeStream = createToUnicodeCMap( nEncoding, &aUnicodes[0], pUnicodesPerGlyph, pEncToUnicodeIndex, SAL_N_ELEMENTS(nEncoding) );
-
+
// write font object
sal_Int32 nObject = createObject();
if( ! updateObject( nObject ) )
throw FontException();
-
+
OStringBuffer aLine( 1024 );
aLine.append( nObject );
aLine.append( " 0 obj\n"
@@ -3640,11 +3640,11 @@ std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitEmbeddedFont( const ImplFont
"endobj\n\n" );
if( ! writeBuffer( aLine.getStr(), aLine.getLength() ) )
throw FontException();
-
+
nFontObject = nObject;
-
+
aRet[ rEmbed.m_nNormalFontID ] = nObject;
-
+
// write additional encodings
for( std::list< EmbedEncoding >::iterator enc_it = rEmbed.m_aExtendedEncodings.begin(); enc_it != rEmbed.m_aExtendedEncodings.end(); ++enc_it )
{
@@ -3653,7 +3653,7 @@ std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitEmbeddedFont( const ImplFont
sal_Int32 nEncObject = createObject();
if( ! updateObject( nEncObject ) )
throw FontException();
-
+
OutputDevice* pRef = getReferenceDevice();
pRef->Push( PUSH_FONT | PUSH_MAPMODE );
pRef->SetMapMode( MapMode( MAP_PIXEL ) );
@@ -3663,7 +3663,7 @@ std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitEmbeddedFont( const ImplFont
aFont.SetPitch( pFont->GetPitch() );
pRef->SetFont( aFont );
pRef->ImplNewFont();
-
+
aLine.setLength( 0 );
aLine.append( nEncObject );
aLine.append( " 0 obj\n"
@@ -3679,7 +3679,7 @@ std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitEmbeddedFont( const ImplFont
pEncToUnicodeIndex[nEncoded] = static_cast<sal_Int32>(aUnicodes.size());
aUnicodes.push_back( nEncodedCodes[nEncoded] );
pUnicodesPerGlyph[nEncoded] = 1;
-
+
aLine.append( " /" );
aLine.append( str_it->m_aName );
if( !((++nEncoded) & 15) )
@@ -3687,18 +3687,18 @@ std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitEmbeddedFont( const ImplFont
}
aLine.append( "]>>\n"
"endobj\n\n" );
-
+
pRef->Pop();
-
+
if( ! writeBuffer( aLine.getStr(), aLine.getLength() ) )
throw FontException();
-
+
nToUnicodeStream = createToUnicodeCMap( nEncoding, &aUnicodes[0], pUnicodesPerGlyph, pEncToUnicodeIndex, nEncoded );
-
+
nObject = createObject();
if( ! updateObject( nObject ) )
throw FontException();
-
+
aLine.setLength( 0 );
aLine.append( nObject );
aLine.append( " 0 obj\n"
@@ -3731,7 +3731,7 @@ std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitEmbeddedFont( const ImplFont
"endobj\n\n" );
if( ! writeBuffer( aLine.getStr(), aLine.getLength() ) )
throw FontException();
-
+
aRet[ enc_it->m_nFontID ] = nObject;
}
}
@@ -3742,7 +3742,7 @@ std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitEmbeddedFont( const ImplFont
endCompression();
disableStreamEncryption();
}
-
+
if( pFontData )
m_pReferenceDevice->mpGraphics->FreeEmbedFontData( pFontData, nFontLen );
@@ -3968,11 +3968,11 @@ bool PDFWriterImpl::emitFonts()
{
if( ! m_pReferenceDevice->ImplGetGraphics() )
return false;
-
+
OStringBuffer aLine( 1024 );
-
+
std::map< sal_Int32, sal_Int32 > aFontIDToObject;
-
+
OUString aTmpName;
osl_createTempFile( NULL, NULL, &aTmpName.pData );
for( FontSubsetData::iterator it = m_aSubsets.begin(); it != m_aSubsets.end(); ++it )
@@ -3989,7 +3989,7 @@ bool PDFWriterImpl::emitFonts()
int nGlyphs = 1;
// fill arrays and prepare encoding index map
sal_Int32 nToUnicodeStream = 0;
-
+
rtl_zeroMemory( pGlyphIDs, sizeof( pGlyphIDs ) );
rtl_zeroMemory( pEncoding, sizeof( pEncoding ) );
rtl_zeroMemory( pUnicodesPerGlyph, sizeof( pUnicodesPerGlyph ) );
@@ -3997,10 +3997,10 @@ bool PDFWriterImpl::emitFonts()
for( FontEmitMapping::iterator fit = lit->m_aMapping.begin(); fit != lit->m_aMapping.end();++fit )
{
sal_uInt8 nEnc = fit->second.getGlyphId();
-
+
DBG_ASSERT( pGlyphIDs[nEnc] == 0 && pEncoding[nEnc] == 0, "duplicate glyph" );
DBG_ASSERT( nEnc <= lit->m_aMapping.size(), "invalid glyph encoding" );
-
+
pGlyphIDs[ nEnc ] = fit->first;
pEncoding[ nEnc ] = nEnc;
pEncToUnicodeIndex[ nEnc ] = static_cast<sal_Int32>(aUnicodes.size());
@@ -4027,7 +4027,7 @@ bool PDFWriterImpl::emitFonts()
CHECK_RETURN( (osl_File_E_None == osl_setFilePos( aFontFile, osl_Pos_End, 0 ) ) );
CHECK_RETURN( (osl_File_E_None == osl_getFilePos( aFontFile, &nLength1 ) ) );
CHECK_RETURN( (osl_File_E_None == osl_setFilePos( aFontFile, osl_Pos_Absolut, 0 ) ) );
-
+
#if OSL_DEBUG_LEVEL > 1
{
OStringBuffer aLine1( " PDFWriterImpl::emitFonts" );
@@ -4047,17 +4047,17 @@ bool PDFWriterImpl::emitFonts()
"/Filter/FlateDecode"
#endif
"/Length1 " );
-
+
sal_uInt64 nStartPos = 0;
if( aSubsetInfo.m_nFontType == FontSubsetInfo::SFNT_TTF )
{
aLine.append( (sal_Int32)nLength1 );
-
+
aLine.append( ">>\n"
"stream\n" );
CHECK_RETURN( writeBuffer( aLine.getStr(), aLine.getLength() ) );
CHECK_RETURN( (osl_File_E_None == osl_getFilePos( m_aFile, &nStartPos ) ) );
-
+
// copy font file
beginCompression();
checkAndEnableStreamEncryption( nFontStream );
@@ -4079,7 +4079,7 @@ bool PDFWriterImpl::emitFonts()
else if( (aSubsetInfo.m_nFontType & FontSubsetInfo::TYPE1_PFB) != 0 ) // TODO: also support PFA?
{
boost::shared_array<unsigned char> pBuffer( new unsigned char[ nLength1 ] );
-
+
sal_uInt64 nBytesRead = 0;
CHECK_RETURN( (osl_File_E_None == osl_readFile( aFontFile, pBuffer.get(), nLength1, &nBytesRead ) ) );
DBG_ASSERT( nBytesRead==nLength1, "PDF-FontSubset read incomplete!" );
@@ -4094,12 +4094,12 @@ bool PDFWriterImpl::emitFonts()
aLine.append( (sal_Int32)aSegmentLengths[1] );
aLine.append( "/Length3 " );
aLine.append( (sal_Int32)aSegmentLengths[2] );
-
+
aLine.append( ">>\n"
"stream\n" );
CHECK_RETURN( writeBuffer( aLine.getStr(), aLine.getLength() ) );
CHECK_RETURN( (osl_File_E_None == osl_getFilePos( m_aFile, &nStartPos ) ) );
-
+
// emit PFB-sections without section headers
beginCompression();
checkAndEnableStreamEncryption( nFontStream );
@@ -4112,19 +4112,19 @@ bool PDFWriterImpl::emitFonts()
fprintf( stderr, "PDF: CreateFontSubset result in not yet supported format=%d\n",aSubsetInfo.m_nFontType);
aLine.append( "0 >>\nstream\n" );
}
-
+
endCompression();
disableStreamEncryption();
// close the file
osl_closeFile( aFontFile );
-
+
sal_uInt64 nEndPos = 0;
CHECK_RETURN( (osl_File_E_None == osl_getFilePos( m_aFile, &nEndPos ) ) );
// end the stream
aLine.setLength( 0 );
aLine.append( "\nendstream\nendobj\n\n" );
CHECK_RETURN( writeBuffer( aLine.getStr(), aLine.getLength() ) );
-
+
// emit stream length object
CHECK_RETURN( updateObject( nStreamLengthObject ) );
aLine.setLength( 0 );
@@ -4133,18 +4133,18 @@ bool PDFWriterImpl::emitFonts()
aLine.append( (sal_Int64)(nEndPos-nStartPos) );
aLine.append( "\nendobj\n\n" );
CHECK_RETURN( writeBuffer( aLine.getStr(), aLine.getLength() ) );
-
+
// write font descriptor
sal_Int32 nFontDescriptor = emitFontDescriptor( it->first, aSubsetInfo, lit->m_nFontID, nFontStream );
-
+
if( nToUnicodeStream )
nToUnicodeStream = createToUnicodeCMap( pEncoding, &aUnicodes[0], pUnicodesPerGlyph, pEncToUnicodeIndex, nGlyphs );
-
+
sal_Int32 nFontObject = createObject();
CHECK_RETURN( updateObject( nFontObject ) );
aLine.setLength( 0 );
aLine.append( nFontObject );
-
+
aLine.append( " 0 obj\n" );
aLine.append( ((aSubsetInfo.m_nFontType & FontSubsetInfo::ANY_TYPE1) != 0) ?
"<</Type/Font/Subtype/Type1/BaseFont/" :
@@ -4174,7 +4174,7 @@ bool PDFWriterImpl::emitFonts()
aLine.append( ">>\n"
"endobj\n\n" );
CHECK_RETURN( writeBuffer( aLine.getStr(), aLine.getLength() ) );
-
+
aFontIDToObject[ lit->m_nFontID ] = nFontObject;
}
else
@@ -4195,7 +4195,7 @@ bool PDFWriterImpl::emitFonts()
}
}
osl_removeFile( aTmpName.pData );
-
+
// emit embedded fonts
for( FontEmbedData::iterator eit = m_aEmbeddedFonts.begin(); eit != m_aEmbeddedFonts.end(); ++eit )
{
@@ -4242,7 +4242,7 @@ bool PDFWriterImpl::emitFonts()
}
appendBuiltinFontsToDict( aFontDict );
aFontDict.append( "\n>>\nendobj\n\n" );
-
+
CHECK_RETURN( updateObject( getFontDictObject() ) );
CHECK_RETURN( writeBuffer( aFontDict.getStr(), aFontDict.getLength() ) );
return true;
@@ -4424,8 +4424,8 @@ bool PDFWriterImpl::appendDest( sal_Int32 nDestID, OStringBuffer& rBuffer )
}
- const PDFDest& rDest = m_aDests[ nDestID ];
- const PDFPage& rDestPage = m_aPages[ rDest.m_nPage ];
+ const PDFDest& rDest = m_aDests[ nDestID ];
+ const PDFPage& rDestPage = m_aPages[ rDest.m_nPage ];
rBuffer.append( '[' );
rBuffer.append( rDestPage.m_nPageObject );
@@ -4484,7 +4484,7 @@ bool PDFWriterImpl::emitLinkAnnotations()
int nAnnots = m_aLinks.size();
for( int i = 0; i < nAnnots; i++ )
{
- const PDFLink& rLink = m_aLinks[i];
+ const PDFLink& rLink = m_aLinks[i];
if( ! updateObject( rLink.m_nObject ) )
continue;
@@ -4711,7 +4711,7 @@ bool PDFWriterImpl::emitNoteAnnotations()
int nAnnots = m_aNotes.size();
for( int i = 0; i < nAnnots; i++ )
{
- const PDFNoteEntry& rNote = m_aNotes[i];
+ const PDFNoteEntry& rNote = m_aNotes[i];
if( ! updateObject( rNote.m_nObject ) )
return false;
@@ -4916,9 +4916,9 @@ Font PDFWriterImpl::drawFieldBorder( PDFWidget& rIntern,
sal_Int32 nDelta = aFont.GetHeight()/4;
if( nDelta < 1 )
nDelta = 1;
- rIntern.m_aRect.Left() += nDelta;
- rIntern.m_aRect.Top() += nDelta;
- rIntern.m_aRect.Right() -= nDelta;
+ rIntern.m_aRect.Left() += nDelta;
+ rIntern.m_aRect.Top() += nDelta;
+ rIntern.m_aRect.Right() -= nDelta;
rIntern.m_aRect.Bottom()-= nDelta;
}
}
@@ -4956,7 +4956,7 @@ void PDFWriterImpl::createDefaultEditAppearance( PDFWidget& rEdit, const PDFWrit
aDA.append( ' ' );
m_aPages[ m_nCurrentPage ].appendMappedLength( sal_Int32( aFont.GetHeight() ), aDA );
aDA.append( " Tf" );
-
+
/* create an empty appearance stream, let the viewer create
the appearance at runtime. This is because AR5 seems to
paint the widget appearance always, and a dynamically created
@@ -5054,10 +5054,10 @@ void PDFWriterImpl::createDefaultCheckBoxAppearance( PDFWidget& rBox, const PDFW
Rectangle aCheckRect, aTextRect;
if( rWidget.ButtonIsLeft )
{
- aCheckRect.Left() = rBox.m_aRect.Left() + nDelta;
- aCheckRect.Top() = rBox.m_aRect.Top() + (rBox.m_aRect.GetHeight()-aFontSize.Height())/2;
- aCheckRect.Right() = aCheckRect.Left() + aFontSize.Height();
- aCheckRect.Bottom() = aCheckRect.Top() + aFontSize.Height();
+ aCheckRect.Left() = rBox.m_aRect.Left() + nDelta;
+ aCheckRect.Top() = rBox.m_aRect.Top() + (rBox.m_aRect.GetHeight()-aFontSize.Height())/2;
+ aCheckRect.Right() = aCheckRect.Left() + aFontSize.Height();
+ aCheckRect.Bottom() = aCheckRect.Top() + aFontSize.Height();
// #i74206# handle small controls without text area
while( aCheckRect.GetWidth() > rBox.m_aRect.GetWidth() && aCheckRect.GetWidth() > nDelta )
@@ -5067,17 +5067,17 @@ void PDFWriterImpl::createDefaultCheckBoxAppearance( PDFWidget& rBox, const PDFW
aCheckRect.Bottom() -= nDelta - (nDelta/2);
}
- aTextRect.Left() = rBox.m_aRect.Left() + aCheckRect.GetWidth()+5*nDelta;
- aTextRect.Top() = rBox.m_aRect.Top();
- aTextRect.Right() = aTextRect.Left() + rBox.m_aRect.GetWidth() - aCheckRect.GetWidth()-6*nDelta;
- aTextRect.Bottom() = rBox.m_aRect.Bottom();
+ aTextRect.Left() = rBox.m_aRect.Left() + aCheckRect.GetWidth()+5*nDelta;
+ aTextRect.Top() = rBox.m_aRect.Top();
+ aTextRect.Right() = aTextRect.Left() + rBox.m_aRect.GetWidth() - aCheckRect.GetWidth()-6*nDelta;
+ aTextRect.Bottom() = rBox.m_aRect.Bottom();
}
else
{
- aCheckRect.Left() = rBox.m_aRect.Right() - nDelta - aFontSize.Height();
- aCheckRect.Top() = rBox.m_aRect.Top() + (rBox.m_aRect.GetHeight()-aFontSize.Height())/2;
- aCheckRect.Right() = aCheckRect.Left() + aFontSize.Height();
- aCheckRect.Bottom() = aCheckRect.Top() + aFontSize.Height();
+ aCheckRect.Left() = rBox.m_aRect.Right() - nDelta - aFontSize.Height();
+ aCheckRect.Top() = rBox.m_aRect.Top() + (rBox.m_aRect.GetHeight()-aFontSize.Height())/2;
+ aCheckRect.Right() = aCheckRect.Left() + aFontSize.Height();
+ aCheckRect.Bottom() = aCheckRect.Top() + aFontSize.Height();
// #i74206# handle small controls without text area
while( aCheckRect.GetWidth() > rBox.m_aRect.GetWidth() && aCheckRect.GetWidth() > nDelta )
@@ -5087,10 +5087,10 @@ void PDFWriterImpl::createDefaultCheckBoxAppearance( PDFWidget& rBox, const PDFW
aCheckRect.Bottom() -= nDelta - (nDelta/2);
}
- aTextRect.Left() = rBox.m_aRect.Left();
- aTextRect.Top() = rBox.m_aRect.Top();
- aTextRect.Right() = aTextRect.Left() + rBox.m_aRect.GetWidth() - aCheckRect.GetWidth()-6*nDelta;
- aTextRect.Bottom() = rBox.m_aRect.Bottom();
+ aTextRect.Left() = rBox.m_aRect.Left();
+ aTextRect.Top() = rBox.m_aRect.Top();
+ aTextRect.Right() = aTextRect.Left() + rBox.m_aRect.GetWidth() - aCheckRect.GetWidth()-6*nDelta;
+ aTextRect.Bottom() = rBox.m_aRect.Bottom();
}
setLineColor( Color( COL_BLACK ) );
setFillColor( Color( COL_TRANSPARENT ) );
@@ -5179,10 +5179,10 @@ void PDFWriterImpl::createDefaultRadioButtonAppearance( PDFWidget& rBox, const P
Rectangle aCheckRect, aTextRect;
if( rWidget.ButtonIsLeft )
{
- aCheckRect.Left() = rBox.m_aRect.Left() + nDelta;
- aCheckRect.Top() = rBox.m_aRect.Top() + (rBox.m_aRect.GetHeight()-aFontSize.Height())/2;
- aCheckRect.Right() = aCheckRect.Left() + aFontSize.Height();
- aCheckRect.Bottom() = aCheckRect.Top() + aFontSize.Height();
+ aCheckRect.Left() = rBox.m_aRect.Left() + nDelta;
+ aCheckRect.Top() = rBox.m_aRect.Top() + (rBox.m_aRect.GetHeight()-aFontSize.Height())/2;
+ aCheckRect.Right() = aCheckRect.Left() + aFontSize.Height();
+ aCheckRect.Bottom() = aCheckRect.Top() + aFontSize.Height();
// #i74206# handle small controls without text area
while( aCheckRect.GetWidth() > rBox.m_aRect.GetWidth() && aCheckRect.GetWidth() > nDelta )
@@ -5192,17 +5192,17 @@ void PDFWriterImpl::createDefaultRadioButtonAppearance( PDFWidget& rBox, const P
aCheckRect.Bottom() -= nDelta - (nDelta/2);
}
- aTextRect.Left() = rBox.m_aRect.Left() + aCheckRect.GetWidth()+5*nDelta;
- aTextRect.Top() = rBox.m_aRect.Top();
- aTextRect.Right() = aTextRect.Left() + rBox.m_aRect.GetWidth() - aCheckRect.GetWidth()-6*nDelta;
- aTextRect.Bottom() = rBox.m_aRect.Bottom();
+ aTextRect.Left() = rBox.m_aRect.Left() + aCheckRect.GetWidth()+5*nDelta;
+ aTextRect.Top() = rBox.m_aRect.Top();
+ aTextRect.Right() = aTextRect.Left() + rBox.m_aRect.GetWidth() - aCheckRect.GetWidth()-6*nDelta;
+ aTextRect.Bottom() = rBox.m_aRect.Bottom();
}
else
{
- aCheckRect.Left() = rBox.m_aRect.Right() - nDelta - aFontSize.Height();
- aCheckRect.Top() = rBox.m_aRect.Top() + (rBox.m_aRect.GetHeight()-aFontSize.Height())/2;
- aCheckRect.Right() = aCheckRect.Left() + aFontSize.Height();
- aCheckRect.Bottom() = aCheckRect.Top() + aFontSize.Height();
+ aCheckRect.Left() = rBox.m_aRect.Right() - nDelta - aFontSize.Height();
+ aCheckRect.Top() = rBox.m_aRect.Top() + (rBox.m_aRect.GetHeight()-aFontSize.Height())/2;
+ aCheckRect.Right() = aCheckRect.Left() + aFontSize.Height();
+ aCheckRect.Bottom() = aCheckRect.Top() + aFontSize.Height();
// #i74206# handle small controls without text area
while( aCheckRect.GetWidth() > rBox.m_aRect.GetWidth() && aCheckRect.GetWidth() > nDelta )
@@ -5212,10 +5212,10 @@ void PDFWriterImpl::createDefaultRadioButtonAppearance( PDFWidget& rBox, const P
aCheckRect.Bottom() -= nDelta - (nDelta/2);
}
- aTextRect.Left() = rBox.m_aRect.Left();
- aTextRect.Top() = rBox.m_aRect.Top();
- aTextRect.Right() = aTextRect.Left() + rBox.m_aRect.GetWidth() - aCheckRect.GetWidth()-6*nDelta;
- aTextRect.Bottom() = rBox.m_aRect.Bottom();
+ aTextRect.Left() = rBox.m_aRect.Left();
+ aTextRect.Top() = rBox.m_aRect.Top();
+ aTextRect.Right() = aTextRect.Left() + rBox.m_aRect.GetWidth() - aCheckRect.GetWidth()-6*nDelta;
+ aTextRect.Bottom() = rBox.m_aRect.Bottom();
}
setLineColor( Color( COL_BLACK ) );
setFillColor( Color( COL_TRANSPARENT ) );
@@ -5260,10 +5260,10 @@ void PDFWriterImpl::createDefaultRadioButtonAppearance( PDFWidget& rBox, const P
writeBuffer( aDA.getStr(), aDA.getLength() );
setFillColor( replaceColor( rWidget.TextColor, rSettings.GetRadioCheckTextColor() ) );
setLineColor( Color( COL_TRANSPARENT ) );
- aCheckRect.Left() += 3*nDelta;
- aCheckRect.Top() += 3*nDelta;
- aCheckRect.Bottom() -= 3*nDelta;
- aCheckRect.Right() -= 3*nDelta;
+ aCheckRect.Left() += 3*nDelta;
+ aCheckRect.Top() += 3*nDelta;
+ aCheckRect.Bottom() -= 3*nDelta;
+ aCheckRect.Right() -= 3*nDelta;
drawEllipse( aCheckRect );
writeBuffer( "\nEMC\n", 5 );
endRedirect();
@@ -6628,7 +6628,7 @@ void PDFWriterImpl::sortWidgets()
namespace vcl {
class PDFStreamIf :
- public cppu::WeakImplHelper1< com::sun::star::io::XOutputStream >
+ public cppu::WeakImplHelper1< com::sun::star::io::XOutputStream >
{
PDFWriterImpl* m_pWriter;
bool m_bWrite;
@@ -6774,10 +6774,10 @@ sal_Int32 PDFWriterImpl::getSystemFont( const Font& i_rFont )
m_aSystemFonts[ pDevFont ] = EmbedFont();
m_aSystemFonts[ pDevFont ].m_nNormalFontID = nFontID;
}
-
+
getReferenceDevice()->Pop();
getReferenceDevice()->ImplNewFont();
-
+
return nFontID;
}
@@ -7383,12 +7383,12 @@ void PDFWriterImpl::drawLayout( SalLayout& rLayout, const String& rText, bool bT
if( i < nGlyphs-1 )
{
nChars = pCharPosAry[i+1] - pCharPosAry[i];
- // #i115618# fix for simple RTL+CTL cases
- // TODO: sanitize for RTL ligatures, more complex CTL, etc.
+ // #i115618# fix for simple RTL+CTL cases
+ // TODO: sanitize for RTL ligatures, more complex CTL, etc.
if( nChars < 0 )
- nChars = -nChars;
+ nChars = -nChars;
else if( nChars == 0 )
- nChars = 1;
+ nChars = 1;
pUnicodesPerGlyph[i] = nChars;
for( int n = 1; n < nChars; n++ )
aUnicodes.push_back( rText.GetChar( sal::static_int_cast<xub_StrLen>(pCharPosAry[i]+n) ) );
@@ -7515,14 +7515,14 @@ void PDFWriterImpl::drawLayout( SalLayout& rLayout, const String& rText, bool bT
// write eventual emphasis marks
if( m_aCurrentPDFState.m_aFont.GetEmphasisMark() & EMPHASISMARK_STYLE )
{
- PolyPolygon aEmphPoly;
- Rectangle aEmphRect1;
- Rectangle aEmphRect2;
- long nEmphYOff;
- long nEmphWidth;
- long nEmphHeight;
- BOOL bEmphPolyLine;
- FontEmphasisMark nEmphMark;
+ PolyPolygon aEmphPoly;
+ Rectangle aEmphRect1;
+ Rectangle aEmphRect2;
+ long nEmphYOff;
+ long nEmphWidth;
+ long nEmphHeight;
+ BOOL bEmphPolyLine;
+ FontEmphasisMark nEmphMark;
push( PUSH_ALL );
@@ -7711,7 +7711,7 @@ void PDFWriterImpl::drawText( const Rectangle& rRect, const String& rOrigStr, US
Point aPos = rRect.TopLeft();
- long nTextHeight = m_pReferenceDevice->GetTextHeight();
+ long nTextHeight = m_pReferenceDevice->GetTextHeight();
xub_StrLen nMnemonicPos = STRING_NOTFOUND;
String aStr = rOrigStr;
@@ -7921,9 +7921,9 @@ void PDFWriterImpl::drawWaveLine( const Point& rStart, const Point& rStop, sal_I
void PDFWriterImpl::drawWaveTextLine( OStringBuffer& aLine, long nWidth, FontUnderline eTextLine, Color aColor, bool bIsAbove )
{
// note: units in pFontEntry are ref device pixel
- ImplFontEntry* pFontEntry = m_pReferenceDevice->mpFontEntry;
- long nLineHeight = 0;
- long nLinePos = 0;
+ ImplFontEntry* pFontEntry = m_pReferenceDevice->mpFontEntry;
+ long nLineHeight = 0;
+ long nLinePos = 0;
appendStrokingColor( aColor, aLine );
aLine.append( "\n" );
@@ -7991,10 +7991,10 @@ void PDFWriterImpl::drawWaveTextLine( OStringBuffer& aLine, long nWidth, FontUnd
void PDFWriterImpl::drawStraightTextLine( OStringBuffer& aLine, long nWidth, FontUnderline eTextLine, Color aColor, bool bIsAbove )
{
// note: units in pFontEntry are ref device pixel
- ImplFontEntry* pFontEntry = m_pReferenceDevice->mpFontEntry;
- long nLineHeight = 0;
- long nLinePos = 0;
- long nLinePos2 = 0;
+ ImplFontEntry* pFontEntry = m_pReferenceDevice->mpFontEntry;
+ long nLineHeight = 0;
+ long nLinePos = 0;
+ long nLinePos2 = 0;
if ( eTextLine > UNDERLINE_BOLDWAVE )
eTextLine = UNDERLINE_SINGLE;
@@ -8160,10 +8160,10 @@ void PDFWriterImpl::drawStraightTextLine( OStringBuffer& aLine, long nWidth, Fon
void PDFWriterImpl::drawStrikeoutLine( OStringBuffer& aLine, long nWidth, FontStrikeout eStrikeout, Color aColor )
{
// note: units in pFontEntry are ref device pixel
- ImplFontEntry* pFontEntry = m_pReferenceDevice->mpFontEntry;
- long nLineHeight = 0;
- long nLinePos = 0;
- long nLinePos2 = 0;
+ ImplFontEntry* pFontEntry = m_pReferenceDevice->mpFontEntry;
+ long nLineHeight = 0;
+ long nLinePos = 0;
+ long nLinePos2 = 0;
if ( eStrikeout > STRIKEOUT_X )
eStrikeout = STRIKEOUT_SINGLE;
@@ -8268,13 +8268,13 @@ void PDFWriterImpl::drawTextLine( const Point& rPos, long nWidth, FontStrikeout
updateGraphicsState();
// note: units in pFontEntry are ref device pixel
- ImplFontEntry* pFontEntry = m_pReferenceDevice->mpFontEntry;
- Color aUnderlineColor = m_aCurrentPDFState.m_aTextLineColor;
- Color aOverlineColor = m_aCurrentPDFState.m_aOverlineColor;
- Color aStrikeoutColor = m_aCurrentPDFState.m_aFont.GetColor();
- bool bStrikeoutDone = false;
- bool bUnderlineDone = false;
- bool bOverlineDone = false;
+ ImplFontEntry* pFontEntry = m_pReferenceDevice->mpFontEntry;
+ Color aUnderlineColor = m_aCurrentPDFState.m_aTextLineColor;
+ Color aOverlineColor = m_aCurrentPDFState.m_aOverlineColor;
+ Color aStrikeoutColor = m_aCurrentPDFState.m_aFont.GetColor();
+ bool bStrikeoutDone = false;
+ bool bUnderlineDone = false;
+ bool bOverlineDone = false;
if ( (eStrikeout == STRIKEOUT_SLASH) || (eStrikeout == STRIKEOUT_X) )
{
@@ -8416,12 +8416,12 @@ void PDFWriterImpl::drawTransparent( const PolyPolygon& rPolyPoly, sal_uInt32 nT
// create XObject
m_aTransparentObjects.push_back( TransparencyEmit() );
// FIXME: polygons with beziers may yield incorrect bound rect
- m_aTransparentObjects.back().m_aBoundRect = rPolyPoly.GetBoundRect();
+ m_aTransparentObjects.back().m_aBoundRect = rPolyPoly.GetBoundRect();
// convert rectangle to default user space
m_aPages.back().convertRect( m_aTransparentObjects.back().m_aBoundRect );
- m_aTransparentObjects.back().m_nObject = createObject();
+ m_aTransparentObjects.back().m_nObject = createObject();
m_aTransparentObjects.back().m_nExtGStateObject = createObject();
- m_aTransparentObjects.back().m_fAlpha = (double)(100-nTransparentPercent) / 100.0;
+ m_aTransparentObjects.back().m_fAlpha = (double)(100-nTransparentPercent) / 100.0;
m_aTransparentObjects.back().m_pContentStream = new SvMemoryStream( 256, 256 );
// create XObject's content stream
OStringBuffer aContent( 256 );
@@ -8528,8 +8528,8 @@ SvStream* PDFWriterImpl::endRedirect()
SvStream* pStream = NULL;
if( ! m_aOutputStreams.empty() )
{
- pStream = m_aOutputStreams.front().m_pStream;
- m_aMapMode = m_aOutputStreams.front().m_aMapMode;
+ pStream = m_aOutputStreams.front().m_pStream;
+ m_aMapMode = m_aOutputStreams.front().m_aMapMode;
m_aOutputStreams.pop_front();
}
@@ -8562,11 +8562,11 @@ void PDFWriterImpl::endTransparencyGroup( const Rectangle& rBoundingBox, sal_uIn
{
// create XObject
m_aTransparentObjects.push_back( TransparencyEmit() );
- m_aTransparentObjects.back().m_aBoundRect = rBoundingBox;
+ m_aTransparentObjects.back().m_aBoundRect = rBoundingBox;
// convert rectangle to default user space
m_aPages.back().convertRect( m_aTransparentObjects.back().m_aBoundRect );
- m_aTransparentObjects.back().m_nObject = createObject();
- m_aTransparentObjects.back().m_fAlpha = (double)(100-nTransparentPercent) / 100.0;
+ m_aTransparentObjects.back().m_nObject = createObject();
+ m_aTransparentObjects.back().m_fAlpha = (double)(100-nTransparentPercent) / 100.0;
// get XObject's content stream
m_aTransparentObjects.back().m_pContentStream = static_cast<SvMemoryStream*>(endRedirect());
m_aTransparentObjects.back().m_nExtGStateObject = createObject();
@@ -8599,11 +8599,11 @@ void PDFWriterImpl::endTransparencyGroup( const Rectangle& rBoundingBox, const B
{
// create XObject
m_aTransparentObjects.push_back( TransparencyEmit() );
- m_aTransparentObjects.back().m_aBoundRect = rBoundingBox;
+ m_aTransparentObjects.back().m_aBoundRect = rBoundingBox;
// convert rectangle to default user space
m_aPages.back().convertRect( m_aTransparentObjects.back().m_aBoundRect );
- m_aTransparentObjects.back().m_nObject = createObject();
- m_aTransparentObjects.back().m_fAlpha = 0.0;
+ m_aTransparentObjects.back().m_nObject = createObject();
+ m_aTransparentObjects.back().m_fAlpha = 0.0;
// get XObject's content stream
m_aTransparentObjects.back().m_pContentStream = static_cast<SvMemoryStream*>(endRedirect());
m_aTransparentObjects.back().m_nExtGStateObject = createObject();
@@ -9524,9 +9524,9 @@ bool PDFWriterImpl::writeBitmapObject( BitmapEmit& rObject, bool bMask )
{
CHECK_RETURN( updateObject( rObject.m_nObject ) );
- Bitmap aBitmap;
- Color aTransparentColor( COL_TRANSPARENT );
- bool bWriteMask = false;
+ Bitmap aBitmap;
+ Color aTransparentColor( COL_TRANSPARENT );
+ bool bWriteMask = false;
if( ! bMask )
{
aBitmap = rObject.m_aBitmap.GetBitmap();
@@ -9590,8 +9590,8 @@ bool PDFWriterImpl::writeBitmapObject( BitmapEmit& rObject, bool bMask )
break;
}
- sal_Int32 nStreamLengthObject = createObject();
- sal_Int32 nMaskObject = 0;
+ sal_Int32 nStreamLengthObject = createObject();
+ sal_Int32 nMaskObject = 0;
#if OSL_DEBUG_LEVEL > 1
{
@@ -9642,7 +9642,7 @@ bool PDFWriterImpl::writeBitmapObject( BitmapEmit& rObject, bool bMask )
//check encryption buffer size
if( checkEncryptionBufferSize( pAccess->GetPaletteEntryCount()*3 ) )
{
- int nChar = 0;
+ int nChar = 0;
//fill the encryption buffer
for( USHORT i = 0; i < pAccess->GetPaletteEntryCount(); i++ )
{
@@ -9787,8 +9787,8 @@ bool PDFWriterImpl::writeBitmapObject( BitmapEmit& rObject, bool bMask )
if( nMaskObject )
{
BitmapEmit aEmit;
- aEmit.m_nObject = nMaskObject;
- aEmit.m_aBitmap = rObject.m_aBitmap;
+ aEmit.m_nObject = nMaskObject;
+ aEmit.m_aBitmap = rObject.m_aBitmap;
return writeBitmapObject( aEmit, true );
}
@@ -9814,12 +9814,12 @@ void PDFWriterImpl::drawJPGBitmap( SvStream& rDCTData, bool bIsTrueColor, const
pStream->Seek( STREAM_SEEK_TO_END );
BitmapID aID;
- aID.m_aPixelSize = rSizePixel;
- aID.m_nSize = pStream->Tell();
+ aID.m_aPixelSize = rSizePixel;
+ aID.m_nSize = pStream->Tell();
pStream->Seek( STREAM_SEEK_TO_BEGIN );
- aID.m_nChecksum = rtl_crc32( 0, pStream->GetData(), aID.m_nSize );
+ aID.m_nChecksum = rtl_crc32( 0, pStream->GetData(), aID.m_nSize );
if( ! rMask.IsEmpty() )
- aID.m_nMaskChecksum = rMask.GetChecksum();
+ aID.m_nMaskChecksum = rMask.GetChecksum();
std::list< JPGEmit >::const_iterator it;
for( it = m_aJPGs.begin(); it != m_aJPGs.end() && ! (aID == it->m_aID); ++it )
@@ -9828,12 +9828,12 @@ void PDFWriterImpl::drawJPGBitmap( SvStream& rDCTData, bool bIsTrueColor, const
{
m_aJPGs.push_front( JPGEmit() );
JPGEmit& rEmit = m_aJPGs.front();
- rEmit.m_nObject = createObject();
- rEmit.m_aID = aID;
- rEmit.m_pStream = pStream;
+ rEmit.m_nObject = createObject();
+ rEmit.m_aID = aID;
+ rEmit.m_pStream = pStream;
rEmit.m_bTrueColor = bIsTrueColor;
if( !! rMask && rMask.GetSizePixel() == rSizePixel )
- rEmit.m_aMask = rMask;
+ rEmit.m_aMask = rMask;
it = m_aJPGs.begin();
}
@@ -9843,7 +9843,7 @@ void PDFWriterImpl::drawJPGBitmap( SvStream& rDCTData, bool bIsTrueColor, const
aLine.append( "q " );
sal_Int32 nCheckWidth = 0;
m_aPages.back().appendMappedLength( (sal_Int32)rTargetArea.GetWidth(), aLine, false, &nCheckWidth );
- aLine.append( " 0 0 " );
+ aLine.append( " 0 0 " );
sal_Int32 nCheckHeight = 0;
m_aPages.back().appendMappedLength( (sal_Int32)rTargetArea.GetHeight(), aLine, true, &nCheckHeight );
aLine.append( ' ' );
@@ -9903,10 +9903,10 @@ void PDFWriterImpl::drawBitmap( const Point& rDestPoint, const Size& rDestSize,
const PDFWriterImpl::BitmapEmit& PDFWriterImpl::createBitmapEmit( const BitmapEx& rBitmap, bool bDrawMask )
{
BitmapID aID;
- aID.m_aPixelSize = rBitmap.GetSizePixel();
- aID.m_nSize = rBitmap.GetBitCount();
- aID.m_nChecksum = rBitmap.GetBitmap().GetChecksum();
- aID.m_nMaskChecksum = 0;
+ aID.m_aPixelSize = rBitmap.GetSizePixel();
+ aID.m_nSize = rBitmap.GetBitCount();
+ aID.m_nChecksum = rBitmap.GetBitmap().GetChecksum();
+ aID.m_nMaskChecksum = 0;
if( rBitmap.IsAlpha() )
aID.m_nMaskChecksum = rBitmap.GetAlpha().GetChecksum();
else
@@ -9924,10 +9924,10 @@ const PDFWriterImpl::BitmapEmit& PDFWriterImpl::createBitmapEmit( const BitmapEx
if( it == m_aBitmaps.end() )
{
m_aBitmaps.push_front( BitmapEmit() );
- m_aBitmaps.front().m_aID = aID;
- m_aBitmaps.front().m_aBitmap = rBitmap;
- m_aBitmaps.front().m_nObject = createObject();
- m_aBitmaps.front().m_bDrawMask = bDrawMask;
+ m_aBitmaps.front().m_aID = aID;
+ m_aBitmaps.front().m_aBitmap = rBitmap;
+ m_aBitmaps.front().m_nObject = createObject();
+ m_aBitmaps.front().m_bDrawMask = bDrawMask;
it = m_aBitmaps.begin();
}
@@ -10002,9 +10002,9 @@ sal_Int32 PDFWriterImpl::createGradient( const Gradient& rGradient, const Size&
if( it == m_aGradients.end() )
{
m_aGradients.push_front( GradientEmit() );
- m_aGradients.front().m_aGradient = rGradient;
- m_aGradients.front().m_nObject = createObject();
- m_aGradients.front().m_aSize = aPtSize;
+ m_aGradients.front().m_aGradient = rGradient;
+ m_aGradients.front().m_nObject = createObject();
+ m_aGradients.front().m_aSize = aPtSize;
it = m_aGradients.begin();
}
@@ -10110,7 +10110,7 @@ void PDFWriterImpl::drawHatch( const PolyPolygon& rPolyPoly, const Hatch& rHatch
return;
if( rPolyPoly.Count() )
{
- PolyPolygon aPolyPoly( rPolyPoly );
+ PolyPolygon aPolyPoly( rPolyPoly );
aPolyPoly.Optimize( POLY_OPTIMIZE_NO_SAME );
push( PUSH_LINECOLOR );
@@ -10124,9 +10124,9 @@ void PDFWriterImpl::drawWallpaper( const Rectangle& rRect, const Wallpaper& rWal
{
MARK( "drawWallpaper" );
- bool bDrawColor = false;
- bool bDrawGradient = false;
- bool bDrawBitmap = false;
+ bool bDrawColor = false;
+ bool bDrawGradient = false;
+ bool bDrawBitmap = false;
BitmapEx aBitmap;
Point aBmpPos = rRect.TopLeft();
@@ -10149,7 +10149,7 @@ void PDFWriterImpl::drawWallpaper( const Rectangle& rRect, const Wallpaper& rWal
{
if( rWall.GetStyle() != WALLPAPER_TILE )
{
- bDrawBitmap = true;
+ bDrawBitmap = true;
if( rWall.IsGradient() )
bDrawGradient = true;
else
@@ -10214,8 +10214,8 @@ void PDFWriterImpl::drawWallpaper( const Rectangle& rRect, const Wallpaper& rWal
aTilingStream.append( " Do\n" );
m_aTilings.push_back( TilingEmit() );
- m_aTilings.back().m_nObject = createObject();
- m_aTilings.back().m_aRectangle = Rectangle( Point( 0, 0 ), aConvertRect.GetSize() );
+ m_aTilings.back().m_nObject = createObject();
+ m_aTilings.back().m_aRectangle = Rectangle( Point( 0, 0 ), aConvertRect.GetSize() );
m_aTilings.back().m_pTilingStream = new SvMemoryStream();
m_aTilings.back().m_pTilingStream->Write( aTilingStream.getStr(), aTilingStream.getLength() );
// phase the tiling so wallpaper begins on upper left
@@ -10243,9 +10243,9 @@ void PDFWriterImpl::drawWallpaper( const Rectangle& rRect, const Wallpaper& rWal
}
else
{
- aBmpPos = aRect.TopLeft();
- aBmpSize = aRect.GetSize();
- bDrawBitmap = true;
+ aBmpPos = aRect.TopLeft();
+ aBmpSize = aRect.GetSize();
+ bDrawBitmap = true;
}
if( aBitmap.IsTransparent() )
@@ -10535,7 +10535,7 @@ void PDFWriterImpl::pop()
OSL_ENSURE( m_aGraphicsStack.size() > 1, "pop without push" );
if( m_aGraphicsStack.size() < 2 )
return;
-
+
GraphicsState aState = m_aGraphicsStack.front();
m_aGraphicsStack.pop_front();
GraphicsState& rOld = m_aGraphicsStack.front();
@@ -10646,9 +10646,9 @@ void PDFWriterImpl::createNote( const Rectangle& rRect, const PDFNote& rNote, sa
return;
m_aNotes.push_back( PDFNoteEntry() );
- m_aNotes.back().m_nObject = createObject();
- m_aNotes.back().m_aContents = rNote;
- m_aNotes.back().m_aRect = rRect;
+ m_aNotes.back().m_nObject = createObject();
+ m_aNotes.back().m_aContents = rNote;
+ m_aNotes.back().m_aRect = rRect;
// convert to default user space now, since the mapmode may change
m_aPages[nPageNr].convertRect( m_aNotes.back().m_aRect );
@@ -10667,9 +10667,9 @@ sal_Int32 PDFWriterImpl::createLink( const Rectangle& rRect, sal_Int32 nPageNr )
sal_Int32 nRet = m_aLinks.size();
m_aLinks.push_back( PDFLink() );
- m_aLinks.back().m_nObject = createObject();
- m_aLinks.back().m_nPage = nPageNr;
- m_aLinks.back().m_aRect = rRect;
+ m_aLinks.back().m_nObject = createObject();
+ m_aLinks.back().m_nPage = nPageNr;
+ m_aLinks.back().m_aRect = rRect;
// convert to default user space now, since the mapmode may change
m_aPages[nPageNr].convertRect( m_aLinks.back().m_aRect );
@@ -10714,7 +10714,7 @@ sal_Int32 PDFWriterImpl::createDest( const Rectangle& rRect, sal_Int32 nPageNr,
m_aDests.push_back( PDFDest() );
m_aDests.back().m_nPage = nPageNr;
- m_aDests.back().m_eType = eType;
+ m_aDests.back().m_eType = eType;
m_aDests.back().m_aRect = rRect;
// convert to default user space now, since the mapmode may change
m_aPages[nPageNr].convertRect( m_aDests.back().m_aRect );
@@ -10739,7 +10739,7 @@ sal_Int32 PDFWriterImpl::setLinkURL( sal_Int32 nLinkId, const OUString& rURL )
if( nLinkId < 0 || nLinkId >= (sal_Int32)m_aLinks.size() )
return -1;
- m_aLinks[ nLinkId ].m_nDest = -1;
+ m_aLinks[ nLinkId ].m_nDest = -1;
using namespace ::com::sun::star;
@@ -10759,7 +10759,7 @@ sal_Int32 PDFWriterImpl::setLinkURL( sal_Int32 nLinkId, const OUString& rURL )
if (m_xTrans.is())
m_xTrans->parseStrict( aURL );
- m_aLinks[ nLinkId ].m_aURL = aURL.Complete;
+ m_aLinks[ nLinkId ].m_aURL = aURL.Complete;
return 0;
}
@@ -10843,42 +10843,42 @@ const sal_Char* PDFWriterImpl::getStructureTag( PDFWriter::StructElement eType )
if( aTagStrings.empty() )
{
aTagStrings[ PDFWriter::NonStructElement] = "NonStruct";
- aTagStrings[ PDFWriter::Document ] = "Document";
- aTagStrings[ PDFWriter::Part ] = "Part";
- aTagStrings[ PDFWriter::Article ] = "Art";
- aTagStrings[ PDFWriter::Section ] = "Sect";
- aTagStrings[ PDFWriter::Division ] = "Div";
- aTagStrings[ PDFWriter::BlockQuote ] = "BlockQuote";
- aTagStrings[ PDFWriter::Caption ] = "Caption";
- aTagStrings[ PDFWriter::TOC ] = "TOC";
- aTagStrings[ PDFWriter::TOCI ] = "TOCI";
- aTagStrings[ PDFWriter::Index ] = "Index";
- aTagStrings[ PDFWriter::Paragraph ] = "P";
- aTagStrings[ PDFWriter::Heading ] = "H";
- aTagStrings[ PDFWriter::H1 ] = "H1";
- aTagStrings[ PDFWriter::H2 ] = "H2";
- aTagStrings[ PDFWriter::H3 ] = "H3";
- aTagStrings[ PDFWriter::H4 ] = "H4";
- aTagStrings[ PDFWriter::H5 ] = "H5";
- aTagStrings[ PDFWriter::H6 ] = "H6";
- aTagStrings[ PDFWriter::List ] = "L";
- aTagStrings[ PDFWriter::ListItem ] = "LI";
- aTagStrings[ PDFWriter::LILabel ] = "Lbl";
- aTagStrings[ PDFWriter::LIBody ] = "LBody";
- aTagStrings[ PDFWriter::Table ] = "Table";
- aTagStrings[ PDFWriter::TableRow ] = "TR";
- aTagStrings[ PDFWriter::TableHeader ] = "TH";
- aTagStrings[ PDFWriter::TableData ] = "TD";
- aTagStrings[ PDFWriter::Span ] = "Span";
- aTagStrings[ PDFWriter::Quote ] = "Quote";
- aTagStrings[ PDFWriter::Note ] = "Note";
- aTagStrings[ PDFWriter::Reference ] = "Reference";
- aTagStrings[ PDFWriter::BibEntry ] = "BibEntry";
- aTagStrings[ PDFWriter::Code ] = "Code";
- aTagStrings[ PDFWriter::Link ] = "Link";
- aTagStrings[ PDFWriter::Figure ] = "Figure";
- aTagStrings[ PDFWriter::Formula ] = "Formula";
- aTagStrings[ PDFWriter::Form ] = "Form";
+ aTagStrings[ PDFWriter::Document ] = "Document";
+ aTagStrings[ PDFWriter::Part ] = "Part";
+ aTagStrings[ PDFWriter::Article ] = "Art";
+ aTagStrings[ PDFWriter::Section ] = "Sect";
+ aTagStrings[ PDFWriter::Division ] = "Div";
+ aTagStrings[ PDFWriter::BlockQuote ] = "BlockQuote";
+ aTagStrings[ PDFWriter::Caption ] = "Caption";
+ aTagStrings[ PDFWriter::TOC ] = "TOC";
+ aTagStrings[ PDFWriter::TOCI ] = "TOCI";
+ aTagStrings[ PDFWriter::Index ] = "Index";
+ aTagStrings[ PDFWriter::Paragraph ] = "P";
+ aTagStrings[ PDFWriter::Heading ] = "H";
+ aTagStrings[ PDFWriter::H1 ] = "H1";
+ aTagStrings[ PDFWriter::H2 ] = "H2";
+ aTagStrings[ PDFWriter::H3 ] = "H3";
+ aTagStrings[ PDFWriter::H4 ] = "H4";
+ aTagStrings[ PDFWriter::H5 ] = "H5";
+ aTagStrings[ PDFWriter::H6 ] = "H6";
+ aTagStrings[ PDFWriter::List ] = "L";
+ aTagStrings[ PDFWriter::ListItem ] = "LI";
+ aTagStrings[ PDFWriter::LILabel ] = "Lbl";
+ aTagStrings[ PDFWriter::LIBody ] = "LBody";
+ aTagStrings[ PDFWriter::Table ] = "Table";
+ aTagStrings[ PDFWriter::TableRow ] = "TR";
+ aTagStrings[ PDFWriter::TableHeader ] = "TH";
+ aTagStrings[ PDFWriter::TableData ] = "TD";
+ aTagStrings[ PDFWriter::Span ] = "Span";
+ aTagStrings[ PDFWriter::Quote ] = "Quote";
+ aTagStrings[ PDFWriter::Note ] = "Note";
+ aTagStrings[ PDFWriter::Reference ] = "Reference";
+ aTagStrings[ PDFWriter::BibEntry ] = "BibEntry";
+ aTagStrings[ PDFWriter::Code ] = "Code";
+ aTagStrings[ PDFWriter::Link ] = "Link";
+ aTagStrings[ PDFWriter::Figure ] = "Figure";
+ aTagStrings[ PDFWriter::Formula ] = "Formula";
+ aTagStrings[ PDFWriter::Form ] = "Form";
}
std::map< PDFWriter::StructElement, const char* >::const_iterator it = aTagStrings.find( eType );
@@ -10888,7 +10888,7 @@ const sal_Char* PDFWriterImpl::getStructureTag( PDFWriter::StructElement eType )
void PDFWriterImpl::beginStructureElementMCSeq()
{
- if( m_bEmitStructure &&
+ if( m_bEmitStructure &&
m_nCurrentStructElement > 0 && // StructTreeRoot
! m_aStructure[ m_nCurrentStructElement ].m_bOpenMCSeq // already opened sequence
)
@@ -11011,10 +11011,10 @@ sal_Int32 PDFWriterImpl::beginStructureElement( PDFWriter::StructElement eType,
sal_Int32 nNewId = sal_Int32(m_aStructure.size());
m_aStructure.push_back( PDFStructureElement() );
PDFStructureElement& rEle = m_aStructure.back();
- rEle.m_eType = eType;
- rEle.m_nOwnElement = nNewId;
- rEle.m_nParentElement = m_nCurrentStructElement;
- rEle.m_nFirstPageObject = m_aPages[ m_nCurrentPage ].m_nPageObject;
+ rEle.m_eType = eType;
+ rEle.m_nOwnElement = nNewId;
+ rEle.m_nParentElement = m_nCurrentStructElement;
+ rEle.m_nFirstPageObject = m_aPages[ m_nCurrentPage ].m_nPageObject;
m_aStructure[ m_nCurrentStructElement ].m_aChildren.push_back( nNewId );
m_nCurrentStructElement = nNewId;
@@ -11047,7 +11047,7 @@ sal_Int32 PDFWriterImpl::beginStructureElement( PDFWriter::StructElement eType,
if( m_bEmitStructure ) // don't create nonexistant objects
{
- rEle.m_nObject = createObject();
+ rEle.m_nObject = createObject();
// update parent's kids list
m_aStructure[ rEle.m_nParentElement ].m_aKids.push_back( rEle.m_nObject );
}
@@ -11102,7 +11102,7 @@ void PDFWriterImpl::endStructureElement()
* This function adds an internal structure list container to overcome the 8191 elements array limitation
* in kids element emission.
* Recursive function
- *
+ *
*/
void PDFWriterImpl::addInternalStructureContainer( PDFStructureElement& rEle )
{
@@ -11160,21 +11160,21 @@ void PDFWriterImpl::addInternalStructureContainer( PDFStructureElement& rEle )
m_aStructure.push_back( PDFStructureElement() );
PDFStructureElement& rEleNew = m_aStructure.back();
rEleNew.m_aAlias = aAliasName;
- rEleNew.m_eType = PDFWriter::Division; // a new Div type container
- rEleNew.m_nOwnElement = nNewId;
- rEleNew.m_nParentElement = nCurrentStructElement;
+ rEleNew.m_eType = PDFWriter::Division; // a new Div type container
+ rEleNew.m_nOwnElement = nNewId;
+ rEleNew.m_nParentElement = nCurrentStructElement;
//inherit the same page as the first child to be reparented
- rEleNew.m_nFirstPageObject = m_aStructure[ rEle.m_aChildren.front() ].m_nFirstPageObject;
+ rEleNew.m_nFirstPageObject = m_aStructure[ rEle.m_aChildren.front() ].m_nFirstPageObject;
rEleNew.m_nObject = createObject();//assign a PDF object number
//add the object to the kid list of the parent
aNewKids.push_back( PDFStructureElementKid( rEleNew.m_nObject ) );
aNewChildren.push_back( nNewId );
-
+
std::list< sal_Int32 >::iterator aChildEndIt( rEle.m_aChildren.begin() );
std::list< PDFStructureElementKid >::iterator aKidEndIt( rEle.m_aKids.begin() );
advance( aChildEndIt, ncMaxPDFArraySize );
advance( aKidEndIt, ncMaxPDFArraySize );
-
+
rEleNew.m_aKids.splice( rEleNew.m_aKids.begin(),
rEle.m_aKids,
rEle.m_aKids.begin(),
@@ -11193,7 +11193,7 @@ void PDFWriterImpl::addInternalStructureContainer( PDFStructureElement& rEle )
//finally add the new kids resulting from the container added
rEle.m_aKids.insert( rEle.m_aKids.begin(), aNewKids.begin(), aNewKids.end() );
rEle.m_aChildren.insert( rEle.m_aChildren.begin(), aNewChildren.begin(), aNewChildren.end() );
- }
+ }
}
}
}
@@ -11248,42 +11248,42 @@ bool PDFWriterImpl::setStructureAttribute( enum PDFWriter::StructAttribute eAttr
switch( eAttr )
{
case PDFWriter::Placement:
- if( eVal == PDFWriter::Block ||
- eVal == PDFWriter::Inline ||
- eVal == PDFWriter::Before ||
- eVal == PDFWriter::Start ||
+ if( eVal == PDFWriter::Block ||
+ eVal == PDFWriter::Inline ||
+ eVal == PDFWriter::Before ||
+ eVal == PDFWriter::Start ||
eVal == PDFWriter::End )
bInsert = true;
break;
case PDFWriter::WritingMode:
- if( eVal == PDFWriter::LrTb ||
- eVal == PDFWriter::RlTb ||
+ if( eVal == PDFWriter::LrTb ||
+ eVal == PDFWriter::RlTb ||
eVal == PDFWriter::TbRl )
{
bInsert = true;
}
break;
case PDFWriter::TextAlign:
- if( eVal == PDFWriter::Start ||
- eVal == PDFWriter::Center ||
- eVal == PDFWriter::End ||
+ if( eVal == PDFWriter::Start ||
+ eVal == PDFWriter::Center ||
+ eVal == PDFWriter::End ||
eVal == PDFWriter::Justify )
{
- if( eType == PDFWriter::Paragraph ||
- eType == PDFWriter::Heading ||
- eType == PDFWriter::H1 ||
- eType == PDFWriter::H2 ||
- eType == PDFWriter::H3 ||
- eType == PDFWriter::H4 ||
- eType == PDFWriter::H5 ||
- eType == PDFWriter::H6 ||
- eType == PDFWriter::List ||
- eType == PDFWriter::ListItem ||
- eType == PDFWriter::LILabel ||
- eType == PDFWriter::LIBody ||
- eType == PDFWriter::Table ||
- eType == PDFWriter::TableRow ||
- eType == PDFWriter::TableHeader ||
+ if( eType == PDFWriter::Paragraph ||
+ eType == PDFWriter::Heading ||
+ eType == PDFWriter::H1 ||
+ eType == PDFWriter::H2 ||
+ eType == PDFWriter::H3 ||
+ eType == PDFWriter::H4 ||
+ eType == PDFWriter::H5 ||
+ eType == PDFWriter::H6 ||
+ eType == PDFWriter::List ||
+ eType == PDFWriter::ListItem ||
+ eType == PDFWriter::LILabel ||
+ eType == PDFWriter::LIBody ||
+ eType == PDFWriter::Table ||
+ eType == PDFWriter::TableRow ||
+ eType == PDFWriter::TableHeader ||
eType == PDFWriter::TableData )
{
bInsert = true;
@@ -11294,11 +11294,11 @@ bool PDFWriterImpl::setStructureAttribute( enum PDFWriter::StructAttribute eAttr
case PDFWriter::Height:
if( eVal == PDFWriter::Auto )
{
- if( eType == PDFWriter::Figure ||
- eType == PDFWriter::Formula ||
- eType == PDFWriter::Form ||
- eType == PDFWriter::Table ||
- eType == PDFWriter::TableHeader ||
+ if( eType == PDFWriter::Figure ||
+ eType == PDFWriter::Formula ||
+ eType == PDFWriter::Form ||
+ eType == PDFWriter::Table ||
+ eType == PDFWriter::TableHeader ||
eType == PDFWriter::TableData )
{
bInsert = true;
@@ -11306,12 +11306,12 @@ bool PDFWriterImpl::setStructureAttribute( enum PDFWriter::StructAttribute eAttr
}
break;
case PDFWriter::BlockAlign:
- if( eVal == PDFWriter::Before ||
- eVal == PDFWriter::Middle ||
- eVal == PDFWriter::After ||
+ if( eVal == PDFWriter::Before ||
+ eVal == PDFWriter::Middle ||
+ eVal == PDFWriter::After ||
eVal == PDFWriter::Justify )
{
- if( eType == PDFWriter::TableHeader ||
+ if( eType == PDFWriter::TableHeader ||
eType == PDFWriter::TableData )
{
bInsert = true;
@@ -11319,11 +11319,11 @@ bool PDFWriterImpl::setStructureAttribute( enum PDFWriter::StructAttribute eAttr
}
break;
case PDFWriter::InlineAlign:
- if( eVal == PDFWriter::Start ||
- eVal == PDFWriter::Center ||
+ if( eVal == PDFWriter::Start ||
+ eVal == PDFWriter::Center ||
eVal == PDFWriter::End )
{
- if( eType == PDFWriter::TableHeader ||
+ if( eType == PDFWriter::TableHeader ||
eType == PDFWriter::TableData )
{
bInsert = true;
@@ -11331,32 +11331,32 @@ bool PDFWriterImpl::setStructureAttribute( enum PDFWriter::StructAttribute eAttr
}
break;
case PDFWriter::LineHeight:
- if( eVal == PDFWriter::Normal ||
+ if( eVal == PDFWriter::Normal ||
eVal == PDFWriter::Auto )
{
// only for ILSE and BLSE
- if( eType == PDFWriter::Paragraph ||
- eType == PDFWriter::Heading ||
- eType == PDFWriter::H1 ||
- eType == PDFWriter::H2 ||
- eType == PDFWriter::H3 ||
- eType == PDFWriter::H4 ||
- eType == PDFWriter::H5 ||
- eType == PDFWriter::H6 ||
- eType == PDFWriter::List ||
- eType == PDFWriter::ListItem ||
- eType == PDFWriter::LILabel ||
- eType == PDFWriter::LIBody ||
- eType == PDFWriter::Table ||
- eType == PDFWriter::TableRow ||
- eType == PDFWriter::TableHeader ||
- eType == PDFWriter::TableData ||
- eType == PDFWriter::Span ||
- eType == PDFWriter::Quote ||
- eType == PDFWriter::Note ||
- eType == PDFWriter::Reference ||
- eType == PDFWriter::BibEntry ||
- eType == PDFWriter::Code ||
+ if( eType == PDFWriter::Paragraph ||
+ eType == PDFWriter::Heading ||
+ eType == PDFWriter::H1 ||
+ eType == PDFWriter::H2 ||
+ eType == PDFWriter::H3 ||
+ eType == PDFWriter::H4 ||
+ eType == PDFWriter::H5 ||
+ eType == PDFWriter::H6 ||
+ eType == PDFWriter::List ||
+ eType == PDFWriter::ListItem ||
+ eType == PDFWriter::LILabel ||
+ eType == PDFWriter::LIBody ||
+ eType == PDFWriter::Table ||
+ eType == PDFWriter::TableRow ||
+ eType == PDFWriter::TableHeader ||
+ eType == PDFWriter::TableData ||
+ eType == PDFWriter::Span ||
+ eType == PDFWriter::Quote ||
+ eType == PDFWriter::Note ||
+ eType == PDFWriter::Reference ||
+ eType == PDFWriter::BibEntry ||
+ eType == PDFWriter::Code ||
eType == PDFWriter::Link )
{
bInsert = true;
@@ -11364,34 +11364,34 @@ bool PDFWriterImpl::setStructureAttribute( enum PDFWriter::StructAttribute eAttr
}
break;
case PDFWriter::TextDecorationType:
- if( eVal == PDFWriter::NONE ||
- eVal == PDFWriter::Underline ||
- eVal == PDFWriter::Overline ||
+ if( eVal == PDFWriter::NONE ||
+ eVal == PDFWriter::Underline ||
+ eVal == PDFWriter::Overline ||
eVal == PDFWriter::LineThrough )
{
// only for ILSE and BLSE
- if( eType == PDFWriter::Paragraph ||
- eType == PDFWriter::Heading ||
- eType == PDFWriter::H1 ||
- eType == PDFWriter::H2 ||
- eType == PDFWriter::H3 ||
- eType == PDFWriter::H4 ||
- eType == PDFWriter::H5 ||
- eType == PDFWriter::H6 ||
- eType == PDFWriter::List ||
- eType == PDFWriter::ListItem ||
- eType == PDFWriter::LILabel ||
- eType == PDFWriter::LIBody ||
- eType == PDFWriter::Table ||
- eType == PDFWriter::TableRow ||
- eType == PDFWriter::TableHeader ||
- eType == PDFWriter::TableData ||
- eType == PDFWriter::Span ||
- eType == PDFWriter::Quote ||
- eType == PDFWriter::Note ||
- eType == PDFWriter::Reference ||
- eType == PDFWriter::BibEntry ||
- eType == PDFWriter::Code ||
+ if( eType == PDFWriter::Paragraph ||
+ eType == PDFWriter::Heading ||
+ eType == PDFWriter::H1 ||
+ eType == PDFWriter::H2 ||
+ eType == PDFWriter::H3 ||
+ eType == PDFWriter::H4 ||
+ eType == PDFWriter::H5 ||
+ eType == PDFWriter::H6 ||
+ eType == PDFWriter::List ||
+ eType == PDFWriter::ListItem ||
+ eType == PDFWriter::LILabel ||
+ eType == PDFWriter::LIBody ||
+ eType == PDFWriter::Table ||
+ eType == PDFWriter::TableRow ||
+ eType == PDFWriter::TableHeader ||
+ eType == PDFWriter::TableData ||
+ eType == PDFWriter::Span ||
+ eType == PDFWriter::Quote ||
+ eType == PDFWriter::Note ||
+ eType == PDFWriter::Reference ||
+ eType == PDFWriter::BibEntry ||
+ eType == PDFWriter::Code ||
eType == PDFWriter::Link )
{
bInsert = true;
@@ -11399,14 +11399,14 @@ bool PDFWriterImpl::setStructureAttribute( enum PDFWriter::StructAttribute eAttr
}
break;
case PDFWriter::ListNumbering:
- if( eVal == PDFWriter::NONE ||
- eVal == PDFWriter::Disc ||
- eVal == PDFWriter::Circle ||
- eVal == PDFWriter::Square ||
- eVal == PDFWriter::Decimal ||
- eVal == PDFWriter::UpperRoman ||
- eVal == PDFWriter::LowerRoman ||
- eVal == PDFWriter::UpperAlpha ||
+ if( eVal == PDFWriter::NONE ||
+ eVal == PDFWriter::Disc ||
+ eVal == PDFWriter::Circle ||
+ eVal == PDFWriter::Square ||
+ eVal == PDFWriter::Decimal ||
+ eVal == PDFWriter::UpperRoman ||
+ eVal == PDFWriter::LowerRoman ||
+ eVal == PDFWriter::UpperAlpha ||
eVal == PDFWriter::LowerAlpha )
{
if( eType == PDFWriter::List )
@@ -11454,21 +11454,21 @@ bool PDFWriterImpl::setStructureAttributeNumerical( enum PDFWriter::StructAttrib
case PDFWriter::StartIndent:
case PDFWriter::EndIndent:
// just for BLSE
- if( eType == PDFWriter::Paragraph ||
- eType == PDFWriter::Heading ||
- eType == PDFWriter::H1 ||
- eType == PDFWriter::H2 ||
- eType == PDFWriter::H3 ||
- eType == PDFWriter::H4 ||
- eType == PDFWriter::H5 ||
- eType == PDFWriter::H6 ||
- eType == PDFWriter::List ||
- eType == PDFWriter::ListItem ||
- eType == PDFWriter::LILabel ||
- eType == PDFWriter::LIBody ||
- eType == PDFWriter::Table ||
- eType == PDFWriter::TableRow ||
- eType == PDFWriter::TableHeader ||
+ if( eType == PDFWriter::Paragraph ||
+ eType == PDFWriter::Heading ||
+ eType == PDFWriter::H1 ||
+ eType == PDFWriter::H2 ||
+ eType == PDFWriter::H3 ||
+ eType == PDFWriter::H4 ||
+ eType == PDFWriter::H5 ||
+ eType == PDFWriter::H6 ||
+ eType == PDFWriter::List ||
+ eType == PDFWriter::ListItem ||
+ eType == PDFWriter::LILabel ||
+ eType == PDFWriter::LIBody ||
+ eType == PDFWriter::Table ||
+ eType == PDFWriter::TableRow ||
+ eType == PDFWriter::TableHeader ||
eType == PDFWriter::TableData )
{
bInsert = true;
@@ -11476,17 +11476,17 @@ bool PDFWriterImpl::setStructureAttributeNumerical( enum PDFWriter::StructAttrib
break;
case PDFWriter::TextIndent:
// paragraph like BLSE and additional elements
- if( eType == PDFWriter::Paragraph ||
- eType == PDFWriter::Heading ||
- eType == PDFWriter::H1 ||
- eType == PDFWriter::H2 ||
- eType == PDFWriter::H3 ||
- eType == PDFWriter::H4 ||
- eType == PDFWriter::H5 ||
- eType == PDFWriter::H6 ||
- eType == PDFWriter::LILabel ||
- eType == PDFWriter::LIBody ||
- eType == PDFWriter::TableHeader ||
+ if( eType == PDFWriter::Paragraph ||
+ eType == PDFWriter::Heading ||
+ eType == PDFWriter::H1 ||
+ eType == PDFWriter::H2 ||
+ eType == PDFWriter::H3 ||
+ eType == PDFWriter::H4 ||
+ eType == PDFWriter::H5 ||
+ eType == PDFWriter::H6 ||
+ eType == PDFWriter::LILabel ||
+ eType == PDFWriter::LIBody ||
+ eType == PDFWriter::TableHeader ||
eType == PDFWriter::TableData )
{
bInsert = true;
@@ -11494,11 +11494,11 @@ bool PDFWriterImpl::setStructureAttributeNumerical( enum PDFWriter::StructAttrib
break;
case PDFWriter::Width:
case PDFWriter::Height:
- if( eType == PDFWriter::Figure ||
- eType == PDFWriter::Formula ||
- eType == PDFWriter::Form ||
- eType == PDFWriter::Table ||
- eType == PDFWriter::TableHeader ||
+ if( eType == PDFWriter::Figure ||
+ eType == PDFWriter::Formula ||
+ eType == PDFWriter::Form ||
+ eType == PDFWriter::Table ||
+ eType == PDFWriter::TableHeader ||
eType == PDFWriter::TableData )
{
bInsert = true;
@@ -11507,28 +11507,28 @@ bool PDFWriterImpl::setStructureAttributeNumerical( enum PDFWriter::StructAttrib
case PDFWriter::LineHeight:
case PDFWriter::BaselineShift:
// only for ILSE and BLSE
- if( eType == PDFWriter::Paragraph ||
- eType == PDFWriter::Heading ||
- eType == PDFWriter::H1 ||
- eType == PDFWriter::H2 ||
- eType == PDFWriter::H3 ||
- eType == PDFWriter::H4 ||
- eType == PDFWriter::H5 ||
- eType == PDFWriter::H6 ||
- eType == PDFWriter::List ||
- eType == PDFWriter::ListItem ||
- eType == PDFWriter::LILabel ||
- eType == PDFWriter::LIBody ||
- eType == PDFWriter::Table ||
- eType == PDFWriter::TableRow ||
- eType == PDFWriter::TableHeader ||
- eType == PDFWriter::TableData ||
- eType == PDFWriter::Span ||
- eType == PDFWriter::Quote ||
- eType == PDFWriter::Note ||
- eType == PDFWriter::Reference ||
- eType == PDFWriter::BibEntry ||
- eType == PDFWriter::Code ||
+ if( eType == PDFWriter::Paragraph ||
+ eType == PDFWriter::Heading ||
+ eType == PDFWriter::H1 ||
+ eType == PDFWriter::H2 ||
+ eType == PDFWriter::H3 ||
+ eType == PDFWriter::H4 ||
+ eType == PDFWriter::H5 ||
+ eType == PDFWriter::H6 ||
+ eType == PDFWriter::List ||
+ eType == PDFWriter::ListItem ||
+ eType == PDFWriter::LILabel ||
+ eType == PDFWriter::LIBody ||
+ eType == PDFWriter::Table ||
+ eType == PDFWriter::TableRow ||
+ eType == PDFWriter::TableHeader ||
+ eType == PDFWriter::TableData ||
+ eType == PDFWriter::Span ||
+ eType == PDFWriter::Quote ||
+ eType == PDFWriter::Note ||
+ eType == PDFWriter::Reference ||
+ eType == PDFWriter::BibEntry ||
+ eType == PDFWriter::Code ||
eType == PDFWriter::Link )
{
bInsert = true;
@@ -11537,7 +11537,7 @@ bool PDFWriterImpl::setStructureAttributeNumerical( enum PDFWriter::StructAttrib
case PDFWriter::RowSpan:
case PDFWriter::ColSpan:
// only for table cells
- if( eType == PDFWriter::TableHeader ||
+ if( eType == PDFWriter::TableHeader ||
eType == PDFWriter::TableData )
{
bInsert = true;
@@ -11575,9 +11575,9 @@ void PDFWriterImpl::setStructureBoundingBox( const Rectangle& rRect )
if( m_nCurrentStructElement > 0 && m_bEmitStructure )
{
PDFWriter::StructElement eType = m_aStructure[ m_nCurrentStructElement ].m_eType;
- if( eType == PDFWriter::Figure ||
- eType == PDFWriter::Formula ||
- eType == PDFWriter::Form ||
+ if( eType == PDFWriter::Figure ||
+ eType == PDFWriter::Formula ||
+ eType == PDFWriter::Form ||
eType == PDFWriter::Table )
{
m_aStructure[ m_nCurrentStructElement ].m_aBBox = rRect;
@@ -11622,8 +11622,8 @@ void PDFWriterImpl::setPageTransition( PDFWriter::PageTransition eType, sal_uInt
if( nPageNr < 0 || nPageNr >= (sal_Int32)m_aPages.size() )
return;
- m_aPages[ nPageNr ].m_eTransition = eType;
- m_aPages[ nPageNr ].m_nTransTime = nMilliSec;
+ m_aPages[ nPageNr ].m_eTransition = eType;
+ m_aPages[ nPageNr ].m_nTransTime = nMilliSec;
}
void PDFWriterImpl::ensureUniqueRadioOnValues()
@@ -11712,9 +11712,9 @@ sal_Int32 PDFWriterImpl::findRadioGroupWidget( const PDFWriter::RadioButtonWidge
// new group, insert the radiobutton
m_aWidgets.push_back( PDFWidget() );
- m_aWidgets.back().m_nObject = createObject();
- m_aWidgets.back().m_nPage = m_nCurrentPage;
- m_aWidgets.back().m_eType = PDFWriter::RadioButton;
+ m_aWidgets.back().m_nObject = createObject();
+ m_aWidgets.back().m_nPage = m_nCurrentPage;
+ m_aWidgets.back().m_eType = PDFWriter::RadioButton;
m_aWidgets.back().m_nRadioGroup = rBtn.RadioGroup;
m_aWidgets.back().m_nFlags |= 0x0000C000; // NoToggleToOff and Radio bits
@@ -11737,10 +11737,10 @@ sal_Int32 PDFWriterImpl::createControl( const PDFWriter::AnyWidget& rControl, sa
sal_Int32 nNewWidget = m_aWidgets.size();
m_aWidgets.push_back( PDFWidget() );
- m_aWidgets.back().m_nObject = createObject();
- m_aWidgets.back().m_aRect = rControl.Location;
- m_aWidgets.back().m_nPage = nPageNr;
- m_aWidgets.back().m_eType = rControl.getType();
+ m_aWidgets.back().m_nObject = createObject();
+ m_aWidgets.back().m_aRect = rControl.Location;
+ m_aWidgets.back().m_nPage = nPageNr;
+ m_aWidgets.back().m_eType = rControl.getType();
sal_Int32 nRadioGroupWidget = -1;
// for unknown reasons the radio buttons of a radio group must not have a
@@ -11754,10 +11754,10 @@ sal_Int32 PDFWriterImpl::createControl( const PDFWriter::AnyWidget& rControl, sa
}
// caution: m_aWidgets must not be changed after here or rNewWidget may be invalid
- PDFWidget& rNewWidget = m_aWidgets[nNewWidget];
- rNewWidget.m_aDescription = rControl.Description;
- rNewWidget.m_aText = rControl.Text;
- rNewWidget.m_nTextStyle = rControl.TextStyle &
+ PDFWidget& rNewWidget = m_aWidgets[nNewWidget];
+ rNewWidget.m_aDescription = rControl.Description;
+ rNewWidget.m_aText = rControl.Text;
+ rNewWidget.m_nTextStyle = rControl.TextStyle &
( TEXT_DRAW_LEFT | TEXT_DRAW_CENTER | TEXT_DRAW_RIGHT | TEXT_DRAW_TOP |
TEXT_DRAW_VCENTER | TEXT_DRAW_BOTTOM |
TEXT_DRAW_MULTILINE | TEXT_DRAW_WORDBREAK );
@@ -11794,8 +11794,8 @@ sal_Int32 PDFWriterImpl::createControl( const PDFWriter::AnyWidget& rControl, sa
* so we need to create a radio button on demand for a new group
* and insert a checkbox for each RadioButtonWidget as its child
*/
- rNewWidget.m_eType = PDFWriter::CheckBox;
- rNewWidget.m_nRadioGroup = rBtn.RadioGroup;
+ rNewWidget.m_eType = PDFWriter::CheckBox;
+ rNewWidget.m_nRadioGroup = rBtn.RadioGroup;
DBG_ASSERT( nRadioGroupWidget >= 0 && nRadioGroupWidget < (sal_Int32)m_aWidgets.size(), "no radio group parent" );
@@ -11808,8 +11808,8 @@ sal_Int32 PDFWriterImpl::createControl( const PDFWriter::AnyWidget& rControl, sa
rNewWidget.m_aOnValue = rBtn.OnValue;
if( ! rRadioButton.m_aValue.getLength() && rBtn.Selected )
{
- rNewWidget.m_aValue = rNewWidget.m_aOnValue;
- rRadioButton.m_aValue = rNewWidget.m_aOnValue;
+ rNewWidget.m_aValue = rNewWidget.m_aOnValue;
+ rRadioButton.m_aValue = rNewWidget.m_aOnValue;
}
createDefaultRadioButtonAppearance( rNewWidget, rBtn );
@@ -11835,9 +11835,9 @@ sal_Int32 PDFWriterImpl::createControl( const PDFWriter::AnyWidget& rControl, sa
rNewWidget.m_nTextStyle = TEXT_DRAW_VCENTER;
const PDFWriter::ListBoxWidget& rLstBox = static_cast<const PDFWriter::ListBoxWidget&>(rControl);
- rNewWidget.m_aListEntries = rLstBox.Entries;
+ rNewWidget.m_aListEntries = rLstBox.Entries;
rNewWidget.m_aSelectedEntries = rLstBox.SelectedEntries;
- rNewWidget.m_aValue = rLstBox.Text;
+ rNewWidget.m_aValue = rLstBox.Text;
if( rLstBox.DropDown )
rNewWidget.m_nFlags |= 0x00020000;
if( rLstBox.Sort )
@@ -11853,28 +11853,28 @@ sal_Int32 PDFWriterImpl::createControl( const PDFWriter::AnyWidget& rControl, sa
rNewWidget.m_nTextStyle = TEXT_DRAW_VCENTER;
const PDFWriter::ComboBoxWidget& rBox = static_cast<const PDFWriter::ComboBoxWidget&>(rControl);
- rNewWidget.m_aValue = rBox.Text;
- rNewWidget.m_aListEntries = rBox.Entries;
+ rNewWidget.m_aValue = rBox.Text;
+ rNewWidget.m_aListEntries = rBox.Entries;
rNewWidget.m_nFlags |= 0x00060000; // combo and edit flag
if( rBox.Sort )
rNewWidget.m_nFlags |= 0x00080000;
PDFWriter::ListBoxWidget aLBox;
- aLBox.Name = rBox.Name;
- aLBox.Description = rBox.Description;
- aLBox.Text = rBox.Text;
- aLBox.TextStyle = rBox.TextStyle;
- aLBox.ReadOnly = rBox.ReadOnly;
- aLBox.Border = rBox.Border;
- aLBox.BorderColor = rBox.BorderColor;
- aLBox.Background = rBox.Background;
- aLBox.BackgroundColor = rBox.BackgroundColor;
- aLBox.TextFont = rBox.TextFont;
- aLBox.TextColor = rBox.TextColor;
- aLBox.DropDown = true;
- aLBox.Sort = rBox.Sort;
- aLBox.MultiSelect = false;
- aLBox.Entries = rBox.Entries;
+ aLBox.Name = rBox.Name;
+ aLBox.Description = rBox.Description;
+ aLBox.Text = rBox.Text;
+ aLBox.TextStyle = rBox.TextStyle;
+ aLBox.ReadOnly = rBox.ReadOnly;
+ aLBox.Border = rBox.Border;
+ aLBox.BorderColor = rBox.BorderColor;
+ aLBox.Background = rBox.Background;
+ aLBox.BackgroundColor = rBox.BackgroundColor;
+ aLBox.TextFont = rBox.TextFont;
+ aLBox.TextColor = rBox.TextColor;
+ aLBox.DropDown = true;
+ aLBox.Sort = rBox.Sort;
+ aLBox.MultiSelect = false;
+ aLBox.Entries = rBox.Entries;
createDefaultListBoxAppearance( rNewWidget, aLBox );
}