main/sc/source/ui/view/printfun.cxx
//	nZoom muss gesetzt sein !!!
//	und der entsprechende Twip-MapMode eingestellt
nZoom muss gesetzt sein
und der entsprechende Twip-MapMode eingestellt
nZoom muss gesetzt sein und der entsprechende Twip - MapMode eingestellt
void ScPrintFunc::UpdateHFHeight( ScPrintHFParam& rParam )
{
	DBG_ASSERT( aPageSize.Width(), "UpdateHFHeight ohne aPageSize");
	if (rParam.bEnable && rParam.bDynamic)
	{
		MakeEditEngine();
		long nPaperWidth = ( aPageSize.Width() - nLeftMargin - nRightMargin -
								rParam.nLeft - rParam.nRight ) * 100 / nZoom;
		if (rParam.pBorder)
			nPaperWidth -= ( rParam.pBorder->GetDistance(BOX_LINE_LEFT) +
							 rParam.pBorder->GetDistance(BOX_LINE_RIGHT) +
							 lcl_LineTotal(rParam.pBorder->GetLeft()) +
							 lcl_LineTotal(rParam.pBorder->GetRight()) ) * 100 / nZoom;
		if (rParam.pShadow && rParam.pShadow->GetLocation() != SVX_SHADOW_NONE)
			nPaperWidth -= ( rParam.pShadow->CalcShadowSpace(SHADOW_LEFT) +
							 rParam.pShadow->CalcShadowSpace(SHADOW_RIGHT) ) * 100L / nZoom;
		pEditEngine->SetPaperSize( Size( nPaperWidth, 10000 ) );
		long nMaxHeight = 0;
		if ( rParam.pLeft )
		{
			nMaxHeight = Max( nMaxHeight, TextHeight( rParam.pLeft->GetLeftArea() ) );
			nMaxHeight = Max( nMaxHeight, TextHeight( rParam.pLeft->GetCenterArea() ) );
			nMaxHeight = Max( nMaxHeight, TextHeight( rParam.pLeft->GetRightArea() ) );
		}
		if ( rParam.pRight )
		{
			nMaxHeight = Max( nMaxHeight, TextHeight( rParam.pRight->GetLeftArea() ) );
			nMaxHeight = Max( nMaxHeight, TextHeight( rParam.pRight->GetCenterArea() ) );
			nMaxHeight = Max( nMaxHeight, TextHeight( rParam.pRight->GetRightArea() ) );
		}
		rParam.nHeight = nMaxHeight + rParam.nDistance;
		if (rParam.pBorder)
			rParam.nHeight += rParam.pBorder->GetDistance(BOX_LINE_TOP) +
							  rParam.pBorder->GetDistance(BOX_LINE_BOTTOM) +
							  lcl_LineTotal( rParam.pBorder->GetTop() ) +
							  lcl_LineTotal( rParam.pBorder->GetBottom() );
		if (rParam.pShadow && rParam.pShadow->GetLocation() != SVX_SHADOW_NONE)
			rParam.nHeight += rParam.pShadow->CalcShadowSpace(SHADOW_TOP) +
							  rParam.pShadow->CalcShadowSpace(SHADOW_BOTTOM);
		if (rParam.nHeight < rParam.nManHeight)
			rParam.nHeight = rParam.nManHeight;			
	}
}
void ScPrintFunc :: UpdateHFHeight ( ScPrintHFParam & rParam ) { DBG_ASSERT ( aPageSize . Width ( ) , " " ) ; if ( rParam . bEnable && rParam . bDynamic ) { MakeEditEngine ( ) ; long nPaperWidth = ( aPageSize . Width ( ) - nLeftMargin - nRightMargin - rParam . nLeft - rParam . nRight ) * 100 / nZoom ; if ( rParam . pBorder ) nPaperWidth -= ( rParam . pBorder -> GetDistance ( BOX_LINE_LEFT ) + rParam . pBorder -> GetDistance ( BOX_LINE_RIGHT ) + lcl_LineTotal ( rParam . pBorder -> GetLeft ( ) ) + lcl_LineTotal ( rParam . pBorder -> GetRight ( ) ) ) * 100 / nZoom ; if ( rParam . pShadow && rParam . pShadow -> GetLocation ( ) != SVX_SHADOW_NONE ) nPaperWidth -= ( rParam . pShadow -> CalcShadowSpace ( SHADOW_LEFT ) + rParam . pShadow -> CalcShadowSpace ( SHADOW_RIGHT ) ) * 100L / nZoom ; pEditEngine -> SetPaperSize ( Size ( nPaperWidth , 10000 ) ) ; long nMaxHeight = 0 ; if ( rParam . pLeft ) { nMaxHeight = Max ( nMaxHeight , TextHeight ( rParam . pLeft -> GetLeftArea ( ) ) ) ; nMaxHeight = Max ( nMaxHeight , TextHeight ( rParam . pLeft -> GetCenterArea ( ) ) ) ; nMaxHeight = Max ( nMaxHeight , TextHeight ( rParam . pLeft -> GetRightArea ( ) ) ) ; } if ( rParam . pRight ) { nMaxHeight = Max ( nMaxHeight , TextHeight ( rParam . pRight -> GetLeftArea ( ) ) ) ; nMaxHeight = Max ( nMaxHeight , TextHeight ( rParam . pRight -> GetCenterArea ( ) ) ) ; nMaxHeight = Max ( nMaxHeight , TextHeight ( rParam . pRight -> GetRightArea ( ) ) ) ; } rParam . nHeight = nMaxHeight + rParam . nDistance ; if ( rParam . pBorder ) rParam . nHeight += rParam . pBorder -> GetDistance ( BOX_LINE_TOP ) + rParam . pBorder -> GetDistance ( BOX_LINE_BOTTOM ) + lcl_LineTotal ( rParam . pBorder -> GetTop ( ) ) + lcl_LineTotal ( rParam . pBorder -> GetBottom ( ) ) ; if ( rParam . pShadow && rParam . pShadow -> GetLocation ( ) != SVX_SHADOW_NONE ) rParam . nHeight += rParam . pShadow -> CalcShadowSpace ( SHADOW_TOP ) + rParam . pShadow -> CalcShadowSpace ( SHADOW_BOTTOM ) ; if ( rParam . nHeight < rParam . nManHeight ) rParam . nHeight = rParam . nManHeight ; } }
nZoom muss gesetzt sein !
nZoom muss gesetzt sein !
//	nHeight aus Inhalten berechnen // eingestelltes Minimum