LibreOffice Module sw (master)  1
inputwin.cxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
20 #include <sal/config.h>
21 #include <sal/log.hxx>
22 
23 #include <comphelper/string.hxx>
24 #include <o3tl/safeint.hxx>
25 #include <officecfg/Office/Common.hxx>
26 #include <tools/gen.hxx>
27 #include <sfx2/objface.hxx>
28 #include <sfx2/viewfrm.hxx>
29 #include <sfx2/dispatch.hxx>
30 #include <svx/ruler.hxx>
31 #include <svl/stritem.hxx>
32 #include <vcl/event.hxx>
33 
34 #include <swtypes.hxx>
35 #include <cmdid.h>
36 #include <swmodule.hxx>
37 #include <wrtsh.hxx>
38 #include <view.hxx>
39 #include <inputwin.hxx>
40 #include <fldbas.hxx>
41 #include <fldmgr.hxx>
42 #include <frmfmt.hxx>
43 #include <cellatr.hxx>
44 #include <edtwin.hxx>
45 #include <helpids.h>
46 #include <strings.hrc>
47 #include <bitmaps.hlst>
48 
49 // Only for the UpdateRange: Delete the box in which the stacked cursor is positioned.
50 #include <pam.hxx>
51 
52 #include <swundo.hxx>
53 
55 
56 #define ED_POS 2
57 #define ED_FORMULA 3
58 
60 
61 IMPL_LINK(PosEdit, KeyInputHdl, const KeyEvent&, rKEvt, bool)
62 {
63  return ChildKeyInput(rKEvt);
64 }
65 
67  : ToolBox(pParent, WB_3DLOOK|WB_BORDER)
68  , mxPos(VclPtr<PosEdit>::Create(this))
69  , mxEdit(VclPtr<InputEdit>::Create(this))
70  , pWrtShell(nullptr)
71  , pView(nullptr)
72  , m_bDoesUndo(true)
73  , m_bResetUndo(false)
74  , m_bCallUndo(false)
75 {
76  bFirst = true;
77  bIsTable = bDelSel = false;
78 
79  InsertItem(FN_FORMULA_CALC, Image(StockImage::Yes, RID_BMP_FORMULA_CALC),
80  SwResId(STR_FORMULA_CALC));
81  InsertItem(FN_FORMULA_CANCEL, Image(StockImage::Yes, RID_BMP_FORMULA_CANCEL),
82  SwResId(STR_FORMULA_CANCEL));
83  InsertItem(FN_FORMULA_APPLY, Image(StockImage::Yes, RID_BMP_FORMULA_APPLY),
84  SwResId(STR_FORMULA_APPLY));
85 
89 
90  SwView *pDispatcherView = dynamic_cast<SwView*>(pDispatcher ? pDispatcher->GetFrame()->GetViewShell() : nullptr);
91  SwView* pActiveView = ::GetActiveView();
92  if (pDispatcherView == pActiveView)
93  pView = pActiveView;
94  pWrtShell = pView ? pView->GetWrtShellPtr() : nullptr;
95 
96  InsertWindow(ED_POS, mxPos.get(), ToolBoxItemBits::NONE, 0);
97  SetItemText(ED_POS, SwResId(STR_ACCESS_FORMULA_TYPE));
98  mxPos->set_accessible_name(SwResId(STR_ACCESS_FORMULA_TYPE));
99  SetAccessibleName(SwResId(STR_ACCESS_FORMULA_TOOLBAR));
100  InsertSeparator ( 1 );
101  InsertSeparator ();
103  SetItemText(ED_FORMULA, SwResId(STR_ACCESS_FORMULA_TEXT));
104  mxEdit->set_accessible_name(SwResId(STR_ACCESS_FORMULA_TEXT));
106 
107  SetItemBits( FN_FORMULA_CALC, GetItemBits( FN_FORMULA_CALC ) | ToolBoxItemBits::DROPDOWNONLY );
108  SetDropdownClickHdl( LINK( this, SwInputWindow, DropdownClickHdl ));
109 
110  Size aSizeTbx = CalcWindowSizePixel();
111  Size aEditSize = mxEdit->GetSizePixel();
113  long nMaxHeight = std::max(aEditSize.Height(), aItemRect.GetHeight());
114  if( nMaxHeight+2 > aSizeTbx.Height() )
115  aSizeTbx.setHeight( nMaxHeight+2 );
116  Size aSize = GetSizePixel();
117  aSize.setHeight( aSizeTbx.Height() );
118  SetSizePixel( aSize );
119 
120  // align edit and item vcentered
121  Size aPosSize = mxPos->GetSizePixel();
122  aPosSize.setHeight( nMaxHeight );
123  aEditSize.setHeight( nMaxHeight );
124  Point aPosPos = mxPos->GetPosPixel();
125  Point aEditPos = mxEdit->GetPosPixel();
126  aPosPos.setY( (aSize.Height() - nMaxHeight)/2 + 1 );
127  aEditPos.setY( (aSize.Height() - nMaxHeight)/2 + 1 );
128  mxPos->SetPosSizePixel( aPosPos, aPosSize );
129  mxEdit->SetPosSizePixel( aEditPos, aEditSize );
130 }
131 
133 {
134  disposeOnce();
135 }
136 
138 {
139  // wake rulers
140  if(pView)
141  {
144  }
145  pMgr.reset();
146  if(pWrtShell)
148 
150 
154 }
155 
157 {
158  if (m_bResetUndo)
159  {
160  if (pWrtShell)
161  {
162  DelBoxContent();
164  if (m_bCallUndo)
165  {
166  pWrtShell->Undo();
167  }
168  }
169  m_bResetUndo = false; // #i117122# once is enough :)
170  }
171 }
172 
174 {
175  ToolBox::Resize();
176 
177  long nWidth = GetSizePixel().Width();
178  long nLeft = mxEdit->GetPosPixel().X();
179  Size aEditSize = mxEdit->GetSizePixel();
180 
181  aEditSize.setWidth( std::max( static_cast<long>(nWidth - nLeft - 5), long(0) ) );
182  mxEdit->SetSizePixel( aEditSize );
183 }
184 
186 {
187  bIsTable = false;
188  // stop rulers
189  if (pView)
190  {
191  pView->GetHRuler().SetActive( false );
192  pView->GetVRuler().SetActive( false );
193 
194  OSL_ENSURE(pWrtShell, "no WrtShell!");
195  // Cursor in table
197 
198  if( bFirst )
200  SelTableCellsNotify) );
201  if( bIsTable )
202  {
203  const OUString& rPos = pWrtShell->GetBoxNms();
204  sal_Int32 nPos = 0;
205  short nSrch = -1;
206  while( (nPos = rPos.indexOf( ':',nPos + 1 ) ) != -1 )
207  nSrch = static_cast<short>(nPos);
208  mxPos->set_text( rPos.copy( ++nSrch ) );
210  }
211  else
212  mxPos->set_text(SwResId(STR_TBL_FORMULA));
213 
214  // Edit current field
215  OSL_ENSURE(pMgr == nullptr, "FieldManager not deleted");
216  pMgr.reset(new SwFieldMgr);
217 
218  // Form should always begin with "=" , so set here
219  OUString sEdit('=');
220  if( pMgr->GetCurField() && SwFieldTypesEnum::Formel == pMgr->GetCurTypeId() )
221  {
222  sEdit += pMgr->GetCurFieldPar2();
223  }
224  else if( bFirst && bIsTable )
225  {
226  m_bResetUndo = true;
227  SAL_WARN_IF(
229  "sw", "/org.openoffice.Office.Common/Undo/Steps <= 0");
230 
232  if( !m_bDoesUndo )
233  {
234  pWrtShell->DoUndo();
235  }
236 
237  if( !pWrtShell->SwCursorShell::HasSelection() )
238  {
240  pWrtShell->SetMark();
242  }
243  if( pWrtShell->SwCursorShell::HasSelection() )
244  {
246  pWrtShell->Delete();
248  {
249  m_bCallUndo = true;
250  }
251  }
252  pWrtShell->DoUndo(false);
253 
255  if( pWrtShell->GetTableBoxFormulaAttrs( aSet ))
256  sEdit += aSet.Get( RES_BOXATR_FORMULA ).GetFormula();
257  }
258 
259  if( bFirst )
260  {
261  // Set WrtShell flags correctly
262  pWrtShell->SttSelect();
263  pWrtShell->EndSelect();
264  }
265 
266  bFirst = false;
267 
268  mxEdit->connect_changed( LINK( this, SwInputWindow, ModifyHdl ));
269 
270  mxEdit->set_text( sEdit );
271  sOldFormula = sEdit;
272 
273  // For input cut the UserInterface
274 
275  pView->GetEditWin().LockKeyInput(true);
276  pView->GetViewFrame()->GetDispatcher()->Lock(true);
277  pWrtShell->Push();
278  }
279 
280  ToolBox::Show();
281 
282  // grab focus after ToolBox is shown so focus isn't potentially lost elsewhere
283  if (pView)
284  {
285  int nPos = mxEdit->get_text().getLength();
286  mxEdit->select_region(nPos, nPos);
287  mxEdit->GrabFocus();
288  }
289 }
290 
291 IMPL_LINK( SwInputWindow, MenuHdl, Menu *, pMenu, bool )
292 {
293  OString aCommand = pMenu->GetCurItemIdent();
294  if (!aCommand.isEmpty())
295  {
296  aCommand += " ";
297  mxEdit->replace_selection(OStringToOUString(aCommand, RTL_TEXTENCODING_ASCII_US));
298  }
299  return false;
300 }
301 
302 IMPL_LINK_NOARG(SwInputWindow, DropdownClickHdl, ToolBox *, void)
303 {
304  sal_uInt16 nCurID = GetCurItemId();
305  EndSelection(); // reset back CurItemId !
306  if (nCurID == FN_FORMULA_CALC)
307  {
308  VclBuilder aBuilder(nullptr, VclBuilderContainer::getUIRootDir(), "modules/swriter/ui/inputwinmenu.ui", "");
309  VclPtr<PopupMenu> aPopMenu(aBuilder.get_menu("menu"));
310  aPopMenu->SetSelectHdl(LINK(this, SwInputWindow, MenuHdl));
311  aPopMenu->Execute(this, GetItemRect(FN_FORMULA_CALC), PopupMenuFlags::NoMouseUpClose);
312  }
313 }
314 
316 {
317  sal_uInt16 nCurID = GetCurItemId();
318  EndSelection(); // reset back CurItemId !
319  switch ( nCurID )
320  {
321  case FN_FORMULA_CANCEL:
322  {
323  CancelFormula();
324  }
325  break;
326  case FN_FORMULA_APPLY:
327  {
328  ApplyFormula();
329  }
330  break;
331  }
332 }
333 
335 {
336  pView->GetViewFrame()->GetDispatcher()->Lock(false);
337  pView->GetEditWin().LockKeyInput(false);
340 
341  // Form should always begin with "=", so remove it here again
342  OUString sEdit(comphelper::string::strip(mxEdit->get_text(), ' '));
343  if( !sEdit.isEmpty() && '=' == sEdit[0] )
344  sEdit = sEdit.copy( 1 );
345  SfxStringItem aParam(FN_EDIT_FORMULA, sEdit);
346 
349  const SfxPoolItem* aArgs[2];
350  aArgs[0] = &aParam;
351  aArgs[1] = nullptr;
352  pView->GetViewFrame()->GetBindings().Execute( FN_EDIT_FORMULA, aArgs, SfxCallMode::ASYNCHRON );
353 }
354 
356 {
357  if(pView)
358  {
359  pView->GetViewFrame()->GetDispatcher()->Lock( false );
360  pView->GetEditWin().LockKeyInput(false);
363 
364  if( bDelSel )
366 
368 
370 
371  pView->GetViewFrame()->GetDispatcher()->Execute( FN_EDIT_FORMULA, SfxCallMode::ASYNCHRON);
372  }
373 }
374 
375 const sal_Unicode CH_LRE = 0x202a;
376 const sal_Unicode CH_PDF = 0x202c;
377 
378 IMPL_LINK( SwInputWindow, SelTableCellsNotify, SwWrtShell&, rCaller, void )
379 {
380  if(bIsTable)
381  {
382  SwFrameFormat* pTableFormat = rCaller.GetTableFormat();
383  OUString sBoxNms( rCaller.GetBoxNms() );
384  OUString sTableNm;
385  if( pTableFormat && aCurrentTableName != pTableFormat->GetName() )
386  sTableNm = pTableFormat->GetName();
387 
388  mxEdit->UpdateRange( sBoxNms, sTableNm );
389 
390  OUString sNew = OUStringChar(CH_LRE) + mxEdit->get_text()
391  + OUStringChar(CH_PDF);
392 
393  if( sNew != sOldFormula )
394  {
395  // The WrtShell is in the table selection,
396  // then cancel the table selection otherwise, the cursor is
397  // positioned "in the forest" and the live update does not work!
398  pWrtShell->StartAllAction();
399 
400  SwPaM aPam( *pWrtShell->GetStackCursor()->GetPoint() );
402  aPam.SetMark();
403  aPam.Move( fnMoveForward, GoInSection );
404 
405  IDocumentContentOperations& rIDCO = pWrtShell->getIDocumentContentOperations();
406  rIDCO.DeleteRange( aPam );
407  rIDCO.InsertString( aPam, sNew );
408  pWrtShell->EndAllAction();
409  sOldFormula = sNew;
410  }
411  }
412  else
413  mxEdit->GrabFocus();
414 }
415 
416 void SwInputWindow::SetFormula( const OUString& rFormula )
417 {
418  OUString sEdit('=');
419  if( !rFormula.isEmpty() )
420  {
421  if( '=' == rFormula[0] )
422  sEdit = rFormula;
423  else
424  sEdit += rFormula;
425  }
426  mxEdit->set_text( sEdit );
427  mxEdit->select_region(sEdit.getLength(), sEdit.getLength());
428  bDelSel = true;
429 }
430 
432 {
433  if (bIsTable && m_bResetUndo)
434  {
435  pWrtShell->StartAllAction();
436  DelBoxContent();
437  OUString sNew = OUStringChar(CH_LRE) + mxEdit->get_text()
438  + OUStringChar(CH_PDF);
439  pWrtShell->SwEditShell::Insert2( sNew );
440  pWrtShell->EndAllAction();
441  sOldFormula = sNew;
442  }
443 }
444 
446 {
447  if( bIsTable )
448  {
450  pWrtShell->ClearMark();
452  pWrtShell->Push();
454  pWrtShell->SetMark();
456  pWrtShell->SwEditShell::Delete();
458  }
459 }
460 
461 IMPL_LINK(InputEdit, KeyInputHdl, const KeyEvent&, rEvent, bool)
462 {
463  bool bHandled = false;
464  const vcl::KeyCode aCode = rEvent.GetKeyCode();
465  if (aCode == KEY_RETURN || aCode == KEY_F2)
466  {
467  bHandled = ActivateHdl(*m_xWidget);
468  }
469  else if(aCode == KEY_ESCAPE )
470  {
471  static_cast<SwInputWindow*>(GetParent())->CancelFormula();
472  bHandled = true;
473  }
474  return bHandled || ChildKeyInput(rEvent);
475 }
476 
477 IMPL_LINK_NOARG(InputEdit, ActivateHdl, weld::Entry&, bool)
478 {
479  static_cast<SwInputWindow*>(GetParent())->ApplyFormula();
480  return true;
481 }
482 
483 void InputEdit::UpdateRange(const OUString& rBoxes,
484  const OUString& rName )
485 {
486  if( rBoxes.isEmpty() )
487  {
488  GrabFocus();
489  return;
490  }
491  const sal_Unicode cOpen = '<', cClose = '>',
492  cOpenBracket = '(';
493  OUString aPrefix = rName;
494  if(!rName.isEmpty())
495  aPrefix += ".";
496  OUString aBoxes = aPrefix + rBoxes;
497 
498  int nSelStartPos, nSelEndPos;
499  m_xWidget->get_selection_bounds(nSelStartPos, nSelEndPos);
500 
501  Selection aSelection(nSelStartPos, nSelEndPos);
502  sal_uInt16 nSel = static_cast<sal_uInt16>(aSelection.Len());
503  // OS: The following expression ensures that in the overwrite mode,
504  // the selected closing parenthesis will be not deleted.
505  if( nSel && ( nSel > 1 ||
506  m_xWidget->get_text()[ static_cast<sal_uInt16>(aSelection.Min()) ] != cClose ))
507  m_xWidget->cut_clipboard();
508  else
509  aSelection.Max() = aSelection.Min();
510  OUString aActText(m_xWidget->get_text());
511  const sal_uInt16 nLen = aActText.getLength();
512  if( !nLen )
513  {
514  OUString aStr = OUStringChar(cOpen) + aBoxes + OUStringChar(cClose);
515  m_xWidget->set_text(aStr);
516  sal_Int32 nPos = aStr.indexOf( cClose );
517  OSL_ENSURE(nPos != -1, "delimiter not found");
518  ++nPos;
519  m_xWidget->select_region(nPos, nPos);
520  }
521  else
522  {
523  bool bFound = false;
524  sal_Unicode cCh;
525  sal_uInt16 nPos, nEndPos = 0, nStartPos = static_cast<sal_uInt16>(aSelection.Min());
526  if( nStartPos-- )
527  {
528  do {
529  if( cOpen == (cCh = aActText[ nStartPos ] ) ||
530  cOpenBracket == cCh )
531  {
532  bFound = cCh == cOpen;
533  break;
534  }
535  } while( nStartPos-- > 0 );
536  }
537  if( bFound )
538  {
539  bFound = false;
540  nEndPos = nStartPos;
541  while( nEndPos < nLen )
542  {
543  if( cClose == aActText[ nEndPos ] )
544  {
545  bFound = true;
546  break;
547  }
548  ++nEndPos;
549  }
550  // Only if the current position lies in the range or right behind.
551  if( bFound && !( nStartPos < o3tl::make_unsigned(aSelection.Max()) &&
552  static_cast<sal_uInt16>(aSelection.Max()) <= nEndPos + 1 ))
553  bFound = false;
554  }
555  if( bFound )
556  {
557  nPos = ++nStartPos + 1; // We want behind
558  aActText = aActText.replaceAt( nStartPos, nEndPos - nStartPos, aBoxes );
559  nPos = nPos + aBoxes.getLength();
560  }
561  else
562  {
563  OUString aTmp = OUStringChar(cOpen) + aBoxes + OUStringChar(cClose);
564  nPos = static_cast<sal_uInt16>(aSelection.Min());
565  aActText = aActText.replaceAt( nPos, 0, aTmp );
566  nPos = nPos + aTmp.getLength();
567  }
568  if( m_xWidget->get_text() != aActText )
569  {
570  m_xWidget->set_text(aActText);
571  m_xWidget->select_region(nPos, nPos);
572  }
573  }
574  GrabFocus();
575 
576 }
577 
579  sal_uInt16 nId,
580  SfxBindings const * pBindings,
581  SfxChildWinInfo* ) :
582  SfxChildWindow( _pParent, nId )
583 {
584  pDispatch = pBindings->GetDispatcher();
586  static_cast<SwInputWindow*>(GetWindow())->ShowWin();
587  SetAlignment(SfxChildAlignment::LOWESTTOP);
588 }
589 
591 {
592  if(pDispatch)
593  pDispatch->Lock(false);
594 }
595 
597 {
599  return aInfo;
600 }
601 
602 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
SfxViewFrame * GetViewFrame() const
long Width() const
SFX_IMPL_POS_CHILDWINDOW_WITHID(SfxInfoBarContainerChild, SID_INFOBAR, SFX_OBJECTBAR_OBJECT)
virtual void Resize() override
Definition: inputwin.cxx:173
bool m_bCallUndo
Definition: inputwin.hxx:162
void EndSelTableCells()
Definition: wrtsh.hxx:632
long GetHeight() const
void SetActive(bool bOn=true)
virtual void dispose() override
Definition: inputwin.cxx:137
SwWrtShell * pWrtShell
Definition: inputwin.hxx:153
void InsertWindow(sal_uInt16 nItemId, vcl::Window *pWindow, ToolBoxItemBits nBits=ToolBoxItemBits::NONE, ImplToolItems::size_type nPos=APPEND)
SwView * GetActiveView()
Definition: swmodul1.cxx:115
void ApplyFormula()
Definition: inputwin.cxx:334
#define HID_TBX_FORMULA_CANCEL
Definition: helpids.h:154
long Height() const
void DelBoxContent()
Definition: inputwin.cxx:445
void Create(SwFormatVertOrient &rItem, SvStream &rStrm, sal_uInt16 nVersionAbusedAsSize)
Definition: legacyitem.cxx:32
SfxDispatcher * GetDispatcher()
ToolBoxItemBits GetItemBits(sal_uInt16 nItemId) const
void disposeAndClear()
SwView * pView
Definition: inputwin.hxx:154
bool Pop(SwCursorShell::PopMode=SwCursorShell::PopMode::DeleteStack)
Definition: wrtsh1.cxx:1708
SwInputWindow(vcl::Window *pParent, SfxDispatcher const *pDispatcher)
Definition: inputwin.cxx:66
void SetAccessibleName(const OUString &rName)
virtual void SetSizePixel(const Size &rNewSize)
virtual void dispose() override
void CancelFormula()
Definition: inputwin.cxx:355
SwUndoId EndUndo(SwUndoId eUndoId=SwUndoId::EMPTY, const SwRewriter *pRewriter=nullptr)
Closes parenthesis of nUndoId, not used by UI.
Definition: edws.cxx:234
virtual void DeleteRange(SwPaM &)=0
Delete a range SwFlyFrameFormat.
long Len() const
void SetWindow(const VclPtr< vcl::Window > &p)
std::unique_ptr< weld::Entry > m_xWidget
Definition: inputwin.hxx:36
void EnterStdMode()
Definition: select.cxx:550
SwEditWin & GetEditWin()
Definition: view.hxx:403
void DoUndo(bool bOn=true)
Undo.
Definition: edws.cxx:200
#define FN_EDIT_FORMULA
Definition: cmdid.h:77
void SetItemText(sal_uInt16 nItemId, const OUString &rText)
void EndAllAction()
Definition: edws.cxx:97
sal_uInt16 GetCurItemId() const
vcl::Window * GetWindow() const
VclPtr< PosEdit > mxPos
Definition: inputwin.hxx:150
virtual void Resize() override
SvxRuler & GetVRuler()
Definition: view.hxx:482
virtual void Click() override
Definition: inputwin.cxx:315
Used by the UI to modify the document model.
Definition: wrtsh.hxx:90
bool GoInSection(SwPaM &rPam, SwMoveFnCollection const &fnMove)
Definition: pam.cxx:941
Size CalcWindowSizePixel()
sal_uInt16 sal_Unicode
void SetDropdownClickHdl(const Link< ToolBox *, void > &rLink)
#define ED_FORMULA
Definition: inputwin.cxx:57
void CleanupUglyHackWithUndo()
Definition: inputwin.cxx:156
const OUString & GetName() const
Definition: format.hxx:111
void set_text(const OUString &rText)
Definition: inputwin.hxx:130
constexpr sal_uInt16 KEY_F2
#define ED_POS
Definition: inputwin.cxx:56
SwInputChild(vcl::Window *, sal_uInt16 nId, SfxBindings const *, SfxChildWinInfo *)
Definition: inputwin.cxx:578
virtual void InsertItem(const OUString &rCommand, const css::uno::Reference< css::frame::XFrame > &rFrame, ToolBoxItemBits nBits, const Size &rRequestedSize, ImplToolItems::size_type nPos=APPEND)
bool Execute(sal_uInt16 nSlot, const SfxPoolItem **pArgs=nullptr, SfxCallMode nCall=SfxCallMode::SLOT)
void LockKeyInput(bool bSet)
Definition: edtwin.hxx:239
tools::Rectangle GetItemRect(sal_uInt16 nItemId)
void UpdateRange(const OUString &rSel, const OUString &rTableName)
Definition: inputwin.cxx:483
#define FN_FORMULA_CANCEL
Definition: cmdid.h:391
virtual ~SwInputChild() override
Definition: inputwin.cxx:590
PaM is Point and Mark: a selection of the document model.
Definition: pam.hxx:136
void EndSelect()
Definition: select.cxx:424
bool Move(SwMoveFnCollection const &fnMove=fnMoveForward, SwGoInDoc fnGo=GoInContent)
Movement of cursor.
Definition: pam.cxx:496
const SfxItemPool & GetAttrPool() const
Definition: viewsh.hxx:614
void set_text(const OUString &rText)
Definition: inputwin.hxx:65
long Min() 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
Definition: crsrsh.hxx:893
const sal_Unicode CH_PDF
Definition: inputwin.cxx:376
void SetSelectHdl(const Link< Menu *, bool > &rLink)
Style of a layout element.
Definition: frmfmt.hxx:57
void EndSelection()
OUString aCurrentTableName
Definition: inputwin.hxx:155
void set_accessible_name(const OUString &rName)
Definition: inputwin.hxx:75
#define FN_FORMULA_CALC
Definition: cmdid.h:390
#define HID_TBX_FORMULA_CALC
Definition: helpids.h:153
void Push()
store a copy of the current cursor on the cursor stack
Definition: crsrsh.cxx:2229
SfxBindings & GetBindings()
void SetItemBits(sal_uInt16 nItemId, ToolBoxItemBits nBits)
SwUndoId StartUndo(SwUndoId eUndoId=SwUndoId::EMPTY, const SwRewriter *pRewriter=nullptr)
Undo: set up Undo parenthesis, return nUndoId of this parenthesis.
Definition: edws.cxx:223
constexpr std::enable_if_t< std::is_signed_v< T >, std::make_unsigned_t< T > > make_unsigned(T value)
void ShowWin()
Definition: inputwin.cxx:185
std::unique_ptr< SwFieldMgr > pMgr
Definition: inputwin.hxx:152
SfxDispatcher * pDispatch
Definition: inputwin.hxx:193
void SetMark()
Definition: crsrsh.hxx:879
bool GoCurrSection(SwPaM &rPam, SwMoveFnCollection const &fnMove)
Definition: pam.cxx:1044
virtual ~SwInputWindow() override
Definition: inputwin.cxx:132
const sal_Unicode CH_LRE
Definition: inputwin.cxx:375
void Lock(bool bLock)
OUString SwResId(const char *pId)
Definition: swmodule.cxx:178
static OUString getUIRootDir()
Text operation/manipulation interface.
void SttSelect()
Definition: select.cxx:384
OUString sOldFormula
Definition: inputwin.hxx:155
void GrabFocus()
#define HID_TBX_FORMULA_APPLY
Definition: helpids.h:155
SfxViewShell * GetViewShell() const
OUString GetBoxNms() const
Definition: trvltbl.cxx:745
SwFrameFormat * GetTableFormat()
Definition: edws.cxx:183
constexpr sal_uInt16 KEY_RETURN
bool MoveSection(SwWhichSection, SwMoveFnCollection const &)
Definition: crsrsh.cxx:711
bool Delete()
Delete content of all ranges.
Definition: eddel.cxx:110
#define HID_EDIT_FORMULA
Definition: helpids.h:67
void SetAlignment(SfxChildAlignment eAlign)
WinBits const WB_3DLOOK
Size GetSizePixel() const override
void connect_changed(const Link< weld::Entry &, void > &rLink)
Definition: inputwin.hxx:90
SwWrtShell * GetWrtShellPtr() const
Definition: view.hxx:401
#define SAL_WARN_IF(condition, area, stream)
WinBits const WB_BORDER
constexpr sal_uInt16 KEY_ESCAPE
SwMoveFnCollection const & fnSectionEnd
Definition: paminit.cxx:50
SwMoveFnCollection const & fnMoveForward
SwPam::Move()/Find() default argument.
Definition: paminit.cxx:59
IMPL_LINK_NOARG(SwInputWindow, DropdownClickHdl, ToolBox *, void)
Definition: inputwin.cxx:302
bool m_bDoesUndo
Definition: inputwin.hxx:160
OString strip(const OString &rIn, char c)
SfxViewFrame * GetFrame() const
void InsertSeparator(ImplToolItems::size_type nPos=APPEND, sal_uInt16 nPixSize=0)
bool GetTableBoxFormulaAttrs(SfxItemSet &rSet) const
Definition: edtab.cxx:302
void select_region(int nStartPos, int nEndPos)
Definition: inputwin.hxx:85
PopupMenu * get_menu(const OString &sID)
#define FN_FORMULA_APPLY
Definition: cmdid.h:392
void ClearMark()
Definition: crsrsh.cxx:930
SvxRuler & GetHRuler()
Definition: view.hxx:481
SwMoveFnCollection const & fnSectionStart
Definition: paminit.cxx:49
SwMoveFnCollection const & fnMoveBackward
Definition: paminit.cxx:58
IMPL_LINK(PosEdit, KeyInputHdl, const KeyEvent &, rKEvt, bool)
Definition: inputwin.cxx:61
SfxDispatcher * GetDispatcher() const
OUString get_text() const
Definition: inputwin.hxx:70
reference_type * get() const
OUString aCommand
long Max() 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)
Definition: inputwin.hxx:135
void SetHelpId(sal_uInt16 nItemId, const OString &rHelpId)
bool DoesUndo() const
Definition: edws.cxx:203
void StartAllAction()
For all views of this document.
Definition: edws.cxx:86
void setWidth(long nWidth)
aStr
void Undo(sal_uInt16 const nCount=1)
Definition: edundo.cxx:97
virtual SfxChildWinInfo GetInfo() const
Definition: view.hxx:146
sal_uInt16 nPos
bool m_bResetUndo
Definition: inputwin.hxx:161
VclPtr< InputEdit > mxEdit
Definition: inputwin.hxx:151
void SetFormula(const OUString &rFormula)
Definition: inputwin.cxx:416
#define RES_BOXATR_FORMULA
Definition: hintids.hxx:357
void SelTableCells(const Link< SwWrtShell &, void > &rLink)
Definition: wrtsh.hxx:626
void Show(bool bVisible=true, ShowFlags nFlags=ShowFlags::NONE)
void setHeight(long nHeight)