Kaydet (Commit) c1cad9bb authored tarafından Caolán McNamara's avatar Caolán McNamara

Resolves: fdo#78204 adjust note icons on comments-in-margins case

the page has been scaled by 75% and vertically centered so the page positions
need to be also adjusted.

Change-Id: I7ab6b4956933ba444441c857e78aee8e5c1cf97a
üst c008e4a4
...@@ -36,6 +36,8 @@ namespace vcl ...@@ -36,6 +36,8 @@ namespace vcl
class OutputDevice; class OutputDevice;
class SwFrm; class SwFrm;
class SwLinePortion; class SwLinePortion;
class SwPageFrm;
class SwPrintData;
class SwTxtPainter; class SwTxtPainter;
class SwEditShell; class SwEditShell;
class StringRangeEnumerator; class StringRangeEnumerator;
...@@ -207,6 +209,8 @@ class SwEnhancedPDFExportHelper ...@@ -207,6 +209,8 @@ class SwEnhancedPDFExportHelper
bool mbSkipEmptyPages; bool mbSkipEmptyPages;
bool mbEditEngineOnly; bool mbEditEngineOnly;
const SwPrintData& mrPrintData;
static TableColumnsMap aTableColumnsMap; static TableColumnsMap aTableColumnsMap;
static LinkIdMap aLinkIdMap; static LinkIdMap aLinkIdMap;
static NumListIdMap aNumListIdMap; static NumListIdMap aNumListIdMap;
...@@ -229,7 +233,8 @@ class SwEnhancedPDFExportHelper ...@@ -229,7 +233,8 @@ class SwEnhancedPDFExportHelper
OutputDevice& rOut, OutputDevice& rOut,
const OUString& rPageRange, const OUString& rPageRange,
bool bSkipEmptyPages, bool bSkipEmptyPages,
bool bEditEngineOnly ); bool bEditEngineOnly,
const SwPrintData& rPrintData );
~SwEnhancedPDFExportHelper(); ~SwEnhancedPDFExportHelper();
...@@ -240,6 +245,10 @@ class SwEnhancedPDFExportHelper ...@@ -240,6 +245,10 @@ class SwEnhancedPDFExportHelper
static FrmTagIdMap& GetFrmTagIdMap() { return aFrmTagIdMap; } static FrmTagIdMap& GetFrmTagIdMap() { return aFrmTagIdMap; }
static LanguageType GetDefaultLanguage() {return eLanguageDefault; } static LanguageType GetDefaultLanguage() {return eLanguageDefault; }
//scale and position rRectangle if we're scaling due to notes in margins.
Rectangle SwRectToPDFRect(const SwPageFrm* pCurrPage,
const Rectangle& rRectangle) const;
}; };
#endif #endif
......
...@@ -69,6 +69,7 @@ ...@@ -69,6 +69,7 @@
#include <itrpaint.hxx> #include <itrpaint.hxx>
#include <i18nlangtag/languagetag.hxx> #include <i18nlangtag/languagetag.hxx>
#include <IMark.hxx> #include <IMark.hxx>
#include <printdata.hxx>
#include <SwNodeNum.hxx> #include <SwNodeNum.hxx>
#include <switerator.hxx> #include <switerator.hxx>
#include <stack> #include <stack>
...@@ -677,7 +678,9 @@ void SwTaggedPDFHelper::SetAttributes( vcl::PDFWriter::StructElement eType ) ...@@ -677,7 +678,9 @@ void SwTaggedPDFHelper::SetAttributes( vcl::PDFWriter::StructElement eType )
( pFrm->IsTabFrm() && ( pFrm->IsTabFrm() &&
!static_cast<const SwTabFrm*>(pFrm)->IsFollow() && !static_cast<const SwTabFrm*>(pFrm)->IsFollow() &&
!static_cast<const SwTabFrm*>(pFrm)->HasFollow() ) ) !static_cast<const SwTabFrm*>(pFrm)->HasFollow() ) )
mpPDFExtOutDevData->SetStructureBoundingBox( pFrm->Frm().SVRect() ); {
mpPDFExtOutDevData->SetStructureBoundingBox(pFrm->Frm().SVRect());
}
} }
if ( bRowSpan ) if ( bRowSpan )
...@@ -1447,12 +1450,14 @@ SwEnhancedPDFExportHelper::SwEnhancedPDFExportHelper( SwEditShell& rSh, ...@@ -1447,12 +1450,14 @@ SwEnhancedPDFExportHelper::SwEnhancedPDFExportHelper( SwEditShell& rSh,
OutputDevice& rOut, OutputDevice& rOut,
const OUString& rPageRange, const OUString& rPageRange,
bool bSkipEmptyPages, bool bSkipEmptyPages,
bool bEditEngineOnly ) bool bEditEngineOnly,
const SwPrintData& rPrintData )
: mrSh( rSh ), : mrSh( rSh ),
mrOut( rOut ), mrOut( rOut ),
mpRangeEnum( 0 ), mpRangeEnum( 0 ),
mbSkipEmptyPages( bSkipEmptyPages ), mbSkipEmptyPages( bSkipEmptyPages ),
mbEditEngineOnly( bEditEngineOnly ) mbEditEngineOnly( bEditEngineOnly ),
mrPrintData( rPrintData )
{ {
if ( !rPageRange.isEmpty() ) if ( !rPageRange.isEmpty() )
mpRangeEnum = new StringRangeEnumerator( rPageRange, 0, mrSh.GetPageCount()-1 ); mpRangeEnum = new StringRangeEnumerator( rPageRange, 0, mrSh.GetPageCount()-1 );
...@@ -1502,6 +1507,29 @@ SwEnhancedPDFExportHelper::~SwEnhancedPDFExportHelper() ...@@ -1502,6 +1507,29 @@ SwEnhancedPDFExportHelper::~SwEnhancedPDFExportHelper()
delete mpRangeEnum; delete mpRangeEnum;
} }
Rectangle SwEnhancedPDFExportHelper::SwRectToPDFRect(const SwPageFrm* pCurrPage,
const Rectangle& rRectangle) const
{
sal_Int16 nPostItMode = mrPrintData.GetPrintPostIts();
if (nPostItMode != POSTITS_INMARGINS)
return rRectangle;
//the page has been scaled by 75% and vertically centered, so adjust these
//rectangles equivalently
Rectangle aRect(rRectangle);
Size aRectSize(aRect.GetSize());
double fScale = 0.75;
aRectSize.Width() = (aRectSize.Width() * fScale);
aRectSize.Height() = (aRectSize.Height() * fScale);
long nOrigHeight = pCurrPage->Frm().Height();
long nNewHeight = nOrigHeight*fScale;
long nShiftY = (nOrigHeight-nNewHeight)/2;
aRect.Left() = (aRect.Left() * fScale);
aRect.Top() = (aRect.Top() * fScale);
aRect.Move(0, nShiftY);
aRect.SetSize(aRectSize);
return aRect;
}
void SwEnhancedPDFExportHelper::EnhancedPDFExport() void SwEnhancedPDFExportHelper::EnhancedPDFExport()
{ {
vcl::PDFExtOutDevData* pPDFExtOutDevData = vcl::PDFExtOutDevData* pPDFExtOutDevData =
...@@ -1555,6 +1583,8 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport() ...@@ -1555,6 +1583,8 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport()
{ {
// Link Rectangle // Link Rectangle
const SwRect& rNoteRect = mrSh.GetCharRect(); const SwRect& rNoteRect = mrSh.GetCharRect();
const SwPageFrm* pCurrPage =
static_cast<const SwPageFrm*>( mrSh.GetLayout()->Lower() );
// Link PageNums // Link PageNums
std::vector<sal_Int32> aNotePageNums = CalcOutputPageNums( rNoteRect ); std::vector<sal_Int32> aNotePageNums = CalcOutputPageNums( rNoteRect );
...@@ -1580,7 +1610,8 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport() ...@@ -1580,7 +1610,8 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport()
aNote.Contents = pField->GetTxt(); aNote.Contents = pField->GetTxt();
// Link Export // Link Export
pPDFExtOutDevData->CreateNote( rNoteRect.SVRect(), aNote, aNotePageNums[nNumIdx] ); Rectangle aRect(SwRectToPDFRect(pCurrPage, rNoteRect.SVRect()));
pPDFExtOutDevData->CreateNote(aRect, aNote, aNotePageNums[nNumIdx]);
} }
} }
} }
...@@ -1632,6 +1663,9 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport() ...@@ -1632,6 +1663,9 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport()
aTmp.insert( aTmp.begin(), mrSh.SwCrsrShell::_GetCrsr()->begin(), mrSh.SwCrsrShell::_GetCrsr()->end() ); aTmp.insert( aTmp.begin(), mrSh.SwCrsrShell::_GetCrsr()->begin(), mrSh.SwCrsrShell::_GetCrsr()->end() );
OSL_ENSURE( !aTmp.empty(), "Enhanced pdf export - rectangles are missing" ); OSL_ENSURE( !aTmp.empty(), "Enhanced pdf export - rectangles are missing" );
const SwPageFrm* pSelectionPage =
static_cast<const SwPageFrm*>( mrSh.GetLayout()->Lower() );
// Create the destination for internal links: // Create the destination for internal links:
sal_Int32 nDestId = -1; sal_Int32 nDestId = -1;
if ( bIntern ) if ( bIntern )
...@@ -1643,12 +1677,18 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport() ...@@ -1643,12 +1677,18 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport()
// Destination Rectangle // Destination Rectangle
const SwRect& rDestRect = mrSh.GetCharRect(); const SwRect& rDestRect = mrSh.GetCharRect();
const SwPageFrm* pCurrPage =
static_cast<const SwPageFrm*>( mrSh.GetLayout()->Lower() );
// Destination PageNum // Destination PageNum
const sal_Int32 nDestPageNum = CalcOutputPageNum( rDestRect ); const sal_Int32 nDestPageNum = CalcOutputPageNum( rDestRect );
// Destination Export // Destination Export
if ( -1 != nDestPageNum ) if ( -1 != nDestPageNum )
nDestId = pPDFExtOutDevData->CreateDest( rDestRect.SVRect(), nDestPageNum ); {
Rectangle aRect(SwRectToPDFRect(pCurrPage, rDestRect.SVRect()));
nDestId = pPDFExtOutDevData->CreateDest(aRect, nDestPageNum);
}
} }
if ( !bIntern || -1 != nDestId ) if ( !bIntern || -1 != nDestId )
...@@ -1670,8 +1710,9 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport() ...@@ -1670,8 +1710,9 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport()
for ( size_t nNumIdx = 0; nNumIdx < aLinkPageNums.size(); ++nNumIdx ) for ( size_t nNumIdx = 0; nNumIdx < aLinkPageNums.size(); ++nNumIdx )
{ {
// Link Export // Link Export
Rectangle aRect(SwRectToPDFRect(pSelectionPage, rLinkRect.SVRect()));
const sal_Int32 nLinkId = const sal_Int32 nLinkId =
pPDFExtOutDevData->CreateLink( rLinkRect.SVRect(), aLinkPageNums[nNumIdx] ); pPDFExtOutDevData->CreateLink(aRect, aLinkPageNums[nNumIdx]);
// Store link info for tagged pdf output: // Store link info for tagged pdf output:
const IdMapEntry aLinkEntry( rLinkRect, nLinkId ); const IdMapEntry aLinkEntry( rLinkRect, nLinkId );
...@@ -1705,6 +1746,9 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport() ...@@ -1705,6 +1746,9 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport()
if ( RES_DRAWFRMFMT != pFrmFmt->Which() && if ( RES_DRAWFRMFMT != pFrmFmt->Which() &&
SFX_ITEM_SET == pFrmFmt->GetAttrSet().GetItemState( RES_URL, true, &pItem ) ) SFX_ITEM_SET == pFrmFmt->GetAttrSet().GetItemState( RES_URL, true, &pItem ) )
{ {
const SwPageFrm* pCurrPage =
static_cast<const SwPageFrm*>( mrSh.GetLayout()->Lower() );
OUString aURL( static_cast<const SwFmtURL*>(pItem)->GetURL() ); OUString aURL( static_cast<const SwFmtURL*>(pItem)->GetURL() );
const bool bIntern = '#' == aURL[0]; const bool bIntern = '#' == aURL[0];
...@@ -1719,12 +1763,17 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport() ...@@ -1719,12 +1763,17 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport()
// Destination Rectangle // Destination Rectangle
const SwRect& rDestRect = mrSh.GetCharRect(); const SwRect& rDestRect = mrSh.GetCharRect();
pCurrPage = static_cast<const SwPageFrm*>( mrSh.GetLayout()->Lower() );
// Destination PageNum // Destination PageNum
const sal_Int32 nDestPageNum = CalcOutputPageNum( rDestRect ); const sal_Int32 nDestPageNum = CalcOutputPageNum( rDestRect );
// Destination Export // Destination Export
if ( -1 != nDestPageNum ) if ( -1 != nDestPageNum )
nDestId = pPDFExtOutDevData->CreateDest( rDestRect.SVRect(), nDestPageNum ); {
Rectangle aRect(SwRectToPDFRect(pCurrPage, rDestRect.SVRect()));
nDestId = pPDFExtOutDevData->CreateDest(aRect, nDestPageNum);
}
} }
if ( !bIntern || -1 != nDestId ) if ( !bIntern || -1 != nDestId )
...@@ -1738,8 +1787,9 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport() ...@@ -1738,8 +1787,9 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport()
// Link Export // Link Export
for ( size_t nNumIdx = 0; nNumIdx < aLinkPageNums.size(); ++nNumIdx ) for ( size_t nNumIdx = 0; nNumIdx < aLinkPageNums.size(); ++nNumIdx )
{ {
Rectangle aRect(SwRectToPDFRect(pCurrPage, aLinkRect.SVRect()));
const sal_Int32 nLinkId = const sal_Int32 nLinkId =
pPDFExtOutDevData->CreateLink( aLinkRect.SVRect(), aLinkPageNums[nNumIdx] ); pPDFExtOutDevData->CreateLink(aRect, aLinkPageNums[nNumIdx]);
// Connect Link and Destination: // Connect Link and Destination:
if ( bIntern ) if ( bIntern )
...@@ -1801,13 +1851,16 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport() ...@@ -1801,13 +1851,16 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport()
mrSh.GotoRefMark( rRefName, pField->GetSubType(), pField->GetSeqNo() ); mrSh.GotoRefMark( rRefName, pField->GetSubType(), pField->GetSeqNo() );
const SwRect& rDestRect = mrSh.GetCharRect(); const SwRect& rDestRect = mrSh.GetCharRect();
const SwPageFrm* pCurrPage = static_cast<const SwPageFrm*>( mrSh.GetLayout()->Lower() );
// Destination PageNum // Destination PageNum
const sal_Int32 nDestPageNum = CalcOutputPageNum( rDestRect ); const sal_Int32 nDestPageNum = CalcOutputPageNum( rDestRect );
if ( -1 != nDestPageNum ) if ( -1 != nDestPageNum )
{ {
// Destination Export // Destination Export
const sal_Int32 nDestId = pPDFExtOutDevData->CreateDest( rDestRect.SVRect(), nDestPageNum ); Rectangle aRect(SwRectToPDFRect(pCurrPage, rDestRect.SVRect()));
const sal_Int32 nDestId = pPDFExtOutDevData->CreateDest(aRect, nDestPageNum);
// #i44368# Links in Header/Footer // #i44368# Links in Header/Footer
const SwPosition aPos( *pTNd ); const SwPosition aPos( *pTNd );
...@@ -1826,8 +1879,9 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport() ...@@ -1826,8 +1879,9 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport()
for ( size_t nNumIdx = 0; nNumIdx < aLinkPageNums.size(); ++nNumIdx ) for ( size_t nNumIdx = 0; nNumIdx < aLinkPageNums.size(); ++nNumIdx )
{ {
// Link Export // Link Export
aRect = SwRectToPDFRect(pCurrPage, rLinkRect.SVRect());
const sal_Int32 nLinkId = const sal_Int32 nLinkId =
pPDFExtOutDevData->CreateLink( rLinkRect.SVRect(), aLinkPageNums[nNumIdx] ); pPDFExtOutDevData->CreateLink(aRect, aLinkPageNums[nNumIdx]);
// Store link info for tagged pdf output: // Store link info for tagged pdf output:
const IdMapEntry aLinkEntry( rLinkRect, nLinkId ); const IdMapEntry aLinkEntry( rLinkRect, nLinkId );
...@@ -1893,14 +1947,18 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport() ...@@ -1893,14 +1947,18 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport()
// Destination Rectangle // Destination Rectangle
const SwRect& rDestRect = mrSh.GetCharRect(); const SwRect& rDestRect = mrSh.GetCharRect();
const SwPageFrm* pCurrPage =
static_cast<const SwPageFrm*>( mrSh.GetLayout()->Lower() );
// Destination PageNum // Destination PageNum
const sal_Int32 nDestPageNum = CalcOutputPageNum( rDestRect ); const sal_Int32 nDestPageNum = CalcOutputPageNum( rDestRect );
for ( size_t nNumIdx = 0; nNumIdx < aLinkPageNums.size(); ++nNumIdx ) for ( size_t nNumIdx = 0; nNumIdx < aLinkPageNums.size(); ++nNumIdx )
{ {
// Link Export // Link Export
Rectangle aRect(SwRectToPDFRect(pCurrPage, aLinkRect.SVRect()));
const sal_Int32 nLinkId = const sal_Int32 nLinkId =
pPDFExtOutDevData->CreateLink( aLinkRect.SVRect(), aLinkPageNums[nNumIdx] ); pPDFExtOutDevData->CreateLink(aRect, aLinkPageNums[nNumIdx]);
// Store link info for tagged pdf output: // Store link info for tagged pdf output:
const IdMapEntry aLinkEntry( aLinkRect, nLinkId ); const IdMapEntry aLinkEntry( aLinkRect, nLinkId );
...@@ -1908,8 +1966,9 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport() ...@@ -1908,8 +1966,9 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport()
if ( -1 != nDestPageNum ) if ( -1 != nDestPageNum )
{ {
aRect = SwRectToPDFRect(pCurrPage, rDestRect.SVRect());
// Destination Export // Destination Export
const sal_Int32 nDestId = pPDFExtOutDevData->CreateDest( rDestRect.SVRect(), nDestPageNum ); const sal_Int32 nDestId = pPDFExtOutDevData->CreateDest(rDestRect.SVRect(), nDestPageNum);
// Connect Link and Destination: // Connect Link and Destination:
pPDFExtOutDevData->SetLinkDest( nLinkId, nDestId ); pPDFExtOutDevData->SetLinkDest( nLinkId, nDestId );
...@@ -1954,14 +2013,18 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport() ...@@ -1954,14 +2013,18 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport()
mrSh.GotoOutline(i); mrSh.GotoOutline(i);
const SwRect& rDestRect = mrSh.GetCharRect(); const SwRect& rDestRect = mrSh.GetCharRect();
const SwPageFrm* pCurrPage =
static_cast<const SwPageFrm*>( mrSh.GetLayout()->Lower() );
// Destination PageNum // Destination PageNum
const sal_Int32 nDestPageNum = CalcOutputPageNum( rDestRect ); const sal_Int32 nDestPageNum = CalcOutputPageNum( rDestRect );
if ( -1 != nDestPageNum ) if ( -1 != nDestPageNum )
{ {
// Destination Export // Destination Export
Rectangle aRect(SwRectToPDFRect(pCurrPage, rDestRect.SVRect()));
const sal_Int32 nDestId = const sal_Int32 nDestId =
pPDFExtOutDevData->CreateDest( rDestRect.SVRect(), nDestPageNum ); pPDFExtOutDevData->CreateDest(aRect, nDestPageNum);
// Outline entry text // Outline entry text
const OUString& rEntry = mrSh.getIDocumentOutlineNodesAccess()->getOutlineText( i, true, false, false ); const OUString& rEntry = mrSh.getIDocumentOutlineNodesAccess()->getOutlineText( i, true, false, false );
...@@ -1999,12 +2062,18 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport() ...@@ -1999,12 +2062,18 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport()
// Destination Rectangle // Destination Rectangle
const SwRect& rDestRect = mrSh.GetCharRect(); const SwRect& rDestRect = mrSh.GetCharRect();
const SwPageFrm* pCurrPage =
static_cast<const SwPageFrm*>( mrSh.GetLayout()->Lower() );
// Destination PageNum // Destination PageNum
const sal_Int32 nDestPageNum = CalcOutputPageNum( rDestRect ); const sal_Int32 nDestPageNum = CalcOutputPageNum( rDestRect );
// Destination Export // Destination Export
if ( -1 != nDestPageNum ) if ( -1 != nDestPageNum )
pPDFExtOutDevData->CreateNamedDest( sBkName, rDestRect.SVRect(), nDestPageNum ); {
Rectangle aRect(SwRectToPDFRect(pCurrPage, rDestRect.SVRect()));
pPDFExtOutDevData->CreateNamedDest(sBkName, aRect, nDestPageNum);
}
} }
mrSh.SwCrsrShell::ClearMark(); mrSh.SwCrsrShell::ClearMark();
//<--- i56629 //<--- i56629
...@@ -2030,22 +2099,26 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport() ...@@ -2030,22 +2099,26 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport()
// Destination Rectangle // Destination Rectangle
const SwRect& rDestRect = mrSh.GetCharRect(); const SwRect& rDestRect = mrSh.GetCharRect();
const SwPageFrm* pCurrPage =
static_cast<const SwPageFrm*>( mrSh.GetLayout()->Lower() );
// Destination PageNum // Destination PageNum
const sal_Int32 nDestPageNum = CalcOutputPageNum( rDestRect ); const sal_Int32 nDestPageNum = CalcOutputPageNum( rDestRect );
if ( -1 != nDestPageNum ) if ( -1 != nDestPageNum )
{ {
Rectangle aRect(SwRectToPDFRect(pCurrPage, rDestRect.SVRect()));
if ( aIBeg->nLinkId != -1 ) if ( aIBeg->nLinkId != -1 )
{ {
// Destination Export // Destination Export
const sal_Int32 nDestId = pPDFExtOutDevData->CreateDest( rDestRect.SVRect(), nDestPageNum ); const sal_Int32 nDestId = pPDFExtOutDevData->CreateDest(aRect, nDestPageNum);
// Connect Link and Destination: // Connect Link and Destination:
pPDFExtOutDevData->SetLinkDest( aIBeg->nLinkId, nDestId ); pPDFExtOutDevData->SetLinkDest( aIBeg->nLinkId, nDestId );
} }
else else
{ {
pPDFExtOutDevData->DescribeRegisteredDest( aIBeg->nDestId, rDestRect.SVRect(), nDestPageNum ); pPDFExtOutDevData->DescribeRegisteredDest(aIBeg->nDestId, aRect, nDestPageNum);
} }
} }
} }
...@@ -2161,8 +2234,9 @@ void SwEnhancedPDFExportHelper::MakeHeaderFooterLinks( vcl::PDFExtOutDevData& rP ...@@ -2161,8 +2234,9 @@ void SwEnhancedPDFExportHelper::MakeHeaderFooterLinks( vcl::PDFExtOutDevData& rP
for ( size_t nNumIdx = 0; nNumIdx < aHFLinkPageNums.size(); ++nNumIdx ) for ( size_t nNumIdx = 0; nNumIdx < aHFLinkPageNums.size(); ++nNumIdx )
{ {
// Link Export // Link Export
Rectangle aRect(SwRectToPDFRect(pPageFrm, aHFLinkRect.SVRect()));
const sal_Int32 nHFLinkId = const sal_Int32 nHFLinkId =
rPDFExtOutDevData.CreateLink( aHFLinkRect.SVRect(), aHFLinkPageNums[nNumIdx] ); rPDFExtOutDevData.CreateLink(aRect, aHFLinkPageNums[nNumIdx]);
// Connect Link and Destination: // Connect Link and Destination:
if ( bIntern ) if ( bIntern )
......
...@@ -3012,13 +3012,14 @@ void SAL_CALL SwXTextDocument::render( ...@@ -3012,13 +3012,14 @@ void SAL_CALL SwXTextDocument::render(
((SwView*)pView)->GetWrtShellPtr() : ((SwView*)pView)->GetWrtShellPtr() :
0; 0;
SwPrintData const& rSwPrtOptions =
*m_pRenderData->GetSwPrtOptions();
if (bIsPDFExport && bFirstPage && pWrtShell) if (bIsPDFExport && bFirstPage && pWrtShell)
{ {
SwEnhancedPDFExportHelper aHelper( *pWrtShell, *pOut, aPageRange, bIsSkipEmptyPages, false ); SwEnhancedPDFExportHelper aHelper( *pWrtShell, *pOut, aPageRange, bIsSkipEmptyPages, false, rSwPrtOptions );
} }
SwPrintData const& rSwPrtOptions =
*m_pRenderData->GetSwPrtOptions();
if (bPrintProspect) if (bPrintProspect)
pVwSh->PrintProspect( pOut, rSwPrtOptions, nRenderer ); pVwSh->PrintProspect( pOut, rSwPrtOptions, nRenderer );
else // normal printing and PDF export else // normal printing and PDF export
...@@ -3032,7 +3033,7 @@ void SAL_CALL SwXTextDocument::render( ...@@ -3032,7 +3033,7 @@ void SAL_CALL SwXTextDocument::render(
if (bIsPDFExport && bLastPage && pWrtShell) if (bIsPDFExport && bLastPage && pWrtShell)
{ {
SwEnhancedPDFExportHelper aHelper( *pWrtShell, *pOut, aPageRange, bIsSkipEmptyPages, true ); SwEnhancedPDFExportHelper aHelper( *pWrtShell, *pOut, aPageRange, bIsSkipEmptyPages, true, rSwPrtOptions );
} }
pVwSh->SetPDFExportOption( false ); pVwSh->SetPDFExportOption( false );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment