22 #include <com/sun/star/accessibility/XAccessible.hpp>
24 #include <com/sun/star/i18n/XBreakIterator.hpp>
25 #include <com/sun/star/i18n/ScriptType.hpp>
26 #include <com/sun/star/i18n/InputSequenceCheckMode.hpp>
27 #include <com/sun/star/i18n/XExtendedInputSequenceChecker.hpp>
29 #include <com/sun/star/i18n/UnicodeScript.hpp>
30 #include <com/sun/star/ui/ContextMenuExecuteEvent.hpp>
54 #include <editeng/editeng.hxx>
92 #include <inputwin.hxx>
145 #include <strings.hrc>
188 SdrObject* pTextBox = pTextBoxFormat->FindRealSdrObject();
210 , aHdlPos( pH->GetPos() )
211 , aLastPos( pH->GetPos() )
224 bTopRightHandle = (pHdl->
GetKind() == SdrHdlKind::Anchor_TR);
231 if ( bTopRightHandle )
233 aHitTestPos +=
Point( -1, 1 );
237 aHitTestPos +=
Point( 1, 1 );
252 static constexpr sal_uInt16 nNoPos = std::numeric_limits<sal_uInt16>::max();
273 bool HasContent()
const {
return !m_aHelpStrings.empty() && nCurArrPos != nNoPos; }
274 const OUString&
CurStr()
const {
return m_aHelpStrings[nCurArrPos].first; }
275 sal_uInt16
CurLen()
const {
return m_aHelpStrings[nCurArrPos].second; }
280 if( ++nCurArrPos >= m_aHelpStrings.size() )
281 nCurArrPos = (bEndLess && !m_bIsAutoText ) ? 0 : nCurArrPos-1;
286 if( 0 == nCurArrPos-- )
287 nCurArrPos = (bEndLess && !m_bIsAutoText ) ? m_aHelpStrings.size()-1 : 0;
291 void FillStrArr(
SwWrtShell const & rSh,
const OUString& rWord );
292 void SortAndFilter(
const OUString &rOrigWord);
301 static bool IsMinMove(
const Point &rStartPos,
const Point &rLPt)
303 return std::abs(rStartPos.X() - rLPt.X()) >
MIN_MOVE ||
304 std::abs(rStartPos.Y() - rLPt.Y()) >
MIN_MOVE;
335 SetQuickHelpText(OUString());
342 m_pUserMarker.reset();
344 eStyle = PointerStyle::NotAllowed;
352 bool bFrameIsValidTarget =
false;
353 if( m_pApplyTempl->m_pFormatClipboard )
354 bFrameIsValidTarget = m_pApplyTempl->m_pFormatClipboard->HasContentForThisType(
SelectionType::Frame );
355 else if( !m_pApplyTempl->nColor )
356 bFrameIsValidTarget = ( m_pApplyTempl->eType == SfxStyleFamily::Frame );
358 if( bFrameIsValidTarget &&
360 dynamic_cast<const SwFlyFrameFormat*>( pFormat) )
365 if ( !m_pUserMarker )
372 m_pUserMarker.reset();
375 rSh.SwCursorShell::SetVisibleCursor( rLPt );
377 SetPointer( eStyle );
391 ? PointerStyle::ChainNotAllowed : PointerStyle::Chain;
396 if ( !m_pUserMarker )
403 m_pUserMarker.reset();
406 SetPointer( eStyle );
410 bool bExecHyperlinks = m_rView.GetDocShell()->IsReadOnly();
411 if ( !bExecHyperlinks )
415 if ( ( bSecureOption && nModifier ==
KEY_MOD1 ) ||
416 ( !bSecureOption && nModifier !=
KEY_MOD1 ) )
417 bExecHyperlinks =
true;
420 const bool bExecSmarttags = nModifier ==
KEY_MOD1;
423 bool bPrefSdrPointer =
false;
424 bool bHitHandle =
false;
425 bool bCntAtPos =
false;
426 bool bIsDocReadOnly = m_rView.GetDocShell()->IsReadOnly() &&
428 m_aActHitType = SdrHitKind::NONE;
432 else if ( (bHitHandle = (pSdrView->
PickHandle(rLPt) !=
nullptr)) )
434 m_aActHitType = SdrHitKind::Object;
435 bPrefSdrPointer =
true;
440 if ( m_rView.GetDrawFuncPtr() && !m_bInsDraw && bNotInSelObj )
442 m_aActHitType = SdrHitKind::Object;
443 if (IsObjectSelect())
444 eStyle = PointerStyle::Arrow;
446 bPrefSdrPointer =
true;
452 SdrObject* pObj = (bNotInSelObj && bExecHyperlinks) ?
472 m_aActHitType = SdrHitKind::NONE;
473 bPrefSdrPointer =
true;
480 if (eHit == SdrHitKind::UrlField && bExecHyperlinks)
482 m_aActHitType = SdrHitKind::Object;
483 bPrefSdrPointer =
true;
499 eStyle = bMovable ? PointerStyle::Move : PointerStyle::Arrow;
500 m_aActHitType = SdrHitKind::Object;
517 eStyle = PointerStyle::NotAllowed;
519 eStyle = PointerStyle::Move;
520 m_aActHitType = SdrHitKind::Object;
524 if ( m_rView.GetDrawFuncPtr() )
525 bPrefSdrPointer =
true;
533 if ( bPrefSdrPointer )
536 SetPointer( PointerStyle::NotAllowed );
539 if (m_rView.GetDrawFuncPtr() && m_rView.GetDrawFuncPtr()->IsInsertForm() && !bHitHandle)
540 SetPointer( PointerStyle::DrawRect );
548 eStyle = PointerStyle::Arrow;
570 eStyle = PointerStyle::RefHand;
576 if( !bClickToFollow ||
579 eStyle = PointerStyle::RefHand;
582 else if (GetView().GetWrtShell().GetViewOptions()->IsShowOutlineContentVisibilityButton())
591 eStyle = PointerStyle::RefHand;
601 OUString sQuickHelp(
SwResId(STR_CLICK_OUTLINE_CONTENT_TOGGLE_VISIBILITY));
603 && nPos + 1 < nOutlineNodesCount
605 sQuickHelp +=
" (" +
SwResId(STR_CLICK_OUTLINE_CONTENT_TOGGLE_VISIBILITY_EXT) +
")";
606 SetQuickHelpText(sQuickHelp);
617 eStyle = PointerStyle::TextVertical;
622 eStyle = PointerStyle::ShowWhitespace;
624 eStyle = PointerStyle::HideWhitespace;
627 SetPointer( eStyle );
637 Point aModPt( m_aMovePos );
645 const int nMaxScroll = 40;
651 rSh.
Drag(&aModPt,
false);
659 if ( m_xRowColumnSelectionStart )
661 Point aPos( aModPt );
674 if( aModPt.Y() < ( rVisArea.
Top() + rVisArea.
Height() / 2 ) )
681 m_aMovePos += rSh.
VisArea().
Pos() - aOldVis.Pos();
695 std::max( m_aMovePos.Y() - rVisArea.
Bottom(), rVisArea.
Top() - m_aMovePos.Y() ),
696 std::max( m_aMovePos.X() - rVisArea.
Right(), rVisArea.
Left() - m_aMovePos.X()));
697 m_aTimer.SetTimeout( std::max( coMinLen, nTimeout - nDiff*2L) );
704 if( !m_aTimer.IsActive() )
706 m_pShadCursor.reset();
721 m_nInsFrameColCount = nCols;
726 SetSdrDrawMode( eSdrObjectKind );
729 m_rView.SetDrawFuncPtr(std::make_unique<DrawSelection>( &m_rView.GetWrtShell(),
this, &m_rView ));
731 m_rView.SetDrawFuncPtr(std::make_unique<SwDrawBase>( &m_rView.GetWrtShell(),
this, &m_rView ));
733 m_rView.SetSelDrawSlot();
734 SetSdrDrawMode( eSdrObjectKind );
736 m_rView.GetDrawFuncPtr()->Activate( SID_OBJECT_SELECT );
738 m_rView.GetDrawFuncPtr()->Activate( sal::static_int_cast< sal_uInt16 >(eSdrObjectKind) );
740 m_nInsFrameColCount = 1;
745 if (m_rView.GetDrawFuncPtr())
747 m_rView.GetDrawFuncPtr()->Deactivate();
748 m_rView.SetDrawFuncPtr(
nullptr);
750 m_rView.LeaveDrawCreate();
752 m_nInsFrameColCount = 1;
766 uno::Reference < i18n::XBreakIterator > xBI = pBreakIter->
GetBreakIter();
770 if (xBI->getScriptType( rText, 0 ) == i18n::ScriptType::COMPLEX)
773 nCTLScriptPos = xBI->nextScript( rText, 0, i18n::ScriptType::COMPLEX );
775 return (0 <= nCTLScriptPos && nCTLScriptPos <= rText.getLength());
781 const OUString &rInBuffer)
802 default: bLang =
false;
809 if(SfxItemState::DEFAULT <= aLangSet.GetItemState(nWhich))
812 if ( eLang == eBufferLanguage )
843 i18n::UnicodeScript
eType = !rInBuffer.isEmpty() ?
845 i18n::UnicodeScript_kScriptCount;
847 bool bSystemIsNonLatin =
false;
850 case i18n::UnicodeScript_kGreek:
851 case i18n::UnicodeScript_kCyrillic:
854 bSystemIsNonLatin =
true;
862 bLang = (bSystemIsNonLatin != bOOoLangIsNonLatin);
875 if ( m_aInBuffer.isEmpty() )
884 uno::Reference < i18n::XExtendedInputSequenceChecker > xISC =
pCheckIt->
xCheck;
885 if ( xISC.is() && IsInputSequenceCheckingRequired( m_aInBuffer, *rSh.
GetCursor() ) )
900 const sal_Int32 nOldLen = aOldText.getLength();
904 sal_Int32 nExpandSelection = 0;
907 sal_Int32 nTmpPos = nOldLen;
909 i18n::InputSequenceCheckMode::STRICT : i18n::InputSequenceCheckMode::BASIC;
911 OUString aNewText( aOldText );
914 for( sal_Int32 k = 0; k < m_aInBuffer.getLength(); ++k)
917 const sal_Int32 nPrevPos =xISC->correctInputSequence( aNewText, nTmpPos - 1, cChar, nCheckMode );
920 if (nPrevPos != aNewText.getLength())
921 nTmpPos = nPrevPos + 1;
925 sal_Int32 nNewLen = aNewText.getLength();
928 sal_Int32 nChgPos = 0;
929 while ( nChgPos < nOldLen && nChgPos < nNewLen &&
930 pOldText[nChgPos] == pNewText[nChgPos] )
933 const sal_Int32 nChgLen = nNewLen - nChgPos;
936 m_aInBuffer = aNewText.copy( nChgPos, nChgLen );
937 nExpandSelection = nOldLen - nChgPos;
944 for( sal_Int32 k = 0; k < m_aInBuffer.getLength(); ++k )
947 if (xISC->checkInputSequence( aNewText, nTmpPos - 1, cChar, nCheckMode ))
950 aNewText += OUStringChar( cChar );
954 m_aInBuffer = aNewText.copy( aOldText.getLength() );
962 if (m_aInBuffer.isEmpty())
969 OSL_ENSURE( nCursorStartPos >= nExpandSelection,
"cannot expand selection as specified!!" );
970 if (nExpandSelection && nCursorStartPos >= nExpandSelection)
978 uno::Reference< frame::XDispatchRecorder > xRecorder =
979 m_rView.GetViewFrame()->GetBindings().GetRecorder();
980 if ( xRecorder.is() )
1000 rSh.
Insert( m_aInBuffer );
1002 m_aInBuffer.clear();
1007 #define MOVE_LEFT_SMALL 0
1008 #define MOVE_UP_SMALL 1
1009 #define MOVE_RIGHT_BIG 2
1010 #define MOVE_DOWN_BIG 3
1011 #define MOVE_LEFT_BIG 4
1012 #define MOVE_UP_BIG 5
1013 #define MOVE_RIGHT_SMALL 6
1014 #define MOVE_DOWN_SMALL 7
1017 #define MOVE_LEFT_HUGE 8
1018 #define MOVE_UP_HUGE 9
1019 #define MOVE_RIGHT_HUGE 10
1020 #define MOVE_DOWN_HUGE 11
1039 RndStdIds eAnchorId = aSet.Get(RES_ANCHOR).GetAnchorId();
1051 aSnap = PixelToLogic(
Size(1,1));
1076 const bool bFollowTextFlow =
1077 aSet.Get(RES_FOLLOW_TEXT_FLOW).GetValue();
1078 const SwPosition* pToCharContentPos = aSet.Get(RES_ANCHOR).GetContentAnchor();
1080 text::RelOrientation::FRAME, aVert.GetRelationOrient(),
1081 pToCharContentPos, bFollowTextFlow,
1082 false, &aRefPoint );
1104 nRight = aSnap.
Width();
1119 default: OSL_ENSURE(
true,
"ChangeFly: Unknown direction." );
1122 if ((RndStdIds::FLY_AS_CHAR == eAnchorId) && ( nDir % 2 ))
1127 else if ( aDiff < -aTmp.
Height() )
1134 bool bDown = 0 != ( nDir & 0x02 );
1137 case text::VertOrientation::CHAR_TOP:
1138 if( bDown ) eNew = text::VertOrientation::CENTER;
1140 case text::VertOrientation::CENTER:
1141 eNew = bDown ? text::VertOrientation::TOP : text::VertOrientation::CHAR_TOP;
1143 case text::VertOrientation::TOP:
1144 if( !bDown ) eNew = text::VertOrientation::CENTER;
1146 case text::VertOrientation::LINE_TOP:
1147 if( bDown ) eNew = text::VertOrientation::LINE_CENTER;
1149 case text::VertOrientation::LINE_CENTER:
1150 eNew = bDown ? text::VertOrientation::LINE_BOTTOM : text::VertOrientation::LINE_TOP;
1152 case text::VertOrientation::LINE_BOTTOM:
1153 if( !bDown ) eNew = text::VertOrientation::LINE_CENTER;
1160 aVert.SetPos( aDiff );
1163 aVert.SetVertOrient( eNew );
1167 if (bWeb && (RndStdIds::FLY_AT_PARA == eAnchorId)
1175 case text::HoriOrientation::RIGHT:
1177 eNew = text::HoriOrientation::LEFT;
1179 case text::HoriOrientation::LEFT:
1181 eNew = text::HoriOrientation::RIGHT;
1185 if( eNew != aHori.GetHoriOrient() )
1187 aHori.SetHoriOrient( eNew );
1195 bool bSetPos = (RndStdIds::FLY_AS_CHAR != eAnchorId);
1198 bSetPos = RndStdIds::FLY_AT_PAGE == eAnchorId;
1215 const bool bOnePixel(
1253 if(0 != nX || 0 != nY)
1259 aSnap.setWidth( std::max(
sal_uLong(1), static_cast<sal_uLong>(aSnap.Width()) / nDiv ) );
1262 aSnap.setHeight( std::max(
sal_uLong(1), static_cast<sal_uLong>(aSnap.Height()) / nDiv ) );
1266 aSnap = PixelToLogic(
Size(1,1));
1271 aSnap =
Size(aSnap.Width() * 3, aSnap.Height() * 3);
1274 nX *= aSnap.
Width();
1275 nY *= aSnap.Height();
1288 bool bDummy1, bDummy2;
1289 const bool bVertAnchor = rSh.
IsFrameVertical(
true, bDummy1, bDummy2 );
1290 bool bHoriMove = !bVertAnchor == !( nDir % 2 );
1292 !bHoriMove || (rSh.
GetAnchorId() != RndStdIds::FLY_AS_CHAR);
1305 if( SdrHdlKind::Anchor == pHdl->
GetKind() ||
1306 SdrHdlKind::Anchor_TR == pHdl->
GetKind() )
1321 pSdrView->
BegDragObj(aStartPoint,
nullptr, pHdl, 0);
1325 bool bWasNoSnap = rDragStat.IsNoSnap();
1340 const_cast<SdrDragStat&
>(rDragStat).SetNoSnap(bWasNoSnap);
1362 if (
vcl::Window* pWindow = m_rView.GetPostItMgr()->GetActiveSidebarWin())
1364 pWindow->KeyInput(rKEvt);
1380 bool bOutlineContentVisibleAttr =
true;
1382 if (!bOutlineContentVisibleAttr)
1386 bOutlineContentVisibleAttr =
true;
1388 if (!bOutlineContentVisibleAttr)
1396 m_pApplyTempl && m_pApplyTempl->m_pFormatClipboard )
1398 m_pApplyTempl->m_pFormatClipboard->Erase();
1400 m_rView.GetViewFrame()->GetBindings().Invalidate(SID_FORMATPAINTBRUSH);
1413 SfxObjectShell *pObjSh = m_rView.GetViewFrame()->GetObjectShell();
1414 if ( m_bLockInput || (pObjSh && pObjSh->
GetProgress()) )
1419 m_pShadCursor.reset();
1420 m_aKeyInputFlushTimer.Stop();
1422 bool bIsDocReadOnly = m_rView.GetDocShell()->IsReadOnly() &&
1427 if(!bIsDocReadOnly && m_eBufferLanguage != eNewLanguage && !m_aInBuffer.isEmpty())
1431 m_eBufferLanguage = eNewLanguage;
1434 if( m_pQuickHlpData->m_bIsDisplayed )
1436 aTmpQHD.
Move( *m_pQuickHlpData );
1437 m_pQuickHlpData->Stop( rSh );
1448 if ( m_rView.GetDrawFuncPtr() && m_bInsFrame )
1454 bool bFlushBuffer =
false;
1455 bool bNormalChar =
false;
1456 bool bAppendSpace = m_pQuickHlpData->m_bAppendSpace;
1457 m_pQuickHlpData->m_bAppendSpace =
false;
1463 GetView().GetDocShell()->GetDoc()->dumpAsXml();
1468 SwRootFrame* pLayout = GetView().GetDocShell()->GetWrtShell()->GetLayout();
1495 if( ( bVertText && ( !bTableCursor || bVertTable ) ) ||
1496 ( bTableCursor && bVertTable ) )
1499 if (eDirection == SvxFrameDirection::Vertical_LR_BT)
1554 nEvent = SvMacroItemId::SwFrmKeyInputAlpha;
1556 nEvent = SvMacroItemId::SwFrmKeyInputNoAlpha;
1564 xArgs->
Put(xVar.
get(), 1);
1567 if( SvMacroItemId::SwFrmKeyInputAlpha == nEvent )
1571 xArgs->
Put(xVar.
get(), 2);
1575 if( !sRet.isEmpty() && sRet.toInt32()!=0 )
1591 pAnchor = rHdlList.
GetHdl(SdrHdlKind::Anchor_TR);
1600 uno::Reference< frame::XDispatchRecorder > xRecorder =
1601 m_rView.GetViewFrame()->GetBindings().GetRecorder();
1602 if ( !xRecorder.is() )
1610 OUString sFormulaEntry;
1612 enum class SwKeyState { CheckKey, InsChar, InsTab,
1613 NoNum, NumOff, NumOrNoNum, NumDown, NumUp,
1614 NumIndentInc, NumIndentDec,
1617 NextCell, PrevCell, OutlineUp, OutlineDown,
1618 GlossaryExpand, NextPrevGlossary,
1622 LaunchOLEObject, GoIntoFly, GoIntoDrawing,
1623 EnterDrawHandleMode,
1624 CheckDocReadOnlyKeys,
1625 CheckAutoCorrect, EditFormula,
1626 ColLeftBig, ColRightBig,
1627 ColLeftSmall, ColRightSmall,
1630 CellLeftBig, CellRightBig,
1631 CellLeftSmall, CellRightSmall,
1632 CellTopBig, CellBottomBig,
1633 CellTopSmall, CellBottomSmall,
1635 Fly_Change, Draw_Change,
1642 SwKeyState eKeyState = bIsDocReadOnly ? SwKeyState::CheckDocReadOnlyKeys : SwKeyState::CheckKey;
1643 SwKeyState eNextKeyState = SwKeyState::End;
1646 if (m_nKS_NUMDOWN_Count > 0)
1647 m_nKS_NUMDOWN_Count--;
1649 if (m_nKS_NUMINDENTINC_Count > 0)
1650 m_nKS_NUMINDENTINC_Count--;
1652 while( SwKeyState::End != eKeyState )
1654 SwKeyState eFlyState = SwKeyState::KeyToView;
1658 case SwKeyState::CheckKey:
1659 eKeyState = SwKeyState::KeyToView;
1661 #if OSL_DEBUG_LEVEL > 1
1671 !rKeyCode.
IsMod2() &&
'=' == aCh &&
1686 eKeyState = SwKeyState::EditFormula;
1694 sFormulaEntry =
"=";
1706 eKeyState = SwKeyState::GlossaryExpand;
1713 eKeyState = SwKeyState::ColRightBig;
1714 eFlyState = SwKeyState::Fly_Change;
1716 goto KEYINPUT_CHECKTABLE;
1719 eKeyState = SwKeyState::ColRightSmall;
1720 eFlyState = SwKeyState::Fly_Change;
1722 goto KEYINPUT_CHECKTABLE;
1725 eKeyState = SwKeyState::ColLeftSmall;
1726 goto KEYINPUT_CHECKTABLE;
1729 eKeyState = SwKeyState::ColLeftBig;
1730 goto KEYINPUT_CHECKTABLE;
1733 eKeyState = SwKeyState::CellRightBig;
1734 goto KEYINPUT_CHECKTABLE;
1737 eKeyState = SwKeyState::CellRightSmall;
1738 goto KEYINPUT_CHECKTABLE;
1741 eKeyState = SwKeyState::CellLeftSmall;
1742 goto KEYINPUT_CHECKTABLE;
1745 eKeyState = SwKeyState::CellLeftBig;
1746 goto KEYINPUT_CHECKTABLE;
1749 eKeyState = SwKeyState::ColBottomSmall;
1750 eFlyState = SwKeyState::Fly_Change;
1752 goto KEYINPUT_CHECKTABLE;
1755 eKeyState = SwKeyState::ColBottomBig;
1756 eFlyState = SwKeyState::Fly_Change;
1758 goto KEYINPUT_CHECKTABLE;
1761 eKeyState = SwKeyState::CellBottomSmall;
1762 goto KEYINPUT_CHECKTABLE;
1765 eKeyState = SwKeyState::CellBottomBig;
1766 goto KEYINPUT_CHECKTABLE;
1769 eKeyState = SwKeyState::CellTopBig;
1770 goto KEYINPUT_CHECKTABLE;
1773 eKeyState = SwKeyState::CellTopSmall;
1774 goto KEYINPUT_CHECKTABLE;
1776 KEYINPUT_CHECKTABLE:
1779 if(!pFlyFormat && SwKeyState::KeyToView != eFlyState &&
1782 eKeyState = SwKeyState::Draw_Change;
1785 eKeyState = eFlyState;
1786 else if( SwKeyState::Draw_Change != eKeyState)
1787 eKeyState = SwKeyState::EnterCharCell;
1803 eKeyState = pFlyFormat ? SwKeyState::Fly_Change : SwKeyState::Draw_Change;
1807 eKeyState = SwKeyState::Draw_Change;
1826 eFlyState = SwKeyState::Fly_Change;
1829 goto KEYINPUT_CHECKTABLE_INSDEL;
1833 goto KEYINPUT_CHECKTABLE_INSDEL;
1841 eFlyState = SwKeyState::Fly_Change;
1844 goto KEYINPUT_CHECKTABLE_INSDEL;
1852 eFlyState = SwKeyState::Fly_Change;
1855 goto KEYINPUT_CHECKTABLE_INSDEL;
1858 KEYINPUT_CHECKTABLE_INSDEL:
1863 eKeyState = SwKeyState::KeyToView;
1864 if(SwKeyState::KeyToView != eFlyState)
1868 eKeyState = SwKeyState::Draw_Change;
1870 eKeyState = SwKeyState::Fly_Change;
1880 eKeyState = SwKeyState::NumOrNoNum;
1885 std::unique_ptr<weld::MessageDialog> xInfo(xBuilder->weld_message_dialog(
"InfoReadonlyDialog"));
1887 eKeyState = SwKeyState::End;
1898 eKeyState = SwKeyState::LaunchOLEObject;
1900 eKeyState = SwKeyState::GoIntoFly;
1905 eKeyState = SwKeyState::GoIntoDrawing;
1907 eKeyState = SwKeyState::GoIntoFly;
1911 eKeyState = SwKeyState::GlossaryExpand;
1914 else if( m_aInBuffer.isEmpty() &&
1920 eKeyState = SwKeyState::NumOff;
1921 eNextKeyState = SwKeyState::OutlineLvOff;
1926 SelectionType::Ole | SelectionType::Frame |
1930 eKeyState = SwKeyState::AutoFormatByInput;
1934 eNextKeyState = eKeyState;
1935 eKeyState = SwKeyState::CheckAutoCorrect;
1947 eKeyState = SwKeyState::NoNum;
1950 eKeyState = SwKeyState::SpecialInsert;
1969 || ( rSh.
IsNoNum() && bOnlyBackspaceKey ) ) )
1975 eKeyState = SwKeyState::End;
1980 if (m_nKS_NUMDOWN_Count > 0 &&
1983 eKeyState = SwKeyState::NumUp;
1984 m_nKS_NUMDOWN_Count = 2;
1987 else if (m_nKS_NUMINDENTINC_Count > 0)
1989 eKeyState = SwKeyState::NumIndentDec;
1990 m_nKS_NUMINDENTINC_Count = 2;
2008 bool bCallNumOrNoNum(
false );
2009 if ( bOnlyBackspaceKey && !rSh.
IsNoNum() )
2011 bCallNumOrNoNum =
true;
2013 else if ( !bOnlyBackspaceKey && rSh.
IsNoNum() )
2015 bCallNumOrNoNum =
true;
2017 else if ( bOnlyBackspaceKey
2023 if ( pCurrNumRule !=
nullptr
2026 bCallNumOrNoNum =
true;
2029 if ( bCallNumOrNoNum
2032 eKeyState = SwKeyState::NumOrNoNum;
2040 std::unique_ptr<weld::MessageDialog> xInfo(xBuilder->weld_message_dialog(
"InfoReadonlyDialog"));
2042 eKeyState = SwKeyState::End;
2048 eFlyState = SwKeyState::Fly_Change;
2050 goto KEYINPUT_CHECKTABLE_INSDEL;
2057 eKeyState = SwKeyState::GotoNextFieldMark;
2062 eKeyState = SwKeyState::End;
2071 eKeyState = SwKeyState::NumIndentInc;
2076 eKeyState = SwKeyState::NumDown;
2080 eKeyState = SwKeyState::InsTab;
2087 eKeyState = SwKeyState::NextCell;
2090 eKeyState = SwKeyState::CheckAutoCorrect;
2091 eNextKeyState = SwKeyState::NextCell;
2101 eKeyState = SwKeyState::NextObject;
2104 eKeyState = SwKeyState::InsTab;
2112 eKeyState = SwKeyState::OutlineDown;
2121 eKeyState = SwKeyState::GotoPrevFieldMark;
2126 eKeyState = SwKeyState::End;
2135 eKeyState = SwKeyState::NumIndentDec;
2137 eKeyState = SwKeyState::NumUp;
2142 eKeyState = SwKeyState::PrevCell;
2145 eKeyState = SwKeyState::CheckAutoCorrect;
2146 eNextKeyState = SwKeyState::PrevCell;
2156 eKeyState = SwKeyState::PrevObject;
2159 eKeyState = SwKeyState::End;
2166 eKeyState = SwKeyState::OutlineUp;
2178 aTmpQHD.
Next( pACorr &&
2180 eKeyState = SwKeyState::NextPrevGlossary;
2183 eKeyState = SwKeyState::InsTab;
2188 eKeyState = SwKeyState::EnterDrawHandleMode;
2191 eKeyState = SwKeyState::InsTab;
2204 eKeyState = SwKeyState::NextPrevGlossary;
2210 eKeyState = SwKeyState::EnterDrawHandleMode;
2219 eKeyState = SwKeyState::GoIntoFly;
2222 eKeyState = SwKeyState::GoIntoDrawing;
2224 eKeyState = SwKeyState::GoIntoFly;
2231 case SwKeyState::CheckDocReadOnlyKeys:
2233 eKeyState = SwKeyState::KeyToView;
2238 bNormalChar =
false;
2239 eKeyState = SwKeyState::End;
2249 SwKeyState::PrevObject : SwKeyState::NextObject;
2253 GetView().GetViewFrame()->GetDispatcher()->Execute(
2265 eKeyState = SwKeyState::GoIntoFly;
2273 bNormalChar =
false;
2274 eKeyState = SwKeyState::End;
2284 case SwKeyState::EnterCharCell:
2286 eKeyState = SwKeyState::KeyToView;
2291 eKeyState = SwKeyState::End;
2296 eKeyState = SwKeyState::End;
2303 case SwKeyState::KeyToView:
2305 eKeyState = SwKeyState::End;
2317 if( !m_aInBuffer.isEmpty() && ( !bNormalChar || bIsDocReadOnly ))
2324 auto xInfo(std::make_shared<weld::GenericDialogController>(
GetFrameWeld(),
"modules/swriter/ui/inforeadonlydialog.ui",
"InfoReadonlyDialog"));
2326 eKeyState = SwKeyState::End;
2328 else if( m_rView.KeyInput( aKeyEvent ) )
2330 bFlushBuffer =
true;
2331 bNormalChar =
false;
2339 GetView().GetViewFrame()->GetBindings().Execute(SID_COPY);
2341 if( !bIsDocReadOnly && bNormalChar )
2348 bool bTextBox =
false;
2355 if (bDrawObject && !bTextBox)
2361 if (
auto pSwDrawTextShell = dynamic_cast< SwDrawTextShell *>( m_rView.GetCurShell() ) )
2362 pSwDrawTextShell->Init();
2370 m_rView.AttrChangedNotify(
nullptr);
2373 eKeyState = SwKeyState::InsChar;
2377 bNormalChar =
false;
2378 Window::KeyInput( aKeyEvent );
2383 case SwKeyState::LaunchOLEObject:
2386 eKeyState = SwKeyState::End;
2389 case SwKeyState::GoIntoFly:
2393 m_rView.AttrChangedNotify(
nullptr);
2395 eKeyState = SwKeyState::End;
2398 case SwKeyState::GoIntoDrawing:
2402 SdrObject* pObj = pMark->GetMarkedSdrObj();
2406 if (
auto pSwDrawTextShell = dynamic_cast< SwDrawTextShell *>( m_rView.GetCurShell() ) )
2407 pSwDrawTextShell->Init();
2410 eKeyState = SwKeyState::End;
2413 case SwKeyState::EnterDrawHandleMode:
2418 const_cast<SdrHdlList&
>(rHdlList).TravelFocusHdl(bForward);
2419 eKeyState = SwKeyState::End;
2422 case SwKeyState::InsTab:
2423 if( dynamic_cast<const SwWebView*>( &m_rView) !=
nullptr)
2426 Window::KeyInput( aKeyEvent );
2427 eKeyState = SwKeyState::End;
2432 case SwKeyState::InsChar:
2438 OSL_ENSURE(pFieldmark,
2439 "Where is my FieldMark??");
2444 "where is the otherpos?");
2450 eKeyState = SwKeyState::End;
2455 const bool bIsNormalChar =
2457 if( bAppendSpace && bIsNormalChar &&
2469 (
'*' == aCh ||
'_' == aCh ) ) ||
2470 ( pACorr->
IsAutoCorrFlag( ACFlags::ChgQuotes ) && (
'\"' == aCh ))||
2471 ( pACorr->
IsAutoCorrFlag( ACFlags::ChgSglQuotes ) && (
'\'' == aCh))))
2475 if(
'\"' != aCh &&
'\'' != aCh )
2480 pACorr->
IsAutoCorrFlag( ACFlags::CapitalStartSentence | ACFlags::CapitalStartWord |
2481 ACFlags::ChgOrdinalNumber | ACFlags::AddNonBrkSpace |
2482 ACFlags::ChgToEnEmDash | ACFlags::SetINetAttr |
2483 ACFlags::Autocorrect | ACFlags::TransliterateRTL ) &&
2484 '\"' != aCh &&
'\'' != aCh &&
'*' != aCh &&
'_' != aCh
2492 OUStringBuffer
aBuf(m_aInBuffer);
2494 m_aInBuffer.getLength() + aKeyEvent.
GetRepeat() + 1, aCh);
2495 m_aInBuffer = aBuf.makeStringAndClear();
2499 m_aKeyInputFlushTimer.Start();
2501 eKeyState = SwKeyState::End;
2505 auto xInfo(std::make_shared<weld::GenericDialogController>(
GetFrameWeld(),
"modules/swriter/ui/inforeadonlydialog.ui",
"InfoReadonlyDialog"));
2507 eKeyState = SwKeyState::End;
2511 case SwKeyState::CheckAutoCorrect:
2514 pACorr->
IsAutoCorrFlag( ACFlags::CapitalStartSentence | ACFlags::CapitalStartWord |
2515 ACFlags::ChgOrdinalNumber | ACFlags::TransliterateRTL |
2516 ACFlags::ChgToEnEmDash | ACFlags::SetINetAttr |
2517 ACFlags::Autocorrect ) &&
2523 eKeyState = eNextKeyState;
2529 sal_uInt16 nSlotId = 0;
2533 case SwKeyState::SpecialInsert:
2537 case SwKeyState::NoNum:
2541 case SwKeyState::NumOff:
2545 case SwKeyState::OutlineLvOff:
2548 case SwKeyState::NumDown:
2550 m_nKS_NUMDOWN_Count = 2;
2552 case SwKeyState::NumUp:
2556 case SwKeyState::NumIndentInc:
2558 m_nKS_NUMINDENTINC_Count = 2;
2561 case SwKeyState::GotoNextFieldMark:
2568 case SwKeyState::GotoPrevFieldMark:
2576 case SwKeyState::NumIndentDec:
2580 case SwKeyState::OutlineDown:
2583 case SwKeyState::OutlineUp:
2587 case SwKeyState::NextCell:
2592 case SwKeyState::PrevCell:
2596 case SwKeyState::AutoFormatByInput:
2600 case SwKeyState::NextObject:
2601 case SwKeyState::PrevObject:
2605 m_rView.GetDrawFuncPtr() )
2607 m_rView.GetDrawFuncPtr()->Deactivate();
2608 m_rView.SetDrawFuncPtr(
nullptr);
2609 m_rView.LeaveDrawCreate();
2610 m_rView.AttrChangedNotify(
nullptr);
2616 case SwKeyState::GlossaryExpand:
2621 OUString sFnd(aTmpQHD.
CurStr());
2634 m_pQuickHlpData->m_bAppendSpace =
true;
2639 sFnd = sFnd.copy(aTmpQHD.
CurLen());
2641 m_pQuickHlpData->m_bAppendSpace = !pACorr ||
2648 case SwKeyState::NextPrevGlossary:
2649 m_pQuickHlpData->Move( aTmpQHD );
2650 m_pQuickHlpData->Start(rSh,
false);
2653 case SwKeyState::EditFormula:
2655 const sal_uInt16
nId = SwInputChild::GetChildWindowId();
2660 GetChildWindow( nId ));
2681 case SwKeyState::Fly_Change:
2686 ChangeDrawing( nDir );
2688 ChangeFly( nDir, dynamic_cast<const SwWebView*>( &m_rView) !=
nullptr );
2691 case SwKeyState::Draw_Change :
2692 ChangeDrawing( nDir );
2697 if( nSlotId && m_rView.GetViewFrame()->GetBindings().GetRecorder().is() )
2699 SfxRequest aReq(m_rView.GetViewFrame(), nSlotId );
2702 eKeyState = SwKeyState::End;
2709 GetFrameControlsManager().SetOutlineContentVisibilityButtons();
2714 GetView().GetViewFrame()->GetBindings().Update(
FN_STAT_PAGE );
2717 if( bFlushBuffer && !m_aInBuffer.isEmpty() )
2728 const bool bAutoTextShown
2751 m_bMBPressed =
false;
2770 const bool bOnlyText,
bool bLockView )
2775 int nTmpSetCursor = 0;
2792 SetUseInputLanguage(
false );
2819 if (m_rView.GetPostItMgr()->IsHit(aMEvt.
GetPosPixel()))
2826 pWindow->MouseButtonDown(aMEvt);
2831 m_rView.GetPostItMgr()->SetActiveSidebarWin(
nullptr);
2838 bool bExecFormatPaintbrush = m_pApplyTempl && m_pApplyTempl->m_pFormatClipboard
2839 && m_pApplyTempl->m_pFormatClipboard->HasContent();
2840 if( bExecFormatPaintbrush )
2845 m_bWasShdwCursor =
nullptr != m_pShadCursor;
2846 m_pShadCursor.reset();
2851 bool bOverFly =
false;
2852 bool bPageAnchored =
false;
2853 bool bOverHeaderFooterFly = IsOverHeaderFooterFly( aDocPos, eControl, bOverFly, bPageAnchored );
2855 bool bIsDocReadOnly = m_rView.GetDocShell()->IsReadOnly();
2856 if (bOverHeaderFooterFly && (!bIsDocReadOnly && rSh.
GetCurField()))
2858 bOverHeaderFooterFly =
false;
2861 if ( IsInHeaderFooter( aDocPos, eControl ) || bOverHeaderFooterFly )
2866 bool bActive =
true;
2889 const bool bWasInFooter = aPam.GetPoint()->nNode.GetNode().
FindFooterStartNode() !=
nullptr;
2962 if ( IsChainMode() )
2964 SetChainMode(
false );
2968 rSh.
Chain( *pFormat, aDocPos );
2975 m_rView.SelectShellForDrop();
2977 bool bCallBase =
true;
2979 if( m_pQuickHlpData->m_bIsDisplayed )
2980 m_pQuickHlpData->Stop( rSh );
2981 m_pQuickHlpData->m_bAppendSpace =
false;
2998 m_bIsInMove =
false;
3000 m_aRszMvHdlPt.setX( 0 );
3001 m_aRszMvHdlPt.setY( 0 );
3011 if ( SwTab::SEL_HORI <= nMouseTabCol && SwTab::COLSEL_VERT >= nMouseTabCol )
3017 m_xRowColumnSelectionStart = aDocPos;
3021 m_bMBPressed =
true;
3031 m_rView.SetTabColFromDoc(
true );
3033 m_rView.SetTabRowFromDoc(
true );
3035 m_rView.SetTabColFromDocPos( aDocPos );
3036 m_rView.InvalidateRulerPos();
3037 SfxBindings& rBind = m_rView.GetViewFrame()->GetBindings();
3039 if (RulerColumnDrag(
3042 m_rView.SetTabColFromDoc(
false );
3043 m_rView.SetTabRowFromDoc(
false );
3044 m_rView.InvalidateRulerPos();
3058 m_rView.SetNumRuleNodeFromDoc( pNodeAtPos );
3059 m_rView.InvalidateRulerPos();
3060 SfxBindings& rBind = m_rView.GetViewFrame()->GetBindings();
3065 m_rView.SetNumRuleNodeFromDoc(
nullptr );
3066 m_rView.InvalidateRulerPos();
3074 m_rView.SetNumRuleNodeFromDoc(
nullptr );
3086 bool bOnlyText =
false;
3087 m_bMBPressed =
true;
3089 m_nKS_NUMDOWN_Count = 0;
3104 if( !bIsDocReadOnly &&
3107 nullptr != ( pHdl = pSdrView->
PickHandle(aDocPos) ) &&
3108 ( pHdl->
GetKind() == SdrHdlKind::Anchor ||
3109 pHdl->
GetKind() == SdrHdlKind::Anchor_TR ) )
3118 if (EnterDrawMode(aMEvt, aDocPos))
3123 else if ( m_rView.GetDrawFuncPtr() && m_bInsFrame )
3135 bool bHitHandle = pHdl && pHdl->
GetKind() != SdrHdlKind::Anchor &&
3136 pHdl->
GetKind() != SdrHdlKind::Anchor_TR;
3142 if ( !m_pApplyTempl )
3160 bool bExecHyperlinks = m_rView.GetDocShell()->IsReadOnly();
3161 if ( !bExecHyperlinks )
3167 bExecHyperlinks =
true;
3172 if (0 == nNumberOfClicks && 0 < aMEvt.
GetClicks())
3173 nNumberOfClicks = 4;
3175 bool bExecDrawTextLink =
false;
3186 if (1 == nNumberOfClicks)
3193 if (bExecHyperlinks && pSdrView)
3196 pSdrView->
PickAnything(aMEvt, SdrMouseEventKind::BUTTONDOWN, aVEvt);
3198 if (aVEvt.
eEvent == SdrEventKind::ExecuteUrl)
3199 bExecDrawTextLink =
true;
3203 if (1 == nNumberOfClicks && !bExecDrawTextLink)
3207 if ( m_aActHitType != SdrHitKind::NONE && !rSh.
IsSelFrameMode() &&
3208 !GetView().GetViewFrame()->GetDispatcher()->IsLocked())
3235 m_rView.GetDrawFuncPtr()->Deactivate();
3236 m_rView.SetDrawFuncPtr(
nullptr);
3237 m_rView.LeaveDrawCreate();
3238 m_rView.AttrChangedNotify(
nullptr);
3250 if (!m_rView.GetDrawFuncPtr())
3257 (m_aActHitType == SdrHitKind::NONE ||
3262 if( !bIsDocReadOnly && !m_pAnchorMarker &&
nullptr !=
3264 ( pHdl->
GetKind() == SdrHdlKind::Anchor ||
3265 pHdl->
GetKind() == SdrHdlKind::Anchor_TR ) )
3283 m_rView.AttrChangedNotify(
nullptr);
3286 bool bSelObj = rSh.
SelectObj( aDocPos, nFlag );
3296 m_rView.AttrChangedNotify(
nullptr);
3307 m_rView.GetDrawFuncPtr() )
3309 m_rView.GetDrawFuncPtr()->Deactivate();
3310 m_rView.SetDrawFuncPtr(
nullptr);
3311 m_rView.LeaveDrawCreate();
3312 m_rView.AttrChangedNotify(
nullptr);
3321 switch ( nNumberOfClicks )
3341 GetView().GetViewFrame()->GetBindings().Execute(
3343 SfxCallMode::RECORD|SfxCallMode::SLOT);
3360 GetView().GetViewFrame()->GetBindings().Execute(
3362 SfxCallMode::RECORD|SfxCallMode::SLOT);
3368 EnterDrawTextMode(aDocPos);
3369 if (
auto pSwDrawTextShell = dynamic_cast< SwDrawTextShell *>( m_rView.GetCurShell() ) )
3370 pSwDrawTextShell->Init();
3385 if( !bIsDocReadOnly &&
3452 GetView().GetViewFrame()->GetBindings().Execute(SID_FM_CTL_PROPERTIES);
3481 if ( 3 == nNumberOfClicks )
3502 bool bLockView = m_bWasShdwCursor;
3535 if ( !bExecDrawTextLink )
3543 MoveCursor(rSh, aDocPos, bOnlyText, bLockView);
3618 if (rMarkList.
GetMark(0) ==
nullptr)
3621 m_rView.AttrChangedNotify(
nullptr);
3651 m_rView.AttrChangedNotify(
nullptr);
3659 PointerStyle::RefHand != GetPointer();
3664 if( bExecHyperlinks )
3710 bool bEditableFieldClicked =
false;
3715 bool bEditableField = (aFieldAtPos.
pFndTextAttr !=
nullptr
3718 if (!bEditableField)
3738 bEditableFieldClicked =
true;
3743 bool bOverURLGrf =
false;
3745 bOverURLGrf = bOverSelect =
nullptr != rSh.
IsURLGrfAtPos( aDocPos );
3749 MoveCursor( rSh, aDocPos, bOnlyText, bLockView );
3752 if (!bOverURLGrf && !bExecDrawTextLink && !bOnlyText)
3766 if ( !bOverSelect && bEditableFieldClicked && (!pCursorField ||
3791 MoveCursor(rSh, aDocPos,
false,
true);
3807 }
while (++nPos < nOutlineNodesCount
3827 MoveCursor( rSh, aDocPos, rSh.
IsObjSelectable( aDocPos ), m_bWasShdwCursor );
3840 Window::MouseButtonDown(aMEvt);
3852 bool bChkTableSel =
false;
3854 switch ( nMouseTabCol )
3858 nPointer = PointerStyle::VSizeBar;
3859 bChkTableSel =
true;
3863 nPointer = PointerStyle::HSizeBar;
3864 bChkTableSel =
true;
3868 nPointer = PointerStyle::TabSelectSE;
3872 nPointer = PointerStyle::TabSelectSW;
3876 nPointer = PointerStyle::TabSelectS;
3879 nPointer = PointerStyle::TabSelectE;
3883 nPointer = PointerStyle::TabSelectW;
3888 if ( PointerStyle::Null != nPointer &&
3893 SetPointer( nPointer );
3904 ? PointerStyle::VSizeBar
3905 : PointerStyle::HSizeBar;
3906 SetPointer( nPointer );
3921 pWindow->MouseMove(rMEvt);
3928 bool bExecFormatPaintbrush = m_pApplyTempl && m_pApplyTempl->m_pFormatClipboard
3929 && m_pApplyTempl->m_pFormatClipboard->HasContent();
3930 if( bExecFormatPaintbrush )
3952 if (pContentFrame != m_pSavedOutlineFrame)
3955 if (m_pSavedOutlineFrame && !m_pSavedOutlineFrame->IsInDtor() &&
3956 rNds.
GetOutLineNds().
Seek_Entry(static_cast<SwTextFrame*>(m_pSavedOutlineFrame)->GetTextNodeFirst(), &nPos) &&
3961 m_pSavedOutlineFrame = pContentFrame;
3967 GetFrameControlsManager().SetOutlineContentVisibilityButton(aSwContentAtPos.
aFnd.
pNode->
GetTextNode());
3971 else if (m_pSavedOutlineFrame && !m_pSavedOutlineFrame->IsInDtor())
3979 GetTextNodeFirst(), &nPos) &&
3983 m_pSavedOutlineFrame);
3985 m_pSavedOutlineFrame =
nullptr;
3991 m_pShadCursor.reset();
3994 bool bIsDocReadOnly = m_rView.GetDocShell()->IsReadOnly();
4001 const Point aDocPt( PixelToLogic( aPixPt ) );
4003 if ( IsChainMode() )
4012 m_aSaveCallEvent.Clear();
4014 if ( !bIsDocReadOnly && pSdrView && pSdrView->
MouseMove(rMEvt,
this) )
4016 SetPointer( PointerStyle::Text );
4025 if (m_pSavedOutlineFrame && !bInsWin)
4034 m_pSavedOutlineFrame =
nullptr;
4038 if( m_pShadCursor && !bInsWin )
4040 m_pShadCursor.reset();
4043 if( bInsWin && m_xRowColumnSelectionStart )
4046 Point aPos( aDocPt );
4056 aDD = LogicToPixel( aDD );
4058 if ( !aRect.IsInside( aPixPt ) )
4059 StopDDTimer( &rSh, aDocPt );
4062 if(m_rView.GetDrawFuncPtr())
4066 m_rView.GetDrawFuncPtr()->MouseMove( rMEvt );
4069 Point aTmp( aDocPt );
4081 if(aRelPos.X() >= 0)
4085 const SfxPointItem aTmp1( SID_ATTR_POSITION, aRelPos );
4099 if (!bIsDocReadOnly && bInsWin && !m_pApplyTempl && !rSh.
IsInSelect() && changeMousePointer(aDocPt))
4104 bool bDelShadCursor =
true;
4109 if( m_pAnchorMarker )
4121 const Point aOld = m_pAnchorMarker->GetPosForHitTest( *(rSh.
GetOut()) );
4124 if( pSdrView && (
nullptr!=( pHdl = pSdrView->
PickHandle( aOld ) )||
4125 nullptr !=(pHdl = pSdrView->
PickHandle( m_pAnchorMarker->GetHdlPos()) ) ) &&
4126 ( pHdl->
GetKind() == SdrHdlKind::Anchor ||
4127 pHdl->
GetKind() == SdrHdlKind::Anchor_TR ) )
4129 m_pAnchorMarker->ChgHdl( pHdl );
4130 if( aNew.X() || aNew.Y() )
4132 m_pAnchorMarker->
SetPos( aNew );
4133 m_pAnchorMarker->SetLastPos( aDocPt );
4138 m_pAnchorMarker.reset();
4143 if ( !m_bMBPressed )
4145 if ( m_bIsInMove ||
IsMinMove( m_aStartPos, aPixPt ) )
4148 LeaveArea( aDocPt );
4151 if ( m_rView.GetDrawFuncPtr() )
4154 m_rView.GetDrawFuncPtr()->MouseMove( rMEvt );
4170 if ( !m_bMBPressed )
4179 if ( m_bIsInMove ||
IsMinMove( m_aStartPos, aPixPt ) )
4184 const Point aSttPt( PixelToLogic( m_aStartPos ) );
4197 ? SvMacroItemId::SwFrmMove
4198 : SvMacroItemId::SwFrmResize;
4200 if (
nullptr != pFlyFormat)
4201 pMacro = pFlyFormat->GetMacro().GetMacroTable().Get(nEvent);
4202 if (
nullptr != pMacro &&
4204 m_aRszMvHdlPt != aDocPt )
4206 m_aRszMvHdlPt = aDocPt;
4207 sal_uInt32
nPos = 0;
4210 xVar->
PutString( pFlyFormat->GetName() );
4211 xArgs->
Put(xVar.
get(), ++nPos);
4213 if( SvMacroItemId::SwFrmResize == nEvent )
4217 xArgs->
Put(xVar.
get(), ++nPos);
4221 xVar->
PutLong( aDocPt.X() - aSttPt.X() );
4222 xArgs->
Put(xVar.
get(), ++nPos);
4224 xVar->
PutLong( aDocPt.Y() - aSttPt.Y() );
4225 xArgs->
Put(xVar.
get(), ++nPos);
4235 if( !sRet.isEmpty() && sRet.toInt32()!=0 )
4241 if( bIsDocReadOnly )
4252 const Point aSttPt(PixelToLogic(m_aStartPos));
4255 bResizeKeepRatio = bResizeKeepRatio && pHdl->
IsCornerHdl();
4263 pSdrView->
SetOrtho(!bResizeKeepRatio);
4271 pSdrView->
SetOrtho(bResizeKeepRatio);
4280 else if( bIsDocReadOnly )
4285 Point aTmp( aDocPt );
4289 else if(m_bIsInMove)
4294 (
IsMinMove( m_aStartPos,aPixPt ) || m_bIsInMove) &&
4306 Point aTmp( aDocPt );
4318 rSh.
Drag( &aDocPt,
false );
4329 if ( m_pApplyTempl )
4331 UpdatePointer(aDocPt);
4342 m_rView.GetPostItMgr()->SetShadowState(reinterpret_cast<const SwPostItField*>(pField),
false);
4345 m_rView.GetPostItMgr()->SetShadowState(
nullptr,
false);
4348 m_rView.GetPostItMgr()->SetShadowState(
nullptr,
false);
4356 bool bTstShdwCursor =
true;
4364 pINet = static_cast<const SwFormatINetFormat*>(aContentAtPos.
aFnd.
pAttr);
4366 const void* pTmp = pINet;
4371 bTstShdwCursor =
false;
4373 m_aSaveCallEvent.Set( pINet );
4376 IMapObject* pIMapObj = pFormat->GetIMapObject( aDocPt );
4378 m_aSaveCallEvent.Set( pFormat, pIMapObj );
4385 if( m_aSaveCallEvent != aLastCallEvent )
4388 rSh.
CallEvent( SvMacroItemId::OnMouseOut,
4389 aLastCallEvent,
true );
4391 if( !rSh.
CallEvent( SvMacroItemId::OnMouseOver,
4393 m_aSaveCallEvent.Clear();
4396 else if( aLastCallEvent.
HasEvent() )
4399 rSh.
CallEvent( SvMacroItemId::OnMouseOut,
4400 aLastCallEvent,
true );
4403 if( bTstShdwCursor && bInsWin && !bIsDocReadOnly &&
4415 if( !m_pShadCursor )
4418 if( text::HoriOrientation::RIGHT != eOrient && text::HoriOrientation::CENTER != eOrient )
4419 eOrient = text::HoriOrientation::LEFT;
4420 m_pShadCursor->SetPos( aRect.
Pos(), aRect.
Height(),
static_cast< sal_uInt16
>(eOrient) );
4421 bDelShadCursor =
false;
4429 rSh.
Drag( &aDocPt,
false );
4436 if( bDelShadCursor && m_pShadCursor )
4438 m_pShadCursor.reset();
4440 m_bWasShdwCursor =
false;
4452 pWindow->MouseButtonUp(rMEvt);
4457 bool bCallBase =
true;
4459 bool bCallShadowCursor = m_bWasShdwCursor;
4460 m_bWasShdwCursor =
false;
4463 m_pShadCursor.reset();
4466 m_xRowColumnSelectionStart.reset();
4472 m_rView.SetTabColFromDoc(
false );
4473 m_rView.SetNumRuleNodeFromDoc(
nullptr);
4492 if ( !m_bMBPressed )
4504 StopDDTimer( &rSh, aDocPt );
4505 m_bMBPressed =
false;
4508 rSh.
EndDrag( &aDocPt,
false );
4513 if ((PixelToLogic(m_aStartPos).
Y() == (aDocPos.Y())) && (PixelToLogic(m_aStartPos).X() == (aDocPos.X())))
4531 pSdrView->
MarkObj(pShape, pPV);
4539 if( m_pAnchorMarker )
4541 if(m_pAnchorMarker->GetHdl())
4544 m_pAnchorMarker->GetHdl()->SetSelected(
false);
4547 Point aPnt( m_pAnchorMarker->GetLastPos() );
4548 m_pAnchorMarker.reset();
4549 if( aPnt.X() || aPnt.Y() )
4552 if ( m_bInsDraw && m_rView.GetDrawFuncPtr() )
4554 if ( m_rView.GetDrawFuncPtr()->MouseButtonUp( rMEvt ) )
4556 if (m_rView.GetDrawFuncPtr())
4558 m_rView.GetDrawFuncPtr()->Deactivate();
4560 if (!m_rView.IsDrawMode())
4562 m_rView.SetDrawFuncPtr(
nullptr);
4563 SfxBindings& rBind = m_rView.GetViewFrame()->GetBindings();
4572 if (!m_rView.GetDrawFuncPtr())
4582 const Point aDocPos( PixelToLogic( m_aStartPos ) );
4587 m_rView.AttrChangedNotify(
nullptr);
4590 m_rView.GetDrawFuncPtr()->BreakCreate();
4593 if (IsMouseCaptured())
4597 bool bPopMode =
false;
4603 if ( m_rView.GetDrawFuncPtr() && m_rView.GetDrawFuncPtr()->MouseButtonUp(rMEvt) )
4605 m_rView.GetDrawFuncPtr()->Deactivate();
4606 m_rView.AttrChangedNotify(
nullptr);
4609 if ( m_rView.GetDrawFuncPtr() && m_bInsFrame )
4629 Point aEndPt, aSttPt;
4640 if ( aSttPt != aEndPt )
4643 rSh.
Copy(rSh, aSttPt, aEndPt);
4648 rSh.
EndDrag( &aDocPt,
false );
4658 ? SvMacroItemId::SwFrmMove
4659 : SvMacroItemId::SwFrmResize;
4661 if (
nullptr != pFlyFormat)
4662 pMacro = pFlyFormat->GetMacro().GetMacroTable().Get(nEvent);
4663 if (
nullptr != pMacro)
4665 const Point aSttPt( PixelToLogic( m_aStartPos ) );
4666 m_aRszMvHdlPt = aDocPt;
4667 sal_uInt32
nPos = 0;
4670 xVar->
PutString( pFlyFormat->GetName() );
4671 xArgs->
Put(xVar.
get(), ++nPos);
4673 if( SvMacroItemId::SwFrmResize == nEvent )
4676 xVar->
PutUShort( static_cast< sal_uInt16 >(eOldSdrMoveHdl) );
4677 xArgs->
Put(xVar.
get(), ++nPos);
4681 xVar->
PutLong( aDocPt.X() - aSttPt.X() );
4682 xArgs->
Put(xVar.
get(), ++nPos);
4684 xVar->
PutLong( aDocPt.Y() - aSttPt.Y() );
4685 xArgs->
Put(xVar.
get(), ++nPos);
4689 xArgs->
Put(xVar.
get(), ++nPos);
4698 rSh.
EndDrag( &aDocPt,
false );
4710 rSh.
EndDrag( &aDocPt,
false );
4720 rSh.
EndDrag( &aDocPt,
false );
4733 const Point aDocPos( PixelToLogic( m_aStartPos ) );
4742 rSh.
EndDrag( &aDocPt,
false );
4751 bool bExecHyperlinks = m_rView.GetDocShell()->IsReadOnly();
4752 if ( !bExecHyperlinks )
4758 bExecHyperlinks =
true;
4764 bExecHyperlinks =
false;
4786 bool bAddMode(
false);
4802 const Point aDocPos( PixelToLogic( m_aStartPos ) );
4827 m_rView.ExecSmartTagPopup( aDocPt );
4831 OSL_ENSURE( aContentAtPos.
aFnd.
pFieldmark !=
nullptr,
"where is my field ptr???");
4848 OUString val((*static_cast<const SwFormatINetFormat*>(aContentAtPos.
aFnd.
pAttr)).GetValue());
4849 if (val.startsWith(
"#"))
4850 bExecHyperlinks =
true;
4852 if ( bExecHyperlinks && aContentAtPos.
aFnd.
pAttr )
4857 bCallShadowCursor =
false;
4862 if( !rSh.
GetContentAtPos( aDocPt, aContentAtPos,
true ) && bExecHyperlinks )
4867 pSdrView->
PickAnything(rMEvt, SdrMouseEventKind::BUTTONDOWN, aVEvt);
4869 if (pSdrView && aVEvt.
eEvent == SdrEventKind::ExecuteUrl)
4875 const OUString& sURL(pField->
GetURL());
4879 bCallShadowCursor =
false;
4886 bCallShadowCursor =
false;
4891 if( bCallShadowCursor &&
4895 !GetConnectMetaFile() &&
4933 if( pFormatClipboard )
4936 SwWrtShell& rWrtShell = m_rView.GetWrtShell();
4938 bool bNoCharacterFormats =
false;
4939 bool bNoParagraphFormats =
true;
4946 bNoCharacterFormats =
true;
4947 bNoParagraphFormats =
false;
4950 bNoParagraphFormats =
false;
4953 pFormatClipboard->
Paste( rWrtShell, pPool, bNoCharacterFormats, bNoParagraphFormats );
4960 m_pUserMarker.reset();
4962 else if( m_pApplyTempl->nColor )
4965 switch( m_pApplyTempl->nColor )
4967 case SID_ATTR_CHAR_COLOR_EXT:
4970 case SID_ATTR_CHAR_COLOR_BACKGROUND_EXT:
4978 m_pApplyTempl->nUndo =
4988 m_aTemplateTimer.Stop();
4993 m_aTemplateTimer.Start();
4999 OUString aStyleName;
5000 switch ( m_pApplyTempl->eType )
5002 case SfxStyleFamily::Para:
5007 m_pApplyTempl->nUndo =
5010 if ( m_pApplyTempl->aColl.pTextColl )
5011 aStyleName = m_pApplyTempl->aColl.pTextColl->GetName();
5014 case SfxStyleFamily::Char:
5022 m_pApplyTempl->nUndo =
5025 if ( m_pApplyTempl->aColl.pCharFormat )
5026 aStyleName = m_pApplyTempl->aColl.pCharFormat->GetName();
5029 case SfxStyleFamily::Frame :
5032 if(dynamic_cast<const SwFlyFrameFormat*>( pFormat) )
5034 rSh.
SetFrameFormat( m_pApplyTempl->aColl.pFrameFormat,
false, &aDocPt );
5035 m_pApplyTempl->nUndo =
5038 if( m_pApplyTempl->aColl.pFrameFormat )
5039 aStyleName = m_pApplyTempl->aColl.pFrameFormat->GetName();
5043 case SfxStyleFamily::Page:
5046 if ( m_pApplyTempl->aColl.pPageDesc )
5047 aStyleName = m_pApplyTempl->aColl.pPageDesc->GetName();
5048 m_pApplyTempl->nUndo =
5052 case SfxStyleFamily::Pseudo: