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 <officecfg/Office/Common.hxx>
25 #include <tools/gen.hxx>
26 #include <sfx2/objface.hxx>
27 #include <sfx2/viewfrm.hxx>
28 #include <sfx2/dispatch.hxx>
29 #include <svx/ruler.hxx>
30 #include <svl/zforlist.hxx>
31 #include <svl/stritem.hxx>
32 #include <vcl/event.hxx>
33 #include <vcl/settings.hxx>
34 
35 #include <swtypes.hxx>
36 #include <cmdid.h>
37 #include <swmodule.hxx>
38 #include <wrtsh.hxx>
39 #include <view.hxx>
40 #include <calc.hxx>
41 #include <inputwin.hxx>
42 #include <fldbas.hxx>
43 #include <fldmgr.hxx>
44 #include <frmfmt.hxx>
45 #include <cellatr.hxx>
46 #include <edtwin.hxx>
47 #include <helpids.h>
48 #include <strings.hrc>
49 #include <bitmaps.hlst>
50 
51 // Only for the UpdateRange: Delete the box in which the stacked cursor is positioned.
52 #include <pam.hxx>
53 
54 #include <swundo.hxx>
55 #include <dbui.hrc>
56 
58 
59 #define ED_POS 2
60 #define ED_FORMULA 3
61 
63 
64 SwInputWindow::SwInputWindow(vcl::Window* pParent, SfxDispatcher const * pDispatcher)
65  : ToolBox(pParent, WB_3DLOOK|WB_BORDER)
66  , aPos(VclPtr<Edit>::Create(this, WB_3DLOOK|WB_CENTER|WB_BORDER|WB_READONLY))
67  , aEdit(VclPtr<InputEdit>::Create(this, WB_3DLOOK|WB_TABSTOP|WB_BORDER|WB_NOHIDESELECTION))
68  , pWrtShell(nullptr)
69  , pView(nullptr)
70  , m_bDoesUndo(true)
71  , m_bResetUndo(false)
72  , m_bCallUndo(false)
73 {
74  bFirst = true;
75  bIsTable = bDelSel = false;
76 
77  aEdit->SetSizePixel(aEdit->CalcMinimumSize());
78  aPos->SetSizePixel(aPos->LogicToPixel(Size(45, 11), MapMode(MapUnit::MapAppFont)));
79 
80  InsertItem(FN_FORMULA_CALC, Image(StockImage::Yes, RID_BMP_FORMULA_CALC),
81  SwResId(STR_FORMULA_CALC));
82  InsertItem(FN_FORMULA_CANCEL, Image(StockImage::Yes, RID_BMP_FORMULA_CANCEL),
83  SwResId(STR_FORMULA_CANCEL));
84  InsertItem(FN_FORMULA_APPLY, Image(StockImage::Yes, RID_BMP_FORMULA_APPLY),
85  SwResId(STR_FORMULA_APPLY));
86 
90 
91  SwView *pDispatcherView = dynamic_cast<SwView*>(pDispatcher ? pDispatcher->GetFrame()->GetViewShell() : nullptr);
92  SwView* pActiveView = ::GetActiveView();
93  if (pDispatcherView == pActiveView)
94  pView = pActiveView;
95  pWrtShell = pView ? pView->GetWrtShellPtr() : nullptr;
96 
97  InsertWindow(ED_POS, aPos.get(), ToolBoxItemBits::NONE, 0);
98  SetItemText(ED_POS, SwResId(STR_ACCESS_FORMULA_TYPE));
99  aPos->SetAccessibleName(SwResId(STR_ACCESS_FORMULA_TYPE));
100  SetAccessibleName(SwResId(STR_ACCESS_FORMULA_TOOLBAR));
101  InsertSeparator ( 1 );
102  InsertSeparator ();
103  InsertWindow(ED_FORMULA, aEdit.get());
104  SetItemText(ED_FORMULA, SwResId(STR_ACCESS_FORMULA_TEXT));
105  aEdit->SetAccessibleName(SwResId(STR_ACCESS_FORMULA_TEXT));
106  SetHelpId(ED_FORMULA, HID_EDIT_FORMULA);
107 
108  SetItemBits( FN_FORMULA_CALC, GetItemBits( FN_FORMULA_CALC ) | ToolBoxItemBits::DROPDOWNONLY );
109  SetDropdownClickHdl( LINK( this, SwInputWindow, DropdownClickHdl ));
110 
111  Size aSizeTbx = CalcWindowSizePixel();
112  Size aEditSize = aEdit->GetSizePixel();
113  tools::Rectangle aItemRect( GetItemRect(FN_FORMULA_CALC) );
114  long nMaxHeight = std::max(aEditSize.Height(), aItemRect.GetHeight());
115  if( nMaxHeight+2 > aSizeTbx.Height() )
116  aSizeTbx.setHeight( nMaxHeight+2 );
117  Size aSize = GetSizePixel();
118  aSize.setHeight( aSizeTbx.Height() );
119  SetSizePixel( aSize );
120 
121  // align edit and item vcentered
122  Size aPosSize = aPos->GetSizePixel();
123  aPosSize.setHeight( nMaxHeight );
124  aEditSize.setHeight( nMaxHeight );
125  Point aPosPos = aPos->GetPosPixel();
126  Point aEditPos = aEdit->GetPosPixel();
127  aPosPos.setY( (aSize.Height() - nMaxHeight)/2 + 1 );
128  aEditPos.setY( (aSize.Height() - nMaxHeight)/2 + 1 );
129  aPos->SetPosSizePixel( aPosPos, aPosSize );
130  aEdit->SetPosSizePixel( aEditPos, aEditSize );
131 }
132 
134 {
135  disposeOnce();
136 }
137 
139 {
140  // wake rulers
141  if(pView)
142  {
145  }
146  pMgr.reset();
147  if(pWrtShell)
149 
151 
155 }
156 
158 {
159  if (m_bResetUndo)
160  {
161  if (pWrtShell)
162  {
163  DelBoxContent();
165  if (m_bCallUndo)
166  {
167  pWrtShell->Undo();
168  }
169  }
170  m_bResetUndo = false; // #i117122# once is enough :)
171  }
172 }
173 
175 {
176  ToolBox::Resize();
177 
178  long nWidth = GetSizePixel().Width();
179  long nLeft = aEdit->GetPosPixel().X();
180  Size aEditSize = aEdit->GetSizePixel();
181 
182  aEditSize.setWidth( std::max( static_cast<long>(nWidth - nLeft - 5), long(0) ) );
183  aEdit->SetSizePixel( aEditSize );
184  aEdit->Invalidate();
185 }
186 
188 {
189  bIsTable = false;
190  // stop rulers
191  if(pView)
192  {
193  pView->GetHRuler().SetActive( false );
194  pView->GetVRuler().SetActive( false );
195 
196  OSL_ENSURE(pWrtShell, "no WrtShell!");
197  // Cursor in table
199 
200  if( bFirst )
202  SelTableCellsNotify) );
203  if( bIsTable )
204  {
205  const OUString& rPos = pWrtShell->GetBoxNms();
206  sal_Int32 nPos = 0;
207  short nSrch = -1;
208  while( (nPos = rPos.indexOf( ':',nPos + 1 ) ) != -1 )
209  nSrch = static_cast<short>(nPos);
210  aPos->SetText( rPos.copy( ++nSrch ) );
212  }
213  else
214  aPos->SetText(SwResId(STR_TBL_FORMULA));
215 
216  // Edit current field
217  OSL_ENSURE(pMgr == nullptr, "FieldManager not deleted");
218  pMgr.reset(new SwFieldMgr);
219 
220  // Form should always begin with "=" , so set here
221  OUString sEdit('=');
222  if( pMgr->GetCurField() && TYP_FORMELFLD == pMgr->GetCurTypeId() )
223  {
224  sEdit += pMgr->GetCurFieldPar2();
225  }
226  else if( bFirst && bIsTable )
227  {
228  m_bResetUndo = true;
229  SAL_WARN_IF(
231  "sw", "/org.openoffice.Office.Common/Undo/Steps <= 0");
232 
234  if( !m_bDoesUndo )
235  {
236  pWrtShell->DoUndo();
237  }
238 
239  if( !pWrtShell->SwCursorShell::HasSelection() )
240  {
242  pWrtShell->SetMark();
244  }
245  if( pWrtShell->SwCursorShell::HasSelection() )
246  {
248  pWrtShell->Delete();
250  {
251  m_bCallUndo = true;
252  }
253  }
254  pWrtShell->DoUndo(false);
255 
257  if( pWrtShell->GetTableBoxFormulaAttrs( aSet ))
258  sEdit += aSet.Get( RES_BOXATR_FORMULA ).GetFormula();
259  }
260 
261  if( bFirst )
262  {
263  // Set WrtShell flags correctly
264  pWrtShell->SttSelect();
265  pWrtShell->EndSelect();
266  }
267 
268  bFirst = false;
269 
270  aEdit->SetModifyHdl( LINK( this, SwInputWindow, ModifyHdl ));
271 
272  aEdit->SetText( sEdit );
273  aEdit->SetSelection( Selection( sEdit.getLength(), sEdit.getLength() ) );
274  sOldFormula = sEdit;
275 
276  aEdit->Invalidate();
277  aEdit->Update();
278  aEdit->GrabFocus();
279  // For input cut the UserInterface
280 
281  pView->GetEditWin().LockKeyInput(true);
282  pView->GetViewFrame()->GetDispatcher()->Lock(true);
283  pWrtShell->Push();
284  }
285  ToolBox::Show();
286 }
287 
288 IMPL_LINK( SwInputWindow, MenuHdl, Menu *, pMenu, bool )
289 {
290  OString aCommand = pMenu->GetCurItemIdent();
291  if (!aCommand.isEmpty())
292  {
293  aCommand += " ";
294  aEdit->ReplaceSelected(OStringToOUString(aCommand, RTL_TEXTENCODING_ASCII_US));
295  }
296  return false;
297 }
298 
299 IMPL_LINK_NOARG(SwInputWindow, DropdownClickHdl, ToolBox *, void)
300 {
301  sal_uInt16 nCurID = GetCurItemId();
302  EndSelection(); // reset back CurItemId !
303  if (nCurID == FN_FORMULA_CALC)
304  {
305  VclBuilder aBuilder(nullptr, VclBuilderContainer::getUIRootDir(), "modules/swriter/ui/inputwinmenu.ui", "");
306  VclPtr<PopupMenu> aPopMenu(aBuilder.get_menu("menu"));
307  aPopMenu->SetSelectHdl(LINK(this, SwInputWindow, MenuHdl));
308  aPopMenu->Execute(this, GetItemRect(FN_FORMULA_CALC), PopupMenuFlags::NoMouseUpClose);
309  }
310 }
311 
313 {
314  sal_uInt16 nCurID = GetCurItemId();
315  EndSelection(); // reset back CurItemId !
316  switch ( nCurID )
317  {
318  case FN_FORMULA_CANCEL:
319  {
320  CancelFormula();
321  }
322  break;
323  case FN_FORMULA_APPLY:
324  {
325  ApplyFormula();
326  }
327  break;
328  }
329 }
330 
332 {
333  pView->GetViewFrame()->GetDispatcher()->Lock(false);
334  pView->GetEditWin().LockKeyInput(false);
337 
338  // Form should always begin with "=", so remove it here again
339  OUString sEdit(comphelper::string::strip(aEdit->GetText(), ' '));
340  if( !sEdit.isEmpty() && '=' == sEdit[0] )
341  sEdit = sEdit.copy( 1 );
342  SfxStringItem aParam(FN_EDIT_FORMULA, sEdit);
343 
346  const SfxPoolItem* aArgs[2];
347  aArgs[0] = &aParam;
348  aArgs[1] = nullptr;
349  pView->GetViewFrame()->GetBindings().Execute( FN_EDIT_FORMULA, aArgs, SfxCallMode::ASYNCHRON );
350 }
351 
353 {
354  if(pView)
355  {
356  pView->GetViewFrame()->GetDispatcher()->Lock( false );
357  pView->GetEditWin().LockKeyInput(false);
360 
361  if( bDelSel )
363 
365 
367 
368  pView->GetViewFrame()->GetDispatcher()->Execute( FN_EDIT_FORMULA, SfxCallMode::ASYNCHRON);
369  }
370 }
371 
372 const sal_Unicode CH_LRE = 0x202a;
373 const sal_Unicode CH_PDF = 0x202c;
374 
375 IMPL_LINK( SwInputWindow, SelTableCellsNotify, SwWrtShell&, rCaller, void )
376 {
377  if(bIsTable)
378  {
379  SwFrameFormat* pTableFormat = rCaller.GetTableFormat();
380  OUString sBoxNms( rCaller.GetBoxNms() );
381  OUString sTableNm;
382  if( pTableFormat && aCurrentTableName != pTableFormat->GetName() )
383  sTableNm = pTableFormat->GetName();
384 
385  aEdit->UpdateRange( sBoxNms, sTableNm );
386 
387  OUString sNew = OUStringLiteral1(CH_LRE) + aEdit->GetText()
388  + OUStringLiteral1(CH_PDF);
389 
390  if( sNew != sOldFormula )
391  {
392  // The WrtShell is in the table selection,
393  // then cancel the table selection otherwise, the cursor is
394  // positioned "in the forest" and the live update does not work!
395  pWrtShell->StartAllAction();
396 
397  SwPaM aPam( *pWrtShell->GetStackCursor()->GetPoint() );
399  aPam.SetMark();
400  aPam.Move( fnMoveForward, GoInSection );
401 
402  IDocumentContentOperations& rIDCO = pWrtShell->getIDocumentContentOperations();
403  rIDCO.DeleteRange( aPam );
404  rIDCO.InsertString( aPam, sNew );
405  pWrtShell->EndAllAction();
406  sOldFormula = sNew;
407  }
408  }
409  else
410  aEdit->GrabFocus();
411 }
412 
413 void SwInputWindow::SetFormula( const OUString& rFormula )
414 {
415  OUString sEdit('=');
416  if( !rFormula.isEmpty() )
417  {
418  if( '=' == rFormula[0] )
419  sEdit = rFormula;
420  else
421  sEdit += rFormula;
422  }
423  aEdit->SetText( sEdit );
424  aEdit->SetSelection( Selection( sEdit.getLength(), sEdit.getLength() ) );
425  aEdit->Invalidate();
426  bDelSel = true;
427 }
428 
429 IMPL_LINK_NOARG(SwInputWindow, ModifyHdl, Edit&, void)
430 {
431  if (bIsTable && m_bResetUndo)
432  {
433  pWrtShell->StartAllAction();
434  DelBoxContent();
435  OUString sNew = OUStringLiteral1(CH_LRE) + aEdit->GetText()
436  + OUStringLiteral1(CH_PDF);
437  pWrtShell->SwEditShell::Insert2( sNew );
438  pWrtShell->EndAllAction();
439  sOldFormula = sNew;
440  }
441 }
442 
444 {
445  if( bIsTable )
446  {
448  pWrtShell->ClearMark();
450  pWrtShell->Push();
452  pWrtShell->SetMark();
454  pWrtShell->SwEditShell::Delete();
456  }
457 }
458 
459 void InputEdit::KeyInput(const KeyEvent& rEvent)
460 {
461  const vcl::KeyCode aCode = rEvent.GetKeyCode();
462  if(aCode == KEY_RETURN || aCode == KEY_F2 )
463  static_cast<SwInputWindow*>(GetParent())->ApplyFormula();
464  else if(aCode == KEY_ESCAPE )
465  static_cast<SwInputWindow*>(GetParent())->CancelFormula();
466  else
467  Edit::KeyInput(rEvent);
468 }
469 
470 void InputEdit::UpdateRange(const OUString& rBoxes,
471  const OUString& rName )
472 {
473  if( rBoxes.isEmpty() )
474  {
475  GrabFocus();
476  return;
477  }
478  const sal_Unicode cOpen = '<', cClose = '>',
479  cOpenBracket = '(';
480  OUString aPrefix = rName;
481  if(!rName.isEmpty())
482  aPrefix += ".";
483  OUString aBoxes = aPrefix;
484  aBoxes += rBoxes;
485  Selection aSelection(GetSelection());
486  sal_uInt16 nSel = static_cast<sal_uInt16>(aSelection.Len());
487  // OS: The following expression ensures that in the overwrite mode,
488  // the selected closing parenthesis will be not deleted.
489  if( nSel && ( nSel > 1 ||
490  GetText()[ static_cast<sal_uInt16>(aSelection.Min()) ] != cClose ))
491  Cut();
492  else
493  aSelection.Max() = aSelection.Min();
494  OUString aActText(GetText());
495  const sal_uInt16 nLen = aActText.getLength();
496  if( !nLen )
497  {
498  OUString aStr = OUStringBuffer().
499  append(cOpen).append(aBoxes).append(cClose).
500  makeStringAndClear();
501  SetText(aStr);
502  sal_Int32 nPos = aStr.indexOf( cClose );
503  OSL_ENSURE(nPos != -1, "delimiter not found");
504  ++nPos;
505  SetSelection( Selection( nPos, nPos ));
506  }
507  else
508  {
509  bool bFound = false;
510  sal_Unicode cCh;
511  sal_uInt16 nPos, nEndPos = 0, nStartPos = static_cast<sal_uInt16>(aSelection.Min());
512  if( nStartPos-- )
513  {
514  do {
515  if( cOpen == (cCh = aActText[ nStartPos ] ) ||
516  cOpenBracket == cCh )
517  {
518  bFound = cCh == cOpen;
519  break;
520  }
521  } while( nStartPos-- > 0 );
522  }
523  if( bFound )
524  {
525  bFound = false;
526  nEndPos = nStartPos;
527  while( nEndPos < nLen )
528  {
529  if( cClose == (cCh = aActText[ nEndPos ]))
530  {
531  bFound = true;
532  break;
533  }
534  ++nEndPos;
535  }
536  // Only if the current position lies in the range or right behind.
537  if( bFound && !( nStartPos < static_cast<sal_uInt16>(aSelection.Max()) &&
538  static_cast<sal_uInt16>(aSelection.Max()) <= nEndPos + 1 ))
539  bFound = false;
540  }
541  if( bFound )
542  {
543  nPos = ++nStartPos + 1; // We want behind
544  aActText = aActText.replaceAt( nStartPos, nEndPos - nStartPos, aBoxes );
545  nPos = nPos + aBoxes.getLength();
546  }
547  else
548  {
549  OUString aTmp = OUStringBuffer().
550  append(cOpen).append(aBoxes).append(cClose).
551  makeStringAndClear();
552  nPos = static_cast<sal_uInt16>(aSelection.Min());
553  aActText = aActText.replaceAt( nPos, 0, aTmp );
554  nPos = nPos + aTmp.getLength();
555  }
556  if( GetText() != aActText )
557  {
558  SetText( aActText );
559  SetSelection( Selection( nPos, nPos ) );
560  }
561  }
562  GrabFocus();
563 
564 }
565 
567  sal_uInt16 nId,
568  SfxBindings const * pBindings,
569  SfxChildWinInfo* ) :
570  SfxChildWindow( _pParent, nId )
571 {
572  pDispatch = pBindings->GetDispatcher();
574  static_cast<SwInputWindow*>(GetWindow())->ShowWin();
575  SetAlignment(SfxChildAlignment::LOWESTTOP);
576 }
577 
579 {
580  if(pDispatch)
581  pDispatch->Lock(false);
582 }
583 
585 {
587  return aInfo;
588 }
589 
590 /* 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
#define KEY_F2
SFX_IMPL_POS_CHILDWINDOW_WITHID(SfxInfoBarContainerChild, SID_INFOBAR, SFX_OBJECTBAR_OBJECT)
virtual void Resize() override
Definition: inputwin.cxx:174
virtual void Cut()
bool m_bCallUndo
Definition: inputwin.hxx:62
void EndSelTableCells()
Definition: wrtsh.hxx:630
long GetHeight() const
void SetActive(bool bOn=true)
virtual void dispose() override
Definition: inputwin.cxx:138
SwWrtShell * pWrtShell
Definition: inputwin.hxx:53
VclPtr< Edit > aPos
Definition: inputwin.hxx:50
SwView * GetActiveView()
Definition: swmodul1.cxx:123
void ApplyFormula()
Definition: inputwin.cxx:331
#define HID_TBX_FORMULA_CANCEL
Definition: helpids.h:154
long Height() const
void DelBoxContent()
Definition: inputwin.cxx:443
SfxDispatcher * GetDispatcher()
void disposeAndClear()
SwView * pView
Definition: inputwin.hxx:54
bool Pop(SwCursorShell::PopMode=SwCursorShell::PopMode::DeleteStack)
Definition: wrtsh1.cxx:1721
virtual Size GetSizePixel() const
virtual void SetSizePixel(const Size &rNewSize)
virtual void dispose() override
void CancelFormula()
Definition: inputwin.cxx:352
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:552
SwEditWin & GetEditWin()
Definition: view.hxx:403
void DoUndo(bool bOn=true)
Undo.
Definition: edws.cxx:199
#define FN_EDIT_FORMULA
Definition: cmdid.h:76
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:312
Used by the UI to modify the document model.
Definition: wrtsh.hxx:88
bool GoInSection(SwPaM &rPam, SwMoveFnCollection const &fnMove)
Definition: pam.cxx:886
sal_uInt16 sal_Unicode
virtual void SetModifyHdl(const Link< Edit &, void > &rLink)
#define ED_FORMULA
Definition: inputwin.cxx:60
void CleanupUglyHackWithUndo()
Definition: inputwin.cxx:157
const OUString & GetName() const
Definition: format.hxx:111
#define ED_POS
Definition: inputwin.cxx:59
virtual const Selection & GetSelection() const
SwInputChild(vcl::Window *, sal_uInt16 nId, SfxBindings const *, SfxChildWinInfo *)
Definition: inputwin.cxx:566
OString strip(const OString &rIn, sal_Char c)
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:381
virtual ~SwInputChild() override
Definition: inputwin.cxx:578
PaM is Point and Mark: a selection of the document model.
Definition: pam.hxx:136
void EndSelect()
Definition: select.cxx:426
bool Move(SwMoveFnCollection const &fnMove=fnMoveForward, SwGoInDoc fnGo=GoInContent)
Movement of cursor.
Definition: pam.cxx:481
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:888
const sal_Unicode CH_PDF
Definition: inputwin.cxx:373
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:380
#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:2221
SfxBindings & GetBindings()
#define KEY_ESCAPE
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:470
void ShowWin()
Definition: inputwin.cxx:187
std::unique_ptr< SwFieldMgr > pMgr
Definition: inputwin.hxx:52
SfxDispatcher * pDispatch
Definition: inputwin.hxx:93
void SetMark()
Definition: crsrsh.hxx:874
bool GoCurrSection(SwPaM &rPam, SwMoveFnCollection const &fnMove)
Definition: pam.cxx:989
virtual ~SwInputWindow() override
Definition: inputwin.cxx:133
const sal_Unicode CH_LRE
Definition: inputwin.cxx:372
void Lock(bool bLock)
OUString SwResId(const char *pId)
Definition: swmodule.cxx:191
static OUString getUIRootDir()
Text operation/manipulation interface.
void SttSelect()
Definition: select.cxx:386
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:743
SwFrameFormat * GetTableFormat()
Definition: edws.cxx:182
bool MoveSection(SwWhichSection, SwMoveFnCollection const &)
Definition: crsrsh.cxx:707
bool Delete()
Delete content of all ranges.
Definition: eddel.cxx:117
#define HID_EDIT_FORMULA
Definition: helpids.h:67
void SetAlignment(SfxChildAlignment eAlign)
#define KEY_RETURN
Size GetSizePixel() const override
const vcl::KeyCode & GetKeyCode() const
SwWrtShell * GetWrtShellPtr() const
Definition: view.hxx:401
#define SAL_WARN_IF(condition, area, stream)
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:299
void Create(SwFormatVertOrient &rItem, SvStream &rStrm, sal_uInt16 nVersionAbusedAsSize)
Definition: legacyitem.cxx:34
bool m_bDoesUndo
Definition: inputwin.hxx:60
bool GetTableBoxFormulaAttrs(SfxItemSet &rSet) const
Definition: edtab.cxx:310
PopupMenu * get_menu(const OString &sID)
#define FN_FORMULA_APPLY
Definition: cmdid.h:382
virtual void KeyInput(const KeyEvent &) override
Definition: inputwin.cxx:459
void ClearMark()
Definition: crsrsh.cxx:926
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:288
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
sal_Int32 nPos
void setWidth(long nWidth)
aStr
void Undo(sal_uInt16 const nCount=1)
Definition: edundo.cxx:101
virtual SfxChildWinInfo GetInfo() const
Definition: view.hxx:146
bool m_bResetUndo
Definition: inputwin.hxx:61
void SetFormula(const OUString &rFormula)
Definition: inputwin.cxx:413
#define RES_BOXATR_FORMULA
Definition: hintids.hxx:262
void SelTableCells(const Link< SwWrtShell &, void > &rLink)
Definition: wrtsh.hxx:624
void Show(bool bVisible=true, ShowFlags nFlags=ShowFlags::NONE)
void setHeight(long nHeight)