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();
312static bool IsMinMove(
const Point &rStartPos,
const Point &rLPt)
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;
647 Point aModPt( m_aMovePos );
655 const int nMaxScroll = 40;
661 rSh.
Drag(&aModPt,
false);
669 if ( m_xRowColumnSelectionStart )
671 Point aPos( aModPt );
684 if( aModPt.Y() < ( rVisArea.
Top() + rVisArea.
Height() / 2 ) )
776 uno::Reference < i18n::XBreakIterator > xBI = pBreakIter->
GetBreakIter();
780 if (xBI->getScriptType( rText, 0 ) == i18n::ScriptType::COMPLEX)
783 nCTLScriptPos = xBI->nextScript( rText, 0, i18n::ScriptType::COMPLEX );
785 return (0 <= nCTLScriptPos && nCTLScriptPos <= rText.getLength());
791 const OUString &rInBuffer)
812 default: bLang =
false;
819 if(SfxItemState::DEFAULT <= aLangSet.
GetItemState(nWhich))
822 if ( eLang == eBufferLanguage )
853 i18n::UnicodeScript
eType = !rInBuffer.isEmpty() ?
855 i18n::UnicodeScript_kScriptCount;
857 bool bSystemIsNonLatin =
false;
860 case i18n::UnicodeScript_kGreek:
861 case i18n::UnicodeScript_kCyrillic:
864 bSystemIsNonLatin =
true;
872 bLang = (bSystemIsNonLatin != bOOoLangIsNonLatin);
897 uno::Reference < i18n::XExtendedInputSequenceChecker > xISC =
pCheckIt->
xCheck;
913 const sal_Int32 nOldLen = aOldText.getLength();
917 sal_Int32 nExpandSelection = 0;
920 sal_Int32 nTmpPos = nOldLen;
922 i18n::InputSequenceCheckMode::STRICT : i18n::InputSequenceCheckMode::BASIC;
924 OUString aNewText( aOldText );
927 for( sal_Int32 k = 0; k <
m_aInBuffer.getLength(); ++k)
930 const sal_Int32 nPrevPos =xISC->correctInputSequence( aNewText, nTmpPos - 1, cChar, nCheckMode );
933 if (nPrevPos != aNewText.getLength())
934 nTmpPos = nPrevPos + 1;
938 sal_Int32 nNewLen = aNewText.getLength();
941 sal_Int32 nChgPos = 0;
942 while ( nChgPos < nOldLen && nChgPos < nNewLen &&
943 pOldText[nChgPos] == pNewText[nChgPos] )
946 const sal_Int32 nChgLen = nNewLen - nChgPos;
950 nExpandSelection = nOldLen - nChgPos;
957 for( sal_Int32 k = 0; k <
m_aInBuffer.getLength(); ++k )
960 if (xISC->checkInputSequence( aNewText, nTmpPos - 1, cChar, nCheckMode ))
963 aNewText += OUStringChar( cChar );
967 m_aInBuffer = aNewText.copy( aOldText.getLength() );
982 OSL_ENSURE( nCursorStartPos >= nExpandSelection,
"cannot expand selection as specified!!" );
983 if (nExpandSelection && nCursorStartPos >= nExpandSelection)
991 uno::Reference< frame::XDispatchRecorder > xRecorder =
993 if ( xRecorder.is() )
1018#define MOVE_LEFT_SMALL 0
1019#define MOVE_UP_SMALL 1
1020#define MOVE_RIGHT_BIG 2
1021#define MOVE_DOWN_BIG 3
1022#define MOVE_LEFT_BIG 4
1023#define MOVE_UP_BIG 5
1024#define MOVE_RIGHT_SMALL 6
1025#define MOVE_DOWN_SMALL 7
1028#define MOVE_LEFT_HUGE 8
1029#define MOVE_UP_HUGE 9
1030#define MOVE_RIGHT_HUGE 10
1031#define MOVE_DOWN_HUGE 11
1086 const bool bFollowTextFlow =
1091 &rFormatAnchor, bFollowTextFlow,
1092 false, &aRefPoint );
1114 nRight = aSnap.
Width();
1129 default: OSL_ENSURE(
true,
"ChangeFly: Unknown direction." );
1132 if ((RndStdIds::FLY_AS_CHAR == eAnchorId) && ( nDir % 2 ))
1137 else if ( aDiff < -aTmp.
Height() )
1144 bool bDown = 0 != ( nDir & 0x02 );
1147 case text::VertOrientation::CHAR_TOP:
1148 if( bDown ) eNew = text::VertOrientation::CENTER;
1150 case text::VertOrientation::CENTER:
1151 eNew = bDown ? text::VertOrientation::TOP : text::VertOrientation::CHAR_TOP;
1153 case text::VertOrientation::TOP:
1154 if( !bDown ) eNew = text::VertOrientation::CENTER;
1156 case text::VertOrientation::LINE_TOP:
1157 if( bDown ) eNew = text::VertOrientation::LINE_CENTER;
1159 case text::VertOrientation::LINE_CENTER:
1160 eNew = bDown ? text::VertOrientation::LINE_BOTTOM : text::VertOrientation::LINE_TOP;
1162 case text::VertOrientation::LINE_BOTTOM:
1163 if( !bDown ) eNew = text::VertOrientation::LINE_CENTER;
1177 if (bWeb && (RndStdIds::FLY_AT_PARA == eAnchorId)
1185 case text::HoriOrientation::RIGHT:
1187 eNew = text::HoriOrientation::LEFT;
1189 case text::HoriOrientation::LEFT:
1191 eNew = text::HoriOrientation::RIGHT;
1205 bool bSetPos = (RndStdIds::FLY_AS_CHAR != eAnchorId);
1208 bSetPos = RndStdIds::FLY_AT_PAGE == eAnchorId;
1225 const bool bOnePixel(
1263 if(0 != nX || 0 != nY)
1284 nX *= aSnap.
Width();
1298 bool bDummy1, bDummy2;
1299 const bool bVertAnchor = rSh.
IsFrameVertical(
true, bDummy1, bDummy2 );
1300 bool bHoriMove = !bVertAnchor == !( nDir % 2 );
1302 !bHoriMove || (rSh.
GetAnchorId() != RndStdIds::FLY_AS_CHAR);
1315 if( SdrHdlKind::Anchor == pHdl->
GetKind() ||
1316 SdrHdlKind::Anchor_TR == pHdl->
GetKind() )
1331 pSdrView->
BegDragObj(aStartPoint,
nullptr, pHdl, 0);
1335 bool bWasNoSnap = rDragStat.
IsNoSnap();
1350 const_cast<SdrDragStat&
>(rDragStat).SetNoSnap(bWasNoSnap);
1374 pWindow->KeyInput(rKEvt);
1440 bool bFlushBuffer =
false;
1441 bool bNormalChar =
false;
1478 if( ( bVertText && ( !bTableCursor || bVertTable ) ) ||
1479 ( bTableCursor && bVertTable ) )
1482 if (eDirection == SvxFrameDirection::Vertical_LR_BT)
1534 std::shared_ptr<SwContentControl> pContentControl = rFormatContentControl.
GetContentControl();
1535 if (pContentControl->ShouldOpenPopup(rKeyCode))
1541 if (pContentControlButton)
1543 pContentControlButton->StartPopup();
1569 = static_txtattr_cast<SwTextContentControl*>(pAttr);
1572 std::shared_ptr<SwContentControl> pContentControl
1574 if (pContentControl->IsInteractingCharacter(aCh))
1590 nEvent = SvMacroItemId::SwFrmKeyInputAlpha;
1592 nEvent = SvMacroItemId::SwFrmKeyInputNoAlpha;
1599 xVar->PutString( pFlyFormat->
GetName() );
1600 xArgs->Put(xVar.
get(), 1);
1603 if( SvMacroItemId::SwFrmKeyInputAlpha == nEvent )
1604 xVar->PutChar( aCh );
1607 xArgs->Put(xVar.
get(), 2);
1611 if( !sRet.isEmpty() && sRet.toInt32()!=0 )
1627 pAnchor = rHdlList.
GetHdl(SdrHdlKind::Anchor_TR);
1636 uno::Reference< frame::XDispatchRecorder > xRecorder =
1638 if ( !xRecorder.is() )
1646 OUString sFormulaEntry;
1648 enum class SwKeyState { CheckKey, InsChar, InsTab,
1649 NoNum, NumOff, NumOrNoNum, NumDown, NumUp,
1650 NumIndentInc, NumIndentDec,
1653 NextCell, PrevCell, OutlineUp, OutlineDown,
1654 GlossaryExpand, NextPrevGlossary,
1658 LaunchOLEObject, GoIntoFly, GoIntoDrawing,
1659 EnterDrawHandleMode,
1660 CheckDocReadOnlyKeys,
1661 CheckAutoCorrect, EditFormula,
1662 ColLeftBig, ColRightBig,
1663 ColLeftSmall, ColRightSmall,
1666 CellLeftBig, CellRightBig,
1667 CellLeftSmall, CellRightSmall,
1668 CellTopBig, CellBottomBig,
1669 CellTopSmall, CellBottomSmall,
1671 Fly_Change, Draw_Change,
1678 SwKeyState eKeyState = bIsDocReadOnly ? SwKeyState::CheckDocReadOnlyKeys : SwKeyState::CheckKey;
1679 SwKeyState eNextKeyState = SwKeyState::End;
1688 while( SwKeyState::End != eKeyState )
1690 SwKeyState eFlyState = SwKeyState::KeyToView;
1694 case SwKeyState::CheckKey:
1695 eKeyState = SwKeyState::KeyToView;
1698 !rKeyCode.
IsMod2() &&
'=' == aCh &&
1713 eKeyState = SwKeyState::EditFormula;
1721 sFormulaEntry =
"=";
1733 eKeyState = SwKeyState::GlossaryExpand;
1740 eKeyState = SwKeyState::ColRightBig;
1741 eFlyState = SwKeyState::Fly_Change;
1743 goto KEYINPUT_CHECKTABLE;
1746 eKeyState = SwKeyState::ColRightSmall;
1747 eFlyState = SwKeyState::Fly_Change;
1749 goto KEYINPUT_CHECKTABLE;
1752 eKeyState = SwKeyState::ColLeftSmall;
1753 goto KEYINPUT_CHECKTABLE;
1756 eKeyState = SwKeyState::ColLeftBig;
1757 goto KEYINPUT_CHECKTABLE;
1760 eKeyState = SwKeyState::CellRightBig;
1761 goto KEYINPUT_CHECKTABLE;
1764 eKeyState = SwKeyState::CellRightSmall;
1765 goto KEYINPUT_CHECKTABLE;
1768 eKeyState = SwKeyState::CellLeftSmall;
1769 goto KEYINPUT_CHECKTABLE;
1772 eKeyState = SwKeyState::CellLeftBig;
1773 goto KEYINPUT_CHECKTABLE;
1776 eKeyState = SwKeyState::ColBottomSmall;
1777 eFlyState = SwKeyState::Fly_Change;
1779 goto KEYINPUT_CHECKTABLE;
1782 eKeyState = SwKeyState::ColBottomBig;
1783 eFlyState = SwKeyState::Fly_Change;
1785 goto KEYINPUT_CHECKTABLE;
1788 eKeyState = SwKeyState::CellBottomSmall;
1789 goto KEYINPUT_CHECKTABLE;
1792 eKeyState = SwKeyState::CellBottomBig;
1793 goto KEYINPUT_CHECKTABLE;
1796 eKeyState = SwKeyState::CellTopBig;
1797 goto KEYINPUT_CHECKTABLE;
1800 eKeyState = SwKeyState::CellTopSmall;
1801 goto KEYINPUT_CHECKTABLE;
1809 ! (Window::GetIndicatorState() & KeyIndicatorState::CAPSLOCK)
1813 bFlushBuffer =
true;
1814 bNormalChar =
false;
1815 eKeyState = SwKeyState::End;
1821 if(!pFlyFormat && SwKeyState::KeyToView != eFlyState &&
1824 eKeyState = SwKeyState::Draw_Change;
1827 eKeyState = eFlyState;
1828 else if( SwKeyState::Draw_Change != eKeyState)
1829 eKeyState = SwKeyState::EnterCharCell;
1845 eKeyState = pFlyFormat ? SwKeyState::Fly_Change : SwKeyState::Draw_Change;
1849 eKeyState = SwKeyState::Draw_Change;
1868 eFlyState = SwKeyState::Fly_Change;
1871 goto KEYINPUT_CHECKTABLE_INSDEL;
1875 goto KEYINPUT_CHECKTABLE_INSDEL;
1883 eFlyState = SwKeyState::Fly_Change;
1886 goto KEYINPUT_CHECKTABLE_INSDEL;
1897 pDropDown->LaunchPopup();
1898 eKeyState = SwKeyState::End;
1901 eFlyState = SwKeyState::Fly_Change;
1904 goto KEYINPUT_CHECKTABLE_INSDEL;
1907KEYINPUT_CHECKTABLE_INSDEL:
1912 eKeyState = SwKeyState::KeyToView;
1913 if(SwKeyState::KeyToView != eFlyState)
1917 eKeyState = SwKeyState::Draw_Change;
1919 eKeyState = SwKeyState::Fly_Change;
1929 eKeyState = SwKeyState::NumOrNoNum;
1934 eKeyState = SwKeyState::End;
1946 eKeyState = SwKeyState::LaunchOLEObject;
1948 eKeyState = SwKeyState::GoIntoFly;
1953 eKeyState = SwKeyState::GoIntoDrawing;
1955 eKeyState = SwKeyState::GoIntoFly;
1959 eKeyState = SwKeyState::GlossaryExpand;
1968 eKeyState = SwKeyState::NumOff;
1969 eNextKeyState = SwKeyState::OutlineLvOff;
1978 eKeyState = SwKeyState::AutoFormatByInput;
1982 eNextKeyState = eKeyState;
1983 eKeyState = SwKeyState::CheckAutoCorrect;
1995 eKeyState = SwKeyState::NoNum;
1998 eKeyState = SwKeyState::SpecialInsert;
2017 || ( rSh.
IsNoNum() && bOnlyBackspaceKey ) ) )
2023 eKeyState = SwKeyState::End;
2031 eKeyState = SwKeyState::NumUp;
2037 eKeyState = SwKeyState::NumIndentDec;
2056 bool bCallNumOrNoNum(
false );
2057 if ( bOnlyBackspaceKey && !rSh.
IsNoNum() )
2059 bCallNumOrNoNum =
true;
2061 else if ( !bOnlyBackspaceKey && rSh.
IsNoNum() )
2063 bCallNumOrNoNum =
true;
2065 else if ( bOnlyBackspaceKey
2071 if ( pCurrNumRule !=
nullptr
2074 bCallNumOrNoNum =
true;
2077 if ( bCallNumOrNoNum
2080 eKeyState = SwKeyState::NumOrNoNum;
2088 eKeyState = SwKeyState::End;
2094 eFlyState = SwKeyState::Fly_Change;
2096 goto KEYINPUT_CHECKTABLE_INSDEL;
2106 eKeyState = SwKeyState::GotoNextFieldMark;
2111 eKeyState = SwKeyState::End;
2119 eKeyState = SwKeyState::NumDown;
2123 eKeyState = SwKeyState::InsTab;
2133 eKeyState = SwKeyState::NextObject;
2138 eKeyState = SwKeyState::NextCell;
2141 eKeyState = SwKeyState::CheckAutoCorrect;
2142 eNextKeyState = SwKeyState::NextCell;
2145 else if (pTextContentControl)
2150 switch (pCC->GetType())
2153 eKeyState = SwKeyState::InsTab;
2156 eKeyState = SwKeyState::GotoNextFieldMark;
2162 eKeyState = SwKeyState::InsTab;
2170 eKeyState = SwKeyState::OutlineDown;
2181 eKeyState = SwKeyState::GotoPrevFieldMark;
2186 eKeyState = SwKeyState::End;
2192 eKeyState = SwKeyState::NumUp;
2201 eKeyState = SwKeyState::PrevObject;
2206 eKeyState = SwKeyState::PrevCell;
2209 eKeyState = SwKeyState::CheckAutoCorrect;
2210 eNextKeyState = SwKeyState::PrevCell;
2213 else if (pTextContentControl)
2215 eKeyState = SwKeyState::GotoPrevFieldMark;
2219 eKeyState = SwKeyState::End;
2226 eKeyState = SwKeyState::OutlineUp;
2238 aTmpQHD.
Next( pACorr &&
2240 eKeyState = SwKeyState::NextPrevGlossary;
2243 eKeyState = SwKeyState::InsTab;
2248 eKeyState = SwKeyState::EnterDrawHandleMode;
2253 eKeyState = SwKeyState::NumIndentInc;
2266 eKeyState = SwKeyState::NextPrevGlossary;
2272 eKeyState = SwKeyState::EnterDrawHandleMode;
2278 eKeyState = SwKeyState::NumIndentDec;
2287 eKeyState = SwKeyState::GoIntoFly;
2290 eKeyState = SwKeyState::GoIntoDrawing;
2292 eKeyState = SwKeyState::GoIntoFly;
2299 case SwKeyState::CheckDocReadOnlyKeys:
2301 eKeyState = SwKeyState::KeyToView;
2306 bNormalChar =
false;
2307 eKeyState = SwKeyState::End;
2317 SwKeyState::PrevObject : SwKeyState::NextObject;
2333 eKeyState = SwKeyState::GoIntoFly;
2341 bNormalChar =
false;
2342 eKeyState = SwKeyState::End;
2352 case SwKeyState::EnterCharCell:
2354 eKeyState = SwKeyState::KeyToView;
2359 eKeyState = SwKeyState::End;
2364 eKeyState = SwKeyState::End;
2371 case SwKeyState::KeyToView:
2373 eKeyState = SwKeyState::End;
2385 if( !
m_aInBuffer.isEmpty() && ( !bNormalChar || bIsDocReadOnly ))
2393 eKeyState = SwKeyState::End;
2397 bFlushBuffer =
true;
2398 bNormalChar =
false;
2408 if( !bIsDocReadOnly && bNormalChar )
2415 bool bTextBox =
false;
2422 if (bDrawObject && !bTextBox)
2429 pSwDrawTextShell->Init();
2437 m_rView.AttrChangedNotify(
nullptr);
2440 eKeyState = SwKeyState::InsChar;
2444 bNormalChar =
false;
2445 Window::KeyInput( aKeyEvent );
2450 case SwKeyState::LaunchOLEObject:
2453 eKeyState = SwKeyState::End;
2456 case SwKeyState::GoIntoFly:
2460 m_rView.AttrChangedNotify(
nullptr);
2462 eKeyState = SwKeyState::End;
2465 case SwKeyState::GoIntoDrawing:
2469 SdrObject* pObj = pMark->GetMarkedSdrObj();
2474 pSwDrawTextShell->Init();
2477 eKeyState = SwKeyState::End;
2480 case SwKeyState::EnterDrawHandleMode:
2485 const_cast<SdrHdlList&
>(rHdlList).TravelFocusHdl(bForward);
2486 eKeyState = SwKeyState::End;
2489 case SwKeyState::InsTab:
2493 Window::KeyInput( aKeyEvent );
2494 eKeyState = SwKeyState::End;
2499 case SwKeyState::InsChar:
2510 auto pTextContentControl = static_txtattr_cast<SwTextContentControl*>(pAttr);
2512 std::shared_ptr<SwContentControl> pContentControl = rFormatContentControl.
GetContentControl();
2513 if (pContentControl->IsInteractingCharacter(aCh))
2516 eKeyState = SwKeyState::End;
2528 OSL_ENSURE(pFieldmark,
2529 "Where is my FieldMark??");
2533 OSL_ENSURE(pFieldmark->IsExpanded(),
2534 "where is the otherpos?");
2535 if (pFieldmark->IsExpanded())
2540 eKeyState = SwKeyState::End;
2545 const bool bIsNormalChar =
2547 if( bAppendSpace && bIsNormalChar &&
2559 (
'*' == aCh ||
'_' == aCh ) ) ||
2560 ( pACorr->
IsAutoCorrFlag( ACFlags::ChgQuotes ) && (
'\"' == aCh ))||
2561 ( pACorr->
IsAutoCorrFlag( ACFlags::ChgSglQuotes ) && (
'\'' == aCh))))
2565 if(
'\"' != aCh &&
'\'' != aCh )
2570 pACorr->
IsAutoCorrFlag( ACFlags::CapitalStartSentence | ACFlags::CapitalStartWord |
2571 ACFlags::ChgOrdinalNumber | ACFlags::AddNonBrkSpace |
2572 ACFlags::ChgToEnEmDash | ACFlags::SetINetAttr |
2573 ACFlags::Autocorrect | ACFlags::TransliterateRTL ) &&
2574 '\"' != aCh &&
'\'' != aCh &&
'*' != aCh &&
'_' != aCh
2587 bFlushBuffer = !delayFlush;
2591 keyInputFlushTimerStop.dismiss();
2596 eKeyState = SwKeyState::End;
2601 eKeyState = SwKeyState::End;
2605 case SwKeyState::CheckAutoCorrect:
2608 pACorr->
IsAutoCorrFlag( ACFlags::CapitalStartSentence | ACFlags::CapitalStartWord |
2609 ACFlags::ChgOrdinalNumber | ACFlags::TransliterateRTL |
2610 ACFlags::ChgToEnEmDash | ACFlags::SetINetAttr |
2611 ACFlags::Autocorrect ) &&
2617 eKeyState = eNextKeyState;
2623 sal_uInt16 nSlotId = 0;
2627 case SwKeyState::SpecialInsert:
2631 case SwKeyState::NoNum:
2635 case SwKeyState::NumOff:
2639 case SwKeyState::OutlineLvOff:
2642 case SwKeyState::NumDown:
2646 case SwKeyState::NumUp:
2650 case SwKeyState::NumIndentInc:
2655 case SwKeyState::GotoNextFieldMark:
2661 case SwKeyState::GotoPrevFieldMark:
2667 case SwKeyState::NumIndentDec:
2671 case SwKeyState::OutlineDown:
2674 case SwKeyState::OutlineUp:
2678 case SwKeyState::NextCell:
2683 case SwKeyState::PrevCell:
2687 case SwKeyState::AutoFormatByInput:
2691 case SwKeyState::NextObject:
2692 case SwKeyState::PrevObject:
2701 m_rView.AttrChangedNotify(
nullptr);
2707 case SwKeyState::GlossaryExpand:
2712 OUString sFnd(aTmpQHD.
CurStr());
2730 sFnd = sFnd.copy(aTmpQHD.
CurLen());
2739 case SwKeyState::NextPrevGlossary:
2744 case SwKeyState::EditFormula:
2746 const sal_uInt16
nId = SwInputChild::GetChildWindowId();
2751 GetChildWindow(
nId ));
2772 case SwKeyState::Fly_Change:
2782 case SwKeyState::Draw_Change :
2793 eKeyState = SwKeyState::End;
2811 const bool bAutoTextShown
2853 const bool bOnlyText,
bool bLockView )
2858 int nTmpSetCursor = 0;
2909 pWindow->MouseButtonDown(aMEvt);
2923 if( bExecFormatPaintbrush )
2934 bool bOverFly =
false;
2935 bool bPageAnchored =
false;
2939 if (bOverHeaderFooterFly && (!bIsDocReadOnly && rSh.
GetCurField()))
2941 bOverHeaderFooterFly =
false;
2951 bool bActive =
true;
3054 rSh.
Chain( *pFormat, aDocPos );
3063 bool bCallBase =
true;
3097 if ( SwTab::SEL_HORI <= nMouseTabCol && SwTab::COLSEL_VERT >= nMouseTabCol )
3172 bool bOnlyText =
false;
3190 if( !bIsDocReadOnly &&
3193 nullptr != ( pHdl = pSdrView->
PickHandle(aDocPos) ) &&
3194 ( pHdl->
GetKind() == SdrHdlKind::Anchor ||
3195 pHdl->
GetKind() == SdrHdlKind::Anchor_TR ) )
3221 bool bHitHandle = pHdl && pHdl->
GetKind() != SdrHdlKind::Anchor &&
3222 pHdl->
GetKind() != SdrHdlKind::Anchor_TR;
3247 if ( !bExecHyperlinks )
3252 bExecHyperlinks =
true;
3257 if (0 == nNumberOfClicks && 0 < aMEvt.
GetClicks())
3258 nNumberOfClicks = 4;
3260 bool bExecDrawTextLink =
false;
3271 if (1 == nNumberOfClicks)
3278 if (bExecHyperlinks && pSdrView)
3281 pSdrView->
PickAnything(aMEvt, SdrMouseEventKind::BUTTONDOWN, aVEvt);
3283 if (aVEvt.
meEvent == SdrEventKind::ExecuteUrl)
3284 bExecDrawTextLink =
true;
3288 if (1 == nNumberOfClicks && !bExecDrawTextLink)
3323 m_rView.AttrChangedNotify(
nullptr);
3349 ( pHdl->
GetKind() == SdrHdlKind::Anchor ||
3350 pHdl->
GetKind() == SdrHdlKind::Anchor_TR ) )
3368 m_rView.AttrChangedNotify(
nullptr);
3371 bool bSelObj = rSh.
SelectObj( aDocPos, nFlag );
3381 m_rView.AttrChangedNotify(
nullptr);
3397 m_rView.AttrChangedNotify(
nullptr);
3406 switch ( nNumberOfClicks )
3431 SfxCallMode::RECORD|SfxCallMode::SLOT);
3447 SfxCallMode::RECORD|SfxCallMode::SLOT);
3455 pSwDrawTextShell->Init();
3470 if( !bIsDocReadOnly &&
3532 IFieldmark *pFieldBM =
const_cast< IFieldmark*
> ( aContentAtPos.
aFnd.
pFieldmark );
3546 const OUString sToxText = aToxContentAtPos.
sStr;
3547 if (!sToxText.isEmpty() && aToxContentAtPos.
pFndTextAttr)
3585 if ( 3 == nNumberOfClicks )
3639 if ( !bExecDrawTextLink )
3713 if (nNumberOfClicks == 2)
3721 SfxCallMode::RECORD | SfxCallMode::SLOT);
3735 if (rMarkList.
GetMark(0) ==
nullptr)
3738 m_rView.AttrChangedNotify(
nullptr);
3782 m_rView.AttrChangedNotify(
nullptr);
3795 if( bExecHyperlinks )
3841 bool bEditableFieldClicked =
false;
3846 bool bEditableField = (aFieldAtPos.
pFndTextAttr !=
nullptr
3849 if (!bEditableField)
3868 bEditableFieldClicked =
true;
3873 bool bOverURLGrf =
false;
3875 bOverURLGrf = bOverSelect =
nullptr != rSh.
IsURLGrfAtPos( aDocPos );
3879 MoveCursor( rSh, aDocPos, bOnlyText, bLockView );
3882 if (!bOverURLGrf && !bExecDrawTextLink && !bOnlyText)
3896 if ( !bOverSelect && bEditableFieldClicked && (!pCursorField ||
3955 Window::MouseButtonDown(aMEvt);
3967 bool bChkTableSel =
false;
3969 switch ( nMouseTabCol )
3973 nPointer = PointerStyle::VSizeBar;
3974 bChkTableSel =
true;
3978 nPointer = PointerStyle::HSizeBar;
3979 bChkTableSel =
true;
3983 nPointer = PointerStyle::TabSelectSE;
3987 nPointer = PointerStyle::TabSelectSW;
3991 nPointer = PointerStyle::TabSelectS;
3994 nPointer = PointerStyle::TabSelectE;
3998 nPointer = PointerStyle::TabSelectW;
4003 if ( PointerStyle::Null != nPointer &&
4019 ? PointerStyle::VSizeBar
4020 : PointerStyle::HSizeBar;
4036 pWindow->MouseMove(rMEvt);
4045 if( bExecFormatPaintbrush )
4182 Point aPos( aDocPt );
4205 Point aTmp( aDocPt );
4217 if(aRelPos.X() >= 0)
4221 const SfxPointItem aTmp1( SID_ATTR_POSITION, aRelPos );
4229 const SvxStatusItem aCell( SID_TABLE_CELL, OUString(), StatusCategory::NONE );
4240 bool bDelShadCursor =
true;
4260 if( pSdrView && (
nullptr!=( pHdl = pSdrView->
PickHandle( aOld ) )||
4262 ( pHdl->
GetKind() == SdrHdlKind::Anchor ||
4263 pHdl->
GetKind() == SdrHdlKind::Anchor_TR ) )
4266 if( aNew.X() || aNew.Y() )
4333 ? SvMacroItemId::SwFrmMove
4334 : SvMacroItemId::SwFrmResize;
4336 if (
nullptr != pFlyFormat)
4338 if (
nullptr != pMacro &&
4343 sal_uInt32
nPos = 0;
4346 xVar->PutString( pFlyFormat->
GetName() );
4347 xArgs->Put(xVar.
get(), ++
nPos);
4349 if( SvMacroItemId::SwFrmResize == nEvent )
4352 xVar->PutUShort(
static_cast< sal_uInt16
>(
g_eSdrMoveHdl) );
4353 xArgs->Put(xVar.
get(), ++
nPos);
4357 xVar->PutLong( aDocPt.X() - aSttPt.X() );
4358 xArgs->Put(xVar.
get(), ++
nPos);
4360 xVar->PutLong( aDocPt.Y() - aSttPt.Y() );
4361 xArgs->Put(xVar.
get(), ++
nPos);
4371 if( !sRet.isEmpty() && sRet.toInt32()!=0 )
4377 if( bIsDocReadOnly )
4391 bResizeKeepRatio = bResizeKeepRatio && pHdl->
IsCornerHdl();
4399 pSdrView->
SetOrtho(!bResizeKeepRatio);
4407 pSdrView->
SetOrtho(bResizeKeepRatio);
4416 else if( bIsDocReadOnly )
4421 Point aTmp( aDocPt );
4442 Point aTmp( aDocPt );
4454 rSh.
Drag( &aDocPt,
false );
4492 bool bTstShdwCursor =
true;
4502 const void* pTmp = pINet;
4507 bTstShdwCursor =
false;
4524 rSh.
CallEvent( SvMacroItemId::OnMouseOut,
4525 aLastCallEvent,
true );
4527 if( !rSh.
CallEvent( SvMacroItemId::OnMouseOver,
4532 else if( aLastCallEvent.
HasEvent() )
4535 rSh.
CallEvent( SvMacroItemId::OnMouseOut,
4536 aLastCallEvent,
true );
4539 if( bTstShdwCursor && bInsWin && !bIsDocReadOnly &&
4554 if( text::HoriOrientation::RIGHT != eOrient && text::HoriOrientation::CENTER != eOrient )
4555 eOrient = text::HoriOrientation::LEFT;
4557 bDelShadCursor =
false;
4565 rSh.
Drag( &aDocPt,
false );
4588 pWindow->MouseButtonUp(rMEvt);
4593 bool bCallBase =
true;
4644 rSh.
EndDrag( &aDocPt,
false );
4667 pSdrView->
MarkObj(pShape, pPV);
4685 if( aPnt.X() || aPnt.Y() )
4723 m_rView.AttrChangedNotify(
nullptr);
4733 bool bPopMode =
false;
4742 m_rView.AttrChangedNotify(
nullptr);
4765 Point aEndPt, aSttPt;
4776 if ( aSttPt != aEndPt )
4779 rSh.
Copy(rSh, aSttPt, aEndPt);
4784 rSh.
EndDrag( &aDocPt,
false );
4794 ? SvMacroItemId::SwFrmMove
4795 : SvMacroItemId::SwFrmResize;
4797 if (
nullptr != pFlyFormat)
4799 if (
nullptr != pMacro)
4803 sal_uInt32
nPos = 0;
4806 xVar->PutString( pFlyFormat->
GetName() );
4807 xArgs->Put(xVar.
get(), ++
nPos);
4809 if( SvMacroItemId::SwFrmResize == nEvent )
4812 xVar->PutUShort(
static_cast< sal_uInt16
>(eOldSdrMoveHdl) );
4813 xArgs->Put(xVar.
get(), ++
nPos);
4817 xVar->PutLong( aDocPt.X() - aSttPt.X() );
4818 xArgs->Put(xVar.
get(), ++
nPos);
4820 xVar->PutLong( aDocPt.Y() - aSttPt.Y() );
4821 xArgs->Put(xVar.
get(), ++
nPos);
4824 xVar->PutUShort( 1 );
4825 xArgs->Put(xVar.
get(), ++
nPos);
4851 = static_txtattr_cast<SwTextContentControl*>(pAttr);
4860 rSh.
EndDrag( &aDocPt,
false );
4872 rSh.
EndDrag( &aDocPt,
false );
4882 rSh.
EndDrag( &aDocPt,
false );