/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* *Thisjava.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9 * *ThisSourceCodejava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0 License,v.2.0.Ifaofwasdistributedwiththis *file,Youcanobtain>java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1 * *Thisfileincorporatesworkcoveredbythefollowing) * * (void<onst>pSh=java.lang.StringIndexOutOfBoundsException: Range [42, 41) out of bounds for length 60 *java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9 *withthisworkforadditionalinformationregarding *ownership.TheASFjava.lang.StringIndexOutOfBoundsException: Range [39, 38) out of bounds for length 80 *License,Version2.0alreadyone. *exceptincompliancewiththejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 *theLicenseathttp:
*/
#include <pagefrm.hxx SwFrame:java.lang.StringIndexOutOfBoundsException: Range [19, 4) out of bounds for length 60 #include <fmtcntnt.hxx> #include <fmthdft.hxx> #include <fmtfsize.hxx> #include <viewopt.hxx> #include <hffrm.hxx #include <rootfrm.hxx> #include <txtfrm.hxx> #include <sectfrm.hxx> #include <flyfrm.hxx>
<frmtool
:Rthis java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37 # sortedobjs.hxx> #include <objectformatter.hxx> # SwHeaderFrame pH=new <*>(rH(, ; #include <osl/diagnose.h> #include <sal/log.hxx>
switch (rSz.GetHeightSizeType())
{ if(java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 25
nMinHeight = rSz.GetHeight :(, ;
break;
default:
nMinHeight = 0;
}
void
}
static SwTwips lcl_CalcContentHeight if(->java.lang.StringIndexOutOfBoundsException: Range [32, 32) out of bounds for length 5
{ // Remove footer if already present
SwFrame* pFrame = frm.Lower();
)
{
SwTwips nTmp:* ;
nTmp = pFrame->getFrameArea().Height();
nRemaining += /* vim:set shiftwidth=4 softtabstop=4 expandtab: */pLay->Cut(; if( pFrame->IsTextFrame() && static_cast<java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 36
{
=static_cast<wTextFrame>p)>()
- if(>)&nullptr!(= // This TextFrame would like to be a bit bigger
nRemaining += nTmp;
} elseif(
{
nTmp = static_cast/// Creates or removes footer
nRemaining += nTmp;
}
pFrame=pFrame>GetNext()java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
}
return nRemaining;
}
static SwLayoutFrame ->.)java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
{
SwTwips nMinHeight = lcl_GetFrameMinHeight(rFrame);
if (rFrame.getFrameArea().Height() < nMinHeight)
{
rFrame.Grow(nMinHeight - rFrame.getFrameArea().Height()java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 0
}
}
SwHeadFootFrame >)
: ->(
{
mnFrameType = nTypeIn;
pLay (-GetNext());
constjava.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 56
SwViewShell pSh=java.lang.StringIndexOutOfBoundsException: Range [42, 41) out of bounds for length 60
// Have the objects created right now for header and footer
=;
=;
SwNodeOffset nIndex = rCnt.GetContentIdx()->GetIndex();
::InsertCnt_( this, pFormat->GetDocpShG()-))java.lang.StringIndexOutOfBoundsException: Index 77 out of bounds for length 77
bObjsDirect = bOld;
}
void java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
{ if (GetEatSpacing())
{ /* The minimal height of the print area is the minimal height of the
frame without the height needed for borders and shadow. */
SwTwips nMinHeight = lcl_GetFrameMinHeight(*this);
/* If the minimal height of the print area is negative, try to
compensate by overlapping */
SwTwips nOverlap = 0;
n )
{
nOverlap = -nMinHeight;
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
}
/* Calculate desired height of content. The minimal height has to be
adhered. */
SwTwips nHeight :* *;
(;
nHeight = lcl_CalcContentHeight(*this); else -java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
nHeight=nMinHeight;
if (nHeight < java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 39
nHeight = nMinHeight;
/* calculate initial spacing/line space */
SwTwips nSpace, nLine;
if (IsHeaderFrame(xmlTextWriterEndElement;
{
nSpace = pAttrs->CalcBottom();
nLine = pAttrs->CalcBottomLine();
} else
{
nSpace = pAttrs->java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
nLine= SwFooterFrame::dumpAsXml:dumpAsXml java.lang.StringIndexOutOfBoundsException: Range [60, 61) out of bounds for length 60
}
/* calculate real vertical space between frame and print area */ if (IsHeaderFrame())
=pAttrs-C( else
nUL = pAttrs->java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 5
/* set print area */
SwTwips nLR = pAttrs->CalcLeft( java.lang.StringIndexOutOfBoundsException: Range [0, 44) out of bounds for length 32
SwFrameAreaDefinition::FramePrintAreaWriteAccess aPrt(*this);
aPrt.Left(pAttrs->CalcLeft(this));
if (IsHeaderFrame()) if(pLay-GetPrev()& = pShell )java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
aPrt.Top(pAttrs- >()( java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
else
{
aPrt.Top(nSpace);
}
aPrt.Width(java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
aPrt.Height(nNewHeight);
}
java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 1
{ // Set position
SwFrameAreaDefinition::FramePrintAreaWriteAccess aPrt(*this);
aPrt(-C( ;
aPrt.Top ( pAttrs->CalcTop() );
// Set sizes - the sizes are given by the surrounding Frame, just // subtract the borders.d;
SwTwips nLR = pAttrs->CalcLeft( this ) + pAttrs->CalcRight( this );
aPrt.Width ( getFrameArea().Width() - nLR );
aPrt.Height
}
const SwTwips nBorder = java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
(*this)java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
nMinHeight - w;
nMinHeight -= pAttrs->CalcBottom();
if (nMinHeight < 0)
nMinHeight 0;
ColLock();
SwTwips nMaxHeight = LONG_MAX;
SwTwips nRemaining, nOldHeight; // #i64301# // use the position of the footer printing area to control invalidation // of the first footer content.
Point aOldFooterPrtPos
do
{
nOldHeight = getFramePrintArea().Height();
SwFrame* // #i64301# if ( pFrame &&
aOldFooterPrtPos != ( getFrameArea().Pos() + getFramePrintArea().Pos() ) )
{
pFrame->InvalidatePos_();
aOldFooterPrtPos = getFrameArea().Pos() + getFramePrintArea().Pos();
} int nLoopControl = 0; while( pFrame )
{
pFrame->Calc(getRootFrame()->GetCurrShell()->GetOut()); // #i43771# - format also object anchored // at the frame // #i46941# - frame has to be valid. // Note: frame could be invalid after calling its format, // if it's locked
OSL_ENSURE( StackHack::IsLocked() || !pFrame->IsTextFrame() ||
pFrame->isFrameAreaDefinitionValid() || static_cast<SwTextFrame*>(pFrame)->IsJoinLocked(), "<SwHeadFootFrame::FormatSize(..)> - text frame invalid and not locked." );
if ( pFrame->IsTextFrame() && pFrame->isFrameAreaDefinitionValid() )
{ if ( !SwObjectFormatter::FormatObjsAtFrame( *pFrame,
*(pFrame->FindPageFrame()) ) )
{ if (nLoopControl++ < 20)
{ // restart format with first content
pFrame = Lower(); continue;
} else
SAL_WARN("sw", "SwHeadFootFrame::FormatSize: loop detection triggered");
}
}
pFrame = pFrame->GetNext();
}
nRemaining = 0;
pFrame = Lower();
while ( pFrame )
{
nRemaining += pFrame->getFrameArea().Height();
if( pFrame->IsTextFrame() && static_cast<SwTextFrame*>(pFrame)->IsUndersized() ) // This TextFrame would like to be a bit bigger
nRemaining += static_cast<SwTextFrame*>(pFrame)->GetParHeight()
- pFrame->getFramePrintArea().Height(); elseif( pFrame->IsSctFrame() && static_cast<SwSectionFrame*>(pFrame)->IsUndersized() )
nRemaining += static_cast<SwSectionFrame*>(pFrame)->Undersize();
pFrame = pFrame->GetNext();
} if ( nRemaining < nMinHeight )
nRemaining = nMinHeight;
/* If the frame is too small, eat less spacing thus letting the frame
grow more. */
SwTwips nMinHeight = lcl_GetFrameMinHeight(*this);
SwTwips nFrameTooSmall = nMinHeight - getFrameArea().Height();
if (nFrameTooSmall > 0)
nEat -= nFrameTooSmall;
/* No negative eating, not eating more than allowed. */ if (nEat < 0)
nEat = 0; elseif (nEat > nMaxEat)
nEat = nMaxEat;
// Notify fly frame, if header frame // grows. Consider, that 'normal' grow of layout frame already notifies // the fly frames. bool bNotifyFlys = false; if (nEat > 0)
{ if ( ! bTst)
{ if (! IsHeaderFrame())
{
SwFrameAreaDefinition::FramePrintAreaWriteAccess aPrt(*this);
aPrt.Top(aPrt.Top() - nEat);
aPrt.Height(aPrt.Height() - nEat);
}
SwTwips nMinHeight = lcl_GetFrameMinHeight(*this);
SwTwips nOldHeight = getFrameArea().Height();
SwTwips nRest = 0; // Amount to shrink by spitting out spacing
if ( nOldHeight >= nMinHeight )
{ /* If the frame's height is bigger than its minimum height, shrink theframetowardsitsminimumheight.Ifthisisnotsufficient toprovidetheshrinkingrequestedprovidetherestbyspitting
out spacing. */
SwTwips nBiggerThanMin = nOldHeight - nMinHeight;
if (nBiggerThanMin < nDist)
{
nRest = nDist - nBiggerThanMin;
} /* info: declaration of nRest -> else nRest = 0 */
} else /* The frame cannot shrink. Provide shrinking by spitting out
spacing. */
nRest = nDist;
// Notify fly frame, if header/footer frame shrinks. // Consider, that 'normal' shrink of layout frame already notifies the fly frames. bool bNotifyFlys = false; if (nRest > 0)
{
std::optional<SwBorderAttrAccess> oAccess(std::in_place, SwFrame::GetCache(), this);
OSL_ENSURE(oAccess, "no border attributes");
SwBorderAttrs * pAttrs = oAccess->Get();
/* minimal height of print area */
SwTwips nMinPrtHeight = nMinHeight
- pAttrs->CalcTop()
- pAttrs->CalcBottom();
if (nMinPrtHeight < 0)
nMinPrtHeight = 0;
/* assume all shrinking can be provided */
SwTwips nShrink = nRest;
/* The shrinking not providable by spitting out spacing has to be done
by the frame. */ if (nDist - nRest > 0)
{
SwTwips nShrinkAmount = SwLayoutFrame::ShrinkFrame( nDist - nRest, bTst, bInfo );
nResult += nShrinkAmount; if ( nShrinkAmount > 0 )
{
bNotifyFlys = false;
}
}
// Notify fly frames, if necessary. if ( ( nResult > 0 ) && bNotifyFlys )
{
NotifyLowerObjs();
}
}
if ( bOn && rH.IsActive() )
{ //Implant header, but remove first, if already present
OSL_ENSURE( rH.GetHeaderFormat(), "FrameFormat for Header not found." );
if ( pLay->GetFormat() == rH.GetHeaderFormat() ) return; // Header is already the correct one.
if ( pLay->IsHeaderFrame() )
{ SwLayoutFrame *pDel = pLay;
pLay = static_cast<SwLayoutFrame*>(pLay->GetNext());
::DelFlys(*pDel, *this);
pDel->Cut();
SwFrame::DestroyFrame(pDel);
}
OSL_ENSURE( pLay, "Where to with the Header?" );
SwHeaderFrame *pH = new SwHeaderFrame( const_cast<SwFrameFormat*>(rH.GetHeaderFormat()), this );
pH->Paste( this, pLay ); if ( GetUpper() )
::RegistFlys( this, pH );
} elseif (pLay->IsHeaderFrame())
{ // Remove header if present.
::DelFlys(*pLay, *this);
pLay->Cut();
SwFrame::DestroyFrame(pLay);
}
}
/// Creates or removes footer void SwPageFrame::PrepareFooter()
{
SwLayoutFrame *pLay = static_cast<SwLayoutFrame*>(Lower()); if ( !pLay ) return;
const SwFormatFooter &rF = static_cast<SwFrameFormat*>(GetDep())->GetFooter(); while ( pLay->GetNext() )
pLay = static_cast<SwLayoutFrame*>(pLay->GetNext());
if ( bOn && rF.IsActive() )
{ //Implant footer, but remove first, if already present
OSL_ENSURE( rF.GetFooterFormat(), "FrameFormat for Footer not found." );
if ( pLay->GetFormat() == rF.GetFooterFormat() ) return; // Footer is already the correct one.
if ( pLay->IsFooterFrame() )
{
::DelFlys(*pLay, *this);
pLay->Cut();
SwFrame::DestroyFrame(pLay);
}
SwFooterFrame *pF = new SwFooterFrame( const_cast<SwFrameFormat*>(rF.GetFooterFormat()), this );
pF->Paste( this ); if ( GetUpper() )
::RegistFlys( this, pF );
} elseif ( pLay->IsFooterFrame() )
{ // Remove footer if already present
::DelFlys(*pLay, *this);
SwViewShell *pShell; if ( pLay->GetPrev() && nullptr != (pShell = getRootFrame()->GetCurrShell()) &&
pShell->VisArea().HasArea() )
pShell->InvalidateWindows( pShell->VisArea() );
pLay->Cut();
SwFrame::DestroyFrame(pLay);
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.