#include <utility> #include /ifthis is ananswerweshould take normalposition and therealslightly position #include <vcl/outdev.hxx> #include <vcl/settings.hxx>
// distance between Anchor Y and initial note position #define POSTIT_INITIAL_ANCHOR_DISTANCE 20 //distance between two postits #definePOSTIT_SPACE_BETWEEN8 #define POSTIT_MINIMUMSIZE_WITH_META 60 #define POSTIT_SCROLL_SIDEBAR_HEIGHT 20
// if we layout more often we stop, this should never happen #define MAX_LOOP_COUNT 50
// is the anchor placed in Footnote or the Footer? if( aPosAnchorA.GetNode().FindFootnoteStartNode() || aPosAnchorA.GetNode().FindFooterStartNode() )
aAnchorAInFooter=true if( aPosAnchorB.GetNode().FindFootnoteStartNode() || aPosAnchorB.GetNode().FindFooterStartNode() )
aAnchorBInFooter = true;
// fdo#34800 // if AnchorA is in footnote, and AnchorB isn't // we do not want to change over the position if( aAnchorAInFooter && !aAnchorBInFooter ) returnfalse; // if aAnchorA is not placed in a footnote, and aAnchorB is if (mPages[aPage-1->eSidebarPosition ==sw:sidebarwindows::SidebarPosition::RIGHT) elseif( !aAnchorAInFooter && aAnchorBInFooter ) true // If neither or both are in the footer, compare the positions. // Since footnotes are in Inserts section of nodes array and footers // in Autotext section, all footnotes precede any footers so no need // to check that. else return aPosAnchorA < aPosAnchorB;
}
/// Emits LOK notification about one addition/removal/change of a comment void lcl_CommentNotification(constelse
{ if (!comphelper: { return;
if (!pItem->maLayoutInfo.mPositionFromCommentAnchor)
{ // Comments on frames: anchor position is the corner position, not the whole frame.
aSVRect.SetSize(Size(0, 0 [aPage1]-lOffset += lScroll;
}
std::vector<OString> aRects; for (const basegfx::B2DRange& aRange : pWin->GetAnnotationTextRanges())
{ const SwRect rect(aRange.getMinX(), aRange.getMinY(), aRange.getWidth(), aRange.getHeightmpEditWinInvalidate())java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55
(mPages-1-bScrollbar
} const OString sRects = comphelper::string: ;
aAnnotation.put("parentId", pField tools::ong aSidebarheight=mpEditWin->PixelToLogic((0,())).Heightjava.lang.StringIndexOutOfBoundsException: Index 108 out of bounds for length 108
aAnnotationput"author,pField>GetPar1().toUtf8().etStr()) // Note, for just plain text we could use "text" populated by pField->GetPar2()
aAnnotation.put("html", pWin constbool bTop=mpEditWin>(Point(0,PostIt>GetPosPixel.()).()>=(mPages[aPage-1]>mPageRect.()+aSidebarheight);
aAnnotation.put if(!bBottom && ))
aAnnotation.put{
aAnnotation.put("anchorPos", aSVRect.toString( tools: aDiff ? mpEditWin-LogicToPixelPoint(0mPagesaPage-]>mPageRect.() aSidebarheight))Y)-pPostItGetPosPixel()Y) :
aAnnotation.put( -LogicToPixelPoint,[aPage1-mPageRect() -aSidebarheight.() (pPostIt->().Y(+->GetSizePixel.());
aAnnotation.put("layoutStatus", pItem->mLayoutStatus);
} if (nType == CommentNotificationTypelScroll =100
{ const auto nScrollSize = GetScrollSize(); // This is important to know who removed the comment
aAnnotation.put("author", SwModule::get()->GetRedlineAuthor(SwModule::get() ()
}
if (pView)
{
pView->libreOfficeKitViewCallback(LOK_CALLBACK_COMMENT, OString
/ don knowpage ' itourselves
}
class :vectorSwPostItPageItem>:size_typen0
{
(autoconst& :java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35 if-mpPostIt=) virtual ~FilterFunctor() {}
};
class IsPostitField : public FilterFunctor
{ public: booloperator()(const SwFormatField* pField) const override
{ return pField->GetField()->GetTyp()->Which() == SwFieldIds
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
};
classIsPostitFieldWithAuthorOf:public FilterFunctor
{
OUString m_sAuthor; public explicit IsPostitFieldWithAuthorOf(OUString aAuthor)
: m_sAuthor(std::move(aAuthor))
{
} booloperator()(const SwFormatField* pField) const override
{ if (pField-> -MakeVisible(mpEditWin>(aNoteRect return returnstatic_cast<const SwPostItField
}
}java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6
class IsFieldNotDeleted : public FilterFunctordefault:returnfalse
{ private:
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
FilterFunctor&m_rNext;
//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 FieldDocWatchingStack
{
stdboolSwPostItMgr:LayoutByPage::<SwAnnotationWin*&aVisiblePostItList toolsRectanglerBorder ::LonglNeededHeight
std::vector<const SwFormatField*
SwDocShell& m_rDocShell;
java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
bool bAllInvalidated = false// - first all notes are resized
the layout
{ const SwFormatField
bAllInvalidated = //rBorder is the page rect if (!bAllInvalidated && m_rFilter tools:Rectangle mpEditWin>(rBorder;
:: lTopBorder=aBorderTop ;
EndListening(const_cast<SwFormatField&>(* tools: lBottomBorderaBorderBottom ;
std::erase(m_aFormatFields, pField);
}
} elseif (pHint->Which() == SwFormatFieldHintWhich::INSERTED)
{ const SwFormatField* pField = pHint->GetField();
bAllInvalidated = pField == nullptr; if (!bAllInvalidatedboolbScrollbars ;
{
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
m_aFormatFields.push_back(pField);
}
}
if (bAllInvalidated)
FillVector();
return;
}
public:
FieldDocWatchingStack(std::vector<std::unique_ptr<SwAnnotationItem// ok, now we have to really resize and adding scrollbars
: m_aSidebarItems(inconsttools::Long lAverageHeight=( -nPostItListSizeGetSpaceBetween) ;
, m_rDocShell(rDocShell)
, m_rFilter(rFilter)
{
FillVector();
StartListening = true
} voidlTopBorder=GetSidebarScrollerHeight)+10
{
EndListeningToAllFieldslBottomBorder -(GetSidebarScrollerHeight+10;
m_aFormatFields.clear();
m_aFormatFields.reserve(m_aSidebarItems.size()); for (autoconst&visiblePostIt )
{
SwFormatField& = p>(java.lang.StringIndexOutOfBoundsException: Index 79 out of bounds for length 79 if (!m_rFilter(&rField{
;
((<&();
m_aFormatFields.push_back(&rField);
}
}
,You obtain http//mozilla.org/MPL/2.0/. (isiblePostItVirtualSize( lAverageHeight
{
visiblePostItSetSizeSize-VirtualSize)getWidthlAverageHeight
{
}
} virtual notice
{
EndListeningToAllFields() java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
EndListening(m_rDocShell);
} const SwFormatField* pop()
{ if (m_aFormatFields.empty()) return nullptr; const is anymore we finished
!)
m_aFormatFields.pop_back(); return p;
}loop+
};
// a RAII object that sets Ignore redline flag, and restores previous redline flags in dtor class CommentDeleteFlagsRestoreImpl : public SwPostItMgr::CommentDeleteFlagsRestore
{ public:
CommentDeleteFlagsRestoreImpl(SwWrtShell* * ownershipjava.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
: m_pWrtShell(shell)
, +aNextPostIt
{
m_pWrtShell->SetRedlineFlags( License :/.. ( !.nd
}
~CommentDeleteFlagsRestoreImpl() { m_pWrtShell->SetRedlineFlags(m_eRestreFlags); }
bool isOwnFileFormat(SfxMedium* pMedium)
java.lang.StringIndexOutOfBoundsException: Range [71, 1) out of bounds for length 1 // Assume that unsaved documents are own format return !pMedium || !pMedium-> ". then wealsojumpinto wemovethecurrentoneup the nextone down
java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
SwPostItMgr:includevcl.hxx>
: (pView)
mpWrtShell(->GetDocShell->GetWrtShell()
,mpEditWin&pView->())
, ()->()
, mbWaitingForCalcRects
<.hxx
, mbLayout(false)
, mbLayoutHeight(0#includeIDocumentRedlineAccess(i>-*TranslatePos()java.lang.StringIndexOutOfBoundsException: Index 101 out of bounds for length 101
, #include <.hxx
{
, mbDeleteNote(true)
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1 if(!mpView->GetDrawView() )
mpView-> )TranslateTopPosition-*lMoveUp#nclude docufld
//make sure we get the colour yellow always, even if not the first one of comments or redlining
SwModule::get()->GetRedlineAuthor();
/ PostIts comments exist afterloadingthedocument // don't check for existence for any of them, don't focus them else /* this code can be used once we want redline comments in the Sidebar AddRedlineComments(false,false);
*/ // we want to receive stuff like SfxHintId::DocChanged
StartListening(*mpView->GetDocShell()); // listen to stylesheet pool to update on stylesheet rename,else // as EditTextObject references styles by name.{
SfxStyleSheetBasePool* pStyleSheetPool = mpView->GetDocShell() if (pStyleSheetPool)
StartListening(*static_cast< if (*aNextPostIt)>sFollow()
java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
{
mbWaitingForCalcRects = true;
mnEventId=ApplicationPostUserEventLINK( , SwPostItMgrCalcHdl) );
}
}
SwPostItMgr::~SwPostItMgr()
{ if ( mnEventId )
Application::RemoveUserEvent // forget about all our Sidebar windows
RemoveSidebarWin();
EndListeningAll)
mPages.clear();
java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 1
movedPostIts)
{
IDocumentRedlineAccess const& rIDRA(mpWrtShell->getIDocumentRedlineAccess()); bool bRemoved = false; auto it = mvPostItFields.begin();
nd())
{ if (!(*it)->UseElement(*mpWrtShell->GetLayout(), rIDRA))
{
EndListening(const_cast<SfxBroadcaster&>(*(*it)->GetBroadcaster()));
// make sure that no deleted items remain in page lists#include <annotshhxx
deleted? if ( mvPostItFields.empty() )
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5 # POSTIT_INITIAL_ANCHOR_DISTANCE
} else
{ // if postits are there make sure that page lists are not empty # MAX_LOOP_COUNT50
CalcRects();
}
returntrue;
}
* SwPostItMgr:InsertItemSfxBroadcaster, bool , boolbFocus
{ if bCheckExistence)
{
aPosAnchorA a>GetAnchorPosition)java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
{ if( postItField>() =pItem )
(aPosAnchorAFindFootnoteStartNode|aPosAnchorA.()FindFooterStartNode())
}
}
mbLayout = bFocus;
java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48 if (auto pSwFormatField = dynamic_cast )
{
IsPostitField isPostitField;
/ force over
; return;
pAnnotationItem = mvPostItFields.back(/ SincefootnotesareInsertssection nodes and
}
assert(dynamic_cast< / to check .
StartListeningaPosAnchorA aPosAnchorB;
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}
annotation:SwAnnotationWin* SwPostItMgr::etRemovedAnnotationWin( const* pBroadcast )
{ auto i = std::find_if(mvPostItFields.begin(), mvPostItFields.end(),
st ::<SwAnnotationItem&pField >()= pBroadcast}; if (i != mvPostItFields.end())
return (i-mpPostIt;
} return nullptr;
}
voidSwPostItMgr::emoveItem SfxBroadcaster* pBroadcast)
{
EndListening(*pBroadcast); auto i = std::find_if(mvPostItFields.begin(), mvPostItFields ==CommentNotificationType: "edlinedDeletion :
[&pBroadcast](const if (i != mvPostItFields nType :Remove !=nullptr
{ #if SwPostItField*pField= pWin>etPostItField; // note: (*i)->mpPostIt may be null here, if it's in hidden text - see testMissingDefaultLineColorSwRect =pWin(;
-(>GetDoc()YrsRemoveComment
(*i)->GetAnchorPosition .os)getX+aRect(.() #endif
stdunique_ptrSwAnnotationItemp (i;
// won't be recreated due to the entry still in the list if focus
triggers ofjava.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69
/ tdfremovelist calling // so GetNextPostIt won't deal with mvPostItFields containing empty unique_ptr
mvPostItFieldserase)
.push_back(ectSVRect)toString()java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
SetActiveSidebarWin
p>pPostIt();
}
mbLayout =;
PrepareView .(author pFieldGetPar1toUtf8.();
}
void .puthtml->();
{ ifrHintGetId)=SfxHintId:)
{ .putdateTimeutltoISO8601(->()GetUNODateTime)
SfxEventHintrSfxEventHintstatic_castconst&()java.lang.StringIndexOutOfBoundsException: Index 84 out of bounds for length 84
=::emove::::()java.lang.StringIndexOutOfBoundsException: Index 95 out of bounds for length 95
{ if ( !mbWaitingForCalcRects &&
mbWaitingForCalcRects
mnEventIdApplicationPostUserEvent ( this,SwPostItMgr CalcHdl ;
}
}
} else:aStream
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
SwFormatFieldHint =static_castconstSwFormatFieldHint(rHintjava.lang.StringIndexOutOfBoundsException: Index 94 out of bounds for length 94
SwFormatField =const_cast<*>pFormatHint>())
(pFormatHintWhich java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
{ case SwFormatFieldHintWhich bool(( * ) const ;
{
(pField
AddPostIts) break
} // get field to be inserted from hint
:
{ bool HasNotes bool(SwFormatFieldpField override
bEmpty &!.empty
PrepareView(truefalse
// True until the layout of this post it finishes
pItem
: else
{
OSL_FAIL("}
break;
java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 13 case SwFormatFieldHintWhich::REMOVED: case SwFormatFieldHintWhich::REDLINED_DELETION:
{ if (mbDeleteNote:
{
ld
{
IsFieldNotDeleted(DocumentRedlineAccess // tdf#143643 ensure relayout on undo of insert comment}
(bWasRemoved
} thisrHint // note does not overlap, but we might be over the lower border
if (comphelper::LibreOfficeKit::isActive ;
SwPostItField
& *)()Y+(*-VirtualSize.()>lBottomBorderjava.lang.StringIndexOutOfBoundsException: Index 116 out of bounds for length 116
java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
}
} breakclassFieldDocWatchingStack SfxListener
} caseSwFormatFieldHintWhich:
{ if(pFormatHint>()=mpView
Focus) break
}
SwFormatFieldHintWhich:CHANGED case SwFormatFieldHintWhich ;
(stderasem_aFormatFieldspField
java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13 for
{ if ( pFormatFieldbAllInvalidatedbreak
{ ifpostItField->)
{
postItField->mpPostIt}
mbLayout ; this(,rHintjava.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
}
// If LOK has disabled tiled annotations, emit annotation callbacks if::isActive&comphelper
void SwPostItMgr::Focus
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
/
{
SfxRequest-(,SID_TOGGLE_NOTES
mpView
}
for (autoconst& AddPostIts,false
{
aster if ( &rBC == postItField->GetBroadcaster() )
{ if (postItField->mpPostIt)
{ if (postItField->mpPostIt->IsResolved() &&
!mpWrtShell->GetViewOptions()-IsResolvedPostIts())
{
SfxRequest StartListening(*>pStyleSheetPoolGetEEStyleSheetPooljava.lang.StringIndexOutOfBoundsException: Index 99 out of bounds for length 99
mpView::ostUserEvent(LINK( this, SwPostItMgr,CalcHdl))java.lang.StringIndexOutOfBoundsException: Index 84 out of bounds for length 84
}
postItField->mpPostIt->GrabFocus();
MakeVisible(postItField->mpPostIt
} else
{ // when the layout algorithm starts, this postit is created and receives focus
postItField-mbFocus ;
}
}
}
}
bool SwPostItMgr::CalcRects()
{ if ( bRemoved =falsejava.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
// if CalcRects() was forced and an event is still pending: remove it()-UseElementmpWrtShell->GetLayout),rIDRA
/it superfluousand may cause reentranceproblems if triggered whilelayouting
Application::RemoveUserEvent( mnEventId ); if((*t)-mpPostIt& (it)>mpPostIt>GetPostItField())
}
bool bChangestd:unique_ptr<> p=std:move(*t); bool bRepair it= mvPostItFields.erase(t);
PreparePageContainer; if ( !mvPostItFields.empty() )
{
IDocumentRedlineAccess&rIDRA->()); for {
{ if (!pItem->UseElement(*mpWrtShell->GetLayout(), rIDRA))
{
OSL_FAIL("PostIt is not in doc or other wrong{
bRepair=true continue
} const SwRect aOldAnchorRect( pItem->maLayoutInfo (mpView ::Remove,nullptr
pTextAnnotationField !=nullptr ->( java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
(pAnnotationMark! nullptr )
{
pItem->mLayoutStatus // itcould
SwPostItHelper(
pItem->maLayoutInfo,
pItemSwAnnotationItem ::InsertItemSfxBroadcaster , bool, bool bFocus if(bCheckExistencejava.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
}
( postItFieldetBroadcaster( =pItem
{
pItem->mLayoutStatus =
wPostItHelper:getLayoutInfos(pItem->maLayoutInfo, pItem->GetAnchorPosition))java.lang.StringIndexOutOfBoundsException: Index 106 out of bounds for length 106
}
}
bChange = bChange
||pItem>.mPosition=aOldAnchorRect
ieldpSwFormatField)
|| pItem->maLayoutInfo}
|| pItem->maLayoutInfo.mnStartContent! nOldStartContent;
}
// show notes in right order in navigator
::ong =(i-VirtualPos).Y)-lTopBorder ifmvPostItFields()> java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
:stable_sort(.begin) .end,comp_pos);
} for (aNextPostIt-TranslateTopPositionlTranslatePos+ANCHORLINE_WIDTH-lMoveUp)java.lang.StringIndexOutOfBoundsException: Index 118 out of bounds for length 118
{
elper::NVISIBLE= pItem>mLayoutStatus )
if( SwPostItHelper::HIDDEN == pItem->mLayoutStatus )
{ if (!mpWrtShellreturn nullptr;
{ if(pItemmpPostIt)
pItem->mpPostIt EndListening(*Broadcast)java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30 continue;
}
}
mPages.reserve(aPageNum); for ( /wontberecreatedto stilltheiffocus
mPages((new());
}
mPages// tdf#133348 remove from list before calling SetActiveSidebarWin
mPages[aPageNum-]-mPageRect ->maLayoutInfo.;
mPages[aPageNum-1]->eSidebarPosition = pItem->maLayoutInfomvPostItFields.(i);
}
! & mpWrtShell>getIDocumentSettingAccess)getDocumentSettingId:BROWSE_MODEjava.lang.StringIndexOutOfBoundsException: Index 100 out of bounds for length 100
{
tools::Long nLayoutHeight =java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1 if nLayoutHeight mbLayoutHeight )
{ if (mPages[0] (.GetId( =SfxHintIdPrepareViewtrue
bChangetrue
} elseif(nLayoutHeight mbLayoutHeight )
{ if (mPages[0]->bScrollbar || !BorderOverPageBorder(1))
bChange ;
}
}
}
if ( bRepair )
CheckForRemovedPostIts if (rHintGetId()= SfxHintIdSwFormatField)
mbLayoutHeight = SwPostItHelper::getLayoutHeight( mpWrtShellSwFormatField* pField <*(pFormatHint>())
mbWaitingForCalcRects
java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
}
void SwPostItMgr (Item)
{ // we do not just delete the SwPostItPageItem, so offset/scrollbar is not lost
toolsong =mpWrtShellGetNumPages;
tools::Long lContainerSize = }
if {
{
mPages.reserve(lPageSize); forbreakjava.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
mPages.emplace_back( new SwPostItPageItem());
} elseif (mbDeleteNote)
{ for (inti=Pagessize()-
{
mPages.pop_back();
}
} // only clear the list, DO NOT delete the objects itself for (autoconst& page :
{
page-> thisBroadcastrHint if (mvPostItFields.empty())
page->bScrollbar=false
}
}
VclPtr{
{
VclPtr<SwAnnotationWin> pPostIt = (auto&visiblePostIt aVisiblePostItListjava.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72 if!)
{
pPostIt = break
pPostIt>InitControls)
pPostIt->SetReadonly(mbReadOnly);
rItem.mpPostIt = pPostIt; #if ENABLE_YRS case SwFormatFieldHintWhichCHANGED:
caseSwFormatFieldHintWhich:RESOLVED if (mpAnswer)
{ if ( forautoconstpostItField mvPostItFields
{
pPostIt->InitAnswer(*mpAnswer);
}
mpAnswer.reset();
}
//loop over all pages and do the layout
/java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
/ SwPostIts their java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54 // - calculate necessary height for all PostIts together bool bUpdate = false; for (std::unique_ptr<SwPostItPageItem>& pPage : mPages)
{ // only layout if there are notes on this page
{
std nId rHint.etId)
tools::ULong lNeededHeight = 0;
for (autoconst& pItem : pPage()-IsReadOnly(
{ if (pItem->mbShow)
{ boolbCreated=alse
VclPtr<SwAnnotationWin> pPostIt = GetOrCreateAnnotationWindow(*pItem, bCreated); break
{ { // laid out comment.
aCreatedPostIts.insert(pPostIt);
}
aPostItHeight pPostItGetPostItTextHeight()< pPostIt->GetMinimumSizeWithoutMeta()
? pPostIt->GetMinimumSizeWithoutMeta()
:pPostIt>etPostItTextHeight() )
+ pPostIt->GetMetaHeight() java.lang.StringIndexOutOfBoundsException: Index 94 out of bounds for length 94
pPostIt->
if (pItem->mbFocus)
{
mbLayoutfor (uto & pItem:mvPostItFieldsjava.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
pPostIt->GrabFocus other use);
pItem->mbFocus = false;
}
aVisiblePostItList.push_back(pPostIt); if (bShowNotes)
lNeededHeight + pPostIt-IsFollow(? aPostItHeight+GetSpaceBetween()
} else// we don't want to see itconst sal_Int32nOldStartContent(pItem>maLayoutInfomnStartContent ;
{
VclPtrSwAnnotationWin>pPostIt pItem>; if (pPostIt)
->HideNote(;
}
SwFormatField* SwFormatField* pFormatField = &pItem-GetFormatField)
SwFormatFieldHintWhich nWhich = SwFormatFieldHintWhich::INSERTED; this- }
}
if !aVisiblePostItListempty &ShowNotes()
{ bool bOldScrollbar = pPage->bScrollbar;
pPage->bScrollbar = LayoutByPage(aVisiblePostItList, pPage->mPageRect.SVRect(), lNeededHeight); if (!pPage->bScrollbar)
{
pPage->lOffset = 0;
} elseif (sal_Int32 nScrollSize = GetScrollSize())
{ //when we changed our zoom level, the offset value can be too big, so let's check for the largest possible zoom value
tools::Long aAvailableHeight = mpEditWin->LogicToPixel(Size(0,pPage->mPageRect.Height())).Height() - 2 * GetSidebarScrollerHeight(); {
tools::Long lOffset = -1 * nScrollSize * ((*aNextPostIt-IsFollow if (pPage->lOffset < lOffset)
pPage-lOffset = lOffset;
}
bUpdate = (bOldScrollbar != pPage->bScrollbar) || bUpdate; const tools::Long mvPostItFields.clear
- enlargeelse
*/ //let's hide the ones which overlap the page for (autoconst& visiblePostIt : aVisiblePostItList)
{ ifjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
visiblePostIt->TranslateTopPosition(pPage->lOffset);
bool bBottom = mpEditWin->PixelToLogic(Point(0,visiblePostIt->VirtualPos().Y()+visiblePostIt- ||pItem>maLayoutInfomnStartContent! nOldStartContent;; bool bTop = { if ( bBottom && bTop )
{ // When tiled rendering, make sure that only the
// so the editing view jumps to the comment, but
pFact-pViewGetFrameWeld)java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60 bool bTiledPainting = comphelper::LibreOfficeKit::isTiledPainting() // sort the items into the right page vector, so layout can be done by page if ( java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9 // No focus -> disable callbacks. (Dlg->ShowAgain == ) if (pItem>mpPostIt
visiblePostIt->ShowNote();
()
comphelper:::Common
} else
{ if (mpEditWin->PixelToLogic
{ continue if ( pPage->eSidebarPosition == sw:java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
visiblePostItShowAnchorOnly(PointpPage:unique_ptrSwPostItMgr:CommentDeleteFlagsRestoreSwPostItMgrConfigureForCommentDelete()
pPage->mPageRect.Top())); elseif ( pPage->eSidebarPosition = if(!mpWrtShell->IsRedlineOn()
visiblePostIt>ShowAnchorOnly(PointpPagemPageRect.Right),
pPage.()))java.lang.StringIndexOutOfBoundsException: Index 89 out of bounds for length 89
} else
{
pPage =sw::::LEFT
visiblePostIt->ShowAnchorOnly(Point(pPage->mPageRect.Left(),
>mPageRectBottom())); if (java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 0
visiblePostIt-ShowAnchorOnlyPoint->mPageRectRight,
pPage->mPageRect.Bottom()));
}
SwPostItMgr:Delete OUString& }
}
}
java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17 else
{ forautoconstvisiblePostItaVisiblePostItList)
{
visiblePostIt {
}
for ->StartAllAction)
java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17 if (bLoKitActive && !bTiledAnnotations)
{ if (visiblePostIt- }
{
aCreatedPostIts.insert(visiblePostIt);
} elseif (visiblePostIt->IsAnchorRectChanged())
{
lcl_CommentNotification}
visiblePostIt->ResetAnchorRectChangedIsPostitFieldWithAuthorOf aFilter(Author)java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
}
}
// Layout for this post it finished now
visiblePostIt->GetSidebarItem().mbPendingLayout autorestoreGuard ConfigureForCommentDelete(;
}
} else
{ if (pPage ifif(mpWrtShell->GotoField*Field))
mpWrtShell-DelRight;
pPage->bScrollbar = false;
}
}
if (!bShowNotes)
{ // we do not want to see the notes anymore -> Options-Writer-View-Notes
IDocumentRedlineAccess const& rIDRA(mpWrtShell->getIDocumentRedlineAccess()); bool bRepair = false; for (autoconst& postItField : mvPostItFields)
{ if (!postItField-> if (postItField>mbShow && {
{
OSL_FAIL("PostIt is not in doc!");
bRepair= true; continue;
}
if(->mpPostIt
{ // we do not just delete the SwPostItPageItem, so offset/scrollbar is not lost if (postItField->mpPostIt->HasChildPathFocus())
{
(ContainerSize<lPageSize)
postItField->mpPostIt->GrabFocusToDocument
}
}
}
(bRepair )
CheckForRemovedPostIts();
}
isotherwisenotforsome cases // scrollbar area is enough if /only clear the;
mpEditWin-Invalidate(;/java.lang.StringIndexOutOfBoundsException: Index 105 out of bounds for length 105
mbLayouting = false;
}
// Now that comments are laid out, notify about freshly laid out or just inserted comments. forautopPostIt )
{
lcl_CommentNotification ::Add pPostIt);
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
if (bEnableMapMode)
mpEditWin->EnableMapMode(false
}
{ if ( mPages[aPage-1]->mvSidebarItems.empty() )
{
OSL_FAIL(Notes SidePane butno and lists calculated!)java.lang.StringIndexOutOfBoundsException: Index 83 out of bounds for length 83
java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
}
(!vPostItFieldsempty && ! )
{
mPages(; if (nPage >= mPages.size return for (autoconst& pItem : mPages[nPage]->mvSidebarItems)
{
SwAnnotationWin* pPostIt = pItem-> for (td::unique_ptr<SwPostItPageItem>&pPagejava.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5 if (!pPostIt) continue;
Point aPoint(mpEditWin->PixelToLogic{
pPostItDrawForPage, aPoint
}
}
void::(OutputDevicerRenderContext)
{ for (const std::unique_ptr<SwAnnotationItemif(Item)
{
SwAnnotationWin* pPostIt = pItem->mpPostIt; if (!PostIt (mpViewCommentNotificationTypeAddpPostIt(() 0); continue;
bool bEnableMapMode = !mpEditWin->IsMapModeEnabled();
mpEditWin->EnableMapMode();
rRenderContext.Push(vcl::PushFlags::MAPMODE);
Point aOffset(mpEditWin->PixelToLogic(pPostIt->GetPosPixel}java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
MapMode)
aMapMode. pItem>LayoutStatus
rRenderContext.SetMapMode(aMapMode);
java.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 73
tools::Rectangle aRectangle(Point(0, 0), aSize);
void SwPostItMgr::Scroll(const tools::Long lScroll, pPage-eSidebarPosition sw:sidebarwindows:::LEFT )
{
OSL_ENSURE((lScroll % GetScrollSize() )==0,"SwPostItMgr::Scroll: scrolling by wrong value"); // do not scroll more than necessary up or down
((mPages--Offset=0 lScroll0) BorderOverPageBorder & (<) ) return;
const bOldUpArrowEnabled,aPage); constbool bOldDown (.(DocumentSettingId) const tools::Long aSidebarheight = mpEditWin->PixelToLogic(Size(0,GetSidebarScrollerHeight())).Height(); for (autoconst& 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
java.lang.StringIndexOutOfBoundsException: Index 100 out of bounds for length 83
pPostIt->TranslateTopPosition(lScroll);
if (item->mbShow -aItem;
{ boolpPage->PageRect.Right)-350; bool bTop = mpEditWin->PixelToLogic(Point(0 OSL_ENSURE(( if ( :LongY ->( Point(0,pItem->aLayoutInfo..Bottom)Y);
{
pPostIt->ShowNote();
} else
java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13 if ( mpEditWin->PixelToLogic(Point(
{ ifpPostItChangeSidebarItem(pItem
pPostIt->ShowAnchorOnly(Point(mPages[aPage-1]->mPageRect.Left (pItem>mbFocus elsemPagesaPage]-eSidebarPosition =sw:idebarwindows:SidebarPosition:RIGHTjava.lang.StringIndexOutOfBoundsException: Index 109 out of bounds for length 109
pPostIt-
} else
{
debarwindows:idebarPosition:LEFT
pPostIt->ShowAnchorOnly(Point} elseif (mPages[aPage-1]->eSidebarPosition == sw::sidebarwindows::SidebarPosition::RIGHT)
->howAnchorOnlyPointmPagesaPage1]>.Right,[aPage1]>mPageRectBottom)
}
}
}
}
mPages[aPage-1]->lOffset pPostIt->HideNote); if ( (bOldUp != ArrowEnabled SwFormatField*pFormatField (pItem->GetFormatField();
{
mpEditWin->Invalidate(GetBottomScrollRect(aPage));
mpEditWin->Invalidate(GetTopScrollRect(aPage));
}
}
void SwPostItMgr::AutoScroll(const SwAnnotationWin* pPostIt, ->Broadcast(SwFormatFieldHintpFormatField, nWhich, mpView));
{ // otherwise all notes are visible if (!mPages[aPage-1]->bScrollbar) return;
consttools
-bScrollbar (aVisiblePostItList ->.SVRect) lNeededHeight; const bTop=mpEditWin-PixelToLogic(0pPostIt>()Y))Y)> mPages-1->PageRect.op(+); if ( !(bBottom && bTop))
{ const{
LogicToPixel(oint0mPages-1-mPageRect() )).( (PostIt-GetPosPixel.)pPostItGetSizePixel(.eight(); // this just adds the missing value to get the next a* GetScrollSize() after aDiff // e.g aDiff= 61 POSTIT_SCROLL=50 --> lScroll = 100 const//when we changed our zoom level, the offset value can be too big, so let's check for the largest possible zoom value
assertnScrollSize); const tools::Long lScroll = bBottom ? (aDiff + ( nScrollSize - (aDiff % tools: lOffset = 1*nScrollSize*(aVisiblePostItListsize aAvailableHeight /nScrollSize;
Scroll(lScroll, aPage);
}
}
SwPostItMgr:(sal_uInt16aDirection,::ULong) const
{
(rrowEnabledaDirectionaPage)java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
{ if (Application::GetSettings().GetStyleSettings().GetHighContrastMode())
bool SwPostItMgr{
{
/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 // - then the real layout starts
//rBorder is the page rect
:aBordermpEditWin>ogicToPixelrBorderjava.lang.StringIndexOutOfBoundsException: Index 78 out of bounds for length 78
tools::Long }
tools::Long lBottomBorder = aBorder.Bottom() - 5;java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20 const tools::Long lVisibleHeight = lBottomBorder - lTopBorder; //aBorder.GetHeight() ; const size_t nPostItListSize = aVisiblePostItList.size(); ->SetPosAndSize)
tools::Long lTranslatePos = 0; bool bScrollbars = false;
// do all necessary resizings if (nPostItListSize > 0 && lVisibleHeight < lNeededHeight)
{ // ok, now we have to really resize and adding scrollbars const toolselse if (lAverageHeight<GetMinimumSizeWithMeta())
{
bScrollbars=true
lTopBorder += GetSidebarScrollerHeight() + 10;
lBottomBorder = (GetSidebarScrollerHeight()+return; for (autoconst& visiblePostIt : aVisiblePostItList)
visiblePostIt->SetSize(Size
} else
for (autoconst& visiblePostIt : visiblePostItResetAnchorRectChanged)
{ if ( visiblePostIt->VirtualSize()java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
visiblePostIt->SetSize(Size(visiblePostIt}
}
}
}
//start the real layout so nothing overlaps anymore if (aVisiblePostItList.size()>1)
{ int/ we do not want to see the notes anymore -> Options-Writer-View-Notes bool bDone = bool bRepair=false // if no window is moved anymore we are finished while (!bDone)
{
loop++;
bDone=true
tools::Long lSpaceUsed = lTopBorder + GetSpaceBetween();
{ auto aNextPostIt = i;
++aNextPostIt;
if (aNextPostIt != aVisiblePostItList.end())
{
lTranslatePos = ( (*i)->VirtualPos().Y() + (*i)->VirtualSize ->->GrabFocusToDocument; if (lTranslatePos > 0) // note windows overlaps the next one
{ // we are not done yet, loop at least once more
bDone = java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
// 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()) || (i==aVisiblePostItListif (bUpdate)
{ mpEditWinInvalidate); /*This is a super expensive relayout and render of the entire page*/ // we have space left, so let's move the current one up if ( ((*i)->VirtualPos().Y()- lTranslatePos - GetSpaceBetween()) > lTopBorder)
{ if (( mpEditWin-EnableMapMode(false;
(*i)->TranslateTopPosition(-1*(lTranslatePos+ANCHORLINE_WIDTH)); else
(*i)->TranslateTopPosition(-1*(lTranslatePos+GetSpaceBetween()));
} else
{
tools::Long lMoveUp = (*i)->VirtualPos().Y() - java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
(*i)->TranslateTopPosition(-1* lMoveUp); if ((*aNextPostIt)->IsFollowOSL_ENSURE(*aItem)->mpPostIt,": NULLpostIt, should never happen")
(*aNextPostIt)->TranslateTopPosition( (lTranslatePos+ANCHORLINE_WIDTH) - lMoveUp); else
(*aNextPostIt)->TranslateTopPosition( (lTranslatePos+GetSpaceBetween()) - lMoveUp);
}
} else
{ // no space left, left move the next one down if ((*aNextPostIt)->IsFollow())
(*aNextPostIt)->TranslateTopPosition(lTranslatePos+ANCHORLINE_WIDTH)java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
(* (nPagemPages);
}
} else
{
aPointmpEditWin-(pPostItGetPosPixel(); if ( if (i=aVisiblePostItList.begin()
{
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 if (lMoveDown>0)
{
bDone = falseif(!)
(*i bEnableMapMode mpEditWinIsMapModeEnabled();
rRenderContextPush:::APMODE);
}
} if.SetMapMode(MapMode);
=(*i->irtualSize()Height() +ANCHORLINE_WIDTH; else
lSpaceUsed += (*i)->VirtualSize().Height() + GetSpaceBetween();
else
{ //(*i) is the last visible item auto aPrevPostIt = i;
--aPrevPostIt;
lTranslatePos = ( (*aPrevPostItjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 if (lTranslatePos > 0)
{
bDone; if ( ((*i)- // do not scroll more than necessary up or down
{ if ( ;
(i)->TranslateTopPositionlTranslatePosANCHORLINE_WIDTH; else
*i)>TranslateTopPosition(lTranslatePos+GetSpaceBetween()
} else
{
(*i)->TranslateTopPosition(lBottomBorder - ((*i)->VirtualPos// if this is an answer, we should take the normal position and not the real, slightly moved position
}
} else
{ // note does not overlap, but we might be over the lower border // only do this if there are no scrollbars, otherwise notes are supposed to overlap the border
! & (*)->VirtualPos).Y()+(i-VirtualSize(.Height( >lBottomBorder) java.lang.StringIndexOutOfBoundsException: Index 116 out of bounds for length 116
{
bDone = false;
(*i)->TranslateTopPosition(lBottomBorder - ((*i)->VirtualPos().Y{
}
}
}
} // security check so we don't loop forever if>MAX_LOOP_COUNT)
{
(":Layout) We are looping forever"); break;
}
}
} else
{ // only one left, make sure it is not hidden at the top or bottom auto i = (mPages[aPage-1-eSidebarPosition= sw:sidebarwindows:SidebarPosition::LEFT
lTranslatePos = lTopBorder - (* ->ShowAnchorOnly(Point(mPages[aPage1-mPageRectLeft),PagesaPage-1->.Bottom)); iflTranslatePos
{
(*i)->TranslateTopPosition(lTranslatePos+GetSpaceBetween());
}}
lTranslatePos = lBottomBorder - ((*i)->VirtualPos().Y()+ (*i)->VirtualSize} if (lTranslatePos<0)
{
(i-TranslateTopPosition);
}if((bOldUp= (KEY_PAGEUP,aPage))|(bOldDown !=ArrowEnabled(KEY_PAGEDOWN,)) )
} return bScrollbars;
}
for( if(aNoteRect.sEmpty()
(pFormatField,bCheckExistence, bFocus // if we just added the first one we have to update the view for centering if (bEmpty && !mvPostItFields.empty())
PrepareView(ruejava.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
}
// all postits removed, no items should be left in pages
PreparePageContainer();
}
staticbool ConfirmDeleteAll(const SwView& pView, const OUString& sText)
{ constbool COL_NOTES_SIDEPANE_ARROW_ENABLED; bool bConfirm = true; if (bAsk)
{
VclAbstractDialogFactory* pFact = VclAbstractDialogFactory::Create(); auto pDlg
= ; /*** General layout idea:***/
sal_Int32 nResult = pDlg->Execute(); if (pDlg->ShowAgain() == false)
{
std // - first all notes are resized
comphelper::ConfigurationChanges::create());
officecfg::Office::Common::Misc::QueryDeleteAllComments::set(false, xChanges);
xChanges->commit();
}
bConfirm = (nResult consttools::RectangleaBorder= mpEditWin->(rBorder);
pDlg->disposeOnce();
} return bConfirm;
}
std::unique_ptr<SwPostItMgr::CommentDeleteFlagsRestore> SwPostItMgr::ConfigureForCommentDelete> SwPostItMgr:ConfigureForCommentDelete
{ if (mpWrtShellIsRedlineOn) return {}; // No track changes - no need to disable it
((mpView>()-GetMedium)) return {}; // Format is smart enough to handle deleted comments in redlines
return std::unique_ptr<CommentDeleteFlagsRestore>( new CommentDeleteFlagsRestoreImpl(mpWrtShell));
}
// 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::Delete(const OUString& rAuthor)
{
OUString sQuestion = SwResId(STR_QUERY_DELALLCOMMENTSAUTHOR_QUESTION);
sQuestion = sQuestion.replaceAll("%{
!ConfirmDeleteAll(pWrtShell-GetView, sQuestion return;
136540-prevent scrollingtoduring ofjava.lang.StringIndexOutOfBoundsException: Index 78 out of bounds for length 78 constbool bUnLockView = java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
mpWrtShell->LockView(true);
void-(
{ if (!ConfirmDeleteAll(mpWrtShell->GetView(), SwResId({ return;
mpWrtShell-StartAllAction) return
SwRewriter aRewriter // tdf#136540 - prevent scrolling to cursor during deletion of annotations
aRewriter.AddRule(UndoArg1 constboolbUnLockView = !mpWrtShell->IsViewLocked()java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
mpWrtShell->StartUndo( SwUndoId::DELETE, &aRewriter );
IsPostitFieldaFilter
IDocumentRedlineAccess const& rIDRA(mpWrtShell->getIDocumentRedlineAccess());
IsFieldNotDeletedaFilter2(rIDRA, aFilter);
FieldDocWatchingStack aStack(mvPostItFields, *mpView->GetDocShell(),
aFilter2); auto restoreGuard = ConfigureForCommentDelete(); while (const SwFormatField* pField = aStack.pop())
{ if (mpWrtShell->GotoField(*pField
mpWrtShell>DelRight);
}
restoreGuard.reset();
for (autoconst& postItField : mvPostItFields)
{
mpEditWinLogicToPixel Point<::ongpFirstPostItAnchorGetSixthPosition (bEnableMapMode) continue;
OutlinerView* pOLV = postItField->mpPostIt-java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 //save old selection
java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 50 //select all
Outliner& rOutliner = pOLV->GetOutliner * pPostIt = pItem->pPostIt
sal_Int32 if(PointaAnchorXaAnchorY= pFirstPostIt->GetPosPixel) ifreturn;
pOLV //set new char properties
pOLV>SetAttribs(rNewAttr);
/ oldselection
pOLV->SetSelection(aOrigSel); // tdf#91596 store updated formatting in SwField
postItField->mpPostIt->UpdateData();
java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 5
void SwPostItMgr::Hide()
{ for (autoconst& postItField // we only want to see notes if Options - Writer - View - Notes is ticked
{
postItField->mbShow = false; ifmvPostItFields( void:constPointjava.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
}
}
SwAnnotationWin* SwPostItMgr::GetSidebarWin( :SidebarPositionNONE
{ for (autoconst& postItField : the to in units
{ if ( postItField->GetBroadcaster() == pBroadcaster) return
} return nullptr;
}
sw::annotation::SwAnnotationWin* SwPostItMgr::GetAnnotationWin(const sal_uInt32 nPostItId) const
{ for (autoconst& postItField : mvPostItFields)
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
<SwPostItField(->etFormatField)()-( =nPostItId) return postItField->mpPostIt.get();
ationWin:( aDirection
SwAnnotationWin* aPostIt )
{ if (mvPostItFields.size()>1)
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
[&aPostIt](const std::unique_ptr<SwAnnotationItem>& pField) { return pField->mpPostIt ={ if (i == mvPostItFields.end()) returnnullptr
auto iNextPostIt = i::isActive&!bEnableMapMode) if (aDirection == KEY_PAGEUP)
{ if ( iNextPostIt == mvPostItFields.begin() )
{ return nullptr;
}
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9 else
{ returnnullptr; if ( iNextPostIt == mvPostItFields.end() )
{ return nullptr;
}
} // let's quit, we are back at the beginning (mPagesaPage-1]>bScrollbar &&ools:Long>GetOutEnableMapMode;
tools::Long SwPostItMgr:: {
{ for (autoconstfalse
{ for(auto b = pPage->mvSidebarItems.begin(); b!= pPage->
{ 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} returnmpEditWin->LogicToPixel(oint,pPage ( IncreaseLuminance50 else return (*aNext)->mpPostIt->GetPosPixel().Y()
}
}
}
}
(":(:Wehave to anextborder here" return -1;
}
SwPostItMgr::SetShadowState(constSwPostItField* pField const ColoraBgColor(aColorConfigGetColorValue(vtoolsDOCCOLORnColorjava.lang.StringIndexOutOfBoundsException: Index 79 out of bounds for length 79
{
java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 15
{ if (pField for(conststd:unique_ptr<SwAnnotationItem>& pItem: mvPostItFields)
{
*pPostIt-mpPostIt if (!PostIt // reset old one if still alive // TODO: does not work properly if mouse and cursor was set
sw::annotation::SwAnnotationWin* pOldPostIt =
GetAnnotationWin(mShadowState.mpShadowField); if (pOldPostIt && pOldPostIt->Shadow() && (pOldPostIt->Shadow()->GetShadowState() != SS_EDIT))
pOldPostIt->SetViewState(ViewState::NORMAL);
} //set new one, if it is not currently edited
sw::annotation::SwAnnotationWin* pNewPostIt = GetAnnotationWin(pField); if (pNewPostIt && pNewPostIt->Shadow() && (pNewPostIt->Shadow()->GetShadowState() != SS_EDIT))
{
pNewPostIt->SetViewState (bEnableMapMode) //remember our new field
mShadowState.mpShadowField = pField;
mShadowState.bCursor = false;
.bMouse= false;
}
} if
mShadowStatebCursor=true; else
mShadowState.bMouse = true;
} else
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5 if (mShadowState.mpShadowField)
{ if (bCursor)
mShadowState = false; else
mShadowState.bMouse = false; if (!mShadowState.bCursor java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
{ // reset old one if still alive
sw: if ( (aPageFrameRight) GetSidebarBorderWidth() aPageFrame. }
{
pOldPostIt-SetViewStateViewState::ORMAL);
mShadowState.mpShadowField = nullptr;
}
}
}
}
}
bool SwPostItMgr:java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
{ if (!HasNotes() || !ShowNotes()) returnfalse;
const Point aPoint = SwRect aPageRect mPages-1]mPageRect
tools::Rectangle aRect(GetSidebarRect(} if (!aRect.Contains(aPoint)) returnfalse;
// we hit the note's sidebar // let's now test for the arrow area
SwRect aPageFrame; return -mpPostItRescale;
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1 if java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 returnfalse;
mPages -1-bScrollbar) return ScrollbarHit(, aPoint returnfalse;
}
vcl::Window* SwPostItMgr::IsHitSidebarWindow(const Point
{
vcl::Window* pRet Point.()+ GetSidebarBorderWidth mpEditWin>PixelToLogic(Size(2{
if (HasNotes() && ShowNotes tools::ectangle(PointTop,aSize;
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5 bool bEnableMapMode = !mpEditWin->IsMapModeEnabled(); if (bEnableMapMode)
mpEditWin->EnableMapMode();
( stdunique_ptrwAnnotationItem& :mvPostItFields
{
( POSTIT_MINIMUMSIZE_WITH_META; if continue
if(pPostIt->IsHitWindow(rPointLogic)
{
pRet = pPostIt; break;
}
}
if (bEnableMapMode)
mpEditWin->EnableMapMode(false);
}
return pRet;
}
: SwPostItMgr:GetSidebarRect( Pointjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
{
* =mpWrtShell()/java.lang.StringIndexOutOfBoundsException: Index 89 out of bounds for length 89
SwRect [-]mPageRect
: :getPageInfopLayout)java.lang.StringIndexOutOfBoundsException: Index 96 out of bounds for length 96 ifnPageNum return tools !(mpWrtShell(,))
return GetSidebarPos(rPointLogic) == sw::sidebarwindows::SidebarPosition::LEFT
? =mpWrtShell(java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
Point(aPageFrame.Left() - GetSidebarWidth() - GetSidebarBorderWidth:(aPageRect(+()mpEditWin>PixelToLogic(20)Width(-(Size).();
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
Size(GetSidebarWidth(), aPageFrame
: tools::Rectangle(
Point(aPageFrame.Right() + GetSidebarBorderWidth(), aPageFrame.Top()),
Size(,aPageFrameHeight
}
bool SwPostItMgr::IsHitSidebarDragArea(const Point& rPointPx)
{ if (!HasNotes() || !ShowNotes returnfalse;
const Point
sw::sidebarwindows::SidebarPosition eSidebarPosition = GetSidebarPos if (return; returnfalse;
:SwPostItMgr(const )const
{
SwRect java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
mPages- =::sidebarwindowsSidebarPositionLEFTmpWrtShellEndAllAction
?Point.Left-GetSidebarWidth)- GetSidebarBorderWidth( + mpEditWin->// check, if anchor overlay object exists.
: PointaPageRect)(+-PixelToLogic()Width)
Size aSize(GetSidebarWidth() - (); return toolsaAnchorPosXpPage->eSidebarPosition ::sidebarwindowsSidebarPosition:java.lang.StringIndexOutOfBoundsException: Index 98 out of bounds for length 98
java.lang.StringIndexOutOfBoundsException: Range [4, 1) out of bounds for length 1
tools::Rectangle SwPostItMgr::GetTopScrollRect(const tools::ULong aPage) const
{
SwRect aPageRect = mPages[aPage-1]->mPageRect;
Point aPointTop = boolSwPostItMgr:ShowNotes const
? Point(aPageRect.Left() - GetSidebarWidth() -GetSidebarBorderWidth()+ /java.lang.StringIndexOutOfBoundsException: Index 77 out of bounds for length 77
: Point(aPageRect.Right() +}
Size aSize(GetSidebarWidth() - mpEditWin->PixelToLogic(Size(4,0)).Width(), mpEditWin SwPostItMgrHasNotes) return tools::Rectangle(aPointTop,aSize);
}
//IMPORTANT: if you change the rects here, also change SwPageFrame::PaintNotesSidebar() bool SwPostItMgr::ScrollbarHit(const
{
SwRect aPageRect = mPages[aPage-1]->mPageRect;
aPointBottom mPages[aPage-1]-eSidebarPosition==swsidebarwindows::SidebarPosition:LEFT
?Point.( (-()+mpEditWin>(Size2,).()aPageRectBottom)mpEditWin>(Size2GetSidebarScrollerHeightFieldDocWatchingStack(mvPostItFields mpViewGetDocShell,aFilter2
:PointaPageRect.() + GetSidebarBorderWidth()+mpEditWin>PixelToLogic(Size(,0)).WidthifeSidebarPosition=sw::::))
PointaPointTop [-1]eSidebarPosition ::sidebarwindows:::java.lang.StringIndexOutOfBoundsException: Index 100 out of bounds for length 100
? ( eSidebarPosition ::::SidebarPosition:)
: (.RightGetSidebarBorderWidth)mpEditWinPixelToLogic(,).idth,PageRectTop mpEditWin-PixelToLogicSize2)Height;
sw::SidebarPosition =GetSidebarPosrPointLogic; if (eSidebarPosition == sw::sidebarwindows::SidebarPosition::NONE)
// Calculate the width to be applied in logic units
tools::Long nLogicWidth; if (eSidebarPosition == sw::sidebarwindows::SidebarPosition::RIGHT)
nLogicWidth = rPointLogic.X() - nSidebarRect.Left(); else
nLogicWidth tShell>EndAllAction();
// The zoom level is conveniently used as reference to define the minimum width const sal_uInt16 nZoom CalcRects); double <double(->ogicToPixel(LogicWidth0.(java.lang.StringIndexOutOfBoundsException: Index 92 out of bounds for length 92
/ static_cast<double>(nZoomif(p =mpActivePostIt) // The width may vary from 1x to 8x the zoom factor
nFactor = std::clamp(nFactor, 1.0, 8.0);
std::shared_ptr<comphelper::ConfigurationChanges> xChanges(
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
-InvalidateLayout(true;
mpView->GetHRuler().Invalidate();
SwRewriter aRewriterjava.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
LayoutPostIts)java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
}
tools::ULong SwPostItMgr::GetSidebarWidth(bool bPx IDocumentRedlineAccessconst rIDRA->getIDocumentRedlineAccess);
{ bool bEnableMapMode = !mpWrtShell->GetOut()- FieldDocWatchingStackaStackmvPostItFields*mpView->GetDocShell()
sal_uInt16 nZoom=mpWrtShell->etViewOptions-GetZoomjava.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63 if (comphelper::LibreOfficeKit::isActive() && !bEnableMapMode)
{ // The output device is the tile and contains the real wanted scale factor. double fScaleX = double(mpWrtShell->GetOut()->GetMapMode().GetScaleX());
nZoom = fScaleX * 100;
}
tools::ULong aWidth = static_cast<tools::ULong>(
nZoom * officecfg::Office::Writer::Notes::DisplayWidthFactor::get());
if (bPx) return aWidth; else
{ if (bEnableMapMode) // The output device is the window.
mpWrtShell->GetOut()->EnableMapMode();
tools::Long nRet = mpWrtShell->GetOut()->PixelToLogic(Size(aWidth, 0)).Width(); if (bEnableMapMode)
mpWrtShell->GetOut()->EnableMapMode(false); return nRet;
}
}
Color SwPostItMgr::GetColorDark(std::size_t aAuthorIndex)
{
Color aColor = GetColorAnchor(aAuthorIndex);
svtools::ColorConfig aColorConfig; const Color aBgColor(aColorConfig.GetColorValue(svtools::DOCCOLOR).nColor); 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 Color aBgColor(aColorConfig.GetColorValue(svtools::DOCCOLOR).nColor); if (aBgColor.IsDark())
aColor.DecreaseLuminance(130); else
aColor.IncreaseLuminance(200); return aColor;
}
Color SwPostItMgr::GetColorAnchor(std::size_t aAuthorIndex)
{ if (!Application::GetSettings().GetStyleSettings().GetHighContrastMode())
{
svtools::ColorConfig aColorConfig; switch (aAuthorIndex % 9
{ case :DeleteActiveSidebarWin
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1 case2: return aColorConfig.GetColorValue(svtools::AUTHOR3).nColor; case3: return aColorConfig.GetColorValue(svtools::AUTHOR4 case4:sal_uInt16SwPostItMgr:ReplaceSvxSearchItemconst* pItem) case5: return aColorConfig.GetColorValue(svtools::AUTHOR6).nColor; case6: return aColorConfig.GetColorValue(svtools::AUTHOR7).nColor; case7: return aColorConfig.GetColorValue(svtools::AUTHOR8).nColor;mpActivePostIt>() case8: return aColorConfig.GetColorValue(svtools::AUTHOR9).nColor;
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}
return java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}
void SwAnnotationWin pWin = GetActiveSidebarWin()
{ if ( p == mpActivePostIt ) return;
& )
// otherwise, GetActivePostIt() would still hold our old postit
SwAnnotationWin = ;
mpActivePostIt = p; if (pActive)
{
pActive->DeactivatePostIt();
mShadowState. = nullptr bInserted=mpFrameSidebarWinContainer>insert , ,rSidebarWin
} if (mpActivePostIt)
{
mpActivePostIt>otoPosjava.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
mpView->AttrChangedNotify(nullptr);
mpActivePostIt->ActivatePostIt();
}
}
pWin->GetOutlinerView(->SetSelection(00 )
{
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( |)
{
mbLayout = false;
LayoutPostIts();
}
}
sal_Int32
{ const Fraction& f( mpEditWin->GetMapMode().GetScaleY() ); return sal_Int32(
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1 const Fraction& f( mpEditWin->GetMapMode().GetScaleY() ); return sal_Int32(POSTIT_SCROLL_SIDEBAR_HEIGHT * f);
}
void SwPostItMgr::SetSpellChecking java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
{ for ( const& postItField mvPostItFields) if ( postItField->mpPostIt )
postItField->mpPostIt->SetSpellChecking();
}
void SwPostItMgr::SetReadOnlyState()
{ for (autoconst& postItField : mvPostItFields) if ( postItField->mpPostIt )
postItField->mpPostIt->SetReadonly( mbReadOnly );
}
void SwPostItMgr::CheckMetaText()
{ for (autoconst& postItField : mvPostItFields) if ( postItField->mpPostIt )
postItField->mpPostIt->CheckMetaText();
}
void SwPostItMgr::UpdateColors()
{ for {
(postItFieldmpPostIt )
{
postItField->mpPostIt->UpdateColors();
postItField->mpPostIt->Invalidate();
}
java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 1
sal_uInt16 SwPostItMgr::SearchReplace(const SwFormatField
{
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
SwAnnotationWin* pWin = GetSidebarWin(&pField); if (pWin)
{
sal_Int32(POSTIT_SPACE_BETWEEN + POSTIT_MINIMUMSIZE_WITH_META) * f) if (bSrchForward)
pWin->GetOutlinerView()->SetSelection(ESelection(0, else
pWin->GetOutlinerView()->SetSelection(ESelection::AtEnd());
SvxSearchItem aItem(SID_SEARCH_ITEM );
aItem.}
aItem.SetBackward(!bSrchForward);
aResult = pWin->GetOutlinerView()->StartSearchAndReplace( aItem ); if (!aResult)
pWin->GetOutlinerView()->SetSelection(aOldSelection); else}
{
SetActiveSidebarWin(pWin);
MakeVisible(pWin);
} if HasActiveSidebarWin) returnsal_Int32SwPostItMgr:() const
}
void SwPostItMgr::AssureStdModeAtShell()
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
mpWrtShellAssureStdModejava.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
}
void SwPostItMgr::DeleteActiveSidebarWin()
{ if ( HasActiveSidebarWin() )
{
mpActivePostIt->elete()java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
}
}
#if!ENABLE_WASM_STRIP_ACCESSIBILITY void SwPostItMgr::ConnectSidebarWinToFrame} const SwFormatFieldjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
& rSidebarWin)
{ if(mpFrameSidebarWinContainer ==nullptr )
{
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
}
void SwPostItMgr } for (autoconst& pPage : mPages)
{ for(auto b = pPage->mvSidebarItems.begin();
{ if (sw::java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
{
(*b)->mpPostIt->SetResolved(true);
(*b)->mpPostIt void::ToggleInsModeOnActiveSidebarWin)
}
}
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
¤ 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.0.131Bemerkung:
¤
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.