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>
61#include <editeng/editeng.hxx>
99#include <inputwin.hxx>
152#include <strings.hrc>
195 SdrObject* pTextBox = pTextBoxFormat->FindRealSdrObject();
240 aHitTestPos +=
Point( -1, 1 );
244 aHitTestPos +=
Point( 1, 1 );
259 static constexpr sal_uInt16
nNoPos = std::numeric_limits<sal_uInt16>::max();
308static bool IsMinMove(
const Point &rStartPos,
const Point &rLPt)
351 eStyle = PointerStyle::NotAllowed;
359 bool bFrameIsValidTarget =
false;
363 bFrameIsValidTarget = (
m_pApplyTempl->eType == SfxStyleFamily::Frame );
365 if( bFrameIsValidTarget &&
382 rSh.SwCursorShell::SetVisibleCursor( rLPt );
398 ? PointerStyle::ChainNotAllowed : PointerStyle::Chain;
418 if ( !bExecHyperlinks )
421 if ( ( bSecureOption && nModifier ==
KEY_MOD1 ) ||
422 ( !bSecureOption && nModifier !=
KEY_MOD1 ) )
423 bExecHyperlinks =
true;
426 const bool bExecSmarttags = nModifier ==
KEY_MOD1;
429 bool bPrefSdrPointer =
false;
430 bool bHitHandle =
false;
431 bool bCntAtPos =
false;
438 else if ( (bHitHandle = (pSdrView->
PickHandle(rLPt) !=
nullptr)) )
441 bPrefSdrPointer =
true;
450 eStyle = PointerStyle::Arrow;
452 bPrefSdrPointer =
true;
458 SdrObject* pObj = (bNotInSelObj && bExecHyperlinks) ?
479 bPrefSdrPointer =
true;
486 if (eHit == SdrHitKind::UrlField && bExecHyperlinks)
489 bPrefSdrPointer =
true;
505 eStyle = bMovable ? PointerStyle::Move : PointerStyle::Arrow;
523 eStyle = PointerStyle::NotAllowed;
525 eStyle = PointerStyle::Move;
531 bPrefSdrPointer =
true;
539 if ( bPrefSdrPointer )
554 eStyle = PointerStyle::Arrow;
576 eStyle = PointerStyle::RefHand;
582 if( !bClickToFollow ||
585 eStyle = PointerStyle::RefHand;
588 else if (
GetView().GetWrtShell().GetViewOptions()->IsShowOutlineContentVisibilityButton())
597 eStyle = PointerStyle::RefHand;
607 OUString sQuickHelp(
SwResId(STR_CLICK_OUTLINE_CONTENT_TOGGLE_VISIBILITY));
609 &&
nPos + 1 < nOutlineNodesCount
611 sQuickHelp +=
" (" +
SwResId(STR_CLICK_OUTLINE_CONTENT_TOGGLE_VISIBILITY_EXT) +
")";
623 eStyle = PointerStyle::TextVertical;
628 eStyle = PointerStyle::ShowWhitespace;
630 eStyle = PointerStyle::HideWhitespace;
643 Point aModPt( m_aMovePos );
651 const int nMaxScroll = 40;
657 rSh.
Drag(&aModPt,
false);
665 if ( m_xRowColumnSelectionStart )
667 Point aPos( aModPt );
680 if( aModPt.Y() < ( rVisArea.
Top() + rVisArea.
Height() / 2 ) )
772 uno::Reference < i18n::XBreakIterator > xBI = pBreakIter->
GetBreakIter();
776 if (xBI->getScriptType( rText, 0 ) == i18n::ScriptType::COMPLEX)
779 nCTLScriptPos = xBI->nextScript( rText, 0, i18n::ScriptType::COMPLEX );
781 return (0 <= nCTLScriptPos && nCTLScriptPos <= rText.getLength());
787 const OUString &rInBuffer)
808 default: bLang =
false;
815 if(SfxItemState::DEFAULT <= aLangSet.
GetItemState(nWhich))
818 if ( eLang == eBufferLanguage )
849 i18n::UnicodeScript
eType = !rInBuffer.isEmpty() ?
851 i18n::UnicodeScript_kScriptCount;
853 bool bSystemIsNonLatin =
false;
856 case i18n::UnicodeScript_kGreek:
857 case i18n::UnicodeScript_kCyrillic:
860 bSystemIsNonLatin =
true;
868 bLang = (bSystemIsNonLatin != bOOoLangIsNonLatin);
893 uno::Reference < i18n::XExtendedInputSequenceChecker > xISC =
pCheckIt->
xCheck;
909 const sal_Int32 nOldLen = aOldText.getLength();
913 sal_Int32 nExpandSelection = 0;
916 sal_Int32 nTmpPos = nOldLen;
918 i18n::InputSequenceCheckMode::STRICT : i18n::InputSequenceCheckMode::BASIC;
920 OUString aNewText( aOldText );
923 for( sal_Int32 k = 0; k <
m_aInBuffer.getLength(); ++k)
926 const sal_Int32 nPrevPos =xISC->correctInputSequence( aNewText, nTmpPos - 1, cChar, nCheckMode );
929 if (nPrevPos != aNewText.getLength())
930 nTmpPos = nPrevPos + 1;
934 sal_Int32 nNewLen = aNewText.getLength();
937 sal_Int32 nChgPos = 0;
938 while ( nChgPos < nOldLen && nChgPos < nNewLen &&
939 pOldText[nChgPos] == pNewText[nChgPos] )
942 const sal_Int32 nChgLen = nNewLen - nChgPos;
946 nExpandSelection = nOldLen - nChgPos;
953 for( sal_Int32 k = 0; k <
m_aInBuffer.getLength(); ++k )
956 if (xISC->checkInputSequence( aNewText, nTmpPos - 1, cChar, nCheckMode ))
959 aNewText += OUStringChar( cChar );
963 m_aInBuffer = aNewText.copy( aOldText.getLength() );
978 OSL_ENSURE( nCursorStartPos >= nExpandSelection,
"cannot expand selection as specified!!" );
979 if (nExpandSelection && nCursorStartPos >= nExpandSelection)
987 uno::Reference< frame::XDispatchRecorder > xRecorder =
989 if ( xRecorder.is() )
1014#define MOVE_LEFT_SMALL 0
1015#define MOVE_UP_SMALL 1
1016#define MOVE_RIGHT_BIG 2
1017#define MOVE_DOWN_BIG 3
1018#define MOVE_LEFT_BIG 4
1019#define MOVE_UP_BIG 5
1020#define MOVE_RIGHT_SMALL 6
1021#define MOVE_DOWN_SMALL 7
1024#define MOVE_LEFT_HUGE 8
1025#define MOVE_UP_HUGE 9
1026#define MOVE_RIGHT_HUGE 10
1027#define MOVE_DOWN_HUGE 11
1082 const bool bFollowTextFlow =
1087 pToCharContentPos, bFollowTextFlow,
1088 false, &aRefPoint );
1110 nRight = aSnap.
Width();
1125 default: OSL_ENSURE(
true,
"ChangeFly: Unknown direction." );
1128 if ((RndStdIds::FLY_AS_CHAR == eAnchorId) && ( nDir % 2 ))
1133 else if ( aDiff < -aTmp.
Height() )
1140 bool bDown = 0 != ( nDir & 0x02 );
1143 case text::VertOrientation::CHAR_TOP:
1144 if( bDown ) eNew = text::VertOrientation::CENTER;
1146 case text::VertOrientation::CENTER:
1147 eNew = bDown ? text::VertOrientation::TOP : text::VertOrientation::CHAR_TOP;
1149 case text::VertOrientation::TOP:
1150 if( !bDown ) eNew = text::VertOrientation::CENTER;
1152 case text::VertOrientation::LINE_TOP:
1153 if( bDown ) eNew = text::VertOrientation::LINE_CENTER;
1155 case text::VertOrientation::LINE_CENTER:
1156 eNew = bDown ? text::VertOrientation::LINE_BOTTOM : text::VertOrientation::LINE_TOP;
1158 case text::VertOrientation::LINE_BOTTOM:
1159 if( !bDown ) eNew = text::VertOrientation::LINE_CENTER;
1173 if (bWeb && (RndStdIds::FLY_AT_PARA == eAnchorId)
1181 case text::HoriOrientation::RIGHT:
1183 eNew = text::HoriOrientation::LEFT;
1185 case text::HoriOrientation::LEFT:
1187 eNew = text::HoriOrientation::RIGHT;
1201 bool bSetPos = (RndStdIds::FLY_AS_CHAR != eAnchorId);
1204 bSetPos = RndStdIds::FLY_AT_PAGE == eAnchorId;
1221 const bool bOnePixel(
1259 if(0 != nX || 0 != nY)
1280 nX *= aSnap.
Width();
1294 bool bDummy1, bDummy2;
1295 const bool bVertAnchor = rSh.
IsFrameVertical(
true, bDummy1, bDummy2 );
1296 bool bHoriMove = !bVertAnchor == !( nDir % 2 );
1298 !bHoriMove || (rSh.
GetAnchorId() != RndStdIds::FLY_AS_CHAR);
1311 if( SdrHdlKind::Anchor == pHdl->
GetKind() ||
1312 SdrHdlKind::Anchor_TR == pHdl->
GetKind() )
1327 pSdrView->
BegDragObj(aStartPoint,
nullptr, pHdl, 0);
1331 bool bWasNoSnap = rDragStat.
IsNoSnap();
1346 const_cast<SdrDragStat&
>(rDragStat).SetNoSnap(bWasNoSnap);
1370 pWindow->KeyInput(rKEvt);
1436 bool bFlushBuffer =
false;
1437 bool bNormalChar =
false;
1474 if( ( bVertText && ( !bTableCursor || bVertTable ) ) ||
1475 ( bTableCursor && bVertTable ) )
1478 if (eDirection == SvxFrameDirection::Vertical_LR_BT)
1533 nEvent = SvMacroItemId::SwFrmKeyInputAlpha;
1535 nEvent = SvMacroItemId::SwFrmKeyInputNoAlpha;
1542 xVar->PutString( pFlyFormat->
GetName() );
1543 xArgs->Put(xVar.
get(), 1);
1546 if( SvMacroItemId::SwFrmKeyInputAlpha == nEvent )
1547 xVar->PutChar( aCh );
1550 xArgs->Put(xVar.
get(), 2);
1554 if( !sRet.isEmpty() && sRet.toInt32()!=0 )
1570 pAnchor = rHdlList.
GetHdl(SdrHdlKind::Anchor_TR);
1579 uno::Reference< frame::XDispatchRecorder > xRecorder =
1581 if ( !xRecorder.is() )
1589 OUString sFormulaEntry;
1591 enum class SwKeyState { CheckKey, InsChar, InsTab,
1592 NoNum, NumOff, NumOrNoNum, NumDown, NumUp,
1593 NumIndentInc, NumIndentDec,
1596 NextCell, PrevCell, OutlineUp, OutlineDown,
1597 GlossaryExpand, NextPrevGlossary,
1601 LaunchOLEObject, GoIntoFly, GoIntoDrawing,
1602 EnterDrawHandleMode,
1603 CheckDocReadOnlyKeys,
1604 CheckAutoCorrect, EditFormula,
1605 ColLeftBig, ColRightBig,
1606 ColLeftSmall, ColRightSmall,
1609 CellLeftBig, CellRightBig,
1610 CellLeftSmall, CellRightSmall,
1611 CellTopBig, CellBottomBig,
1612 CellTopSmall, CellBottomSmall,
1614 Fly_Change, Draw_Change,
1621 SwKeyState eKeyState = bIsDocReadOnly ? SwKeyState::CheckDocReadOnlyKeys : SwKeyState::CheckKey;
1622 SwKeyState eNextKeyState = SwKeyState::End;
1631 while( SwKeyState::End != eKeyState )
1633 SwKeyState eFlyState = SwKeyState::KeyToView;
1637 case SwKeyState::CheckKey:
1638 eKeyState = SwKeyState::KeyToView;
1641 !rKeyCode.
IsMod2() &&
'=' == aCh &&
1656 eKeyState = SwKeyState::EditFormula;
1664 sFormulaEntry =
"=";
1676 eKeyState = SwKeyState::GlossaryExpand;
1683 eKeyState = SwKeyState::ColRightBig;
1684 eFlyState = SwKeyState::Fly_Change;
1686 goto KEYINPUT_CHECKTABLE;
1689 eKeyState = SwKeyState::ColRightSmall;
1690 eFlyState = SwKeyState::Fly_Change;
1692 goto KEYINPUT_CHECKTABLE;
1695 eKeyState = SwKeyState::ColLeftSmall;
1696 goto KEYINPUT_CHECKTABLE;
1699 eKeyState = SwKeyState::ColLeftBig;
1700 goto KEYINPUT_CHECKTABLE;
1703 eKeyState = SwKeyState::CellRightBig;
1704 goto KEYINPUT_CHECKTABLE;
1707 eKeyState = SwKeyState::CellRightSmall;
1708 goto KEYINPUT_CHECKTABLE;
1711 eKeyState = SwKeyState::CellLeftSmall;
1712 goto KEYINPUT_CHECKTABLE;
1715 eKeyState = SwKeyState::CellLeftBig;
1716 goto KEYINPUT_CHECKTABLE;
1719 eKeyState = SwKeyState::ColBottomSmall;
1720 eFlyState = SwKeyState::Fly_Change;
1722 goto KEYINPUT_CHECKTABLE;
1725 eKeyState = SwKeyState::ColBottomBig;
1726 eFlyState = SwKeyState::Fly_Change;
1728 goto KEYINPUT_CHECKTABLE;
1731 eKeyState = SwKeyState::CellBottomSmall;
1732 goto KEYINPUT_CHECKTABLE;
1735 eKeyState = SwKeyState::CellBottomBig;
1736 goto KEYINPUT_CHECKTABLE;
1739 eKeyState = SwKeyState::CellTopBig;
1740 goto KEYINPUT_CHECKTABLE;
1743 eKeyState = SwKeyState::CellTopSmall;
1744 goto KEYINPUT_CHECKTABLE;
1752 ! (Window::GetIndicatorState() & KeyIndicatorState::CAPSLOCK)
1756 bFlushBuffer =
true;
1757 bNormalChar =
false;
1758 eKeyState = SwKeyState::End;
1764 if(!pFlyFormat && SwKeyState::KeyToView != eFlyState &&
1767 eKeyState = SwKeyState::Draw_Change;
1770 eKeyState = eFlyState;
1771 else if( SwKeyState::Draw_Change != eKeyState)
1772 eKeyState = SwKeyState::EnterCharCell;
1788 eKeyState = pFlyFormat ? SwKeyState::Fly_Change : SwKeyState::Draw_Change;
1792 eKeyState = SwKeyState::Draw_Change;
1811 eFlyState = SwKeyState::Fly_Change;
1814 goto KEYINPUT_CHECKTABLE_INSDEL;
1818 goto KEYINPUT_CHECKTABLE_INSDEL;
1826 eFlyState = SwKeyState::Fly_Change;
1829 goto KEYINPUT_CHECKTABLE_INSDEL;
1837 eFlyState = SwKeyState::Fly_Change;
1840 goto KEYINPUT_CHECKTABLE_INSDEL;
1843KEYINPUT_CHECKTABLE_INSDEL:
1848 eKeyState = SwKeyState::KeyToView;
1849 if(SwKeyState::KeyToView != eFlyState)
1853 eKeyState = SwKeyState::Draw_Change;
1855 eKeyState = SwKeyState::Fly_Change;
1865 eKeyState = SwKeyState::NumOrNoNum;
1870 std::unique_ptr<weld::MessageDialog> xInfo(xBuilder->weld_message_dialog(
"InfoReadonlyDialog"));
1872 eKeyState = SwKeyState::End;
1884 eKeyState = SwKeyState::LaunchOLEObject;
1886 eKeyState = SwKeyState::GoIntoFly;
1891 eKeyState = SwKeyState::GoIntoDrawing;
1893 eKeyState = SwKeyState::GoIntoFly;
1897 eKeyState = SwKeyState::GlossaryExpand;
1906 eKeyState = SwKeyState::NumOff;
1907 eNextKeyState = SwKeyState::OutlineLvOff;
1916 eKeyState = SwKeyState::AutoFormatByInput;
1920 eNextKeyState = eKeyState;
1921 eKeyState = SwKeyState::CheckAutoCorrect;
1933 eKeyState = SwKeyState::NoNum;
1936 eKeyState = SwKeyState::SpecialInsert;
1955 || ( rSh.
IsNoNum() && bOnlyBackspaceKey ) ) )
1961 eKeyState = SwKeyState::End;
1969 eKeyState = SwKeyState::NumUp;
1975 eKeyState = SwKeyState::NumIndentDec;
1994 bool bCallNumOrNoNum(
false );
1995 if ( bOnlyBackspaceKey && !rSh.
IsNoNum() )
1997 bCallNumOrNoNum =
true;
1999 else if ( !bOnlyBackspaceKey && rSh.
IsNoNum() )
2001 bCallNumOrNoNum =
true;
2003 else if ( bOnlyBackspaceKey
2009 if ( pCurrNumRule !=
nullptr
2012 bCallNumOrNoNum =
true;
2015 if ( bCallNumOrNoNum
2018 eKeyState = SwKeyState::NumOrNoNum;
2026 std::unique_ptr<weld::MessageDialog> xInfo(xBuilder->weld_message_dialog(
"InfoReadonlyDialog"));
2028 eKeyState = SwKeyState::End;
2034 eFlyState = SwKeyState::Fly_Change;
2036 goto KEYINPUT_CHECKTABLE_INSDEL;
2043 eKeyState = SwKeyState::GotoNextFieldMark;
2048 eKeyState = SwKeyState::End;
2056 eKeyState = SwKeyState::NumDown;
2060 eKeyState = SwKeyState::InsTab;
2070 eKeyState = SwKeyState::NextObject;
2075 eKeyState = SwKeyState::NextCell;
2078 eKeyState = SwKeyState::CheckAutoCorrect;
2079 eNextKeyState = SwKeyState::NextCell;
2084 eKeyState = SwKeyState::InsTab;
2092 eKeyState = SwKeyState::OutlineDown;
2101 eKeyState = SwKeyState::GotoPrevFieldMark;
2106 eKeyState = SwKeyState::End;
2112 eKeyState = SwKeyState::NumUp;
2121 eKeyState = SwKeyState::PrevObject;
2126 eKeyState = SwKeyState::PrevCell;
2129 eKeyState = SwKeyState::CheckAutoCorrect;
2130 eNextKeyState = SwKeyState::PrevCell;
2135 eKeyState = SwKeyState::End;
2142 eKeyState = SwKeyState::OutlineUp;
2154 aTmpQHD.
Next( pACorr &&
2156 eKeyState = SwKeyState::NextPrevGlossary;
2159 eKeyState = SwKeyState::InsTab;
2164 eKeyState = SwKeyState::EnterDrawHandleMode;
2169 eKeyState = SwKeyState::NumIndentInc;
2182 eKeyState = SwKeyState::NextPrevGlossary;
2188 eKeyState = SwKeyState::EnterDrawHandleMode;
2194 eKeyState = SwKeyState::NumIndentDec;
2203 eKeyState = SwKeyState::GoIntoFly;
2206 eKeyState = SwKeyState::GoIntoDrawing;
2208 eKeyState = SwKeyState::GoIntoFly;
2215 case SwKeyState::CheckDocReadOnlyKeys:
2217 eKeyState = SwKeyState::KeyToView;
2222 bNormalChar =
false;
2223 eKeyState = SwKeyState::End;
2233 SwKeyState::PrevObject : SwKeyState::NextObject;
2249 eKeyState = SwKeyState::GoIntoFly;
2257 bNormalChar =
false;
2258 eKeyState = SwKeyState::End;
2268 case SwKeyState::EnterCharCell:
2270 eKeyState = SwKeyState::KeyToView;
2275 eKeyState = SwKeyState::End;
2280 eKeyState = SwKeyState::End;
2287 case SwKeyState::KeyToView:
2289 eKeyState = SwKeyState::End;
2301 if( !
m_aInBuffer.isEmpty() && ( !bNormalChar || bIsDocReadOnly ))
2308 auto xInfo(std::make_shared<weld::GenericDialogController>(
GetFrameWeld(),
"modules/swriter/ui/inforeadonlydialog.ui",
"InfoReadonlyDialog"));
2310 eKeyState = SwKeyState::End;
2314 bFlushBuffer =
true;
2315 bNormalChar =
false;
2325 if( !bIsDocReadOnly && bNormalChar )
2332 bool bTextBox =
false;
2339 if (bDrawObject && !bTextBox)
2346 pSwDrawTextShell->Init();
2354 m_rView.AttrChangedNotify(
nullptr);
2357 eKeyState = SwKeyState::InsChar;
2361 bNormalChar =
false;
2362 Window::KeyInput( aKeyEvent );
2367 case SwKeyState::LaunchOLEObject:
2370 eKeyState = SwKeyState::End;
2373 case SwKeyState::GoIntoFly:
2377 m_rView.AttrChangedNotify(
nullptr);
2379 eKeyState = SwKeyState::End;
2382 case SwKeyState::GoIntoDrawing:
2386 SdrObject* pObj = pMark->GetMarkedSdrObj();
2391 pSwDrawTextShell->Init();
2394 eKeyState = SwKeyState::End;
2397 case SwKeyState::EnterDrawHandleMode:
2402 const_cast<SdrHdlList&
>(rHdlList).TravelFocusHdl(bForward);
2403 eKeyState = SwKeyState::End;
2406 case SwKeyState::InsTab:
2410 Window::KeyInput( aKeyEvent );
2411 eKeyState = SwKeyState::End;
2416 case SwKeyState::InsChar:
2422 OSL_ENSURE(pFieldmark,
2423 "Where is my FieldMark??");
2428 "where is the otherpos?");
2434 eKeyState = SwKeyState::End;
2439 const bool bIsNormalChar =
2441 if( bAppendSpace && bIsNormalChar &&
2453 (
'*' == aCh ||
'_' == aCh ) ) ||
2454 ( pACorr->
IsAutoCorrFlag( ACFlags::ChgQuotes ) && (
'\"' == aCh ))||
2455 ( pACorr->
IsAutoCorrFlag( ACFlags::ChgSglQuotes ) && (
'\'' == aCh))))
2459 if(
'\"' != aCh &&
'\'' != aCh )
2464 pACorr->
IsAutoCorrFlag( ACFlags::CapitalStartSentence | ACFlags::CapitalStartWord |
2465 ACFlags::ChgOrdinalNumber | ACFlags::AddNonBrkSpace |
2466 ACFlags::ChgToEnEmDash | ACFlags::SetINetAttr |
2467 ACFlags::Autocorrect | ACFlags::TransliterateRTL ) &&
2468 '\"' != aCh &&
'\'' != aCh &&
'*' != aCh &&
'_' != aCh
2481 bFlushBuffer = !delayFlush;
2485 keyInputFlushTimerStop.dismiss();
2490 eKeyState = SwKeyState::End;
2494 auto xInfo(std::make_shared<weld::GenericDialogController>(
GetFrameWeld(),
"modules/swriter/ui/inforeadonlydialog.ui",
"InfoReadonlyDialog"));
2496 eKeyState = SwKeyState::End;
2500 case SwKeyState::CheckAutoCorrect:
2503 pACorr->
IsAutoCorrFlag( ACFlags::CapitalStartSentence | ACFlags::CapitalStartWord |
2504 ACFlags::ChgOrdinalNumber | ACFlags::TransliterateRTL |
2505 ACFlags::ChgToEnEmDash | ACFlags::SetINetAttr |
2506 ACFlags::Autocorrect ) &&
2512 eKeyState = eNextKeyState;
2518 sal_uInt16 nSlotId = 0;
2522 case SwKeyState::SpecialInsert:
2526 case SwKeyState::NoNum:
2530 case SwKeyState::NumOff:
2534 case SwKeyState::OutlineLvOff:
2537 case SwKeyState::NumDown:
2541 case SwKeyState::NumUp:
2545 case SwKeyState::NumIndentInc:
2550 case SwKeyState::GotoNextFieldMark:
2557 case SwKeyState::GotoPrevFieldMark:
2565 case SwKeyState::NumIndentDec:
2569 case SwKeyState::OutlineDown:
2572 case SwKeyState::OutlineUp:
2576 case SwKeyState::NextCell:
2581 case SwKeyState::PrevCell:
2585 case SwKeyState::AutoFormatByInput:
2589 case SwKeyState::NextObject:
2590 case SwKeyState::PrevObject:
2599 m_rView.AttrChangedNotify(
nullptr);
2605 case SwKeyState::GlossaryExpand:
2610 OUString sFnd(aTmpQHD.
CurStr());
2628 sFnd = sFnd.copy(aTmpQHD.
CurLen());
2637 case SwKeyState::NextPrevGlossary:
2642 case SwKeyState::EditFormula:
2644 const sal_uInt16
nId = SwInputChild::GetChildWindowId();
2649 GetChildWindow(
nId ));
2670 case SwKeyState::Fly_Change:
2680 case SwKeyState::Draw_Change :
2691 eKeyState = SwKeyState::End;
2709 const bool bAutoTextShown
2751 const bool bOnlyText,
bool bLockView )
2756 int nTmpSetCursor = 0;
2807 pWindow->MouseButtonDown(aMEvt);
2821 if( bExecFormatPaintbrush )
2832 bool bOverFly =
false;
2833 bool bPageAnchored =
false;
2837 if (bOverHeaderFooterFly && (!bIsDocReadOnly && rSh.
GetCurField()))
2839 bOverHeaderFooterFly =
false;
2849 bool bActive =
true;
2952 rSh.
Chain( *pFormat, aDocPos );
2961 bool bCallBase =
true;
2995 if ( SwTab::SEL_HORI <= nMouseTabCol && SwTab::COLSEL_VERT >= nMouseTabCol )
3070 bool bOnlyText =
false;
3088 if( !bIsDocReadOnly &&
3091 nullptr != ( pHdl = pSdrView->
PickHandle(aDocPos) ) &&
3092 ( pHdl->
GetKind() == SdrHdlKind::Anchor ||
3093 pHdl->
GetKind() == SdrHdlKind::Anchor_TR ) )
3119 bool bHitHandle = pHdl && pHdl->
GetKind() != SdrHdlKind::Anchor &&
3120 pHdl->
GetKind() != SdrHdlKind::Anchor_TR;
3145 if ( !bExecHyperlinks )
3150 bExecHyperlinks =
true;
3155 if (0 == nNumberOfClicks && 0 < aMEvt.
GetClicks())
3156 nNumberOfClicks = 4;
3158 bool bExecDrawTextLink =
false;
3169 if (1 == nNumberOfClicks)
3176 if (bExecHyperlinks && pSdrView)
3179 pSdrView->
PickAnything(aMEvt, SdrMouseEventKind::BUTTONDOWN, aVEvt);
3181 if (aVEvt.
meEvent == SdrEventKind::ExecuteUrl)
3182 bExecDrawTextLink =
true;
3186 if (1 == nNumberOfClicks && !bExecDrawTextLink)
3221 m_rView.AttrChangedNotify(
nullptr);
3247 ( pHdl->
GetKind() == SdrHdlKind::Anchor ||
3248 pHdl->
GetKind() == SdrHdlKind::Anchor_TR ) )
3266 m_rView.AttrChangedNotify(
nullptr);
3269 bool bSelObj = rSh.
SelectObj( aDocPos, nFlag );
3279 m_rView.AttrChangedNotify(
nullptr);
3295 m_rView.AttrChangedNotify(
nullptr);
3304 switch ( nNumberOfClicks )
3329 SfxCallMode::RECORD|SfxCallMode::SLOT);
3345 SfxCallMode::RECORD|SfxCallMode::SLOT);
3353 pSwDrawTextShell->Init();
3368 if( !bIsDocReadOnly &&
3464 if ( 3 == nNumberOfClicks )
3518 if ( !bExecDrawTextLink )
3601 if (rMarkList.
GetMark(0) ==
nullptr)
3604 m_rView.AttrChangedNotify(
nullptr);
3634 m_rView.AttrChangedNotify(
nullptr);
3647 if( bExecHyperlinks )
3693 bool bEditableFieldClicked =
false;
3698 bool bEditableField = (aFieldAtPos.
pFndTextAttr !=
nullptr
3701 if (!bEditableField)
3721 bEditableFieldClicked =
true;
3726 bool bOverURLGrf =
false;
3728 bOverURLGrf = bOverSelect =
nullptr != rSh.
IsURLGrfAtPos( aDocPos );
3732 MoveCursor( rSh, aDocPos, bOnlyText, bLockView );
3735 if (!bOverURLGrf && !bExecDrawTextLink && !bOnlyText)
3749 if ( !bOverSelect && bEditableFieldClicked && (!pCursorField ||
3808 Window::MouseButtonDown(aMEvt);
3820 bool bChkTableSel =
false;
3822 switch ( nMouseTabCol )
3826 nPointer = PointerStyle::VSizeBar;
3827 bChkTableSel =
true;
3831 nPointer = PointerStyle::HSizeBar;
3832 bChkTableSel =
true;
3836 nPointer = PointerStyle::TabSelectSE;
3840 nPointer = PointerStyle::TabSelectSW;
3844 nPointer = PointerStyle::TabSelectS;
3847 nPointer = PointerStyle::TabSelectE;
3851 nPointer = PointerStyle::TabSelectW;
3856 if ( PointerStyle::Null != nPointer &&
3872 ? PointerStyle::VSizeBar
3873 : PointerStyle::HSizeBar;
3889 pWindow->MouseMove(rMEvt);
3898 if( bExecFormatPaintbrush )
4035 Point aPos( aDocPt );
4058 Point aTmp( aDocPt );
4070 if(aRelPos.X() >= 0)
4074 const SfxPointItem aTmp1( SID_ATTR_POSITION, aRelPos );
4093 bool bDelShadCursor =
true;
4113 if( pSdrView && (
nullptr!=( pHdl = pSdrView->
PickHandle( aOld ) )||
4115 ( pHdl->
GetKind() == SdrHdlKind::Anchor ||
4116 pHdl->
GetKind() == SdrHdlKind::Anchor_TR ) )
4119 if( aNew.X() || aNew.Y() )
4186 ? SvMacroItemId::SwFrmMove
4187 : SvMacroItemId::SwFrmResize;
4189 if (
nullptr != pFlyFormat)
4191 if (
nullptr != pMacro &&
4196 sal_uInt32
nPos = 0;
4199 xVar->PutString( pFlyFormat->
GetName() );
4200 xArgs->Put(xVar.
get(), ++
nPos);
4202 if( SvMacroItemId::SwFrmResize == nEvent )
4205 xVar->PutUShort(
static_cast< sal_uInt16
>(
g_eSdrMoveHdl) );
4206 xArgs->Put(xVar.
get(), ++
nPos);
4210 xVar->PutLong( aDocPt.X() - aSttPt.X() );
4211 xArgs->Put(xVar.
get(), ++
nPos);
4213 xVar->PutLong( aDocPt.Y() - aSttPt.Y() );
4214 xArgs->Put(xVar.
get(), ++
nPos);
4224 if( !sRet.isEmpty() && sRet.toInt32()!=0 )
4230 if( bIsDocReadOnly )
4244 bResizeKeepRatio = bResizeKeepRatio && pHdl->
IsCornerHdl();
4252 pSdrView->
SetOrtho(!bResizeKeepRatio);
4260 pSdrView->
SetOrtho(bResizeKeepRatio);
4269 else if( bIsDocReadOnly )
4274 Point aTmp( aDocPt );
4295 Point aTmp( aDocPt );
4307 rSh.
Drag( &aDocPt,
false );
4345 bool bTstShdwCursor =
true;
4355 const void* pTmp = pINet;
4360 bTstShdwCursor =
false;
4377 rSh.
CallEvent( SvMacroItemId::OnMouseOut,
4378 aLastCallEvent,
true );
4380 if( !rSh.
CallEvent( SvMacroItemId::OnMouseOver,
4385 else if( aLastCallEvent.
HasEvent() )
4388 rSh.
CallEvent( SvMacroItemId::OnMouseOut,
4389 aLastCallEvent,
true );
4392 if( bTstShdwCursor && bInsWin && !bIsDocReadOnly &&
4407 if( text::HoriOrientation::RIGHT != eOrient && text::HoriOrientation::CENTER != eOrient )
4408 eOrient = text::HoriOrientation::LEFT;
4410 bDelShadCursor =
false;
4418 rSh.
Drag( &aDocPt,
false );
4441 pWindow->MouseButtonUp(rMEvt);
4446 bool bCallBase =
true;
4497 rSh.
EndDrag( &aDocPt,
false );
4520 pSdrView->
MarkObj(pShape, pPV);
4538 if( aPnt.X() || aPnt.Y() )
4576 m_rView.AttrChangedNotify(
nullptr);
4586 bool bPopMode =
false;
4595 m_rView.AttrChangedNotify(
nullptr);
4618 Point aEndPt, aSttPt;
4629 if ( aSttPt != aEndPt )
4632 rSh.
Copy(rSh, aSttPt, aEndPt);
4637 rSh.
EndDrag( &aDocPt,
false );
4647 ? SvMacroItemId::SwFrmMove
4648 : SvMacroItemId::SwFrmResize;
4650 if (
nullptr != pFlyFormat)
4652 if (
nullptr != pMacro)
4656 sal_uInt32
nPos = 0;
4659 xVar->PutString( pFlyFormat->
GetName() );
4660 xArgs->Put(xVar.
get(), ++
nPos);
4662 if( SvMacroItemId::SwFrmResize == nEvent )
4665 xVar->PutUShort(
static_cast< sal_uInt16
>(eOldSdrMoveHdl) );
4666 xArgs->Put(xVar.
get(), ++
nPos);
4670 xVar->PutLong( aDocPt.X() - aSttPt.X() );
4671 xArgs->Put(xVar.
get(), ++
nPos);
4673 xVar->PutLong( aDocPt.Y() - aSttPt.Y() );
4674 xArgs->Put(xVar.
get(), ++
nPos);
4677 xVar->PutUShort( 1 );
4678 xArgs->Put(xVar.
get(), ++
nPos);
4704 = static_txtattr_cast<SwTextContentControl*>(pAttr);
4713 rSh.
EndDrag( &aDocPt,
false );
4725 rSh.
EndDrag( &aDocPt,
false );
4735 rSh.
EndDrag( &aDocPt,
false );
4757 rSh.
EndDrag( &aDocPt,
false );
4767 if ( !bExecHyperlinks )
4772 bExecHyperlinks =
true;
4778 bExecHyperlinks =
false;
4801 bool bAddMode(
false);
4840 auto pTextContentControl
4841 = static_txtattr_cast<const SwTextContentControl*>(