diff options
author | Michael Stahl <Michael.Stahl@cib.de> | 2020-09-22 12:17:06 +0200 |
---|---|---|
committer | Michael Stahl <michael.stahl@cib.de> | 2020-09-25 10:40:49 +0200 |
commit | 926a1a16a061b666a0b125cd2d15461716655e78 (patch) | |
tree | c4f606bd8138ffdf78f3b79ac5c693302bc5abfe /sw/inc/swcrsr.hxx | |
parent | 582a73abd2e5b51d8a21af2997395cd4db707a80 (diff) |
tdf#101830 sw: show field name for inline input fields too
Currently if the View->Field Names is toggled,
SwViewShell::ImplApplyViewOptions() will call Reformat() and throw away
all existing portions.
So we can just create a different kind of portion altogether depending
on the value of the setting, and avoid complex multi-inheritance portion
or copying lots of code around.
This requires correcting a few assumptions that a SwFieldPortion has a
length of 0 or 1; for the input field, its length is the length of the
entire input field including CH_TXT_ATR_INPUTFIELDSTART/END (unless it's
a follow/rest portion, those are length 0 as always).
For the cursor travelling, LeftRight() works similar to
f6a60ce214117946eef222701023dca612bf0a2b, while UpDown() and mouse click
positioning need tweaks in SwTextCursor::GetModelPositionForViewPoint()
to take the field length into account.
Due to the previous point, mouse click related functions in edtwin.cxx
require checking the position at the start now.
When enabling Field Names, move any shell cursors out of input fields.
Change-Id: I1304f419bd6fa20f0c55fd1b13165c4866d64000
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103155
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@cib.de>
Diffstat (limited to 'sw/inc/swcrsr.hxx')
-rw-r--r-- | sw/inc/swcrsr.hxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sw/inc/swcrsr.hxx b/sw/inc/swcrsr.hxx index a6e634ac3b55..4ed649e85681 100644 --- a/sw/inc/swcrsr.hxx +++ b/sw/inc/swcrsr.hxx @@ -162,15 +162,15 @@ public: virtual bool LeftRight( bool bLeft, sal_uInt16 nCnt, sal_uInt16 nMode, bool bAllowVisual, bool bSkipHidden, bool bInsertCursor, - SwRootFrame const* pLayout); + SwRootFrame const* pLayout, bool isFieldNames); bool UpDown(bool bUp, sal_uInt16 nCnt, Point const * pPt, long nUpDownX, SwRootFrame & rLayout); bool LeftRightMargin(SwRootFrame const& rLayout, bool bLeftMargin, bool bAPI); bool IsAtLeftRightMargin(SwRootFrame const& rLayout, bool bLeftMargin, bool bAPI) const; bool SttEndDoc( bool bSttDoc ); bool GoPrevNextCell( bool bNext, sal_uInt16 nCnt ); - bool Left( sal_uInt16 nCnt ) { return LeftRight( true, nCnt, CRSR_SKIP_CHARS, false/*bAllowVisual*/, false/*bSkipHidden*/, false, nullptr ); } - bool Right( sal_uInt16 nCnt ) { return LeftRight( false, nCnt, CRSR_SKIP_CHARS, false/*bAllowVisual*/, false/*bSkipHidden*/, false, nullptr ); } + bool Left( sal_uInt16 nCnt ) { return LeftRight(true, nCnt, CRSR_SKIP_CHARS, false/*bAllowVisual*/, false/*bSkipHidden*/, false, nullptr, false); } + bool Right( sal_uInt16 nCnt ) { return LeftRight(false, nCnt, CRSR_SKIP_CHARS, false/*bAllowVisual*/, false/*bSkipHidden*/, false, nullptr, false); } bool GoNextCell( sal_uInt16 nCnt = 1 ) { return GoPrevNextCell( true, nCnt ); } bool GoPrevCell( sal_uInt16 nCnt = 1 ) { return GoPrevNextCell( false, nCnt ); } virtual bool GotoTable( const OUString& rName ); @@ -271,7 +271,7 @@ public: virtual bool LeftRight( bool bLeft, sal_uInt16 nCnt, sal_uInt16 nMode, bool bAllowVisual, bool bSkipHidden, bool bInsertCursor, - SwRootFrame const*) override; + SwRootFrame const*, bool) override; virtual bool GotoTable( const OUString& rName ) override; void InsertBox( const SwTableBox& rTableBox ); |