Eine aufbereitete Darstellung der Quelle

 
     
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 

Benutzer

Quelle  hffrm.cxx   Sprache: C

 

/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
 * Thisjava.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
 *
 * This Source Code java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
  License,v. 2.0.Ifa  of  was  distributed with this
 * file, You can obtain           >java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
*
 * This file incorporates work covered by the following          )
 *
 *       (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
 *   with this work for additional information regarding
 *   ownership. The ASF java.lang.StringIndexOutOfBoundsException: Range [39, 38) out of bounds for length 80
 *   License, Version 2.0 already  one.
 *   except in compliance with the java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 *   the License at http:
 */


#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>

static SwTwips dumpAsXmlAttributes)
{
    const SwFormatFrameSize &rSz = rFrame.GetFormat }
    SwTwips nMinHeight;

    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;
        }
        else if(
        {
            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);

        nMinHeight -= pAttrs->CalcTop();
        nMinHeight -= pAttrs->CalcBottom();

        /* 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 overlap and correct spacing */
        nOverlap += nHeight - nMinHeight;
        if (nOverlap < nSpace - nLine)
            nSpace -= nOverlap;
        else
            nSpace = nLine;

        /* 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

        SwTwips nNewHeight;

        if (nUL 
        {
            nNewHeight = getFrameArea().Height() - nUL;
        }
        else
        {
            nNewHeight = 0;
        }

        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
    }

    setFramePrintAreaValid(true);
}

void SwHeadFootFrame::FormatSize(SwTwips nUL, const SwBorderAttrs *
{
    if ( !HasFixSize() )
    {
        if( !IsColLocked() )
        {
            void SwFooterFrame::dumpAsXml(xmlTextWriterPtr writer) const
            setFrameAreaSizeValid(true);

            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();
                    else if( pFrame->IsSctFrame() &&
                             static_cast<SwSectionFrame*>(pFrame)->IsUndersized() )
                        nRemaining += static_cast<SwSectionFrame*>(pFrame)->Undersize();
                    pFrame = pFrame->GetNext();
                }
                if ( nRemaining < nMinHeight )
                    nRemaining = nMinHeight;

                SwTwips nDiff = nRemaining - nOldHeight;

                if( !nDiff )
                    break;
                if( nDiff < 0 )
                {
                    nMaxHeight = nOldHeight;

                    if( nRemaining <= nMinHeight )
                        nRemaining = ( nMaxHeight + nMinHeight + 1 ) / 2;
                }
                else
                {
                    if (nOldHeight > nMinHeight)
                        nMinHeight = nOldHeight;

                    if( nRemaining >= nMaxHeight )
                        nRemaining = ( nMaxHeight + nMinHeight + 1 ) / 2;
                }

                nDiff = nRemaining - nOldHeight;

                if ( nDiff )
                {
                    ColUnlock();
                    if ( nDiff > 0 )
                    {
                        if ( Grow( nDiff ) )
                        {
                            pFrame = Lower();

                            while ( pFrame )
                            {
                                if( pFrame->IsTextFrame())
                                {
                                    SwTextFrame * pTmpFrame = static_cast<SwTextFrame*>(pFrame);
                                    if (pTmpFrame->IsUndersized() )
                                    {
                                        pTmpFrame->InvalidateSize();
                                        pTmpFrame->Prepare(PrepareHint::AdjustSizeWithoutFormatting);
                                    }
                                }
                                /* #i3568# Undersized sections need to be
                                   invalidated too. */

                                else if (pFrame->IsSctFrame())
                                {
                                    SwSectionFrame * pTmpFrame =
                                        static_cast<SwSectionFrame*>(pFrame);
                                    if (pTmpFrame->IsUndersized() )
                                    {
                                        pTmpFrame->InvalidateSize();
                                        pTmpFrame->Prepare(PrepareHint::AdjustSizeWithoutFormatting);
                                    }
                                }
                                pFrame = pFrame->GetNext();
                            }
                        }
                    }
                    else
                        Shrink( -nDiff );
                    // Quickly update the position

                    MakePos();
                    ColLock();
                }
                else
                    break;
                // Don't overwrite the lower edge of the upper
                if ( GetUpper() && getFrameArea().Height() )
                {
                    const SwTwips nDeadLine = GetUpper()->getFrameArea().Top() + GetUpper()->getFramePrintArea().Bottom();
                    const SwTwips nBot = getFrameArea().Bottom();

                    if ( nBot > nDeadLine )
                    {
                        SwFrameAreaDefinition::FrameAreaWriteAccess aFrm(*this);
                        aFrm.Bottom( nDeadLine );

                        SwFrameAreaDefinition::FramePrintAreaWriteAccess aPrt(*this);
                        aPrt.Height( getFrameArea().Height() - nBorder );
                    }
                }

                setFramePrintAreaValid(true);
                setFrameAreaSizeValid(true);
            } while( nRemaining<=nMaxHeight && nOldHeight!=getFramePrintArea().Height() );
            ColUnlock();
        }

        setFramePrintAreaValid(true);
        setFrameAreaSizeValid(true);
    }
    else //if (GetType() & FRM_HEADFOOT)
    {
        do
        {
            if ( getFrameArea().Height() != pAttrs->GetSize().Height() )
            {
                ChgSize( Size( getFrameArea().Width(), pAttrs->GetSize().Height()));
            }

            setFrameAreaSizeValid(true);
            MakePos();
        } while ( !isFrameAreaSizeValid() );
    }
}

void SwHeadFootFrame::Format(vcl::RenderContext* pRenderContext, const SwBorderAttrs * pAttrs)
{
    assert(pAttrs && "SwFooterFrame::Format, pAttrs is 0.");

    if ( isFramePrintAreaValid() && isFrameAreaSizeValid() )
        return;

    if ( ! GetEatSpacing() && IsHeaderFrame())
    {
        SwLayoutFrame::Format(pRenderContext, pAttrs);
    }
    else
    {
        lcl_LayoutFrameEnsureMinHeight(*this);

        SwTwips nUL = pAttrs->CalcTop()  + pAttrs->CalcBottom();

        if ( !isFramePrintAreaValid() )
            FormatPrt(nUL, pAttrs);

        if ( !isFrameAreaSizeValid() )
            FormatSize(nUL, pAttrs);
    }
}

SwTwips SwHeadFootFrame::GrowFrame( SwTwips nDist, SwResizeLimitReason& reason, bool bTst, bool bInfo )
{
    SwTwips nResult;

    if ( IsColLocked() )
    {
        nResult = 0;
        reason = SwResizeLimitReason::Unspecified;
    }
    else if (!GetEatSpacing())
    {
        nResult = SwLayoutFrame::GrowFrame(nDist, reason, bTst, bInfo);
    }
    else
    {
        nResult = 0;

        std::optional<SwBorderAttrAccess> oAccess(std::in_place, SwFrame::GetCache(), this);
        OSL_ENSURE(oAccess, "no border attributes");

        SwBorderAttrs * pAttrs = oAccess->Get();

        /* First assume the whole amount to grow can be provided by eating
           spacing. */

        SwTwips nEat = nDist;
        SwTwips nMaxEat;

        /* calculate maximum eatable spacing */
        if (IsHeaderFrame())
            nMaxEat = getFrameArea().Height() - getFramePrintArea().Top() - getFramePrintArea().Height() - pAttrs->CalcBottomLine();
        else
            nMaxEat = getFramePrintArea().Top() - pAttrs->CalcTopLine();

        if (nMaxEat < 0)
            nMaxEat = 0;

        /* 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;
        else if (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);
                }

                InvalidateAll();
            }

            nResult += nEat;
            // trigger fly frame notify.
            if ( IsHeaderFrame() )
            {
                bNotifyFlys = true;
            }
        }

        if (nDist - nEat > 0)
        {
            const SwTwips nFrameGrow = SwLayoutFrame::GrowFrame(nDist - nEat, reason, bTst, bInfo);

            nResult += nFrameGrow;
            if (nFrameGrow > 0)
            {
                bNotifyFlys = false;
            }
        }
        else
            reason = SwResizeLimitReason::Unspecified;

        // notify fly frames, if necessary and triggered.
        if ( ( nResult > 0 ) && bNotifyFlys )
        {
            NotifyLowerObjs();
        }
    }

    if ( nResult && !bTst )
        SetCompletePaint();

    return nResult;
}

SwTwips SwHeadFootFrame::ShrinkFrame( SwTwips nDist, bool bTst, bool bInfo )
{
    SwTwips nResult;

    if ( IsColLocked() )
    {
        nResult = 0;
    }
    else if (! GetEatSpacing())
    {
        nResult = SwLayoutFrame::ShrinkFrame(nDist, bTst, bInfo);
    }
    else
    {
        nResult = 0;

        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
               the frame towards its minimum height. If this is not sufficient
               to provide the shrinking requested provide the rest by spitting
               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;

            /* calculate maximum shrinking */
            SwTwips nMaxShrink = getFramePrintArea().Height() - nMinPrtHeight;

            /* shrink no more than maximum shrinking */
            if (nShrink > nMaxShrink)
            {
                //nRest -= nShrink - nMaxShrink;
                nShrink = nMaxShrink;
            }

            if (!bTst)
            {
                if (! IsHeaderFrame() )
                {
                    SwFrameAreaDefinition::FramePrintAreaWriteAccess aPrt(*this);
                    aPrt.Top(aPrt.Top() + nShrink);
                    aPrt.Height(aPrt.Height() - nShrink);
                }

                InvalidateAll();
            }
            nResult += nShrink;
            // Trigger fly frame notify.
            if ( IsHeaderFrame() )
            {
                bNotifyFlys = true;
            }
        }

        /* 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();
        }
    }

    return nResult;
}

bool SwHeadFootFrame::GetEatSpacing() const
{
    const SwFrameFormat * pFormat = GetFormat();
    assert(pFormat && "SwHeadFootFrame: no format?");

    return pFormat->GetHeaderAndFooterEatSpacing().GetValue();
}

static void DelFlys( const SwLayoutFrame& rFrame, SwPageFrame &rPage)
{
    size_t i = 0;
    while ( rPage.GetSortedObjs() &&
            rPage.GetSortedObjs()->size() &&
            i < rPage.GetSortedObjs()->size() )
    {
        SwAnchoredObject* pObj = (*rPage.GetSortedObjs())[i];
        if (SwFlyFrame* pFlyFrame = pObj->DynCastFlyFrame())
        {
            if (rFrame.IsAnLower(pFlyFrame))
            {
                SwFrame::DestroyFrame(pFlyFrame);
                // Do not increment index, in this case
                continue;
            }
        }
        ++i;
    }
}

/// Creates or removes headers
void SwPageFrame::PrepareHeader()
{
    SwLayoutFrame *pLay = static_cast<SwLayoutFrame*>(Lower());
    if ( !pLay )
        return;

    const SwFormatHeader &rH = static_cast<SwFrameFormat*>(GetDep())->GetHeader();

    const SwViewShell *pSh = getRootFrame()->GetCurrShell();
    const bool bOn = !(pSh && (pSh->GetViewOptions()->getBrowseMode() ||
                               pSh->GetViewOptions()->IsWhitespaceHidden()));

    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 );
    }
    else if (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());

    const SwViewShell *pSh = getRootFrame()->GetCurrShell();
    const bool bOn = !(pSh && (pSh->GetViewOptions()->getBrowseMode() ||
                               pSh->GetViewOptions()->IsWhitespaceHidden()));

    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 );
    }
    else if ( 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);
    }
}

void SwHeaderFrame::dumpAsXml(xmlTextWriterPtr writer) const
{
    (void)xmlTextWriterStartElement(writer, reinterpret_cast<const xmlChar*>("header"));
    dumpAsXmlAttributes(writer);

    SwHeadFootFrame::dumpAsXml(writer);

    (void)xmlTextWriterEndElement(writer);
}

void SwFooterFrame::dumpAsXml(xmlTextWriterPtr writer) const
{
    (void)xmlTextWriterStartElement(writer, reinterpret_cast<const xmlChar*>("footer"));
    dumpAsXmlAttributes(writer);

    SwHeadFootFrame::dumpAsXml(writer);

    (void)xmlTextWriterEndElement(writer);
}

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Messung V0.5 in Prozent
C=95 H=87 G=90

¤ Diese beiden folgenden Angebotsgruppen bietet das Unternehmen0.28Angebot  ¤

*Eine klare Vorstellung vom Zielzustand






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

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.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Open Source Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Jenseits des Üblichen ....

Besucherstatistik

Besucherstatistik

Statistik
#Sources=1127926
#Domains=2039723