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 <osl/diagnose.h>
24#include <comphelper/string.hxx>
25#include <o3tl/safeint.hxx>
26#include <officecfg/Office/Common.hxx>
27#include <tools/gen.hxx>
28#include <sfx2/objface.hxx>
29#include <sfx2/viewfrm.hxx>
30#include <sfx2/dispatch.hxx>
31#include <svx/ruler.hxx>
32#include <svl/stritem.hxx>
33#include <vcl/event.hxx>
34#include <vcl/weldutils.hxx>
35
36#include <swtypes.hxx>
37#include <cmdid.h>
38#include <swmodule.hxx>
39#include <wrtsh.hxx>
40#include <view.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
57
58constexpr ToolBoxItemId ED_POS(2);
60constexpr ToolBoxItemId FN_FORMULA_CALC(FN_FORMAT + 156); /* select formula */
61constexpr ToolBoxItemId FN_FORMULA_CANCEL(FN_FORMAT + 157); /* don't apply formula */
62constexpr ToolBoxItemId FN_FORMULA_APPLY(FN_FORMAT + 158); /* apply formula */
63
65
66IMPL_LINK(PosEdit, KeyInputHdl, const KeyEvent&, rKEvt, bool)
67{
68 return ChildKeyInput(rKEvt);
69}
70
72 : ToolBox(pParent, WB_3DLOOK|WB_BORDER)
73 , mxPos(VclPtr<PosEdit>::Create(this))
74 , mxEdit(VclPtr<InputEdit>::Create(this))
75 , m_pWrtShell(nullptr)
76 , m_pView(nullptr)
77 , m_bDoesUndo(true)
78 , m_bResetUndo(false)
79 , m_bCallUndo(false)
80{
81 m_bFirst = true;
82 m_bIsTable = m_bDelSel = false;
83
84 InsertItem(FN_FORMULA_CALC, Image(StockImage::Yes, RID_BMP_FORMULA_CALC),
85 SwResId(STR_FORMULA_CALC));
86 InsertItem(FN_FORMULA_CANCEL, Image(StockImage::Yes, RID_BMP_FORMULA_CANCEL),
87 SwResId(STR_FORMULA_CANCEL));
88 InsertItem(FN_FORMULA_APPLY, Image(StockImage::Yes, RID_BMP_FORMULA_APPLY),
89 SwResId(STR_FORMULA_APPLY));
90
94
95 SwView *pDispatcherView = dynamic_cast<SwView*>(pDispatcher ? pDispatcher->GetFrame()->GetViewShell() : nullptr);
96 SwView* pActiveView = ::GetActiveView();
97 if (pDispatcherView == pActiveView)
98 m_pView = pActiveView;
100
101 InsertWindow(ED_POS, mxPos.get(), ToolBoxItemBits::NONE, 0);
102 SetItemText(ED_POS, SwResId(STR_ACCESS_FORMULA_TYPE));
103 mxPos->set_accessible_name(SwResId(STR_ACCESS_FORMULA_TYPE));
104 SetAccessibleName(SwResId(STR_ACCESS_FORMULA_TOOLBAR));
105 InsertSeparator ( 1 );
108 SetItemText(ED_FORMULA, SwResId(STR_ACCESS_FORMULA_TEXT));
109 mxEdit->set_accessible_name(SwResId(STR_ACCESS_FORMULA_TEXT));
111
112 SetItemBits( FN_FORMULA_CALC, GetItemBits( FN_FORMULA_CALC ) | ToolBoxItemBits::DROPDOWNONLY );
113 SetDropdownClickHdl( LINK( this, SwInputWindow, DropdownClickHdl ));
114
115 Size aSizeTbx = CalcWindowSizePixel();
116 Size aEditSize = mxEdit->GetSizePixel();
118 tools::Long nMaxHeight = std::max(aEditSize.Height(), aItemRect.GetHeight());
119 if( nMaxHeight+2 > aSizeTbx.Height() )
120 aSizeTbx.setHeight( nMaxHeight+2 );
121 Size aSize = GetSizePixel();
122 aSize.setHeight( aSizeTbx.Height() );
123 SetSizePixel( aSize );
124
125 // align edit and item vcentered
126 Size aPosSize = mxPos->GetSizePixel();
127 aPosSize.setHeight( nMaxHeight );
128 aEditSize.setHeight( nMaxHeight );
129 Point aPosPos = mxPos->GetPosPixel();
130 Point aEditPos = mxEdit->GetPosPixel();
131 aPosPos.setY( (aSize.Height() - nMaxHeight)/2 + 1 );
132 aEditPos.setY( (aSize.Height() - nMaxHeight)/2 + 1 );
133 mxPos->SetPosSizePixel( aPosPos, aPosSize );
134 mxEdit->SetPosSizePixel( aEditPos, aEditSize );
135}
136
138{
139 disposeOnce();
140}
141
143{
144 // wake rulers
145 if(m_pView)
146 {
149 }
150 m_pMgr.reset();
151 if(m_pWrtShell)
153
155
159}
160
162{
163 if (!m_bResetUndo)
164 return;
165
166 if (m_pWrtShell)
167 {
170 if (m_bCallUndo)
171 {
172 m_pWrtShell->Undo();
173 }
174 }
175 m_bResetUndo = false; // #i117122# once is enough :)
176}
177
179{
181
182 tools::Long nWidth = GetSizePixel().Width();
183 tools::Long nLeft = mxEdit->GetPosPixel().X();
184 Size aEditSize = mxEdit->GetSizePixel();
185
186 aEditSize.setWidth( std::max( static_cast<tools::Long>(nWidth - nLeft - 5), tools::Long(0) ) );
187 mxEdit->SetSizePixel( aEditSize );
188}
189
191{
192 m_bIsTable = false;
193 // stop rulers
194 if (m_pView && m_pWrtShell)
195 {
196 m_pView->GetHRuler().SetActive( false );
197 m_pView->GetVRuler().SetActive( false );
198
199 // Cursor in table
201
202 if( m_bFirst )
204 SelTableCellsNotify) );
205 if( m_bIsTable )
206 {
207 const OUString& rPos = m_pWrtShell->GetBoxNms();
208 sal_Int32 nPos = 0;
209 short nSrch = -1;
210 while( (nPos = rPos.indexOf( ':',nPos + 1 ) ) != -1 )
211 nSrch = static_cast<short>(nPos);
212 mxPos->set_text( rPos.copy( ++nSrch ) );
214 }
215 else
216 mxPos->set_text(SwResId(STR_TBL_FORMULA));
217
218 // Edit current field
219 OSL_ENSURE(m_pMgr == nullptr, "FieldManager not deleted");
220 m_pMgr.reset(new SwFieldMgr);
221
222 // Form should always begin with "=" , so set here
223 OUString sEdit('=');
224 if( m_pMgr->GetCurField() && SwFieldTypesEnum::Formel == m_pMgr->GetCurTypeId() )
225 {
226 sEdit += m_pMgr->GetCurFieldPar2();
227 }
228 else if( m_bFirst && m_bIsTable )
229 {
230 m_bResetUndo = true;
233 "sw", "/org.openoffice.Office.Common/Undo/Steps <= 0");
234
236 if( !m_bDoesUndo )
237 {
239 }
240
241 if( !m_pWrtShell->SwCursorShell::HasSelection() )
242 {
246 }
247 if( m_pWrtShell->SwCursorShell::HasSelection() )
248 {
250 m_pWrtShell->Delete(false);
252 {
253 m_bCallUndo = true;
254 }
255 }
256 m_pWrtShell->DoUndo(false);
257
260 sEdit += aSet.Get( RES_BOXATR_FORMULA ).GetFormula();
261 }
262
263 if( m_bFirst )
264 {
265 // Set WrtShell flags correctly
268 }
269
270 m_bFirst = false;
271
272 mxEdit->connect_changed( LINK( this, SwInputWindow, ModifyHdl ));
273
274 mxEdit->set_text( sEdit );
275 m_sOldFormula = sEdit;
276
277 // For input cut the UserInterface
278
281 m_pWrtShell->Push();
282 }
283
285
286 // grab focus after ToolBox is shown so focus isn't potentially lost elsewhere
287 if (m_pView)
288 {
289 int nPos = mxEdit->get_text().getLength();
290 mxEdit->select_region(nPos, nPos);
291 mxEdit->GrabFocus();
292 }
293}
294
295void SwInputWindow::MenuHdl(std::string_view command)
296{
297 if (!command.empty())
298 mxEdit->replace_selection(OUString::fromUtf8(command) + " ");
299}
300
301IMPL_LINK_NOARG(SwInputWindow, DropdownClickHdl, ToolBox *, void)
302{
303 ToolBoxItemId nCurID = GetCurItemId();
304 EndSelection(); // reset back CurItemId !
305 if (nCurID == FN_FORMULA_CALC)
306 {
307 std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(nullptr, "modules/swriter/ui/inputwinmenu.ui"));
308 std::unique_ptr<weld::Menu> xPopMenu(xBuilder->weld_menu("menu"));
309 tools::Rectangle aRect(GetItemRect(FN_FORMULA_CALC));
310 weld::Window* pParent = weld::GetPopupParent(*this, aRect);
311 MenuHdl(xPopMenu->popup_at_rect(pParent, aRect));
312 }
313}
314
316{
317 ToolBoxItemId nCurID = GetCurItemId();
318 EndSelection(); // reset back CurItemId !
319 if ( nCurID == FN_FORMULA_CANCEL )
320 {
322 }
323 else if (nCurID == FN_FORMULA_APPLY)
324 {
325 ApplyFormula();
326 }
327}
328
330{
331 // in case it was created while loading the document, the active view
332 // wasn't initialised at that time, so ShowWin() didn't initialise anything
333 // either - nothing to do
334 if (!m_pView || !m_pWrtShell)
335 {
336 // presumably there must be an active view now since the event arrived
337 if (SwView* pView = GetActiveView())
338 {
339 // this just makes the input window go away, so that the next time it works
340 pView->GetViewFrame().GetDispatcher()->Execute(FN_EDIT_FORMULA, SfxCallMode::ASYNCHRON);
341 }
342 return;
343 }
344
349
350 // Form should always begin with "=", so remove it here again
351 OUString sEdit(comphelper::string::strip(mxEdit->get_text(), ' '));
352 if( !sEdit.isEmpty() && '=' == sEdit[0] )
353 sEdit = sEdit.copy( 1 );
354 SfxStringItem aParam(FN_EDIT_FORMULA, sEdit);
355
358 const SfxPoolItem* aArgs[2];
359 aArgs[0] = &aParam;
360 aArgs[1] = nullptr;
361 m_pView->GetViewFrame().GetBindings().Execute( FN_EDIT_FORMULA, aArgs, SfxCallMode::ASYNCHRON );
362}
363
365{
366 // in case it was created while loading the document, the active view
367 // wasn't initialised at that time, so ShowWin() didn't initialise anything
368 // either - nothing to do
369 if (!m_pView || !m_pWrtShell)
370 {
371 // presumably there must be an active view now since the event arrived
372 if (SwView* pView = GetActiveView())
373 {
374 // this just makes the input window go away, so that the next time it works
375 pView->GetViewFrame().GetDispatcher()->Execute(FN_EDIT_FORMULA, SfxCallMode::ASYNCHRON);
376 }
377 return;
378 }
379
380 m_pView->GetViewFrame().GetDispatcher()->Lock( false );
384
385 if( m_bDelSel )
387
389
391
392 m_pView->GetViewFrame().GetDispatcher()->Execute( FN_EDIT_FORMULA, SfxCallMode::ASYNCHRON);
393}
394
395const sal_Unicode CH_LRE = 0x202a;
396const sal_Unicode CH_PDF = 0x202c;
397
398IMPL_LINK( SwInputWindow, SelTableCellsNotify, SwWrtShell&, rCaller, void )
399{
400 if(m_pWrtShell && m_bIsTable)
401 {
402 SwFrameFormat* pTableFormat = rCaller.GetTableFormat();
403 OUString sBoxNms( rCaller.GetBoxNms() );
404 OUString sTableNm;
405 if( pTableFormat && m_aCurrentTableName != pTableFormat->GetName() )
406 sTableNm = pTableFormat->GetName();
407
408 mxEdit->UpdateRange( sBoxNms, sTableNm );
409
410 OUString sNew = OUStringChar(CH_LRE) + mxEdit->get_text()
411 + OUStringChar(CH_PDF);
412
413 if( sNew != m_sOldFormula )
414 {
415 // The WrtShell is in the table selection,
416 // then cancel the table selection otherwise, the cursor is
417 // positioned "in the forest" and the live update does not work!
418 m_pWrtShell->StartAllAction();
419
420 SwPaM aPam( *m_pWrtShell->GetStackCursor()->GetPoint() );
422 aPam.SetMark();
424
425 IDocumentContentOperations& rIDCO = m_pWrtShell->getIDocumentContentOperations();
426 rIDCO.DeleteRange( aPam );
427 rIDCO.InsertString( aPam, sNew );
428 m_pWrtShell->EndAllAction();
429 m_sOldFormula = sNew;
430 }
431 }
432 else
433 mxEdit->GrabFocus();
434}
435
436void SwInputWindow::SetFormula( const OUString& rFormula )
437{
438 OUString sEdit('=');
439 if( !rFormula.isEmpty() )
440 {
441 if( '=' == rFormula[0] )
442 sEdit = rFormula;
443 else
444 sEdit += rFormula;
445 }
446 mxEdit->set_text( sEdit );
447 mxEdit->select_region(sEdit.getLength(), sEdit.getLength());
448 m_bDelSel = true;
449}
450
452{
453 if (m_pWrtShell && m_bIsTable && m_bResetUndo)
454 {
455 m_pWrtShell->StartAllAction();
456 DelBoxContent();
457 OUString sNew = OUStringChar(CH_LRE) + mxEdit->get_text()
458 + OUStringChar(CH_PDF);
459 m_pWrtShell->SwEditShell::Insert2( sNew );
460 m_pWrtShell->EndAllAction();
461 m_sOldFormula = sNew;
462 }
463}
464
466{
467 if( m_pWrtShell && m_bIsTable )
468 {
472 m_pWrtShell->Push();
476 m_pWrtShell->SwEditShell::Delete(false);
478 }
479}
480
481IMPL_LINK(InputEdit, KeyInputHdl, const KeyEvent&, rEvent, bool)
482{
483 bool bHandled = false;
484 const vcl::KeyCode aCode = rEvent.GetKeyCode();
485 if (aCode == KEY_RETURN || aCode == KEY_F2)
486 {
487 bHandled = ActivateHdl(*m_xWidget);
488 }
489 else if(aCode == KEY_ESCAPE )
490 {
491 static_cast<SwInputWindow*>(GetParent())->CancelFormula();
492 bHandled = true;
493 }
494 return bHandled || ChildKeyInput(rEvent);
495}
496
498{
499 static_cast<SwInputWindow*>(GetParent())->ApplyFormula();
500 return true;
501}
502
503void InputEdit::UpdateRange(std::u16string_view rBoxes,
504 const OUString& rName )
505{
506 if( rBoxes.empty() )
507 {
508 GrabFocus();
509 return;
510 }
511 const sal_Unicode cOpen = '<', cClose = '>',
512 cOpenBracket = '(';
513 OUString aPrefix = rName;
514 if(!rName.isEmpty())
515 aPrefix += ".";
516 OUString aBoxes = aPrefix + rBoxes;
517
518 int nSelStartPos, nSelEndPos;
519 m_xWidget->get_selection_bounds(nSelStartPos, nSelEndPos);
520
521 Selection aSelection(nSelStartPos, nSelEndPos);
522 sal_uInt16 nSel = o3tl::narrowing<sal_uInt16>(aSelection.Len());
523 // OS: The following expression ensures that in the overwrite mode,
524 // the selected closing parenthesis will be not deleted.
525 if( nSel && ( nSel > 1 ||
526 m_xWidget->get_text()[ o3tl::narrowing<sal_uInt16>(aSelection.Min()) ] != cClose ))
527 m_xWidget->cut_clipboard();
528 else
529 aSelection.Max() = aSelection.Min();
530 OUString aActText(m_xWidget->get_text());
531 const sal_uInt16 nLen = aActText.getLength();
532 if( !nLen )
533 {
534 OUString aStr = OUStringChar(cOpen) + aBoxes + OUStringChar(cClose);
535 m_xWidget->set_text(aStr);
536 sal_Int32 nPos = aStr.indexOf( cClose );
537 OSL_ENSURE(nPos != -1, "delimiter not found");
538 ++nPos;
539 m_xWidget->select_region(nPos, nPos);
540 }
541 else
542 {
543 bool bFound = false;
544 sal_Unicode cCh;
545 sal_uInt16 nPos, nEndPos = 0, nStartPos = o3tl::narrowing<sal_uInt16>(aSelection.Min());
546 if( nStartPos-- )
547 {
548 do {
549 if( cOpen == (cCh = aActText[ nStartPos ] ) ||
550 cOpenBracket == cCh )
551 {
552 bFound = cCh == cOpen;
553 break;
554 }
555 } while( nStartPos-- > 0 );
556 }
557 if( bFound )
558 {
559 bFound = false;
560 nEndPos = nStartPos;
561 while( nEndPos < nLen )
562 {
563 if( cClose == aActText[ nEndPos ] )
564 {
565 bFound = true;
566 break;
567 }
568 ++nEndPos;
569 }
570 // Only if the current position lies in the range or right behind.
571 if( bFound && ( nStartPos >= o3tl::make_unsigned(aSelection.Max()) ||
572 o3tl::narrowing<sal_uInt16>(aSelection.Max()) > nEndPos + 1 ))
573 bFound = false;
574 }
575 if( bFound )
576 {
577 nPos = ++nStartPos + 1; // We want behind
578 aActText = aActText.replaceAt( nStartPos, nEndPos - nStartPos, aBoxes );
579 nPos = nPos + aBoxes.getLength();
580 }
581 else
582 {
583 OUString aTmp = OUStringChar(cOpen) + aBoxes + OUStringChar(cClose);
584 nPos = o3tl::narrowing<sal_uInt16>(aSelection.Min());
585 aActText = aActText.replaceAt( nPos, 0, aTmp );
586 nPos = nPos + aTmp.getLength();
587 }
588 if( m_xWidget->get_text() != aActText )
589 {
590 m_xWidget->set_text(aActText);
591 m_xWidget->select_region(nPos, nPos);
592 }
593 }
594 GrabFocus();
595
596}
597
599 sal_uInt16 nId,
600 SfxBindings const * pBindings,
601 SfxChildWinInfo* ) :
602 SfxChildWindow( _pParent, nId )
603{
604 m_pDispatch = pBindings->GetDispatcher();
606 static_cast<SwInputWindow*>(GetWindow())->ShowWin();
607 SetAlignment(SfxChildAlignment::LOWESTTOP);
608}
609
611{
612 if(m_pDispatch)
613 m_pDispatch->Lock(false);
614}
615
617{
619 return aInfo;
620}
621
622/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::unique_ptr< weld::Image > m_xWidget
static std::unique_ptr< weld::Builder > CreateBuilder(weld::Widget *pParent, const OUString &rUIFile, bool bMobile=false, sal_uInt64 nLOKWindowId=0)
Size GetSizePixel() const override
Text operation/manipulation interface.
virtual void DeleteRange(SwPaM &)=0
Delete a range SwFlyFrameFormat.
virtual bool InsertString(const SwPaM &rRg, const OUString &, const SwInsertFlags nInsertMode=SwInsertFlags::EMPTYEXPAND)=0
Insert string into existing text node at position rRg.Point().
std::unique_ptr< weld::Entry > m_xWidget
Definition: inputwin.hxx:39
void UpdateRange(std::u16string_view rSel, const OUString &rTableName)
Definition: inputwin.cxx:503
tools::Long Min() const
tools::Long Len() const
tools::Long Max() const
bool Execute(sal_uInt16 nSlot, const SfxPoolItem **pArgs=nullptr, SfxCallMode nCall=SfxCallMode::SLOT)
SfxDispatcher * GetDispatcher() const
void SetAlignment(SfxChildAlignment eAlign)
vcl::Window * GetWindow() const
virtual SfxChildWinInfo GetInfo() const
void SetWindow(const VclPtr< vcl::Window > &p)
const SfxPoolItem * Execute(sal_uInt16 nSlot, SfxCallMode nCall=SfxCallMode::SLOT, const SfxPoolItem **pArgs=nullptr, sal_uInt16 nModi=0, const SfxPoolItem **pInternalArgs=nullptr)
SfxViewFrame * GetFrame() const
void Lock(bool bLock)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
SfxViewShell * GetViewShell() const
SfxBindings & GetBindings()
SfxDispatcher * GetDispatcher()
SfxViewFrame & GetViewFrame() const
constexpr tools::Long Height() const
void setWidth(tools::Long nWidth)
void setHeight(tools::Long nHeight)
constexpr tools::Long Width() const
void SetActive(bool bOn=true)
void Push()
store a copy of the current cursor on the cursor stack
Definition: crsrsh.cxx:2279
OUString GetBoxNms() const
Definition: trvltbl.cxx:743
const SwTableNode * IsCursorInTable() const
Definition: crsrsh.hxx:914
void ClearMark()
Definition: crsrsh.cxx:953
void SetMark()
Definition: crsrsh.hxx:900
bool MoveSection(SwWhichSection, SwMoveFnCollection const &)
Definition: crsrsh.cxx:734
void StartAllAction()
For all views of this document.
Definition: edws.cxx:86
SwUndoId StartUndo(SwUndoId eUndoId=SwUndoId::EMPTY, const SwRewriter *pRewriter=nullptr)
Undo: set up Undo parenthesis, return nUndoId of this parenthesis.
Definition: edws.cxx:223
bool Delete(bool isArtificialSelection=false)
Delete content of all ranges.
Definition: eddel.cxx:125
SwFrameFormat * GetTableFormat()
Definition: edws.cxx:183
bool GetTableBoxFormulaAttrs(SfxItemSet &rSet) const
Definition: edtab.cxx:300
void Undo(sal_uInt16 const nCount=1, sal_uInt16 nOffset=0)
Definition: edundo.cxx:105
bool DoesUndo() const
Definition: edws.cxx:203
SwUndoId EndUndo(SwUndoId eUndoId=SwUndoId::EMPTY, const SwRewriter *pRewriter=nullptr)
Closes parenthesis of nUndoId, not used by UI.
Definition: edws.cxx:234
void DoUndo(bool bOn=true)
Undo.
Definition: edws.cxx:200
void EndAllAction()
Definition: edws.cxx:97
void LockKeyInput(bool bSet)
Definition: edtwin.hxx:243
const OUString & GetName() const
Definition: format.hxx:131
Style of a layout element.
Definition: frmfmt.hxx:62
SfxDispatcher * m_pDispatch
Definition: inputwin.hxx:194
SwInputChild(vcl::Window *, sal_uInt16 nId, SfxBindings const *, SfxChildWinInfo *)
Definition: inputwin.cxx:598
virtual ~SwInputChild() override
Definition: inputwin.cxx:610
void CleanupUglyHackWithUndo()
Definition: inputwin.cxx:161
bool m_bResetUndo
Definition: inputwin.hxx:162
SwWrtShell * m_pWrtShell
Definition: inputwin.hxx:154
void SetFormula(const OUString &rFormula)
Definition: inputwin.cxx:436
void ShowWin()
Definition: inputwin.cxx:190
OUString m_aCurrentTableName
Definition: inputwin.hxx:156
void MenuHdl(std::string_view command)
Definition: inputwin.cxx:295
bool m_bCallUndo
Definition: inputwin.hxx:163
bool m_bDoesUndo
Definition: inputwin.hxx:161
VclPtr< InputEdit > mxEdit
Definition: inputwin.hxx:152
void CancelFormula()
Definition: inputwin.cxx:364
void ApplyFormula()
Definition: inputwin.cxx:329
SwView * m_pView
Definition: inputwin.hxx:155
SwInputWindow(vcl::Window *pParent, SfxDispatcher const *pDispatcher)
Definition: inputwin.cxx:71
void DelBoxContent()
Definition: inputwin.cxx:465
virtual void Click() override
Definition: inputwin.cxx:315
VclPtr< PosEdit > mxPos
Definition: inputwin.hxx:151
virtual void Resize() override
Definition: inputwin.cxx:178
std::unique_ptr< SwFieldMgr > m_pMgr
Definition: inputwin.hxx:153
OUString m_sOldFormula
Definition: inputwin.hxx:156
virtual void dispose() override
Definition: inputwin.cxx:142
virtual ~SwInputWindow() override
Definition: inputwin.cxx:137
PaM is Point and Mark: a selection of the document model.
Definition: pam.hxx:187
virtual void SetMark()
Unless this is called, the getter method of Mark will return Point.
Definition: pam.cxx:642
bool Move(SwMoveFnCollection const &fnMove=fnMoveForward, SwGoInDoc fnGo=GoInContent)
Movement of cursor.
Definition: pam.cxx:668
const SfxItemPool & GetAttrPool() const
Definition: viewsh.hxx:625
Definition: view.hxx:146
SvxRuler & GetVRuler()
Definition: view.hxx:504
SwWrtShell * GetWrtShellPtr() const
Definition: view.hxx:422
SwEditWin & GetEditWin()
Definition: view.hxx:424
SvxRuler & GetHRuler()
Definition: view.hxx:503
Used by the UI to modify the document model.
Definition: wrtsh.hxx:97
void SelTableCells(const Link< SwWrtShell &, void > &rLink)
Definition: wrtsh.hxx:655
void EndSelect()
Definition: select.cxx:426
void EndSelTableCells()
Definition: wrtsh.hxx:661
void EnterStdMode()
Definition: select.cxx:552
void SttSelect()
Definition: select.cxx:386
bool Pop(SwCursorShell::PopMode, ::std::optional< SwCallLink > &roLink)
Definition: wrtsh1.cxx:2041
void SetDropdownClickHdl(const Link< ToolBox *, void > &rLink)
void EndSelection()
void InsertWindow(ToolBoxItemId nItemId, vcl::Window *pWindow, ToolBoxItemBits nBits=ToolBoxItemBits::NONE, ImplToolItems::size_type nPos=APPEND)
void InsertSeparator(ImplToolItems::size_type nPos=APPEND, sal_uInt16 nPixSize=0)
Size CalcWindowSizePixel()
virtual void dispose() override
void SetHelpId(ToolBoxItemId nItemId, const OString &rHelpId)
virtual void Resize() override
ToolBoxItemId GetCurItemId() const
virtual void InsertItem(const OUString &rCommand, const css::uno::Reference< css::frame::XFrame > &rFrame, ToolBoxItemBits nBits, const Size &rRequestedSize, ImplToolItems::size_type nPos=APPEND)
tools::Rectangle GetItemRect(ToolBoxItemId nItemId)
void SetItemText(ToolBoxItemId nItemId, const OUString &rText)
ToolBoxItemBits GetItemBits(ToolBoxItemId nItemId) const
void SetItemBits(ToolBoxItemId nItemId, ToolBoxItemBits nBits)
void disposeAndClear()
reference_type * get() const
constexpr tools::Long GetHeight() const
virtual void SetSizePixel(const Size &rNewSize)
void GrabFocus()
void Show(bool bVisible=true, ShowFlags nFlags=ShowFlags::NONE)
void SetAccessibleName(const OUString &rName)
#define FN_EDIT_FORMULA
Definition: cmdid.h:84
constexpr OStringLiteral HID_TBX_FORMULA_APPLY
Definition: helpids.h:116
constexpr OStringLiteral HID_EDIT_FORMULA
Definition: helpids.h:45
constexpr OStringLiteral HID_TBX_FORMULA_CANCEL
Definition: helpids.h:115
constexpr OStringLiteral HID_TBX_FORMULA_CALC
Definition: helpids.h:114
constexpr TypedWhichId< SwTableBoxFormula > RES_BOXATR_FORMULA(157)
SFX_IMPL_POS_CHILDWINDOW_WITHID(SfxInfoBarContainerChild, SID_INFOBAR, SFX_OBJECTBAR_OBJECT)
constexpr ToolBoxItemId ED_FORMULA(3)
const sal_Unicode CH_LRE
Definition: inputwin.cxx:395
const sal_Unicode CH_PDF
Definition: inputwin.cxx:396
constexpr ToolBoxItemId FN_FORMULA_CANCEL(FN_FORMAT+157)
IMPL_LINK(PosEdit, KeyInputHdl, const KeyEvent &, rKEvt, bool)
Definition: inputwin.cxx:66
IMPL_LINK_NOARG(SwInputWindow, DropdownClickHdl, ToolBox *, void)
Definition: inputwin.cxx:301
constexpr ToolBoxItemId ED_POS(2)
constexpr ToolBoxItemId FN_FORMULA_CALC(FN_FORMAT+156)
constexpr ToolBoxItemId FN_FORMULA_APPLY(FN_FORMAT+158)
constexpr sal_uInt16 KEY_RETURN
constexpr sal_uInt16 KEY_F2
constexpr sal_uInt16 KEY_ESCAPE
sal_uInt16 nPos
#define SAL_WARN_IF(condition, area, stream)
aStr
OString strip(const OString &rIn, char c)
void Create(SwFormatVertOrient &rItem, SvStream &rStrm, sal_uInt16 nVersionAbusedAsSize)
Definition: legacyitem.cxx:32
constexpr std::enable_if_t< std::is_signed_v< T >, std::make_unsigned_t< T > > make_unsigned(T value)
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
long Long
weld::Window * GetPopupParent(vcl::Window &rOutWin, tools::Rectangle &rRect)
sal_Int16 nId
bool GoInSection(SwPaM &rPam, SwMoveFnCollection const &fnMove)
Definition: pam.cxx:1165
bool GoCurrSection(SwPaM &rPam, SwMoveFnCollection const &fnMove)
Definition: pam.cxx:1265
SwMoveFnCollection const & fnSectionEnd
Definition: paminit.cxx:52
SwMoveFnCollection const & fnMoveBackward
Definition: paminit.cxx:60
SwMoveFnCollection const & fnMoveForward
SwPam::Move()/Find() default argument.
Definition: paminit.cxx:61
SwMoveFnCollection const & fnSectionStart
Definition: paminit.cxx:51
SwView * GetActiveView()
Definition: swmodul1.cxx:115
OUString SwResId(TranslateId aId)
Definition: swmodule.cxx:168
sal_uInt16 sal_Unicode
WinBits const WB_3DLOOK
WinBits const WB_BORDER