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