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