20#include <config_wasm_strip.h>
25#include <com/sun/star/accessibility/XAccessible.hpp>
26#include <com/sun/star/awt/PopupMenuDirection.hpp>
27#include <com/sun/star/awt/XPopupMenu.hpp>
28#include <com/sun/star/i18n/XBreakIterator.hpp>
29#include <com/sun/star/i18n/ScriptType.hpp>
30#include <com/sun/star/i18n/InputSequenceCheckMode.hpp>
31#include <com/sun/star/i18n/UnicodeScript.hpp>
32#include <com/sun/star/i18n/XExtendedInputSequenceChecker.hpp>
33#include <com/sun/star/ui/ContextMenuExecuteEvent.hpp>
62#include <editeng/editeng.hxx>
74#include <bookmark.hxx>
101#include <inputwin.hxx>
150#include "../../core/crsr/callnk.hxx"
155#include <strings.hrc>
199 SdrObject* pTextBox = pTextBoxFormat->FindRealSdrObject();
244 aHitTestPos +=
Point( -1, 1 );
248 aHitTestPos +=
Point( 1, 1 );
263 static constexpr sal_uInt16
nNoPos = std::numeric_limits<sal_uInt16>::max();
355 eStyle = PointerStyle::NotAllowed;
363 bool bFrameIsValidTarget =
false;
367 bFrameIsValidTarget = (
m_pApplyTempl->eType == SfxStyleFamily::Frame );
369 if( bFrameIsValidTarget &&
386 rSh.SwCursorShell::SetVisibleCursor( rLPt );
402 ? PointerStyle::ChainNotAllowed : PointerStyle::Chain;
422 if ( !bExecHyperlinks )
425 if ( ( bSecureOption && nModifier ==
KEY_MOD1 ) ||
426 ( !bSecureOption && nModifier !=
KEY_MOD1 ) )
427 bExecHyperlinks =
true;
430 const bool bExecSmarttags = nModifier ==
KEY_MOD1;
433 bool bPrefSdrPointer =
false;
434 bool bHitHandle =
false;
435 bool bCntAtPos =
false;
442 else if ( (bHitHandle = (pSdrView->
PickHandle(rLPt) !=
nullptr)) )
445 bPrefSdrPointer =
true;
454 eStyle = PointerStyle::Arrow;
456 bPrefSdrPointer =
true;
462 SdrObject* pObj = (bNotInSelObj && bExecHyperlinks) ?
483 bPrefSdrPointer =
true;
490 if (eHit == SdrHitKind::UrlField && bExecHyperlinks)
493 bPrefSdrPointer =
true;
509 eStyle = bMovable ? PointerStyle::Move : PointerStyle::Arrow;
527 eStyle = PointerStyle::NotAllowed;
529 eStyle = PointerStyle::Move;
535 bPrefSdrPointer =
true;
543 if ( bPrefSdrPointer )
558 eStyle = PointerStyle::Arrow;
580 eStyle = PointerStyle::RefHand;
586 if( !bClickToFollow ||
589 eStyle = PointerStyle::RefHand;
592 else if (
GetView().GetWrtShell().GetViewOptions()->IsShowOutlineContentVisibilityButton())
601 eStyle = PointerStyle::RefHand;
611 OUString sQuickHelp(
SwResId(STR_CLICK_OUTLINE_CONTENT_TOGGLE_VISIBILITY));
613 &&
nPos + 1 < nOutlineNodesCount
615 sQuickHelp +=
" (" +
SwResId(STR_CLICK_OUTLINE_CONTENT_TOGGLE_VISIBILITY_EXT) +
")";
627 eStyle = PointerStyle::TextVertical;
632 eStyle = PointerStyle::ShowWhitespace;
634 eStyle = PointerStyle::HideWhitespace;
639 if( text::HoriOrientation::LEFT ==
m_eOrient )
640 eStyle = PointerStyle::AutoScrollE;
642 eStyle = PointerStyle::AutoScrollW;
655 Point aModPt( m_aMovePos );
663 const int nMaxScroll = 40;
669 rSh.
Drag(&aModPt,
false);
677 if ( m_xRowColumnSelectionStart )
679 Point aPos( aModPt );
692 if( aModPt.
Y() < ( rVisArea.
Top() + rVisArea.
Height() / 2 ) )
783 uno::Reference < i18n::XBreakIterator > xBI = pBreakIter->
GetBreakIter();
787 if (xBI->getScriptType( rText, 0 ) == i18n::ScriptType::COMPLEX)
790 nCTLScriptPos = xBI->nextScript( rText, 0, i18n::ScriptType::COMPLEX );
792 return (0 <= nCTLScriptPos && nCTLScriptPos <= rText.getLength());
798 const OUString &rInBuffer)
819 default: bLang =
false;
826 if(SfxItemState::DEFAULT <= aLangSet.
GetItemState(nWhich))
829 if ( eLang == eBufferLanguage )
860 i18n::UnicodeScript
eType = !rInBuffer.isEmpty() ?
862 i18n::UnicodeScript_kScriptCount;
864 bool bSystemIsNonLatin =
false;
867 case i18n::UnicodeScript_kGreek:
868 case i18n::UnicodeScript_kCyrillic:
871 bSystemIsNonLatin =
true;
879 bLang = (bSystemIsNonLatin != bOOoLangIsNonLatin);
904 uno::Reference < i18n::XExtendedInputSequenceChecker > xISC =
pCheckIt->
xCheck;
920 const sal_Int32 nOldLen = aOldText.getLength();
922 sal_Int32 nExpandSelection = 0;
925 sal_Int32 nTmpPos = nOldLen;
927 i18n::InputSequenceCheckMode::STRICT : i18n::InputSequenceCheckMode::BASIC;
929 OUString aNewText( aOldText );
932 for( sal_Int32 k = 0; k <
m_aInBuffer.getLength(); ++k)
935 const sal_Int32 nPrevPos =xISC->correctInputSequence( aNewText, nTmpPos - 1, cChar, nCheckMode );
938 if (nPrevPos != aNewText.getLength())
939 nTmpPos = nPrevPos + 1;
943 sal_Int32 nNewLen = aNewText.getLength();
946 sal_Int32 nChgPos = 0;
947 while ( nChgPos < nOldLen && nChgPos < nNewLen &&
948 pOldText[nChgPos] == pNewText[nChgPos] )
951 const sal_Int32 nChgLen = nNewLen - nChgPos;
955 nExpandSelection = nOldLen - nChgPos;
962 for( sal_Int32 k = 0; k <
m_aInBuffer.getLength(); ++k )
965 if (xISC->checkInputSequence( aNewText, nTmpPos - 1, cChar, nCheckMode ))
968 aNewText += OUStringChar( cChar );
972 m_aInBuffer = aNewText.copy( aOldText.getLength() );
987 OSL_ENSURE( nCursorStartPos >= nExpandSelection,
"cannot expand selection as specified!!" );
988 if (nExpandSelection && nCursorStartPos >= nExpandSelection)
996 uno::Reference< frame::XDispatchRecorder > xRecorder =
998 if ( xRecorder.is() )
1023#define MOVE_LEFT_SMALL 0
1024#define MOVE_UP_SMALL 1
1025#define MOVE_RIGHT_BIG 2
1026#define MOVE_DOWN_BIG 3
1027#define MOVE_LEFT_BIG 4
1028#define MOVE_UP_BIG 5
1029#define MOVE_RIGHT_SMALL 6
1030#define MOVE_DOWN_SMALL 7
1033#define MOVE_LEFT_HUGE 8
1034#define MOVE_UP_HUGE 9
1035#define MOVE_RIGHT_HUGE 10
1036#define MOVE_DOWN_HUGE 11
1091 const bool bFollowTextFlow =
1096 &rFormatAnchor, bFollowTextFlow,
1097 false, &aRefPoint );
1119 nRight = aSnap.
Width();
1134 default: OSL_ENSURE(
true,
"ChangeFly: Unknown direction." );
1137 if ((RndStdIds::FLY_AS_CHAR == eAnchorId) && ( nDir % 2 ))
1142 else if ( aDiff < -aTmp.
Height() )
1149 bool bDown = 0 != ( nDir & 0x02 );
1152 case text::VertOrientation::CHAR_TOP:
1153 if( bDown ) eNew = text::VertOrientation::CENTER;
1155 case text::VertOrientation::CENTER:
1156 eNew = bDown ? text::VertOrientation::TOP : text::VertOrientation::CHAR_TOP;
1158 case text::VertOrientation::TOP:
1159 if( !bDown ) eNew = text::VertOrientation::CENTER;
1161 case text::VertOrientation::LINE_TOP:
1162 if( bDown ) eNew = text::VertOrientation::LINE_CENTER;
1164 case text::VertOrientation::LINE_CENTER:
1165 eNew = bDown ? text::VertOrientation::LINE_BOTTOM : text::VertOrientation::LINE_TOP;
1167 case text::VertOrientation::LINE_BOTTOM:
1168 if( !bDown ) eNew = text::VertOrientation::LINE_CENTER;
1182 if (bWeb && (RndStdIds::FLY_AT_PARA == eAnchorId)
1190 case text::HoriOrientation::RIGHT:
1192 eNew = text::HoriOrientation::LEFT;
1194 case text::HoriOrientation::LEFT:
1196 eNew = text::HoriOrientation::RIGHT;
1210 bool bSetPos = (RndStdIds::FLY_AS_CHAR != eAnchorId);
1213 bSetPos = RndStdIds::FLY_AT_PAGE == eAnchorId;
1230 const bool bOnePixel(
1268 if(0 != nX || 0 != nY)
1289 nX *= aSnap.
Width();
1303 bool bDummy1, bDummy2;
1304 const bool bVertAnchor = rSh.
IsFrameVertical(
true, bDummy1, bDummy2 );
1305 bool bHoriMove = !bVertAnchor == !( nDir % 2 );
1307 !bHoriMove || (rSh.
GetAnchorId() != RndStdIds::FLY_AS_CHAR);
1320 if( SdrHdlKind::Anchor == pHdl->
GetKind() ||
1321 SdrHdlKind::Anchor_TR == pHdl->
GetKind() )
1336 pSdrView->
BegDragObj(aStartPoint,
nullptr, pHdl, 0);
1340 bool bWasNoSnap = rDragStat.
IsNoSnap();
1355 const_cast<SdrDragStat&
>(rDragStat).SetNoSnap(bWasNoSnap);
1379 pWindow->KeyInput(rKEvt);
1445 bool bFlushBuffer =
false;
1446 bool bNormalChar =
false;
1483 if( ( bVertText && ( !bTableCursor || bVertTable ) ) ||
1484 ( bTableCursor && bVertTable ) )
1487 if (eDirection == SvxFrameDirection::Vertical_LR_BT)
1539 std::shared_ptr<SwContentControl> pContentControl = rFormatContentControl.
GetContentControl();
1540 if (pContentControl->ShouldOpenPopup(rKeyCode))
1546 if (pContentControlButton)
1548 pContentControlButton->StartPopup();
1574 = static_txtattr_cast<SwTextContentControl*>(pAttr);
1577 std::shared_ptr<SwContentControl> pContentControl
1579 if (pContentControl->IsInteractingCharacter(aCh))
1595 nEvent = SvMacroItemId::SwFrmKeyInputAlpha;
1597 nEvent = SvMacroItemId::SwFrmKeyInputNoAlpha;
1604 xVar->PutString( pFlyFormat->
GetName() );
1605 xArgs->Put(xVar.
get(), 1);
1608 if( SvMacroItemId::SwFrmKeyInputAlpha == nEvent )
1609 xVar->PutChar( aCh );
1612 xArgs->Put(xVar.
get(), 2);
1616 if( !sRet.isEmpty() && sRet.toInt32()!=0 )
1632 pAnchor = rHdlList.
GetHdl(SdrHdlKind::Anchor_TR);
1641 uno::Reference< frame::XDispatchRecorder > xRecorder =
1643 if ( !xRecorder.is() )
1651 OUString sFormulaEntry;
1653 enum class SwKeyState { CheckKey, InsChar, InsTab,
1654 NoNum, NumOff, NumOrNoNum, NumDown, NumUp,
1655 NumIndentInc, NumIndentDec,
1658 NextCell, PrevCell, OutlineUp, OutlineDown,
1659 GlossaryExpand, NextPrevGlossary,
1663 LaunchOLEObject, GoIntoFly, GoIntoDrawing,
1664 EnterDrawHandleMode,
1665 CheckDocReadOnlyKeys,
1666 CheckAutoCorrect, EditFormula,
1667 ColLeftBig, ColRightBig,
1668 ColLeftSmall, ColRightSmall,
1671 CellLeftBig, CellRightBig,
1672 CellLeftSmall, CellRightSmall,
1673 CellTopBig, CellBottomBig,
1674 CellTopSmall, CellBottomSmall,
1676 Fly_Change, Draw_Change,
1683 SwKeyState eKeyState = bIsDocReadOnly ? SwKeyState::CheckDocReadOnlyKeys : SwKeyState::CheckKey;
1684 SwKeyState eNextKeyState = SwKeyState::End;
1693 while( SwKeyState::End != eKeyState )
1695 SwKeyState eFlyState = SwKeyState::KeyToView;
1699 case SwKeyState::CheckKey:
1700 eKeyState = SwKeyState::KeyToView;
1703 !rKeyCode.
IsMod2() &&
'=' == aCh &&
1718 eKeyState = SwKeyState::EditFormula;
1726 sFormulaEntry =
"=";
1738 eKeyState = SwKeyState::GlossaryExpand;
1745 eKeyState = SwKeyState::ColRightBig;
1746 eFlyState = SwKeyState::Fly_Change;
1748 goto KEYINPUT_CHECKTABLE;
1751 eKeyState = SwKeyState::ColRightSmall;
1752 eFlyState = SwKeyState::Fly_Change;
1754 goto KEYINPUT_CHECKTABLE;
1757 eKeyState = SwKeyState::ColLeftSmall;
1758 goto KEYINPUT_CHECKTABLE;
1761 eKeyState = SwKeyState::ColLeftBig;
1762 goto KEYINPUT_CHECKTABLE;
1765 eKeyState = SwKeyState::CellRightBig;
1766 goto KEYINPUT_CHECKTABLE;
1769 eKeyState = SwKeyState::CellRightSmall;
1770 goto KEYINPUT_CHECKTABLE;
1773 eKeyState = SwKeyState::CellLeftSmall;
1774 goto KEYINPUT_CHECKTABLE;
1777 eKeyState = SwKeyState::CellLeftBig;
1778 goto KEYINPUT_CHECKTABLE;
1781 eKeyState = SwKeyState::ColBottomSmall;
1782 eFlyState = SwKeyState::Fly_Change;
1784 goto KEYINPUT_CHECKTABLE;
1787 eKeyState = SwKeyState::ColBottomBig;
1788 eFlyState = SwKeyState::Fly_Change;
1790 goto KEYINPUT_CHECKTABLE;
1793 eKeyState = SwKeyState::CellBottomSmall;
1794 goto KEYINPUT_CHECKTABLE;
1797 eKeyState = SwKeyState::CellBottomBig;
1798 goto KEYINPUT_CHECKTABLE;
1801 eKeyState = SwKeyState::CellTopBig;
1802 goto KEYINPUT_CHECKTABLE;
1805 eKeyState = SwKeyState::CellTopSmall;
1806 goto KEYINPUT_CHECKTABLE;
1814 ! (Window::GetIndicatorState() & KeyIndicatorState::CAPSLOCK)
1818 bFlushBuffer =
true;
1819 bNormalChar =
false;
1820 eKeyState = SwKeyState::End;
1826 if(!pFlyFormat && SwKeyState::KeyToView != eFlyState &&
1829 eKeyState = SwKeyState::Draw_Change;
1832 eKeyState = eFlyState;
1833 else if( SwKeyState::Draw_Change != eKeyState)
1834 eKeyState = SwKeyState::EnterCharCell;
1850 eKeyState = pFlyFormat ? SwKeyState::Fly_Change : SwKeyState::Draw_Change;
1854 eKeyState = SwKeyState::Draw_Change;
1873 eFlyState = SwKeyState::Fly_Change;
1876 goto KEYINPUT_CHECKTABLE_INSDEL;
1880 goto KEYINPUT_CHECKTABLE_INSDEL;
1888 eFlyState = SwKeyState::Fly_Change;
1891 goto KEYINPUT_CHECKTABLE_INSDEL;
1902 pDropDown->LaunchPopup();
1903 eKeyState = SwKeyState::End;
1906 eFlyState = SwKeyState::Fly_Change;
1909 goto KEYINPUT_CHECKTABLE_INSDEL;
1912KEYINPUT_CHECKTABLE_INSDEL:
1917 eKeyState = SwKeyState::KeyToView;
1918 if(SwKeyState::KeyToView != eFlyState)
1922 eKeyState = SwKeyState::Draw_Change;
1924 eKeyState = SwKeyState::Fly_Change;
1934 eKeyState = SwKeyState::NumOrNoNum;
1939 eKeyState = SwKeyState::End;
1951 eKeyState = SwKeyState::LaunchOLEObject;
1953 eKeyState = SwKeyState::GoIntoFly;
1958 eKeyState = SwKeyState::GoIntoDrawing;
1960 eKeyState = SwKeyState::GoIntoFly;
1964 eKeyState = SwKeyState::GlossaryExpand;
1973 eKeyState = SwKeyState::NumOff;
1974 eNextKeyState = SwKeyState::OutlineLvOff;
1983 eKeyState = SwKeyState::AutoFormatByInput;
1987 eNextKeyState = eKeyState;
1988 eKeyState = SwKeyState::CheckAutoCorrect;
2000 eKeyState = SwKeyState::NoNum;
2003 eKeyState = SwKeyState::SpecialInsert;
2022 || ( rSh.
IsNoNum() && bOnlyBackspaceKey ) ) )
2028 eKeyState = SwKeyState::End;
2036 eKeyState = SwKeyState::NumUp;
2042 eKeyState = SwKeyState::NumIndentDec;
2061 bool bCallNumOrNoNum(
false );
2062 if ( bOnlyBackspaceKey && !rSh.
IsNoNum() )
2064 bCallNumOrNoNum =
true;
2066 else if ( !bOnlyBackspaceKey && rSh.
IsNoNum() )
2068 bCallNumOrNoNum =
true;
2070 else if ( bOnlyBackspaceKey
2076 if ( pCurrNumRule !=
nullptr
2079 bCallNumOrNoNum =
true;
2082 if ( bCallNumOrNoNum
2085 eKeyState = SwKeyState::NumOrNoNum;
2093 eKeyState = SwKeyState::End;
2099 eFlyState = SwKeyState::Fly_Change;
2101 goto KEYINPUT_CHECKTABLE_INSDEL;
2111 eKeyState = SwKeyState::GotoNextFieldMark;
2116 eKeyState = SwKeyState::End;
2124 eKeyState = SwKeyState::NumDown;
2128 eKeyState = SwKeyState::InsTab;
2138 eKeyState = SwKeyState::NextObject;
2143 eKeyState = SwKeyState::NextCell;
2146 eKeyState = SwKeyState::CheckAutoCorrect;
2147 eNextKeyState = SwKeyState::NextCell;
2150 else if (pTextContentControl)
2155 switch (pCC->GetType())
2158 eKeyState = SwKeyState::InsTab;
2161 eKeyState = SwKeyState::GotoNextFieldMark;
2167 eKeyState = SwKeyState::InsTab;
2175 eKeyState = SwKeyState::OutlineDown;
2186 eKeyState = SwKeyState::GotoPrevFieldMark;
2191 eKeyState = SwKeyState::End;
2197 eKeyState = SwKeyState::NumUp;
2206 eKeyState = SwKeyState::PrevObject;
2211 eKeyState = SwKeyState::PrevCell;
2214 eKeyState = SwKeyState::CheckAutoCorrect;
2215 eNextKeyState = SwKeyState::PrevCell;
2218 else if (pTextContentControl)
2220 eKeyState = SwKeyState::GotoPrevFieldMark;
2224 eKeyState = SwKeyState::End;
2231 eKeyState = SwKeyState::OutlineUp;
2243 aTmpQHD.
Next( pACorr &&
2245 eKeyState = SwKeyState::NextPrevGlossary;
2248 eKeyState = SwKeyState::InsTab;
2253 eKeyState = SwKeyState::EnterDrawHandleMode;
2258 eKeyState = SwKeyState::NumIndentInc;
2271 eKeyState = SwKeyState::NextPrevGlossary;
2277 eKeyState = SwKeyState::EnterDrawHandleMode;
2283 eKeyState = SwKeyState::NumIndentDec;
2292 eKeyState = SwKeyState::GoIntoFly;
2295 eKeyState = SwKeyState::GoIntoDrawing;
2297 eKeyState = SwKeyState::GoIntoFly;
2304 case SwKeyState::CheckDocReadOnlyKeys:
2306 eKeyState = SwKeyState::KeyToView;
2311 bNormalChar =
false;
2312 eKeyState = SwKeyState::End;
2322 SwKeyState::PrevObject : SwKeyState::NextObject;
2338 eKeyState = SwKeyState::GoIntoFly;
2346 bNormalChar =
false;
2347 eKeyState = SwKeyState::End;
2357 case SwKeyState::EnterCharCell:
2359 eKeyState = SwKeyState::KeyToView;
2364 eKeyState = SwKeyState::End;
2369 eKeyState = SwKeyState::End;
2376 case SwKeyState::KeyToView:
2378 eKeyState = SwKeyState::End;
2390 if( !
m_aInBuffer.isEmpty() && ( !bNormalChar || bIsDocReadOnly ))
2398 eKeyState = SwKeyState::End;
2402 bFlushBuffer =
true;
2403 bNormalChar =
false;
2413 if( !bIsDocReadOnly && bNormalChar )
2420 bool bTextBox =
false;
2427 if (bDrawObject && !bTextBox)
2434 pSwDrawTextShell->Init();
2442 m_rView.AttrChangedNotify(
nullptr);
2445 eKeyState = SwKeyState::InsChar;
2449 bNormalChar =
false;
2450 Window::KeyInput( aKeyEvent );
2455 case SwKeyState::LaunchOLEObject:
2458 eKeyState = SwKeyState::End;
2461 case SwKeyState::GoIntoFly:
2465 m_rView.AttrChangedNotify(
nullptr);
2467 eKeyState = SwKeyState::End;
2470 case SwKeyState::GoIntoDrawing:
2474 SdrObject* pObj = pMark->GetMarkedSdrObj();
2479 pSwDrawTextShell->Init();
2482 eKeyState = SwKeyState::End;
2485 case SwKeyState::EnterDrawHandleMode:
2490 const_cast<SdrHdlList&
>(rHdlList).TravelFocusHdl(bForward);
2491 eKeyState = SwKeyState::End;
2494 case SwKeyState::InsTab:
2498 Window::KeyInput( aKeyEvent );
2499 eKeyState = SwKeyState::End;
2504 case SwKeyState::InsChar:
2515 auto pTextContentControl = static_txtattr_cast<SwTextContentControl*>(pAttr);
2517 std::shared_ptr<SwContentControl> pContentControl = rFormatContentControl.
GetContentControl();
2518 if (pContentControl->IsInteractingCharacter(aCh))
2521 eKeyState = SwKeyState::End;
2533 OSL_ENSURE(pFieldmark,
2534 "Where is my FieldMark??");
2538 OSL_ENSURE(pFieldmark->IsExpanded(),
2539 "where is the otherpos?");
2540 if (pFieldmark->IsExpanded())
2545 eKeyState = SwKeyState::End;
2550 const bool bIsNormalChar =
2552 if( bAppendSpace && bIsNormalChar &&
2564 (
'*' == aCh ||
'_' == aCh ) ) ||
2565 ( pACorr->
IsAutoCorrFlag( ACFlags::ChgQuotes ) && (
'\"' == aCh ))||
2566 ( pACorr->
IsAutoCorrFlag( ACFlags::ChgSglQuotes ) && (
'\'' == aCh))))
2570 if(
'\"' != aCh &&
'\'' != aCh )
2575 pACorr->
IsAutoCorrFlag( ACFlags::CapitalStartSentence | ACFlags::CapitalStartWord |
2576 ACFlags::ChgOrdinalNumber | ACFlags::AddNonBrkSpace |
2577 ACFlags::ChgToEnEmDash | ACFlags::SetINetAttr |
2578 ACFlags::Autocorrect | ACFlags::TransliterateRTL |
2579 ACFlags::SetDOIAttr ) &&
2580 '\"' != aCh &&
'\'' != aCh &&
'*' != aCh &&
'_' != aCh
2593 bFlushBuffer = !delayFlush;
2597 keyInputFlushTimerStop.dismiss();
2602 eKeyState = SwKeyState::End;
2607 eKeyState = SwKeyState::End;
2611 case SwKeyState::CheckAutoCorrect:
2614 pACorr->
IsAutoCorrFlag( ACFlags::CapitalStartSentence | ACFlags::CapitalStartWord |
2615 ACFlags::ChgOrdinalNumber | ACFlags::TransliterateRTL |
2616 ACFlags::ChgToEnEmDash | ACFlags::SetINetAttr |
2617 ACFlags::Autocorrect | ACFlags::SetDOIAttr ) &&
2623 eKeyState = eNextKeyState;
2629 sal_uInt16 nSlotId = 0;
2633 case SwKeyState::SpecialInsert:
2637 case SwKeyState::NoNum:
2641 case SwKeyState::NumOff:
2645 case SwKeyState::OutlineLvOff:
2648 case SwKeyState::NumDown:
2652 case SwKeyState::NumUp:
2656 case SwKeyState::NumIndentInc:
2661 case SwKeyState::GotoNextFieldMark:
2667 case SwKeyState::GotoPrevFieldMark:
2673 case SwKeyState::NumIndentDec:
2677 case SwKeyState::OutlineDown:
2680 case SwKeyState::OutlineUp:
2684 case SwKeyState::NextCell:
2689 case SwKeyState::PrevCell:
2693 case SwKeyState::AutoFormatByInput:
2697 case SwKeyState::NextObject:
2698 case SwKeyState::PrevObject:
2707 m_rView.AttrChangedNotify(
nullptr);
2713 case SwKeyState::GlossaryExpand:
2718 OUString sFnd(aTmpQHD.
CurStr());
2736 sFnd = sFnd.copy(aTmpQHD.
CurLen());
2745 case SwKeyState::NextPrevGlossary:
2750 case SwKeyState::EditFormula:
2752 const sal_uInt16
nId = SwInputChild::GetChildWindowId();
2757 GetChildWindow(
nId ));
2778 case SwKeyState::Fly_Change:
2788 case SwKeyState::Draw_Change :
2799 eKeyState = SwKeyState::End;
2817 const bool bAutoTextShown
2859 const bool bOnlyText,
bool bLockView )
2864 int nTmpSetCursor = 0;
2915 pWindow->MouseButtonDown(aMEvt);
2929 if( bExecFormatPaintbrush )
2940 bool bOverFly =
false;
2941 bool bPageAnchored =
false;
2945 if (bOverHeaderFooterFly && (!bIsDocReadOnly && rSh.
GetCurField()))
2947 bOverHeaderFooterFly =
false;
2957 bool bActive =
true;
3050 rSh.
Chain( *pFormat, aDocPos );
3059 bool bCallBase =
true;
3093 if ( SwTab::SEL_HORI <= nMouseTabCol && SwTab::COLSEL_VERT >= nMouseTabCol )
3168 bool bOnlyText =
false;
3186 if( !bIsDocReadOnly &&
3189 nullptr != ( pHdl = pSdrView->
PickHandle(aDocPos) ) &&
3190 ( pHdl->
GetKind() == SdrHdlKind::Anchor ||
3191 pHdl->
GetKind() == SdrHdlKind::Anchor_TR ) )
3217 bool bHitHandle = pHdl && pHdl->
GetKind() != SdrHdlKind::Anchor &&
3218 pHdl->
GetKind() != SdrHdlKind::Anchor_TR;
3243 if ( !bExecHyperlinks )
3248 bExecHyperlinks =
true;
3253 if (0 == nNumberOfClicks && 0 < aMEvt.
GetClicks())
3254 nNumberOfClicks = 4;
3256 bool bExecDrawTextLink =
false;
3267 if (1 == nNumberOfClicks)
3274 if (bExecHyperlinks && pSdrView)
3277 pSdrView->
PickAnything(aMEvt, SdrMouseEventKind::BUTTONDOWN, aVEvt);
3279 if (aVEvt.
meEvent == SdrEventKind::ExecuteUrl)
3280 bExecDrawTextLink =
true;
3284 if (1 == nNumberOfClicks && !bExecDrawTextLink)
3319 m_rView.AttrChangedNotify(
nullptr);
3345 ( pHdl->
GetKind() == SdrHdlKind::Anchor ||
3346 pHdl->
GetKind() == SdrHdlKind::Anchor_TR ) )
3364 m_rView.AttrChangedNotify(
nullptr);
3367 bool bSelObj = rSh.
SelectObj( aDocPos, nFlag );
3377 m_rView.AttrChangedNotify(
nullptr);
3393 m_rView.AttrChangedNotify(
nullptr);
3402 switch ( nNumberOfClicks )
3427 SfxCallMode::RECORD|SfxCallMode::SLOT);
3443 SfxCallMode::RECORD|SfxCallMode::SLOT);
3451 pSwDrawTextShell->Init();
3466 if( !bIsDocReadOnly &&
3528 IFieldmark *pFieldBM =
const_cast< IFieldmark*
> ( aContentAtPos.
aFnd.
pFieldmark );
3542 const OUString sToxText = aToxContentAtPos.
sStr;
3543 if (!sToxText.isEmpty() && aToxContentAtPos.
pFndTextAttr)
3581 if ( 3 == nNumberOfClicks )
3635 if ( !bExecDrawTextLink )
3709 if (nNumberOfClicks == 2)
3717 SfxCallMode::RECORD | SfxCallMode::SLOT);
3731 if (rMarkList.
GetMark(0) ==
nullptr)
3734 m_rView.AttrChangedNotify(
nullptr);
3778 m_rView.AttrChangedNotify(
nullptr);
3791 if( bExecHyperlinks )
3837 bool bEditableFieldClicked =
false;
3842 bool bEditableField = (aFieldAtPos.
pFndTextAttr !=
nullptr
3845 if (!bEditableField)
3864 bEditableFieldClicked =
true;
3869 bool bOverURLGrf =
false;
3871 bOverURLGrf = bOverSelect =
nullptr != rSh.
IsURLGrfAtPos( aDocPos );
3875 MoveCursor( rSh, aDocPos, bOnlyText, bLockView );
3878 if (!bOverURLGrf && !bExecDrawTextLink && !bOnlyText)
3892 if ( !bOverSelect && bEditableFieldClicked && (!pCursorField ||
3951 Window::MouseButtonDown(aMEvt);
3963 bool bChkTableSel =
false;
3965 switch ( nMouseTabCol )
3969 nPointer = PointerStyle::VSizeBar;
3970 bChkTableSel =
true;
3974 nPointer = PointerStyle::HSizeBar;
3975 bChkTableSel =
true;
3979 nPointer = PointerStyle::TabSelectSE;
3983 nPointer = PointerStyle::TabSelectSW;
3987 nPointer = PointerStyle::TabSelectS;
3990 nPointer = PointerStyle::TabSelectE;
3994 nPointer = PointerStyle::TabSelectW;
3999 if ( PointerStyle::Null != nPointer &&
4015 ? PointerStyle::VSizeBar
4016 : PointerStyle::HSizeBar;
4032 pWindow->MouseMove(rMEvt);
4041 if( bExecFormatPaintbrush )
4178 Point aPos( aDocPt );
4201 Point aTmp( aDocPt );
4213 if(aRelPos.
X() >= 0)
4217 const SfxPointItem aTmp1( SID_ATTR_POSITION, aRelPos );
4225 const SvxStatusItem aCell( SID_TABLE_CELL, OUString(), StatusCategory::NONE );
4236 bool bDelShadCursor =
true;
4256 if( pSdrView && (
nullptr!=( pHdl = pSdrView->
PickHandle( aOld ) )||
4258 ( pHdl->
GetKind() == SdrHdlKind::Anchor ||
4259 pHdl->
GetKind() == SdrHdlKind::Anchor_TR ) )
4262 if( aNew.
X() || aNew.
Y() )
4329 ? SvMacroItemId::SwFrmMove
4330 : SvMacroItemId::SwFrmResize;
4332 if (
nullptr != pFlyFormat)
4334 if (
nullptr != pMacro &&
4339 sal_uInt32
nPos = 0;
4342 xVar->PutString( pFlyFormat->
GetName() );
4343 xArgs->Put(xVar.
get(), ++
nPos);
4345 if( SvMacroItemId::SwFrmResize == nEvent )
4348 xVar->PutUShort(
static_cast< sal_uInt16
>(
g_eSdrMoveHdl) );
4349 xArgs->Put(xVar.
get(), ++
nPos);
4353 xVar->PutLong( aDocPt.
X() - aSttPt.
X() );
4354 xArgs->Put(xVar.
get(), ++
nPos);
4356 xVar->PutLong( aDocPt.
Y() - aSttPt.
Y() );
4357 xArgs->Put(xVar.
get(), ++
nPos);
4367 if( !sRet.isEmpty() && sRet.toInt32()!=0 )
4373 if( bIsDocReadOnly )
4387 bResizeKeepRatio = bResizeKeepRatio && pHdl->
IsCornerHdl();
4395 pSdrView->
SetOrtho(!bResizeKeepRatio);
4403 pSdrView->
SetOrtho(bResizeKeepRatio);
4412 else if( bIsDocReadOnly )
4417 Point aTmp( aDocPt );
4438 Point aTmp( aDocPt );
4450 rSh.
Drag( &aDocPt,
false );
4488 bool bTstShdwCursor =
true;
4498 const void* pTmp = pINet;
4503 bTstShdwCursor =
false;
4520 rSh.
CallEvent( SvMacroItemId::OnMouseOut,
4521 aLastCallEvent,
true );
4523 if( !rSh.
CallEvent( SvMacroItemId::OnMouseOver,
4528 else if( aLastCallEvent.
HasEvent() )
4531 rSh.
CallEvent( SvMacroItemId::OnMouseOut,
4532 aLastCallEvent,
true );
4535 if( bTstShdwCursor && bInsWin && !bIsDocReadOnly &&
4549 if( text::HoriOrientation::RIGHT !=
m_eOrient && text::HoriOrientation::CENTER !=
m_eOrient )
4550 m_eOrient = text::HoriOrientation::LEFT;
4552 bDelShadCursor =
false;
4560 rSh.
Drag( &aDocPt,
false );
4583 pWindow->MouseButtonUp(rMEvt);
4588 bool bCallBase =
true;
4639 rSh.
EndDrag( &aDocPt,
false );
4662 pSdrView->
MarkObj(pShape, pPV);
4680 if( aPnt.
X() || aPnt.
Y() )
4718 m_rView.AttrChangedNotify(
nullptr);
4728 bool bPopMode =
false;
4737 m_rView.AttrChangedNotify(
nullptr);
4760 Point aEndPt, aSttPt;
4771 if ( aSttPt != aEndPt )
4774 rSh.
Copy(rSh, aSttPt, aEndPt);
4779 rSh.
EndDrag( &aDocPt,
false );
4789 ? SvMacroItemId::SwFrmMove
4790 : SvMacroItemId::SwFrmResize;
4792 if (
nullptr != pFlyFormat)
4794 if (
nullptr != pMacro)
4798 sal_uInt32
nPos = 0;
4801 xVar->PutString( pFlyFormat->
GetName() );
4802 xArgs->Put(xVar.
get(), ++
nPos);
4804 if( SvMacroItemId::SwFrmResize == nEvent )
4807 xVar->PutUShort(
static_cast< sal_uInt16
>(eOldSdrMoveHdl) );
4808 xArgs->Put(xVar.
get(), ++
nPos);
4812 xVar->PutLong( aDocPt.
X() - aSttPt.
X() );
4813 xArgs->Put(xVar.
get(), ++
nPos);
4815 xVar->PutLong( aDocPt.
Y() - aSttPt.
Y() );
4816 xArgs->Put(xVar.
get(), ++
nPos);
4819 xVar->PutUShort( 1 );
4820 xArgs->Put(xVar.
get(), ++
nPos);
4846 = static_txtattr_cast<SwTextContentControl*>(pAttr);
4855 rSh.
EndDrag( &aDocPt,
false );
4867 rSh.
EndDrag( &aDocPt,
false );