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 SwInputWindow::SwInputWindow(vcl::Window* pParent, SfxDispatcher const * pDispatcher)
62  : ToolBox(pParent, WB_3DLOOK|WB_BORDER)
63  , aPos(VclPtr<Edit>::Create(this, WB_3DLOOK|WB_CENTER|WB_BORDER|WB_READONLY))
64  , aEdit(VclPtr<InputEdit>::Create(this, WB_3DLOOK|WB_TABSTOP|WB_BORDER|WB_NOHIDESELECTION))
65  , pWrtShell(nullptr)
66  , pView(nullptr)
67  , m_bDoesUndo(true)
68  , m_bResetUndo(false)
69  , m_bCallUndo(false)
70 {
71  bFirst = true;
72  bIsTable = bDelSel = false;
73 
74  aEdit->SetSizePixel(aEdit->CalcMinimumSize());
75  aPos->SetSizePixel(aPos->LogicToPixel(Size(45, 11), MapMode(MapUnit::MapAppFont)));
76 
77  InsertItem(FN_FORMULA_CALC, Image(StockImage::Yes, RID_BMP_FORMULA_CALC),
78  SwResId(STR_FORMULA_CALC));
79  InsertItem(FN_FORMULA_CANCEL, Image(StockImage::Yes, RID_BMP_FORMULA_CANCEL),
80  SwResId(STR_FORMULA_CANCEL));
81  InsertItem(FN_FORMULA_APPLY, Image(StockImage::Yes, RID_BMP_FORMULA_APPLY),
82  SwResId(STR_FORMULA_APPLY));
83 
87 
88  SwView *pDispatcherView = dynamic_cast<SwView*>(pDispatcher ? pDispatcher->GetFrame()->GetViewShell() : nullptr);
89  SwView* pActiveView = ::GetActiveView();
90  if (pDispatcherView == pActiveView)
91  pView = pActiveView;
92  pWrtShell = pView ? pView->GetWrtShellPtr() : nullptr;
93 
94  InsertWindow(ED_POS, aPos.get(), ToolBoxItemBits::NONE, 0);
95  SetItemText(ED_POS, SwResId(STR_ACCESS_FORMULA_TYPE));
96  aPos->SetAccessibleName(SwResId(STR_ACCESS_FORMULA_TYPE));
97  SetAccessibleName(SwResId(STR_ACCESS_FORMULA_TOOLBAR));
98  InsertSeparator ( 1 );
99  InsertSeparator ();
100  InsertWindow(ED_FORMULA, aEdit.get());
101  SetItemText(ED_FORMULA, SwResId(STR_ACCESS_FORMULA_TEXT));
102  aEdit->SetAccessibleName(SwResId(STR_ACCESS_FORMULA_TEXT));
103  SetHelpId(ED_FORMULA, HID_EDIT_FORMULA);
104 
105  SetItemBits( FN_FORMULA_CALC, GetItemBits( FN_FORMULA_CALC ) | ToolBoxItemBits::DROPDOWNONLY );
106  SetDropdownClickHdl( LINK( this, SwInputWindow, DropdownClickHdl ));
107 
108  Size aSizeTbx = CalcWindowSizePixel();
109  Size aEditSize = aEdit->GetSizePixel();
110  tools::Rectangle aItemRect( GetItemRect(FN_FORMULA_CALC) );
111  long nMaxHeight = std::max(aEditSize.Height(), aItemRect.GetHeight());
112  if( nMaxHeight+2 > aSizeTbx.Height() )
113  aSizeTbx.setHeight( nMaxHeight+2 );
114  Size aSize = GetSizePixel();
115  aSize.setHeight( aSizeTbx.Height() );
116  SetSizePixel( aSize );
117 
118  // align edit and item vcentered
119  Size aPosSize = aPos->GetSizePixel();
120  aPosSize.setHeight( nMaxHeight );
121  aEditSize.setHeight( nMaxHeight );
122  Point aPosPos = aPos->GetPosPixel();
123  Point aEditPos = aEdit->GetPosPixel();
124  aPosPos.setY( (aSize.Height() - nMaxHeight)/2 + 1 );
125  aEditPos.setY( (aSize.Height() - nMaxHeight)/2 + 1 );
126  aPos->SetPosSizePixel( aPosPos, aPosSize );
127  aEdit->SetPosSizePixel( aEditPos, aEditSize );
128 }
129 
131 {
132  disposeOnce();
133 }
134 
136 {
137  // wake rulers
138  if(pView)
139  {
142  }
143  pMgr.reset();
144  if(pWrtShell)
146 
148 
152 }
153 
155 {
156  if (m_bResetUndo)
157  {
158  if (pWrtShell)
159  {
160  DelBoxContent();
162  if (m_bCallUndo)
163  {
164  pWrtShell->Undo();
165  }
166  }
167  m_bResetUndo = false; // #i117122# once is enough :)
168  }
169 }
170 
172 {
173  ToolBox::Resize();
174 
175  long nWidth = GetSizePixel().Width();
176  long nLeft = aEdit->GetPosPixel().X();
177  Size aEditSize = aEdit->GetSizePixel();
178 
179  aEditSize.setWidth( std::max( static_cast<long>(nWidth - nLeft - 5), long(0) ) );
180  aEdit->SetSizePixel( aEditSize );
181  aEdit->Invalidate();
182 }
183 
185 {
186  bIsTable = false;
187  // stop rulers
188  if(pView)
189  {
190  pView->GetHRuler().SetActive( false );
191  pView->GetVRuler().SetActive( false );
192 
193  OSL_ENSURE(pWrtShell, "no WrtShell!");
194  // Cursor in table
196 
197  if( bFirst )
199  SelTableCellsNotify) );
200  if( bIsTable )
201  {
202  const OUString& rPos = pWrtShell->GetBoxNms();
203  sal_Int32 nPos = 0;
204  short nSrch = -1;
205  while( (nPos = rPos.indexOf( ':',nPos + 1 ) ) != -1 )
206  nSrch = static_cast<short>(nPos);
207  aPos->SetText( rPos.copy( ++nSrch ) );
209  }
210  else
211  aPos->SetText(SwResId(STR_TBL_FORMULA));
212 
213  // Edit current field
214  OSL_ENSURE(pMgr == nullptr, "FieldManager not deleted");
215  pMgr.reset(new SwFieldMgr);
216 
217  // Form should always begin with "=" , so set here
218  OUString sEdit('=');
219  if( pMgr->GetCurField() && SwFieldTypesEnum::Formel == pMgr->GetCurTypeId() )
220  {
221  sEdit += pMgr->GetCurFieldPar2();
222  }
223  else if( bFirst && bIsTable )
224  {
225  m_bResetUndo = true;
226  SAL_WARN_IF(
228  "sw", "/org.openoffice.Office.Common/Undo/Steps <= 0");
229 
231  if( !m_bDoesUndo )
232  {
233  pWrtShell->DoUndo();
234  }
235 
236  if( !pWrtShell->SwCursorShell::HasSelection() )
237  {
239  pWrtShell->SetMark();
241  }
242  if( pWrtShell->SwCursorShell::HasSelection() )
243  {
245  pWrtShell->Delete();
247  {
248  m_bCallUndo = true;
249  }
250  }
251  pWrtShell->DoUndo(false);
252 
254  if( pWrtShell->GetTableBoxFormulaAttrs( aSet ))
255  sEdit += aSet.Get( RES_BOXATR_FORMULA ).GetFormula();
256  }
257 
258  if( bFirst )
259  {
260  // Set WrtShell flags correctly
261  pWrtShell->SttSelect();
262  pWrtShell->EndSelect();
263  }
264 
265  bFirst = false;
266 
267  aEdit->SetModifyHdl( LINK( this, SwInputWindow, ModifyHdl ));
268 
269  aEdit->SetText( sEdit );
270  aEdit->SetSelection( Selection( sEdit.getLength(), sEdit.getLength() ) );
271  sOldFormula = sEdit;
272 
273  aEdit->Invalidate();
274  aEdit->Update();
275  aEdit->GrabFocus();
276  // For input cut the UserInterface
277 
278  pView->GetEditWin().LockKeyInput(true);
279  pView->GetViewFrame()->GetDispatcher()->Lock(true);
280  pWrtShell->Push();
281  }
282  ToolBox::Show();
283 }
284 
285 IMPL_LINK( SwInputWindow, MenuHdl, Menu *, pMenu, bool )
286 {
287  OString aCommand = pMenu->GetCurItemIdent();
288  if (!aCommand.isEmpty())
289  {
290  aCommand += " ";
291  aEdit->ReplaceSelected(OStringToOUString(aCommand, RTL_TEXTENCODING_ASCII_US));
292  }
293  return false;
294 }
295 
296 IMPL_LINK_NOARG(SwInputWindow, DropdownClickHdl, ToolBox *, void)
297 {
298  sal_uInt16 nCurID = GetCurItemId();
299  EndSelection(); // reset back CurItemId !
300  if (nCurID == FN_FORMULA_CALC)
301  {
302  VclBuilder aBuilder(nullptr, VclBuilderContainer::getUIRootDir(), "modules/swriter/ui/inputwinmenu.ui", "");
303  VclPtr<PopupMenu> aPopMenu(aBuilder.get_menu("menu"));
304  aPopMenu->SetSelectHdl(LINK(this, SwInputWindow, MenuHdl));
305  aPopMenu->Execute(this, GetItemRect(FN_FORMULA_CALC), PopupMenuFlags::NoMouseUpClose);
306  }
307 }
308 
310 {
311  sal_uInt16 nCurID = GetCurItemId();
312  EndSelection(); // reset back CurItemId !
313  switch ( nCurID )
314  {
315  case FN_FORMULA_CANCEL:
316  {
317  CancelFormula();
318  }
319  break;
320  case FN_FORMULA_APPLY:
321  {
322  ApplyFormula();
323  }
324  break;
325  }
326 }
327 
329 {
330  pView->GetViewFrame()->GetDispatcher()->Lock(false);
331  pView->GetEditWin().LockKeyInput(false);
334 
335  // Form should always begin with "=", so remove it here again
336  OUString sEdit(comphelper::string::strip(aEdit->GetText(), ' '));
337  if( !sEdit.isEmpty() && '=' == sEdit[0] )
338  sEdit = sEdit.copy( 1 );
339  SfxStringItem aParam(FN_EDIT_FORMULA, sEdit);
340 
343  const SfxPoolItem* aArgs[2];
344  aArgs[0] = &aParam;
345  aArgs[1] = nullptr;
346  pView->GetViewFrame()->GetBindings().Execute( FN_EDIT_FORMULA, aArgs, SfxCallMode::ASYNCHRON );
347 }
348 
350 {
351  if(pView)
352  {
353  pView->GetViewFrame()->GetDispatcher()->Lock( false );
354  pView->GetEditWin().LockKeyInput(false);
357 
358  if( bDelSel )
360 
362 
364 
365  pView->GetViewFrame()->GetDispatcher()->Execute( FN_EDIT_FORMULA, SfxCallMode::ASYNCHRON);
366  }
367 }
368 
369 const sal_Unicode CH_LRE = 0x202a;
370 const sal_Unicode CH_PDF = 0x202c;
371 
372 IMPL_LINK( SwInputWindow, SelTableCellsNotify, SwWrtShell&, rCaller, void )
373 {
374  if(bIsTable)
375  {
376  SwFrameFormat* pTableFormat = rCaller.GetTableFormat();
377  OUString sBoxNms( rCaller.GetBoxNms() );
378  OUString sTableNm;
379  if( pTableFormat && aCurrentTableName != pTableFormat->GetName() )
380  sTableNm = pTableFormat->GetName();
381 
382  aEdit->UpdateRange( sBoxNms, sTableNm );
383 
384  OUString sNew = OUStringChar(CH_LRE) + aEdit->GetText()
385  + OUStringChar(CH_PDF);
386 
387  if( sNew != sOldFormula )
388  {
389  // The WrtShell is in the table selection,
390  // then cancel the table selection otherwise, the cursor is
391  // positioned "in the forest" and the live update does not work!
392  pWrtShell->StartAllAction();
393 
394  SwPaM aPam( *pWrtShell->GetStackCursor()->GetPoint() );
396  aPam.SetMark();
397  aPam.Move( fnMoveForward, GoInSection );
398 
399  IDocumentContentOperations& rIDCO = pWrtShell->getIDocumentContentOperations();
400  rIDCO.DeleteRange( aPam );
401  rIDCO.InsertString( aPam, sNew );
402  pWrtShell->EndAllAction();
403  sOldFormula = sNew;
404  }
405  }
406  else
407  aEdit->GrabFocus();
408 }
409 
410 void SwInputWindow::SetFormula( const OUString& rFormula )
411 {
412  OUString sEdit('=');
413  if( !rFormula.isEmpty() )
414  {
415  if( '=' == rFormula[0] )
416  sEdit = rFormula;
417  else
418  sEdit += rFormula;
419  }
420  aEdit->SetText( sEdit );
421  aEdit->SetSelection( Selection( sEdit.getLength(), sEdit.getLength() ) );
422  aEdit->Invalidate();
423  bDelSel = true;
424 }
425 
426 IMPL_LINK_NOARG(SwInputWindow, ModifyHdl, Edit&, void)
427 {
428  if (bIsTable && m_bResetUndo)
429  {
430  pWrtShell->StartAllAction();
431  DelBoxContent();
432  OUString sNew = OUStringChar(CH_LRE) + aEdit->GetText()
433  + OUStringChar(CH_PDF);
434  pWrtShell->SwEditShell::Insert2( sNew );
435  pWrtShell->EndAllAction();
436  sOldFormula = sNew;
437  }
438 }
439 
441 {
442  if( bIsTable )
443  {
445  pWrtShell->ClearMark();
447  pWrtShell->Push();
449  pWrtShell->SetMark();
451  pWrtShell->SwEditShell::Delete();
453  }
454 }
455 
456 void InputEdit::KeyInput(const KeyEvent& rEvent)
457 {
458  const vcl::KeyCode aCode = rEvent.GetKeyCode();
459  if(aCode == KEY_RETURN || aCode == KEY_F2 )
460  static_cast<SwInputWindow*>(GetParent())->ApplyFormula();
461  else if(aCode == KEY_ESCAPE )
462  static_cast<SwInputWindow*>(GetParent())->CancelFormula();
463  else
464  Edit::KeyInput(rEvent);
465 }
466 
467 void InputEdit::UpdateRange(const OUString& rBoxes,
468  const OUString& rName )
469 {
470  if( rBoxes.isEmpty() )
471  {
472  GrabFocus();
473  return;
474  }
475  const sal_Unicode cOpen = '<', cClose = '>',
476  cOpenBracket = '(';
477  OUString aPrefix = rName;
478  if(!rName.isEmpty())
479  aPrefix += ".";
480  OUString aBoxes = aPrefix + rBoxes;
481  Selection aSelection(GetSelection());
482  sal_uInt16 nSel = static_cast<sal_uInt16>(aSelection.Len());
483  // OS: The following expression ensures that in the overwrite mode,
484  // the selected closing parenthesis will be not deleted.
485  if( nSel && ( nSel > 1 ||
486  GetText()[ static_cast<sal_uInt16>(aSelection.Min()) ] != cClose ))
487  Cut();
488  else
489  aSelection.Max() = aSelection.Min();
490  OUString aActText(GetText());
491  const sal_uInt16 nLen = aActText.getLength();
492  if( !nLen )
493  {
494  OUString aStr = OUStringChar(cOpen) + aBoxes + OUStringChar(cClose);
495  SetText(aStr);
496  sal_Int32 nPos = aStr.indexOf( cClose );
497  OSL_ENSURE(nPos != -1, "delimiter not found");
498  ++nPos;
499  SetSelection( Selection( nPos, nPos ));
500  }
501  else
502  {
503  bool bFound = false;
504  sal_Unicode cCh;
505  sal_uInt16 nPos, nEndPos = 0, nStartPos = static_cast<sal_uInt16>(aSelection.Min());
506  if( nStartPos-- )
507  {
508  do {
509  if( cOpen == (cCh = aActText[ nStartPos ] ) ||
510  cOpenBracket == cCh )
511  {
512  bFound = cCh == cOpen;
513  break;
514  }
515  } while( nStartPos-- > 0 );
516  }
517  if( bFound )
518  {
519  bFound = false;
520  nEndPos = nStartPos;
521  while( nEndPos < nLen )
522  {
523  if( cClose == aActText[ nEndPos ] )
524  {
525  bFound = true;
526  break;
527  }
528  ++nEndPos;
529  }
530  // Only if the current position lies in the range or right behind.
531  if( bFound && !( nStartPos < o3tl::make_unsigned(aSelection.Max()) &&
532  static_cast<sal_uInt16>(aSelection.Max()) <= nEndPos + 1 ))
533  bFound = false;
534  }
535  if( bFound )
536  {
537  nPos = ++nStartPos + 1; // We want behind
538  aActText = aActText.replaceAt( nStartPos, nEndPos - nStartPos, aBoxes );
539  nPos = nPos + aBoxes.getLength();
540  }
541  else
542  {
543  OUString aTmp = OUStringChar(cOpen) + aBoxes + OUStringChar(cClose);
544  nPos = static_cast<sal_uInt16>(aSelection.Min());
545  aActText = aActText.replaceAt( nPos, 0, aTmp );
546  nPos = nPos + aTmp.getLength();
547  }
548  if( GetText() != aActText )
549  {
550  SetText( aActText );
551  SetSelection( Selection( nPos, nPos ) );
552  }
553  }
554  GrabFocus();
555 
556 }
557 
559  sal_uInt16 nId,
560  SfxBindings const * pBindings,
561  SfxChildWinInfo* ) :
562  SfxChildWindow( _pParent, nId )
563 {
564  pDispatch = pBindings->GetDispatcher();
566  static_cast<SwInputWindow*>(GetWindow())->ShowWin();
567  SetAlignment(SfxChildAlignment::LOWESTTOP);
568 }
569 
571 {
572  if(pDispatch)
573  pDispatch->Lock(false);
574 }
575 
577 {
579  return aInfo;
580 }
581 
582 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
virtual Point GetPosPixel() const
SfxViewFrame * GetViewFrame() const
long Width() const
SFX_IMPL_POS_CHILDWINDOW_WITHID(SfxInfoBarContainerChild, SID_INFOBAR, SFX_OBJECTBAR_OBJECT)
virtual void Resize() override
Definition: inputwin.cxx:171
virtual void Cut()
bool m_bCallUndo
Definition: inputwin.hxx:62
void EndSelTableCells()
Definition: wrtsh.hxx:632
long GetHeight() const
void SetActive(bool bOn=true)
virtual void dispose() override
Definition: inputwin.cxx:135
SwWrtShell * pWrtShell
Definition: inputwin.hxx:53
VclPtr< Edit > aPos
Definition: inputwin.hxx:50
SwView * GetActiveView()
Definition: swmodul1.cxx:115
void ApplyFormula()
Definition: inputwin.cxx:328
#define HID_TBX_FORMULA_CANCEL
Definition: helpids.h:154
long Height() const
void DelBoxContent()
Definition: inputwin.cxx:440
void Create(SwFormatVertOrient &rItem, SvStream &rStrm, sal_uInt16 nVersionAbusedAsSize)
Definition: legacyitem.cxx:32
SfxDispatcher * GetDispatcher()
void disposeAndClear()
SwView * pView
Definition: inputwin.hxx:54
bool Pop(SwCursorShell::PopMode=SwCursorShell::PopMode::DeleteStack)
Definition: wrtsh1.cxx:1708
virtual Size GetSizePixel() const
virtual void SetSizePixel(const Size &rNewSize)
virtual void dispose() override
void CancelFormula()
Definition: inputwin.cxx:349
SwUndoId EndUndo(SwUndoId eUndoId=SwUndoId::EMPTY, const SwRewriter *pRewriter=nullptr)
Closes parenthesis of nUndoId, not used by UI.
Definition: edws.cxx:233
virtual void DeleteRange(SwPaM &)=0
Delete a range SwFlyFrameFormat.
long Len() const
void SetWindow(const VclPtr< vcl::Window > &p)
void EnterStdMode()
Definition: select.cxx:550
SwEditWin & GetEditWin()
Definition: view.hxx:403
void DoUndo(bool bOn=true)
Undo.
Definition: edws.cxx:199
#define FN_EDIT_FORMULA
Definition: cmdid.h:77
void EndAllAction()
Definition: edws.cxx:96
sal_uInt16 GetCurItemId() const
vcl::Window * GetWindow() const
virtual void Resize() override
SvxRuler & GetVRuler()
Definition: view.hxx:482
virtual void Click() override
Definition: inputwin.cxx:309
Used by the UI to modify the document model.
Definition: wrtsh.hxx:90
bool GoInSection(SwPaM &rPam, SwMoveFnCollection const &fnMove)
Definition: pam.cxx:941
sal_uInt16 sal_Unicode
virtual void SetModifyHdl(const Link< Edit &, void > &rLink)
#define ED_FORMULA
Definition: inputwin.cxx:57
void CleanupUglyHackWithUndo()
Definition: inputwin.cxx:154
const OUString & GetName() const
Definition: format.hxx:111
constexpr sal_uInt16 KEY_F2
#define ED_POS
Definition: inputwin.cxx:56
virtual const Selection & GetSelection() const
SwInputChild(vcl::Window *, sal_uInt16 nId, SfxBindings const *, SfxChildWinInfo *)
Definition: inputwin.cxx:558
void setY(long nY)
bool Execute(sal_uInt16 nSlot, const SfxPoolItem **pArgs=nullptr, SfxCallMode nCall=SfxCallMode::SLOT)
virtual void SetSelection(const Selection &rSelection)
void LockKeyInput(bool bSet)
Definition: edtwin.hxx:239
void Update()
#define FN_FORMULA_CANCEL
Definition: cmdid.h:388
virtual ~SwInputChild() override
Definition: inputwin.cxx:570
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
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:370
void SetSelectHdl(const Link< Menu *, bool > &rLink)
Style of a layout element.
Definition: frmfmt.hxx:57
void EndSelection()
OUString aCurrentTableName
Definition: inputwin.hxx:55
#define FN_FORMULA_CALC
Definition: cmdid.h:387
#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()
virtual void Invalidate(InvalidateFlags nFlags=InvalidateFlags::NONE)
virtual OUString GetText() const override
SwUndoId StartUndo(SwUndoId eUndoId=SwUndoId::EMPTY, const SwRewriter *pRewriter=nullptr)
Undo: set up Undo parenthesis, return nUndoId of this parenthesis.
Definition: edws.cxx:222
void UpdateRange(const OUString &aSel, const OUString &aTableName)
Definition: inputwin.cxx:467
constexpr std::enable_if_t< std::is_signed_v< T >, std::make_unsigned_t< T > > make_unsigned(T value)
void ShowWin()
Definition: inputwin.cxx:184
std::unique_ptr< SwFieldMgr > pMgr
Definition: inputwin.hxx:52
SfxDispatcher * pDispatch
Definition: inputwin.hxx:93
void SetMark()
Definition: crsrsh.hxx:879
bool GoCurrSection(SwPaM &rPam, SwMoveFnCollection const &fnMove)
Definition: pam.cxx:1044
virtual ~SwInputWindow() override
Definition: inputwin.cxx:130
const sal_Unicode CH_LRE
Definition: inputwin.cxx:369
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:55
void GrabFocus()
virtual void KeyInput(const KeyEvent &rKEvt) override
vcl::Window * GetParent() const
#define HID_TBX_FORMULA_APPLY
Definition: helpids.h:155
long X() const
OUString GetBoxNms() const
Definition: trvltbl.cxx:745
SwFrameFormat * GetTableFormat()
Definition: edws.cxx:182
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)
Size GetSizePixel() const override
const vcl::KeyCode & GetKeyCode() const
SwWrtShell * GetWrtShellPtr() const
Definition: view.hxx:401
#define SAL_WARN_IF(condition, area, stream)
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:296
bool m_bDoesUndo
Definition: inputwin.hxx:60
OString strip(const OString &rIn, char c)
bool GetTableBoxFormulaAttrs(SfxItemSet &rSet) const
Definition: edtab.cxx:302
PopupMenu * get_menu(const OString &sID)
#define FN_FORMULA_APPLY
Definition: cmdid.h:389
virtual void KeyInput(const KeyEvent &) override
Definition: inputwin.cxx:456
void ClearMark()
Definition: crsrsh.cxx:930
VclPtr< InputEdit > aEdit
Definition: inputwin.hxx:51
SvxRuler & GetHRuler()
Definition: view.hxx:481
SwMoveFnCollection const & fnSectionStart
Definition: paminit.cxx:49
SwMoveFnCollection const & fnMoveBackward
Definition: paminit.cxx:58
SfxDispatcher * GetDispatcher() const
IMPL_LINK(SwInputWindow, MenuHdl, Menu *, pMenu, bool)
Definition: inputwin.cxx:285
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)
virtual void SetText(const OUString &rStr) override
bool DoesUndo() const
Definition: edws.cxx:202
void StartAllAction()
For all views of this document.
Definition: edws.cxx:85
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:61
void SetFormula(const OUString &rFormula)
Definition: inputwin.cxx:410
#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)