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 
48 #include <comphelper/classids.hxx>
49 #include <editeng/acorrcfg.hxx>
50 #include <wdocsh.hxx>
51 #include <fmtinfmt.hxx>
52 #include <fmtclds.hxx>
53 #include <fmtfsize.hxx>
54 #include <swmodule.hxx>
55 #include <wrtsh.hxx>
56 #include <view.hxx>
57 #include <docsh.hxx>
58 #include <doc.hxx>
60 #include <uitool.hxx>
61 #include <cmdid.h>
62 #include <globals.hrc>
63 #include <frmmgr.hxx>
64 #include <textsh.hxx>
65 #include <frmfmt.hxx>
66 #include <tablemgr.hxx>
67 #include <swundo.hxx>
68 #include <breakit.hxx>
69 #include <edtwin.hxx>
70 #include <strings.hrc>
71 #include <unochart.hxx>
72 #include <chartins.hxx>
73 #include <viewopt.hxx>
74 
75 #define ShellClass_SwTextShell
76 #include <sfx2/msg.hxx>
77 #include <vcl/EnumContext.hxx>
78 #include <swslots.hxx>
79 #include <SwRewriter.hxx>
80 #include <SwCapObjType.hxx>
81 
82 using namespace ::com::sun::star;
83 
84 #include <svx/svxdlg.hxx>
85 #include <swabstdlg.hxx>
87 #include <drawdoc.hxx>
88 #include <svtools/embedhlp.hxx>
89 #include <sfx2/event.hxx>
90 #include <com/sun/star/ui/dialogs/DialogClosedEvent.hpp>
91 #include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp>
92 #include <IDocumentUndoRedo.hxx>
93 
95 
96 IMPL_STATIC_LINK( SwTextShell, DialogClosedHdl, css::ui::dialogs::DialogClosedEvent*, pEvent, void )
97 {
98  SwView* pView = ::GetActiveView();
99  SwWrtShell& rWrtShell = pView->GetWrtShell();
100 
101  sal_Int16 nDialogRet = pEvent->DialogResult;
102  if( nDialogRet == ui::dialogs::ExecutableDialogResults::CANCEL )
103  {
104  rWrtShell.Undo();
105  rWrtShell.GetIDocumentUndoRedo().ClearRedo();
106  }
107  else
108  {
109  OSL_ENSURE( nDialogRet == ui::dialogs::ExecutableDialogResults::OK,
110  "dialog execution failed" );
111  }
112 }
113 
115 {
117 
118  GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_OBJECT, SfxVisibilityFlags::Invisible, ToolbarId::Text_Toolbox_Sw);
119 
124  GetStaticInterface()->RegisterChildWindow(SID_RUBY_DIALOG);
126 }
127 
128 
130 {
131  SwWrtShell &rSh = GetShell();
132 
133  OSL_ENSURE( !rSh.IsObjSelected() && !rSh.IsFrameSelected(),
134  "wrong shell on dispatcher" );
135 
136  const SfxItemSet *pArgs = rReq.GetArgs();
137  const SfxPoolItem* pItem = nullptr;
138  const sal_uInt16 nSlot = rReq.GetSlot();
139  if(pArgs)
140  pArgs->GetItemState(nSlot, false, &pItem );
141 
142  switch( nSlot )
143  {
144  case FN_INSERT_STRING:
145  if( pItem )
146  rSh.InsertByWord(static_cast<const SfxStringItem *>(pItem)->GetValue());
147  break;
148 
149  case FN_INSERT_SOFT_HYPHEN:
150  if( CHAR_SOFTHYPHEN != rSh.SwCursorShell::GetChar() &&
151  CHAR_SOFTHYPHEN != rSh.SwCursorShell::GetChar( true, -1 ))
152  rSh.Insert( OUString( CHAR_SOFTHYPHEN ) );
153  break;
154 
155  case FN_INSERT_HARDHYPHEN:
156  case FN_INSERT_HARD_SPACE:
157  {
158  const sal_Unicode cIns = FN_INSERT_HARD_SPACE == nSlot ? CHAR_HARDBLANK : CHAR_HARDHYPHEN;
159 
161  SvxAutoCorrect* pACorr = rACfg.GetAutoCorrect();
162  if( pACorr && rACfg.IsAutoFormatByInput()
163  && pACorr->IsAutoCorrFlag(
164  ACFlags::CapitalStartSentence | ACFlags::CapitalStartWord |
165  ACFlags::AddNonBrkSpace | ACFlags::ChgOrdinalNumber | ACFlags::TransliterateRTL |
166  ACFlags::ChgToEnEmDash | ACFlags::SetINetAttr | ACFlags::Autocorrect ) )
167  {
168  rSh.AutoCorrect( *pACorr, cIns );
169  }
170  else
171  {
172  rSh.Insert( OUString( cIns ) );
173  }
174  }
175  break;
176 
177  case FN_INSERT_NNBSP: // shift+mod2/alt+space inserts some other character w/o going through SwEditWin::KeyInput(), at least on macOS
178  case SID_INSERT_RLM :
179  case SID_INSERT_LRM :
180  case SID_INSERT_ZWNBSP :
181  case SID_INSERT_ZWSP:
182  {
183  sal_Unicode cIns = 0;
184  switch(nSlot)
185  {
186  case SID_INSERT_RLM : cIns = CHAR_RLM ; break;
187  case SID_INSERT_LRM : cIns = CHAR_LRM ; break;
188  case SID_INSERT_ZWSP : cIns = CHAR_ZWSP ; break;
189  case SID_INSERT_ZWNBSP: cIns = CHAR_ZWNBSP; break;
190  case FN_INSERT_NNBSP: cIns = CHAR_NNBSP; break;
191  }
192  rSh.Insert( OUString( cIns ) );
193  }
194  break;
195 
196  case FN_INSERT_BREAK:
197  {
198  if( !rSh.CursorInsideInputField() )
199  {
200  rSh.SplitNode();
201  }
202  else
203  {
204  rSh.InsertLineBreak();
205  }
206  }
207  rReq.Done();
208  break;
209 
210  case FN_INSERT_PAGEBREAK:
211  rSh.InsertPageBreak();
212  rReq.Done();
213  break;
214 
215  case FN_INSERT_LINEBREAK:
216  rSh.InsertLineBreak();
217  rReq.Done();
218  break;
219 
221  rSh.InsertColumnBreak();
222  rReq.Done();
223  break;
224 
225  case SID_HYPERLINK_SETLINK:
226  if (pItem)
227  InsertHyperlink(*static_cast<const SvxHyperlinkItem *>(pItem));
228  rReq.Done();
229  break;
230 
231 #if HAVE_FEATURE_AVMEDIA
232  case SID_INSERT_AVMEDIA:
233  rReq.SetReturnValue(SfxBoolItem(nSlot, InsertMediaDlg( rReq )));
234  break;
235 #endif
236 
237  case SID_INSERT_OBJECT:
238  {
239  const SfxGlobalNameItem* pNameItem = rReq.GetArg<SfxGlobalNameItem>(SID_INSERT_OBJECT);
240  SvGlobalName *pName = nullptr;
242  if ( pNameItem )
243  {
244  aName = pNameItem->GetValue();
245  pName = &aName;
246  }
247 
249  rSh.InsertObject( xObj, pName, nSlot);
250  rReq.Done();
251  break;
252  }
253  case SID_INSERT_FLOATINGFRAME:
254  {
256  const SfxStringItem* pNameItem = rReq.GetArg<SfxStringItem>(FN_PARAM_1);
257  const SfxStringItem* pURLItem = rReq.GetArg<SfxStringItem>(FN_PARAM_2);
258  const SvxSizeItem* pMarginItem = rReq.GetArg<SvxSizeItem>(FN_PARAM_3);
259  const SfxByteItem* pScrollingItem = rReq.GetArg<SfxByteItem>(FN_PARAM_4);
260  const SfxBoolItem* pBorderItem = rReq.GetArg<SfxBoolItem>(FN_PARAM_5);
261 
262  if(pURLItem) // URL is a _must_
263  {
265  OUString aName;
266  xObj.Assign( aCnt.CreateEmbeddedObject( SvGlobalName( SO3_IFRAME_CLASSID ).GetByteSequence(), aName ),
267  embed::Aspects::MSOLE_CONTENT );
269  uno::Reference < beans::XPropertySet > xSet( xObj->getComponent(), uno::UNO_QUERY );
270  if ( xSet.is() )
271  {
272  try
273  {
274  ScrollingMode eScroll = ScrollingMode::Auto;
275  if( pScrollingItem && pScrollingItem->GetValue() <= int(ScrollingMode::Auto) )
276  eScroll = static_cast<ScrollingMode>(pScrollingItem->GetValue());
277 
278  Size aMargin;
279  if ( pMarginItem )
280  aMargin = pMarginItem->GetSize();
281 
282  xSet->setPropertyValue("FrameURL", uno::makeAny( pURLItem->GetValue() ) );
283  if ( pNameItem )
284  xSet->setPropertyValue("FrameName", uno::makeAny( pNameItem->GetValue() ) );
285 
286  if ( eScroll == ScrollingMode::Auto )
287  xSet->setPropertyValue("FrameIsAutoScroll",
288  uno::makeAny( true ) );
289  else
290  xSet->setPropertyValue("FrameIsScrollingMode",
291  uno::makeAny( eScroll == ScrollingMode::Yes ) );
292 
293  if ( pBorderItem )
294  xSet->setPropertyValue("FrameIsBorder",
295  uno::makeAny( pBorderItem->GetValue() ) );
296 
297  if ( pMarginItem )
298  {
299  xSet->setPropertyValue("FrameMarginWidth",
300  uno::makeAny( sal_Int32( aMargin.Width() ) ) );
301 
302  xSet->setPropertyValue("FrameMarginHeight",
303  uno::makeAny( sal_Int32( aMargin.Height() ) ) );
304  }
305  }
306  catch (const uno::Exception&)
307  {
308  }
309  }
310 
311  rSh.InsertOleObject( xObj );
312  }
313  else
314  {
315  rSh.InsertObject( xObj, nullptr, nSlot);
316  rReq.Done();
317  }
318  }
319  break;
320  case SID_INSERT_DIAGRAM:
321  {
322  SvtModuleOptions aMOpt;
323  if ( !aMOpt.IsChart() )
324  break;
325  if(!rReq.IsAPI())
326  {
327  SwInsertChart( LINK( this, SwTextShell, DialogClosedHdl ) );
328  }
329  else
330  {
331  uno::Reference< chart2::data::XDataProvider > xDataProvider;
332  bool bFillWithData = true;
333  OUString aRangeString;
334  if (!GetShell().IsTableComplexForChart())
335  {
336  SwFrameFormat* pTableFormat = GetShell().GetTableFormat();
337  aRangeString = pTableFormat->GetName() + "."
338  + GetShell().GetBoxNms();
339 
340  // get table data provider
341  xDataProvider.set( GetView().GetDocShell()->getIDocumentChartDataProviderAccess().GetChartDataProvider() );
342  }
343  else
344  bFillWithData = false; // will create chart with only it's default image
345 
346  SwTableFUNC( &rSh ).InsertChart( xDataProvider, bFillWithData, aRangeString );
347  rSh.LaunchOLEObj();
348 
349  svt::EmbeddedObjectRef& xObj = rSh.GetOLEObject();
350  if(pItem && xObj.is())
351  {
352  Size aSize(static_cast<const SvxSizeItem*>(pItem)->GetSize());
354  ( aSize, MapMode( MapUnit::MapTwip ), MapMode( MapUnit::Map100thMM ) );
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  aStartPos.AdjustX( -(8 * MM50) );
402  aStartPos.AdjustY( -(4 * MM50) );
403  Size aSize(16 * MM50, 8 * MM50);
404  GetShell().LockPaint();
406  SwFlyFrameAttrMgr aMgr( true, GetShellPtr(), Frmmgr_Type::TEXT, nullptr );
407  if(nCols > 1)
408  {
409  SwFormatCol aCol;
410  aCol.Init( nCols, aCol.GetGutterWidth(), aCol.GetWishWidth() );
411  aMgr.SetCol( aCol );
412  }
413  aMgr.InsertFlyFrame(RndStdIds::FLY_AT_PARA, aStartPos, aSize);
415  GetShell().UnlockPaint();
416  }
417  else
418  {
419  GetView().InsFrameMode(nCols);
420  }
421  rReq.Ignore();
422  }
423  break;
424  case FN_INSERT_FRAME:
425  {
426  bool bSingleCol = false;
427  if( nullptr!= dynamic_cast< SwWebDocShell*>( GetView().GetDocShell()) )
428  {
429  SvxHtmlOptions& rHtmlOpt = SvxHtmlOptions::Get();
430  if( HTML_CFG_MSIE == rHtmlOpt.GetExportMode() )
431  {
432  bSingleCol = true;
433  }
434 
435  }
436  // Create new border
437  SwFlyFrameAttrMgr aMgr( true, GetShellPtr(), Frmmgr_Type::TEXT, nullptr );
438  if(pArgs)
439  {
440  Size aSize(aMgr.GetSize());
441  aSize.setWidth( GetShell().GetAnyCurRect(CurRectType::PagePrt).Width() );
442  Point aPos = aMgr.GetPos();
443  RndStdIds eAnchor = RndStdIds::FLY_AT_PARA;
444  if(pArgs->GetItemState(nSlot, false, &pItem) == SfxItemState::SET)
445  eAnchor = static_cast<RndStdIds>(static_cast<const SfxUInt16Item *>(pItem)->GetValue());
446  if(pArgs->GetItemState(FN_PARAM_1, false, &pItem) == SfxItemState::SET)
447  aPos = static_cast<const SfxPointItem *>(pItem)->GetValue();
448  if(pArgs->GetItemState(FN_PARAM_2, false, &pItem) == SfxItemState::SET)
449  aSize = static_cast<const SvxSizeItem *>(pItem)->GetSize();
450  if(pArgs->GetItemState(SID_ATTR_COLUMNS, false, &pItem) == SfxItemState::SET)
451  {
452  const sal_uInt16 nCols = static_cast<const SfxUInt16Item *>(pItem)->GetValue();
453  if( !bSingleCol && 1 < nCols )
454  {
455  SwFormatCol aFormatCol;
456  aFormatCol.Init( nCols , (rReq.IsAPI() ? 0
458  aMgr.SetCol(aFormatCol);
459  }
460  }
461 
462  GetShell().LockPaint();
464 
465  aMgr.InsertFlyFrame(eAnchor, aPos, aSize);
466 
468  GetShell().UnlockPaint();
469  }
470  else
471  {
473 
474  FieldUnit eMetric = ::GetDfltMetric(dynamic_cast<SwWebDocShell*>( GetView().GetDocShell()) != nullptr );
475  SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast< sal_uInt16 >(eMetric)));
478  GetView().GetViewFrame(),
479  GetView().GetFrameWeld(),
480  aSet));
481  if(pDlg->Execute() == RET_OK && pDlg->GetOutputItemSet())
482  {
483  //local variable necessary at least after call of .AutoCaption() because this could be deleted at this point
484  SwWrtShell& rShell = GetShell();
485  rShell.LockPaint();
486  rShell.StartAllAction();
487  rShell.StartUndo(SwUndoId::INSERT);
488 
489  const SfxItemSet* pOutSet = pDlg->GetOutputItemSet();
490  aMgr.SetAttrSet(*pOutSet);
491 
492  // At first delete the selection at the ClickToEditField.
493  if( rShell.IsInClickToEdit() )
494  rShell.DelRight();
495 
496  aMgr.InsertFlyFrame();
497 
498  uno::Reference< frame::XDispatchRecorder > xRecorder =
500  if ( xRecorder.is() )
501  {
502  //FN_INSERT_FRAME
503  sal_uInt16 nAnchor = static_cast<sal_uInt16>(aMgr.GetAnchor());
504  rReq.AppendItem(SfxUInt16Item(nSlot, nAnchor));
505  rReq.AppendItem(SfxPointItem(FN_PARAM_1, rShell.GetObjAbsPos()));
506  rReq.AppendItem(SvxSizeItem(FN_PARAM_2, rShell.GetObjSize()));
507  rReq.Done();
508  }
509 
511 
512  {
513  SwRewriter aRewriter;
514 
515  aRewriter.AddRule(UndoArg1, SwResId(STR_FRAME));
516 
517  rShell.EndUndo(SwUndoId::INSERT, &aRewriter);
518  }
519  rShell.EndAllAction();
520  rShell.UnlockPaint();
521  }
522  }
523  break;
524  }
525  case FN_FORMAT_COLUMN :
526  {
529  pColDlg->StartExecuteAsync([=](sal_Int32 /*nResult*/){
530  pColDlg->disposeOnce();
531  });
532  }
533  break;
534 
535  default:
536  OSL_ENSURE(false, "wrong dispatcher");
537  return;
538  }
539 }
540 
541 static bool lcl_IsMarkInSameSection( SwWrtShell& rWrtSh, const SwSection* pSect )
542 {
543  rWrtSh.SwapPam();
544  bool bRet = pSect == rWrtSh.GetCurrSection();
545  rWrtSh.SwapPam();
546  return bRet;
547 }
548 
550 {
551  const bool bHtmlModeOn = ::GetHtmlMode(GetView().GetDocShell()) & HTMLMODE_ON;
552  SfxWhichIter aIter( rSet );
553  SwWrtShell &rSh = GetShell();
554  sal_uInt16 nWhich = aIter.FirstWhich();
555  SvtModuleOptions aMOpt;
556  SfxObjectCreateMode eCreateMode =
558 
559  bool bCursorInHidden = false;
560  if( !rSh.HasMark() )
561  {
562  rSh.Push();
563  bCursorInHidden = rSh.SelectHiddenRange();
564  rSh.Pop();
565  }
566 
567  while ( nWhich )
568  {
569  switch ( nWhich )
570  {
571  case SID_INSERT_AVMEDIA:
572  if ( GetShell().IsSelFrameMode()
573  || GetShell().CursorInsideInputField()
574  || SfxObjectCreateMode::EMBEDDED == eCreateMode
575  || bCursorInHidden )
576  {
577  rSet.DisableItem( nWhich );
578  }
579  break;
580 
581  case SID_INSERT_DIAGRAM:
582  if( !aMOpt.IsChart()
584  || eCreateMode == SfxObjectCreateMode::EMBEDDED
585  || bCursorInHidden )
586  {
587  rSet.DisableItem( nWhich );
588  }
589  break;
590 
591  case FN_INSERT_SMA:
592  if( !aMOpt.IsMath()
593  || eCreateMode == SfxObjectCreateMode::EMBEDDED
594  || bCursorInHidden
595  || rSh.CursorInsideInputField() )
596  {
597  rSet.DisableItem( nWhich );
598  }
599  break;
600 
601  case SID_INSERT_FLOATINGFRAME:
602  case SID_INSERT_OBJECT:
603  {
604  if( eCreateMode == SfxObjectCreateMode::EMBEDDED || bCursorInHidden )
605  {
606  rSet.DisableItem( nWhich );
607  }
608  else if( GetShell().IsSelFrameMode()
609  || GetShell().CursorInsideInputField() )
610  {
611  rSet.DisableItem( nWhich );
612  }
613  else if(SID_INSERT_FLOATINGFRAME == nWhich && bHtmlModeOn)
614  {
615  SvxHtmlOptions& rHtmlOpt = SvxHtmlOptions::Get();
616  const sal_uInt16 nExport = rHtmlOpt.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  static const sal_uInt16 aFrameAttrRange[] =
840  {
842  SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER,
844  SID_ATTR_PAGE_SIZE, SID_ATTR_PAGE_SIZE,
846  SID_HTML_MODE, SID_HTML_MODE,
847  SID_COLOR_TABLE, SID_PATTERN_LIST,
848  XATTR_FILL_FIRST, XATTR_FILL_LAST, // tdf#95003
849  0
850  };
851 
852  SfxItemSet aSet(GetPool(), aFrameAttrRange );
853  aSet.Put(SfxUInt16Item(SID_HTML_MODE, ::GetHtmlMode(GetView().GetDocShell())));
854 
855  // For the Area tab page.
857 
859  SwFormatFrameSize aFrameSize(SwFrameSize::Variable, rPg.Width(), rPg.Height());
860  aFrameSize.SetWhich(GetPool().GetWhich(SID_ATTR_PAGE_SIZE));
861  aSet.Put(aFrameSize);
862 
864  SwFormatFrameSize aPrtSize(SwFrameSize::Variable, rPr.Width(), rPr.Height());
865  aPrtSize.SetWhich(GetPool().GetWhich(FN_GET_PRINT_AREA));
866  aSet.Put(aPrtSize);
867 
868  aSet.Put(rMgr.GetAttrSet());
869  aSet.SetParent( rMgr.GetAttrSet().GetParent() );
870 
871  // Delete minimum size in columns.
872  SvxBoxInfoItem aBoxInfo(aSet.Get(SID_ATTR_BORDER_INNER));
873  const SvxBoxItem& rBox = aSet.Get(RES_BOX);
874  aBoxInfo.SetMinDist(false);
875  aBoxInfo.SetDefDist(rBox.GetDistance(SvxBoxItemLine::LEFT));
876  aSet.Put(aBoxInfo);
877 
878  return aSet;
879 }
880 
882 {
883  const SfxItemSet *pArgs = rReq.GetArgs();
884  const SfxPoolItem* pItem = nullptr;
885  if( pArgs )
886  pArgs->GetItemState(GetPool().GetWhich(SID_CHARMAP), false, &pItem);
887 
888  OUString aChars, aFontName;
889  if ( pItem )
890  {
891  aChars = static_cast<const SfxStringItem*>(pItem)->GetValue();
892  const SfxPoolItem* pFtItem = nullptr;
893  pArgs->GetItemState( GetPool().GetWhich(SID_ATTR_SPECIALCHAR), false, &pFtItem);
894  const SfxStringItem* pFontItem = dynamic_cast<const SfxStringItem*>( pFtItem );
895  if ( pFontItem )
896  aFontName = pFontItem->GetValue();
897  }
898 
899  SwWrtShell &rSh = GetShell();
903  rSh.GetCurAttr( aSet );
904  SvtScriptType nScript = rSh.GetScriptType();
905 
906  std::shared_ptr<SvxFontItem> aFont(std::make_shared<SvxFontItem>(RES_CHRATR_FONT));
907  {
908  SvxScriptSetItem aSetItem( SID_ATTR_CHAR_FONT, *aSet.GetPool() );
909  aSetItem.GetItemSet().Put( aSet, false );
910  const SfxPoolItem* pI = aSetItem.GetItemOfScript( nScript );
911  if( pI )
912  {
913  aFont.reset(static_cast<SvxFontItem*>(pI->Clone()));
914  }
915  else
916  {
917  aFont.reset(static_cast<SvxFontItem*>(
918  aSet.Get(
922  }
923 
924  if (aFontName.isEmpty())
925  aFontName = aFont->GetFamilyName();
926  }
927 
928  vcl::Font aNewFont(aFontName, Size(1,1)); // Size only because CTOR.
929  if( aChars.isEmpty() )
930  {
931  // Set selected font as default.
932  SfxAllItemSet aAllSet( rSh.GetAttrPool() );
933  aAllSet.Put( SfxBoolItem( FN_PARAM_1, false ) );
934 
935  SwViewOption aOpt(*GetShell().GetViewOptions());
936  const OUString& sSymbolFont = aOpt.GetSymbolFont();
937  if( aFontName.isEmpty() && !sSymbolFont.isEmpty() )
938  aAllSet.Put( SfxStringItem( SID_FONT_NAME, sSymbolFont ) );
939  else
940  aAllSet.Put( SfxStringItem( SID_FONT_NAME, aFont->GetFamilyName() ) );
941 
945  pDlg->Execute();
946  return;
947  }
948 
949  if( aChars.isEmpty() )
950  return;
951 
952  rSh.StartAllAction();
953 
954  // Delete selected content.
955  SwRewriter aRewriter;
956  aRewriter.AddRule(UndoArg1, SwResId(STR_SPECIALCHAR));
957 
958  rSh.StartUndo( SwUndoId::INSERT, &aRewriter );
959  if ( rSh.HasSelection() )
960  {
961  rSh.DelRight();
962  aSet.ClearItem();
963  rSh.GetCurAttr( aSet );
964 
965  SvxScriptSetItem aSetItem( SID_ATTR_CHAR_FONT, *aSet.GetPool() );
966  aSetItem.GetItemSet().Put( aSet, false );
967  const SfxPoolItem* pI = aSetItem.GetItemOfScript( nScript );
968  if( pI )
969  {
970  aFont.reset(static_cast<SvxFontItem*>(pI->Clone()));
971  }
972  else
973  {
974  aFont.reset(static_cast<SvxFontItem*>(aSet.Get( GetWhichOfScript(
977  }
978  }
979 
980  // Insert character.
981  rSh.Insert( aChars );
982 
983  // #108876# a font attribute has to be set always due to a guessed script type
984  if( !aNewFont.GetFamilyName().isEmpty() )
985  {
986  std::unique_ptr<SvxFontItem> aNewFontItem(aFont->Clone());
987  aNewFontItem->SetFamilyName( aNewFont.GetFamilyName() );
988  aNewFontItem->SetFamily( aNewFont.GetFamilyType());
989  aNewFontItem->SetPitch( aNewFont.GetPitch());
990  aNewFontItem->SetCharSet( aNewFont.GetCharSet() );
991 
995 
996  nScript = g_pBreakIt->GetAllScriptsOfText( aChars );
997  if( SvtScriptType::LATIN & nScript )
998  {
999  aRestoreSet.Put( aSet.Get( RES_CHRATR_FONT ) );
1000  aNewFontItem->SetWhich(RES_CHRATR_FONT);
1001  aSet.Put( *aNewFontItem );
1002  }
1003  if( SvtScriptType::ASIAN & nScript )
1004  {
1005  aRestoreSet.Put( aSet.Get( RES_CHRATR_CJK_FONT ) );
1006  aNewFontItem->SetWhich(RES_CHRATR_CJK_FONT);
1007  aSet.Put( *aNewFontItem );
1008  }
1009  if( SvtScriptType::COMPLEX & nScript )
1010  {
1011  aRestoreSet.Put( aSet.Get( RES_CHRATR_CTL_FONT ) );
1012  aNewFontItem->SetWhich(RES_CHRATR_CTL_FONT);
1013  aSet.Put( *aNewFontItem );
1014  }
1015 
1016  rSh.SetMark();
1017  rSh.ExtendSelection( false, aChars.getLength() );
1019  if( !rSh.IsCursorPtAtEnd() )
1020  rSh.SwapPam();
1021 
1022  rSh.ClearMark();
1023 
1024  // #i75891#
1025  // SETATTR_DONTEXPAND does not work if there are already hard attributes.
1026  // Therefore we have to restore the font attributes.
1027  rSh.SetMark();
1028  rSh.SetAttrSet( aRestoreSet );
1029  rSh.ClearMark();
1030 
1031  rSh.UpdateAttr();
1032 
1033  // Why was this done? aFont is not used anymore below, we are not
1034  // in a loop and it's a local variable...?
1035  // aFont = aNewFontItem;
1036  }
1037 
1038  rSh.EndAllAction();
1039  rSh.EndUndo();
1040 
1041  if ( !aChars.isEmpty() )
1042  {
1043  rReq.AppendItem( SfxStringItem( GetPool().GetWhich(SID_CHARMAP), aChars ) );
1044  rReq.AppendItem( SfxStringItem( SID_ATTR_SPECIALCHAR, aNewFont.GetFamilyName() ) );
1045  rReq.Done();
1046  }
1047 }
1048 
1049 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void InsertLineBreak()
Definition: wrtsh1.cxx:919
OString stripEnd(const OString &rIn, char c)
void SetMacro(HyperDialogEvent nEvent, const SvxMacro &rMacro)
void SetURL(const OUString &rURL)
SfxViewFrame * GetViewFrame() const
css::uno::Reference< css::embed::XEmbeddedObject > CreateEmbeddedObject(const css::uno::Sequence< sal_Int8 > &, OUString &, OUString const *pBaseURL=nullptr)
bool IsInClickToEdit() const
Definition: wrtsh.hxx:642
const css::uno::Reference< css::embed::XEmbeddedObject > & GetObject() const
FieldUnit
void SplitNode(bool bAutoFormat=false)
Definition: wrtsh1.cxx:995
#define FN_FORMAT_COLUMN
Definition: cmdid.h:316
bool InsertMediaDlg(SfxRequest const &)
Definition: grfshex.cxx:40
static SvxAutoCorrCfg & Get()
void InsertByWord(const OUString &)
Definition: wrtsh1.cxx:170
bool IsAutoCorrFlag(ACFlags nFlag) const
constexpr TypedWhichId< SvxFontItem > RES_CHRATR_CTL_FONT(27)
SwView & GetView()
Definition: basesh.hxx:57
const OUString & GetFamilyName() const
constexpr sal_uInt16 KEY_MOD1
const SwPageDesc * GetSelectedPageDescs() const
if inside all selection only one PageDesc,
Definition: fedesc.cxx:184
#define SFX_IMPL_INTERFACE(Class, SuperClass)
void AutoCaption(const sal_uInt16 nType, const SvGlobalName *pOleId=nullptr)
Definition: viewdlg2.cxx:179
static SfxInterface * GetStaticInterface()
void InsertObject( const svt::EmbeddedObjectRef &, SvGlobalName const *pName, sal_uInt16 nSlotId=0)
Definition: wrtsh1.cxx:368
void ExecInsert(SfxRequest &)
Definition: textsh.cxx:129
#define FN_DELETE_SENT
Definition: cmdid.h:660
void setWidth(tools::Long nWidth)
#define CHAR_NNBSP
Definition: swtypes.hxx:171
SwView * GetActiveView()
Definition: swmodul1.cxx:116
#define FN_DELETE_BACK_SENT
Definition: cmdid.h:661
void DelToStartOfPara()
Definition: delete.cxx:520
std::string GetValue
Point LogicToLogic(const Point &rPtSource, const MapMode *pMapModeSource, const MapMode *pMapModeDest) const
void DelNxtWord()
Definition: delete.cxx:584
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const =0
bool IsTableMode() const
Definition: crsrsh.hxx:643
SwWrtShell * GetShellPtr()
Definition: basesh.cxx:2692
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:89
SwWrtShell & GetShell()
Definition: basesh.cxx:2687
#define SO3_IFRAME_CLASSID
static SvxAbstractDialogFactory * Create()
void RegisterObjectBar(sal_uInt16, SfxVisibilityFlags nFlags, ToolbarId eId)
Size GetObjSize() const
Definition: feshview.cxx:2293
Reference< XFrame > xFrame
#define MINLAY
Definition: swtypes.hxx:66
void StopQuickHelp()
Definition: edtwin.cxx:5991
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:1722
const wchar_t *typedef int(__stdcall *DllNativeUnregProc)(int
void SetIntName(const OUString &rIntName)
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:232
#define CHAR_HARDBLANK
Definition: swtypes.hxx:164
#define FN_INSERT_AUTH_ENTRY_DLG
Definition: cmdid.h:282
#define FN_DELETE_WHOLE_LINE
Definition: cmdid.h:668
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:186
void EnterStdMode()
Definition: select.cxx:550
SwEditWin & GetEditWin()
Definition: view.hxx:401
void DestroyCursor()
transform TableCursor to normal cursor, nullify Tablemode
Definition: crsrsh.cxx:146
void Done(bool bRemove=false)
const SvGlobalName & GetValue() const
const SvxMacro * GetMacro(SvMacroItemId nEvent) const
Definition: fmtatr2.cxx:251
#define FN_INSERT_COLUMN_BREAK
Definition: cmdid.h:197
Of course Writer needs its own rectangles.
Definition: swrect.hxx:35
#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:209
bool InsertOleObject(const svt::EmbeddedObjectRef &xObj, SwFlyFrameFormat **pFlyFrameFormat=nullptr)
Definition: wrtsh1.cxx:472
RndStdIds GetAnchor() const
Definition: frmmgr.hxx:167
void ExecTransliteration(SfxRequest const &)
Definition: textsh.cxx:775
void DelToEndOfLine()
Definition: delete.cxx:122
void EndAllAction()
Definition: edws.cxx:97
#define FN_INSERT_FRAME_INTERACT
Definition: cmdid.h:216
void InsertHyperlink(const SvxHyperlinkItem &rHlnkItem)
Definition: textfld.cxx:972
RotateTransliteration m_aRotateCase
Definition: textsh.hxx:35
constexpr TypedWhichId< SvxFontItem > RES_CHRATR_FONT(7)
#define CHAR_RLM
Definition: swtypes.hxx:167
Point GetPos() const
Definition: frmmgr.hxx:163
FontFamily GetFamilyType()
sal_uInt16 NextWhich()
bool DelRight()
Definition: delete.cxx:292
SwWrtShell & GetWrtShell() const
Definition: view.hxx:398
IDocumentDrawModelAccess const & getIDocumentDrawModelAccess() const
Definition: doc.cxx:155
const SwSection * GetCurrSection() const
Definition: edsect.cxx:70
#define CHAR_SOFTHYPHEN
Definition: swtypes.hxx:166
void SwapPam()
Definition: crsrsh.cxx:974
#define FN_DELETE_BACK_WORD
Definition: cmdid.h:663
Used by the UI to modify the document model.
Definition: wrtsh.hxx:90
bool SelectHiddenRange()
If the current cursor position is inside a hidden range, the hidden range is selected.
Definition: crsrsh.cxx:3412
sal_uInt16 sal_Unicode
const OUString & GetValue() const
Definition: fmtinfmt.hxx:75
void SetTargetFrame(const OUString &rTarget)
#define FN_DELETE_WORD
Definition: cmdid.h:662
ScrollingMode
static bool lcl_IsMarkInSameSection(SwWrtShell &rWrtSh, const SwSection *pSect)
Definition: textsh.cxx:541
bool IsAutoFormatByInput() const
IMPL_STATIC_LINK(SwTextShell, DialogClosedHdl, css::ui::dialogs::DialogClosedEvent *, pEvent, void)
Definition: textsh.cxx:96
const OUString & GetName() const
Definition: format.hxx:111
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:881
void Width(tools::Long nNew)
Definition: swrect.hxx:187
const SfxItemSet & GetAttrSet() const
Definition: frmmgr.hxx:124
SwDoc * GetDoc() const
Definition: viewsh.hxx:281
static void InitInterface_Impl()
SfxInterface initializer.
Definition: textsh.cxx:114
void RegisterChildWindow(sal_uInt16, bool bContext=false)
SfxObjectCreateMode GetCreateMode() const
#define HTML_CFG_WRITER
void Insert(SwField const &, SwPaM *pAnnotationRange=nullptr)
Definition: wrtsh2.cxx:61
#define FN_DELETE_PARA
Definition: cmdid.h:666
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:2335
void InsertFlyFrame()
Definition: frmmgr.cxx:177
constexpr TypedWhichId< SwFormatINetFormat > RES_TXTATR_INETFMT(51)
SfxItemPool & GetPool() const
static SvxHtmlOptions & Get()
const OUString & GetName() const
Definition: fmtinfmt.hxx:80
weld::Window * GetFrameWeld(const SfxFrame *pFrame)
Definition: dialoghelp.cxx:20
const SfxItemPool & GetAttrPool() const
Definition: viewsh.hxx:611
bool IsMath() const
sal_uInt16 char * pName
virtual void ClearRedo()=0
Delete all Redo actions.
SvtScriptType
Style of a layout element.
Definition: frmfmt.hxx:57
Rect of current PrtArea of page.
SvtScriptType GetScriptType() const
returns the script type of the selection
Definition: edattr.cxx:672
bool HasSelection() const
Definition: wrtsh.hxx:141
#define SW_MOD()
Definition: swmodule.hxx:255
const SfxItemSet * GetParent() const
FontPitch GetPitch()
bool IsInsRegionAvailable() const
Definition: edsect.cxx:57
#define FN_DELETE_LINE
Definition: cmdid.h:664
SwPaM * CreateCursor()
delete the current cursor and make the following into the current
Definition: crsrsh.cxx:122
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
SW_DLLPUBLIC FieldUnit GetDfltMetric(bool bWeb)
Definition: uitool.cxx:686
#define FN_INSERT_TABLE
Definition: cmdid.h:214
SfxObjectCreateMode
#define FN_INSERT_IDX_ENTRY_DLG
Definition: cmdid.h:219
void EndAction(const bool bIdleEnd=false, const bool DoSetPosX=false)
Definition: crsrsh.cxx:238
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
void Push()
store a copy of the current cursor on the cursor stack
Definition: crsrsh.cxx:2236
sal_uInt16 GetFullSelectedSectionCount() const
Search inside the cursor selection for full selected sections.
Definition: edsect.cxx:246
SvxAutoCorrect * GetAutoCorrect()
sal_uInt16 GetGutterWidth(bool bMin=false) const
Definition: atrfrm.cxx:933
void StateInsert(SfxItemSet &)
Definition: textsh.cxx:549
SfxBindings & GetBindings()
bool HasMark() const
Definition: crsrsh.hxx:877
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:358
const OUString & GetValue() const
void ExecDelete(SfxRequest &)
Definition: textsh.cxx:730
HTMLMODE_ON
void DelLine()
Description: Erase the line.
Definition: delete.cxx:97
sal_uInt16 GetHtmlMode(const SwDocShell *pShell)
Definition: viewopt.cxx:337
SwTextShell(SwView &rView)
Definition: textsh.cxx:826
const T * GetArg(sal_uInt16 nSlotId) const
void SetAttrSet(const SfxItemSet &rSet)
Definition: frmmgr.cxx:607
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)
tools::Long Width() const
static sal_Int16 GetI18NScriptTypeOfLanguage(LanguageType nLang)
void DelToStartOfLine()
Definition: delete.cxx:114
void AddRule(SwUndoArg eWhat, const OUString &rWith)
Definition: SwRewriter.cxx:29
#define HTML_CFG_MSIE
sal_uInt16 GetWhichOfScript(sal_uInt16 nWhich, sal_uInt16 nScript)
Definition: hints.cxx:195
TransliterationFlags getNextMode()
HLINK_FIELD
void SetMark()
Definition: crsrsh.hxx:875
#define CHAR_ZWSP
Definition: swtypes.hxx:169
static SwAbstractDialogFactory * Create()
Definition: swabstdlg.cxx:36
#define FN_WORDCOUNT_DIALOG
Definition: cmdid.h:591
void LockPaint()
Definition: viewsh.hxx:601
virtual VclPtr< SfxAbstractDialog > CreateCharMapDialog(weld::Window *pParent, const SfxItemSet &rAttr, const css::uno::Reference< css::frame::XFrame > &rFrame)=0
OUString SwResId(const char *pId)
Definition: swmodule.cxx:165
void SetName(const OUString &rName)
void DelPrvWord()
Definition: delete.cxx:607
void SetName(const OUString &rName)
void PutAreaListItems(SfxItemSet &rSet) const
Put needed items for XPropertyList entries from the DrawModel.
Definition: drawdoc.cxx:127
OUString GetBoxNms() const
Definition: trvltbl.cxx:745
SwDocShell * GetDocShell()
Definition: view.cxx:1108
const css::uno::Reference< css::frame::XFrame > & GetFrameInterface() const
const OUString & GetSymbolFont() const
Definition: viewopt.hxx:564
SwFrameFormat * GetTableFormat()
Definition: edws.cxx:183
#define FN_GET_PRINT_AREA
Definition: cmdid.h:733
#define SFX_OBJECTBAR_OBJECT
#define FN_INSERT_STRING
Definition: cmdid.h:215
Rect of current page.
Point PixelToLogic(const Point &rDevicePt) const
void StartAction()
Definition: crsrsh.cxx:221
void SetParent(const SfxItemSet *pNew)
SelectionType
Definition: wrtsh.hxx:58
void SetReturnValue(const SfxPoolItem &)
bool DelToEndOfSentence()
Definition: delete.cxx:550
void InsertTable(SfxRequest &_rRequest)
Definition: basesh.cxx:2749
sal_uInt16 GetWishWidth() const
Definition: fmtclds.hxx:122
#define CHAR_LRM
Definition: swtypes.hxx:168
#define FN_DELETE_BACK_LINE
Definition: cmdid.h:665
constexpr sal_uInt16 RES_FRMATR_END(131)
IDocumentUndoRedo const & GetIDocumentUndoRedo() const
Provides access to the document undo/redo interface.
Definition: viewsh.cxx:2620
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
#define FN_INSERT_FRAME
Definition: cmdid.h:217
sal_uInt16 GetSlot() const
static const OUString & GetContextName(const Context eContext)
#define CHAR_HARDHYPHEN
Definition: swtypes.hxx:165
#define DEF_GUTTER_WIDTH
Definition: swtypes.hxx:69
void SetMacroEvents(const HyperDialogEvent nEvents)
const css::uno::Reference< css::frame::XDispatchRecorder > & GetRecorder() const
#define FN_INSERT_FIELD
Definition: cmdid.h:198
void DisableItem(sal_uInt16 nWhich)
#define MM50
Definition: swtypes.hxx:59
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) 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:667
#define GetWhich(nSlot)
#define FN_INSERT_FRAME_INTERACT_NOCOL
Definition: cmdid.h:220
bool IsCursorPtAtEnd() const
Definition: crsrsh.hxx:894
bool ExtendSelection(bool bEnd=true, sal_Int32 nCount=1)
extend current SSelection by n characters
Definition: crsrsh.cxx:2607
const o3tl::enumarray< SvxAdjust, unsigned short > aSvxToUnoAdjust USHRT_MAX
Definition: unosett.cxx:254
#define FN_SET_FRM_NAME
Definition: cmdid.h:852
OUString GetSelText() const
get selected text of a node at current cursor
Definition: crsrsh.cxx:2525
OUString aName
LanguageType GetAppLanguage()
Definition: init.cxx:728
RET_OK
constexpr TypedWhichId< SvxFontItem > RES_CHRATR_CJK_FONT(22)
tools::Long Height() const
size_t IsObjSelected() const
Definition: feshview.cxx:1149
#define FN_INSERT_SMA
Definition: cmdid.h:229
#define FN_INSERT_PAGEBREAK
Definition: cmdid.h:212
void ClearMark()
Definition: crsrsh.cxx:937
void InsertColumnBreak()
Definition: wrtsh1.cxx:939
bool GetCurAttr(SfxItemSet &, const bool bMergeIndentValuesOfNumRule=false) const
Definition: edattr.cxx:176
constexpr TypedWhichId< SvxBoxItem > RES_BOX(106)
#define CHAR_ZWNBSP
Definition: swtypes.hxx:170
void SetInsertMode(SvxLinkInsertMode eNew)
void AutoCorrect(SvxAutoCorrect &rACorr, sal_Unicode cChar)
Definition: wrtsh1.cxx:1636
void TransliterateText(TransliterationFlags nType)
Change text to Upper/Lower/Hiragana/Katakana/...
Definition: editsh.cxx:1047
void InsFrameMode(sal_uInt16 nCols)
Definition: view2.cxx:2000
SvxLinkInsertMode GetInsertMode() const
const SwFrameFormat * GetFlyFrameFormat() const
Get FlyFrameFormat; for UI macro linkage at Flys.
Definition: fefly1.cxx:1248
void AppendItem(const SfxPoolItem &)
sal_uInt16 GetExportMode() const
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:884
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:984
SelectionType GetSelectionType() const
Definition: wrtsh1.cxx:1402
void StartAllAction()
For all views of this document.
Definition: edws.cxx:86
void DelToEndOfPara()
Definition: delete.cxx:503
void Ignore()
void Height(tools::Long nNew)
Definition: swrect.hxx:191
bool DeleteRow(bool bCompleteTable=false)
Definition: fetab.cxx:313
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:97
bool IsFrameSelected() const
Definition: feshview.cxx:1157
rtl_TextEncoding GetCharSet() const
Definition: view.hxx:144
void DelToStartOfSentence()
Definition: delete.cxx:541
void UnlockPaint(bool bVirDev=false)
Definition: viewsh.hxx:606
bool IsSelFrameMode() const
Definition: wrtsh.hxx:170
bool IsChart() const
void LaunchOLEObj(tools::Long nVerb=0)
Definition: wrtsh1.cxx:614
bool CursorInsideInputField() const
Definition: crstrvl.cxx:925