25 #include <officecfg/Office/Common.hxx>
40 #include <inputwin.hxx>
47 #include <strings.hrc>
48 #include <bitmaps.hlst>
64 return ChildKeyInput(rKEvt);
93 if (pDispatcherView == pActiveView)
115 if( nMaxHeight+2 > aSizeTbx.
Height() )
127 aPosPos.setY( (aSize.
Height() - nMaxHeight)/2 + 1 );
128 aEditPos.setY( (aSize.
Height() - nMaxHeight)/2 + 1 );
182 aEditSize.
setWidth( std::max( static_cast<tools::Long>(nWidth - nLeft - 5),
tools::Long(0) ) );
201 SelTableCellsNotify) );
207 while( (nPos = rPos.indexOf(
':',nPos + 1 ) ) != -1 )
208 nSrch =
static_cast<short>(nPos);
216 OSL_ENSURE(
pMgr ==
nullptr,
"FieldManager not deleted");
223 sEdit +=
pMgr->GetCurFieldPar2();
230 "sw",
"/org.openoffice.Office.Common/Undo/Steps <= 0");
238 if( !
pWrtShell->SwCursorShell::HasSelection() )
244 if(
pWrtShell->SwCursorShell::HasSelection() )
294 if (!command.empty())
300 sal_uInt16 nCurID = GetCurItemId();
305 std::unique_ptr<weld::Menu> xPopMenu(xBuilder->weld_menu(
"menu"));
308 MenuHdl(xPopMenu->popup_at_rect(pParent, aRect));
352 if( !sEdit.isEmpty() &&
'=' == sEdit[0] )
353 sEdit = sEdit.copy( 1 );
401 OUString sBoxNms( rCaller.GetBoxNms() );
403 if( pTableFormat && aCurrentTableName != pTableFormat->
GetName() )
404 sTableNm = pTableFormat->
GetName();
406 mxEdit->UpdateRange( sBoxNms, sTableNm );
408 OUString sNew = OUStringChar(
CH_LRE) + mxEdit->get_text()
411 if( sNew != sOldFormula )
416 pWrtShell->StartAllAction();
418 SwPaM aPam( *pWrtShell->GetStackCursor()->GetPoint() );
426 pWrtShell->EndAllAction();
437 if( !rFormula.isEmpty() )
439 if(
'=' == rFormula[0] )
451 if (bIsTable && m_bResetUndo)
453 pWrtShell->StartAllAction();
455 OUString sNew = OUStringChar(
CH_LRE) + mxEdit->get_text()
457 pWrtShell->SwEditShell::Insert2( sNew );
458 pWrtShell->EndAllAction();
481 bool bHandled =
false;
492 return bHandled || ChildKeyInput(rEvent);
502 const OUString& rName )
511 OUString aPrefix = rName;
514 OUString aBoxes = aPrefix + rBoxes;
516 int nSelStartPos, nSelEndPos;
517 m_xWidget->get_selection_bounds(nSelStartPos, nSelEndPos);
519 Selection aSelection(nSelStartPos, nSelEndPos);
520 sal_uInt16 nSel =
static_cast<sal_uInt16
>(aSelection.
Len());
523 if( nSel && ( nSel > 1 ||
524 m_xWidget->get_text()[
static_cast<sal_uInt16
>(aSelection.
Min()) ] != cClose ))
527 aSelection.
Max() = aSelection.
Min();
528 OUString aActText(
m_xWidget->get_text());
529 const sal_uInt16 nLen = aActText.getLength();
532 OUString
aStr = OUStringChar(cOpen) + aBoxes + OUStringChar(cClose);
534 sal_Int32
nPos = aStr.indexOf( cClose );
535 OSL_ENSURE(nPos != -1,
"delimiter not found");
543 sal_uInt16
nPos, nEndPos = 0, nStartPos =
static_cast<sal_uInt16
>(aSelection.
Min());
547 if( cOpen == (cCh = aActText[ nStartPos ] ) ||
548 cOpenBracket == cCh )
550 bFound = cCh == cOpen;
553 }
while( nStartPos-- > 0 );
559 while( nEndPos < nLen )
561 if( cClose == aActText[ nEndPos ] )
570 static_cast<sal_uInt16>(aSelection.
Max()) > nEndPos + 1 ))
575 nPos = ++nStartPos + 1;
576 aActText = aActText.replaceAt( nStartPos, nEndPos - nStartPos, aBoxes );
577 nPos = nPos + aBoxes.getLength();
581 OUString aTmp = OUStringChar(cOpen) + aBoxes + OUStringChar(cClose);
582 nPos =
static_cast<sal_uInt16
>(aSelection.
Min());
583 aActText = aActText.replaceAt( nPos, 0, aTmp );
584 nPos = nPos + aTmp.getLength();
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
virtual Point GetPosPixel() const
SfxViewFrame * GetViewFrame() const
#define LINK(Instance, Class, Member)
SFX_IMPL_POS_CHILDWINDOW_WITHID(SfxInfoBarContainerChild, SID_INFOBAR, SFX_OBJECTBAR_OBJECT)
void SetActive(bool bOn=true)
void setWidth(tools::Long nWidth)
#define HID_TBX_FORMULA_CANCEL
SfxDispatcher * GetDispatcher()
bool Pop(SwCursorShell::PopMode=SwCursorShell::PopMode::DeleteStack)
void SetAccessibleName(const OUString &rName)
virtual Size GetSizePixel() const
virtual void SetSizePixel(const Size &rNewSize)
static weld::Builder * CreateBuilder(weld::Widget *pParent, const OUString &rUIFile, bool bMobile=false)
SwUndoId EndUndo(SwUndoId eUndoId=SwUndoId::EMPTY, const SwRewriter *pRewriter=nullptr)
Closes parenthesis of nUndoId, not used by UI.
virtual void DeleteRange(SwPaM &)=0
Delete a range SwFlyFrameFormat.
void SetWindow(const VclPtr< vcl::Window > &p)
void DoUndo(bool bOn=true)
Undo.
vcl::Window * GetWindow() const
Used by the UI to modify the document model.
bool GoInSection(SwPaM &rPam, SwMoveFnCollection const &fnMove)
void set_text(const OUString &rText)
constexpr sal_uInt16 KEY_F2
bool Execute(sal_uInt16 nSlot, const SfxPoolItem **pArgs=nullptr, SfxCallMode nCall=SfxCallMode::SLOT)
void LockKeyInput(bool bSet)
#define FN_FORMULA_CANCEL
PaM is Point and Mark: a selection of the document model.
bool Move(SwMoveFnCollection const &fnMove=fnMoveForward, SwGoInDoc fnGo=GoInContent)
Movement of cursor.
const SfxItemPool & GetAttrPool() const
virtual bool InsertString(const SwPaM &rRg, const OUString &, const SwInsertFlags nInsertMode=SwInsertFlags::EMPTYEXPAND)=0
Insert string into existing text node at position rRg.Point().
const SwTableNode * IsCursorInTable() const
#define HID_TBX_FORMULA_CALC
void Push()
store a copy of the current cursor on the cursor stack
weld::Window * GetPopupParent(vcl::Window &rOutWin, tools::Rectangle &rRect)
SfxBindings & GetBindings()
SwUndoId StartUndo(SwUndoId eUndoId=SwUndoId::EMPTY, const SwRewriter *pRewriter=nullptr)
Undo: set up Undo parenthesis, return nUndoId of this parenthesis.
tools::Long Width() const
constexpr std::enable_if_t< std::is_signed_v< T >, std::make_unsigned_t< T > > make_unsigned(T value)
bool GoCurrSection(SwPaM &rPam, SwMoveFnCollection const &fnMove)
OUString SwResId(const char *pId)
Text operation/manipulation interface.
#define HID_TBX_FORMULA_APPLY
SfxViewShell * GetViewShell() const
OUString GetBoxNms() const
SwFrameFormat * GetTableFormat()
constexpr sal_uInt16 KEY_RETURN
virtual void SetPosSizePixel(const Point &rNewPos, const Size &rNewSize)
bool MoveSection(SwWhichSection, SwMoveFnCollection const &)
bool Delete()
Delete content of all ranges.
void SetAlignment(SfxChildAlignment eAlign)
Size GetSizePixel() const override
constexpr TypedWhichId< SwTableBoxFormula > RES_BOXATR_FORMULA(149)
SwWrtShell * GetWrtShellPtr() const
#define SAL_WARN_IF(condition, area, stream)
constexpr sal_uInt16 KEY_ESCAPE
SwMoveFnCollection const & fnSectionEnd
SwMoveFnCollection const & fnMoveForward
SwPam::Move()/Find() default argument.
OString strip(const OString &rIn, char c)
SfxViewFrame * GetFrame() const
tools::Long Height() const
bool GetTableBoxFormulaAttrs(SfxItemSet &rSet) const
SwMoveFnCollection const & fnSectionStart
SwMoveFnCollection const & fnMoveBackward
void setHeight(tools::Long nHeight)
SfxDispatcher * GetDispatcher() const
reference_type * get() const
const SfxPoolItem * Execute(sal_uInt16 nSlot, SfxCallMode nCall=SfxCallMode::SLOT, const SfxPoolItem **pArgs=nullptr, sal_uInt16 nModi=0, const SfxPoolItem **pInternalArgs=nullptr)
void set_accessible_name(const OUString &rName)
void StartAllAction()
For all views of this document.
void Undo(sal_uInt16 const nCount=1)
virtual SfxChildWinInfo GetInfo() const
void SelTableCells(const Link< SwWrtShell &, void > &rLink)
void Show(bool bVisible=true, ShowFlags nFlags=ShowFlags::NONE)