60void collectUIInformation(
const OUString& aFactor)
63 aDescription.
aID =
"writer_edit";
66 aDescription.
aKeyWord =
"SwEditWinUIObject";
67 aDescription.
aParent =
"MainWindow";
75 bool const bCursorIsVisible(
m_pWrtShell->IsCursorVisible());
84 collectUIInformation(OUString::number(nFactor));
88 short nFactor,
bool bViewOnly )
99 const bool bWeb =
dynamic_cast< const SwWebView *
>( this ) !=
nullptr;
107 if( eZoomType != SvxZoomType::PERCENT )
121 const MapMode aTmpMap( MapUnit::MapTwip );
122 const Size aWindowSize(
GetEditWin().PixelToLogic( rEditSize, aTmpMap ) );
130 if( SvxZoomType::OPTIMAL == eZoomType )
135 nFac = aWindowSize.
Width() * 100 / aPageSize.
Width();
137 else if(SvxZoomType::WHOLEPAGE == eZoomType || SvxZoomType::PAGEWIDTH == eZoomType )
143 nFac = aWindowSize.
Width() * 100 / nTmpWidth;
145 if ( SvxZoomType::WHOLEPAGE == eZoomType )
148 nFac =
std::min( nFac, nVisPercent );
154 nFac = aWindowSize.
Width() * 100 / nTmpWidth;
159 const sal_uInt16 nZoomFac = o3tl::narrowing<sal_uInt16>(nFac);
166 (nZoomFac != pUsrPref->
GetZoom() ||
171 SW_MOD()->ApplyUsrPref(*pUsrPref,
nullptr);
174 if ( pOpt->
GetZoom() != nZoomFac )
180 if ( eZoomType != SvxZoomType::PERCENT )
184 if ( eZoomType == SvxZoomType::WHOLEPAGE )
190 aPos.setX( lLeftMargin );
193 rCharRect.
Bottom() < aPos.Y() )
194 aPos.setY( rCharRect.
Top() - rCharRect.
Height() );
205 else if ( nZoomFac != pOpt->
GetZoom() )
226 const bool bUnLockView = !
m_pWrtShell->IsViewLocked();
236 const bool bWeb =
dynamic_cast< const SwWebView *
>( this ) !=
nullptr;
245 SW_MOD()->ApplyUsrPref(*pUsrPref,
nullptr);
279 OSL_ENSURE( rEvent.GetWindow(),
"Window???" );
282 switch ( rEvent.GetId() )
284 case VclEventId::WindowHide:
285 if( pChildWin == m_pHScrollbar )
286 ShowHScrollbar(
false );
287 else if( pChildWin == m_pVScrollbar )
288 ShowVScrollbar(
false );
290 case VclEventId::WindowShow:
291 if( pChildWin == m_pHScrollbar )
292 ShowHScrollbar(
true );
293 else if( pChildWin == m_pVScrollbar )
294 ShowVScrollbar(
true );
305 assert(!ppScrollbar);
310 ppScrollbar->SetScrollHdl(
LINK(
this,
SwView, HoriScrollHdl ));
312 ppScrollbar->SetScrollHdl(
LINK(
this,
SwView, VertScrollHdl ));
318 ppScrollbar->ExtendedShow();
323 bool* pbNext =
static_cast<bool*
>(
p);
326 const bool bNext = *pbNext;
335 if (
NID_POSTIT != s_nMoveType && m_pPostItMgr )
338 if (pActiveSidebarWin)
343 switch( s_nMoveType )
351 (!bNext && aVisiblePageNumbers.
nFirstPhy == 1))
355 SearchLabel::StartWrapped);
359 auto nPage = bNext ? aVisiblePageNumbers.
nLastPhy + 1 :
364 const Point aPt(GetVisArea().
Left(), nYPos);
365 Point aAlPt(AlignToPixel(aPt));
368 if(aPt.Y() != aAlPt.Y())
369 aAlPt.AdjustY(3 * GetEditWin().PixelToLogic(
Size(0, 1)).
Height());
387 else if(s_nMoveType ==
NID_OLE)
389 bool bSuccess = bNext ?
405 bool bSuccess = rSh.
GotoObj(bNext,
426 GetViewFrame().GetDispatcher()->Execute(bNext ?
447 eSearchLabel = bNext ? SearchLabel::EndWrapped : SearchLabel::StartWrapped;
453 eSearchLabel = SearchLabel::NavElementNotFound;
472 pTyp = pCurField->
GetTyp();
493 if (bFrameTypeFootnote)
504 if (bFrameTypeFootnote)
519 std::vector< OUString > vNavMarkNames;
525 vNavMarkNames.push_back((*ppMark)->GetName());
527 std::sort(vNavMarkNames.begin(), vNavMarkNames.end());
530 if(!vNavMarkNames.empty())
537 if (s_nActMark >=
MAX_MARKS || s_nActMark >=
static_cast<sal_Int32
>(vNavMarkNames.size()))
548 s_nActMark = vNavMarkNames.size()-1;
552 rSh.
GotoMark(vNavMarkNames[s_nActMark]);
561 if (m_pPostItMgr->HasNotes())
564 m_pPostItMgr->AssureStdModeAtShell();
565 m_pPostItMgr->SetActiveSidebarWin(
nullptr);
566 GetEditWin().GrabFocus();
570 bool bWrapped =
false;
585 auto pAnnotationWin = m_pPostItMgr->GetAnnotationWin(
587 if (pAnnotationWin && pAnnotationWin->IsVisible())
599 GetViewFrame().GetDispatcher()->Execute(
FN_POSTIT);
602 SearchLabel::StartWrapped);
615 bool bBackward = s_pSrchItem->GetBackward();
618 s_pSrchItem->SetBackward(!bNext);
621 s_pSrchItem->SetBackward(bBackward);
642 m_pEditWin->GrabFocus();
707 sal_uInt16 nDefDlg = SID_PARA_DLG;
708 switch( pRuler->GetClickType() )
710 case RulerType::DontKnow:
711 case RulerType::Outside:
712 sDefPage=
"labelTP_BORDER";
714 case RulerType::Indent:
715 sDefPage=
"labelTP_PARA_STD";
717 case RulerType::Margin1:
718 case RulerType::Margin2:
723 sDefPage =
"labelTP_TABULATOR";
728 GetViewFrame().GetDispatcher()->ExecuteList(nDefDlg,
729 SfxCallMode::SYNCHRON|SfxCallMode::RECORD,
wrapper iterator: wraps iterator of implementation while hiding MarkBase class; only IMark instances ...
Provides access to the marks of a document.
virtual const_iterator_t getAllMarksEnd() const =0
returns a STL-like random access iterator to the end of the sequence of marks.
virtual const_iterator_t getAllMarksBegin() const =0
returns a STL-like random access iterator to the begin of the sequence of marks.
static SW_DLLPUBLIC MarkType GetType(const ::sw::mark::IMark &rMark)
Returns the MarkType used to create the mark.
virtual bool IsTextEdit() const final override
void Invalidate(sal_uInt16 nId)
SfxViewFrame * GetFrame() const
virtual void Invalidate(sal_uInt16 nId=0)
virtual bool IsDesignMode() const
vcl::Window & GetWindow() const
SfxBindings & GetBindings()
SfxViewFrame & GetViewFrame() const
vcl::Window * GetWindow() const
constexpr tools::Long Height() const
tools::Long AdjustHeight(tools::Long n)
tools::Long AdjustWidth(tools::Long n)
constexpr tools::Long Width() const
tools::Long GetRight() const
tools::Long GetLeft() const
static void SetSearchLabel(const SearchLabel &rSL)
Class for automated call of Start- and EndAction().
A helper class to save cursor state (position).
bool GotoNextOutline()
jump to next node with outline num.
bool GotoPrevOutline()
jump to previous node with outline num.
bool GotoNextFootnoteAnchor()
SwShellCursor * GetCursor_()
const SwPostItField * GetPostItFieldAtCursor() const
bool SttEndDoc(bool bStt)
bool MoveRegion(SwWhichRegion, SwMoveFnCollection const &)
bool MoveTable(SwWhichTable, SwMoveFnCollection const &)
bool GotoNxtPrvTOXMark(bool bNext=true)
jump to next/previous index marker
SwField * GetCurField(const bool bIncludeInputFieldAtStart=false) const
void EndAction(const bool bIdleEnd=false)
bool GotoFootnoteText()
jump from content to footnote
bool GotoPrevFootnoteAnchor()
void GoNextPrevCursorSetSearchLabel(const bool bNext)
bool GotoNxtPrvTableFormula(bool bNext=true, bool bOnlyErrors=false)
Jump to next/previous table formula Optionally it is possible to also jump to broken formulas.
bool IsCursorPtAtEnd() const
bool MoveFieldType(const SwFieldType *pFieldType, const bool bNext, const SwFieldIds nResType=SwFieldIds::Unknown, const bool bAddSetExpressionFieldsToInputFields=true)
void RestoreSavePos()
Restore cursor state to the one saved by SwCursorSaveState.
SwFieldType * GetFieldType(size_t nField, SwFieldIds nResId=SwFieldIds::Unknown) const
get field types with a ResId, if 0 get all
FrameTypeFlags GetFrameType(const Point *pPt, bool bStopAtFly) const
For return values see above FrameType.
bool GotoNextFly(GotoObjFlags eType=GotoObjFlags::FlyAny)
Independent selecting of flys.
bool GotoObj(bool bNext, GotoObjFlags eType=GotoObjFlags::DrawAny)
bool GotoPrevFly(GotoObjFlags eType=GotoObjFlags::FlyAny)
void EndTextEdit()
Deletes object if required.
Instances of SwFields and those derived from it occur 0 to n times.
Base class of all fields.
SwFieldTypesEnum GetTypeId() const
SwFieldType * GetTyp() const
SwFrameFormat & GetMaster()
UseOnPage GetUseOn() const
SwFrameFormat & GetLeft()
tools::ULong GetSidebarWidth(bool bPx=false) const
tools::ULong GetSidebarBorderWidth(bool bPx=false) const
Of course Writer needs its own rectangles.
void Height(tools::Long nNew)
void Top(const tools::Long nTop)
void Bottom(const tools::Long nBottom)
void SSize(const Size &rNew)
Represents the current text cursor of one opened edit window.
bool IsViewLayoutBookMode() const
SvxZoomType GetZoomType() const
sal_uInt16 GetZoom() const
void SetZoomType(SvxZoomType eZoom_)
void SetZoom(sal_uInt16 n)
sal_uInt16 GetViewLayoutColumns() const
void SetReadonly(bool bSet)
void SetViewLayoutColumns(sal_uInt16 nNew)
void SetViewLayoutBookMode(bool bNew)
const IDocumentMarkAccess * getIDocumentMarkAccess() const
Provides access to the document bookmark interface.
Point GetPagePos(sal_uInt16 nPageNum) const
void GetFirstLastVisPageNumbers(SwVisiblePageNumbers &rVisiblePageNumbers)
void GetHRulerMetric(FieldUnit &rToFill) const
SAL_DLLPRIVATE bool UpdateScrollbars()
VclPtr< SwScrollbar > m_pHScrollbar
static void SetActMark(sal_Int32 nSet)
static sal_uInt16 s_nMoveType
void EnableVScrollbar(bool bEnable)
std::unique_ptr< SwWrtShell > m_pWrtShell
void GetVRulerMetric(FieldUnit &rToFill) const
VclPtr< SwScrollbar > m_pVScrollbar
virtual FmFormShell * GetFormShell() override
bool m_bVScrollbarEnabled
VclPtr< SvxRuler > m_pHRuler
VclPtr< SvxRuler > m_pVRuler
void SetViewLayout(sal_uInt16 nColumns, bool bBookMode, bool bViewOnly=false)
void ShowHScrollbar(bool bShow)
void EnableHScrollbar(bool bEnable)
const tools::Rectangle & GetVisArea() const
bool IsHScrollbarVisible() const
SwPostItMgr * GetPostItMgr()
void ChangeVRulerMetric(FieldUnit eUnit)
static sal_Int32 s_nActMark
bool IsVScrollbarVisible() const
SAL_DLLPRIVATE void CreateScrollbar(bool bHori)
void SetVisArea(const tools::Rectangle &, bool bUpdateScrollbar=true)
SAL_DLLPRIVATE void CalcVisArea(const Size &rPixelSz)
SAL_DLLPRIVATE void SetZoom_(const Size &rEditSz, SvxZoomType eZoomType, short nFactor, bool bViewOnly)
static sal_uInt16 GetMoveType()
void ShowVScrollbar(bool bShow)
bool m_bHScrollbarEnabled
static void SetMoveType(sal_uInt16 nSet)
void SetZoom(SvxZoomType eZoomType, short nFactor=100, bool bViewOnly=false)
void ChangeTabMetric(FieldUnit eUnit)
Used by the UI to modify the document model.
void EnterSelFrameMode(const Point *pStartDrag=nullptr)
void addCurrentPosition()
void GotoMark(const ::sw::mark::IMark *const pMark)
SwNavigationMgr & GetNavigationMgr()
void GotoFootnoteAnchor(const SwTextFootnote &rTextFootnote)
bool HasSelection() const
void MoveCursor(bool bWithSelect=false)
const SwView & GetView() const
static UITestLogger & getInstance()
void logEvent(const EventDescription &rDescription)
static VclPtr< reference_type > Create(Arg &&... arg)
#define FN_FORMAT_PAGE_DLG
GotoObjFlags
values can be combined via logical or
@ Page
Rect of current page.
@ PageCalc
... page will be formatted if required.
@ PagesArea
Rect covering the pages area.
SwFieldTypesEnum
List of FieldTypes at UI.
@ Database
For old documents the Field-Which IDs must be preserved !!!
#define LINK(Instance, Class, Member)
constexpr std::enable_if_t< std::is_signed_v< T >, std::make_unsigned_t< T > > make_unsigned(T value)
SwNodeOffset min(const SwNodeOffset &a, const SwNodeOffset &b)
SwNodeOffset abs(const SwNodeOffset &a)
SwMoveFnCollection const & fnTableStart
SwMoveFnCollection const & fnRegionStart
std::map< OUString, OUString > aParameters
constexpr SwTwips DOCUMENTBORDER
bool GotoNextRegion(SwPaM &rCurrentCursor, SwMoveFnCollection const &fnPosRegion, bool bInReadOnly)
bool GotoPrevRegion(SwPaM &rCurrentCursor, SwMoveFnCollection const &fnPosRegion, bool bInReadOnly)
bool GotoNextTable(SwPaM &rCurrentCursor, SwMoveFnCollection const &fnPosTable, bool bInReadOnly)
bool GotoPrevTable(SwPaM &rCurrentCursor, SwMoveFnCollection const &fnPosTable, bool bInReadOnly)
const tools::Long nLeftOfst
IMPL_LINK(SwView, WindowChildEventListener, VclWindowEvent &, rEvent, void)
#define NID_TABLE_FORMULA
#define NID_TABLE_FORMULA_ERROR