convert DestAreaType to scoped enum
and drop read-only enumerators Change-Id: Ibc4c2a99448a83fc179e2779f8f3e5c8f034ae7b Reviewed-on: https://gerrit.libreoffice.org/34059 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
parent
a25b1ff25a
commit
76e0f23171
@ -226,7 +226,7 @@ public:
|
||||
|
||||
/** provides detailed information about a destination range which previously has been registered using RegisterDest.
|
||||
*/
|
||||
void DescribeRegisteredDest( sal_Int32 nDestId, const Rectangle& rRect, sal_Int32 nPageNr, PDFWriter::DestAreaType eType = PDFWriter::XYZ );
|
||||
void DescribeRegisteredDest( sal_Int32 nDestId, const Rectangle& rRect, sal_Int32 nPageNr, PDFWriter::DestAreaType eType = PDFWriter::DestAreaType::XYZ );
|
||||
|
||||
//<---i56629
|
||||
|
||||
@ -246,7 +246,7 @@ public:
|
||||
the destination id (to be used in SetLinkDest) or
|
||||
-1 if page id does not exist
|
||||
*/
|
||||
sal_Int32 CreateDest( const Rectangle& rRect, sal_Int32 nPageNr = -1, PDFWriter::DestAreaType eType = PDFWriter::XYZ );
|
||||
sal_Int32 CreateDest( const Rectangle& rRect, sal_Int32 nPageNr = -1, PDFWriter::DestAreaType eType = PDFWriter::DestAreaType::XYZ );
|
||||
/** Create a new link on a page
|
||||
|
||||
@param rRect
|
||||
|
@ -107,10 +107,7 @@ public:
|
||||
enum PDFVersion { PDF_1_2, PDF_1_3, PDF_1_4, PDF_1_5, PDF_A_1 };//i59651, PDF/A-1b & -1a, only -1b implemented for now
|
||||
// for the meaning of DestAreaType please look at PDF Reference Manual
|
||||
// version 1.4 section 8.2.1, page 475
|
||||
enum DestAreaType { XYZ, Fit, FitHorizontal, FitVertical,
|
||||
FitRectangle, FitPageBoundingBox, FitPageBoundingBoxHorizontal,
|
||||
FitPageBoundingBoxVertical
|
||||
};
|
||||
enum class DestAreaType { XYZ, FitRectangle };
|
||||
|
||||
// for a definition of structural element types please refer to
|
||||
// PDF Reference, 3rd ed. section 9.7.4
|
||||
|
@ -1657,14 +1657,14 @@ void ImplPDFExportShapeInteraction( const uno::Reference< drawing::XShape >& xSh
|
||||
case presentation::ClickAction_LASTPAGE :
|
||||
{
|
||||
sal_Int32 nCount = rDoc.GetSdPageCount( PageKind::Standard );
|
||||
sal_Int32 nDestId = rPDFExtOutDevData.CreateDest( aPageRect, nCount - 1, vcl::PDFWriter::FitRectangle );
|
||||
sal_Int32 nDestId = rPDFExtOutDevData.CreateDest( aPageRect, nCount - 1, vcl::PDFWriter::DestAreaType::FitRectangle );
|
||||
sal_Int32 nLinkId = rPDFExtOutDevData.CreateLink( aLinkRect );
|
||||
rPDFExtOutDevData.SetLinkDest( nLinkId, nDestId );
|
||||
}
|
||||
break;
|
||||
case presentation::ClickAction_FIRSTPAGE :
|
||||
{
|
||||
sal_Int32 nDestId = rPDFExtOutDevData.CreateDest( aPageRect, 0, vcl::PDFWriter::FitRectangle );
|
||||
sal_Int32 nDestId = rPDFExtOutDevData.CreateDest( aPageRect, 0, vcl::PDFWriter::DestAreaType::FitRectangle );
|
||||
sal_Int32 nLinkId = rPDFExtOutDevData.CreateLink( aLinkRect );
|
||||
rPDFExtOutDevData.SetLinkDest( nLinkId, nDestId );
|
||||
}
|
||||
@ -1674,7 +1674,7 @@ void ImplPDFExportShapeInteraction( const uno::Reference< drawing::XShape >& xSh
|
||||
sal_Int32 nDestPage = rPDFExtOutDevData.GetCurrentPageNumber();
|
||||
if ( nDestPage )
|
||||
nDestPage--;
|
||||
sal_Int32 nDestId = rPDFExtOutDevData.CreateDest( aPageRect, nDestPage, vcl::PDFWriter::FitRectangle );
|
||||
sal_Int32 nDestId = rPDFExtOutDevData.CreateDest( aPageRect, nDestPage, vcl::PDFWriter::DestAreaType::FitRectangle );
|
||||
sal_Int32 nLinkId = rPDFExtOutDevData.CreateLink( aLinkRect );
|
||||
rPDFExtOutDevData.SetLinkDest( nLinkId, nDestId );
|
||||
}
|
||||
@ -1685,7 +1685,7 @@ void ImplPDFExportShapeInteraction( const uno::Reference< drawing::XShape >& xSh
|
||||
sal_Int32 nLastPage = rDoc.GetSdPageCount( PageKind::Standard ) - 1;
|
||||
if ( nDestPage > nLastPage )
|
||||
nDestPage = nLastPage;
|
||||
sal_Int32 nDestId = rPDFExtOutDevData.CreateDest( aPageRect, nDestPage, vcl::PDFWriter::FitRectangle );
|
||||
sal_Int32 nDestId = rPDFExtOutDevData.CreateDest( aPageRect, nDestPage, vcl::PDFWriter::DestAreaType::FitRectangle );
|
||||
sal_Int32 nLinkId = rPDFExtOutDevData.CreateLink( aLinkRect );
|
||||
rPDFExtOutDevData.SetLinkDest( nLinkId, nDestId );
|
||||
}
|
||||
@ -1713,7 +1713,7 @@ void ImplPDFExportShapeInteraction( const uno::Reference< drawing::XShape >& xSh
|
||||
sal_Int32 nPage = ImplPDFGetBookmarkPage( aBookmark, rDoc );
|
||||
if ( nPage != -1 )
|
||||
{
|
||||
sal_Int32 nDestId = rPDFExtOutDevData.CreateDest( aPageRect, nPage, vcl::PDFWriter::FitRectangle );
|
||||
sal_Int32 nDestId = rPDFExtOutDevData.CreateDest( aPageRect, nPage, vcl::PDFWriter::DestAreaType::FitRectangle );
|
||||
sal_Int32 nLinkId = rPDFExtOutDevData.CreateLink( aLinkRect );
|
||||
rPDFExtOutDevData.SetLinkDest( nLinkId, nDestId );
|
||||
}
|
||||
@ -2126,9 +2126,9 @@ void SAL_CALL SdXImpressDocument::render( sal_Int32 nRenderer, const uno::Any& r
|
||||
if ( nPage != -1 )
|
||||
{
|
||||
if ( aIBeg->nLinkId != -1 )
|
||||
pPDFExtOutDevData->SetLinkDest( aIBeg->nLinkId, pPDFExtOutDevData->CreateDest( aPageRect, nPage, vcl::PDFWriter::FitRectangle ) );
|
||||
pPDFExtOutDevData->SetLinkDest( aIBeg->nLinkId, pPDFExtOutDevData->CreateDest( aPageRect, nPage, vcl::PDFWriter::DestAreaType::FitRectangle ) );
|
||||
else
|
||||
pPDFExtOutDevData->DescribeRegisteredDest( aIBeg->nDestId, aPageRect, nPage, vcl::PDFWriter::FitRectangle );
|
||||
pPDFExtOutDevData->DescribeRegisteredDest( aIBeg->nDestId, aPageRect, nPage, vcl::PDFWriter::DestAreaType::FitRectangle );
|
||||
}
|
||||
else
|
||||
pPDFExtOutDevData->SetLinkURL( aIBeg->nLinkId, aIBeg->aBookmark );
|
||||
|
@ -616,7 +616,7 @@ sal_Int32 PDFExtOutDevData::CreateNamedDest(const OUString& sDestName, const Re
|
||||
mpGlobalSyncData->mParaRects.push_back( rRect );
|
||||
mpGlobalSyncData->mParaMapModes.push_back( mrOutDev.GetMapMode() );
|
||||
mpGlobalSyncData->mParaInts.push_back( nPageNr == -1 ? mnPage : nPageNr );
|
||||
mpGlobalSyncData->mParaDestAreaTypes.push_back( PDFWriter::XYZ );
|
||||
mpGlobalSyncData->mParaDestAreaTypes.push_back( PDFWriter::DestAreaType::XYZ );
|
||||
|
||||
return mpGlobalSyncData->mCurId++;
|
||||
}
|
||||
|
@ -3714,7 +3714,7 @@ bool PDFWriterImpl::appendDest( sal_Int32 nDestID, OStringBuffer& rBuffer )
|
||||
|
||||
switch( rDest.m_eType )
|
||||
{
|
||||
case PDFWriter::XYZ:
|
||||
case PDFWriter::DestAreaType::XYZ:
|
||||
default:
|
||||
rBuffer.append( "/XYZ " );
|
||||
appendFixedInt( rDest.m_aRect.Left(), rBuffer );
|
||||
@ -3722,10 +3722,7 @@ bool PDFWriterImpl::appendDest( sal_Int32 nDestID, OStringBuffer& rBuffer )
|
||||
appendFixedInt( rDest.m_aRect.Bottom(), rBuffer );
|
||||
rBuffer.append( " 0" );
|
||||
break;
|
||||
case PDFWriter::Fit:
|
||||
rBuffer.append( "/Fit" );
|
||||
break;
|
||||
case PDFWriter::FitRectangle:
|
||||
case PDFWriter::DestAreaType::FitRectangle:
|
||||
rBuffer.append( "/FitR " );
|
||||
appendFixedInt( rDest.m_aRect.Left(), rBuffer );
|
||||
rBuffer.append( ' ' );
|
||||
@ -3735,25 +3732,6 @@ bool PDFWriterImpl::appendDest( sal_Int32 nDestID, OStringBuffer& rBuffer )
|
||||
rBuffer.append( ' ' );
|
||||
appendFixedInt( rDest.m_aRect.Bottom(), rBuffer );
|
||||
break;
|
||||
case PDFWriter::FitHorizontal:
|
||||
rBuffer.append( "/FitH " );
|
||||
appendFixedInt( rDest.m_aRect.Bottom(), rBuffer );
|
||||
break;
|
||||
case PDFWriter::FitVertical:
|
||||
rBuffer.append( "/FitV " );
|
||||
appendFixedInt( rDest.m_aRect.Left(), rBuffer );
|
||||
break;
|
||||
case PDFWriter::FitPageBoundingBox:
|
||||
rBuffer.append( "/FitB" );
|
||||
break;
|
||||
case PDFWriter::FitPageBoundingBoxHorizontal:
|
||||
rBuffer.append( "/FitBH " );
|
||||
appendFixedInt( rDest.m_aRect.Bottom(), rBuffer );
|
||||
break;
|
||||
case PDFWriter::FitPageBoundingBoxVertical:
|
||||
rBuffer.append( "/FitBV " );
|
||||
appendFixedInt( rDest.m_aRect.Left(), rBuffer );
|
||||
break;
|
||||
}
|
||||
rBuffer.append( ']' );
|
||||
|
||||
@ -7477,7 +7455,7 @@ sal_Int32 PDFWriterImpl::emitNamedDestinations()
|
||||
|
||||
switch( rDest.m_eType )
|
||||
{
|
||||
case PDFWriter::XYZ:
|
||||
case PDFWriter::DestAreaType::XYZ:
|
||||
default:
|
||||
aLine.append( "/XYZ " );
|
||||
appendFixedInt( rDest.m_aRect.Left(), aLine );
|
||||
@ -7485,10 +7463,7 @@ sal_Int32 PDFWriterImpl::emitNamedDestinations()
|
||||
appendFixedInt( rDest.m_aRect.Bottom(), aLine );
|
||||
aLine.append( " 0" );
|
||||
break;
|
||||
case PDFWriter::Fit:
|
||||
aLine.append( "/Fit" );
|
||||
break;
|
||||
case PDFWriter::FitRectangle:
|
||||
case PDFWriter::DestAreaType::FitRectangle:
|
||||
aLine.append( "/FitR " );
|
||||
appendFixedInt( rDest.m_aRect.Left(), aLine );
|
||||
aLine.append( ' ' );
|
||||
@ -7498,25 +7473,6 @@ sal_Int32 PDFWriterImpl::emitNamedDestinations()
|
||||
aLine.append( ' ' );
|
||||
appendFixedInt( rDest.m_aRect.Bottom(), aLine );
|
||||
break;
|
||||
case PDFWriter::FitHorizontal:
|
||||
aLine.append( "/FitH " );
|
||||
appendFixedInt( rDest.m_aRect.Bottom(), aLine );
|
||||
break;
|
||||
case PDFWriter::FitVertical:
|
||||
aLine.append( "/FitV " );
|
||||
appendFixedInt( rDest.m_aRect.Left(), aLine );
|
||||
break;
|
||||
case PDFWriter::FitPageBoundingBox:
|
||||
aLine.append( "/FitB" );
|
||||
break;
|
||||
case PDFWriter::FitPageBoundingBoxHorizontal:
|
||||
aLine.append( "/FitBH " );
|
||||
appendFixedInt( rDest.m_aRect.Bottom(), aLine );
|
||||
break;
|
||||
case PDFWriter::FitPageBoundingBoxVertical:
|
||||
aLine.append( "/FitBV " );
|
||||
appendFixedInt( rDest.m_aRect.Left(), aLine );
|
||||
break;
|
||||
}
|
||||
aLine.append( "]\n" );
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user