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