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