LibreOffice Module sw (master)  1
drwtxtex.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 
21 #include <com/sun/star/linguistic2/XThesaurus.hpp>
22 
23 #include <comphelper/string.hxx>
24 #include <i18nlangtag/mslangid.hxx>
25 #include <sfx2/bindings.hxx>
26 #include <sfx2/dispatch.hxx>
27 #include <sfx2/request.hxx>
28 #include <svx/svdview.hxx>
29 #include <editeng/spltitem.hxx>
30 #include <editeng/lrspitem.hxx>
31 #include <editeng/ulspitem.hxx>
32 #include <editeng/orphitem.hxx>
34 #include <editeng/widwitem.hxx>
35 #include <editeng/kernitem.hxx>
37 #include <editeng/lspcitem.hxx>
38 #include <editeng/flstitem.hxx>
39 #include <editeng/adjustitem.hxx>
41 #include <editeng/shdditem.hxx>
42 #include <editeng/udlnitem.hxx>
43 #include <editeng/fontitem.hxx>
44 #include <editeng/fhgtitem.hxx>
45 #include <editeng/colritem.hxx>
46 #include <editeng/wghtitem.hxx>
47 #include <editeng/contouritem.hxx>
48 #include <editeng/postitem.hxx>
49 #include <editeng/frmdiritem.hxx>
51 #include <svx/svdoutl.hxx>
52 #include <sfx2/viewfrm.hxx>
53 #include <svl/stritem.hxx>
54 #include <svl/whiter.hxx>
55 #include <svl/cjkoptions.hxx>
56 #include <svl/ctloptions.hxx>
57 #include <svtools/langtab.hxx>
58 #include <svl/languageoptions.hxx>
59 #include <editeng/flditem.hxx>
60 #include <editeng/editstat.hxx>
61 #include <svx/clipfmtitem.hxx>
62 #include <svx/hlnkitem.hxx>
63 #include <svx/svxdlg.hxx>
64 #include <svx/svxids.hrc>
65 #include <sfx2/htmlmode.hxx>
66 #include <svl/slstitm.hxx>
67 #include <editeng/langitem.hxx>
68 #include <editeng/unolingu.hxx>
71 #include <editeng/eeitem.hxx>
72 #include <editeng/editeng.hxx>
73 #include <editeng/editdata.hxx>
74 #include <editeng/outliner.hxx>
75 #include <editeng/editview.hxx>
76 #include <vcl/outdev.hxx>
78 #include <tools/diagnose_ex.h>
79 
80 #include <cmdid.h>
81 #include <doc.hxx>
82 #include <docstat.hxx>
83 #include <drwtxtsh.hxx>
84 #include <edtwin.hxx>
85 #include <globals.hrc>
86 #include <hintids.hxx>
87 #include <initui.hxx>
88 #include <langhelper.hxx>
89 #include <chrdlgmodes.hxx>
90 #include <pardlg.hxx>
91 #include <string.h>
92 #include <swdtflvr.hxx>
93 #include <swmodule.hxx>
94 #include <swwait.hxx>
95 #include <uitool.hxx>
96 #include <viewopt.hxx>
97 #include <wrtsh.hxx>
98 #include <wview.hxx>
99 
100 #include <swabstdlg.hxx>
101 #include <memory>
102 
103 using namespace ::com::sun::star;
104 
106 {
107  SwWrtShell &rSh = GetShell();
109  SfxItemSet aEditAttr(pOLV->GetAttribs());
110  SfxItemSet aNewAttr(*aEditAttr.GetPool(), aEditAttr.GetRanges());
111 
112  const sal_uInt16 nSlot = rReq.GetSlot();
113 
114  const sal_uInt16 nWhich = GetPool().GetWhich(nSlot);
115  const SfxItemSet *pNewAttrs = rReq.GetArgs();
116 
117  bool bRestoreSelection = false;
118  ESelection aOldSelection;
119 
120  sal_uInt16 nEEWhich = 0;
121  switch (nSlot)
122  {
123  case SID_LANGUAGE_STATUS:
124  {
125  aOldSelection = pOLV->GetSelection();
126  if (!pOLV->GetEditView().HasSelection())
127  {
128  pOLV->GetEditView().SelectCurrentWord();
129  }
130 
131  bRestoreSelection = SwLangHelper::SetLanguageStatus(pOLV,rReq,GetView(),rSh);
132  break;
133  }
134 
135  case SID_THES:
136  {
137  OUString aReplaceText;
138  const SfxStringItem* pItem2 = rReq.GetArg<SfxStringItem>(SID_THES);
139  if (pItem2)
140  aReplaceText = pItem2->GetValue();
141  if (!aReplaceText.isEmpty())
142  ReplaceTextWithSynonym( pOLV->GetEditView(), aReplaceText );
143  break;
144  }
145 
146  case SID_ATTR_CHAR_FONT:
147  case SID_ATTR_CHAR_FONTHEIGHT:
148  case SID_ATTR_CHAR_WEIGHT:
149  case SID_ATTR_CHAR_POSTURE:
150  {
151  SfxItemPool* pPool2 = aEditAttr.GetPool()->GetSecondaryPool();
152  if( !pPool2 )
153  pPool2 = aEditAttr.GetPool();
154  SvxScriptSetItem aSetItem( nSlot, *pPool2 );
155 
156  // #i78017 establish the same behaviour as in Writer
157  SvtScriptType nScriptTypes = SvtScriptType::LATIN | SvtScriptType::ASIAN | SvtScriptType::COMPLEX;
158  if (nSlot == SID_ATTR_CHAR_FONT)
159  nScriptTypes = pOLV->GetSelectedScriptType();
160 
161  if (pNewAttrs)
162  {
163  aSetItem.PutItemForScriptType( nScriptTypes, pNewAttrs->Get( nWhich ) );
164  aNewAttr.Put( aSetItem.GetItemSet() );
165  }
166  }
167  break;
168 
169  case SID_ATTR_CHAR_COLOR: nEEWhich = EE_CHAR_COLOR; break;
170  case SID_ATTR_CHAR_BACK_COLOR: nEEWhich = EE_CHAR_BKGCOLOR; break;
171 
172  case SID_ATTR_CHAR_UNDERLINE:
173  {
174  if ( pNewAttrs )
175  {
176  const SvxTextLineItem& rTextLineItem = static_cast< const SvxTextLineItem& >( pNewAttrs->Get( pNewAttrs->GetPool()->GetWhich(nSlot) ) );
177  aNewAttr.Put( SvxUnderlineItem( rTextLineItem.GetLineStyle(), EE_CHAR_UNDERLINE ) );
178  }
179  else
180  {
181  FontLineStyle eFU = aEditAttr.Get(EE_CHAR_UNDERLINE).GetLineStyle();
183  }
184  }
185  break;
186 
187  case SID_ATTR_CHAR_OVERLINE:
188  {
189  FontLineStyle eFO = aEditAttr.Get(EE_CHAR_OVERLINE).GetLineStyle();
191  }
192  break;
193 
194  case SID_ATTR_CHAR_CONTOUR: nEEWhich = EE_CHAR_OUTLINE; break;
195  case SID_ATTR_CHAR_SHADOWED: nEEWhich = EE_CHAR_SHADOW; break;
196  case SID_ATTR_CHAR_STRIKEOUT: nEEWhich = EE_CHAR_STRIKEOUT; break;
197  case SID_ATTR_CHAR_WORDLINEMODE: nEEWhich = EE_CHAR_WLM; break;
198  case SID_ATTR_CHAR_RELIEF : nEEWhich = EE_CHAR_RELIEF; break;
199  case SID_ATTR_CHAR_LANGUAGE : nEEWhich = EE_CHAR_LANGUAGE;break;
200  case SID_ATTR_CHAR_KERNING : nEEWhich = EE_CHAR_KERNING; break;
201  case SID_ATTR_CHAR_SCALEWIDTH: nEEWhich = EE_CHAR_FONTWIDTH; break;
202  case SID_ATTR_CHAR_AUTOKERN : nEEWhich = EE_CHAR_PAIRKERNING; break;
203  case SID_ATTR_CHAR_ESCAPEMENT: nEEWhich = EE_CHAR_ESCAPEMENT; break;
204  case SID_ATTR_PARA_ADJUST_LEFT:
205  aNewAttr.Put(SvxAdjustItem(SvxAdjust::Left, EE_PARA_JUST));
206  break;
207  case SID_ATTR_PARA_ADJUST_CENTER:
208  aNewAttr.Put(SvxAdjustItem(SvxAdjust::Center, EE_PARA_JUST));
209  break;
210  case SID_ATTR_PARA_ADJUST_RIGHT:
211  aNewAttr.Put(SvxAdjustItem(SvxAdjust::Right, EE_PARA_JUST));
212  break;
213  case SID_ATTR_PARA_ADJUST_BLOCK:
214  aNewAttr.Put(SvxAdjustItem(SvxAdjust::Block, EE_PARA_JUST));
215  break;
216  case SID_ATTR_PARA_LRSPACE:
217  {
218  SvxLRSpaceItem aParaMargin(static_cast<const SvxLRSpaceItem&>(rReq.
219  GetArgs()->Get(nSlot)));
220  aParaMargin.SetWhich( EE_PARA_LRSPACE );
221  aNewAttr.Put(aParaMargin);
222  rReq.Done();
223  }
224  break;
225  case SID_HANGING_INDENT:
226  {
227  SfxItemState eState = aEditAttr.GetItemState( EE_PARA_LRSPACE );
228  if( eState >= SfxItemState::DEFAULT )
229  {
230  SvxLRSpaceItem aParaMargin = aEditAttr.Get( EE_PARA_LRSPACE );
231  aParaMargin.SetWhich( EE_PARA_LRSPACE );
232  short int nFirstLineOffset = aParaMargin.GetTextFirstLineOfst();
233  aParaMargin.SetTextLeft( aParaMargin.GetTextLeft() + nFirstLineOffset );
234  aParaMargin.SetRight( aParaMargin.GetRight() );
235  aParaMargin.SetTextFirstLineOfst( nFirstLineOffset * -1 );
236  aNewAttr.Put(aParaMargin);
237  rReq.Done();
238  }
239  }
240  break;
241  case SID_ATTR_PARA_LINESPACE:
242  {
243  SvxLineSpacingItem aLineSpace = static_cast<const SvxLineSpacingItem&>(pNewAttrs->Get(
244  GetPool().GetWhich(nSlot)));
245  aLineSpace.SetWhich( EE_PARA_SBL );
246  aNewAttr.Put( aLineSpace );
247  rReq.Done();
248  }
249  break;
250  case SID_ATTR_PARA_ULSPACE:
251  {
252  SvxULSpaceItem aULSpace = static_cast<const SvxULSpaceItem&>(pNewAttrs->Get(
253  GetPool().GetWhich(nSlot)));
254  aULSpace.SetWhich( EE_PARA_ULSPACE );
255  aNewAttr.Put( aULSpace );
256  rReq.Done();
257  }
258  break;
259  case SID_PARASPACE_INCREASE:
260  case SID_PARASPACE_DECREASE:
261  {
262  SvxULSpaceItem aULSpace( aEditAttr.Get( EE_PARA_ULSPACE ) );
263  sal_uInt16 nUpper = aULSpace.GetUpper();
264  sal_uInt16 nLower = aULSpace.GetLower();
265 
266  if ( nSlot == SID_PARASPACE_INCREASE )
267  {
268  nUpper = std::min< sal_uInt16 >( nUpper + 57, 5670 );
269  nLower = std::min< sal_uInt16 >( nLower + 57, 5670 );
270  }
271  else
272  {
273  nUpper = std::max< sal_Int16 >( nUpper - 57, 0 );
274  nLower = std::max< sal_Int16 >( nLower - 57, 0 );
275  }
276 
277  aULSpace.SetUpper( nUpper );
278  aULSpace.SetLower( nLower );
279  aNewAttr.Put( aULSpace );
280  rReq.Done();
281  }
282  break;
283  case SID_ATTR_PARA_LINESPACE_10:
284  {
286  aItem.SetPropLineSpace(100);
287  aNewAttr.Put(aItem);
288  }
289  break;
290  case SID_ATTR_PARA_LINESPACE_15:
291  {
293  aItem.SetPropLineSpace(150);
294  aNewAttr.Put(aItem);
295  }
296  break;
297  case SID_ATTR_PARA_LINESPACE_20:
298  {
300  aItem.SetPropLineSpace(200);
301  aNewAttr.Put(aItem);
302  }
303  break;
304 
305  case FN_SET_SUPER_SCRIPT:
306  {
308  SvxEscapement eEsc = static_cast<SvxEscapement>(aEditAttr.Get( EE_CHAR_ESCAPEMENT ).GetEnumValue());
309 
310  if( eEsc == SvxEscapement::Superscript )
311  aItem.SetEscapement( SvxEscapement::Off );
312  else
313  aItem.SetEscapement( SvxEscapement::Superscript );
314  aNewAttr.Put( aItem );
315  }
316  break;
317  case FN_SET_SUB_SCRIPT:
318  {
320  SvxEscapement eEsc = static_cast<SvxEscapement>(aEditAttr.Get( EE_CHAR_ESCAPEMENT ).GetEnumValue());
321 
322  if( eEsc == SvxEscapement::Subscript )
323  aItem.SetEscapement( SvxEscapement::Off );
324  else
325  aItem.SetEscapement( SvxEscapement::Subscript );
326  aNewAttr.Put( aItem );
327  }
328  break;
329 
330  case SID_CHAR_DLG_EFFECT:
331  case SID_CHAR_DLG:
332  case SID_CHAR_DLG_FOR_PARAGRAPH:
333  {
334  const SfxItemSet* pArgs = rReq.GetArgs();
335  const SfxStringItem* pItem = rReq.GetArg<SfxStringItem>(FN_PARAM_1);
336 
337  if( !pArgs || pItem )
338  {
339  aOldSelection = pOLV->GetSelection();
340  if (nSlot == SID_CHAR_DLG_FOR_PARAGRAPH)
341  {
342  // select current paragraph (and restore selection later on...)
343  EditView & rEditView = pOLV->GetEditView();
344  SwLangHelper::SelectPara( rEditView, rEditView.GetSelection() );
345  bRestoreSelection = true;
346  }
347 
348  SwView* pView = &GetView();
349  FieldUnit eMetric = ::GetDfltMetric(dynamic_cast<SwWebView*>( pView) != nullptr );
350  SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast< sal_uInt16 >(eMetric)) );
352 
353  // util::Language does not exists in the EditEngine! That is why not in set.
354 
355  aDlgAttr.Put( aEditAttr );
356  aDlgAttr.Put( SvxKerningItem(0, RES_CHRATR_KERNING) );
357 
360  if (nSlot == SID_CHAR_DLG_EFFECT)
361  {
362  pDlg->SetCurPageId("fonteffects");
363  }
364  else if (nSlot == SID_CHAR_DLG_FOR_PARAGRAPH)
365  {
366  pDlg->SetCurPageId("font");
367  }
368  else if (pItem)
369  {
370  pDlg->SetCurPageId(OUStringToOString(pItem->GetValue(), RTL_TEXTENCODING_UTF8));
371  }
372 
373  sal_uInt16 nRet = pDlg->Execute();
374  if(RET_OK == nRet )
375  {
376  rReq.Done( *( pDlg->GetOutputItemSet() ) );
377  aNewAttr.Put(*pDlg->GetOutputItemSet());
378  }
379  if(RET_OK != nRet)
380  return ;
381  }
382  else
383  aNewAttr.Put(*pArgs);
384  }
385  break;
387  {
389  break;
390  }
392  {
394  rReq.Done();
395  }
396  break;
397  case SID_OPEN_XML_FILTERSETTINGS:
398  {
400  }
401  break;
402  case FN_WORDCOUNT_DIALOG:
403  {
404  GetView().UpdateWordCount(this, nSlot);
405  }
406  break;
407  case SID_PARA_DLG:
408  {
409  const SfxItemSet* pArgs = rReq.GetArgs();
410 
411  if (!pArgs)
412  {
413  SwView* pView = &GetView();
414  FieldUnit eMetric = ::GetDfltMetric(dynamic_cast<SwWebView*>( pView) != nullptr );
415  SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast< sal_uInt16 >(eMetric)) );
416  SfxItemSet aDlgAttr(
417  GetPool(),
418  svl::Items<
420  SID_ATTR_PARA_HYPHENZONE, SID_ATTR_PARA_WIDOWS>{});
421 
422  aDlgAttr.Put(aEditAttr);
423 
424  aDlgAttr.Put( SvxHyphenZoneItem( false, RES_PARATR_HYPHENZONE) );
425  aDlgAttr.Put( SvxFormatBreakItem( SvxBreak::NONE, RES_BREAK ) );
426  aDlgAttr.Put( SvxFormatSplitItem( true, RES_PARATR_SPLIT ) );
427  aDlgAttr.Put( SvxWidowsItem( 0, RES_PARATR_WIDOWS ) );
428  aDlgAttr.Put( SvxOrphansItem( 0, RES_PARATR_ORPHANS ) );
429 
432  sal_uInt16 nRet = pDlg->Execute();
433  if(RET_OK == nRet)
434  {
435  rReq.Done( *( pDlg->GetOutputItemSet() ) );
436  aNewAttr.Put(*pDlg->GetOutputItemSet());
437  }
438  if(RET_OK != nRet)
439  return;
440  }
441  else
442  aNewAttr.Put(*pArgs);
443  }
444  break;
445  case SID_AUTOSPELL_CHECK:
446  {
449  SdrOutliner * pOutliner = pSdrView->GetTextEditOutliner();
450  EEControlBits nCtrl = pOutliner->GetControlWord();
451 
452  bool bSet = static_cast<const SfxBoolItem&>(rReq.GetArgs()->Get(
453  nSlot)).GetValue();
454  if(bSet)
455  nCtrl |= EEControlBits::ONLINESPELLING|EEControlBits::ALLOWBIGOBJS;
456  else
457  nCtrl &= ~EEControlBits::ONLINESPELLING;
458  pOutliner->SetControlWord(nCtrl);
459 
460  rView.ExecuteSlot(rReq);
461  }
462  break;
463  case SID_HYPERLINK_SETLINK:
464  {
465  const SfxPoolItem* pItem = nullptr;
466  if(pNewAttrs)
467  pNewAttrs->GetItemState(nSlot, false, &pItem);
468 
469  if(pItem)
470  {
471  const SvxHyperlinkItem& rHLinkItem = *static_cast<const SvxHyperlinkItem *>(pItem);
472  SvxURLField aField(rHLinkItem.GetURL(), rHLinkItem.GetName(), SvxURLFormat::AppDefault);
473  aField.SetTargetFrame(rHLinkItem.GetTargetFrame());
474 
475  const SvxFieldItem* pFieldItem = pOLV->GetFieldAtSelection();
476 
477  if (pFieldItem && dynamic_cast< const SvxURLField *>( pFieldItem->GetField() ) != nullptr )
478  {
479  // Select field so that it will be deleted during insert
480  ESelection aSel = pOLV->GetSelection();
481  aSel.nEndPos++;
482  pOLV->SetSelection(aSel);
483  }
484  pOLV->InsertField(SvxFieldItem(aField, EE_FEATURE_FIELD));
485  }
486  }
487  break;
488 
489  case SID_EDIT_HYPERLINK:
490  {
491  // Ensure the field is selected first
492  pOLV->GetFieldAtCursor();
493  GetView().GetViewFrame()->GetDispatcher()->Execute(SID_HYPERLINK_DIALOG);
494  }
495  break;
496 
497  case SID_REMOVE_HYPERLINK:
498  {
500  pOLV);
501  }
502  break;
503 
504  case SID_TEXTDIRECTION_LEFT_TO_RIGHT:
505  case SID_TEXTDIRECTION_TOP_TO_BOTTOM:
506  // Shell switch!
507  {
509  SdrPageView* pTmpPV = pSdrView->GetSdrPageView();
510  SdrView* pTmpView = pSdrView;
511 
512  pSdrView->SdrEndTextEdit(true);
513 
514  SfxItemSet aAttr( *aNewAttr.GetPool(),
516  SDRATTR_TEXTDIRECTION>{} );
517 
518  aAttr.Put( SvxWritingModeItem(
519  nSlot == SID_TEXTDIRECTION_LEFT_TO_RIGHT ?
520  text::WritingMode_LR_TB
521  : text::WritingMode_TB_RL, SDRATTR_TEXTDIRECTION ) );
522  pTmpView->SetAttributes( aAttr );
523 
524  rSh.GetView().BeginTextEdit( pTmpObj, pTmpPV, &rSh.GetView().GetEditWin());
525  rSh.GetView().AttrChangedNotify( &rSh );
526  }
527  return;
528 
529  case SID_ATTR_PARA_LEFT_TO_RIGHT:
530  case SID_ATTR_PARA_RIGHT_TO_LEFT:
531  {
533  SdrPageView* pTmpPV = pSdrView->GetSdrPageView();
534  SdrView* pTmpView = pSdrView;
535 
536  pSdrView->SdrEndTextEdit(true);
537  bool bLeftToRight = nSlot == SID_ATTR_PARA_LEFT_TO_RIGHT;
538 
539  const SfxPoolItem* pPoolItem;
540  if( pNewAttrs && SfxItemState::SET == pNewAttrs->GetItemState( nSlot, true, &pPoolItem ) )
541  {
542  if( !static_cast<const SfxBoolItem*>(pPoolItem)->GetValue() )
543  bLeftToRight = !bLeftToRight;
544  }
545  SfxItemSet aAttr(
546  *aNewAttr.GetPool(),
547  svl::Items<
548  EE_PARA_WRITINGDIR, EE_PARA_WRITINGDIR,
549  EE_PARA_JUST, EE_PARA_JUST>{});
550 
551  SvxAdjust nAdjust = SvxAdjust::Left;
552  if( SfxItemState::SET == aEditAttr.GetItemState(EE_PARA_JUST, true, &pPoolItem ) )
553  nAdjust = static_cast<const SvxAdjustItem*>(pPoolItem)->GetAdjust();
554 
555  if( bLeftToRight )
556  {
557  aAttr.Put( SvxFrameDirectionItem( SvxFrameDirection::Horizontal_LR_TB, EE_PARA_WRITINGDIR ) );
558  if( nAdjust == SvxAdjust::Right )
559  aAttr.Put( SvxAdjustItem( SvxAdjust::Left, EE_PARA_JUST ) );
560  }
561  else
562  {
563  aAttr.Put( SvxFrameDirectionItem( SvxFrameDirection::Horizontal_RL_TB, EE_PARA_WRITINGDIR ) );
564  if( nAdjust == SvxAdjust::Left )
565  aAttr.Put( SvxAdjustItem( SvxAdjust::Right, EE_PARA_JUST ) );
566  }
567  pTmpView->SetAttributes( aAttr );
568  rSh.GetView().BeginTextEdit( pTmpObj, pTmpPV, &rSh.GetView().GetEditWin() );
569  rSh.GetView().AttrChangedNotify( &rSh );
570  }
571  return;
572 
573  case FN_GROW_FONT_SIZE:
574  case FN_SHRINK_FONT_SIZE:
575  {
576  const SvxFontListItem* pFontListItem = static_cast< const SvxFontListItem* >
577  ( SfxObjectShell::Current()->GetItem( SID_ATTR_CHAR_FONTLIST ) );
578  const FontList* pFontList = pFontListItem ? pFontListItem->GetFontList() : nullptr;
579  pOLV->GetEditView().ChangeFontSize( nSlot == FN_GROW_FONT_SIZE, pFontList );
580  }
581  break;
582 
583  default:
584  assert(false && "wrong dispatcher");
585  return;
586  }
587  if(nEEWhich && pNewAttrs)
588  {
589  aNewAttr.Put(pNewAttrs->Get(nWhich).CloneSetWhich(nEEWhich));
590  }
591 
592  SetAttrToMarked(aNewAttr);
593 
595 
596  if (IsTextEdit() && pOLV->GetOutliner()->IsModified())
597  rSh.SetModified();
598 
599  if (bRestoreSelection)
600  {
601  // restore selection
602  pOLV->GetEditView().SetSelection( aOldSelection );
603  }
604 }
605 
607 {
608  if (!IsTextEdit()) // Otherwise sometimes crash!
609  return;
610 
612  SfxWhichIter aIter(rSet);
613  sal_uInt16 nWhich = aIter.FirstWhich();
614 
615  SfxItemSet aEditAttr(pOLV->GetAttribs());
616  const SfxPoolItem *pAdjust = nullptr, *pLSpace = nullptr, *pEscItem = nullptr;
617  SvxAdjust eAdjust;
618  int nLSpace;
619  SvxEscapement nEsc;
620 
621  while (nWhich)
622  {
623  sal_uInt16 nSlotId = GetPool().GetSlotId(nWhich);
624  bool bFlag = false;
625  switch (nSlotId)
626  {
627  case SID_LANGUAGE_STATUS: //20412:
628  {
630  nSlotId = 0;
631  break;
632  }
633 
634  case SID_THES:
635  {
636  OUString aStatusVal;
638  bool bIsLookUpWord
639  = GetStatusValueForThesaurusFromContext(aStatusVal, nLang, pOLV->GetEditView());
640  rSet.Put(SfxStringItem(SID_THES, aStatusVal));
641 
642  // disable "Thesaurus" context menu entry if there is nothing to look up
643  uno::Reference<linguistic2::XThesaurus> xThes(::GetThesaurus());
644  if (!bIsLookUpWord || !xThes.is() || nLang == LANGUAGE_NONE
645  || !xThes->hasLocale(LanguageTag::convertToLocale(nLang)))
646  rSet.DisableItem(SID_THES);
647 
649  nSlotId = 0;
650  break;
651  }
652 
653  case SID_ATTR_PARA_ADJUST_LEFT:
654  eAdjust = SvxAdjust::Left;
655  goto ASK_ADJUST;
656  case SID_ATTR_PARA_ADJUST_RIGHT:
657  eAdjust = SvxAdjust::Right;
658  goto ASK_ADJUST;
659  case SID_ATTR_PARA_ADJUST_CENTER:
660  eAdjust = SvxAdjust::Center;
661  goto ASK_ADJUST;
662  case SID_ATTR_PARA_ADJUST_BLOCK:
663  eAdjust = SvxAdjust::Block;
664  goto ASK_ADJUST;
665  ASK_ADJUST:
666  {
667  if (!pAdjust)
668  aEditAttr.GetItemState(EE_PARA_JUST, false, &pAdjust);
669 
670  if (!pAdjust || IsInvalidItem(pAdjust))
671  {
672  rSet.InvalidateItem(nSlotId);
673  nSlotId = 0;
674  }
675  else
676  bFlag = eAdjust == static_cast<const SvxAdjustItem*>(pAdjust)->GetAdjust();
677  }
678  break;
679 
680  case SID_ATTR_PARA_LRSPACE:
681  case SID_ATTR_PARA_LEFTSPACE:
682  case SID_ATTR_PARA_RIGHTSPACE:
683  case SID_ATTR_PARA_FIRSTLINESPACE:
684  {
685  SfxItemState eState = aEditAttr.GetItemState(EE_PARA_LRSPACE);
686  if (eState >= SfxItemState::DEFAULT)
687  {
688  SvxLRSpaceItem aLR = aEditAttr.Get(EE_PARA_LRSPACE);
689  aLR.SetWhich(SID_ATTR_PARA_LRSPACE);
690  rSet.Put(aLR);
691  }
692  else
693  rSet.InvalidateItem(nSlotId);
694  nSlotId = 0;
695  }
696  break;
697  case SID_ATTR_PARA_LINESPACE:
698  {
699  SfxItemState eState = aEditAttr.GetItemState(EE_PARA_SBL);
700  if (eState >= SfxItemState::DEFAULT)
701  {
702  const SvxLineSpacingItem& aLR = aEditAttr.Get(EE_PARA_SBL);
703  rSet.Put(aLR);
704  }
705  else
706  rSet.InvalidateItem(nSlotId);
707  nSlotId = 0;
708  }
709  break;
710  case SID_ATTR_PARA_ULSPACE:
711  case SID_ATTR_PARA_BELOWSPACE:
712  case SID_ATTR_PARA_ABOVESPACE:
713  case SID_PARASPACE_INCREASE:
714  case SID_PARASPACE_DECREASE:
715  {
716  SfxItemState eState = aEditAttr.GetItemState(EE_PARA_ULSPACE);
717  if (eState >= SfxItemState::DEFAULT)
718  {
719  SvxULSpaceItem aULSpace = aEditAttr.Get(EE_PARA_ULSPACE);
720  if (!aULSpace.GetUpper() && !aULSpace.GetLower())
721  rSet.DisableItem(SID_PARASPACE_DECREASE);
722  else if (aULSpace.GetUpper() >= 5670 && aULSpace.GetLower() >= 5670)
723  rSet.DisableItem(SID_PARASPACE_INCREASE);
724  if (nSlotId == SID_ATTR_PARA_ULSPACE || nSlotId == SID_ATTR_PARA_ABOVESPACE
725  || nSlotId == SID_ATTR_PARA_BELOWSPACE)
726  {
727  aULSpace.SetWhich(nSlotId);
728  rSet.Put(aULSpace);
729  }
730  }
731  else
732  {
733  rSet.DisableItem(SID_PARASPACE_INCREASE);
734  rSet.DisableItem(SID_PARASPACE_DECREASE);
735  rSet.InvalidateItem(SID_ATTR_PARA_ULSPACE);
736  rSet.InvalidateItem(SID_ATTR_PARA_ABOVESPACE);
737  rSet.InvalidateItem(SID_ATTR_PARA_BELOWSPACE);
738  }
739  nSlotId = 0;
740  }
741  break;
742 
743  case SID_ATTR_PARA_LINESPACE_10:
744  nLSpace = 100;
745  goto ASK_LINESPACE;
746  case SID_ATTR_PARA_LINESPACE_15:
747  nLSpace = 150;
748  goto ASK_LINESPACE;
749  case SID_ATTR_PARA_LINESPACE_20:
750  nLSpace = 200;
751  goto ASK_LINESPACE;
752  ASK_LINESPACE:
753  {
754  if (!pLSpace)
755  aEditAttr.GetItemState(EE_PARA_SBL, false, &pLSpace);
756 
757  if (!pLSpace || IsInvalidItem(pLSpace))
758  {
759  rSet.InvalidateItem(nSlotId);
760  nSlotId = 0;
761  }
762  else if (nLSpace
763  == static_cast<const SvxLineSpacingItem*>(pLSpace)->GetPropLineSpace())
764  bFlag = true;
765  else
766  nSlotId = 0;
767  }
768  break;
769 
770  case FN_SET_SUPER_SCRIPT:
771  nEsc = SvxEscapement::Superscript;
772  goto ASK_ESCAPE;
773  case FN_SET_SUB_SCRIPT:
774  nEsc = SvxEscapement::Subscript;
775  goto ASK_ESCAPE;
776  ASK_ESCAPE:
777  {
778  if (!pEscItem)
779  pEscItem = &aEditAttr.Get(EE_CHAR_ESCAPEMENT);
780 
781  if (nEsc == static_cast<const SvxEscapementItem*>(pEscItem)->GetEscapement())
782  bFlag = true;
783  else
784  nSlotId = 0;
785  }
786  break;
787 
788  case SID_THESAURUS:
789  {
790  // disable "Thesaurus" if the language is not supported
794  LanguageType nLang = static_cast<const SvxLanguageItem&>(rItem).GetLanguage();
795 
796  uno::Reference<linguistic2::XThesaurus> xThes(::GetThesaurus());
797  if (!xThes.is() || nLang == LANGUAGE_NONE
798  || !xThes->hasLocale(LanguageTag::convertToLocale(nLang)))
799  rSet.DisableItem(SID_THESAURUS);
800  nSlotId = 0;
801  }
802  break;
803  case SID_HANGUL_HANJA_CONVERSION:
804  case SID_CHINESE_CONVERSION:
805  {
806  if (!SvtCJKOptions().IsAnyEnabled())
807  {
808  GetView().GetViewFrame()->GetBindings().SetVisibleState(nWhich, false);
809  rSet.DisableItem(nWhich);
810  }
811  else
812  GetView().GetViewFrame()->GetBindings().SetVisibleState(nWhich, true);
813  }
814  break;
815 
816  case SID_TEXTDIRECTION_LEFT_TO_RIGHT:
817  case SID_TEXTDIRECTION_TOP_TO_BOTTOM:
818  if (!SvtLanguageOptions().IsVerticalTextEnabled())
819  {
820  rSet.DisableItem(nSlotId);
821  nSlotId = 0;
822  }
823  else
824  {
825  SdrOutliner* pOutliner = pSdrView->GetTextEditOutliner();
826  if (pOutliner)
827  bFlag = pOutliner->IsVertical()
828  == (SID_TEXTDIRECTION_TOP_TO_BOTTOM == nSlotId);
829  else
830  {
831  text::WritingMode eMode = aEditAttr.Get(SDRATTR_TEXTDIRECTION).GetValue();
832 
833  if (nSlotId == SID_TEXTDIRECTION_LEFT_TO_RIGHT)
834  {
835  bFlag = eMode == text::WritingMode_LR_TB;
836  }
837  else
838  {
839  bFlag = eMode != text::WritingMode_TB_RL;
840  }
841  }
842  }
843  break;
844  case SID_ATTR_PARA_LEFT_TO_RIGHT:
845  case SID_ATTR_PARA_RIGHT_TO_LEFT:
846  {
847  if (!SvtLanguageOptions().IsCTLFontEnabled())
848  {
849  rSet.DisableItem(nWhich);
850  nSlotId = 0;
851  }
852  else
853  {
854  SdrOutliner* pOutliner = pSdrView->GetTextEditOutliner();
855  if (pOutliner && pOutliner->IsVertical())
856  {
857  rSet.DisableItem(nWhich);
858  nSlotId = 0;
859  }
860  else
861  {
862  switch (aEditAttr.Get(EE_PARA_WRITINGDIR).GetValue())
863  {
864  case SvxFrameDirection::Horizontal_LR_TB:
865  bFlag = nWhich == SID_ATTR_PARA_LEFT_TO_RIGHT;
866  break;
867 
868  case SvxFrameDirection::Horizontal_RL_TB:
869  bFlag = nWhich != SID_ATTR_PARA_LEFT_TO_RIGHT;
870  break;
871  default:
872  break;
873  }
874  }
875  }
876  }
877  break;
878  case SID_TRANSLITERATE_HALFWIDTH:
879  case SID_TRANSLITERATE_FULLWIDTH:
880  case SID_TRANSLITERATE_HIRAGANA:
881  case SID_TRANSLITERATE_KATAKANA:
882  {
883  SvtCJKOptions aCJKOptions;
884  if (!aCJKOptions.IsChangeCaseMapEnabled())
885  {
886  rSet.DisableItem(nWhich);
887  GetView().GetViewFrame()->GetBindings().SetVisibleState(nWhich, false);
888  }
889  else
890  GetView().GetViewFrame()->GetBindings().SetVisibleState(nWhich, true);
891  }
892  break;
893  case SID_INSERT_RLM:
894  case SID_INSERT_LRM:
895  {
896  SvtCTLOptions aCTLOptions;
897  bool bEnabled = aCTLOptions.IsCTLFontEnabled();
898  GetView().GetViewFrame()->GetBindings().SetVisibleState(nWhich, bEnabled);
899  if (!bEnabled)
900  rSet.DisableItem(nWhich);
901  }
902  break;
903  case SID_REMOVE_HYPERLINK:
904  case SID_EDIT_HYPERLINK:
905  {
907  rSet.DisableItem(nWhich);
908  }
909  break;
910  default:
911  nSlotId = 0; // don't know this slot
912  break;
913  }
914 
915  if (nSlotId && bFlag)
916  rSet.Put(SfxBoolItem(nWhich, bFlag));
917 
918  nWhich = aIter.NextWhich();
919  }
920 }
921 
923 {
924  if (!IsTextEdit()) // Otherwise crash!
925  return;
926 
928  SfxItemSet aEditAttr(pOLV->GetAttribs());
929 
930  SfxWhichIter aIter(rSet);
931  sal_uInt16 nWhich = aIter.FirstWhich();
932  SvtScriptType nScriptType = pOLV->GetSelectedScriptType();
933  while(nWhich)
934  {
935  sal_uInt16 nEEWhich = 0;
936  sal_uInt16 nSlotId = GetPool().GetSlotId( nWhich );
937  switch( nSlotId )
938  {
939  case SID_ATTR_CHAR_FONT:
940  case SID_ATTR_CHAR_FONTHEIGHT:
941  case SID_ATTR_CHAR_WEIGHT:
942  case SID_ATTR_CHAR_POSTURE:
943  {
944  SfxItemPool* pEditPool = aEditAttr.GetPool()->GetSecondaryPool();
945  if( !pEditPool )
946  pEditPool = aEditAttr.GetPool();
947  SvxScriptSetItem aSetItem( nSlotId, *pEditPool );
948  aSetItem.GetItemSet().Put( aEditAttr, false );
949  const SfxPoolItem* pI = aSetItem.GetItemOfScript( nScriptType );
950  if( pI )
951  {
952  rSet.Put(pI->CloneSetWhich(nWhich));
953  }
954  else
955  rSet.InvalidateItem( nWhich );
956  }
957  break;
958  case SID_ATTR_CHAR_COLOR: nEEWhich = EE_CHAR_COLOR; break;
959  case SID_ATTR_CHAR_BACK_COLOR: nEEWhich = EE_CHAR_BKGCOLOR; break;
960  case SID_ATTR_CHAR_UNDERLINE: nEEWhich = EE_CHAR_UNDERLINE;break;
961  case SID_ATTR_CHAR_OVERLINE: nEEWhich = EE_CHAR_OVERLINE;break;
962  case SID_ATTR_CHAR_CONTOUR: nEEWhich = EE_CHAR_OUTLINE; break;
963  case SID_ATTR_CHAR_SHADOWED: nEEWhich = EE_CHAR_SHADOW;break;
964  case SID_ATTR_CHAR_STRIKEOUT: nEEWhich = EE_CHAR_STRIKEOUT;break;
965  case SID_AUTOSPELL_CHECK:
966  {
967  const SfxPoolItem* pState = rView.GetSlotState(nWhich);
968  if (pState)
969  rSet.Put(SfxBoolItem(nWhich, static_cast<const SfxBoolItem*>(pState)->GetValue()));
970  else
971  rSet.DisableItem( nWhich );
972  break;
973  }
974  case SID_ATTR_CHAR_WORDLINEMODE: nEEWhich = EE_CHAR_WLM; break;
975  case SID_ATTR_CHAR_RELIEF : nEEWhich = EE_CHAR_RELIEF; break;
976  case SID_ATTR_CHAR_LANGUAGE : nEEWhich = EE_CHAR_LANGUAGE;break;
977  case SID_ATTR_CHAR_KERNING : nEEWhich = EE_CHAR_KERNING; break;
978  case SID_ATTR_CHAR_SCALEWIDTH: nEEWhich = EE_CHAR_FONTWIDTH;break;
979  case SID_ATTR_CHAR_AUTOKERN : nEEWhich = EE_CHAR_PAIRKERNING; break;
980  case SID_ATTR_CHAR_ESCAPEMENT: nEEWhich = EE_CHAR_ESCAPEMENT; break;
981  case FN_GROW_FONT_SIZE:
982  case FN_SHRINK_FONT_SIZE:
983  {
984  SfxItemPool* pEditPool = aEditAttr.GetPool()->GetSecondaryPool();
985  if( !pEditPool )
986  pEditPool = aEditAttr.GetPool();
987 
988  SvxScriptSetItem aSetItem( SID_ATTR_CHAR_FONTHEIGHT, *pEditPool );
989  aSetItem.GetItemSet().Put( aEditAttr, false );
990  const SvxFontHeightItem* pSize( static_cast<const SvxFontHeightItem*>( aSetItem.GetItemOfScript( nScriptType ) ) );
991 
992  if( pSize )
993  {
994  sal_uInt32 nSize = pSize->GetHeight();
995  if( nSize >= 19998 )
997  else if( nSize <= 40 )
999  }
1000  }
1001  }
1002  if(nEEWhich)
1003  {
1004  rSet.Put(aEditAttr.Get(nEEWhich).CloneSetWhich(nWhich));
1005  }
1006 
1007  nWhich = aIter.NextWhich();
1008  }
1009 }
1010 
1012 {
1013  if (!IsTextEdit()) // Otherwise crash!
1014  return;
1015 
1017 
1018  ESelection aSel(pOLV->GetSelection());
1019  const bool bCopy = (aSel.nStartPara != aSel.nEndPara) || (aSel.nStartPos != aSel.nEndPos);
1020  sal_uInt16 nId = rReq.GetSlot();
1021  switch( nId )
1022  {
1023  case SID_CUT:
1024  if (bCopy)
1025  pOLV->Cut();
1026  return;
1027 
1028  case SID_COPY:
1029  if (bCopy)
1030  pOLV->Copy();
1031  return;
1032 
1033  case SID_PASTE:
1034  pOLV->PasteSpecial();
1035  break;
1036 
1037  case SID_PASTE_UNFORMATTED:
1038  pOLV->Paste();
1039  break;
1040 
1041  case SID_PASTE_SPECIAL:
1042  {
1044  ScopedVclPtr<SfxAbstractPasteDialog> pDlg(pFact->CreatePasteDialog(GetView().GetEditWin().GetFrameWeld()));
1045 
1046  pDlg->Insert(SotClipboardFormatId::STRING, OUString());
1047  pDlg->Insert(SotClipboardFormatId::RTF, OUString());
1048  pDlg->Insert(SotClipboardFormatId::RICHTEXT, OUString());
1049 
1051  SotClipboardFormatId nFormat = pDlg->GetFormat(aDataHelper.GetTransferable());
1052 
1053  if (nFormat != SotClipboardFormatId::NONE)
1054  {
1055  if (nFormat == SotClipboardFormatId::STRING)
1056  pOLV->Paste();
1057  else
1058  pOLV->PasteSpecial();
1059  }
1060 
1061  break;
1062  }
1063 
1064  case SID_CLIPBOARD_FORMAT_ITEMS:
1065  {
1066  SotClipboardFormatId nFormat = SotClipboardFormatId::NONE;
1067  const SfxPoolItem* pItem;
1068  if (rReq.GetArgs() && rReq.GetArgs()->GetItemState(nId, true, &pItem) == SfxItemState::SET)
1069  {
1070  if (const SfxUInt32Item* pUInt32Item = dynamic_cast<const SfxUInt32Item *>(pItem))
1071  nFormat = static_cast<SotClipboardFormatId>(pUInt32Item->GetValue());
1072  }
1073 
1074  if (nFormat != SotClipboardFormatId::NONE)
1075  {
1076  if (nFormat == SotClipboardFormatId::STRING)
1077  pOLV->Paste();
1078  else
1079  pOLV->PasteSpecial();
1080  }
1081 
1082  break;
1083  }
1084 
1085  default:
1086  OSL_FAIL("wrong dispatcher");
1087  return;
1088  }
1089 }
1090 
1092 {
1093  if (!IsTextEdit()) // Otherwise crash!
1094  return;
1095 
1097  ESelection aSel(pOLV->GetSelection());
1098  const bool bCopy = (aSel.nStartPara != aSel.nEndPara) ||
1099  (aSel.nStartPos != aSel.nEndPos);
1100 
1102  const bool bPaste = aDataHelper.HasFormat( SotClipboardFormatId::STRING ) ||
1103  aDataHelper.HasFormat( SotClipboardFormatId::RTF ) ||
1104  aDataHelper.HasFormat( SotClipboardFormatId::RICHTEXT );
1105 
1106  SfxWhichIter aIter(rSet);
1107  sal_uInt16 nWhich = aIter.FirstWhich();
1108 
1109  while(nWhich)
1110  {
1111  switch(nWhich)
1112  {
1113  case SID_CUT:
1114  case SID_COPY:
1115  if( !bCopy )
1116  rSet.DisableItem( nWhich );
1117  break;
1118 
1119  case SID_PASTE:
1120  case SID_PASTE_UNFORMATTED:
1121  case SID_PASTE_SPECIAL:
1122  if( !bPaste )
1123  rSet.DisableItem( nWhich );
1124  break;
1125 
1126  case SID_CLIPBOARD_FORMAT_ITEMS:
1127  if( bPaste )
1128  {
1129  SvxClipboardFormatItem aFormats( SID_CLIPBOARD_FORMAT_ITEMS );
1130 
1131  if ( aDataHelper.HasFormat( SotClipboardFormatId::STRING ) )
1132  aFormats.AddClipbrdFormat( SotClipboardFormatId::STRING );
1133  if ( aDataHelper.HasFormat( SotClipboardFormatId::RTF ) )
1134  aFormats.AddClipbrdFormat( SotClipboardFormatId::RTF );
1135  if ( aDataHelper.HasFormat( SotClipboardFormatId::RICHTEXT ) )
1136  aFormats.AddClipbrdFormat( SotClipboardFormatId::RICHTEXT );
1137 
1138  rSet.Put( aFormats );
1139  }
1140  else
1141  rSet.DisableItem( nWhich );
1142  break;
1143  }
1144 
1145  nWhich = aIter.NextWhich();
1146  }
1147 }
1148 
1149 // Hyperlink status
1150 
1152 {
1153  if (!IsTextEdit()) // Otherwise crash!
1154  return;
1155 
1157  SfxWhichIter aIter(rSet);
1158  sal_uInt16 nWhich = aIter.FirstWhich();
1159 
1160  while(nWhich)
1161  {
1162  switch(nWhich)
1163  {
1164  case SID_HYPERLINK_GETLINK:
1165  {
1166  SvxHyperlinkItem aHLinkItem;
1167  aHLinkItem.SetInsertMode(HLINK_FIELD);
1168 
1169  const SvxFieldItem* pFieldItem = pOLV->GetFieldAtSelection();
1170 
1171  if (pFieldItem)
1172  {
1173  const SvxURLField* pURLField = dynamic_cast<const SvxURLField*>(pFieldItem->GetField());
1174 
1175  if (pURLField)
1176  {
1177  aHLinkItem.SetName(pURLField->GetRepresentation());
1178  aHLinkItem.SetURL(pURLField->GetURL());
1179  aHLinkItem.SetTargetFrame(pURLField->GetTargetFrame());
1180  }
1181  }
1182  else
1183  {
1184  OUString sSel(pOLV->GetSelected());
1185  sSel = sSel.copy(0, std::min<sal_Int32>(255, sSel.getLength()));
1186  aHLinkItem.SetName(comphelper::string::stripEnd(sSel, ' '));
1187  }
1188 
1189  sal_uInt16 nHtmlMode = ::GetHtmlMode(GetView().GetDocShell());
1190  aHLinkItem.SetInsertMode(static_cast<SvxLinkInsertMode>(aHLinkItem.GetInsertMode() |
1191  ((nHtmlMode & HTMLMODE_ON) != 0 ? HLINK_HTMLMODE : 0)));
1192 
1193  rSet.Put(aHLinkItem);
1194  }
1195  break;
1196  }
1197  nWhich = aIter.NextWhich();
1198  }
1199 }
1200 
1201 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
const SfxPoolItem * ExecuteSlot(SfxRequest &rReq, const SfxInterface *pIF=nullptr)
void SetURL(const OUString &rURL)
SfxViewFrame * GetViewFrame() const
#define LANGUAGE_NONE
#define EE_CHAR_ESCAPEMENT
void SetTargetFrame(const OUString &rFrm)
#define EE_ITEMS_START
FieldUnit
OString stripEnd(const OString &rIn, sal_Char c)
void PasteSpecial()
virtual SdrEndTextEditKind SdrEndTextEdit(bool bDontDeleteReally=false)
void PutItemForScriptType(SvtScriptType nScriptType, const SfxPoolItem &rItem)
sal_uInt16 GetLower() const
#define LINE_SPACE_DEFAULT_HEIGHT
void SetEscapement(const SvxEscapement eNew)
#define FN_SET_SUPER_SCRIPT
Definition: cmdid.h:289
#define RES_CHRATR_LANGUAGE
Definition: hintids.hxx:78
bool BeginTextEdit(SdrObject *pObj, SdrPageView *pPV=nullptr, vcl::Window *pWin=nullptr, bool bIsNewObj=false, bool bSetSelectionToStart=false)
Definition: viewdraw.cxx:507
SdrView * pSdrView
Definition: drwtxtsh.hxx:35
void SelectPara(EditView &rEditView, const ESelection &rCurSel)
Definition: langhelper.cxx:567
#define EE_CHAR_LANGUAGE
virtual const SfxItemSet * GetOutputItemSet() const =0
std::string GetValue
short GetTextFirstLineOfst() const
static void RemoveURLField(Outliner *pOutl, OutlinerView *pOLV)
const OUString & GetTargetFrame() const
static void HandleOpenXmlFilterSettings(SfxRequest &)
SfxDispatcher * GetDispatcher()
static SvxAbstractDialogFactory * Create()
#define EE_CHAR_KERNING
LanguageType GetLanguage(SfxItemSet const &aSet, sal_uInt16 nLangWhichId)
Definition: langhelper.cxx:402
void GetState(SfxItemSet &)
Definition: drwtxtex.cxx:606
bool IsTextEdit()
Definition: drwtxtsh.cxx:176
bool HasSelection() const
void InvalidateItem(sal_uInt16 nWhich)
#define EE_PARA_JUST
sal_Int16 nId
sal_uInt16 FirstWhich()
void SetTextLeft(const long nL, const sal_uInt16 nProp=100)
SwEditWin & GetEditWin()
Definition: view.hxx:403
void Execute(SfxRequest &)
Definition: drwtxtex.cxx:105
void Done(bool bRemove=false)
SdrMark * GetMark(size_t nNum) const
void ChangeFontSize(bool bGrow, const FontList *pList)
static SfxObjectShell * Current()
void SetModified()
Definition: edws.cxx:69
const SfxItemSet * GetArgs() const
void SelectCurrentWord(sal_Int16 nWordType=css::i18n::WordType::ANYWORD_IGNOREWHITESPACES)
void ExecClpbrd(SfxRequest const &rReq)
Definition: drwtxtex.cxx:1011
#define RES_PARATR_SPLIT
Definition: hintids.hxx:163
bool IsCTLFontEnabled() const
void StateInsert(SfxItemSet &rSet)
Definition: drwtxtex.cxx:1151
bool HasFormat(SotClipboardFormatId nFormat) const
EEControlBits
const OUString & GetTargetFrame() const
sal_uInt16 NextWhich()
static LanguageType nLang
Definition: srtdlg.cxx:58
#define EE_CHAR_FONTWIDTH
Used by the UI to modify the document model.
Definition: wrtsh.hxx:88
void GetDrawTextCtrlState(SfxItemSet &)
Definition: drwtxtex.cxx:922
#define EE_PARA_ULSPACE
void StateClpbrd(SfxItemSet &rSet)
Definition: drwtxtex.cxx:1091
void UpdateWordCount(SfxShell *, sal_uInt16)
Definition: view1.cxx:207
void SetTargetFrame(const OUString &rTarget)
const SwView & GetView() const
Definition: wrtsh.hxx:426
void SetPropLineSpace(const sal_uInt16 nProp)
LINESTYLE_NONE
const SfxPoolItem & GetDefault(sal_uInt16 nFormatHint) const
Get the default attribute in this document.
Definition: docfmt.cxx:682
static TransferableDataHelper CreateFromSystemClipboard(vcl::Window *pWindow)
HLINK_HTMLMODE
SwDoc * GetDoc() const
Definition: viewsh.hxx:284
SotClipboardFormatId
sal_Int32 nEndPos
#define EE_CHAR_BKGCOLOR
#define EE_CHAR_OVERLINE
bool SetLanguageStatus(OutlinerView *pOLV, SfxRequest &rReq, SwView const &rView, SwWrtShell &rSh)
Definition: langhelper.cxx:102
SwView & rView
Definition: drwtxtsh.hxx:32
EditView & GetEditView() const
#define FN_SHRINK_FONT_SIZE
Definition: cmdid.h:286
SfxItemPool & GetPool() const
bool IsChangeCaseMapEnabled() const
SdrObject * GetMarkedSdrObj() const
#define EE_PARA_LRSPACE
static bool IsCursorAtURLField(OutlinerView *pOLV)
const SfxPoolItem * GetItem(sal_uInt16 nSlotId) const
void SetRight(const long nR, const sal_uInt16 nProp=100)
#define FN_SET_SUB_SCRIPT
Definition: cmdid.h:290
const SdrOutliner * GetTextEditOutliner() const
SvtScriptType
#define FN_NUMBERING_OUTLINE_DLG
Definition: cmdid.h:470
const OUString & GetURL() const
#define SW_MOD()
Definition: swmodule.hxx:255
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
SW_DLLPUBLIC FieldUnit GetDfltMetric(bool bWeb)
Definition: uitool.cxx:691
SvxAdjust
const SfxPoolItem * GetSlotState(sal_uInt16 nSlotId, const SfxInterface *pIF=nullptr, SfxItemSet *pStateSet=nullptr)
#define EE_PARA_WRITINGDIR
const SvxFieldItem * GetFieldAtSelection() const
#define EE_CHAR_UNDERLINE
#define EE_FEATURE_FIELD
SfxBindings & GetBindings()
const OUString & GetValue() const
const SdrMarkList & GetMarkedObjectList() const
#define RES_PARATR_HYPHENZONE
Definition: hintids.hxx:167
HTMLMODE_ON
sal_uInt16 GetHtmlMode(const SwDocShell *pShell)
Definition: viewopt.cxx:339
#define RES_PARATR_ORPHANS
Definition: hintids.hxx:164
const T * GetArg(sal_uInt16 nSlotId) const
bool SetAttributes(const SfxItemSet &rSet, bool bReplaceAll=false)
#define EE_CHAR_SHADOW
OUString GetSelected() const
void ExecFormatFootnote()
Definition: view0.cxx:607
static sal_Int16 GetI18NScriptTypeOfLanguage(LanguageType nLang)
LINESTYLE_SINGLE
SvtScriptType GetSelectedScriptType() const
virtual void SetCurPageId(const OString &rName)=0
void GetLanguageStatus(OutlinerView *pOLV, SfxItemSet &rSet)
Definition: langhelper.cxx:62
weld::Window * GetFrameWeld(SfxFrame *pFrame)
Definition: dialoghelp.cxx:20
sal_uInt16 GetWhichOfScript(sal_uInt16 nWhich, sal_uInt16 nScript)
Definition: hints.cxx:195
bool IsModified() const
#define EE_CHAR_COLOR
#define SDRATTR_TEXTDIRECTION
void Paste(bool bUseSpecial=false)
const OutlinerView * GetTextEditOutlinerView() const
HLINK_FIELD
Outliner * GetOutliner() const
static SwAbstractDialogFactory * Create()
Definition: swabstdlg.cxx:36
const OUString & GetRepresentation() const
#define FN_WORDCOUNT_DIALOG
Definition: cmdid.h:571
sal_uInt16 GetSlotId(sal_uInt16 nWhich) const
void SetName(const OUString &rName)
void InsertField(const SvxFieldItem &rFld)
std::unique_ptr< SfxPoolItem > CloneSetWhich(sal_uInt16 nNewWhich) const
SfxItemPool * GetPool() const
const SvxFieldData * GetFieldAtCursor()
const OUString & GetURL() const
#define RES_CHRATR_KERNING
Definition: hintids.hxx:77
OString OUStringToOString(const OUString &str, ConnectionSettings const *settings)
FontLineStyle GetLineStyle() const
#define EE_PARA_SBL
#define EE_CHAR_PAIRKERNING
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
SwView & GetView()
Definition: drwtxtsh.hxx:49
sal_uInt16 GetSlot() const
void SetSelection(const ESelection &)
#define EE_CHAR_RELIEF
#define EE_CHAR_OUTLINE
sal_uInt32 GetHeight() const
bool EDITENG_DLLPUBLIC GetStatusValueForThesaurusFromContext(OUString &rStatusVal, LanguageType &rLang, const EditView &rEditView)
SfxItemState
void DisableItem(sal_uInt16 nWhich)
void SetTextFirstLineOfst(const short nF, const sal_uInt16 nProp=100)
weld::Window * GetFrameWeld() const
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
sal_uInt16 GetWhich(sal_uInt16 nSlot, bool bDeep=true) const
void ExecNumberingOutline(SfxItemPool &)
Definition: view0.cxx:614
#define GetWhich(nSlot)
uno::Reference< linguistic2::XThesaurus > GetThesaurus()
Definition: swtypes.cxx:76
LanguageType GetAppLanguage()
Definition: init.cxx:771
RET_OK
SwWrtShell & GetShell()
Definition: drwtxtsh.cxx:146
void SetAttrToMarked(const SfxItemSet &rAttr)
Definition: drwtxtsh.cxx:165
ESelection GetSelection()
#define FN_GROW_FONT_SIZE
Definition: cmdid.h:285
long GetRight() const
void SetInsertMode(SvxLinkInsertMode eNew)
SdrPageView * GetSdrPageView() const
#define FN_FORMAT_FOOTNOTE_DLG
Definition: cmdid.h:306
void SetSelection(const ESelection &rNewSel)
void AddClipbrdFormat(SotClipboardFormatId nId)
#define RES_PARATR_WIDOWS
Definition: hintids.hxx:165
SvxEscapement
void SetVisibleState(sal_uInt16 nId, bool bShow)
const OUString & GetName() const
SvxLinkInsertMode GetInsertMode() const
void InvalidateAll(bool bWithMsg)
SVX_DLLPUBLIC MSO_SPT Get(const OUString &)
SfxItemSet GetAttribs()
ESelection GetSelection() const
const SfxPoolItem * Execute(sal_uInt16 nSlot, SfxCallMode nCall=SfxCallMode::SLOT, const SfxPoolItem **pArgs=nullptr, sal_uInt16 nModi=0, const SfxPoolItem **pInternalArgs=nullptr)
const FontList * GetFontList() const
virtual VclPtr< SfxAbstractTabDialog > CreateSwCharDlg(weld::Window *pParent, SwView &pVw, const SfxItemSet &rCoreSet, SwCharDlgMode nDialogMode, const OUString *pFormatStr=nullptr)=0
bool IsInvalidItem(const SfxPoolItem *pItem)
#define RES_BREAK
Definition: hintids.hxx:199
FontLineStyle
const css::uno::Reference< css::datatransfer::XTransferable > & GetTransferable() const
long GetTextLeft() const
#define EE_CHAR_STRIKEOUT
virtual VclPtr< SfxAbstractTabDialog > CreateSwParaDlg(weld::Window *pParent, SwView &rVw, const SfxItemSet &rCoreSet, bool bDraw, const OString &sDefPage=OString())=0
const SfxPoolItem * GetItemOfScript(SvtScriptType nScript) const
void EDITENG_DLLPUBLIC ReplaceTextWithSynonym(EditView &rEditView, const OUString &rSynonmText)
Definition: view.hxx:146
sal_uInt16 GetUpper() const
const SvxFieldData * GetField() const
static css::lang::Locale convertToLocale(LanguageType nLangID, bool bResolveSystem=true)
#define EE_CHAR_WLM
#define EE_ITEMS_END