/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * This file incorporates work covered by the following license notice: * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed * with this work for additional information regarding copyright * ownership. The ASF licenses this file to you under the Apache * License, Version 2.0 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
// Used to draw the guide line while resizing the comment sidebar width static tools::Rectangle aLastCommentSidebarPos;
// Usually in MouseButtonUp a selection is revoked when the selection is // not currently being pulled open. Unfortunately in MouseButtonDown there // is being selected at double/triple click. That selection is completely // finished in the Handler and thus can't be distinguished in the Up. // To resolve this g_bHoldSelection is set in Down and evaluated in Up. staticbool g_bHoldSelection = false;
/// Check if the selected shape has a TextBox: if so, go into that instead. staticbool lcl_goIntoTextBox(SwEditWin& rEditWin, SwWrtShell& rSh)
{
SdrMark* pMark = rSh.GetDrawView()->GetMarkedObjectList().GetMark(0); if (!pMark) returnfalse;
SdrObject* pSdrObject = pMark->GetMarkedSdrObj();
SwFrameFormat* pObjectFormat = ::FindFrameFormat(pSdrObject); if (SwFrameFormat* pTextBoxFormat = SwTextBoxHelper::getOtherTextBoxFormat(pObjectFormat, RES_DRAWFRMFMT))
{
SdrObject* pTextBox = pTextBoxFormat->FindRealSdrObject();
SdrView* pSdrView = rSh.GetDrawView(); // Unmark the shape.
pSdrView->UnmarkAllObj(); // Mark the textbox.
rSh.SelectObj(Point(), SW_ALLOW_TEXTBOX, pTextBox); // Clear the DrawFuncPtr.
rEditWin.StopInsFrame(); returntrue;
} returnfalse;
}
/// Assists with auto-completion of AutoComplete words and AutoText names. struct QuickHelpData
{ /// Strings that at least partially match an input word, and match length.
std::vector<std::pair<OUString, sal_uInt16>> m_aHelpStrings; /// Index of the current help string.
sal_uInt16 nCurArrPos; static constexpr sal_uInt16 nNoPos = std::numeric_limits<sal_uInt16>::max();
/// Help data stores AutoText names rather than AutoComplete words. bool m_bIsAutoText; /// Display help string as a tip rather than inline. bool m_bIsTip; /// Tip ID when a help string is displayed as a tip. void* nTipId; /// Append a space character to the displayed help string (if appropriate). bool m_bAppendSpace;
/// Help string is currently displayed. bool m_bIsDisplayed;
/** * For MouseButtonDown - determine whether a DrawObject * a NO SwgFrame was hit! Shift/Ctrl should only result * in selecting, with DrawObjects; at SwgFlys to trigger * hyperlinks if applicable (Download/NewWindow!)
*/ staticbool IsDrawObjSelectable( const SwWrtShell& rSh, const Point& rPt )
{ bool bRet = true;
SdrObject* pObj; switch( rSh.GetObjCntType( rPt, pObj ))
{ case OBJCNT_NONE: case OBJCNT_FLY: case OBJCNT_GRF: case OBJCNT_OLE:
bRet = false; break; default:; //prevent warning
} return bRet;
}
m_aActHitType = SdrHitKind::NONE;
PointerStyle eStyle = PointerStyle::Text; if ( !pSdrView )
bCntAtPos = true; elseif ( (bHitHandle = (pSdrView->PickHandle(rLPt) != nullptr)) )
{
m_aActHitType = SdrHitKind::Object;
bPrefSdrPointer = true;
} else
{ constbool bNotInSelObj = !rSh.IsInsideSelectedObj( rLPt ); if ( m_rView.GetDrawFuncPtr() && !m_bInsDraw && bNotInSelObj )
{
m_aActHitType = SdrHitKind::Object; if (IsObjectSelect())
eStyle = PointerStyle::Arrow; else
bPrefSdrPointer = true;
} else
{
SdrPageView* pPV = nullptr;
pSdrView->SetHitTolerancePixel( HIT_PIX );
SdrObject* pObj = (bNotInSelObj && bExecHyperlinks) ?
pSdrView->PickObj(rLPt, pSdrView->getHitTolLog(), pPV, SdrSearchOptions::PICKMACRO) :
nullptr; if (pObj)
{
SdrObjMacroHitRec aTmp;
aTmp.aPos = rLPt;
aTmp.pPageView = pPV;
SetPointer( pObj->GetMacroPointer( aTmp ) ); return;
} else
{ // dvo: IsObjSelectable() eventually calls SdrView::PickObj, so // apparently this is used to determine whether this is a // drawling layer object or not. if ( rSh.IsObjSelectable( rLPt ) )
{ if (pSdrView->IsTextEdit())
{
m_aActHitType = SdrHitKind::NONE;
bPrefSdrPointer = true;
} else
{
SdrViewEvent aVEvt;
SdrHitKind eHit = pSdrView->PickAnything(rLPt, aVEvt);
if (eHit == SdrHitKind::UrlField && bExecHyperlinks)
{
m_aActHitType = SdrHitKind::Object;
bPrefSdrPointer = true;
} else
{ // if we're over a selected object, we show an // ARROW by default. We only show a MOVE if 1) the // object is selected, and 2) it may be moved // (i.e., position is not protected). bool bMovable =
(!bNotInSelObj) &&
(rSh.GetSelectedObjCount() || rSh.IsFrameSelected()) &&
(rSh.IsSelObjProtected(FlyProtectFlags::Pos) == FlyProtectFlags::NONE);
SdrObject* pSelectableObj = rSh.GetObjAt(rLPt); // Don't update pointer if this is a background image only. if (pSelectableObj->GetLayer() != rSh.GetDoc()->getIDocumentDrawModelAccess().GetHellId())
eStyle = bMovable ? PointerStyle::Move : PointerStyle::Arrow;
m_aActHitType = SdrHitKind::Object;
}
}
} else
{ if ( rSh.IsFrameSelected() && !bNotInSelObj )
{ // dvo: this branch appears to be dead and should be // removed in a future version. Reason: The condition // !bNotInSelObj means that this branch will only be // executed in the cursor points inside a selected // object. However, if this is the case, the previous // if( rSh.IsObjSelectable(rLPt) ) must always be true: // rLPt is inside a selected object, then obviously // rLPt is over a selectable object. if (rSh.IsSelObjProtected(FlyProtectFlags::Size) != FlyProtectFlags::NONE)
eStyle = PointerStyle::NotAllowed; else
eStyle = PointerStyle::Move;
m_aActHitType = SdrHitKind::Object;
} else
{ if ( m_rView.GetDrawFuncPtr() )
bPrefSdrPointer = true; else
bCntAtPos = true;
}
}
}
}
} if ( bPrefSdrPointer )
{ if (bIsViewReadOnly || (rSh.GetSelectedObjCount() && rSh.IsSelObjProtected(FlyProtectFlags::Content) != FlyProtectFlags::NONE))
SetPointer( PointerStyle::NotAllowed ); else
{ if (m_rView.GetDrawFuncPtr() && m_rView.GetDrawFuncPtr()->IsInsertForm() && !bHitHandle)
SetPointer( PointerStyle::DrawRect ); else
SetPointer( pSdrView->GetPreferredPointer( rLPt, rSh.GetOut() ) );
}
} else
{ if( !rSh.IsPageAtPos( rLPt ) || m_pAnchorMarker )
eStyle = PointerStyle::Arrow; else
{ // Even if we already have something, prefer URLs if possible.
SwContentAtPos aUrlPos(IsAttrAtPos::InetAttr); if (bCntAtPos || rSh.GetContentAtPos(rLPt, aUrlPos))
{
SwContentAtPos aSwContentAtPos(
IsAttrAtPos::Field |
IsAttrAtPos::ClickField |
IsAttrAtPos::InetAttr |
IsAttrAtPos::Footnote |
IsAttrAtPos::SmartTag); if( rSh.GetContentAtPos( rLPt, aSwContentAtPos) )
{ // Is edit inline input field if (IsAttrAtPos::Field == aSwContentAtPos.eContentAtPos
&& aSwContentAtPos.pFndTextAttr != nullptr
&& aSwContentAtPos.pFndTextAttr->Which() == RES_TXTATR_INPUTFIELD)
{ const SwField *pCursorField = rSh.CursorInsideInputField() ? rSh.GetCurField( true ) : nullptr; if (!(pCursorField && pCursorField == aSwContentAtPos.pFndTextAttr->GetFormatField().GetField()))
eStyle = PointerStyle::RefHand;
} else
{ constbool bClickToFollow = IsAttrAtPos::InetAttr == aSwContentAtPos.eContentAtPos ||
IsAttrAtPos::SmartTag == aSwContentAtPos.eContentAtPos; if( !bClickToFollow ||
(IsAttrAtPos::InetAttr == aSwContentAtPos.eContentAtPos && bExecHyperlinks) ||
(IsAttrAtPos::SmartTag == aSwContentAtPos.eContentAtPos && bExecSmarttags) )
eStyle = PointerStyle::RefHand;
}
} elseif (GetView().GetWrtShell().GetViewOptions()->IsShowOutlineContentVisibilityButton())
{
aSwContentAtPos.eContentAtPos = IsAttrAtPos::Outline; if (rSh.GetContentAtPos(rLPt, aSwContentAtPos))
{ if (IsAttrAtPos::Outline == aSwContentAtPos.eContentAtPos)
{ if (nModifier == KEY_MOD1)
{
eStyle = PointerStyle::RefHand; // set quick help if(aSwContentAtPos.aFnd.pNode && aSwContentAtPos.aFnd.pNode->IsTextNode())
{ const SwNodes& rNds = GetView().GetWrtShell().GetDoc()->GetNodes();
SwOutlineNodes::size_type nPos;
rNds.GetOutLineNds().Seek_Entry(aSwContentAtPos.aFnd.pNode->GetTextNode(), &nPos);
SwOutlineNodes::size_type nOutlineNodesCount
= rSh.getIDocumentOutlineNodesAccess()->getOutlineNodesCount(); int nLevel = rSh.getIDocumentOutlineNodesAccess()->getOutlineLevel(nPos);
OUString sQuickHelp(SwResId(STR_CLICK_OUTLINE_CONTENT_TOGGLE_VISIBILITY)); if (!rSh.GetViewOptions()->IsTreatSubOutlineLevelsAsContent()
&& nPos + 1 < nOutlineNodesCount
&& rSh.getIDocumentOutlineNodesAccess()->getOutlineLevel(nPos + 1) > nLevel)
sQuickHelp += " (" + SwResId(STR_CLICK_OUTLINE_CONTENT_TOGGLE_VISIBILITY_EXT) + ")";
SetQuickHelpText(sQuickHelp);
}
}
}
}
}
}
}
// which kind of text pointer have we to show - horz / vert - ? if( PointerStyle::Text == eStyle && rSh.IsInVerticalText( &rLPt ))
eStyle = PointerStyle::TextVertical; elseif (rSh.GetViewOptions()->CanHideWhitespace() &&
rSh.GetLayout()->IsBetweenPages(rLPt))
{ if (rSh.GetViewOptions()->IsHideWhitespaceMode())
eStyle = PointerStyle::ShowWhitespace; else
eStyle = PointerStyle::HideWhitespace;
}
if( m_pShadCursor )
{ if( text::HoriOrientation::LEFT == m_eOrient ) // Arrow to the right
eStyle = PointerStyle::AutoScrollE; else// Arrow to the left
eStyle = PointerStyle::AutoScrollW;
}
// It can be that a "jump" over a table cannot be accomplished like // that. So we jump over the table by Up/Down here. const SwRect& rVisArea = rSh.VisArea(); if( aOldVis == rVisArea && !rSh.IsStartOfDoc() && !rSh.IsEndOfDoc() )
{ // take the center point of VisArea to // decide in which direction the user want. if( aModPt.Y() < ( rVisArea.Top() + rVisArea.Height() / 2 ) )
rSh.Up( true ); else
rSh.Down( true );
}
}
//return INVALID_HINT if language should not be explicitly overridden, the correct //HintId to use for the eBufferLanguage otherwise static sal_uInt16 lcl_isNonDefaultLanguage(LanguageType eBufferLanguage, SwView const & rView, const OUString &rInBuffer)
{
sal_uInt16 nWhich = INVALID_HINT;
//If the option to IgnoreLanguageChange is set, short-circuit this method //which results in the document/paragraph language remaining the same //despite a change to the keyboard/input language
SvtSysLocaleOptions aSysLocaleOptions; if(aSysLocaleOptions.IsIgnoreLanguageChange())
{ return INVALID_HINT;
}
bool bLang = true; if(eBufferLanguage != LANGUAGE_DONTKNOW)
{ switch( SvtLanguageOptions::GetI18NScriptTypeOfLanguage( eBufferLanguage ))
{ case i18n::ScriptType::ASIAN: nWhich = RES_CHRATR_CJK_LANGUAGE; break; case i18n::ScriptType::COMPLEX: nWhich = RES_CHRATR_CTL_LANGUAGE; break; case i18n::ScriptType::LATIN: nWhich = RES_CHRATR_LANGUAGE; break; default: bLang = false;
} if(bLang)
{
SfxItemSet aLangSet(rView.GetPool(), nWhich, nWhich);
SwWrtShell& rSh = rView.GetWrtShell();
rSh.GetCurAttr(aLangSet); if(SfxItemState::DEFAULT <= aLangSet.GetItemState(nWhich))
{
LanguageType eLang = static_cast<const SvxLanguageItem&>(aLangSet.Get(nWhich)).GetLanguage(); if ( eLang == eBufferLanguage )
{ // current language attribute equal to language reported from system
bLang = false;
} elseif ( !g_bInputLanguageSwitched && RES_CHRATR_LANGUAGE == nWhich )
{ // special case: switching between two "LATIN" languages // In case the current keyboard setting might be suitable // for both languages we can't safely assume that the user // wants to use the language reported from the system, // except if we knew that it was explicitly switched (thus // the check for "bInputLangeSwitched").
// The language reported by the system could be just the // system default language that the user is not even aware // of, because no language selection tool is installed at // all. In this case the OOo language should get preference // as it might have been selected by the user explicitly.
// Usually this case happens if the OOo language is // different to the system language but the system keyboard // is still suitable for the OOo language (e.g. writing // English texts with a German keyboard).
// For non-latin keyboards overwriting the attribute is // still valid. We do this for cyrillic and greek ATM. In // future versions of OOo this should be replaced by a // configuration switch that allows to give the preference // to the OOo setting or the system setting explicitly // and/or a better handling of the script type.
i18n::UnicodeScript eType = !rInBuffer.isEmpty() ?
GetAppCharClass().getScript( rInBuffer, 0 ) :
i18n::UnicodeScript_kScriptCount;
bool bSystemIsNonLatin = false; switch ( eType )
{ case i18n::UnicodeScript_kGreek: case i18n::UnicodeScript_kCyrillic: // in case other UnicodeScripts require special // keyboards they can be added here
bSystemIsNonLatin = true; break; default: break;
}
/** * Character buffer is inserted into the document
*/ void SwEditWin::FlushInBuffer()
{ if ( m_aKeyInputFlushTimer.IsActive())
m_aKeyInputFlushTimer.Stop();
// get text from the beginning (i.e left side) of current selection // to the start of the paragraph
rSh.NormalizePam(); // make point be the first (left) one if (!rSh.GetCursor()->HasMark())
rSh.GetCursor()->SetMark();
rSh.GetCursor()->GetMark()->SetContent(0);
// valid sequence or sequence could be corrected: if (nPrevPos != aNewText.getLength())
nTmpPos = nPrevPos + 1;
}
// find position of first character that has changed
sal_Int32 nNewLen = aNewText.getLength(); const sal_Unicode *pOldText = aOldText.getStr(); const sal_Unicode *pNewText = aNewText.getStr();
sal_Int32 nChgPos = 0; while ( nChgPos < nOldLen && nChgPos < nNewLen &&
pOldText[nChgPos] == pNewText[nChgPos] )
++nChgPos;
const sal_Int32 nChgLen = nNewLen - nChgPos; if (nChgLen)
{
m_aInBuffer = aNewText.copy( nChgPos, nChgLen );
nExpandSelection = nOldLen - nChgPos;
} else
m_aInBuffer.clear();
} else
{ for( sal_Int32 k = 0; k < m_aInBuffer.getLength(); ++k )
{ const sal_Unicode cChar = m_aInBuffer[k]; if (xISC->checkInputSequence( aNewText, nTmpPos - 1, cChar, nCheckMode ))
{ // character can be inserted:
aNewText += OUStringChar( cChar );
++nTmpPos;
}
}
m_aInBuffer = aNewText.copy( aOldText.getLength() ); // copy new text to be inserted to buffer
}
}
// at this point now we will insert the buffer text 'normally' some lines below...
rSh.Pop(SwCursorShell::PopMode::DeleteCurrent);
if (m_aInBuffer.isEmpty()) return;
// if text prior to the original selection needs to be changed // as well, we now expand the selection accordingly.
SwPaM &rCursor = *rSh.GetCursor(); const sal_Int32 nCursorStartPos = rCursor.Start()->GetContentIndex();
OSL_ENSURE( nCursorStartPos >= nExpandSelection, "cannot expand selection as specified!!" ); if (nExpandSelection && nCursorStartPos >= nExpandSelection)
{ if (!rCursor.HasMark())
rCursor.SetMark();
rCursor.Start()->AdjustContent( -nExpandSelection );
}
}
if ( xRecorder.is() )
{ // determine shell
SfxShell *pSfxShell = lcl_GetTextShellFromDispatcher( m_rView ); // generate request and record if (pSfxShell)
{
SfxRequest aReq(m_rView.GetViewFrame(), FN_INSERT_STRING);
aReq.AppendItem( SfxStringItem( FN_INSERT_STRING, m_aInBuffer ) );
aReq.Done();
}
}
void SwEditWin::ChangeDrawing( sal_uInt8 nDir )
{ // start undo action in order to get only one // undo action for this change.
SwWrtShell &rSh = m_rView.GetWrtShell();
rSh.StartUndo();
tools::Long nX = 0;
tools::Long nY = 0; constbool bOnePixel(
MOVE_LEFT_SMALL == nDir ||
MOVE_UP_SMALL == nDir ||
MOVE_RIGHT_SMALL == nDir ||
MOVE_DOWN_SMALL == nDir); constbool bHuge(
MOVE_LEFT_HUGE == nDir ||
MOVE_UP_HUGE == nDir ||
MOVE_RIGHT_HUGE == nDir ||
MOVE_DOWN_HUGE == nDir);
SwMove nAnchorDir = SwMove::UP; switch(nDir)
{ case MOVE_LEFT_SMALL: case MOVE_LEFT_HUGE: case MOVE_LEFT_BIG:
nX = -1;
nAnchorDir = SwMove::LEFT; break; case MOVE_UP_SMALL: case MOVE_UP_HUGE: case MOVE_UP_BIG:
nY = -1; break; case MOVE_RIGHT_SMALL: case MOVE_RIGHT_HUGE: case MOVE_RIGHT_BIG:
nX = +1;
nAnchorDir = SwMove::RIGHT; break; case MOVE_DOWN_SMALL: case MOVE_DOWN_HUGE: case MOVE_DOWN_BIG:
nY = +1;
nAnchorDir = SwMove::DOWN; break;
}
if(bOnePixel)
{
aSnap = PixelToLogic(Size(1,1));
} elseif(bHuge)
{ // #i121236# 567twips == 1cm, but just take three times the normal snap
aSnap = Size(aSnap.Width() * 3, aSnap.Height() * 3);
}
nX *= aSnap.Width();
nY *= aSnap.Height();
SdrView *pSdrView = rSh.GetDrawView(); const SdrHdlList& rHdlList = pSdrView->GetHdlList();
SdrHdl* pHdl = rHdlList.GetFocusHdl();
rSh.StartAllAction(); if(nullptr == pHdl)
{ // now move the selected draw objects // if the object's position is not protected if(!(nProtect&FlyProtectFlags::Pos))
{ // Check if object is anchored as character and move direction bool bDummy1, bDummy2; constbool bVertAnchor = rSh.IsFrameVertical( true, bDummy1, bDummy2 ); bool bHoriMove = !bVertAnchor == !( nDir % 2 ); bool bMoveAllowed =
!bHoriMove || (rSh.GetAnchorId() != RndStdIds::FLY_AS_CHAR); if ( bMoveAllowed )
{
pSdrView->MoveAllMarked(Size(nX, nY));
rSh.SetModified();
}
}
} else
{ // move handle with index nHandleIndex if (nX || nY)
{ if( SdrHdlKind::Anchor == pHdl->GetKind() ||
SdrHdlKind::Anchor_TR == pHdl->GetKind() )
{ // anchor move cannot be allowed when position is protected if(!(nProtect&FlyProtectFlags::Pos))
rSh.MoveAnchor( nAnchorDir );
} //now resize if size is protected elseif(!(nProtect&FlyProtectFlags::Size))
{ // now move the Handle (nX, nY)
Point aStartPoint(pHdl->GetPos());
Point aEndPoint(pHdl->GetPos() + Point(nX, nY)); const SdrDragStat& rDragStat = pSdrView->GetDragStat();
SfxObjectShell *pObjSh = m_rView.GetViewFrame().GetObjectShell(); if ( m_bLockInput || (pObjSh && pObjSh->GetProgress()) ) // When the progress bar is active or a progress is // running on a document, no order is being taken return;
m_pShadCursor.reset(); // Do not reset the timer here, otherwise when flooded with events it would never time out // if every key event stopped and started it again.
comphelper::ScopeGuard keyInputFlushTimerStop([this]() { m_aKeyInputFlushTimer.Stop(); });
bool bIsViewReadOnly = IsViewReadonly();
//if the language changes the buffer must be flushed
LanguageType eNewLanguage = GetInputLanguage(); if(!bIsViewReadOnly && m_eBufferLanguage != eNewLanguage && !m_aInBuffer.isEmpty())
{
FlushInBuffer();
}
m_eBufferLanguage = eNewLanguage;
// OS:the DrawView also needs a readonly-Flag as well if ( !bIsViewReadOnly && rSh.GetDrawView() && rSh.GetDrawView()->KeyInput( rKEvt, this ) )
{
rSh.GetView().GetViewFrame().GetBindings().InvalidateAll( false );
rSh.SetModified(); return; // Event evaluated by SdrView
}
if ( m_rView.GetDrawFuncPtr() && m_bInsFrame )
{
StopInsFrame();
rSh.Edit();
}
const vcl::KeyCode& rKeyCode = aKeyEvent.GetKeyCode();
sal_Unicode aCh = aKeyEvent.GetCharCode();
// enable switching to notes anchor with Ctrl - Alt - Page Up/Down // pressing this inside a note will switch to next/previous note if ((rKeyCode.IsMod1() && rKeyCode.IsMod2()) && ((rKeyCode.GetCode() == KEY_PAGEUP) || (rKeyCode.GetCode() == KEY_PAGEDOWN)))
{ constbool bNext = rKeyCode.GetCode()==KEY_PAGEDOWN; const SwFieldType* pFieldType = rSh.GetFieldType( 0, SwFieldIds::Postit );
rSh.MoveFieldType( pFieldType, bNext ); return;
}
if (SwTextContentControl* pTextContentControl = rSh.CursorInsideContentControl())
{ // Check if this combination of rKeyCode and pTextContentControl should open a popup. const SwFormatContentControl& rFormatContentControl = pTextContentControl->GetContentControl();
std::shared_ptr<SwContentControl> pContentControl = rFormatContentControl.GetContentControl(); if (pContentControl->ShouldOpenPopup(rKeyCode))
{
SwShellCursor* pCursor = rSh.GetCursor_(); if (pCursor)
{
VclPtr<SwContentControlButton> pContentControlButton = pCursor->GetContentControlButton(); if (pContentControlButton)
{
pContentControlButton->StartPopup(); return;
}
}
}
}
if (pFlyFormat)
{ // See if the fly frame's anchor is in a content control. If so, // try to interact with it. const SwFormatAnchor& rFormatAnchor = pFlyFormat->GetAnchor();
SwNode* pAnchorNode = rFormatAnchor.GetAnchorNode(); if (pAnchorNode)
{
SwTextNode* pTextNode = pAnchorNode->GetTextNode(); if (pTextNode)
{
sal_Int32 nContentIdx = rFormatAnchor.GetAnchorContentOffset();
SwTextAttr* pAttr = pTextNode->GetTextAttrAt(
nContentIdx, RES_TXTATR_CONTENTCONTROL, ::sw::GetTextAttrMode::Parent); if (pAttr)
{
SwTextContentControl* pTextContentControl
= static_txtattr_cast<SwTextContentControl*>(pAttr); const SwFormatContentControl& rFormatContentControl
= pTextContentControl->GetContentControl();
std::shared_ptr<SwContentControl> pContentControl
= rFormatContentControl.GetContentControl(); if (pContentControl->IsInteractingCharacter(aCh))
{
rSh.GotoContentControl(rFormatContentControl); return;
}
}
}
}
}
switch( eKeyState )
{ case SwKeyState::CheckKey:
eKeyState = SwKeyState::KeyToView; // default forward to View
if (!comphelper::LibreOfficeKit::isActive() &&
!rKeyCode.IsMod2() && '=' == aCh &&
!rSh.IsTableMode() && rSh.GetTableFormat() &&
rSh.IsSttPara() &&
!rSh.HasReadonlySel())
{ // at the beginning of the table's cell a '=' -> // call EditRow (F2-functionality) // [Avoid this for LibreOfficeKit, as the separate input window // steals the focus & things go wrong - the user never gets // the focus back.]
rSh.Push(); if( !rSh.MoveSection( GoCurrSection, fnSectionStart) &&
!rSh.IsTableBoxTextFormat() )
{ // is at the beginning of the box
eKeyState = SwKeyState::EditFormula; if( rSh.HasMark() )
rSh.SwapPam(); else
rSh.SttSelect();
rSh.MoveSection( GoCurrSection, fnSectionEnd );
rSh.Pop();
rSh.EndSelect();
sFormulaEntry = "=";
} else
rSh.Pop(SwCursorShell::PopMode::DeleteCurrent);
} else
{ if( pACorr && aTmpQHD.HasContent() && !rSh.HasSelection() &&
!rSh.HasReadonlySel() && !aTmpQHD.m_bIsAutoText &&
pACorr->GetSwFlags().nAutoCmpltExpandKey ==
(rKeyCode.GetModifier() | rKeyCode.GetCode()) )
--> --------------------
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.