LibreOffice Module sw (master)  1
textsh.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 <config_features.h>
21 
22 #include <hintids.hxx>
23 #include <comphelper/string.hxx>
24 #include <svl/globalnameitem.hxx>
25 #include <sfx2/bindings.hxx>
26 #include <sfx2/frmdescr.hxx>
27 #include <sfx2/objface.hxx>
28 #include <sfx2/viewfrm.hxx>
29 
31 #include <svl/eitem.hxx>
32 #include <svl/ptitem.hxx>
33 #include <svl/stritem.hxx>
35 #include <svx/hlnkitem.hxx>
36 #include <svl/whiter.hxx>
37 #include <sfx2/request.hxx>
38 #include <editeng/fontitem.hxx>
39 #include <editeng/boxitem.hxx>
40 #include <editeng/sizeitem.hxx>
41 #include <editeng/svxacorr.hxx>
43 #include <sfx2/htmlmode.hxx>
44 #include <svtools/htmlcfg.hxx>
45 #include <com/sun/star/embed/Aspects.hpp>
46 #include <com/sun/star/embed/XEmbeddedObject.hpp>
47 #include <osl/diagnose.h>
48 
49 #include <comphelper/classids.hxx>
50 #include <editeng/acorrcfg.hxx>
51 #include <wdocsh.hxx>
52 #include <fmtinfmt.hxx>
53 #include <fmtclds.hxx>
54 #include <fmtfsize.hxx>
55 #include <swmodule.hxx>
56 #include <wrtsh.hxx>
57 #include <view.hxx>
58 #include <docsh.hxx>
59 #include <doc.hxx>
61 #include <uitool.hxx>
62 #include <cmdid.h>
63 #include <globals.hrc>
64 #include <frmmgr.hxx>
65 #include <textsh.hxx>
66 #include <frmfmt.hxx>
67 #include <tablemgr.hxx>
68 #include <swundo.hxx>
69 #include <breakit.hxx>
70 #include <edtwin.hxx>
71 #include <strings.hrc>
72 #include <unochart.hxx>
73 #include <chartins.hxx>
74 #include <viewopt.hxx>
75 
76 #define ShellClass_SwTextShell
77 #include <sfx2/msg.hxx>
78 #include <vcl/EnumContext.hxx>
79 #include <swslots.hxx>
80 #include <SwRewriter.hxx>
81 #include <SwCapObjType.hxx>
82 
83 using namespace ::com::sun::star;
84 
85 #include <svx/svxdlg.hxx>
86 #include <swabstdlg.hxx>
88 #include <drawdoc.hxx>
89 #include <svtools/embedhlp.hxx>
90 #include <sfx2/event.hxx>
91 #include <com/sun/star/ui/dialogs/DialogClosedEvent.hpp>
92 #include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp>
93 #include <IDocumentUndoRedo.hxx>
94 #include <formatcontentcontrol.hxx>
95 
97 
98 IMPL_STATIC_LINK( SwTextShell, DialogClosedHdl, css::ui::dialogs::DialogClosedEvent*, pEvent, void )
99 {
100  SwView* pView = ::GetActiveView();
101  SwWrtShell& rWrtShell = pView->GetWrtShell();
102 
103  sal_Int16 nDialogRet = pEvent->DialogResult;
104  if( nDialogRet == ui::dialogs::ExecutableDialogResults::CANCEL )
105  {
106  rWrtShell.Undo();
107  rWrtShell.GetIDocumentUndoRedo().ClearRedo();
108  }
109  else
110  {
111  OSL_ENSURE( nDialogRet == ui::dialogs::ExecutableDialogResults::OK,
112  "dialog execution failed" );
113  }
114 }
115 
117 {
119 
120  GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_OBJECT, SfxVisibilityFlags::Invisible, ToolbarId::Text_Toolbox_Sw);
121 
126  GetStaticInterface()->RegisterChildWindow(SID_RUBY_DIALOG);
128 }
129 
130 
132 {
133  SwWrtShell &rSh = GetShell();
134 
135  OSL_ENSURE( !rSh.IsObjSelected() && !rSh.IsFrameSelected(),
136  "wrong shell on dispatcher" );
137 
138  const SfxItemSet *pArgs = rReq.GetArgs();
139  const SfxPoolItem* pItem = nullptr;
140  const sal_uInt16 nSlot = rReq.GetSlot();
141  if(pArgs)
142  pArgs->GetItemState(nSlot, false, &pItem );
143 
144  switch( nSlot )
145  {
146  case FN_INSERT_STRING:
147  if( pItem )
148  rSh.InsertByWord(static_cast<const SfxStringItem *>(pItem)->GetValue());
149  break;
150 
151  case FN_INSERT_SOFT_HYPHEN:
152  if( CHAR_SOFTHYPHEN != rSh.SwCursorShell::GetChar() &&
153  CHAR_SOFTHYPHEN != rSh.SwCursorShell::GetChar( true, -1 ))
154  rSh.Insert( OUString( CHAR_SOFTHYPHEN ) );
155  break;
156 
157  case FN_INSERT_HARDHYPHEN:
158  case FN_INSERT_HARD_SPACE:
159  {
160  const sal_Unicode cIns = FN_INSERT_HARD_SPACE == nSlot ? CHAR_HARDBLANK : CHAR_HARDHYPHEN;
161 
163  SvxAutoCorrect* pACorr = rACfg.GetAutoCorrect();
164  if( pACorr && rACfg.IsAutoFormatByInput()
165  && pACorr->IsAutoCorrFlag(
166  ACFlags::CapitalStartSentence | ACFlags::CapitalStartWord |
167  ACFlags::AddNonBrkSpace | ACFlags::ChgOrdinalNumber | ACFlags::TransliterateRTL |
168  ACFlags::ChgToEnEmDash | ACFlags::SetINetAttr | ACFlags::Autocorrect ) )
169  {
170  rSh.AutoCorrect( *pACorr, cIns );
171  }
172  else
173  {
174  rSh.Insert( OUString( cIns ) );
175  }
176  }
177  break;
178 
179  case FN_INSERT_NNBSP: // shift+mod2/alt+space inserts some other character w/o going through SwEditWin::KeyInput(), at least on macOS
180  case SID_INSERT_RLM :
181  case SID_INSERT_LRM :
182  case SID_INSERT_WJ :
183  case SID_INSERT_ZWSP:
184  {
185  sal_Unicode cIns = 0;
186  switch(nSlot)
187  {
188  case SID_INSERT_RLM : cIns = CHAR_RLM ; break;
189  case SID_INSERT_LRM : cIns = CHAR_LRM ; break;
190  case SID_INSERT_ZWSP : cIns = CHAR_ZWSP ; break;
191  case SID_INSERT_WJ: cIns = CHAR_WJ; break;
192  case FN_INSERT_NNBSP: cIns = CHAR_NNBSP; break;
193  }
194  rSh.Insert( OUString( cIns ) );
195  }
196  break;
197 
198  case FN_INSERT_BREAK:
199  {
201  {
202  rSh.SplitNode();
203  }
204  else
205  {
206  rSh.InsertLineBreak();
207  }
208  }
209  rReq.Done();
210  break;
211 
212  case FN_INSERT_PAGEBREAK:
213  rSh.InsertPageBreak();
214  rReq.Done();
215  break;
216 
217  case FN_INSERT_LINEBREAK:
218  rSh.InsertLineBreak();
219  rReq.Done();
220  break;
221 
224  rReq.Done();
225  break;
226 
229  rReq.Done();
230  break;
231 
234  rReq.Done();
235  break;
236 
239  rReq.Done();
240  break;
241 
243  {
244  SwWrtShell& rWrtSh = GetShell();
248  aContext.maEndDialogFn = [](sal_Int32){};
249  pDlg->StartExecuteAsync(aContext);
250  rReq.Done();
251  break;
252  }
253 
255  rSh.InsertColumnBreak();
256  rReq.Done();
257  break;
258 
259  case SID_HYPERLINK_SETLINK:
260  if (pItem)
261  InsertHyperlink(*static_cast<const SvxHyperlinkItem *>(pItem));
262  rReq.Done();
263  break;
264 
265 #if HAVE_FEATURE_AVMEDIA
266  case SID_INSERT_AVMEDIA:
267  rReq.SetReturnValue(SfxBoolItem(nSlot, InsertMediaDlg( rReq )));
268  break;
269 #endif
270 
271  case SID_INSERT_OBJECT:
272  {
273  const SfxGlobalNameItem* pNameItem = rReq.GetArg<SfxGlobalNameItem>(SID_INSERT_OBJECT);
274  SvGlobalName *pName = nullptr;
276  if ( pNameItem )
277  {
278  aName = pNameItem->GetValue();
279  pName = &aName;
280  }
281 
283  rSh.InsertObject( xObj, pName, nSlot);
284  rReq.Done();
285  break;
286  }
287  case SID_INSERT_FLOATINGFRAME:
288  {
290  const SfxStringItem* pNameItem = rReq.GetArg<SfxStringItem>(FN_PARAM_1);
291  const SfxStringItem* pURLItem = rReq.GetArg<SfxStringItem>(FN_PARAM_2);
292  const SvxSizeItem* pMarginItem = rReq.GetArg<SvxSizeItem>(FN_PARAM_3);
293  const SfxByteItem* pScrollingItem = rReq.GetArg<SfxByteItem>(FN_PARAM_4);
294  const SfxBoolItem* pBorderItem = rReq.GetArg<SfxBoolItem>(FN_PARAM_5);
295 
296  if(pURLItem) // URL is a _must_
297  {
299  OUString aName;
300  xObj.Assign( aCnt.CreateEmbeddedObject( SvGlobalName( SO3_IFRAME_CLASSID ).GetByteSequence(), aName ),
301  embed::Aspects::MSOLE_CONTENT );
303  uno::Reference < beans::XPropertySet > xSet( xObj->getComponent(), uno::UNO_QUERY );
304  if ( xSet.is() )
305  {
306  try
307  {
308  ScrollingMode eScroll = ScrollingMode::Auto;
309  if( pScrollingItem && pScrollingItem->GetValue() <= int(ScrollingMode::Auto) )
310  eScroll = static_cast<ScrollingMode>(pScrollingItem->GetValue());
311 
312  Size aMargin;
313  if ( pMarginItem )
314  aMargin = pMarginItem->GetSize();
315 
316  xSet->setPropertyValue("FrameURL", uno::Any( pURLItem->GetValue() ) );
317  if ( pNameItem )
318  xSet->setPropertyValue("FrameName", uno::Any( pNameItem->GetValue() ) );
319 
320  if ( eScroll == ScrollingMode::Auto )
321  xSet->setPropertyValue("FrameIsAutoScroll",
322  uno::Any( true ) );
323  else
324  xSet->setPropertyValue("FrameIsScrollingMode",
325  uno::Any( eScroll == ScrollingMode::Yes ) );
326 
327  if ( pBorderItem )
328  xSet->setPropertyValue("FrameIsBorder",
329  uno::Any( pBorderItem->GetValue() ) );
330 
331  if ( pMarginItem )
332  {
333  xSet->setPropertyValue("FrameMarginWidth",
334  uno::Any( sal_Int32( aMargin.Width() ) ) );
335 
336  xSet->setPropertyValue("FrameMarginHeight",
337  uno::Any( sal_Int32( aMargin.Height() ) ) );
338  }
339  }
340  catch (const uno::Exception&)
341  {
342  }
343  }
344 
345  rSh.InsertOleObject( xObj );
346  }
347  else
348  {
349  rSh.InsertObject( xObj, nullptr, nSlot);
350  rReq.Done();
351  }
352  }
353  break;
354  case SID_INSERT_DIAGRAM:
355  {
356  SvtModuleOptions aMOpt;
357  if ( !aMOpt.IsChart() )
358  break;
359  if(!rReq.IsAPI())
360  {
361  SwInsertChart( LINK( this, SwTextShell, DialogClosedHdl ) );
362  }
363  else
364  {
365  uno::Reference< chart2::data::XDataProvider > xDataProvider;
366  bool bFillWithData = true;
367  OUString aRangeString;
368  if (!GetShell().IsTableComplexForChart())
369  {
370  SwFrameFormat* pTableFormat = GetShell().GetTableFormat();
371  aRangeString = pTableFormat->GetName() + "."
372  + GetShell().GetBoxNms();
373 
374  // get table data provider
375  xDataProvider.set( GetView().GetDocShell()->getIDocumentChartDataProviderAccess().GetChartDataProvider() );
376  }
377  else
378  bFillWithData = false; // will create chart with only it's default image
379 
380  SwTableFUNC( &rSh ).InsertChart( xDataProvider, bFillWithData, aRangeString );
381  rSh.LaunchOLEObj();
382 
383  svt::EmbeddedObjectRef& xObj = rSh.GetOLEObject();
384  if(pItem && xObj.is())
385  {
386  Size aSize(static_cast<const SvxSizeItem*>(pItem)->GetSize());
388 
389  if(aSize.Width() > MINLAY&& aSize.Height()> MINLAY)
390  {
391  awt::Size aSz;
392  aSz.Width = aSize.Width();
393  aSz.Height = aSize.Height();
394  xObj->setVisualAreaSize( xObj.GetViewAspect(), aSz );
395  }
396  }
397  }
398  }
399  break;
400 
401  case FN_INSERT_SMA:
402  {
403  // #i34343# Inserting a math object into an autocompletion crashes
404  // the suggestion has to be removed before
406  SvGlobalName aGlobalName( SO3_SM_CLASSID );
407  rSh.InsertObject( svt::EmbeddedObjectRef(), &aGlobalName );
408  }
409  break;
410 
411  case FN_INSERT_TABLE:
412  InsertTable( rReq );
413  break;
414 
417  {
418  sal_uInt16 nCols = 1;
419  bool bModifier1 = rReq.GetModifier() == KEY_MOD1;
420  if(pArgs)
421  {
422  const SfxUInt16Item* pColsItem = nullptr;
423  if(FN_INSERT_FRAME_INTERACT_NOCOL != nSlot &&
424  (pColsItem = pArgs->GetItemIfSet(SID_ATTR_COLUMNS, false)))
425  nCols = pColsItem->GetValue();
426  if(const SfxUInt16Item* pModifierItem = pArgs->GetItemIfSet(SID_MODIFIER, false))
427  bModifier1 |= KEY_MOD1 == pModifierItem->GetValue();
428  }
429  if(bModifier1 )
430  {
431  SwEditWin& rEdtWin = GetView().GetEditWin();
432  Size aWinSize = rEdtWin.GetSizePixel();
433  Point aStartPos(aWinSize.Width()/2, aWinSize.Height() / 2);
434  aStartPos = rEdtWin.PixelToLogic(aStartPos);
435  constexpr tools::Long constTwips_2cm = o3tl::toTwips(2, o3tl::Length::cm);
436  constexpr tools::Long constTwips_4cm = o3tl::toTwips(4, o3tl::Length::cm);
437  aStartPos.AdjustX(-constTwips_4cm);
438  aStartPos.AdjustY(-constTwips_2cm);
439  Size aSize(2 * constTwips_4cm, 2 * constTwips_2cm);
440  GetShell().LockPaint();
442  SwFlyFrameAttrMgr aMgr( true, GetShellPtr(), Frmmgr_Type::TEXT, nullptr );
443  if(nCols > 1)
444  {
445  SwFormatCol aCol;
446  aCol.Init( nCols, aCol.GetGutterWidth(), aCol.GetWishWidth() );
447  aMgr.SetCol( aCol );
448  }
449  aMgr.InsertFlyFrame(RndStdIds::FLY_AT_PARA, aStartPos, aSize);
451  GetShell().UnlockPaint();
452  }
453  else
454  {
455  GetView().InsFrameMode(nCols);
456  }
457  rReq.Ignore();
458  }
459  break;
460  case FN_INSERT_FRAME:
461  {
462  bool bSingleCol = false;
463  if( nullptr!= dynamic_cast< SwWebDocShell*>( GetView().GetDocShell()) )
464  {
466  {
467  bSingleCol = true;
468  }
469 
470  }
471  // Create new border
472  SwFlyFrameAttrMgr aMgr( true, GetShellPtr(), Frmmgr_Type::TEXT, nullptr );
473  if(pArgs)
474  {
475  Size aSize(aMgr.GetSize());
476  aSize.setWidth( GetShell().GetAnyCurRect(CurRectType::PagePrt).Width() );
477  Point aPos = aMgr.GetPos();
478  RndStdIds eAnchor = RndStdIds::FLY_AT_PARA;
479  if(pArgs->GetItemState(nSlot, false, &pItem) == SfxItemState::SET)
480  eAnchor = static_cast<RndStdIds>(static_cast<const SfxUInt16Item *>(pItem)->GetValue());
481  if(pArgs->GetItemState(FN_PARAM_1, false, &pItem) == SfxItemState::SET)
482  aPos = static_cast<const SfxPointItem *>(pItem)->GetValue();
483  if(pArgs->GetItemState(FN_PARAM_2, false, &pItem) == SfxItemState::SET)
484  aSize = static_cast<const SvxSizeItem *>(pItem)->GetSize();
485  if(const SfxUInt16Item* pColsItem = pArgs->GetItemIfSet(SID_ATTR_COLUMNS, false))
486  {
487  const sal_uInt16 nCols = pColsItem->GetValue();
488  if( !bSingleCol && 1 < nCols )
489  {
490  SwFormatCol aFormatCol;
491  aFormatCol.Init( nCols , (rReq.IsAPI() ? 0
492  : DEF_GUTTER_WIDTH), USHRT_MAX );
493  aMgr.SetCol(aFormatCol);
494  }
495  }
496 
497  GetShell().LockPaint();
499 
500  aMgr.InsertFlyFrame(eAnchor, aPos, aSize);
501 
503  GetShell().UnlockPaint();
504  }
505  else
506  {
508 
509  FieldUnit eMetric = ::GetDfltMetric(dynamic_cast<SwWebDocShell*>( GetView().GetDocShell()) != nullptr );
510  SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast< sal_uInt16 >(eMetric)));
513  GetView().GetViewFrame(),
514  GetView().GetFrameWeld(),
515  aSet));
516  if(pDlg->Execute() == RET_OK && pDlg->GetOutputItemSet())
517  {
518  //local variable necessary at least after call of .AutoCaption() because this could be deleted at this point
519  SwWrtShell& rShell = GetShell();
520  rShell.LockPaint();
521  rShell.StartAllAction();
522  rShell.StartUndo(SwUndoId::INSERT);
523 
524  const SfxItemSet* pOutSet = pDlg->GetOutputItemSet();
525  aMgr.SetAttrSet(*pOutSet);
526 
527  // At first delete the selection at the ClickToEditField.
528  if( rShell.IsInClickToEdit() )
529  rShell.DelRight();
530 
531  aMgr.InsertFlyFrame();
532 
533  uno::Reference< frame::XDispatchRecorder > xRecorder =
535  if ( xRecorder.is() )
536  {
537  //FN_INSERT_FRAME
538  sal_uInt16 nAnchor = static_cast<sal_uInt16>(aMgr.GetAnchor());
539  rReq.AppendItem(SfxUInt16Item(nSlot, nAnchor));
540  rReq.AppendItem(SfxPointItem(FN_PARAM_1, rShell.GetObjAbsPos()));
541  rReq.AppendItem(SvxSizeItem(FN_PARAM_2, rShell.GetObjSize()));
542  rReq.Done();
543  }
544 
546 
547  {
548  SwRewriter aRewriter;
549 
550  aRewriter.AddRule(UndoArg1, SwResId(STR_FRAME));
551 
552  rShell.EndUndo(SwUndoId::INSERT, &aRewriter);
553  }
554  rShell.EndAllAction();
555  rShell.UnlockPaint();
556  }
557  }
558  break;
559  }
560  case FN_FORMAT_COLUMN :
561  {
564  pColDlg->StartExecuteAsync([=](sal_Int32 /*nResult*/){
565  pColDlg->disposeOnce();
566  });
567  }
568  break;
569 
570  default:
571  OSL_ENSURE(false, "wrong dispatcher");
572  return;
573  }
574 }
575 
576 static bool lcl_IsMarkInSameSection( SwWrtShell& rWrtSh, const SwSection* pSect )
577 {
578  rWrtSh.SwapPam();
579  bool bRet = pSect == rWrtSh.GetCurrSection();
580  rWrtSh.SwapPam();
581  return bRet;
582 }
583 
585 {
586  const bool bHtmlModeOn = ::GetHtmlMode(GetView().GetDocShell()) & HTMLMODE_ON;
587  SfxWhichIter aIter( rSet );
588  SwWrtShell &rSh = GetShell();
589  sal_uInt16 nWhich = aIter.FirstWhich();
590  SvtModuleOptions aMOpt;
591  SfxObjectCreateMode eCreateMode =
593 
594  bool bCursorInHidden = false;
595  if( !rSh.HasMark() )
596  {
597  rSh.Push();
598  bCursorInHidden = rSh.SelectHiddenRange();
599  rSh.Pop();
600  }
601 
602  while ( nWhich )
603  {
604  switch ( nWhich )
605  {
606  case SID_INSERT_AVMEDIA:
607  if ( GetShell().IsSelFrameMode()
608  || GetShell().CursorInsideInputField()
609  || SfxObjectCreateMode::EMBEDDED == eCreateMode
610  || bCursorInHidden )
611  {
612  rSet.DisableItem( nWhich );
613  }
614  break;
615 
616  case SID_INSERT_DIAGRAM:
617  if( !aMOpt.IsChart()
619  || eCreateMode == SfxObjectCreateMode::EMBEDDED
620  || bCursorInHidden )
621  {
622  rSet.DisableItem( nWhich );
623  }
624  break;
625 
626  case FN_INSERT_SMA:
627  if( !aMOpt.IsMath()
628  || eCreateMode == SfxObjectCreateMode::EMBEDDED
629  || bCursorInHidden
630  || rSh.CursorInsideInputField() )
631  {
632  rSet.DisableItem( nWhich );
633  }
634  break;
635 
636  case SID_INSERT_FLOATINGFRAME:
637  case SID_INSERT_OBJECT:
638  {
639  if( eCreateMode == SfxObjectCreateMode::EMBEDDED || bCursorInHidden )
640  {
641  rSet.DisableItem( nWhich );
642  }
643  else if( GetShell().IsSelFrameMode()
644  || GetShell().CursorInsideInputField() )
645  {
646  rSet.DisableItem( nWhich );
647  }
648  else if(SID_INSERT_FLOATINGFRAME == nWhich && bHtmlModeOn)
649  {
650  const sal_uInt16 nExport = SvxHtmlOptions::GetExportMode();
651  if(HTML_CFG_MSIE != nExport && HTML_CFG_WRITER != nExport )
652  rSet.DisableItem(nWhich);
653  }
654  }
655  break;
656 
659  {
660  if( GetShell().IsSelFrameMode()
661  || rSh.IsTableMode()
663  || bCursorInHidden )
664  rSet.DisableItem(nWhich);
665  }
666  break;
667 
668  case SID_HYPERLINK_GETLINK:
669  {
671  rSh.GetCurAttr( aSet );
672 
673  SvxHyperlinkItem aHLinkItem;
674  if(const SwFormatINetFormat* pINetFormat = aSet.GetItemIfSet(RES_TXTATR_INETFMT, false))
675  {
676  aHLinkItem.SetURL(pINetFormat->GetValue());
677  aHLinkItem.SetTargetFrame(pINetFormat->GetTargetFrame());
678  aHLinkItem.SetIntName(pINetFormat->GetName());
679  const SvxMacro *pMacro = pINetFormat->GetMacro( SvMacroItemId::OnMouseOver );
680  if( pMacro )
681  aHLinkItem.SetMacro(HyperDialogEvent::MouseOverObject, *pMacro);
682 
683  pMacro = pINetFormat->GetMacro( SvMacroItemId::OnClick );
684  if( pMacro )
685  aHLinkItem.SetMacro(HyperDialogEvent::MouseClickObject, *pMacro);
686 
687  pMacro = pINetFormat->GetMacro( SvMacroItemId::OnMouseOut );
688  if( pMacro )
689  aHLinkItem.SetMacro(HyperDialogEvent::MouseOutObject, *pMacro);
690 
691  // Get the text of the Link.
692  rSh.StartAction();
693  const bool bAtEnd(rSh.IsCursorPtAtEnd());
694  if(!bAtEnd) // tdf#91832: ensure forward selection
695  rSh.SwapPam();
696  rSh.CreateCursor();
697  if(!bAtEnd)
698  rSh.SwapPam();
699  rSh.SwCursorShell::SelectTextAttr(RES_TXTATR_INETFMT,true);
700  OUString sLinkName = rSh.GetSelText();
701  aHLinkItem.SetName(sLinkName);
702  aHLinkItem.SetInsertMode(HLINK_FIELD);
703  rSh.DestroyCursor();
704  rSh.EndAction();
705  }
706  else
707  {
708  OUString sReturn = rSh.GetSelText();
709  sReturn = sReturn.copy(0, std::min<sal_Int32>(255, sReturn.getLength()));
710  aHLinkItem.SetName(comphelper::string::stripEnd(sReturn, ' '));
711  }
712 
713  aHLinkItem.SetInsertMode(static_cast<SvxLinkInsertMode>(aHLinkItem.GetInsertMode() |
714  (bHtmlModeOn ? HLINK_HTMLMODE : 0)));
715  aHLinkItem.SetMacroEvents ( HyperDialogEvent::MouseOverObject|
716  HyperDialogEvent::MouseClickObject | HyperDialogEvent::MouseOutObject );
717 
718  rSet.Put(aHLinkItem);
719  }
720  break;
721 
722  case FN_INSERT_FRAME:
723  if (rSh.IsSelFrameMode() )
724  {
725  const SelectionType nSel = rSh.GetSelectionType();
726  if( ((SelectionType::Graphic | SelectionType::Ole ) & nSel ) || bCursorInHidden )
727  rSet.DisableItem(nWhich);
728  }
729  else if ( rSh.CursorInsideInputField() )
730  {
731  rSet.DisableItem(nWhich);
732  }
733  break;
734 
735  case FN_FORMAT_COLUMN :
736  {
737  //#i80458# column dialog cannot work if the selection contains different page styles and different sections
738  bool bDisable = true;
739  if( rSh.GetFlyFrameFormat() || rSh.GetSelectedPageDescs() )
740  bDisable = false;
741  if( bDisable )
742  {
743  const SwSection* pCurrSection = rSh.GetCurrSection();
744  const sal_uInt16 nFullSectCnt = rSh.GetFullSelectedSectionCount();
745  if( pCurrSection && ( !rSh.HasSelection() || 0 != nFullSectCnt ))
746  bDisable = false;
747  else if(
748  rSh.HasSelection() && rSh.IsInsRegionAvailable() &&
749  ( !pCurrSection || ( 1 != nFullSectCnt &&
750  lcl_IsMarkInSameSection( rSh, pCurrSection ) )))
751  bDisable = false;
752  }
753  if(bDisable)
754  rSet.DisableItem(nWhich);
755  }
756  break;
757  }
758  nWhich = aIter.NextWhich();
759  }
760 }
761 
763 {
764  SwWrtShell &rSh = GetShell();
765  switch( rReq.GetSlot() )
766  {
767  case FN_DELETE_SENT:
768  if( rSh.IsTableMode() )
769  {
770  rSh.DeleteRow();
771  rSh.EnterStdMode();
772  }
773  else
774  rSh.DelToEndOfSentence();
775  break;
776  case FN_DELETE_BACK_SENT:
777  rSh.DelToStartOfSentence();
778  break;
779  case FN_DELETE_WORD:
780  rSh.DelNxtWord();
781  break;
782  case FN_DELETE_BACK_WORD:
783  rSh.DelPrvWord();
784  break;
785  case FN_DELETE_LINE:
786  rSh.DelToEndOfLine();
787  break;
788  case FN_DELETE_BACK_LINE:
789  rSh.DelToStartOfLine();
790  break;
791  case FN_DELETE_PARA:
792  rSh.DelToEndOfPara();
793  break;
794  case FN_DELETE_BACK_PARA:
795  rSh.DelToStartOfPara();
796  break;
798  rSh.DelLine();
799  break;
800  default:
801  OSL_ENSURE(false, "wrong dispatcher");
802  return;
803  }
804  rReq.Done();
805 }
806 
808 {
809  using namespace ::com::sun::star::i18n;
810  TransliterationFlags nMode = TransliterationFlags::NONE;
811 
812  switch( rReq.GetSlot() )
813  {
814  case SID_TRANSLITERATE_SENTENCE_CASE:
815  nMode = TransliterationFlags::SENTENCE_CASE;
816  break;
817  case SID_TRANSLITERATE_TITLE_CASE:
818  nMode = TransliterationFlags::TITLE_CASE;
819  break;
820  case SID_TRANSLITERATE_TOGGLE_CASE:
821  nMode = TransliterationFlags::TOGGLE_CASE;
822  break;
823  case SID_TRANSLITERATE_UPPER:
824  nMode = TransliterationFlags::LOWERCASE_UPPERCASE;
825  break;
826  case SID_TRANSLITERATE_LOWER:
827  nMode = TransliterationFlags::UPPERCASE_LOWERCASE;
828  break;
829 
830  case SID_TRANSLITERATE_HALFWIDTH:
831  nMode = TransliterationFlags::FULLWIDTH_HALFWIDTH;
832  break;
833  case SID_TRANSLITERATE_FULLWIDTH:
834  nMode = TransliterationFlags::HALFWIDTH_FULLWIDTH;
835  break;
836 
837  case SID_TRANSLITERATE_HIRAGANA:
838  nMode = TransliterationFlags::KATAKANA_HIRAGANA;
839  break;
840  case SID_TRANSLITERATE_KATAKANA:
841  nMode = TransliterationFlags::HIRAGANA_KATAKANA;
842  break;
843 
844  default:
845  OSL_ENSURE(false, "wrong dispatcher");
846  }
847 
848  if( nMode != TransliterationFlags::NONE )
849  GetShell().TransliterateText( nMode );
850 }
851 
853 {
854  if( rReq.GetSlot() == SID_TRANSLITERATE_ROTATE_CASE )
856 }
857 
859  SwBaseShell(_rView)
860 {
861  SetName("Text");
863 }
864 
866 {
867 }
868 
870 {
871  SfxItemSet aSet(GetPool(), svl::Items<
873  XATTR_FILL_FIRST, XATTR_FILL_LAST, // tdf#95003
874  SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER,
875  SID_ATTR_PAGE_SIZE, SID_ATTR_PAGE_SIZE,
876  SID_COLOR_TABLE, SID_PATTERN_LIST,
877  SID_HTML_MODE, SID_HTML_MODE,
880  aSet.Put(SfxUInt16Item(SID_HTML_MODE, ::GetHtmlMode(GetView().GetDocShell())));
881 
882  // For the Area tab page.
884 
886  SwFormatFrameSize aFrameSize(SwFrameSize::Variable, rPg.Width(), rPg.Height());
887  aFrameSize.SetWhich(GetPool().GetWhich(SID_ATTR_PAGE_SIZE));
888  aSet.Put(aFrameSize);
889 
891  SwFormatFrameSize aPrtSize(SwFrameSize::Variable, rPr.Width(), rPr.Height());
892  aPrtSize.SetWhich(GetPool().GetWhich(FN_GET_PRINT_AREA));
893  aSet.Put(aPrtSize);
894 
895  aSet.Put(rMgr.GetAttrSet());
896  aSet.SetParent( rMgr.GetAttrSet().GetParent() );
897 
898  // Delete minimum size in columns.
899  SvxBoxInfoItem aBoxInfo(aSet.Get(SID_ATTR_BORDER_INNER));
900  const SvxBoxItem& rBox = aSet.Get(RES_BOX);
901  aBoxInfo.SetMinDist(false);
902  aBoxInfo.SetDefDist(rBox.GetDistance(SvxBoxItemLine::LEFT));
903  aSet.Put(aBoxInfo);
904 
905  return aSet;
906 }
907 
909 {
910  const SfxItemSet *pArgs = rReq.GetArgs();
911  const SfxStringItem* pItem = nullptr;
912  if( pArgs )
913  pItem = pArgs->GetItemIfSet(SID_CHARMAP, false);
914 
915  OUString aChars, aFontName;
916  if ( pItem )
917  {
918  aChars = pItem->GetValue();
919  const SfxStringItem* pFontItem = pArgs->GetItemIfSet( SID_ATTR_SPECIALCHAR, false );
920  if ( pFontItem )
921  aFontName = pFontItem->GetValue();
922  }
923 
924  SwWrtShell &rSh = GetShell();
927  RES_CHRATR_CTL_FONT, RES_CHRATR_CTL_FONT> aSet( GetPool() );
928  rSh.GetCurAttr( aSet );
929  SvtScriptType nScript = rSh.GetScriptType();
930 
931  std::shared_ptr<SvxFontItem> aFont(std::make_shared<SvxFontItem>(RES_CHRATR_FONT));
932  {
933  SvxScriptSetItem aSetItem( SID_ATTR_CHAR_FONT, *aSet.GetPool() );
934  aSetItem.GetItemSet().Put( aSet, false );
935  const SfxPoolItem* pI = aSetItem.GetItemOfScript( nScript );
936  if( pI )
937  {
938  aFont.reset(static_cast<SvxFontItem*>(pI->Clone()));
939  }
940  else
941  {
942  TypedWhichId<SvxFontItem> nFontWhich =
944  RES_CHRATR_FONT,
946  aFont.reset(aSet.Get(nFontWhich).Clone());
947  }
948 
949  if (aFontName.isEmpty())
950  aFontName = aFont->GetFamilyName();
951  }
952 
953  vcl::Font aNewFont(aFontName, Size(1,1)); // Size only because CTOR.
954  if( aChars.isEmpty() )
955  {
956  // Set selected font as default.
957  SfxAllItemSet aAllSet( rSh.GetAttrPool() );
958  aAllSet.Put( SfxBoolItem( FN_PARAM_1, false ) );
959 
960  SwViewOption aOpt(*GetShell().GetViewOptions());
961  const OUString& sSymbolFont = aOpt.GetSymbolFont();
962  if( aFontName.isEmpty() && !sSymbolFont.isEmpty() )
963  aAllSet.Put( SfxStringItem( SID_FONT_NAME, sSymbolFont ) );
964  else
965  aAllSet.Put( SfxStringItem( SID_FONT_NAME, aFont->GetFamilyName() ) );
966 
970  pDlg->Execute();
971  return;
972  }
973 
974  if( aChars.isEmpty() )
975  return;
976 
977  rSh.StartAllAction();
978 
979  // Delete selected content.
980  SwRewriter aRewriter;
981  aRewriter.AddRule(UndoArg1, SwResId(STR_SPECIALCHAR));
982 
983  rSh.StartUndo( SwUndoId::INSERT, &aRewriter );
984  if ( rSh.HasSelection() )
985  {
986  rSh.DelRight();
987  aSet.ClearItem();
988  rSh.GetCurAttr( aSet );
989 
990  SvxScriptSetItem aSetItem( SID_ATTR_CHAR_FONT, *aSet.GetPool() );
991  aSetItem.GetItemSet().Put( aSet, false );
992  const SfxPoolItem* pI = aSetItem.GetItemOfScript( nScript );
993  if( pI )
994  {
995  aFont.reset(static_cast<SvxFontItem*>(pI->Clone()));
996  }
997  else
998  {
999  TypedWhichId<SvxFontItem> nFontWhich =
1001  RES_CHRATR_FONT,
1003  aFont.reset(aSet.Get( nFontWhich ).Clone());
1004  }
1005  }
1006 
1007  // Insert character.
1008  rSh.Insert( aChars );
1009 
1010  // #108876# a font attribute has to be set always due to a guessed script type
1011  if( !aNewFont.GetFamilyName().isEmpty() )
1012  {
1013  std::unique_ptr<SvxFontItem> aNewFontItem(aFont->Clone());
1014  aNewFontItem->SetFamilyName( aNewFont.GetFamilyName() );
1015  aNewFontItem->SetFamily( aNewFont.GetFamilyType());
1016  aNewFontItem->SetPitch( aNewFont.GetPitch());
1017  aNewFontItem->SetCharSet( aNewFont.GetCharSet() );
1018 
1021  RES_CHRATR_CTL_FONT, RES_CHRATR_CTL_FONT> aRestoreSet( GetPool() );
1022 
1023  nScript = g_pBreakIt->GetAllScriptsOfText( aChars );
1024  if( SvtScriptType::LATIN & nScript )
1025  {
1026  aRestoreSet.Put( aSet.Get( RES_CHRATR_FONT ) );
1027  aNewFontItem->SetWhich(RES_CHRATR_FONT);
1028  aSet.Put( *aNewFontItem );
1029  }
1030  if( SvtScriptType::ASIAN & nScript )
1031  {
1032  aRestoreSet.Put( aSet.Get( RES_CHRATR_CJK_FONT ) );
1033  aNewFontItem->SetWhich(RES_CHRATR_CJK_FONT);
1034  aSet.Put( *aNewFontItem );
1035  }
1036  if( SvtScriptType::COMPLEX & nScript )
1037  {
1038  aRestoreSet.Put( aSet.Get( RES_CHRATR_CTL_FONT ) );
1039  aNewFontItem->SetWhich(RES_CHRATR_CTL_FONT);
1040  aSet.Put( *aNewFontItem );
1041  }
1042 
1043  rSh.SetMark();
1044  rSh.ExtendSelection( false, aChars.getLength() );
1046  if( !rSh.IsCursorPtAtEnd() )
1047  rSh.SwapPam();
1048 
1049  rSh.ClearMark();
1050 
1051  // #i75891#
1052  // SETATTR_DONTEXPAND does not work if there are already hard attributes.
1053  // Therefore we have to restore the font attributes.
1054  rSh.SetMark();
1055  rSh.SetAttrSet( aRestoreSet );
1056  rSh.ClearMark();
1057 
1058  rSh.UpdateAttr();
1059 
1060  // Why was this done? aFont is not used anymore below, we are not
1061  // in a loop and it's a local variable...?
1062  // aFont = aNewFontItem;
1063  }
1064 
1065  rSh.EndAllAction();
1066  rSh.EndUndo();
1067 
1068  if ( !aChars.isEmpty() )
1069  {
1070  rReq.AppendItem( SfxStringItem( SID_CHARMAP, aChars ) );
1071  rReq.AppendItem( SfxStringItem( SID_ATTR_SPECIALCHAR, aNewFont.GetFamilyName() ) );
1072  rReq.Done();
1073  }
1074 }
1075 
1076 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void InsertLineBreak(std::optional< SwLineBreakClear > oClear=std::nullopt)
Definition: wrtsh1.cxx:955
OString stripEnd(const OString &rIn, char c)
void SetMacro(HyperDialogEvent nEvent, const SvxMacro &rMacro)
void SetURL(const OUString &rURL)
SfxViewFrame * GetViewFrame() const
#define CHAR_WJ
Definition: swtypes.hxx:167
css::uno::Reference< css::embed::XEmbeddedObject > CreateEmbeddedObject(const css::uno::Sequence< sal_Int8 > &, OUString &, OUString const *pBaseURL=nullptr)
#define FN_INSERT_PICTURE_CONTENT_CONTROL
Definition: cmdid.h:226
bool IsInClickToEdit() const
Definition: wrtsh.hxx:656
const css::uno::Reference< css::embed::XEmbeddedObject > & GetObject() const
FieldUnit
void SplitNode(bool bAutoFormat=false)
Definition: wrtsh1.cxx:1264
#define FN_FORMAT_COLUMN
Definition: cmdid.h:330
bool InsertMediaDlg(SfxRequest const &)
Definition: grfshex.cxx:42
static SvxAutoCorrCfg & Get()
const T * GetItemIfSet(TypedWhichId< T > nWhich, bool bSrchInParent=true) const
void InsertByWord(const OUString &)
Definition: wrtsh1.cxx:201
bool IsAutoCorrFlag(ACFlags nFlag) const
constexpr TypedWhichId< SvxFontItem > RES_CHRATR_CTL_FONT(27)
SwView & GetView()
Definition: basesh.hxx:59
const OUString & GetFamilyName() const
constexpr sal_uInt16 KEY_MOD1
const SwPageDesc * GetSelectedPageDescs() const
if inside all selection only one PageDesc,
Definition: fedesc.cxx:185
#define SFX_IMPL_INTERFACE(Class, SuperClass)
void AutoCaption(const sal_uInt16 nType, const SvGlobalName *pOleId=nullptr)
Definition: viewdlg2.cxx:180
static SfxInterface * GetStaticInterface()
void InsertObject( const svt::EmbeddedObjectRef &, SvGlobalName const *pName, sal_uInt16 nSlotId=0)
Definition: wrtsh1.cxx:390
void ExecInsert(SfxRequest &)
Definition: textsh.cxx:131
constexpr auto toTwips(N number, Length from)
#define FN_DELETE_SENT
Definition: cmdid.h:677
void setWidth(tools::Long nWidth)
#define CHAR_NNBSP
Definition: swtypes.hxx:168
SwView * GetActiveView()
Definition: swmodul1.cxx:116
static constexpr auto Items
#define FN_DELETE_BACK_SENT
Definition: cmdid.h:678
void DelToStartOfPara()
Definition: delete.cxx:569
std::string GetValue
void DelNxtWord()
Definition: delete.cxx:633
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const =0
bool IsTableMode() const
Definition: crsrsh.hxx:648
SwWrtShell * GetShellPtr()
Definition: basesh.cxx:2825
const SwRect & GetAnyCurRect(CurRectType eType, const Point *pPt=nullptr, const css::uno::Reference< css::embed::XEmbeddedObject > &=css::uno::Reference< css::embed::XEmbeddedObject >()) const
Definition: fews.cxx:90
SwWrtShell & GetShell()
Definition: basesh.cxx:2820
#define SO3_IFRAME_CLASSID
static SvxAbstractDialogFactory * Create()
void RegisterObjectBar(sal_uInt16, SfxVisibilityFlags nFlags, ToolbarId eId)
long Long
Size GetObjSize() const
Definition: feshview.cxx:2392
Reference< XFrame > xFrame
#define MINLAY
Definition: swtypes.hxx:62
void StopQuickHelp()
Definition: edtwin.cxx:6050
void SetAttrSet(const SfxItemSet &, SetAttrMode nFlags=SetAttrMode::DEFAULT, SwPaM *pCursor=nullptr, const bool bParagraphSetting=false)
Definition: edatmisc.cxx:151
bool Pop(SwCursorShell::PopMode=SwCursorShell::PopMode::DeleteStack)
Definition: wrtsh1.cxx:1993
constexpr Point convert(const Point &rPoint, o3tl::Length eFrom, o3tl::Length eTo)
const wchar_t *typedef int(__stdcall *DllNativeUnregProc)(int
void SetIntName(const OUString &rIntName)
constexpr sal_uInt16 RES_FRMATR_END(133)
virtual Size GetSizePixel() const
sal_uInt16 GetValue() const
SvtScriptType GetAllScriptsOfText(const OUString &rText) const
Definition: breakit.cxx:127
virtual ~SwTextShell() override
Definition: textsh.cxx:865
sal_uInt16 FirstWhich()
void SetCol(const SwFormatCol &rCol)
Definition: frmmgr.cxx:243
#define CHAR_HARDBLANK
Definition: swtypes.hxx:161
#define FN_INSERT_AUTH_ENTRY_DLG
Definition: cmdid.h:296
#define FN_DELETE_WHOLE_LINE
Definition: cmdid.h:685
void UpdateAttr()
Definition: crsrsh.hxx:765
SwUndoId EndUndo(SwUndoId eUndoId=SwUndoId::EMPTY, const SwRewriter *pRewriter=nullptr)
Closes parenthesis of nUndoId, not used by UI.
Definition: edws.cxx:234
css::uno::Reference< css::frame::XModel > InsertChart(css::uno::Reference< css::chart2::data::XDataProvider > const &rxDataProvider, bool bFillWithData, const OUString &rCellRange, SwFlyFrameFormat **ppFlyFrameFormat=nullptr)
Definition: tablemgr.cxx:185
void EnterStdMode()
Definition: select.cxx:551
SwEditWin & GetEditWin()
Definition: view.hxx:416
void DestroyCursor()
transform TableCursor to normal cursor, nullify Tablemode
Definition: crsrsh.cxx:152
void Done(bool bRemove=false)
const SvGlobalName & GetValue() const
void LaunchOLEObj(sal_Int32 nVerb=css::embed::EmbedVerbs::MS_OLEVERB_PRIMARY)
Definition: wrtsh1.cxx:635
#define FN_INSERT_COLUMN_BREAK
Definition: cmdid.h:206
Of course Writer needs its own rectangles.
Definition: swrect.hxx:34
#define SO3_SM_CLASSID
#define FN_EDIT_FORMULA
Definition: cmdid.h:84
const SfxItemSet * GetArgs() const
void RegisterPopupMenu(const OUString &)
#define FN_INSERT_LINEBREAK
Definition: cmdid.h:218
bool InsertOleObject(const svt::EmbeddedObjectRef &xObj, SwFlyFrameFormat **pFlyFrameFormat=nullptr)
Definition: wrtsh1.cxx:494
RndStdIds GetAnchor() const
Definition: frmmgr.hxx:167
void ExecTransliteration(SfxRequest const &)
Definition: textsh.cxx:807
void DelToEndOfLine()
Definition: delete.cxx:126
void EndAllAction()
Definition: edws.cxx:97
#define FN_INSERT_FRAME_INTERACT
Definition: cmdid.h:230
void InsertHyperlink(const SvxHyperlinkItem &rHlnkItem)
Definition: textfld.cxx:974
RotateTransliteration m_aRotateCase
Definition: textsh.hxx:35
constexpr TypedWhichId< SvxFontItem > RES_CHRATR_FONT(7)
#define CHAR_RLM
Definition: swtypes.hxx:164
Point GetPos() const
Definition: frmmgr.hxx:163
FontFamily GetFamilyType()
sal_uInt16 NextWhich()
bool DelRight()
Definition: delete.cxx:294
constexpr SwTwips DEF_GUTTER_WIDTH
Definition: swtypes.hxx:65
SwWrtShell & GetWrtShell() const
Definition: view.hxx:413
IDocumentDrawModelAccess const & getIDocumentDrawModelAccess() const
Definition: doc.cxx:155
const SwSection * GetCurrSection() const
Definition: edsect.cxx:71
#define CHAR_SOFTHYPHEN
Definition: swtypes.hxx:163
void SwapPam()
Definition: crsrsh.cxx:976
#define FN_DELETE_BACK_WORD
Definition: cmdid.h:680
Used by the UI to modify the document model.
Definition: wrtsh.hxx:96
OUString SwResId(TranslateId aId)
Definition: swmodule.cxx:164
#define FN_INSERT_CONTENT_CONTROL
Definition: cmdid.h:220
constexpr tools::Long Width() const
SvtScriptType
bool SelectHiddenRange()
If the current cursor position is inside a hidden range, the hidden range is selected.
Definition: crsrsh.cxx:3462
sal_uInt16 sal_Unicode
void SetTargetFrame(const OUString &rTarget)
#define FN_DELETE_WORD
Definition: cmdid.h:679
ScrollingMode
static bool lcl_IsMarkInSameSection(SwWrtShell &rWrtSh, const SwSection *pSect)
Definition: textsh.cxx:576
bool IsAutoFormatByInput() const
IMPL_STATIC_LINK(SwTextShell, DialogClosedHdl, css::ui::dialogs::DialogClosedEvent *, pEvent, void)
Definition: textsh.cxx:98
const OUString & GetName() const
Definition: format.hxx:131
SwBreakIt * g_pBreakIt
Definition: breakit.cxx:33
SfxFrame & GetFrame() const
SfxItemSet CreateInsertFrameItemSet(SwFlyFrameAttrMgr &rMgr)
Create item set for the insert frame dialog.
Definition: textsh.cxx:869
HLINK_HTMLMODE
void InsertSymbol(SfxRequest &)
Definition: textsh.cxx:908
void Width(tools::Long nNew)
Definition: swrect.hxx:189
const SfxItemSet & GetAttrSet() const
Definition: frmmgr.hxx:124
#define FN_INSERT_CHECKBOX_CONTENT_CONTROL
Definition: cmdid.h:221
void Insert(const OUString &)
Definition: wrtsh1.cxx:221
SwDoc * GetDoc() const
Definition: viewsh.hxx:282
static void InitInterface_Impl()
SfxInterface initializer.
Definition: textsh.cxx:116
void RegisterChildWindow(sal_uInt16, bool bContext=false)
SfxObjectCreateMode GetCreateMode() const
#define HTML_CFG_WRITER
sal_Int16 GetI18NScriptTypeOfLanguage(LanguageType nLang)
#define FN_DELETE_PARA
Definition: cmdid.h:683
TransliterationFlags
virtual VclPtr< SfxAbstractTabDialog > CreateFrameTabDialog(const OUString &rDialogType, SfxViewFrame *pFrame, weld::Window *pParent, const SfxItemSet &rCoreSet, bool bNewFrame=true, const OString &sDefPage=OString())=0
Point GetObjAbsPos() const
Definition: feshview.cxx:2434
void InsertFlyFrame()
Definition: frmmgr.cxx:188
constexpr TypedWhichId< SwFormatINetFormat > RES_TXTATR_INETFMT(51)
SfxItemPool & GetPool() const
weld::Window * GetFrameWeld(const SfxFrame *pFrame)
Definition: dialoghelp.cxx:19
const SfxItemPool & GetAttrPool() const
Definition: viewsh.hxx:617
bool IsMath() const
sal_uInt16 char * pName
virtual void ClearRedo()=0
Delete all Redo actions.
Style of a layout element.
Definition: frmfmt.hxx:59
Rect of current PrtArea of page.
SvtScriptType GetScriptType() const
returns the script type of the selection
Definition: edattr.cxx:662
bool HasSelection() const
Definition: wrtsh.hxx:147
#define SW_MOD()
Definition: swmodule.hxx:255
const SfxItemSet * GetParent() const
FontPitch GetPitch()
bool IsInsRegionAvailable() const
Definition: edsect.cxx:58
#define FN_DELETE_LINE
Definition: cmdid.h:681
SwPaM * CreateCursor()
delete the current cursor and make the following into the current
Definition: crsrsh.cxx:124
SW_DLLPUBLIC FieldUnit GetDfltMetric(bool bWeb)
Definition: uitool.cxx:755
#define FN_INSERT_TABLE
Definition: cmdid.h:228
SfxObjectCreateMode
#define FN_INSERT_IDX_ENTRY_DLG
Definition: cmdid.h:233
sal_uInt16 GetModifier() const
Window class for the Writer edit area, this is the one handling mouse and keyboard events and doing t...
Definition: edtwin.hxx:59
SelectionType
void Push()
store a copy of the current cursor on the cursor stack
Definition: crsrsh.cxx:2248
sal_uInt16 GetFullSelectedSectionCount() const
Search inside the cursor selection for full selected sections.
Definition: edsect.cxx:247
SvxAutoCorrect * GetAutoCorrect()
sal_uInt16 GetGutterWidth(bool bMin=false) const
Definition: atrfrm.cxx:919
void StateInsert(SfxItemSet &)
Definition: textsh.cxx:584
SfxBindings & GetBindings()
bool HasMark() const
Definition: crsrsh.hxx:886
void Assign(const css::uno::Reference< css::embed::XEmbeddedObject > &xObj, sal_Int64 nAspect)
svt::EmbeddedObjectRef & GetOLEObject() const
Get OLE object at pointer.
Definition: editsh.cxx:359
const OUString & GetValue() const
#define FN_CONTENT_CONTROL_PROPERTIES
Definition: cmdid.h:225
void ExecDelete(SfxRequest &)
Definition: textsh.cxx:762
HTMLMODE_ON
void DelLine()
Description: Erase the line.
Definition: delete.cxx:101
sal_uInt16 GetHtmlMode(const SwDocShell *pShell)
Definition: viewopt.cxx:354
SwTextShell(SwView &rView)
Definition: textsh.cxx:858
const T * GetArg(sal_uInt16 nSlotId) const
void SetAttrSet(const SfxItemSet &rSet)
Definition: frmmgr.cxx:618
virtual const SwDrawModel * GetDrawModel() const =0
Draw Model and id accessors.
SwUndoId StartUndo(SwUndoId eUndoId=SwUndoId::EMPTY, const SwRewriter *pRewriter=nullptr)
Undo: set up Undo parenthesis, return nUndoId of this parenthesis.
Definition: edws.cxx:223
constexpr sal_uInt16 XATTR_FILL_FIRST(XATTRSET_LINE+1)
void DelToStartOfLine()
Definition: delete.cxx:118
void InsertContentControl(SwContentControlType eType)
Definition: wrtsh1.cxx:1016
void AddRule(SwUndoArg eWhat, const OUString &rWith)
Definition: SwRewriter.cxx:25
#define HTML_CFG_MSIE
void Undo(sal_uInt16 const nCount=1, sal_uInt16 nOffset=0)
Definition: edundo.cxx:96
sal_uInt16 GetWhichOfScript(sal_uInt16 nWhich, sal_uInt16 nScript)
Definition: hints.cxx:193
TransliterationFlags getNextMode()
virtual VclPtr< VclAbstractDialog > CreateSwContentControlDlg(weld::Window *pParent, SwWrtShell &rSh)=0
HLINK_FIELD
void SetMark()
Definition: crsrsh.hxx:884
#define CHAR_ZWSP
Definition: swtypes.hxx:166
static SwAbstractDialogFactory * Create()
Definition: swabstdlg.cxx:36
#define FN_WORDCOUNT_DIALOG
Definition: cmdid.h:605
void LockPaint()
Definition: viewsh.hxx:607
virtual VclPtr< SfxAbstractDialog > CreateCharMapDialog(weld::Window *pParent, const SfxItemSet &rAttr, const css::uno::Reference< css::frame::XFrame > &rFrame)=0
void SetName(const OUString &rName)
Point PixelToLogic(const Point &rDevicePt) const
void DelPrvWord()
Definition: delete.cxx:656
void SetName(const OUString &rName)
bool StartExecuteAsync(const std::function< void(sal_Int32)> &rEndDialogFn)
void PutAreaListItems(SfxItemSet &rSet) const
Put needed items for XPropertyList entries from the DrawModel.
Definition: drawdoc.cxx:128
OUString GetBoxNms() const
Definition: trvltbl.cxx:746
SwDocShell * GetDocShell()
Definition: view.cxx:1132
const css::uno::Reference< css::frame::XFrame > & GetFrameInterface() const
const OUString & GetSymbolFont() const
Definition: viewopt.hxx:575
SwFrameFormat * GetTableFormat()
Definition: edws.cxx:183
#define FN_GET_PRINT_AREA
Definition: cmdid.h:751
#define SFX_OBJECTBAR_OBJECT
#define FN_INSERT_STRING
Definition: cmdid.h:229
Rect of current page.
void StartAction()
Definition: crsrsh.cxx:227
void SetParent(const SfxItemSet *pNew)
void SetReturnValue(const SfxPoolItem &)
bool DelToEndOfSentence()
Definition: delete.cxx:599
void InsertTable(SfxRequest &_rRequest)
Definition: basesh.cxx:2882
sal_uInt16 GetWishWidth() const
Definition: fmtclds.hxx:122
#define CHAR_LRM
Definition: swtypes.hxx:165
#define FN_DELETE_BACK_LINE
Definition: cmdid.h:682
IDocumentUndoRedo const & GetIDocumentUndoRedo() const
Provides access to the document undo/redo interface.
Definition: viewsh.cxx:2795
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
#define FN_INSERT_FRAME
Definition: cmdid.h:231
sal_uInt16 GetSlot() const
static const OUString & GetContextName(const Context eContext)
#define CHAR_HARDHYPHEN
Definition: swtypes.hxx:162
void SetMacroEvents(const HyperDialogEvent nEvents)
const css::uno::Reference< css::frame::XDispatchRecorder > & GetRecorder() const
#define FN_INSERT_FIELD
Definition: cmdid.h:207
void DisableItem(sal_uInt16 nWhich)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
constexpr tools::Long Height() const
void ExecRotateTransliteration(SfxRequest const &)
Definition: textsh.cxx:852
#define FN_DELETE_BACK_PARA
Definition: cmdid.h:684
#define GetWhich(nSlot)
#define FN_INSERT_FRAME_INTERACT_NOCOL
Definition: cmdid.h:234
bool IsCursorPtAtEnd() const
Definition: crsrsh.hxx:903
bool ExtendSelection(bool bEnd=true, sal_Int32 nCount=1)
extend current SSelection by n characters
Definition: crsrsh.cxx:2634
#define FN_SET_FRM_NAME
Definition: cmdid.h:865
OUString GetSelText() const
get selected text of a node at current cursor
Definition: crsrsh.cxx:2552
OUString aName
LanguageType GetAppLanguage()
Definition: init.cxx:725
RET_OK
constexpr TypedWhichId< SvxFontItem > RES_CHRATR_CJK_FONT(22)
size_t IsObjSelected() const
Definition: feshview.cxx:1246
#define FN_INSERT_SMA
Definition: cmdid.h:243
#define FN_INSERT_PAGEBREAK
Definition: cmdid.h:223
void ClearMark()
Definition: crsrsh.cxx:939
void InsertColumnBreak()
Definition: wrtsh1.cxx:993
bool GetCurAttr(SfxItemSet &, const bool bMergeIndentValuesOfNumRule=false) const
Definition: edattr.cxx:171
constexpr TypedWhichId< SvxBoxItem > RES_BOX(106)
void SetInsertMode(SvxLinkInsertMode eNew)
void AutoCorrect(SvxAutoCorrect &rACorr, sal_Unicode cChar)
Definition: wrtsh1.cxx:1907
void TransliterateText(TransliterationFlags nType)
Change text to Upper/Lower/Hiragana/Katakana/...
Definition: editsh.cxx:1060
void InsFrameMode(sal_uInt16 nCols)
Definition: view2.cxx:2135
SvxLinkInsertMode GetInsertMode() const
const SwFrameFormat * GetFlyFrameFormat() const
Get FlyFrameFormat; for UI macro linkage at Flys.
Definition: fefly1.cxx:1270
bool CursorInsideContentControl() const
Definition: crstrvl.cxx:1005
void AppendItem(const SfxPoolItem &)
virtual VclPtr< VclAbstractDialog > CreateSwColumnDialog(weld::Window *pParent, SwWrtShell &rSh)=0
RndStdIds
constexpr sal_uInt16 XATTR_FILL_LAST(XATTR_FILLBACKGROUND)
void InsertPageBreak(const OUString *pPageDesc=nullptr, const ::std::optional< sal_uInt16 > &rPgNum=std::nullopt)
Definition: wrtsh1.cxx:917
static bool TryRunningState(const css::uno::Reference< css::embed::XEmbeddedObject > &)
bool IsAPI() const
const Size & GetSize() const
Definition: frmmgr.hxx:138
Frame is variable in Var-direction.
sal_Int64 GetViewAspect() const
void Init(sal_uInt16 nNumCols, sal_uInt16 nGutterWidth, sal_uInt16 nAct)
This function allows to (repeatedly) initialize the columns.
Definition: atrfrm.cxx:970
SelectionType GetSelectionType() const
Definition: wrtsh1.cxx:1675
void StartAllAction()
For all views of this document.
Definition: edws.cxx:86
void DelToEndOfPara()
Definition: delete.cxx:552
#define FN_INSERT_DROPDOWN_CONTENT_CONTROL
Definition: cmdid.h:224
void Ignore()
void Height(tools::Long nNew)
Definition: swrect.hxx:193
bool DeleteRow(bool bCompleteTable=false)
Definition: fetab.cxx:315
sal_uInt16 GetExportMode()
void SetContextName(const OUString &rsContextName)
constexpr sal_uInt16 RES_FRMATR_BEGIN(RES_PARATR_LIST_END)
bool IsFrameSelected() const
Definition: feshview.cxx:1254
rtl_TextEncoding GetCharSet() const
Definition: view.hxx:144
void DelToStartOfSentence()
Definition: delete.cxx:590
void UnlockPaint(bool bVirDev=false)
Definition: viewsh.hxx:612
bool IsSelFrameMode() const
Definition: wrtsh.hxx:176
bool IsChart() const
void EndAction(const bool bIdleEnd=false)
Definition: crsrsh.cxx:244
bool CursorInsideInputField() const
Definition: crstrvl.cxx:995