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 {
261 SwTableBoxFormula& rFormula
262 = const_cast<SwTableBoxFormula&>(aSet.Get(RES_BOXATR_FORMULA));
263 // rFormula could be ANY of the table's formulas.
264 // GetFormula returns the "current" formula - which is basically undefined,
265 // so do something that encourages the current position's formula to become current.
266 if (m_pWrtShell->GetCursor())
267 {
269 if (pNd)
270 {
271 const SwTable& rTable = static_cast<const SwTableNode*>(pNd)->GetTable();
272 // get cell's external formula (for UI) by waving the magic wand.
273 rFormula.PtrToBoxNm(&rTable);
274 }
275 }
276
277 sEdit += rFormula.GetFormula();
278 }
279 }
280
281 if( m_bFirst )
282 {
283 // Set WrtShell flags correctly
286 }
287
288 m_bFirst = false;
289
290 mxEdit->connect_changed( LINK( this, SwInputWindow, ModifyHdl ));
291
292 mxEdit->set_text( sEdit );
293 m_sOldFormula = sEdit;
294
295 // For input cut the UserInterface
296
299 m_pWrtShell->Push();
300 }
301
303
304 // grab focus after ToolBox is shown so focus isn't potentially lost elsewhere
305 if (m_pView)
306 {
307 int nPos = mxEdit->get_text().getLength();
308 mxEdit->select_region(nPos, nPos);
309 mxEdit->GrabFocus();
310 }
311}
312
313void SwInputWindow::MenuHdl(std::u16string_view command)
314{
315 if (!command.empty())
316 mxEdit->replace_selection(OUString::Concat(command) + " ");
317}
318
319IMPL_LINK_NOARG(SwInputWindow, DropdownClickHdl, ToolBox *, void)
320{
321 ToolBoxItemId nCurID = GetCurItemId();
322 EndSelection(); // reset back CurItemId !
323 if (nCurID == FN_FORMULA_CALC)
324 {
325 std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(nullptr, "modules/swriter/ui/inputwinmenu.ui"));
326 std::unique_ptr<weld::Menu> xPopMenu(xBuilder->weld_menu("menu"));
327 tools::Rectangle aRect(GetItemRect(FN_FORMULA_CALC));
328 weld::Window* pParent = weld::GetPopupParent(*this, aRect);
329 MenuHdl(xPopMenu->popup_at_rect(pParent, aRect));
330 }
331}
332
334{
335 ToolBoxItemId nCurID = GetCurItemId();
336 EndSelection(); // reset back CurItemId !
337 if ( nCurID == FN_FORMULA_CANCEL )
338 {
340 }
341 else if (nCurID == FN_FORMULA_APPLY)
342 {
343 ApplyFormula();
344 }
345}
346
348{
349 // in case it was created while loading the document, the active view
350 // wasn't initialised at that time, so ShowWin() didn't initialise anything
351 // either - nothing to do
352 if (!m_pView || !m_pWrtShell)
353 {
354 // presumably there must be an active view now since the event arrived
355 if (SwView* pView = GetActiveView())
356 {
357 // this just makes the input window go away, so that the next time it works
358 pView->GetViewFrame().GetDispatcher()->Execute(FN_EDIT_FORMULA, SfxCallMode::ASYNCHRON);
359 }
360 return;
361 }
362
367
368 // Form should always begin with "=", so remove it here again
369 OUString sEdit(comphelper::string::strip(mxEdit->get_text(), ' '));
370 if( !sEdit.isEmpty() && '=' == sEdit[0] )
371 sEdit = sEdit.copy( 1 );
372 SfxStringItem aParam(FN_EDIT_FORMULA, sEdit);
373
376 const SfxPoolItem* aArgs[2];
377 aArgs[0] = &aParam;
378 aArgs[1] = nullptr;
379 m_pView->GetViewFrame().GetBindings().Execute( FN_EDIT_FORMULA, aArgs, SfxCallMode::ASYNCHRON );
380}
381
383{
384 // in case it was created while loading the document, the active view
385 // wasn't initialised at that time, so ShowWin() didn't initialise anything
386 // either - nothing to do
387 if (!m_pView || !m_pWrtShell)
388 {
389 // presumably there must be an active view now since the event arrived
390 if (SwView* pView = GetActiveView())
391 {
392 // this just makes the input window go away, so that the next time it works
393 pView->GetViewFrame().GetDispatcher()->Execute(FN_EDIT_FORMULA, SfxCallMode::ASYNCHRON);
394 }
395 return;
396 }
397
398 m_pView->GetViewFrame().GetDispatcher()->Lock( false );
402
403 if( m_bDelSel )
405
407
409
410 m_pView->GetViewFrame().GetDispatcher()->Execute( FN_EDIT_FORMULA, SfxCallMode::ASYNCHRON);
411}
412
413const sal_Unicode CH_LRE = 0x202a;
414const sal_Unicode CH_PDF = 0x202c;
415
416IMPL_LINK( SwInputWindow, SelTableCellsNotify, SwWrtShell&, rCaller, void )
417{
418 if(m_pWrtShell && m_bIsTable)
419 {
420 SwFrameFormat* pTableFormat = rCaller.GetTableFormat();
421 OUString sBoxNms( rCaller.GetBoxNms() );
422 OUString sTableNm;
423 if( pTableFormat && m_aCurrentTableName != pTableFormat->GetName() )
424 sTableNm = pTableFormat->GetName();
425
426 mxEdit->UpdateRange( sBoxNms, sTableNm );
427
428 OUString sNew = OUStringChar(CH_LRE) + mxEdit->get_text()
429 + OUStringChar(CH_PDF);
430
431 if( sNew != m_sOldFormula )
432 {
433 // The WrtShell is in the table selection,
434 // then cancel the table selection otherwise, the cursor is
435 // positioned "in the forest" and the live update does not work!
436 m_pWrtShell->StartAllAction();
437
438 SwPaM aPam( *m_pWrtShell->GetStackCursor()->GetPoint() );
440 aPam.SetMark();
442
443 IDocumentContentOperations& rIDCO = m_pWrtShell->getIDocumentContentOperations();
444 rIDCO.DeleteRange( aPam );
445 rIDCO.InsertString( aPam, sNew );
446 m_pWrtShell->EndAllAction();
447 m_sOldFormula = sNew;
448 }
449 }
450 else
451 mxEdit->GrabFocus();
452}
453
454void SwInputWindow::SetFormula( const OUString& rFormula )
455{
456 OUString sEdit('=');
457 if( !rFormula.isEmpty() )
458 {
459 if( '=' == rFormula[0] )
460 sEdit = rFormula;
461 else
462 sEdit += rFormula;
463 }
464 mxEdit->set_text( sEdit );
465 mxEdit->select_region(sEdit.getLength(), sEdit.getLength());
466 m_bDelSel = true;
467}
468
470{
471 if (m_pWrtShell && m_bIsTable && m_bResetUndo)
472 {
473 m_pWrtShell->StartAllAction();
474 DelBoxContent();
475 OUString sNew = OUStringChar(CH_LRE) + mxEdit->get_text()
476 + OUStringChar(CH_PDF);
477 m_pWrtShell->SwEditShell::Insert2( sNew );
478 m_pWrtShell->EndAllAction();
479 m_sOldFormula = sNew;
480 }
481}
482
484{
485 if( m_pWrtShell && m_bIsTable )
486 {
490 m_pWrtShell->Push();
494 m_pWrtShell->SwEditShell::Delete(false);
496 }
497}
498
499IMPL_LINK(InputEdit, KeyInputHdl, const KeyEvent&, rEvent, bool)
500{
501 bool bHandled = false;
502 const vcl::KeyCode aCode = rEvent.GetKeyCode();
503 if (aCode == KEY_RETURN || aCode == KEY_F2)
504 {
505 bHandled = ActivateHdl(*m_xWidget);
506 }
507 else if(aCode == KEY_ESCAPE )
508 {
509 static_cast<SwInputWindow*>(GetParent())->CancelFormula();
510 bHandled = true;
511 }
512 return bHandled || ChildKeyInput(rEvent);
513}
514
516{
517 static_cast<SwInputWindow*>(GetParent())->ApplyFormula();
518 return true;
519}
520
521void InputEdit::UpdateRange(std::u16string_view rBoxes,
522 const OUString& rName )
523{
524 if( rBoxes.empty() )
525 {
526 GrabFocus();
527 return;
528 }
529 const sal_Unicode cOpen = '<', cClose = '>',
530 cOpenBracket = '(';
531 OUString aPrefix = rName;
532 if(!rName.isEmpty())
533 aPrefix += ".";
534 OUString aBoxes = aPrefix + rBoxes;
535
536 int nSelStartPos, nSelEndPos;
537 m_xWidget->get_selection_bounds(nSelStartPos, nSelEndPos);
538
539 Selection aSelection(nSelStartPos, nSelEndPos);
540 sal_uInt16 nSel = o3tl::narrowing<sal_uInt16>(aSelection.Len());
541 // OS: The following expression ensures that in the overwrite mode,
542 // the selected closing parenthesis will be not deleted.
543 if( nSel && ( nSel > 1 ||
544 m_xWidget->get_text()[ o3tl::narrowing<sal_uInt16>(aSelection.Min()) ] != cClose ))
545 m_xWidget->cut_clipboard();
546 else
547 aSelection.Max() = aSelection.Min();
548 OUString aActText(m_xWidget->get_text());
549 const sal_uInt16 nLen = aActText.getLength();
550 if( !nLen )
551 {
552 OUString aStr = OUStringChar(cOpen) + aBoxes + OUStringChar(cClose);
553 m_xWidget->set_text(aStr);
554 sal_Int32 nPos = aStr.indexOf( cClose );
555 OSL_ENSURE(nPos != -1, "delimiter not found");
556 ++nPos;
557 m_xWidget->select_region(nPos, nPos);
558 }
559 else
560 {
561 bool bFound = false;
562 sal_Unicode cCh;
563 sal_uInt16 nPos, nEndPos = 0, nStartPos = o3tl::narrowing<sal_uInt16>(aSelection.Min());
564 if( nStartPos-- )
565 {
566 do {
567 if( cOpen == (cCh = aActText[ nStartPos ] ) ||
568 cOpenBracket == cCh )
569 {
570 bFound = cCh == cOpen;
571 break;
572 }
573 } while( nStartPos-- > 0 );
574 }
575 if( bFound )
576 {
577 bFound = false;
578 nEndPos = nStartPos;
579 while( nEndPos < nLen )
580 {
581 if( cClose == aActText[ nEndPos ] )
582 {
583 bFound = true;
584 break;
585 }
586 ++nEndPos;
587 }
588 // Only if the current position lies in the range or right behind.
589 if( bFound && ( nStartPos >= o3tl::make_unsigned(aSelection.Max()) ||
590 o3tl::narrowing<sal_uInt16>(aSelection.Max()) > nEndPos + 1 ))
591 bFound = false;
592 }
593 if( bFound )
594 {
595 nPos = ++nStartPos + 1; // We want behind
596 aActText = aActText.replaceAt( nStartPos, nEndPos - nStartPos, aBoxes );
597 nPos = nPos + aBoxes.getLength();
598 }
599 else
600 {
601 OUString aTmp = OUStringChar(cOpen) + aBoxes + OUStringChar(cClose);
602 nPos = o3tl::narrowing<sal_uInt16>(aSelection.Min());
603 aActText = aActText.replaceAt( nPos, 0, aTmp );
604 nPos = nPos + aTmp.getLength();
605 }
606 if( m_xWidget->get_text() != aActText )
607 {
608 m_xWidget->set_text(aActText);
609 m_xWidget->select_region(nPos, nPos);
610 }
611 }
612 GrabFocus();
613
614}
615
617 sal_uInt16 nId,
618 SfxBindings const * pBindings,
619 SfxChildWinInfo* ) :
620 SfxChildWindow( _pParent, nId )
621{
622 m_pDispatch = pBindings->GetDispatcher();
624 static_cast<SwInputWindow*>(GetWindow())->ShowWin();
625 SetAlignment(SfxChildAlignment::LOWESTTOP);
626}
627
629{
630 if(m_pDispatch)
631 m_pDispatch->Lock(false);
632}
633
635{
637 return aInfo;
638}
639
640/* 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:521
void setY(tools::Long nY)
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:2550
OUString GetBoxNms() const
Definition: trvltbl.cxx:743
const SwTableNode * IsCursorInTable() const
Check if Point of current cursor is placed within a table.
Definition: crsrsh.cxx:600
SwCursor * GetCursor(bool bMakeTableCursor=true) const
Return pointer to the current shell cursor.
Definition: crsrsh.cxx:194
void ClearMark()
Definition: crsrsh.cxx:1225
void SetMark()
Definition: crsrsh.hxx:906
bool MoveSection(SwWhichSection, SwMoveFnCollection const &)
Definition: crsrsh.cxx:1006
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:134
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:244
const OUString & GetName() const
Definition: format.hxx:131
Style of a layout element.
Definition: frmfmt.hxx:72
SfxDispatcher * m_pDispatch
Definition: inputwin.hxx:194
SwInputChild(vcl::Window *, sal_uInt16 nId, SfxBindings const *, SfxChildWinInfo *)
Definition: inputwin.cxx:616
virtual ~SwInputChild() override
Definition: inputwin.cxx:628
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:454
void ShowWin()
Definition: inputwin.cxx:190
OUString m_aCurrentTableName
Definition: inputwin.hxx:156
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:382
void ApplyFormula()
Definition: inputwin.cxx:347
SwView * m_pView
Definition: inputwin.hxx:155
SwInputWindow(vcl::Window *pParent, SfxDispatcher const *pDispatcher)
Definition: inputwin.cxx:71
void DelBoxContent()
Definition: inputwin.cxx:483
void MenuHdl(std::u16string_view command)
Definition: inputwin.cxx:313
virtual void Click() override
Definition: inputwin.cxx:333
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
Base class of the Writer document model elements.
Definition: node.hxx:98
SwTableNode * FindTableNode()
Search table node, in which it is.
Definition: node.cxx:380
PaM is Point and Mark: a selection of the document model.
Definition: pam.hxx:188
SwNode & GetPointNode() const
Definition: pam.hxx:275
virtual void SetMark()
Unless this is called, the getter method of Mark will return Point.
Definition: pam.cxx:643
bool Move(SwMoveFnCollection const &fnMove=fnMoveForward, SwGoInDoc fnGo=GoInContent)
Movement of cursor.
Definition: pam.cxx:657
const OUString & GetFormula() const
Definition: cellfml.hxx:137
void PtrToBoxNm(const SwTable *pTable)
create from the internal formula (for CORE) the external formula (for UI)
Definition: cellfml.cxx:580
SwTable is one table in the document model, containing rows (which contain cells).
Definition: swtable.hxx:113
const SfxItemPool & GetAttrPool() const
Definition: viewsh.hxx:648
Definition: view.hxx:146
SvxRuler & GetVRuler()
Definition: view.hxx:506
SwWrtShell * GetWrtShellPtr() const
Definition: view.hxx:424
SwEditWin & GetEditWin()
Definition: view.hxx:426
SvxRuler & GetHRuler()
Definition: view.hxx:505
Used by the UI to modify the document model.
Definition: wrtsh.hxx:97
void SelTableCells(const Link< SwWrtShell &, void > &rLink)
Definition: wrtsh.hxx:657
void EndSelect()
Definition: select.cxx:434
void EndSelTableCells()
Definition: wrtsh.hxx:663
void EnterStdMode()
Definition: select.cxx:560
void SttSelect()
Definition: select.cxx:394
bool Pop(SwCursorShell::PopMode, ::std::optional< SwCallLink > &roLink)
Definition: wrtsh1.cxx:2047
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
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)
void SetHelpId(ToolBoxItemId nItemId, const OUString &rHelpId)
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:85
constexpr OUStringLiteral HID_EDIT_FORMULA
Definition: helpids.h:45
constexpr OUStringLiteral HID_TBX_FORMULA_CANCEL
Definition: helpids.h:116
constexpr OUStringLiteral HID_TBX_FORMULA_CALC
Definition: helpids.h:115
constexpr OUStringLiteral HID_TBX_FORMULA_APPLY
Definition: helpids.h:117
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:413
const sal_Unicode CH_PDF
Definition: inputwin.cxx:414
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:319
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:1188
bool GoCurrSection(SwPaM &rPam, SwMoveFnCollection const &fnMove)
Definition: pam.cxx:1288
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