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