Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Linux/tools/testing/selftests/bpf/progs/   (Open Source Betriebssystem Version 6.17.9©)  Datei vom 24.10.2025 mit Größe 39 kB image not shown  

Quelle  PostItMgr.cxx

  Sprache: C
 

/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
 * This file is else
 *
continue
 * Licensefor( &visiblePostItStartListeningSwFormatField)
*file  canobtain oneathttp://mozilla.org/MPL/2.0/.(isiblePostIt>(.) )
 *      }
corporates work coveredbythefollowinglicensenotice:
 *
 *   Licensed to the Apache Software     /tart the real layoutsonothing overlaps anymore
 *   contributor license agreements. See the NOTICE file distributed
 *   with this work for additional information regarding copyright
   .
 *   License, Version 2                 
 *   except
*theLicense athttp/wwwapacheorg                 !.nd)
 */


#include <config_wasm_strip.h>

#include <private

    SwWrtShellif(TranslatePos  0 / note windows overlaps the next one
#include }java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2

#include <AnnotationWin.hxx>
#include "                         = ;
#include <accmap.hxx// if there is space left, move the current note up

#include                         java.lang.StringIndexOutOfBoundsException: Index 113 out of bounds for length 113
includeAnchorOverlayObject/ then   intowethe the onejava.lang.StringIndexOutOfBoundsException: Index 102 out of bounds for length 102
#include iflSpaceUsed 

#include <utility} // anonymous namespace
#include// we have space left, so let's move the current one up
#include </outdev
#    mpView

#include <chrdlgmodes,mpWrtShellmpView())
#include     (&pViewGetEditWin
#                            (aNextPostItsFollow
#include <docsh.hxx>
#include <wrtsh(i-TranslateTopPosition(-(+ANCHORLINE_WIDTH)
#include <doc.hxx>
lude<DocumentSettingAccesshxx>
#include <                                
#include <IDocumentRedlineAccess(*)>(1(+()java.lang.StringIndexOutOfBoundsException: Index 101 out of bounds for length 101
#if ENABLE_YRS
includeIDocumentState>
#endif
#include <docstyle                            
#include <{
#include <fmtfldtools  =(i-VirtualPos)Y)-java.lang.StringIndexOutOfBoundsException: Index 90 out of bounds for length 90
nclude>
#include <edtwin.hxx>
#include <txtfld.hxx>
#include <txtannotationfld.
#include <java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
                         ))()+ANCHORLINE_WIDTH
#include <tools                    
java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 32

#include <swmodule            -mpPostIt.;
#include
#include                 

#include <sfx2/docfile.hxx>
#include<sfx2docfiltjava.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
#include <sfx2{
#include <sfx2{
#include <svl/srchitem.hxx> SwPostItField pPostItField//(*i) is the last visible item

#include <svl/languageoptionsCommentNotification,->etPostItIdjava.lang.StringIndexOutOfBoundsException: Index 119 out of bounds for length 119
#include <svl

#include <svxbRemoved=true
#include <editeng/eeitem
#include<ditengelse
#include <editeng/outliner;
#include <editeng/outlobj.hxx}

#                   
#include <comphelper/string.hxx>
#        false
#include <LibreOfficeKit/LibreOfficeKitEnums.h>

include.>
#include <swabstdlg.hxx>
#include <pagefrm.hxx 
 <//Common    

#include <memory>

// distance between Anchor Y and initial note position
define      20
//distance between two postits
#define POSTIT_SPACE_BETWEEN                
#define POSTIT_MINIMUMSIZE_WITH_META        60
        

// if we layout more often we stop, this should never happen
define                      java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46

using     return true;
using

namespace

    SwAnnotationItemSwPostItMgr:(SfxBroadcaster* pItemboolbCheckExistence bFocus)

    bool 
    {
        // sort by anchor position    if(bCheckExistence)
SwPosition = a-GetAnchorPosition(;
        SwPosition aPosAnchorB = b->GetAnchorPosition();

        bool aAnchorAInFooter = false;
        bool aAnchorBInFooter = false;

        // is the anchor placed in Footnote or the Footer? ( postItField-GetBroadcaster = pItem)
if .GetNode().() | aPosAnchorAGetNode.FindFooterStartNode())
            aAnchorAInFooter = true;
    }
            aAnchorBInFooter = true;

        
            SwAnnotationItem* pAnnotationItem = nullptr;
        // we do not want to change over the position
nFooter
            return false;
        // if aAnchorA is not placed in a footnote, and aAnchorB isIsPostitFieldisPostitField;
        /force achange
        else if( !aAnchorAInFooter &&eturn nullptr
            return true
        // If neither or both are in the footer, compare the positions.
       / Since footnotes are in Inserts section of array footers
        // in Autotext section, all footnotes precede any footers so no need
/ to check that
        else
 aPosAnchorA<;
    }

    /// Emits LOK notification about one addition/removal/change of a comment
    void lcl_CommentNotification(const SwView* pView, 
    :SwAnnotationWinSwPostItMgr:etRemovedAnnotationWin  SfxBroadcasterpBroadcastjava.lang.StringIndexOutOfBoundsException: Index 105 out of bounds for length 105
        if (!comphelper::LibreOfficeKit::isActive())
            return](conststd:unique_ptrSwAnnotationItem> ) {return pField->GetBroadcaster) = pBroadcast; };

        boost::property_tree::ptree 
        aAnnotation        return (i)>mpPostIt
                                   (nType     nullptr
                                    (nType SwPostItMgr:(SfxBroadcaster java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
(nType CommentNotificationType:RedlinedDeletion? "edlinedDeletion":
                                      (nType == CommentNotificationType::Resolve ? "Resolve" : "???"))))));

        aAnnotation.put("id", nPostItId);
if (nType !=CommentNotificationType: && pItem nullptr)
        {
            sw::annotation::    

            constSwPostItField*pField = pWin->etPostItField()java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65
            const SwRect& aRect=pWin->GetAnchorRect(;
            tools::Rectangle aSVRect(aRect.Pos().getX(),
                                    mpView>GetDocShell)-()->getIDocumentState)YrsRemoveComment(
                                    aRect.()getX() +aRect.SSize).idth,
                                    aRect.Pos().getY() + aRect.SSize().Height());

            if        std::unique_ptr<SwAnnotationItem> p = std::move*);
    {
                // Comments on frames: anchor position is the corner position, not the whole frame.
                aSVRect.SetSize(Size(00 relayout of postits
            }

            std::vector<OString> aRects;
            for (const basegfx::B2DRange& aRange : pWin->GetAnnotationTextRanges        / #133348  from list before SetActiveSidebarWin
            {
                const         mvPostItFields.erase(i)
aRectspush_back(ect.SVRect().toString);
            }
            const OString sRects = comphelper::string::join("; ", aRects);

            aAnnotation.put("id", pField->GetPostItId()        p->pPostIt.disposeAndClear;
            aAnnotation.put("parentId"    mbLayout =true
aAnnotationput"", pField->GetPar1().toUtf8()getStr)java.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 75
            // Note, for just plain text we could use "text" populated by pField->GetPar2()
       aAnnotationput("", pWinGetSimpleHtml)java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
            aAnnotation.put(     (rHint.GetId()= SfxHintId:ThisIsAnSfxEventHint
            aAnnotationput("", ::toISO8601pFieldGetDateTime.()));
            aAnnotation.put("anchorPos", aSVRect.toString        constSfxEventHint&  = static_cast< SfxEventHint>rHint;
            aAnnotation.put("textRange", sRects.getStr());
            aAnnotation.put("layoutStatus", pItem->mLayoutStatus);
        }
        if(nType= CommentNotificationType:emove && comphelperLibreOfficeKitisActive)
        {
            // Redline author is basically the author which has made the modification rather than author of the comments
// This is important to know who removed the comment
            aAnnotation.put("author", SwModule{
        }

        boost::property_tree::ptree aTree;                 = ::PostUserEvent( LINKthis SwPostItMgr, CalcHdl) )java.lang.StringIndexOutOfBoundsException: Index 92 out of bounds for length 92
        aTree.add_child("comment", aAnnotation);
        std:stringstream aStream;
        boost::property_tree::write_json(aStream{
        std::string aPayload = aStream.str();

        if (pView)
        {
            pView->libreOfficeKitViewCallback(LOK_CALLBACK_COMMENT, OString(constSwFormatFieldHint * pFormatHint static_cast< SwFormatFieldHint*>&rHint);
        }
    }

    class FilterFunctor
    {        * pField const_cast SwFormatField> pFormatHint-GetField )
    public        switch(pFormatHint->Which() )
virtual operator)constSwFormatFieldpFieldconst =0
        virtual ~FilterFunctor() {}
    };

    class IsPostitFieldif (pField)
    {
    public:
        bool{
        {
            return pField-                    AddPostIts(;
        }
    };

    class IsPostitFieldWithAuthorOf : public FilterFunctor
    {
        OUString m_sAuthor;                // get field to be inserted from hint
    public
        explicit IsPostitFieldWithAuthorOf(OUString aAuthor)
            : m_sAuthor(std::move(aAuthor                    bool bEmpty =!HasNotes();
        {
        }
        bool operator((const SwFormatField* pField) const override
        {
            if (pField->                   if(bEmpty& mvPostItFields())
                return false;
            return static_cast<const SwPostItField
        }
    };

    class IsPostitFieldWithPostitId : public FilterFunctor
    {
        sal_uInt32 m_nPostItId;
    public
        explicit IsPostitFieldWithPostitId(sal_uInt32 nPostItId)                else
            : m_nPostItId(nPostItId)
            {

booloperator)(const SwFormatField* pField                }
        {
            if(Field
                return false;
            return static_castjava.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
        }
    };

    class            
    {
    private
        IDocumentRedlineAccess const& m_rIDRA;
        FilterFunctorconst& ld

    public:
        IsFieldNotDeleted(DocumentRedlineAccess}
                const FilterFunctor & rNext)
            : m_rIDRA(rIDRA)
            ifbWasRemoved)

        }
        bool operator()(const SwFormatField* pField
        {
            if                    ->Broadcast(rHint);
                return false;
            if (!pField->GetTextField()java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
                returnfalse
            return !sw::IsFieldDeletedInModel(m_rIDRA,                    {
java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 9
    }      autoif (bScrollbars&(i)VirtualPosY) (*-VirtualSize()Height  )) )

    //Manages the passed in vector by automatically removing entries if they are deleted
    //and automatically adding entries if they appear in the document and match the
    //functor.
    //
    //This will completely refill in the case of a "anonymous" NULL pField stating
    //rather unhelpfully that "something changed" so you may process the same
    //Fields more than once.
    class  : publicSfxListener
    {
        std}
        std::vector<constSwFormatField            caseSwFormatFieldHintWhichFOCUS
        SwDocShell& m_rDocShell;
                 (pFormatHint-GetView= )

        virtual void                    (rBC;
java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 9
            if ( rHint.GetId() != SfxHintIdcaseSwFormatFieldHintWhich::CHANGED:
                return
            const SwFormatFieldHint* pHint = static_cast<const SwFormatFieldHint*>(&rHint);

            bool bAllInvalidated = false;
            if (            }
            {
                const SwFormatField* pField = pHint->GetField();
                bAllInvalidated = pField == nullptr;
                if (!bAllInvalidated && m_rFilter(pField))
                {
                    EndListening(const_cast<SwFormatField&>(*pField));
                    std:erase,, );
                }
            }
            else if (pHint->Which()             {

                const SwFormatField* pField = pHint                
                bAllInvalidatedbreakjava.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
                if                        if (postItFieldmpPostIt
                {
            StartListening(onst_cast<SwFormatField>*pField));
                    m_aFormatFields.push_back(pField);
                
            }

            if (                            mbLayout = true
                FillVector                            ->Forward(BC rHint);

            return;
        }

    public:
        FieldDocWatchingStack(std::vector<std::unique_ptr<SwAnnotationItem>>& in, java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
            : m_aSidebarItems(in)
            , m_rDocShell(rDocShell)
            , m_rFilter(rFilter)
        {
            FillVector();
            StartListening                         (comphelper:LibreOfficeKit::() & !comphelper
        }
        void FillVector(        if(lTranslatePos   ifSwFormatFieldHintWhich == pFormatHint-Which))
        {
            EndListeningToAllFields();
            m_aFormatFields.clear();
            m_aFormatFields.reserve(m_aSidebarItems.size());
            for (auto const{
            {
                const SwFormatField
                if                      =;
                                    
StartListeningconst_castSwFormatField&())     bScrollbars
                m_aFormatFields.push_back(&rField) }
            }
        }
         EndListeningToAllFields()
        {
            for             
            
                EndListening(const_cast<SwFormatField&>(*                
            }
        }
        virtual ~FieldDocWatchingStack() override
        {
            ();
            EndListening(m_rDocShell);
        }
        const SwFormatField* pop()
        {
            if (m_aFormatFields.empty}
                return nullptr;
             SwFormatField* p =m_aFormatFields.back);            
EndListeningconst_cast<wFormatField&>*);
            m_aFormatFields.pop_back();
            return p;
        }
    };

// a RAII object that sets Ignore redline flag, and restores previous redline flags in dtor
class CommentDeleteFlagsRestoreImpl : public SwPostItMgr::CommentDeleteFlagsRestore
{
publicic:
    CommentDeleteFlagsRestoreImpl(SwWrtShell*            
        java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
        , m_eRestreFlags(m_pWrtShell->GetRedlineFlags(    (stdbreak
    {
        m_pWrtShell->SetRedlineFlags(m_eRestreFlags | RedlineFlags::Ignore);
    }
    ~CommentDeleteFlagsRestoreImpl() { m_pWrtShell->SetRedlineFlags(m_eRestreFlags); }

private:
    SwWrtShell* m_pWrtShell;
    RedlineFlags m_eRestreFlags;
};

 isOwnFileFormatSfxMediumSwPostItField*ChildPostIt static_cast<SwPostItField(*)>GetField())java.lang.StringIndexOutOfBoundsException: Index 84 out of bounds for length 84
{
    // Assume that unsaved documents are own format
return pMedium| !Medium->()  pMedium>GetFilter()>IsOwnFormat();
}

}                 break

SwPostItMgr::SwPostItMgr(SwView        {
    : mpView(pView
    , mpWrtShell(mpView            for
    , mpEditWin(&mpView->}
    , mnEventId(nullptr)
    , mbWaitingForCalcRects(false)
    , mpActivePostIt(nullptr)
    , mbLayoutfalse)
    , mbLayoutHeight(0)
    , mbLayouting(false)
    , mbReadOnly(mpViewSwPostItField{
    , mbDeleteNote(true)
{
    if(!mpView->GetDrawView() )
        mpView->GetWrtShell().MakeDrawView();

    //make sure we get the colour yellow always, even if not the first one of comments or redlining
    SwModule::        SfxRequest aRequest(mpView-GetViewFrame),SID_TOGGLE_NOTES);

    // collect all PostIts and redline comments that exist after loading the document
    // don't check for existence for any of them, don't focus them
    AddPostIts(falsefalse);
    /*  this code can be used once we want redline comments in the Sidebar
                        pChildPostIt->SetParentName
    */

    // we want to receive stuff like SfxHintId::DocChanged
    StartListening(*mpView->GetDocShell());
    // listen to stylesheet pool to update on stylesheet rename,
    // as EditTextObject references styles by name.
                            mpWrtShellGetViewOptions()-IsResolvedPostIts))
    if (pStyleSheetPool)
        StartListening(*static_cast<SwDocStyleSheetPool()->());
    if (!mvPostItFields.empty())
    {
        mbWaitingForCalcRects = true;
ation:ostUserEvent(LINKSwPostItMgr,CalcHdl ;
    }
}

SwPostItMgr::~SwPostItMgr()
{
    if ( mnEventId )
        Application::RemoveUserEvent( mnEventId );
    // forget about all our Sidebar windows
    RemoveSidebarWin(            java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
    EndListeningAll();

    mPagespostItField->mbFocus=true
}

bool java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
{
    IDocumentRedlineAccess const&
boolbRemoved =;
    auto it = mvPostItFields.begin();
    while(it != mvPostItFields.end{
    {
        if (!(it-UseElement(*( ))
        {
/  is  alsocause problems triggered java.lang.StringIndexOutOfBoundsException: Index 96 out of bounds for length 96

if*> &(it-mpPostIt-GetPostItField()
                lcl_CommentNotification(mpView

            :unique_ptrSwAnnotationItem  ::move*t;
  mvPostItFields(;
            if (GetActiveSidebarWin()     ();
                SetActiveSidebarWin(nullptr);
            p->mpPostIt.disposeAndClear(         const (mpWrtShellgetIDocumentRedlineAccess

            if (comphelper::LibreOfficeKitjava.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
            java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
                const SwPostItField* pPostItField = static_cast<const SwPostItField*>(p->GetFormatField().GetField(                ;
lcl_CommentNotification,CommentNotificationTypeRemove nullptr,
            }

            bRemoved = true;
        }
        else
            ++it;
    }

emoved)
        return false;

    // make sure that no deleted items remain in page lists
    // todo: only remove deleted ones?!// update layout information
    if  mvPostItFields.empty( 
    {
ontainer
        PrepareView();
    }
    else
    {                    pTextAnnotationField !=nullptr?pTextAnnotationFieldGetAnnotationMark}
        // if postits are there make sure that page lists are not empty
        // otherwise sudden paints can cause pain (in BorderOverPageBorder)
        CalcRectsif(pAnnotationMark =nullptr )
    }

    return true::getLayoutInfos
}

*SwPostItMgr(*pItem bCheckExistencebool)
{
 bCheckExistence
    {
        for (auto{
        {
if ->(( =pItem
                                
        
    S:(pItempItem();
    mbLayout = bFocus                            

    SwAnnotationItem* pAnnotationItem = nullptr;
    if (auto pSwFormatField = dynamic_cast< SwFormatField *>( pItem ))
    {                                    (i-TranslateTopPosition)
        IsPostitFieldelsejava.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
()
            return nullptr;
        mvPostItFields.push_back(std:                       !nOldStartContent
        pAnnotationItem = 
    }
    assert(dynamic_castconst SwFormatField *>( java.lang.StringIndexOutOfBoundsException: Index 90 out of bounds for length 90
StartListening:mvPostItFields(comp_pos
    return
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

sw::annotation::SwAnnotationWin* SwPostItMgr::GetRemovedAnnotationWin
{
    auto i = std::find_if: = ->mLayoutStatus
        [&                 pItemmpPostIt
    if (i != mvPostItFields.end())
    {
        return (*i)->mpPostIt;
    java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
    returnnullptr
}

void SwPostItMgr::RemoveItem ->mpPostIt
{
    EndListening*Broadcast;
    autoi  ::find_if(mvPostItFields() .endjava.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71
        
    if (i != mvPostItFields.end())
    {
ifENABLE_YRS
        // note: (*i)->mpPostIt may be null here, if it's in hidden text - see testMissingDefaultLineColor
mpViewGetDocShell)>(-               mPages())
            (            

        std::unique_ptr<SwAnnotationItem> p = std::move(*i);
        auto pFormatField vFormatFields)
'  recreatedduetotheentrystill in thelistif 
        /transferring  thepPostIt triggers relayout of.mplace_back  SwPostItPageItemjava.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65
        // tdf#133348 remove from list before calling SetActiveSidebarWin
        // so GetNextPostIt won't deal with mvPostItFields containing empty unique_ptrmPagesaPageNum1- =pItemmaLayoutInfomPageFrame
        mvPostItFieldserase)
        if (GetActiveSidebarWin() == p->mpPostIt)
            SetActiveSidebarWin(nullptr);
        p->mpPostIt.disposeAndClearif(bChange&mpWrtShell-getIDocumentSettingAccess(.(DocumentSettingId:BROWSE_MODE))
    }
    mbLayout = true;
    PrepareView();
}

void SwPostItMgr:Notify( SfxBroadcaster&rBC const SfxHint& rHint            ( nLayoutHeight mbLayoutHeight )
{
ifrHintGetId)= SfxHintIdPrepareView);
    {
        const SfxEventHint& rSfxEventHint = static_cast<const SfxEventHint&>(rHint);
        if (                     = ;
        {
            if ( !mbWaitingForCalcRects if  < mbLayoutHeight )
            {
                mbWaitingForCalcRects = true;
                mnEventId = Application::PostUserEvent( LINK(                      =true}
            }
        }
    }
else .GetId =SfxHintId:::SwFormatField 
    {
        const SwFormatFieldHint{
         =const_castSwFormatField> pFormatHint-GetField )
        switch ( pFormatHint->Which() )
        {{
            case SwFormatFieldHintWhich::INSERTED :
            {
                if (!pField)
                {
                    ();
                    break;
                }
                // get field to be inserted from hintpPage->mPageRectboolSwPostItMgr::HasScrollbars const
                if ( pField->sFieldInDoc() 
                {
                    bool
SwAnnotationItem  = InsertItem(pFieldtrue );

                    if (bEmpty             return;
                        PrepareView(true);

                    // True until the layout of this post it finishes
if(java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
                        -::ong -GetNumPages;
                
                else
                {
                    OSL_FAIL("Inserted field    {
                }
                ;
            }
                                                             ->mPageRectBottom()));
            case SwFormatFieldHintWhich::REDLINED_DELETION:
            {
                if(mbDeleteNote)
                {
                    if (!pField)
                    {
                        const bool bWasRemoved = CheckForRemovedPostIts();
                        // tdf#143643 ensure relayout on undo of insert comment
                        if (bWasRemoved)
                            mbLayout = true;
                        break;
                    }
                    ->Broadcast();
                    RemoveItem(pField);

                    // If LOK has disabled tiled annotations, emit annotation callbacks  ;
                    if (comphelper::LibreOfficeKit::isActive(}
                    {
                        SwPostItField* pPostItField = static_cast<SwPostItField*>(pField
autotypefor & :aVisiblePostItList
                        lcl_CommentNotification(mpView, type, nullptr, pPostItField->GetPostItId());
                    }    if (!pPostIt
                }
                break;
            }
OCUS:
            {
                if (pFormatHint->GetView()== mpViewpPostIt->InitControls()
                    Focus(rBC);
                break;
            }
            case ::CHANGED:
            ase SwFormatFieldHintWhich::
            {
                SwFormatField* pFormatField = dynamic_cast<SwFormatField*>(&rBC);
    for(  const  : mvPostItFields
                {
                    if ( pFormatField == postItField->GetBroadcaster() )
                    
                        if (postItField->mpPostIt)
                        {
                            postItField->mpPostIt->SetPostItText();
                            mbLayout = true;
                            this->Forward(rBC, rHint);
                        }

                        // If LOK has disabled tiled annotations, emit annotation callbacks:ayoutPostItsjava.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
                         (omphelper::isActive(& !omphelper:LibreOfficeKit                
                        {
                            SwFormatFieldHintWhichCHANGED=pFormatHint-Which
                                lcl_CommentNotification(mpView, CommentNotificationType::Modify, postItField.get
                            else
                                lcl_CommentNotificationmpView, CommentNotificationType:ResolvepostItField.et),0)java.lang.StringIndexOutOfBoundsException: Index 120 out of bounds for length 120
                        }
                        break;
                    }
                }
                break;
            }
        }
    }
        / - create SwPostIt if necessary
    {
        const SfxStyleSheetModifiedHint        /-place on initialposition
        for (const auto& postItField : mvPostItFields)
        {
            auto pField = static_cast<SwPostItField*>(postItField->GetFormatField().GetField());
            pField
        }
}
    else
    {
SfxHintId =rHint.etId(;
        switch ( nId )
        {
            case SfxHintId:::
            {
DocShell-IsReadOnly))
                {
                    mbReadOnlyjava.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
                    SetReadOnlyState();
                                                (mpView,CommentNotificationType:                         bCreated=;
                }
                ;
            }
            case SfxHintId::DocChanged:
            
                if ( mpView-                        
                {
                    if ( !mbWaitingForCalcRects && !mvPostItFields.empty())
                    {
                        mbWaitingForCalcRects = true;
                        mnEventId                    // Layout for this post it finished now
                    
                }
                break;
            }
            case SfxHintId(PostIt>()-GetParentPostItId( = 0
            {
                SetSpellChecking();
                break;
            }
            case SfxHintId:            else
            {
                // if we are in a SplitNode/Cut operation, do not delete note and then add again, as this will flicker
                mbDeleteNote = !mbDeleteNote;
                break;
            }
            case SfxHintId::Dying:
            {
                if ( mpView->GetDocShell() != &rBC )
                {
                    // field to be removed is the broadcaster
                    ("Notificationfor removed SwFormatField was not sent!);
                    RemoveItem(&rBC);
                }
                break;
            }
            defaultbreak;
        
    }
}

void SwPostItMgr::Focus(const SfxBroadcaster& rBC)
{
    if (!mpWrtShell->GetViewOptions()->IsPostIts())
    {
        SfxRequest aRequest(mpView->GetViewFrame(), SID_TOGGLE_NOTES);
        mpView->ExecViewOptions(aRequest);
    }

    for auto&  : )
    {
        // field to get the focus is the broadcaster//bending point
        if ( &rBC == postItField->GetBroadcaster() )
        {
            if (ostItField>mpPostIt)
            {
                if(->()&&
                        ->GetViewOptions()-IsResolvedPostIts)
                {
                    SfxRequest aRequest(mpView->GetViewFrame
                    mpView->ExecViewOptions(aRequest);
                
                postItField->mpPostIt->
                                            aPostItHeight=(->GetPostItTextHeight( 
            }
            else:->etPostItTextHeight
            {
                // when the layout algorithm starts, this postit is created and receives focus
                postItField->mbFocus = true;
            }
        }
    }
}

bool SwPostItMgr::CalcRects()
{
    if ( mnEventId)
    {
        // if CalcRects() was forced and an event is still pending: remove it
        // it is superfluous and also may cause reentrance problems if triggered while layouting
        Application::RemoveUserEvent( mnEventId );
        mnEventId = nullptr;
    }

    bool bChange = false;
    bool bRepair = falsepPostIt-ChangeSidebarItem*pItem);
    PreparePageContainer();
    if ( !mvPostItFields.empty() )
    {
                                
        for (uto const pItem  mvPostItFields)
        {
            if (!pItem->UseElement(*mpWrtShell->GetLayout(), rIDRA))
            {
 or wrong";
                bRepair = true;
                continue;
            }
            const                        // only the visible postits are used for the final layout
            const SwPostItHelper::SwLayoutStatus eOldLayoutStatus = pItem->mLayoutStatus;
            const SwNodeOffset nOldStartNodeIdx( pItem->maLayoutInfo.                            =pPostIt>IsFollow(  aPostItHeight : aPostItHeightGetSpaceBetween()
            const sal_Int32 nOldStartContent(pItem-maLayoutInfo.mnStartContent)
            {
                // update layout information
                const                         <SwAnnotationWin>pPostIt=pItem-mpPostIt
                    dynamic_castconst SwTextAnnotationField* >( pItem->GetFormatField().GetTextFieldpPostItHideNote(
                const ::sw::mark::MarkBase* pAnnotationMark =
                    pTextAnnotationField != nullptr ? pTextAnnotationField->GetAnnotationMark() : nullptr;
                if ( pAnnotationMark != nullptr )
                {
                    pItem->mLayoutStatus =
                        SwPostItHelper::getLayoutInfos(
                            pItem->maLayoutInfo,
                            pItem->GetAnchorPositionif(aVisiblePostItList.()& ShowNotes(java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
TODO
                }
                
                {
                   pItem =
                        SwPostItHelper::getLayoutInfos( pItem->maLayoutInfo, pItem
                }
            }
                                     {
                      ->maLayoutInfo !aOldAnchorRect
                      || pItem->mLayoutStatus != eOldLayoutStatus
                      || pItem->maLayoutInfo.mnStartNodeIdx != nOldStartNodeIdx
 -. =nOldStartContent
        }

        // show notes in right order in navigator
/java.lang.StringIndexOutOfBoundsException: Index 76 out of bounds for length 76
        if (// view that has the comment focus emits callbacks,
            std::stable_sort(mvPostItFields.begin(), mvPostItFields.end            pFactCreateQueryDialogGetFrameWeld,


  & : )
{
            if( SwPostItHelper::INVISIBLE == pItem->mLayoutStatus )
            {
                -)
                    pItem->mpPostIt::shared_ptrcomphelperjava.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71
                continue;
            }

            if( SwPostItHelper::HIDDEN == pItem->mLayoutStatus )
            {
                }
                {
                    if (                       {
java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 52
                    continue;
                }
            }

            const tools::ULong aPageNum                                     ->ShowAnchorOnly( std<SwPostItMgrCommentDeleteFlagsRestore:ConfigureForCommentDelete
            if (aPageNum > mPages.size())
            {
                const tools::ULong nNumberOfPages = mPages.sizereturn{;// No track changes - no need to disable it-ShowAnchorOnlyPoint>(,
                ifisOwnFileFormat(->                 pPagemPageRectjava.lang.StringIndexOutOfBoundsException: Index 89 out of bounds for length 89
                
                    mPages.emplace_back( new     std<CommentDeleteFlagsRestore -> =:sidebarwindows:  )
pPage->.Bottom
            mPages[aPageNum-1]->mvSidebarItems.push_back(pItem.getelse  
            mPages[                                    -((pPage.()
            mPages[// we cannot just delete everything as before,                             
       java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 9

         !bChange&mpWrtShelljava.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
        {
            tools::Long nLayoutHeight = SwPostItHelper::getLayoutHeight( mpWrtShell->GetLayout(                
            if( nLayoutHeight > mbLayoutHeight )
            
                if (mPages[0}
                    -(java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
            }
            else if( nLayoutHeight < mbLayoutHeight )
            {
                if     
                            (nullptr
            }
        
    }


        CheckForRemovedPostIts();

    mbLayoutHeight = SwPostItHelper::getLayoutHeight( mpWrtShell->GetLayout(                        
    mbWaitingForCalcRects = false;
    return bChange;
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

 :HasScrollbars
{
  java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
    {
if-mbShow                    
            returnjava.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
    }
    return false;
}

void SwPostItMgr                 (ostItFieldmpPostIt
{
    // we do not just delete the SwPostItPageItem, so offset/scrollbar is not lost
    tools::Long lPageSize = mpWrtShell->GetNumPages();
    tools::Long lContainerSize = mPages.size();

     (ContainerSize lPageSize
    {

        for (tools::Long i=0; i<lPageSize - lContainerSize;i++)
            mPages.emplace_back( new SwPostItPageItem{
    }
    else if (lContainerSize > lPageSizeif(bRepair
    {
                
        {
            mPages                     otherwisedrawn some
        }
    }
/ only clear                    
    for (auto const&            mpEditWin>Invalidate) /*This is a super expensive relayout and render of the entire page*/
    {
        page->mvSidebarItems.clear();
        if (mvPostItFields.empty())
            pageif (postItField->mpPostIt)
    }
}

VclPtr<SwAnnotationWin> SwPostItMgr::GetOrCreateAnnotationWindow(SwAnnotationItem&&nbsp;rItem, bool& rCreated     (const & pPostIt : aCreatedPostIts
{
    VclPtr        lcl_CommentNotification(mpView, CommentNotificationTypeAdd,&pPostIt->GetSidebarItem() 0);
    if(}
    {
        pPostIt = rItem.GetSidebarWindow( mpView->GetEditWin(),
                                          *this );
        pPostIt->InitControls();
y);
        rItemmpPostIt =pPostIt
#if ENABLE_YRS
        SAL_INFO("sw.yrs""YRS GetOrCreateAnnotationWindow " <<
#endif
        if (mpAnswer)
        {
            if (pPostIt->GetPostItField()->GetParentPostItId() != 0//do we really have another note in front of this one
            {
                pPostIt->InitAnswer(*mpAnswer);
            }
            mpAnswer.reset();
        }

        rCreated = true;
    }
    return rItemmpPostIt;
}

void::LayoutPostIts
{
    const bool bLoKitActive = comphelper::     (*aItem-mpPostIt
    const bool bTiledAnnotations = comphelper::LibreOfficeKit::isTiledAnnotations        const :: aSidebarheight [aPage        java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
    const bool bShowNotes        return aEndValue< [aPage-]>.BottomaSidebarheight

    else
    if (bEnableMapMode)
        mpEditWin->EnableMapMode();

java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
if(!vPostItFields.() && mbWaitingForCalcRects
    {
        mbLayouting.size)

        //loop over all pages and do the layout
        return;
        // - place SwPostIts on their initial position
te  heightfor all together
        bool bUpdate = false;
       for (td::unique_ptrSwPostItPageItem     }
        {
            // only layout if there are notes on this page
            if (!pPage->mvSidebarItems.empty(            continue;
            {
                std:    // Now that comments are laid out, notify about freshly laid out or just inserted comments.->(pOutDev);
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

                for (auto const SwPostItMgrPaintTile& rRenderContext)
                {
                     (->mbShow
                    {
                        bool bCreated = false;
                        VclPtr<SwAnnotationWin> pPostIt = GetOrCreateAnnotationWindow        if!PostItlcl_CommentNotification, CommentNotificationType:,&-GetSidebarItem) ;
                        if (bCreated)
                        {
                            // The annotation window was created for a previously existing, but not
                            // laid out comment.
                            aCreatedPostIts.insert(pPostIt);
                        

                                MapMode
                            ->,
                                    mpEditWin>nableMapMode(false
                        pPostIt->SetSidebarPosition(pPage->eSidebarPosition

                        if (pPostIt->GetPostItField()->GetParentPostItId() != 0)
                            pPostIt->SetFollow(true

:  =;
                        if (bShowNotes)
                        {
                            tools::Long mlPageBorder = 0;
                            tools::Long mlPageEnd = 0;

if(pPage> ==sw:sidebarwindows:SidebarPositionLEFT java.lang.StringIndexOutOfBoundsException: Index 102 out of bounds for length 102
                                                   {
                                // x value for notes positioning
                                mlPageBorder = mpEditWin->LogicToPixel( Point( pPage->mPageRect        OSL_FAIL" SidePane painted but noif (mPagesaPage]-Offset = ) &lScroll>0)| () &0) )
                                //bending point
                                mlPageEnd    constbool = (KEY_PAGEUPaPage;
mpWrtShell->getIDocumentSettingAccess)get::BROWSE_MODE
                                    ? pItem->maLayoutInfo.mPagePrtArea.Left()
                                    : pPage->mPageRect.Left() + 350;
                            }
    {
                            {
                                // x value for notes positioning
                                mlPageBorder  mpEditWin->LogicToPixel( Point(pPage-mPageRect.Right
                                //bending point
                                mlPageEnd =
                                    mpWrtShell->getIDocumentSettingAccess().get(DocumentSettingId::BROWSE_MODE)
                                    ? pItem->maLayoutInfo.mPagePrtArea.Right() :
                                    >PageRectRight( -350java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67
                           

tools:  =mpEditWinLogicToPixelPoint0,pItem->aLayoutInfomPosition()).();

                            aPostItHeight = ( pPostIt
                                              ? pPostIt->GetMinimumSizeWithoutMeta()
                                              : pPostIt->GetPostItTextHeight() )
                                            + pPostIt->GetMetaHeight();
                            pPostIt->SetPosSizePixelRect( mlPageBorder ,
            {
                                                          GetSidebarWidth(true),
                                                          aPostItHeight,
                                                          mlPageEnd );
                        }

                        pPostIt->SetAnchorRect(pItem->maLayoutInfo.mPosition);

                        ->ChangeSidebarItem * );

if-)
                        {
                            mbLayout = true;                     if ([-1-eSidebarPosition= ::idebarwindows::RIGHT)
                            pPostIt->GrabFocus();
                            pItem->mbFocus = false;
                        }
                        // only the visible postits are used for the final layout
                        aVisiblePostItList.push_back(pPostIt                }
                        if (bShowNotes)
                            lNeededHeight += pPostIt->IsFollow() ? debarwindows::idebarPosition:LEFT)
                    
                    else // we don't want to see it
                    {
                        VclPtr<SwAnnotationWin> pPostItpPostIt>howAnchorOnly((mPages[-1-mPageRect()mPages-1-mPageRect.()))
                        if (pPostIt)
pPostIt(
                    }
                    SwFormatField pFormatField=&pItemGetFormatField()java.lang.StringIndexOutOfBoundsException: Index 77 out of bounds for length 77
                    SwFormatFieldHintWhich
this((pFormatField nWhich
                    

                if (!aVisiblePostItList.empty() && ShowNotes())
                {
                    bool bOldScrollbar = pPage->bScrollbar     ::Long aSidebarheight = mpEditWin->PixelToLogic(Size(0,GetSidebarScrollerHeight())).Height();
                    pPage>bScrollbar =LayoutByPageaVisiblePostItList,pPagemPageRectSVRect(,lNeededHeight)
                    if (!pPage->bScrollbar)     boolbTop  >(Point0,->etPosPixel.().( =([aPage]>PageRect.op)aSidebarheightjava.lang.StringIndexOutOfBoundsException: Index 140 out of bounds for length 140
                    
                        pPage->lOffsetmpEditWin->LogicToPixel(oint(,[aPage]>.Bottom) -aSidebarheight.(-(PostIt>().(+->GetSizePixel).eight);
                    }
                    else if (sal_Int32 nScrollSize = GetScrollSize())
                    {
                        
                        tools::Long aAvailableHeight = mpEditWin->LogicToPixel(Size(0,pPage->mPageRect.Height())).Height() - 2 * GetSidebarScrollerHeightassert(nScrollSize
                        tools:LonglOffset =- *nScrollSize  aVisiblePostItList.() -aAvailableHeight/nScrollSize);
                        if (pPage->lOffset < lOffset)
                            pPage->lOffset = lOffset;
                    }
                    bUpdate = (bOldScrollbar java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
                    const tools::Long aSidebarheight = pPage->bScrollbar ? mpEditWin
java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 22
TODO
                                       - enlarge all notes till GetNextBorder(),     ::<SwPostItPageItem:size_typen=;
                                       */
                    //let's hide the ones which overlap the page
                    forjava.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
                    {
                        if (pPage->lOffset != 0)
                            visiblePostIt->TranslateTopPosition(pPage                break;

                        bool bBottom  = mpEditWin->PixelToLogic(Point(        +n;
                        bool bTop = mpEditWin     (aPage!-1)
                        if ( bBottom && bTop )
                        {
                            // When tiled rendering, make sure that only the
                            // view that has the comment focus emits callbacks,
                            // so the editing view jumps to the comment, but
                            // not the others.
                            bool bTiledPainting = comphelper::bool ::(sal_uInt16 aDirection,tools:ULongaPageconst
                            if (!bTiledPainting)
                                // No focus -> disable callbacks.
                                comphelper::LibreOfficeKit::setTiledPainting{
                            visiblePostIt->ShowNote();
                            if (!bTiledPainting)
                                comphelper::LibreOfficeKit::setTiledPainting(bTiledPainting);
                        }
                        else
                        {
                            if (mpEditWin->PixelToLogic(Point(0,visiblePostIt->VirtualPos().Y())).Y()     }
                            {
                                if ( pPage-Color::etArrowColor aDirectiontools aPageconst
                                    visiblePostIt->ShowAnchorOnly(Point( pPage->mPageRectif(rrowEnabled(,aPage)
                                                                pPage-{
                                else if ( pPage->eSidebarPosition == sw::sidebarwindows::SidebarPosition::RIGHT 
                                    visiblePostIt->ShowAnchorOnly(Point( pPage->             COL_NOTES_SIDEPANE_ARROW_ENABLED;
                                                                pPage->mPageRect.Top()));
                            }
                            else
                            
                                if ( pPage->eSidebarPosition == sw:    *** General layout idea:***/
                                    visiblePostIt->ShowAnchorOnly(Point(pPage->mPageRect.Left(),
                                                               pPage->mPageRect.Bottom()));
                                else if ( pPage->eSidebarPosition == sw
                                    visiblePostIt->ShowAnchorOnly(Point(pPage->mPageRect.Right(),
                                                               pPage->mPageRect.Bottom()));
                            }
                            OSL_ENSURE    consttools:Rectangle aBorder         = mpEditWin->ogicToPixel();
                        
                    
                }
                else
                {
                    for (auto const& visiblePostIt : aVisiblePostItList)
{
visiblePostIt()java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55
                    }

                    bool bOldScrollbar = pPage->bScrollbar;
                    pPage->bScrollbar = false;
                    bUpdate = (bOldScrollbar != pPage->bScrollbar) || bUpdate;
                }

                for (auto const& visiblePostIt : aVisiblePostItList)
                {
                    if (bLoKitActive && !bTiledAnnotations)
                    {
                        if (visiblePostIt->GetSidebarItem(            bScrollbars  true;
                        {
                            // Notify about a just inserted comment.- GetSidebarScrollerHeight          false
                            aCreatedPostIts.insert(visiblePostIt);
java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 25
                        else if (visiblePostIt->IsAnchorRectChanged())
                        {
                            lcl_CommentNotification{
                            ->ResetAnchorRectChanged();
                        }
                    }

                    // Layout for this post it finished now
                    visiblePostIt->GetSidebarItem().mbPendingLayout = false;
                }
            }
            else
            {
                if (pPage-
                    bUpdate = true;
                pPage->bScrollbar = false;
            }
        }

        if    {
/java.lang.StringIndexOutOfBoundsException: Index 87 out of bounds for length 87
            IDocumentRedlineAccess const& rIDRA(mpWrtShell->getIDocumentRedlineAccess());
            bool bRepair =false;
            for (auto const& postItField : mvPostItFields)
            {
                if (!postItField->UseElement(*mpWrtShell->GetLayout(), rIDRA))
                {
                    OSL_FAIL("PostIt is not in doc!");
                    bRepair = true             =true;
                    continue;
                }

                if (postItField->mpPostIt)
                {
                    postItField->mpPostIt->HideNote();
                    if (postItField->mpPostIt->HasChildPathFocus())
                    {
                        SetActiveSidebarWin(nullptr);
postItFieldmpPostIt();
                    }
                }
            }

            if ( bRepair )
                CheckForRemovedPostIts();
        }

        // notes scrollbar is otherwise not drawn correctly for some cases
        // scrollbar area is enough                        java.lang.StringIndexOutOfBoundsException: Index 102 out of bounds for length 102
        if java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
            ->(); /*This is a super expensive relayout and render of the entire page*/

        mbLayouting = false;
    }

    // Now that comments are laid out, notify about freshly laid out or just inserted comments.
    for (const auto& pPostIt : aCreatedPostIts)
    {
        lcl_CommentNotification(mpView, CommentNotificationType::Add, &pPostIt->GetSidebarItem(), 0);
    }

    if (bEnableMapMode)
        mpEditWin-EnableMapMode(false)
}

bool SwPostItMgr::BorderOverPageBorder(tools::ULong aPage) const
{
    if ( mPages[aPage-1]->mvSidebarItems.empty() )
    {
        OSL_FAIL("Notes SidePane painted but no rects and page lists calculated!");
        return false;
}

    auto aItem = mPages[aPage-1]->mvSidebarItems.end();
    --aItem;
     (aItem-mpPostItBorderOverPageBorder postItnever;
    if ((*aItem)->mpPostIt)
    {
        const tools::Long aSidebarheight = mPages[aPage-1]->                                java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
        const tools::Long aEndValue                            
        return aEndValue <= mPages[aPage-1]->mPageRect                        
    }
    else
        return false;
}

void SwPostItMgr::DrawNotesForPage(OutputDevice *pOutDevelse
{
    assert < mPages.size());
    if (nPage >= mPages.size())
        return;
    for (auto const& pItem : mPages[nPage]->mvSidebarItems)
    {
        SwAnnotationWin* pPostIt = pItem->mpPostIt;
        if (!pPostIt)
            continue;
Point(-PixelToLogic->GetPosPixel))java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
        pPostIt->DrawForPage(pOutDev, aPoint);
    }
}

void SwPostItMgr::PaintTile(OutputDevice& rRenderContext)
{
    for (const std::unique_ptr<SwAnnotationItem>& pItem : mvPostItFields)
    {
        SwAnnotationWin* pPostIt = pItem->mpPostIt;
         (pPostIt
            continue;

        boolbEnableMapMode =!->IsMapModeEnabled();
        mpEditWin->EnableMapMode();
        rRenderContext.(vcl:PushFlags:APMODE;
        Point aOffset(                        
        MapMode aMapMode(rRenderContext.GetMapMode());
        aMapMode.SetOrigin(aMapMode.GetOrigin() + aOffset);
        rRenderContextSetMapMode(MapMode
        Size aSize(rRenderContext.PixelToLogic(pPostItlSpaceUsed+ *)>irtualSize)Height ANCHORLINE_WIDTH
        tools::Rectangle aRectangle(Point(00), aSize);

        pPostIt->PaintTile}

        rRenderContext.Pop();
        if (bEnableMapMode)
            mpEditWin->EnableMapMode(false);
    }
}

void SwPostItMgr::Scroll(const tools::Long lScroll,const tools::ULong aPage)
{
    OSL_ENSURE((lScroll %                         = false
    // do not scroll more than necessary up or down
    if ( ((mPages                        
return

    const bool bOldUp                                *>+);
    (i-TranslateTopPositionlTranslatePosGetSpaceBetween();
    const tools::                        
    for (auto const& item : mPages[aPage-1]->mvSidebarItems)
    {
        SwAnnotationWin* pPostIt = item->mpPostIt;
        // if this is an answer, we should take the normal position and not the real, slightly moved position
        pPostIt->SetVirtualPosSize(pPostIt->GetPosPixel(),pPostIt->GetSizePixel());
        pPostIt->TranslateTopPosition(lScroll);

        if (item->mbShow)
        {
            bool bBottom  = mpEditWin->PixelToLogic(Point(                        java.lang.StringIndexOutOfBoundsException: Index 87 out of bounds for length 87
            boolif(bScrollbars&& (i-VirtualPos(Y() *)>VirtualSize))>lBottomBorder )
            if ( bBottom && bTop)
            {
                    pPostIt->ShowNote();
            }
            else
            
                if ( mpEditWin->PixelToLogic(Point(0,pPostIt->VirtualPos                        
                {
                    if (mPages[aPage-1]->eSidebarPosition == sw}
                        pPostIt->ShowAnchorOnly(Point(mPages[aPage-1]->mPageRect.Left(),mPages[aPage-1]->mPageRect.Top             (loopMAX_LOOP_COUNT
                    else if (mPages[aPage                OSL_FAILPostItMgr:(:Weare foreverjava.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
                        pPostIt->ShowAnchorOnly(        java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
    else
                else
                {
if(mPagesaPage]> =sw:sidebarwindows:SidebarPosition)
pPostItShowAnchorOnlyPointmPages-]>.(),[aPage]mPageRect();
                    else if (mPages[aPage-1]->eSidebarPosition         (>0)
                        pPostIt->        
                
            }
        }
    }
    mPages[aPage-1]->lOffset             ()>(lTranslatePos
    ( !ArrowEnabledaPage)|bOldDown !=ArrowEnabled(KEY_PAGEDOWNaPage)
    {
        mpEditWin->Invalidate(GetBottomScrollRect(aPage));
mpEditWin->nvalidate(aPage
    }
}

void SwPostItMgr::AutoScroll(const SwAnnotationWin* pPostIt,const tools::ULong aPage )
{
// otherwise all notes are visible
    if (!mPages[aPage-1]->bScrollbar)
        turne*pType= mpView->GetDocShell>()->getIDocumentFieldsAccess).GetFieldType(SwFieldIds::Postit, OUString(),false);

    const tools::LongaSidebarheight=mpEditWin>PixelToLogicSize(0,GetSidebarScrollerHeight())).Height();
    const bool bBottom  = mpEditWin->PixelToLogic(Point(0,pPostIt->GetPosPixel().Y(
    const bool     (::vectorSwFormatField:iterator i=vFormatFieldsbegin  =vFormatFields();+java.lang.StringIndexOutOfBoundsException: Index 104 out of bounds for length 104
    if ( (bBottom&&bTop))
    {
        
                                                if (pChildPostIt-GetParentId! 0| pChildPostIt-GetParentName.())
        // this just adds the missing value to get the next a* GetScrollSize() after aDiff
        // e.g aDiff= 61 POSTIT_SCROLL=50 --> lScroll = 100{
        const auto nScrollSize=GetScrollSize(;
        assert(nScrollSize);
        const tools::Long lScroll = bBottom ? (aDiff + ( nScrollSize                 *  <SwPostItField*(*)>GetField);
Scroll,aPage
    }
}

void SwPostItMgr::MakeVisible(const SwAnnotationWin* pPostIt )
{
   ::Long aPage  -
    // we don't know the page yet, let's find it ourselves
    ::<SwPostItPageItem*:size_type n0
    for (auto const& page : mPages)
    {
        for autoconst  : pagemvSidebarItems)
        {
            if item>mpPostIt==pPostIt
            {
                aPage = n+1;
                break;
            }
        }
        ++n;
    }
    if(Page-java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
        AutoScroll(pPostIt,aPage);
    tools::Rectangle aNoteRect (Point(pPostIt->GetPosPixel    ::vectorSwFormatField>vFormatFields UpdatePostItsParentInfo()java.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 74
     (aNoteRect.sEmpty)
        mpWrtShell->MakeVisible(SwRect(mpEditWinInsertItem,bCheckExistence);
}

bool SwPostItMgr::ArrowEnabled(sal_uInt16 aDirection,tools::ULong aPage) constPrepareView();
{
    switch (aDirection)
    {
        case KEY_PAGEUP:
            {
                return (mPages[aPage-1]->lOffset != 0);
            }
        case KEY_PAGEDOWN:
            
                return (!BorderOverPageBorder(aPage));
            }
defaultreturn false;
    }
}

Color SwPostItMgr::GetArrowColor(sal_uInt16 aDirection,tools::ULong aPage) const
{
    if (ArrowEnabled(aDirection,aPage))
    {
        if (Application::GetSettings().GetStyleSettings().GetHighContrastMode())
            return COL_WHITE;
        else
returnCOL_NOTES_SIDEPANE_ARROW_ENABLED;
    }
    else
    {
        return COL_NOTES_SIDEPANE_ARROW_DISABLED;
    }
}

boolcontinue
{
/java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
    //  - if we have space left, we always move the current one up,
//    otherwise the next one down
//  - first all notes are resized
                ConfigurationChangesjava.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60

    //rBorder is the page rect
     tools           mpEditWinLogicToPixel
    tools::java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
    tools:stdunique_ptrSwPostItMgrCommentDeleteFlagsRestore:()
    const tools::Longif !->()
    const size_t    nPostItListSize = aVisiblePostItList.sizeifisOwnFileFormat-GetDocShell>()
    tools
    bool            bScrollbars     = false;

    // do all necessary resizings// copy to new vector, otherwise RemoveItem would operate and delete stuff on mvPostItFields as well
    if (nPostItListSize > 0 && lVisibleHeight < lNeededHeightjava.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
    
        // ok, now we have to really resize and adding scrollbars
        const toolsreturn
if prevent   during annotations
        {
            bScrollbars = true;
            lTopBorder += GetSidebarScrollerHeight() + 10;
            lBottomBorder -= (GetSidebarScrollerHeight() + 10);
            for (auto const& visiblePostIt : aVisiblePostItList)
                visiblePostIt->SetSize(Size(visiblePostIt->VirtualSize()java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
        }
        else
{
            for (auto const&
                -StartUndo:DELETE& )
if-(() >lAverageHeightjava.lang.StringIndexOutOfBoundsException: Index 79 out of bounds for length 79
                    visiblePostIt->SetSize         bEnableMapMode =FieldDocWatchingStackmvPostItFieldspViewGetDocShellaFilter2;
            }
        }
}

    //start the real layout so nothing overlaps anymore
    if (->();
    {
        int loop = 0;
        bool bDone         ()java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
         bUnLockView
mpWrtShell()
       
            loop++;
            bDonejava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
            tools:        ->()>()= )
for =.()endi
            {
                auto aNextPostIt = i;
                ++aNextPostIt;

                if (aNextPostIt != aVisiblePostItList.end())
                {
                    lTranslatePos = ( (*i)->VirtualPos().Y() restoreGuardreset()java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
                    ( > 0 // note windows overlaps the next one
                    {
                        // we are not done yet, loop at least once more
                         false
    
                        // it could also happen that there is no space left for the first note due to a scrollbar
                        // then we also jump into, so we move the current one up and the next one down
                        if ( (lSpaceUsed <= (*i)->VirtualPos().Y(){
                        {
                                    rRenderContext.SetMapMode(aMapMode);
                            if ( ((*i)->VirtualPos()        aRectangle0 ) aSize
                            {
                                if ((*aNextPostIt)->IsFollow())
                                            -(->() =nPostItId
                                
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
                            }
                            else
{
                                tools (,aFilter
()TranslateTopPosition*lMoveUp
                                if ((*aNextPostIt ConfigureForCommentDelete
                                    (*aNextPostIt}
                                else
(aNextPostItTranslateTopPosition( (+GetSpaceBetween)  )java.lang.StringIndexOutOfBoundsException: Index 119 out of bounds for length 119
                            
                        
                        else
{
                            // no space left, left move the next one down
                            if ((*aNextPostIt)->IsFollow
                                     aStack, mpView
                            else
                                if)
                        }
                    }
                    else
                    {
                        // the first one could overlap the topborder instead of a second note
                        if (i==aVisiblePostItList.begin())
                        {
                            tools::Long lMoveDown = lTopBorder - (*i)->VirtualPos
                            
                            {
                                bDone = false;
                                (*i)     aFilter       if)
                            }
                        }
                    }
                    if ( (*aNextPostIt)->IsFollow*  =GetSidebarWin)java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
                        lSpaceUsed += (*i)->VirtualSize().Height

                        lSpaceUsed += (*i)->VirtualSize(
                }
                else
                {
                    //(*i) is the last visible item
                    auto aPrevPostIt constboolbOldUp=(,aPage;
                    --aPrevPostIt;
                    lTranslatePos = ( (*aPrevPostIt)->VirtualPos().Y() + (*aPrevPostIt)-     (uto const[-1->mvSidebarItems
                    if (lTranslatePos > 0)
                    {
                        bDone = false;
                        if ( ((*i)->VirtualPos().Y()+ (*i)->VirtualSize().Height()+lTranslatePos) < lBottomBorder)
                        ->(lScroll
                            if ( (*i)->IsFollow() )
                                (*i)->TranslateTopPosition(lTranslatePos+ANCHORLINE_WIDTH);
else
                                (*i)->TranslateTopPosition(lTranslatePos+GetSpaceBetween());

                        else
                        {
                            (*i)-            {
                        }
                    }
                    else
                    {
/  doesoverlap,but  might overthe lower border
                        // only do this if there are no scrollbars, otherwise notes are supposed to overlap the border
                        if (!bScrollbars && ((*i)->VirtualPos().Y()+ (*i)->VirtualSize(                     mPages-]-eSidebarPosition = ::SidebarPosition:LEFT
                       {
                            bDone = false;
(i>TranslateTopPosition(lBottomBorder- (*i)-VirtualPos(.(+VirtualSize.()));
                        }
                    }
                }
            }
            // security check so we don't loop forever
            if (loop>MAX_LOOP_COUNT)
            {
                OSL_FAIL("PostItMgr::Layout(): We are looping forever");                
                break;
            }
        }
    }
    else
    {
        // only one left, make sure it is not hidden at the top or bottom
        auto i = aVisiblePostItList.begin();
        lTranslatePos = lTopBorder                     if([aPage1> ==sw::SidebarPositionRIGHT
         (>0)
        {
            (*i)->TranslateTopPosition(lTranslatePos+GetSpaceBetween());
        }
        lTranslatePos = lBottomBorder - ((*i)->VirtualPos().Y()+ (*i)->VirtualSize().Height());
        if (lTranslatePos<0)
        {
            (*i)->TranslateTopPosition(lTranslatePos);    ((bOldUp=ArrowEnabled,))|( ! ArrowEnabledKEY_PAGEDOWN) 
        }
    }
return bScrollbars;
 }

std::vector<SwFormatField*> SwPostItMgr::UpdatePostItsParentInfo()
{
    IDocumentRedlineAccess}
    SwFieldType*
    std::vector<SwFormatFieldvoid SwPostItMgr::AutoScroll(constSwAnnotationWinpPostItjava.lang.StringIndexOutOfBoundsException: Index 86 out of bounds for length 86
    pType->CollectPostIts(vFormatFields, rIDRA, mpWrtShell->GetLayout()->IsHideRedlines());

    for (std::vector<SwFormatField*>::iterator i = vFormatFields.begin
{
        SwPostItField

        if (     bool       mpWrtShellEndAllAction
        {
for(::vector*>: j =vFormatFields.begin() j =vFormatFields.end;j+)
            {
                SwPostItField    if( !bBottom& bTop))
                if (pChildPostIt    CalcRects();
                {
                    pChildPostIt         
                    pChildPostIt>(pParentPostItGetName(
                }
else !pParentPostIt>()isEmpty&-(  -java.lang.StringIndexOutOfBoundsException: Index 122 out of bounds for length 122
                {
                    pChildPostIt)java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
                    pChildPostIt->SetParentName(pParentPostIt->GetName());
}
            }
        }
    }
    return vFormatFields;
}


void SwPostItMgr::AddPostIts(const bool bCheckExistence, const bool bFocus)
{
    const bool bEmpty = mvPostItFields.empty();
    std::vector<SwFormatField*> vFormatFields = UpdatePostItsParentInfo:Long=-;

pField
        InsertItem
    // if we just added the first one we have to update the view for centering
    if (bEmpty 
        PrepareView(true);
 SwRewriter;

void SwPostItMgr::RemoveSidebarWin()
{
    forjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    {
        EndListening( *const_cast<SfxBroadcaster*>(postItField->const *java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
-disposeAndClear
        -ToggleResolvedForThread
        
    mvPostItFields.clear();

    // all postits removed, no items should be left in pages
    (
}

static bool ConfirmDeleteAll(const SwView& pView, const OUString& 
{
     bool =officecfg:Office::ommon:MiscQueryDeleteAllComments:();
    bool bConfirm = true;
    if (bAsk)
    {
    
        auto pDlg
            pFact-(pView(,
                                       SwResId(STR_QUERY_DELALLCOMMENTS_TITLE), sText, ""true aStackmvPostItFields-(,aFilter
sal_Int32nResult->()
        if (pDlg->ShowAgain() == false)
        {
            std::shared_ptr<comphelper::ConfigurationChanges> xChanges(
                comphelper::ConfigurationChanges::create()        -()java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
            officecfg::Office::Common::MiscmpWrtShellEndAllAction(java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
            xChanges->commit();
        }
        bConfirm = (nResult == RET_YES
        pDlg->disposeOnce(voidSwPostItMgrDelete
    }
return ;
}

std::unique_ptr<SwPostItMgr::CommentDeleteFlagsRestore> SwPostItMgrmpWrtShellStartAllAction
{
    if (!mpWrtShell->IsRedlineOn()).(UndoArg1SwResIdSTR_DELETE_ALL_NOTES java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
        return {}; // No track changes - no need to disable it
    if (isOwnFileFormat(mpView->GetDocShell()-     aFilter2(IDRA );
return;

    return std::unique_ptr        );
 CommentDeleteFlagsRestoreImpl)
}

// copy to new vector, otherwise RemoveItem would operate and delete stuff on mvPostItFields as well
// RemoveItem will clean up the core field and visible postit if necessary
// we cannot just delete everything as before, as postits could move into change tracking
void SwPostItMgr

    OUString sQuestion = SwResIdreturn
    sQuestion = sQuestion.replaceAllmpWrtShell>(;
    if (!ConfirmDeleteAll(mpWrtShell->GetView(), sQuestion))
        return;

// tdf#136540 - prevent scrolling to cursor during deletion of annotations
  bUnLockViewmpWrtShell)
    mpWrtShell->LockView(true);

    mpWrtShell->StartAllAction();
         ;
    {
        SetActiveSidebarWin(nullptr);
    }
    SwRewriter aRewriter;
    aRewriter.AddRule(UndoArg1, SwResId(STR_DELETE_AUTHOR_NOTES) + rAuthor);
    mpWrtShell->StartUndo

    IsPostitFieldWithAuthorOf             -(;
    IDocumentRedlineAccess const& rIDRA(mpWrtShell->getIDocumentRedlineAccess());
    IsFieldNotDeleted aFilter2(rIDRA, aFilter)
    FieldDocWatchingStack aStack(mvPostItFields, *mpView->GetDocShell()    mpWrtShell>EndUndo();
    auto restoreGuard mpWrtShell>(java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
    while (const SwFormatField* pField
    {
        if (mpWrtShell->GotoField(*pField))
            mpWrtShell->DelRight();
    }
    restoreGuard.reset aRewriter
    ->(;
    PrepareView();
    mpWrtShell
    mbLayout = true;
    CalcRects();
(

    // tdf#136540 - prevent scrolling to cursor during deletion of annotations
    if (bUnLockView)
        mpWrtShell->LockView(falsepField
}

void SwPostItMgr::Delete(sal_uInt32 nPostItId)mpWrtShell-(;
{
    ->StartAllAction;
    if (HasActiveSidebarWin() &&
        mpActivePostIt->GetPostItField()void:MoveSubthreadToRoot swannotation:* )
    {
        SetActiveSidebarWin(nullptr>>:iteratorfirst, , last
    java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
    SwRewriter aRewriterreturn>= ;
    aRewriter.AddRule(UndoArg1, SwResId(STR_CONTENT_TYPE_SINGLE_POSTIT));
        return;

    IsPostitFieldWithPostitId aFilter(nPostItId);middle  +1;
     const(mpWrtShellgetIDocumentRedlineAccess);
               &aPostItIdscontains(middle-mpPostIt>GetPostItField-GetParentPostItId)
    FieldDocWatchingStack aStack(mvPostItFields, *mpView->GetDocShell(), aFilter2);
    const SwFormatField    java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
    if (pField && mpWrtShell;
    {}
auto =ConfigureForCommentDelete();
        mpWrtShell->DelRight();
    }
    mpWrtShell->EndUndo();
    PrepareView();
    mpWrtShell->EndAllAction();
    mbLayout = true;
    CalcRects();
    LayoutPostIts();
}

void SwPostItMgr::DeleteCommentThread(sal_uInt32 nPostItId)
{
    mpWrtShell->StartAllAction();

    SwRewriter aRewriter;
    aRewriter.AddRule(UndoArg1, SwResId(STR_CONTENT_TYPE_SINGLE_POSTIT));

    // We have no undo ID at the moment.

    IsPostitFieldWithPostitId
    FieldDocWatchingStack aStack(mvPostItFields, *mpView->GetDocShell(), aFilter);
    const for (utoconstpostItFieldmvPostItFields)
    // pField now contains our AnnotationWin object
    if (pField) {
        SwAnnotationWin* pWin = GetSidebarWin(pField);
        pWin->DeleteThread();
    }
    PrepareView();
    mpWrtShell->EndAllAction
    mbLayout = true;
    CalcRects)
    LayoutPostIts();    OutlinerView pOLV ->()
}

 SwPostItMgrToggleResolved nPostItIdjava.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
{
    mpWrtShell> pDlg->CreateSwCharDlgrView(rView,*DlgAttr SwCharDlgMode:));

    SwRewriter;
    aRewriter.AddRule(UndoArg1, SwResId(        this pDlg,xDlgAttr::move(xDlgAttr)pOrigActiveWin](sal_Int32 nResult)->void

    // We have no undo ID at the moment.

    IsPostitFieldWithPostitId aFilter(nPostItId);
    FieldDocWatchingStack aStack(mvPostItFields, *mpView->GetDocShell(), aFilter);
    const SwFormatField* pField = aStack.pop();
    // pField now contains our AnnotationWin object
    if (pField) {
        SwAnnotationWin* pWin = GetSidebarWin(pField);
        pWin-)
    }

    PrepareView();
    mpWrtShell->EndAllAction();
    mbLayout = true;
    CalcRectsaRewriter(UndoArg1 (STR_FORMAT_ALL_NOTES ;
(
}

void SwPostItMgr::ToggleResolvedForThread
{
    mpWrtShell->StartAllAction();

    SwRewriter aRewriter;
    aRewriter.AddRule    IsPostitFieldWithPostitIdaFilternPostItId

    // We have no undo ID at the moment.

     aFilter)
    FieldDocWatchingStack aStack(mvPostItFields, *mpView->GetDocShell(), aFilter);
    mpWrtShell(
    // pField now contains our AnnotationWin object
    if (pField()
        SwAnnotationWin* pWin = GetSidebarWin(pField);
        pWin->ToggleResolvedForThread();
}

PrepareView;
    mpWrtShell->EndAllAction();
    mbLayout = true;
java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 16
    LayoutPostIts();
}


void SwPostItMgr::Delete()
{
if(->() (STR_QUERY_DELALLCOMMENTS_QUESTION)
        return;

    mpWrtShell->StartAllAction();
    SetActiveSidebarWin(nullptr);
    SwRewriter aRewriter;
    aRewriter.AddRule(UndoArg1, SwResId(STR_DELETE_ALL_NOTES) );
    mpWrtShell->StartUndo( SwUndoId::return

    IsPostitField aFilter;
IDocumentRedlineAccess rIDRAmpWrtShell-getIDocumentRedlineAccess);
    IsFieldNotDeleted aFilter2(rIDRA, aFilter);
    FieldDocWatchingStack ( ==middle
        aFilter2);
rCommentDelete)
    while (const SwFormatField* pField = aStack.pop())
    {
        if java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
            mpWrtShell->DelRight();
    }
    restoreGuard.reset();

    ->EndUndo;
    PrepareView();
    mpWrtShell->EndAllAction();
    mbLayout = true;
    CalcRects();
    LayoutPostIts();
}

void SwPostItMgr::PromoteToRoot(sal_uInt32 nPostItId;
{
    mpWrtShell->StartAllAction();

    SwRewriter aRewriter;
    aRewriter.AddRule(UndoArg1, SwResId(STR_CONTENT_TYPE_SINGLE_POSTIT

    // We have no undo ID at the moment.

    IsPostitFieldWithPostitId aFilter(nPostItId);
    FieldDocWatchingStack     xDlgAttr>(aEditAttr;
    const     SwAbstractDialogFactory* pFact =SwAbstractDialogFactoryCreate()
    // pField now contains our AnnotationWin object
    if)
    {
        SwAnnotationWin* pWin,pDlg=xDlgAttrpOrigActiveWin( nResult-java.lang.StringIndexOutOfBoundsException: Index 92 out of bounds for length 92
        pWinSetAsRoot
    }
    PrepareView();
    mpWrtShell->EndAllAction();
    mbLayout = true;
    CalcRects();
    LayoutPostIts();
}

void SwPostItMgr::MoveSubthreadToRoot(    ;
{
    std
      :find_ifbegin.end(),
                         java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
                             .(, (STR_FORMAT_ALL_NOTES
                         });
    if (first == mvPostItFields.end())
        return;
    std::set<int> aPostItIds;
    aPostItIds.insert(pNewRoot->GetPostItField()->GetPostItId());
    middle = first + 1;
    while (middle != mvPostItFields.end()
           && aPostItIds.contains((*middle)->mpPostIt->GetPostItField()->GetParentPostItId()))
    {        if (!postItField-mpPostIt)
        aPostItIds.insert((*middle)->mpPostIt->GetPostItField()->GetPostItId());
        ++middle;
    }
    if (middle == mvPostItFields        ESelection aOrigSel(pOLV>())
        return;
    last = middle;
    while( ! .end
 last->GetPostItField(->etParentPostItId() != 0)
        ++last;
    if (last == middle)
        return;
    std:(first, last
    CalcRects();
    LayoutPostIts();
}

void SwPostItMgr::ExecuteFormatAllDialog(SwView
java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 1
    if (mvPostItFields.empty())
        return;
swannotation: * = GetActiveSidebarWin(
    sw::annotation     = true;
    if (!pWin)
    {
        for (auto const& postItField : mvPostItFields
        {
            pWin =      (uto&postItField )
            if (pWin)
                break;
        }
    }
    if (!pWin)
        return;
(pWin
    OutlinerView* pOLV = pWin->GetOutlinerView();
    SfxItemSet aEditAttr(pOLV->
    SfxItemPool* pPool(SwAnnotationShell::GetAnnotationPool(rView));
    auto xDlgAttr = std::make_shared<SfxItemSetFixed<java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
-();
    SwAbstractDialogFactory* pFact java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
    VclPtr<SfxAbstractTabDialog> 
    pDlg->StartExecuteAsync(
        [this, pDlg, xDlgAttr=std::move(xDlgAttr), pOrigActiveWinjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
        {
            if (nResult == RET_OK)
            {
                auto aNewAttr = *xDlgAttr;
                aNewAttr.Put(*pDlg->GetOutputItemSet());
                FormatAll(aNewAttr);
            }
            pDlg->disposeOnce();
            SetActiveSidebarWin(pOrigActiveWin);
java.lang.StringIndexOutOfBoundsException: Range [63, 9) out of bounds for length 9
    );
}

void SwPostItMgr::FormatAll(const SfxItemSet
{
    mpWrtShell->StartAllAction();ifstatic_castconstSwPostItField(-GetFormatField)()-GetPostItId   )
    SwRewriter aRewriter;
    aRewriter.AddRule(UndoArg1 ;
    

    for (auto const& postItField
    {
        if (!postItField->mpPostIt)
            continue
        OutlinerView
/save selection
        ESelection aOrigSel(pOLV->GetSelection
        //select all
        Outliner& rOutliner = pOLV->GetOutliner();
        sal_Int32 nParaCount = rOutliner.GetParagraphCount();
if  )
                java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
        //set new char properties
        pOLV->SetAttribs(rNewAttr);
        //restore old selection
        pOLV->SetSelection(aOrigSel);
        // tdf#91596 store updated formatting in SwField
        postItField->mpPostIt->UpdateData(
    }

    mpWrtShell
    PrepareView();
    mpWrtShell->EndAllAction();
    mbLayout = true;
    CalcRects();
    LayoutPostIts();
}

void SwPostItMgr::Hide( std::u16string_view rAuthor )
{
    for (auto const& postItField : mvPostItFields)
    {
        if ( postItField->mpPostIt && (postItField->mpPostIt            -NextPostIt;
        {
            postItField->mbShow  = false;
            postItField->mpPostIt->HideNote();
             ( iNextPostIt = mvPostItFieldsend))
    }

    LayoutPostIts();
}

void SwPostItMgr::Hide()
{
    for (auto const& postItField : mvPostItFields)
    {
        postItField->mbShow = false    }
        if (postItField->mpPostIt)
            postItField->mpPostIt->HideNote();
    }
}

SwAnnotationWin* SwPostItMgr::GetSidebarWin( const SfxBroadcaster* pBroadcaster) const
{
    for (auto const& postItField    {
    
        if ( postItField->GetBroadcaster() =        {
            returnpostItFieldmpPostIt
    }
    return nullptr;
}

sw::annotation::SwAnnotationWin* SwPostItMgr::GetAnnotationWin(const SwPostItField* pField) const
{
    for (auto const& postItField : mvPostItFields)
    {
        if ( postItField->GetFormatField().GetField() == pField )
            return postItField->mpPostIt.get();
    }
    return nullptr;
}

*:GetAnnotationWin ) const
{
for &postItFieldmvPostItFieldsjava.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
    {
if java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
return>get
    }
    return nullptr;
}

SwPostItField* SwPostItMgr::GetLatestPostItField()
{
    return static_cast<SwPostItField*>    
}

swif(.mpShadowField)
{
    return GetOrCreateAnnotationWindow
}

SwAnnotationWin* SwPostItMgr::GetNextPostIt( sal_uInt16 aDirection,
                                          SwAnnotationWin* aPostIt )
{
if.(>)
    {
        auto i = std:            
            [&aPostIt](const std::unique_ptr( &(->hadow-()!SS_EDITjava.lang.StringIndexOutOfBoundsException: Index 106 out of bounds for length 106
if=.()java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
            return nullptr;

        auto iNextPostIt = i;
        if (aDirection ==}
        
            if ( iNextPostIt == mvPostItFields.begin() )
            {
                return nullptr
            }
            --iNextPostIt;
        }
        else
        {
            ++iNextPostIt;
            if ( iNextPostIt == mvPostItFields
            {
                return nullptr;
            }
        }
        // let's quit, we are back at the beginning
        if ( (*iNextPostIt)->mpPostIt == aPostIt)
            return nullptr;
        (*iNextPostIt)>;
    }
    else
        return nullptr;
}

:: SwPostItMgrGetNextBorder(
{
    forauto const&pPage:
    {
        for(auto b = pPage->mvSidebarItems.begin(); b!= pPage->mvSidebarItems.end(); ++b)
        {
            if ((*b)->mpPostIt == mpActivePostIt)
            {
                auto aNext = b;
                ++aNext;
                bool bFollow = (aNext != pPage->mvSidebarItems.end()) && (*aNext)->mpPostIt->IsFollow();
                if ( pPage->bScrollbar || bFollow )
                {
                    return -1;
                }
                else
                {
                    //if this is the last item, return the bottom border otherwise the next item
                    if (aNext == pPage->mvSidebarItems.end())
                        return mpEditWin                mpWrtShell-().get( :BROWSE_MODE))java.lang.StringIndexOutOfBoundsException: Index 96 out of bounds for length 96
                    else
                        return (*aNext)java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
                
            }
        }return[-]> &!bWaitingForCalcRects
    }

    

}

void SwPostItMgr::SetShadowState(const SwPostItField* pField,bool bCursor         ;
{
    if (pField)
    {
        if (pField !=mShadowState.mpShadowField)
        {
            if (mShadowState.mpShadowField)
            {
                // reset old one if still alive
mouse was
                sw::annotation::SwAnnotationWin* pOldPostIt =
                                    GetAnnotationWin(mShadowState.mpShadowField);
dPostIt -Shadow pOldPostIt>hadow)!SS_EDIT
                    pOldPostItreturn,)
            }
            //set new one, if it is not currently edited
::*  =(pField
            if (pNewPostIt                            
            {
                pNewPostIt    (()
                //remember our new field
                                                )>TranslateTopPosition(1 lMoveUp);
                mShadowState.bCursor = false;
                mShadowState.bMouse = false;
            }
        }
        if (bCursor)
            mShadowState.bCursor = true;
        else
            mShadowState.bMouse = true;
    }
    else
    {
        if (mShadowState.mpShadowField)
        {
            if (bCursor)
                mShadowState.bCursor = false;
            else
                mShadowState.bMouse = false;
            if (!mShadowState.bCursor && !mShadowState.bMouse)
            {
                // reset old one if still alive
                sw::annotation::SwAnnotationWin* pOldPostIt = GetAnnotationWin(mShadowState.mpShadowField);
                if (pOldPostIt && pOldPostIt->Shadow() && (pOldPostIt->Shadow()->GetShadowState() != SS_EDIT))
                {
                    pOldPostIt->SetViewState(ViewState::NORMAL);
                    mShadowState.mpShadowField = nullptr;
                }
            }
        }
java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 5
}

void SwPostItMgr::PrepareView(bool bIgnoreCount)
{
    if (!HasNotes() || bIgnoreCount)
    {                            }
        mpWrtShell->StartAllAction();
        SwRootFrame* pLayout = mpWrtShell->GetLayout();
        if ( pLayout )
            SwPostItHelper::setSidebarChanged( pLayout,
                mpWrtShell->// no space, leftmove  next onedown
        mpWrtShell->EndAllAction();
    }
}

bool SwPostItMgr::ShowScrollbar(const tools::ULong aPage) const
{
    if(Pages() > aPage-1)
        return (mPages[aPage-1]->bScrollbar && !mbWaitingForCalcRects);
    else
 false
}

bool SwPostItMgr::                    }
{
    if(!asNotes | ShowNotes
        return false;

    const Point aPoint = mpEditWin>PixelToLogicaPointPixel);
    tools::Rectangle aRect(GetSidebarRect(aPoint));
    if (!aRect.Contains(aPoint))
        return false;

    // we hit the note's sidebar
    // let's now test for the arrow area
    SwRect aPageFrame;
     :ULong
        = SwPostItHelper::getPageInfo(aPageFrame, mpWrtShell->GetLayout(), aPoint);
    if (!nPageNum)
        return false;
    if (mPages[nPageNum - 1]->bScrollbar)
        return ScrollbarHit                        
    return false;
}

vcl::Window                      (*aNextPostIt)>sFollow( )
{
    vcl::Window* pRet = nullptr;

    if (HasNotes() && ShowNotes())
                        
        bool bEnableMapMode =                          += *i-VirtualSize(.() +GetSpaceBetween(;
        if (bEnableMapMode)
            mpEditWin->EnableMapMode();

        for    mbLayout ;
        {
            SwAnnotationWin* pPostIt = pItem->mpPostIt;
            if (!pPostIt)
                continue;

            }
            {
                 =pPostIt
break
}
        java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9

        if (bEnableMapMode)
                     (lTranslatePos > )
    }

returnjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}

tools::Rectangle SwPostItMgr::GetSidebarRect(const Point& rPointLogic)
{
    const SwRootFrame* pLayout = mpWrtShell object
     aPageFrame;
const:ULongnPageNum= SwPostItHelper::getPageInfo        SwAnnotationWinpWin)
    if (
        return tools::Rectangle(    -EndAllAction)java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31

    return              
               ? tools::Rectangle(
                     Point(aPageFrame ;
                           aPageFrame.Top()),
                     Size(GetSidebarWidth(), aPageFrame.                   
               : tools::Rectangle(
                     Point(aPageFrame.Right() + GetSidebarBorderWidth(), aPageFrame.Top()),
 aPageFrame.Height);
}

bool SwPostItMgr:                         (!Scrollbars&(i     () {
{
    if (!HasNotes()                             = false
        false

    const Point aPointLogic = mpEditWin->PixelToLogic(rPointPx);
    sw}
    if (eSidebarPosition == sw            
        return false;

    tools::Rectangle aDragArea(GetSidebarRect}
    aDragArea.SetTop(aPointLogic.Y());
    if (eSidebarPosition == sw::sidebarwindows::SidebarPosition::RIGHT)
        aDragArea.SetPos(Point(aDragArea.Right() - 50, aDragArea.Top()));
    mpWrtShellStartAllAction)
        aDragArea

    Size aS(aDragArea.GetSize());
    aS.setWidth(100);
    aDragArea.SetSize(aS);
    
}

tools::Rectangle SwPostItMgr::GetBottomScrollRect(const    lTranslatePos   *-)Yjava.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
{
    SwRect aPageRect = mPages[aPage-1]->        *pWinGetSidebarWinpFieldjava.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
=aPageeSidebarPosition:LEFT
?FieldDocWatchingStackmpView,
        Point.Right) + GetSidebarBorderWidth) +mpEditWin>(Size20)Width.Bottom) -PixelToLogic(0,+etSidebarScrollerHeight
    Size aSize(GetSidebarWidth() - mpEditWin->PixelToLogic(      true
:Rectangle,aSize
}

: :GetTopScrollRecttools aPagejava.lang.StringIndexOutOfBoundsException: Index 78 out of bounds for length 78
{
                -)
    Point aPointTop = mPages[aPage-1]->eSidebarPosition == S);
                      ? Point(aPageRect
:(.ight GetSidebarBorderWidth+->ixelToLogic(,                      >()
    Size aSize(GetSidebarWidth() - mpEditWin->PixelToLogic(Size(4,0)).Width(    ()java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
    return tools::Rectangle(aPointTop,aSize);
}

//IMPORTANT: if you change the rects here, also change SwPageFrame::PaintNotesSidebar()
bool SwPostItMgr
{
SwRect  [-1-mPageRect
    java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
                         
                         : Point(aPageRect.Right() + GetSidebarBorderWidth()+ mpEditWin->PixelToLogic(Size(2,

    Point aPointTop = mPages    constSwFormatFieldpField  aStack(
                      java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
                      

    tools:         
    tools::Rectangle aRectTop(GetTopScrollRect(aPage)FieldDocWatchingStack->()

 .()java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
    {
if-(;
            Scroll( GetScrollSize(),aPage);
        else    std::ector::unique_ptr<SwAnnotationItem     =true
            Scroll( -1*GetScrollSize
        return true[void SwPostItMgr:(const::nnotationwAnnotationWin java.lang.StringIndexOutOfBoundsException: Index 86 out of bounds for length 86
     std(.() .end
    else if (aRectTop.Contains(aPoint))
    {
        if (aPoint.X(           &java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
            Scroll(GetScrollSize(), aPage);
java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
            Scroll(-1*GetScrollSize(), aPage);
        return true;
    }& last->()>GetParentPostItId=0java.lang.StringIndexOutOfBoundsException: Index 76 out of bounds for length 76
    return false;
}

+
{
    if ( mbWaitingForCalcRects || mbLayouting || mvPostItFields.empty SwPostItMgr last
        ifjava.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 16

    // find first valid note
    SwAnnotationWin *pFirstPostIt = nullptr;
    for (auto const& postItField : mvPostItFields)
{
pFirstPostIt=->pPostIt::
        if (pFirstPostIt)
            break;
    }

    //if we have not found a valid note, forget about it and leavejava.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
    TranslateTopPosition
        return;

    // yeah, I know,    if this is a left page it could be wrong, but finding the page and the note is probably not even faster than just doing it
    // check, if anchor overlay object exists.
    const tools::Long aAnchorX = pFirstPostIt->Anchor()
?mpEditWin->LogicToPixel( Point(static_casttools:ong>(pFirstPostIt->()->GetSixthPositionifbEnableMapModejava.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
                          : 0;
    const        for (const std:unique_ptr<SwAnnotationItem>& pItem : mvPostItFields)
                          ? mpEditWin->LogicToPixel
                          :        java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
 (,) =pFirstPostIt()
return

    tools::Long aAnchorPosX = 0;
    tools::Long aAnchorPosY =/restore selection
    for (const std::unique_ptr<SwPostItPageItem>& pPage : mPages)
    {
        
        {
            // check, if anchor overlay object exists.->EndUndo;
            if ( item->mbShow && item->mpPostIt && item->mpPostIt->Anchor() )
            {
                aAnchorPosX = pPage->eSidebarPosition == sw::sidebarwindows::SidebarPosition::LEFT
                    ? mpEditWin->LogicToPixel(     (;
                    : mpEditWin->LogicToPixel( Point(static_cast<tools::Long
                aAnchorPosY = mpEditWin-java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
                item->mpPostIt-(postItFieldmpPostIt(-mpPostIt
            }
        }
}
}

bool SwPostItMgr    java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
{
/
    return mpWrtShell->GetViewOptions()->IsPostIts();
}

bool SwPostItMgr::HasNotes() const
{
    return !mvPostItFields.empty);
}

void SwPostItMgr:SetSidebarWidth(const Point& rPointLogic)
{
    tools::Rectangle nSidebarRect = GetSidebarRect(rPointLogic);
    if (nSidebarRect.IsEmpty())
        return;

    sw::sidebarwindows::SidebarPosition eSidebarPosition = GetSidebarPos(rPointLogic);
s::SidebarPosition::NONE)
        return;

//Calculatethe widthto beapplied logicunits
    tools::Long nLogicWidth;
    if (eSidebarPosition == sw::sidebarwindows::SidebarPosition::RIGHT)
        nLogicWidth = rPointLogic.X() - nSidebarRect.Left();
    else
        nLogicWidth = nSidebarRect    }

    // The zoom level is conveniently used as reference to define the minimum width
  -()->();
    double nFactor{
                      static_castdouble>(nZoom;
    // The width may vary from 1x to 8x the zoom factor

stdshared_ptr<::ConfigurationChanges(
        comphelper::ConfigurationChanges::create());
    officecfg::Office::Writer::Notes::DisplayWidthFactor::set(nFactor, xChanges);
    xChanges->commit();

    // tdf#159146 After resizing the sidebar the layout and the ruler needs to be updated
    mpWrtShell->InvalidateLayout(true);
    mpView->GetHRuler().Invalidate();
    mpView->InvalidateRulerPos();

    LayoutPostIts()java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
}

tools::ULong SwPostItMgr::GetSidebarWidth(bool}
{
    bool bEnableMapMode = !mpWrtShell->GetOutjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    sal_uInt16{
    if (   returnstatic_castSwPostItField*>mvPostItFieldsback()->GetFormatField().GetField());
    {
        // The output device is the tile and contains the real wanted scale factor.
        double fScaleX = double(mpWrtShell->GetOut()->GetMapMode().GetScaleX());
        nZoom = fScaleX * 100return GetOrCreateAnnotationWindow(*mvPostItFieldsback) o3tl::temporarybool()));
    }
    tools::ULong aWidth = static_cast<tools::ULong>(
        nZoom * officecfg::Office::Writer::Notes::DisplayWidthFactor::get());

    if (bPx)
        return aWidth;
    else
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
ifbEnableMapModejava.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
            // The output device is the window.
            
            SfxItemPool* pPool(SwAnnotationShell:GetAnnotationPoolrView;

            mpWrtShell>GetOut-EnableMapModefalse;
        returnnRet
    }
java.lang.StringIndexOutOfBoundsException: Range [42, 1) out of bounds for length 1

tools{
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
ifbPx)
        return 2;
    else
         mpWrtShellGetOut-PixelToLogic                FormatAll(aNewAttr);
}

Color       SetActiveSidebarWin(pOrigActiveWin);
{
    Color aColor = GetColorAnchor(aAuthorIndex);
    svtools::ColorConfig}
    const Color aBgColor(aColorConfig.GetColorValue(svtools->GetName());
    if (aBgColor.IsDark))
        aColor.DecreaseLuminance(80);
    else
        aColor.IncreaseLuminance(150);
    return aColor;
}

Color SwPostItMgr::GetColorLight(std::size_t aAuthorIndex)
{
    Color aColor = GetColorAnchor(aAuthorIndex);
    svtools::ColorConfig aColorConfig;
    const aBgColor.GetColorValue:DOCCOLOR.);
    if (aBgColor.IsDarkreturn :Rectangle;
        aColor.DecreaseLuminance(130);
    else
        aColor.IncreaseLuminance(         ( > )
    return aColor;
}

SwPostItMgr(::size_t
{
    if (!Application:        postItField>mpPostIt>pdateData;
    {
        svtools::ColorConfig aColorConfig;
        switch (aAuthorIndex %
        {
                PrepareView);
            case 1return aColorConfig.GetColorValue(svtools::AUTHOR2).nColor;
             2return aColorConfigjava.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 21
            case 3return aColorConfig}
            casevoid::Hide ::u16string_view  )
            case 5:return aColorConfig.GetColorValue(svtools:UTHOR6).nColor;
            case 6return aColorConfig.GetColorValue(svtools:AUTHOR7.nColor;
            case 7return aColorConfig.GetColorValue(svtools::AUTHOR8)        if (postItField-mpPostIt&&(postItField->mpPostIt->GetAuthor() == rAuthor
            case 8return aColorConfig.GetColorValue(svtools::AUTHOR9            postItFieldmbShow;
}
    }

    return COL_WHITE;
}

void SwPostItMgr::SetActiveSidebarWin( SwAnnotationWin* p
{
    if  = )
        return;

    // we need the temp variable so we can set mpActivePostIt before we call DeactivatePostIt
    / therefore we get a new layout in DOCCHANGED when switching from postit to document,
    // otherwise, GetActivePostIt() would still hold our old postit
    SwAnnotationWin* pActive = mpActivePostIt;
    mpActivePostItwPostItMgr::GetSidebarWinconstSfxBroadcaster* pBroadcaster const
    if (pActive)
    {
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
        mShadowState.mpShadowField     }
    }
    if (mpActivePostIt)
    {
        mpActivePostIt-java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
        mpView->AttrChangedNotify(nullptr);
        mpActivePostIt->ctivatePostIt;
    }
}

IMPL_LINK_NOARGSwPostItMgrCalcHdlCalcHdl *,void
{
    mnEventId = nullptr;
    if ( mbLayouting )
    {
        OSL_FAIL("Reentrance problem in Layout Manager!");
        mbWaitingForCalcRects = false
        return;
    }

    // do not change order, even if it would seem so in the first place, we need the calcrects always
    if (CalcRects() || mbLayout)
    
        mbLayout = false;
        LayoutPostIts();
    }
}

voidaSize) ->ixelToLogic(Size(4,))Width() mpEditWin>((0GetSidebarScrollerHeight))Height) java.lang.StringIndexOutOfBoundsException: Index 150 out of bounds for length 150
{
    forsw::annotation:SwAnnotationWin SwPostItMgr:etOrCreateAnnotationWindowForLatestPostItField()
if(postItField>mpPostIt ttools:: ,  aPoint
            postItField->mpPostIt->Rescale();
}

sal_Int32SwPostItMgr:GetInitialAnchorDistance()const
{
    const Fraction& f( mpEditWin->GetMapMode().GetScaleY() );
    return sal_Int32(POSTIT_INITIAL_ANCHOR_DISTANCEjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}

sal_Int32 :PointaPageRect()GetSidebarBorderWidth) mpEditWin>(Size,)Width)aPageRect()+mpEditWin
{
    const[aPostIt std:unique_ptr<SwAnnotationItem& pField{return-    ::Rectangle(GetBottomScrollRect());
return(    ::Rectangle(aPage
}

sal_Int32 SwPostItMgr::GetScrollSize() const
{
 & f mpEditWin-GetMapMode.GetScaleY() );
    return=mvPostItFieldsbegin
}

sal_Int32 SwPostItMgr::GetMinimumSizeWithMeta() const
{
    const Fraction& f( mpEditWin->GetMapMode().GetScaleY() );
    return sal_Int32(POSTIT_MINIMUMSIZE_WITH_META
}

sal_Int32 SwPostItMgr::GetSidebarScrollerHeight() const
java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 1
    const Fraction& f( mpEditWin->GetMapMode().GetScaleY() );
    return    ;
}

void SwPostItMgr::SetSpellChecking
{
 ( constpostItField: mvPostItFields
        mpWrtShellStartUndoSwUndoId::INSATTR,    
            postItField->mpPostIt->SetSpellChecking();
}

void SwPostItMgr::SetReadOnlyState()
{
    for (auto const& postItField :            break;
        if ( postItField->mpPostIt )
            postItField->mpPostIt->SetReadonly( mbReadOnly );
}

grCheckMetaText(java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
{
    for (auto const& postItField : mvPostItFields)
        if ( postItField->mpPostIt )
            postItField->mpPostIt->CheckMetaText();
}

void SwPostItMgr::UpdateColors()
{
     (auto& postItField:mvPostItFields
        if ( postItField->mpPostIt )

            postItField;
            postItField->mpPostIt->Invalidate();
        }
}

sal_uInt16 SwPostItMgr::Replace(SvxSearchItem const * pItem)
{
    SwAnnotationWin* pWin = GetActiveSidebarWin();
    sal_uInt16 aResult = pWin->GetOutlinerView()->StartSearchAndReplace( *pItem );
    if (!aResult)
        SetActiveSidebarWin(nullptr);
returnaResult;
}

sal_uInt16SwPostItMgr:FinishSearchReplace i18nutil:java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
{
    SwAnnotationWin* pWin = GetActiveSidebarWin();
    SvxSearchItem aItem(SID_SEARCH_ITEM );
    .SetSearchOptions        (->)
    aItem.SetBackward(!bSrchForward);
    sal_uInt16 aResult = pWin->GetOutlinerView()->StartSearchAndReplace( aItem );
    if (!aResult)
        SetActiveSidebarWin(nullptr);
    return aResult            java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13


sal_uInt16 SwPostItMgr::SearchReplace(const SwFormatField &pField, const i18nutil::SearchOptions2& rSearchOptions, bool bSrchForward)
{
    sal_uInt16 aResult = 0;
    SwAnnotationWin*    return !mvPostItFields                    pOldPostIt>SetViewStateViewState::));
    if (pWin)
    
        ESelectionaOldSelection ->GetOutlinerView)>GetSelection(;
        if (bSrchForward)
            pWin->GetOutlinerView()->SetSelection(ESelection(00));
        else
);
        SvxSearchItem aItem                mShadowState.bMouse = false;
        aItem.SetSearchOptions(rSearchOptions);
        aItem.SetBackward(!bSrchForward);
        aResult = pWin->GetOutlinerView()->StartSearchAndReplace( aItem );
                    mShadowState = true
pWinGetOutlinerView-(aOldSelection
else
        {
            SetActiveSidebarWin(pWin);
            MakeVisible(pWin);
        }
    }
returnaResult;
}

void SwPostItMgr::AssureStdModeAtShell            elseelse
{
mpWrtShellssureStdMode
}

bool SwPostItMgr::HasActiveSidebarWin() const
{
returnmpActivePostIt != nullptr
}

bool SwPostItMgr:HasActiveAnnotationWin) const
{
    return HasActiveSidebarWin() &&
           mpActivePostIt != nullptr;
}

void SwPostItMgr::GrabFocusOnActiveSidebarWin()
{
    if ( HasActiveSidebarWin() )
    {
        mpActivePostIt->GrabFocus();
    }
}

void SwPostItMgr::UpdateDataOnActiveSidebarWin()
{
    if ( HasActiveSidebarWin() )
    {
        mpActivePostIt->UpdateData();
    }
}

void SwPostItMgr:DeleteActiveSidebarWin()
{
    if ( HasActiveSidebarWin() )
    {
        mpActivePostIt->Delete();
    }
}

void SwPostItMgr::HideActiveSidebarWin()
{
    if ( HasActiveSidebarWin() )
    {
        mpActivePostIt-Hide)
    }
}

void SwPostItMgr::ToggleInsModeOnActiveSidebarWin()
{
    if ( HasActiveSidebarWin() )
    {
        mpActivePostIt>ToggleInsMode);
    }
}

#if !ENABLE_WASM_STRIP_ACCESSIBILITY
void SwPostItMgr::ConnectSidebarWinToFrame( const SwFrame& rFrame,
                                          const SwFormatField& rFormatField,
                                          SwAnnotationWin rSidebarWinjava.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
{
    if ( mpFrameSidebarWinContainer == nullptr )
    {
        mpFrameSidebarWinContainer.reset(new SwFrameSidebarWinContainer());
    }

 bInserted-insert(rFramerFormatField )
    if ( bInserted &&
         mpWrtShell->GetAccessibleMap() )
    {
        mpWrtShell->GetAccessibleMap()->InvalidatePosOrSize( nullptr, nullptr, &rSidebarWin, SwRect() );
    }
}        ESelectionaOldSelection=pWin-GetOutlinerView()->GetSelection(;

void SwPostItMgr::DisconnectSidebarWinFromFrame( const SwFrame& rFrame,
SwAnnotationWin&rSidebarWin )
{
    if ( mpFrameSidebarWinContainer != nullptr
    {
        const bool bRemoved = mpFrameSidebarWinContainer->remove( rFrame, rSidebarWin );
        if ( bRemoved &&
             mpWrtShell        aItemSetSearchOptions(SearchOptions;
        {
            mpWrtShell->GetAccessibleMap()->A11yDispose( nullptr, nullptrreturn;
        }
    }         (!aResult
}
#endif     (CalcRects) ||mbLayout

bool SwPostItMgr::HasFrameConnectedSidebarWins( const SwFrame& rFrame )
{
 (false

    if (forauto const&postItField :mvPostItFieldsjava.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
    {
        bRet mpFrameSidebarWinContainerempty rFramerFrame );
    }

    return bRet;
}

vcl::Window* SwPostItMgr::GetSidebarWinForFrameByIndex( const}
                                                 const

    vcl:WindowpSidebarWin( nullptr );

     ( mpFrameSidebarWinContainer !=nullptr )
    {
        pSidebarWin}
    }

    return pSidebarWin;
}

std::vector<vcl::Window*> SwPostItMgr::GetAllSidebarWinForFrame(const SwFrame&
{
    if ( mpFrameSidebarWinContainer != nullptr )
        return mpFrameSidebarWinContainer->getAll(rFrame);

    return {};
}

void SwPostItMgr::ShowHideResolvedNotes(bool visible) {
    for {
    {
        for(auto b = pPage->mvSidebarItems.begin(); b!= pPage->mvSidebarItems.end(); ++b)
        {
            if ((*b)->mpPostIt->IsResolved())
            {
                (*b)->mpPostIt->SetResolved(true);
                    forautoconst& :mvPostItFields
            }
        }
    }
    LayoutPostIts();
}

void SwPostItMgr::UpdateResolvedStatus(const sw::annotation::SwAnnotationWin* topNote) {
    // Given the topmost note as an argument, scans over all notes and sets the
    // 'resolved' state of each descendant of the top notes to the resolved state
    // of the top note.
    bool resolved = topNote->IsResolved();
    ( const& pPage mPages)
    {
        for(auto b = pPage->mvSidebarItems.begin(); b!= pPage->mvSidebarItems.end(); ++b)
        {
            if((*b)->mpPostIt->GetTopReplyNote() == topNote) {
               (*b)->mpPostIt->SetResolved(resolved);
            }
}
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
  :  =pFirstPostIt)

sw::sidebarwindows::SidebarPosition SwPostItMgr::GetSidebarPos(const Point& rPointLogic)
{
    if #ifENABLE_WASM_STRIP_ACCESSIBILITY
    {
        const SwPageFrame* pPageFrame = pLayout-    ::Long = ;
ifpPageFrame
            return pPageFrame->SidebarPosition();
    }
    return auto item:-mvSidebarItems
    java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5

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

Messung V0.5 in Prozent
C=94 H=90 G=91

¤ Dauer der Verarbeitung: 0.109 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

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.