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