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;
1567 if( SvMacroItemId::SwFrmKeyInputAlpha == nEvent )
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(rMEvt.
GetPosPixel()))
2826 pWindow->MouseButtonDown(rMEvt);
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( rMEvt,
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();
3063 if ( RulerMarginDrag( rMEvt,
3066 m_rView.SetNumRuleNodeFromDoc(
nullptr );
3067 m_rView.InvalidateRulerPos();
3075 m_rView.SetNumRuleNodeFromDoc(
nullptr );
3087 bool bOnlyText =
false;
3088 m_bMBPressed =
true;
3090 m_nKS_NUMDOWN_Count = 0;
3105 if( !bIsDocReadOnly &&
3108 nullptr != ( pHdl = pSdrView->
PickHandle(aDocPos) ) &&
3109 ( pHdl->
GetKind() == SdrHdlKind::Anchor ||
3110 pHdl->
GetKind() == SdrHdlKind::Anchor_TR ) )
3119 if ( EnterDrawMode( rMEvt, aDocPos ) )
3124 else if ( m_rView.GetDrawFuncPtr() && m_bInsFrame )
3136 bool bHitHandle = pHdl && pHdl->
GetKind() != SdrHdlKind::Anchor &&
3137 pHdl->
GetKind() != SdrHdlKind::Anchor_TR;
3143 if ( !m_pApplyTempl )
3161 bool bExecHyperlinks = m_rView.GetDocShell()->IsReadOnly();
3162 if ( !bExecHyperlinks )
3168 bExecHyperlinks =
true;
3173 if ( 0 == nNumberOfClicks && 0 < rMEvt.
GetClicks() )
3174 nNumberOfClicks = 4;
3176 bool bExecDrawTextLink =
false;
3187 if (1 == nNumberOfClicks)
3194 if (bExecHyperlinks && pSdrView)
3197 pSdrView->
PickAnything(rMEvt, SdrMouseEventKind::BUTTONDOWN, aVEvt);
3199 if (aVEvt.
eEvent == SdrEventKind::ExecuteUrl)
3200 bExecDrawTextLink =
true;
3204 if (1 == nNumberOfClicks && !bExecDrawTextLink)
3208 if ( m_aActHitType != SdrHitKind::NONE && !rSh.
IsSelFrameMode() &&
3209 !GetView().GetViewFrame()->GetDispatcher()->IsLocked())
3236 m_rView.GetDrawFuncPtr()->Deactivate();
3237 m_rView.SetDrawFuncPtr(
nullptr);
3238 m_rView.LeaveDrawCreate();
3239 m_rView.AttrChangedNotify(
nullptr);
3251 if (!m_rView.GetDrawFuncPtr())
3258 (m_aActHitType == SdrHitKind::NONE ||
3263 if( !bIsDocReadOnly && !m_pAnchorMarker &&
nullptr !=
3265 ( pHdl->
GetKind() == SdrHdlKind::Anchor ||
3266 pHdl->
GetKind() == SdrHdlKind::Anchor_TR ) )
3284 m_rView.AttrChangedNotify(
nullptr);
3287 bool bSelObj = rSh.
SelectObj( aDocPos, nFlag );
3297 m_rView.AttrChangedNotify(
nullptr);
3308 m_rView.GetDrawFuncPtr() )
3310 m_rView.GetDrawFuncPtr()->Deactivate();
3311 m_rView.SetDrawFuncPtr(
nullptr);
3312 m_rView.LeaveDrawCreate();
3313 m_rView.AttrChangedNotify(
nullptr);
3322 switch ( nNumberOfClicks )
3342 GetView().GetViewFrame()->GetBindings().Execute(
3344 SfxCallMode::RECORD|SfxCallMode::SLOT);
3361 GetView().GetViewFrame()->GetBindings().Execute(
3363 SfxCallMode::RECORD|SfxCallMode::SLOT);
3369 EnterDrawTextMode(aDocPos);
3370 if (
auto pSwDrawTextShell = dynamic_cast< SwDrawTextShell *>( m_rView.GetCurShell() ) )
3371 pSwDrawTextShell->Init();
3386 if( !bIsDocReadOnly &&
3453 GetView().GetViewFrame()->GetBindings().Execute(SID_FM_CTL_PROPERTIES);
3483 if ( 3 == nNumberOfClicks )
3504 bool bLockView = m_bWasShdwCursor;
3537 if ( !bExecDrawTextLink )
3545 MoveCursor(rSh, aDocPos, bOnlyText, bLockView);
3620 if (rMarkList.
GetMark(0) ==
nullptr)
3623 m_rView.AttrChangedNotify(
nullptr);
3653 m_rView.AttrChangedNotify(
nullptr);
3661 PointerStyle::RefHand != GetPointer();
3666 if( bExecHyperlinks )
3712 bool bEditableFieldClicked =
false;
3717 bool bEditableField = (aFieldAtPos.
pFndTextAttr !=
nullptr
3720 if (!bEditableField)
3740 bEditableFieldClicked =
true;
3745 bool bOverURLGrf =
false;
3747 bOverURLGrf = bOverSelect =
nullptr != rSh.
IsURLGrfAtPos( aDocPos );
3751 MoveCursor( rSh, aDocPos, bOnlyText, bLockView );
3754 if (!bOverURLGrf && !bExecDrawTextLink && !bOnlyText)
3768 if ( !bOverSelect && bEditableFieldClicked && (!pCursorField ||
3792 MoveCursor(rSh, aDocPos,
false,
true);
3808 }
while (++nPos < nOutlineNodesCount
3829 MoveCursor( rSh, aDocPos, rSh.
IsObjSelectable( aDocPos ), m_bWasShdwCursor );
3842 Window::MouseButtonDown(rMEvt);
3854 bool bChkTableSel =
false;
3856 switch ( nMouseTabCol )
3860 nPointer = PointerStyle::VSizeBar;
3861 bChkTableSel =
true;
3865 nPointer = PointerStyle::HSizeBar;
3866 bChkTableSel =
true;
3870 nPointer = PointerStyle::TabSelectSE;
3874 nPointer = PointerStyle::TabSelectSW;
3878 nPointer = PointerStyle::TabSelectS;
3881 nPointer = PointerStyle::TabSelectE;
3885 nPointer = PointerStyle::TabSelectW;
3890 if ( PointerStyle::Null != nPointer &&
3895 SetPointer( nPointer );
3906 ? PointerStyle::VSizeBar
3907 : PointerStyle::HSizeBar;
3908 SetPointer( nPointer );
3923 pWindow->MouseMove(rMEvt);
3930 bool bExecFormatPaintbrush = m_pApplyTempl && m_pApplyTempl->m_pFormatClipboard
3931 && m_pApplyTempl->m_pFormatClipboard->HasContent();
3932 if( bExecFormatPaintbrush )
3954 if (pContentFrame != m_pSavedOutlineFrame)
3957 if (m_pSavedOutlineFrame && !m_pSavedOutlineFrame->IsInDtor() &&
3958 rNds.
GetOutLineNds().
Seek_Entry(static_cast<SwTextFrame*>(m_pSavedOutlineFrame)->GetTextNodeFirst(), &nPos) &&
3963 m_pSavedOutlineFrame = pContentFrame;
3969 GetFrameControlsManager().SetOutlineContentVisibilityButton(aSwContentAtPos.
aFnd.
pNode->
GetTextNode());
3973 else if (m_pSavedOutlineFrame && !m_pSavedOutlineFrame->IsInDtor())
3981 GetTextNodeFirst(), &nPos) &&
3985 m_pSavedOutlineFrame);
3987 m_pSavedOutlineFrame =
nullptr;
3993 m_pShadCursor.reset();
3996 bool bIsDocReadOnly = m_rView.GetDocShell()->IsReadOnly();
4003 const Point aDocPt( PixelToLogic( aPixPt ) );
4005 if ( IsChainMode() )
4014 m_aSaveCallEvent.Clear();
4016 if ( !bIsDocReadOnly && pSdrView && pSdrView->
MouseMove(rMEvt,
this) )
4018 SetPointer( PointerStyle::Text );
4027 if (m_pSavedOutlineFrame && !bInsWin)
4036 m_pSavedOutlineFrame =
nullptr;
4040 if( m_pShadCursor && !bInsWin )
4042 m_pShadCursor.reset();
4045 if( bInsWin && m_xRowColumnSelectionStart )
4048 Point aPos( aDocPt );
4058 aDD = LogicToPixel( aDD );
4060 if ( !aRect.IsInside( aPixPt ) )
4061 StopDDTimer( &rSh, aDocPt );
4064 if(m_rView.GetDrawFuncPtr())
4068 m_rView.GetDrawFuncPtr()->MouseMove( rMEvt );
4071 Point aTmp( aDocPt );
4083 if(aRelPos.X() >= 0)
4087 const SfxPointItem aTmp1( SID_ATTR_POSITION, aRelPos );
4101 if (!bIsDocReadOnly && bInsWin && !m_pApplyTempl && !rSh.
IsInSelect() && changeMousePointer(aDocPt))
4106 bool bDelShadCursor =
true;
4111 if( m_pAnchorMarker )
4123 const Point aOld = m_pAnchorMarker->GetPosForHitTest( *(rSh.
GetOut()) );
4126 if( pSdrView && (
nullptr!=( pHdl = pSdrView->
PickHandle( aOld ) )||
4127 nullptr !=(pHdl = pSdrView->
PickHandle( m_pAnchorMarker->GetHdlPos()) ) ) &&
4128 ( pHdl->
GetKind() == SdrHdlKind::Anchor ||
4129 pHdl->
GetKind() == SdrHdlKind::Anchor_TR ) )
4131 m_pAnchorMarker->ChgHdl( pHdl );
4132 if( aNew.X() || aNew.Y() )
4134 m_pAnchorMarker->
SetPos( aNew );
4135 m_pAnchorMarker->SetLastPos( aDocPt );
4140 m_pAnchorMarker.reset();
4145 if ( !m_bMBPressed )
4147 if ( m_bIsInMove ||
IsMinMove( m_aStartPos, aPixPt ) )
4150 LeaveArea( aDocPt );
4153 if ( m_rView.GetDrawFuncPtr() )
4156 m_rView.GetDrawFuncPtr()->MouseMove( rMEvt );
4172 if ( !m_bMBPressed )
4181 if ( m_bIsInMove ||
IsMinMove( m_aStartPos, aPixPt ) )
4186 const Point aSttPt( PixelToLogic( m_aStartPos ) );
4199 ? SvMacroItemId::SwFrmMove
4200 : SvMacroItemId::SwFrmResize;
4202 if (
nullptr != pFlyFormat)
4203 pMacro = pFlyFormat->GetMacro().GetMacroTable().Get(nEvent);
4204 if (
nullptr != pMacro &&
4206 m_aRszMvHdlPt != aDocPt )
4208 m_aRszMvHdlPt = aDocPt;
4209 sal_uInt32
nPos = 0;
4212 xVar->
PutString( pFlyFormat->GetName() );
4213 xArgs->
Put32( xVar.
get(), ++nPos );
4215 if( SvMacroItemId::SwFrmResize == nEvent )
4219 xArgs->
Put32( xVar.
get(), ++nPos );
4223 xVar->
PutLong( aDocPt.X() - aSttPt.X() );
4224 xArgs->
Put32( xVar.
get(), ++nPos );
4226 xVar->
PutLong( aDocPt.Y() - aSttPt.Y() );
4227 xArgs->
Put32( xVar.
get(), ++nPos );
4237 if( !sRet.isEmpty() && sRet.toInt32()!=0 )
4243 if( bIsDocReadOnly )
4254 const Point aSttPt(PixelToLogic(m_aStartPos));
4257 bResizeKeepRatio = bResizeKeepRatio && pHdl->
IsCornerHdl();
4265 pSdrView->
SetOrtho(!bResizeKeepRatio);
4273 pSdrView->
SetOrtho(bResizeKeepRatio);
4282 else if( bIsDocReadOnly )
4287 Point aTmp( aDocPt );
4291 else if(m_bIsInMove)
4296 (
IsMinMove( m_aStartPos,aPixPt ) || m_bIsInMove) &&
4308 Point aTmp( aDocPt );
4320 rSh.
Drag( &aDocPt,
false );
4331 if ( m_pApplyTempl )
4333 UpdatePointer(aDocPt);
4344 m_rView.GetPostItMgr()->SetShadowState(reinterpret_cast<const SwPostItField*>(pField),
false);
4347 m_rView.GetPostItMgr()->SetShadowState(
nullptr,
false);
4350 m_rView.GetPostItMgr()->SetShadowState(
nullptr,
false);
4358 bool bTstShdwCursor =
true;
4366 pINet = static_cast<const SwFormatINetFormat*>(aContentAtPos.
aFnd.
pAttr);
4368 const void* pTmp = pINet;
4373 bTstShdwCursor =
false;
4375 m_aSaveCallEvent.Set( pINet );
4378 IMapObject* pIMapObj = pFormat->GetIMapObject( aDocPt );
4380 m_aSaveCallEvent.Set( pFormat, pIMapObj );
4387 if( m_aSaveCallEvent != aLastCallEvent )
4390 rSh.
CallEvent( SvMacroItemId::OnMouseOut,
4391 aLastCallEvent,
true );
4393 if( !rSh.
CallEvent( SvMacroItemId::OnMouseOver,
4395 m_aSaveCallEvent.Clear();
4398 else if( aLastCallEvent.
HasEvent() )
4401 rSh.
CallEvent( SvMacroItemId::OnMouseOut,
4402 aLastCallEvent,
true );
4405 if( bTstShdwCursor && bInsWin && !bIsDocReadOnly &&
4417 if( !m_pShadCursor )
4420 if( text::HoriOrientation::RIGHT != eOrient && text::HoriOrientation::CENTER != eOrient )
4421 eOrient = text::HoriOrientation::LEFT;
4422 m_pShadCursor->SetPos( aRect.
Pos(), aRect.
Height(),
static_cast< sal_uInt16
>(eOrient) );
4423 bDelShadCursor =
false;
4431 rSh.
Drag( &aDocPt,
false );
4438 if( bDelShadCursor && m_pShadCursor )
4440 m_pShadCursor.reset();
4442 m_bWasShdwCursor =
false;
4454 pWindow->MouseButtonUp(rMEvt);
4459 bool bCallBase =
true;
4461 bool bCallShadowCursor = m_bWasShdwCursor;
4462 m_bWasShdwCursor =
false;
4465 m_pShadCursor.reset();
4468 m_xRowColumnSelectionStart.reset();
4474 m_rView.SetTabColFromDoc(
false );
4475 m_rView.SetNumRuleNodeFromDoc(
nullptr);
4494 if ( !m_bMBPressed )
4506 StopDDTimer( &rSh, aDocPt );
4507 m_bMBPressed =
false;
4510 rSh.
EndDrag( &aDocPt,
false );
4515 if ((PixelToLogic(m_aStartPos).
Y() == (aDocPos.Y())) && (PixelToLogic(m_aStartPos).X() == (aDocPos.X())))
4533 pSdrView->
MarkObj(pShape, pPV);
4541 if( m_pAnchorMarker )
4543 if(m_pAnchorMarker->GetHdl())
4546 m_pAnchorMarker->GetHdl()->SetSelected(
false);
4549 Point aPnt( m_pAnchorMarker->GetLastPos() );
4550 m_pAnchorMarker.reset();
4551 if( aPnt.X() || aPnt.Y() )
4554 if ( m_bInsDraw && m_rView.GetDrawFuncPtr() )
4556 if ( m_rView.GetDrawFuncPtr()->MouseButtonUp( rMEvt ) )
4558 if (m_rView.GetDrawFuncPtr())
4560 m_rView.GetDrawFuncPtr()->Deactivate();
4562 if (!m_rView.IsDrawMode())
4564 m_rView.SetDrawFuncPtr(
nullptr);
4565 SfxBindings& rBind = m_rView.GetViewFrame()->GetBindings();
4574 if (!m_rView.GetDrawFuncPtr())
4584 const Point aDocPos( PixelToLogic( m_aStartPos ) );
4589 m_rView.AttrChangedNotify(
nullptr);
4592 m_rView.GetDrawFuncPtr()->BreakCreate();
4595 if (IsMouseCaptured())
4599 bool bPopMode =
false;
4605 if ( m_rView.GetDrawFuncPtr() && m_rView.GetDrawFuncPtr()->MouseButtonUp(rMEvt) )
4607 m_rView.GetDrawFuncPtr()->Deactivate();
4608 m_rView.AttrChangedNotify(
nullptr);
4611 if ( m_rView.GetDrawFuncPtr() && m_bInsFrame )
4631 Point aEndPt, aSttPt;
4642 if ( aSttPt != aEndPt )
4645 rSh.
Copy(rSh, aSttPt, aEndPt);
4650 rSh.
EndDrag( &aDocPt,
false );
4660 ? SvMacroItemId::SwFrmMove
4661 : SvMacroItemId::SwFrmResize;
4663 if (
nullptr != pFlyFormat)
4664 pMacro = pFlyFormat->GetMacro().GetMacroTable().Get(nEvent);
4665 if (
nullptr != pMacro)
4667 const Point aSttPt( PixelToLogic( m_aStartPos ) );
4668 m_aRszMvHdlPt = aDocPt;
4669 sal_uInt32
nPos = 0;
4672 xVar->
PutString( pFlyFormat->GetName() );
4673 xArgs->
Put32( xVar.
get(), ++nPos );
4675 if( SvMacroItemId::SwFrmResize == nEvent )
4678 xVar->
PutUShort( static_cast< sal_uInt16 >(eOldSdrMoveHdl) );
4679 xArgs->
Put32( xVar.
get(), ++nPos );
4683 xVar->
PutLong( aDocPt.X() - aSttPt.X() );
4684 xArgs->
Put32( xVar.
get(), ++nPos );
4686 xVar->
PutLong( aDocPt.Y() - aSttPt.Y() );
4687 xArgs->
Put32( xVar.
get(), ++nPos );
4691 xArgs->
Put32( xVar.
get(), ++nPos );
4700 rSh.
EndDrag( &aDocPt,
false );
4712 rSh.
EndDrag( &aDocPt,
false );
4722 rSh.
EndDrag( &aDocPt,
false );
4735 const Point aDocPos( PixelToLogic( m_aStartPos ) );
4744 rSh.
EndDrag( &aDocPt,
false );
4753 bool bExecHyperlinks = m_rView.GetDocShell()->IsReadOnly();
4754 if ( !bExecHyperlinks )
4760 bExecHyperlinks =
true;
4766 bExecHyperlinks =
false;
4788 bool bAddMode(
false);
4804 const Point aDocPos( PixelToLogic( m_aStartPos ) );
4829 m_rView.ExecSmartTagPopup( aDocPt );
4833 OSL_ENSURE( aContentAtPos.
aFnd.
pFieldmark !=
nullptr,
"where is my field ptr???");
4850 OUString val((*static_cast<const SwFormatINetFormat*>(aContentAtPos.
aFnd.
pAttr)).GetValue());
4851 if (val.startsWith(
"#"))
4852 bExecHyperlinks =
true;
4854 if ( bExecHyperlinks && aContentAtPos.
aFnd.
pAttr )
4859 bCallShadowCursor =
false;
4864 if( !rSh.
GetContentAtPos( aDocPt, aContentAtPos,
true ) && bExecHyperlinks )
4869 pSdrView->
PickAnything(rMEvt, SdrMouseEventKind::BUTTONDOWN, aVEvt);
4871 if (pSdrView && aVEvt.
eEvent == SdrEventKind::ExecuteUrl)
4877 const OUString& sURL(pField->
GetURL());
4881 bCallShadowCursor =
false;
4888 bCallShadowCursor =
false;
4893 if( bCallShadowCursor &&
4897 !GetConnectMetaFile() &&
4935 if( pFormatClipboard )
4938 SwWrtShell& rWrtShell = m_rView.GetWrtShell();
4940 bool bNoCharacterFormats =
false;
4941 bool bNoParagraphFormats =
true;
4948 bNoCharacterFormats =
true;
4949 bNoParagraphFormats =
false;
4952 bNoParagraphFormats =
false;
4955 pFormatClipboard->
Paste( rWrtShell, pPool, bNoCharacterFormats, bNoParagraphFormats );
4962 m_pUserMarker.reset();
4964 else if( m_pApplyTempl->nColor )
4967 switch( m_pApplyTempl->nColor )
4969 case SID_ATTR_CHAR_COLOR_EXT:
4972 case SID_ATTR_CHAR_COLOR_BACKGROUND_EXT:
4980 m_pApplyTempl->nUndo =
4990 m_aTemplateTimer.Stop();
4995 m_aTemplateTimer.Start();
5001 OUString aStyleName;
5002 switch ( m_pApplyTempl->eType )
5004 case SfxStyleFamily::Para:
5009 m_pApplyTempl->nUndo =
5012 if ( m_pApplyTempl->aColl.pTextColl )
5013 aStyleName = m_pApplyTempl->aColl.pTextColl->GetName();
5016 case SfxStyleFamily::Char:
5024 m_pApplyTempl->nUndo =
5027 if ( m_pApplyTempl->aColl.pCharFormat )
5028 aStyleName = m_pApplyTempl->aColl.pCharFormat->GetName();
5031 case SfxStyleFamily::Frame :
5034 if(dynamic_cast<const SwFlyFrameFormat*>( pFormat) )
5036 rSh.
SetFrameFormat( m_pApplyTempl->aColl.pFrameFormat,
false, &aDocPt );
5037 m_pApplyTempl->nUndo =
5040 if( m_pApplyTempl->aColl.pFrameFormat )
5041 aStyleName = m_pApplyTempl->aColl.pFrameFormat->GetName();
5045 case SfxStyleFamily::Page:
5048 if ( m_pApplyTempl->aColl.pPageDesc )
5049 aStyleName = m_pApplyTempl->aColl.pPageDesc->GetName();
5050 m_pApplyTempl->nUndo =
5054 case SfxStyleFamily::Pseudo: