LibreOffice Module sw (master) 1
textsh.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#include <config_features.h>
21
22#include <hintids.hxx>
23#include <comphelper/string.hxx>
25#include <sfx2/bindings.hxx>
26#include <sfx2/frmdescr.hxx>
27#include <sfx2/objface.hxx>
28#include <sfx2/viewfrm.hxx>
29
31#include <svl/eitem.hxx>
32#include <svl/ptitem.hxx>
33#include <svl/stritem.hxx>
35#include <svx/hlnkitem.hxx>
36#include <svl/whiter.hxx>
37#include <sfx2/request.hxx>
38#include <editeng/fontitem.hxx>
39#include <editeng/boxitem.hxx>
40#include <editeng/sizeitem.hxx>
41#include <editeng/svxacorr.hxx>
43#include <sfx2/htmlmode.hxx>
44#include <svtools/htmlcfg.hxx>
45#include <com/sun/star/embed/Aspects.hpp>
46#include <com/sun/star/embed/XEmbeddedObject.hpp>
47#include <osl/diagnose.h>
48
50#include <editeng/acorrcfg.hxx>
51#include <wdocsh.hxx>
52#include <fmtinfmt.hxx>
53#include <fmtclds.hxx>
54#include <fmtfsize.hxx>
55#include <swmodule.hxx>
56#include <wrtsh.hxx>
57#include <view.hxx>
58#include <docsh.hxx>
59#include <doc.hxx>
61#include <uitool.hxx>
62#include <cmdid.h>
63#include <globals.hrc>
64#include <frmmgr.hxx>
65#include <textsh.hxx>
66#include <frmfmt.hxx>
67#include <tablemgr.hxx>
68#include <swundo.hxx>
69#include <breakit.hxx>
70#include <edtwin.hxx>
71#include <strings.hrc>
72#include <unochart.hxx>
73#include <chartins.hxx>
74#include <viewopt.hxx>
75
76#define ShellClass_SwTextShell
77#include <sfx2/msg.hxx>
78#include <vcl/EnumContext.hxx>
79#include <swslots.hxx>
80#include <SwRewriter.hxx>
81#include <SwCapObjType.hxx>
82
83using namespace ::com::sun::star;
84
85#include <svx/svxdlg.hxx>
86#include <swabstdlg.hxx>
88#include <drawdoc.hxx>
89#include <svtools/embedhlp.hxx>
90#include <sfx2/event.hxx>
91#include <com/sun/star/ui/dialogs/DialogClosedEvent.hpp>
92#include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp>
93#include <IDocumentUndoRedo.hxx>
95
97
98IMPL_STATIC_LINK( SwTextShell, DialogClosedHdl, css::ui::dialogs::DialogClosedEvent*, pEvent, void )
99{
100 if (SwView* pView = GetActiveView())
101 {
102 SwWrtShell& rWrtShell = pView->GetWrtShell();
103
104 sal_Int16 nDialogRet = pEvent->DialogResult;
105 if( nDialogRet == ui::dialogs::ExecutableDialogResults::CANCEL )
106 {
107 rWrtShell.Undo();
108 rWrtShell.GetIDocumentUndoRedo().ClearRedo();
109 }
110 else
111 {
112 OSL_ENSURE( nDialogRet == ui::dialogs::ExecutableDialogResults::OK,
113 "dialog execution failed" );
114 }
115 }
116}
117
119{
121
122 GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_OBJECT, SfxVisibilityFlags::Invisible, ToolbarId::Text_Toolbox_Sw);
123
128 GetStaticInterface()->RegisterChildWindow(SID_RUBY_DIALOG);
130}
131
132
134{
135 SwWrtShell &rSh = GetShell();
136
137 OSL_ENSURE( !rSh.IsObjSelected() && !rSh.IsFrameSelected(),
138 "wrong shell on dispatcher" );
139
140 const SfxItemSet *pArgs = rReq.GetArgs();
141 const SfxPoolItem* pItem = nullptr;
142 const sal_uInt16 nSlot = rReq.GetSlot();
143 if(pArgs)
144 pArgs->GetItemState(nSlot, false, &pItem );
145
146 switch( nSlot )
147 {
148 case FN_INSERT_STRING:
149 if( pItem )
150 rSh.InsertByWord(static_cast<const SfxStringItem *>(pItem)->GetValue());
151 break;
152
153 case FN_INSERT_SOFT_HYPHEN:
154 if( CHAR_SOFTHYPHEN != rSh.SwCursorShell::GetChar() &&
155 CHAR_SOFTHYPHEN != rSh.SwCursorShell::GetChar( true, -1 ))
156 rSh.Insert( OUString( CHAR_SOFTHYPHEN ) );
157 break;
158
159 case FN_INSERT_HARDHYPHEN:
160 case FN_INSERT_HARD_SPACE:
161 {
162 const sal_Unicode cIns = FN_INSERT_HARD_SPACE == nSlot ? CHAR_HARDBLANK : CHAR_HARDHYPHEN;
163
165 SvxAutoCorrect* pACorr = rACfg.GetAutoCorrect();
166 if( pACorr && rACfg.IsAutoFormatByInput()
167 && pACorr->IsAutoCorrFlag(
168 ACFlags::CapitalStartSentence | ACFlags::CapitalStartWord |
169 ACFlags::AddNonBrkSpace | ACFlags::ChgOrdinalNumber | ACFlags::TransliterateRTL |
170 ACFlags::ChgToEnEmDash | ACFlags::SetINetAttr | ACFlags::Autocorrect |
171 ACFlags::SetDOIAttr ) )
172 {
173 rSh.AutoCorrect( *pACorr, cIns );
174 }
175 else
176 {
177 rSh.Insert( OUString( cIns ) );
178 }
179 }
180 break;
181
182 case FN_INSERT_NNBSP: // shift+mod2/alt+space inserts some other character w/o going through SwEditWin::KeyInput(), at least on macOS
183 case SID_INSERT_RLM :
184 case SID_INSERT_LRM :
185 case SID_INSERT_WJ :
186 case SID_INSERT_ZWSP:
187 {
188 sal_Unicode cIns = 0;
189 switch(nSlot)
190 {
191 case SID_INSERT_RLM : cIns = CHAR_RLM ; break;
192 case SID_INSERT_LRM : cIns = CHAR_LRM ; break;
193 case SID_INSERT_ZWSP : cIns = CHAR_ZWSP ; break;
194 case SID_INSERT_WJ: cIns = CHAR_WJ; break;
195 case FN_INSERT_NNBSP: cIns = CHAR_NNBSP; break;
196 }
197 rSh.Insert( OUString( cIns ) );
198 }
199 break;
200
201 case FN_INSERT_BREAK:
202 {
204 {
205 rSh.SplitNode();
206 }
207 else
208 {
209 rSh.InsertLineBreak();
210 }
211 }
212 rReq.Done();
213 break;
214
216 rSh.InsertPageBreak();
217 rReq.Done();
218 break;
219
221 rSh.InsertLineBreak();
222 rReq.Done();
223 break;
224
227 rReq.Done();
228 break;
229
232 rReq.Done();
233 break;
234
237 rReq.Done();
238 break;
239
242 rReq.Done();
243 break;
244
247 rReq.Done();
248 break;
249
252 rReq.Done();
253 break;
254
257 rReq.Done();
258 break;
259
261 {
262 SwWrtShell& rWrtSh = GetShell();
266 aContext.maEndDialogFn = [](sal_Int32){};
267 pDlg->StartExecuteAsync(aContext);
268 rReq.Done();
269 break;
270 }
271
273 rSh.InsertColumnBreak();
274 rReq.Done();
275 break;
276
277 case SID_HYPERLINK_SETLINK:
278 if (pItem)
279 InsertHyperlink(*static_cast<const SvxHyperlinkItem *>(pItem));
280 rReq.Done();
281 break;
282
283#if HAVE_FEATURE_AVMEDIA
284 case SID_INSERT_AVMEDIA:
285 rReq.SetReturnValue(SfxBoolItem(nSlot, InsertMediaDlg( rReq )));
286 break;
287#endif
288
289 case SID_INSERT_OBJECT:
290 {
291 const SfxGlobalNameItem* pNameItem = rReq.GetArg<SfxGlobalNameItem>(SID_INSERT_OBJECT);
292 SvGlobalName *pName = nullptr;
294 if ( pNameItem )
295 {
296 aName = pNameItem->GetValue();
297 pName = &aName;
298 }
299
301 rSh.InsertObject( xObj, pName, nSlot);
302 rReq.Done();
303 break;
304 }
305 case SID_INSERT_FLOATINGFRAME:
306 {
308 const SfxStringItem* pNameItem = rReq.GetArg<SfxStringItem>(FN_PARAM_1);
309 const SfxStringItem* pURLItem = rReq.GetArg<SfxStringItem>(FN_PARAM_2);
310 const SvxSizeItem* pMarginItem = rReq.GetArg<SvxSizeItem>(FN_PARAM_3);
311 const SfxByteItem* pScrollingItem = rReq.GetArg<SfxByteItem>(FN_PARAM_4);
312 const SfxBoolItem* pBorderItem = rReq.GetArg<SfxBoolItem>(FN_PARAM_5);
313
314 if(pURLItem) // URL is a _must_
315 {
317 OUString aName;
319 embed::Aspects::MSOLE_CONTENT );
321 uno::Reference < beans::XPropertySet > xSet( xObj->getComponent(), uno::UNO_QUERY );
322 if ( xSet.is() )
323 {
324 try
325 {
326 ScrollingMode eScroll = ScrollingMode::Auto;
327 if( pScrollingItem && pScrollingItem->GetValue() <= int(ScrollingMode::Auto) )
328 eScroll = static_cast<ScrollingMode>(pScrollingItem->GetValue());
329
330 Size aMargin;
331 if ( pMarginItem )
332 aMargin = pMarginItem->GetSize();
333
334 xSet->setPropertyValue("FrameURL", uno::Any( pURLItem->GetValue() ) );
335 if ( pNameItem )
336 xSet->setPropertyValue("FrameName", uno::Any( pNameItem->GetValue() ) );
337
338 if ( eScroll == ScrollingMode::Auto )
339 xSet->setPropertyValue("FrameIsAutoScroll",
340 uno::Any( true ) );
341 else
342 xSet->setPropertyValue("FrameIsScrollingMode",
343 uno::Any( eScroll == ScrollingMode::Yes ) );
344
345 if ( pBorderItem )
346 xSet->setPropertyValue("FrameIsBorder",
347 uno::Any( pBorderItem->GetValue() ) );
348
349 if ( pMarginItem )
350 {
351 xSet->setPropertyValue("FrameMarginWidth",
352 uno::Any( sal_Int32( aMargin.Width() ) ) );
353
354 xSet->setPropertyValue("FrameMarginHeight",
355 uno::Any( sal_Int32( aMargin.Height() ) ) );
356 }
357 }
358 catch (const uno::Exception&)
359 {
360 }
361 }
362
363 rSh.InsertOleObject( xObj );
364 }
365 else
366 {
367 rSh.InsertObject( xObj, nullptr, nSlot);
368 rReq.Done();
369 }
370 }
371 break;
372 case SID_INSERT_DIAGRAM:
373 {
374 SvtModuleOptions aMOpt;
375 if ( !aMOpt.IsChart() )
376 break;
377 if(!rReq.IsAPI())
378 {
379 SwInsertChart( LINK( this, SwTextShell, DialogClosedHdl ) );
380 }
381 else
382 {
383 uno::Reference< chart2::data::XDataProvider > xDataProvider;
384 bool bFillWithData = true;
385 OUString aRangeString;
386 if (!GetShell().IsTableComplexForChart())
387 {
388 SwFrameFormat* pTableFormat = GetShell().GetTableFormat();
389 aRangeString = pTableFormat->GetName() + "."
390 + GetShell().GetBoxNms();
391
392 // get table data provider
393 xDataProvider.set( GetView().GetDocShell()->getIDocumentChartDataProviderAccess().GetChartDataProvider() );
394 }
395 else
396 bFillWithData = false; // will create chart with only it's default image
397
398 SwTableFUNC( &rSh ).InsertChart( xDataProvider, bFillWithData, aRangeString );
399 rSh.LaunchOLEObj();
400
402 if(pItem && xObj.is())
403 {
404 Size aSize(static_cast<const SvxSizeItem*>(pItem)->GetSize());
406
407 if(aSize.Width() > MINLAY&& aSize.Height()> MINLAY)
408 {
409 awt::Size aSz;
410 aSz.Width = aSize.Width();
411 aSz.Height = aSize.Height();
412 xObj->setVisualAreaSize( xObj.GetViewAspect(), aSz );
413 }
414 }
415 }
416 }
417 break;
418
419 case FN_INSERT_SMA:
420 {
421 // #i34343# Inserting a math object into an autocompletion crashes
422 // the suggestion has to be removed before
424 SvGlobalName aGlobalName( SO3_SM_CLASSID );
425 rSh.InsertObject( svt::EmbeddedObjectRef(), &aGlobalName );
426 }
427 break;
428
429 case FN_INSERT_TABLE:
430 InsertTable( rReq );
431 break;
432
435 {
436 sal_uInt16 nCols = 1;
437 bool bModifier1 = rReq.GetModifier() == KEY_MOD1;
438 if(pArgs)
439 {
440 const SfxUInt16Item* pColsItem = nullptr;
441 if(FN_INSERT_FRAME_INTERACT_NOCOL != nSlot &&
442 (pColsItem = pArgs->GetItemIfSet(SID_ATTR_COLUMNS, false)))
443 nCols = pColsItem->GetValue();
444 if(const SfxUInt16Item* pModifierItem = pArgs->GetItemIfSet(SID_MODIFIER, false))
445 bModifier1 |= KEY_MOD1 == pModifierItem->GetValue();
446 }
447 if(bModifier1 )
448 {
449 SwEditWin& rEdtWin = GetView().GetEditWin();
450 Size aWinSize = rEdtWin.GetSizePixel();
451 Point aStartPos(aWinSize.Width()/2, aWinSize.Height() / 2);
452 aStartPos = rEdtWin.PixelToLogic(aStartPos);
453 constexpr tools::Long constTwips_2cm = o3tl::toTwips(2, o3tl::Length::cm);
454 constexpr tools::Long constTwips_4cm = o3tl::toTwips(4, o3tl::Length::cm);
455 aStartPos.AdjustX(-constTwips_4cm);
456 aStartPos.AdjustY(-constTwips_2cm);
457 Size aSize(2 * constTwips_4cm, 2 * constTwips_2cm);
460 SwFlyFrameAttrMgr aMgr( true, GetShellPtr(), Frmmgr_Type::TEXT, nullptr );
461 if(nCols > 1)
462 {
463 SwFormatCol aCol;
464 aCol.Init( nCols, aCol.GetGutterWidth(), aCol.GetWishWidth() );
465 aMgr.SetCol( aCol );
466 }
467 aMgr.InsertFlyFrame(RndStdIds::FLY_AT_PARA, aStartPos, aSize);
470 }
471 else
472 {
473 GetView().InsFrameMode(nCols);
474 }
475 rReq.Ignore();
476 }
477 break;
478 case FN_INSERT_FRAME:
479 {
480 bool bSingleCol = false;
481 if( nullptr!= dynamic_cast< SwWebDocShell*>( GetView().GetDocShell()) )
482 {
484 {
485 bSingleCol = true;
486 }
487
488 }
489 // Create new border
490 SwFlyFrameAttrMgr aMgr( true, GetShellPtr(), Frmmgr_Type::TEXT, nullptr );
491 if(pArgs)
492 {
493 Size aSize(aMgr.GetSize());
494 aSize.setWidth( GetShell().GetAnyCurRect(CurRectType::PagePrt).Width() );
495 Point aPos = aMgr.GetPos();
496 RndStdIds eAnchor = RndStdIds::FLY_AT_PARA;
497 if(pArgs->GetItemState(nSlot, false, &pItem) == SfxItemState::SET)
498 eAnchor = static_cast<RndStdIds>(static_cast<const SfxUInt16Item *>(pItem)->GetValue());
499 if(pArgs->GetItemState(FN_PARAM_1, false, &pItem) == SfxItemState::SET)
500 aPos = static_cast<const SfxPointItem *>(pItem)->GetValue();
501 if(pArgs->GetItemState(FN_PARAM_2, false, &pItem) == SfxItemState::SET)
502 aSize = static_cast<const SvxSizeItem *>(pItem)->GetSize();
503 if(const SfxUInt16Item* pColsItem = pArgs->GetItemIfSet(SID_ATTR_COLUMNS, false))
504 {
505 const sal_uInt16 nCols = pColsItem->GetValue();
506 if( !bSingleCol && 1 < nCols )
507 {
508 SwFormatCol aFormatCol;
509 aFormatCol.Init( nCols , (rReq.IsAPI() ? 0
510 : DEF_GUTTER_WIDTH), USHRT_MAX );
511 aMgr.SetCol(aFormatCol);
512 }
513 }
514
517
518 aMgr.InsertFlyFrame(eAnchor, aPos, aSize);
519
522 }
523 else
524 {
526
527 FieldUnit eMetric = ::GetDfltMetric(dynamic_cast<SwWebDocShell*>( GetView().GetDocShell()) != nullptr );
528 SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast< sal_uInt16 >(eMetric)));
531 GetView().GetViewFrame(),
533 aSet));
534 if(pDlg->Execute() == RET_OK && pDlg->GetOutputItemSet())
535 {
536 //local variable necessary at least after call of .AutoCaption() because this could be deleted at this point
537 SwWrtShell& rShell = GetShell();
539 rShell.StartAllAction();
541
542 const SfxItemSet* pOutSet = pDlg->GetOutputItemSet();
543 aMgr.SetAttrSet(*pOutSet);
544
545 // At first delete the selection at the ClickToEditField.
546 if( rShell.IsInClickToEdit() )
547 rShell.DelRight();
548
549 aMgr.InsertFlyFrame();
550
551 uno::Reference< frame::XDispatchRecorder > xRecorder =
553 if ( xRecorder.is() )
554 {
555 //FN_INSERT_FRAME
556 sal_uInt16 nAnchor = static_cast<sal_uInt16>(aMgr.GetAnchor());
557 rReq.AppendItem(SfxUInt16Item(nSlot, nAnchor));
558 rReq.AppendItem(SfxPointItem(FN_PARAM_1, rShell.GetObjAbsPos()));
559 rReq.AppendItem(SvxSizeItem(FN_PARAM_2, rShell.GetObjSize()));
560 rReq.Done();
561 }
562
564
565 {
566 SwRewriter aRewriter;
567
568 aRewriter.AddRule(UndoArg1, SwResId(STR_FRAME));
569
570 rShell.EndUndo(SwUndoId::INSERT, &aRewriter);
571 }
572 rShell.EndAllAction();
573 rShell.UnlockPaint();
574 }
575 }
576 break;
577 }
578 case FN_FORMAT_COLUMN :
579 {
582 pColDlg->StartExecuteAsync([=](sal_Int32 /*nResult*/){
583 pColDlg->disposeOnce();
584 });
585 }
586 break;
587
588 default:
589 OSL_ENSURE(false, "wrong dispatcher");
590 return;
591 }
592}
593
594static bool lcl_IsMarkInSameSection( SwWrtShell& rWrtSh, const SwSection* pSect )
595{
596 rWrtSh.SwapPam();
597 bool bRet = pSect == rWrtSh.GetCurrSection();
598 rWrtSh.SwapPam();
599 return bRet;
600}
601
603{
604 const bool bHtmlModeOn = ::GetHtmlMode(GetView().GetDocShell()) & HTMLMODE_ON;
605 SfxWhichIter aIter( rSet );
606 SwWrtShell &rSh = GetShell();
607 sal_uInt16 nWhich = aIter.FirstWhich();
608 SvtModuleOptions aMOpt;
609 SfxObjectCreateMode eCreateMode =
611 const bool bCursorInHidden = rSh.IsInHiddenRange(/*bSelect=*/false);
612
613 while ( nWhich )
614 {
615 switch ( nWhich )
616 {
617 case SID_INSERT_AVMEDIA:
618 if ( GetShell().IsSelFrameMode()
619 || GetShell().CursorInsideInputField()
620 || SfxObjectCreateMode::EMBEDDED == eCreateMode
621 || bCursorInHidden )
622 {
623 rSet.DisableItem( nWhich );
624 }
625 break;
626
627 case SID_INSERT_DIAGRAM:
628 if( !aMOpt.IsChart()
629 || GetShell().CursorInsideInputField()
630 || eCreateMode == SfxObjectCreateMode::EMBEDDED
631 || bCursorInHidden )
632 {
633 rSet.DisableItem( nWhich );
634 }
635 break;
636
637 case FN_INSERT_SMA:
638 if( !aMOpt.IsMath()
639 || eCreateMode == SfxObjectCreateMode::EMBEDDED
640 || bCursorInHidden
641 || rSh.CursorInsideInputField() )
642 {
643 rSet.DisableItem( nWhich );
644 }
645 break;
646
647 case SID_INSERT_FLOATINGFRAME:
648 case SID_INSERT_OBJECT:
649 {
650 if( eCreateMode == SfxObjectCreateMode::EMBEDDED || bCursorInHidden )
651 {
652 rSet.DisableItem( nWhich );
653 }
654 else if( GetShell().IsSelFrameMode()
655 || GetShell().CursorInsideInputField() )
656 {
657 rSet.DisableItem( nWhich );
658 }
659 else if(SID_INSERT_FLOATINGFRAME == nWhich && bHtmlModeOn)
660 {
661 const sal_uInt16 nExport = SvxHtmlOptions::GetExportMode();
662 if(HTML_CFG_MSIE != nExport && HTML_CFG_WRITER != nExport )
663 rSet.DisableItem(nWhich);
664 }
665 }
666 break;
667
670 {
671 if( GetShell().IsSelFrameMode()
672 || rSh.IsTableMode()
673 || GetShell().CursorInsideInputField()
674 || bCursorInHidden )
675 rSet.DisableItem(nWhich);
676 }
677 break;
678
679 case SID_HYPERLINK_GETLINK:
680 {
682 rSh.GetCurAttr( aSet );
683
684 SvxHyperlinkItem aHLinkItem;
685 if(const SwFormatINetFormat* pINetFormat = aSet.GetItemIfSet(RES_TXTATR_INETFMT, false))
686 {
687 aHLinkItem.SetURL(pINetFormat->GetValue());
688 aHLinkItem.SetTargetFrame(pINetFormat->GetTargetFrame());
689 aHLinkItem.SetIntName(pINetFormat->GetName());
690 const SvxMacro *pMacro = pINetFormat->GetMacro( SvMacroItemId::OnMouseOver );
691 if( pMacro )
692 aHLinkItem.SetMacro(HyperDialogEvent::MouseOverObject, *pMacro);
693
694 pMacro = pINetFormat->GetMacro( SvMacroItemId::OnClick );
695 if( pMacro )
696 aHLinkItem.SetMacro(HyperDialogEvent::MouseClickObject, *pMacro);
697
698 pMacro = pINetFormat->GetMacro( SvMacroItemId::OnMouseOut );
699 if( pMacro )
700 aHLinkItem.SetMacro(HyperDialogEvent::MouseOutObject, *pMacro);
701
702 // Get the text of the Link.
703 rSh.StartAction();
704 const bool bAtEnd(rSh.IsCursorPtAtEnd());
705 if(!bAtEnd) // tdf#91832: ensure forward selection
706 rSh.SwapPam();
707 rSh.CreateCursor();
708 if(!bAtEnd)
709 rSh.SwapPam();
710 rSh.SwCursorShell::SelectTextAttr(RES_TXTATR_INETFMT,true);
711 OUString sLinkName = rSh.GetSelText();
712 aHLinkItem.SetName(sLinkName);
713 aHLinkItem.SetInsertMode(HLINK_FIELD);
714 rSh.DestroyCursor();
715 rSh.EndAction();
716 }
717 else
718 {
719 OUString sReturn = rSh.GetSelText();
720 sReturn = sReturn.copy(0, std::min<sal_Int32>(255, sReturn.getLength()));
721 aHLinkItem.SetName(comphelper::string::stripEnd(sReturn, ' '));
722 }
723
724 aHLinkItem.SetInsertMode(static_cast<SvxLinkInsertMode>(aHLinkItem.GetInsertMode() |
725 (bHtmlModeOn ? HLINK_HTMLMODE : 0)));
726 aHLinkItem.SetMacroEvents ( HyperDialogEvent::MouseOverObject|
727 HyperDialogEvent::MouseClickObject | HyperDialogEvent::MouseOutObject );
728
729 rSet.Put(aHLinkItem);
730 }
731 break;
732
733 case FN_INSERT_FRAME:
734 if (rSh.IsSelFrameMode() )
735 {
736 const SelectionType nSel = rSh.GetSelectionType();
737 if( ((SelectionType::Graphic | SelectionType::Ole ) & nSel ) || bCursorInHidden )
738 rSet.DisableItem(nWhich);
739 }
740 else if ( rSh.CursorInsideInputField() )
741 {
742 rSet.DisableItem(nWhich);
743 }
744 break;
745
746 case FN_FORMAT_COLUMN :
747 {
748 //#i80458# column dialog cannot work if the selection contains different page styles and different sections
749 bool bDisable = true;
750 if( rSh.GetFlyFrameFormat() || rSh.GetSelectedPageDescs() )
751 bDisable = false;
752 if( bDisable )
753 {
754 const SwSection* pCurrSection = rSh.GetCurrSection();
755 const sal_uInt16 nFullSectCnt = rSh.GetFullSelectedSectionCount();
756 if( pCurrSection && ( !rSh.HasSelection() || 0 != nFullSectCnt ))
757 bDisable = false;
758 else if(
759 rSh.HasSelection() && rSh.IsInsRegionAvailable() &&
760 ( !pCurrSection || ( 1 != nFullSectCnt &&
761 lcl_IsMarkInSameSection( rSh, pCurrSection ) )))
762 bDisable = false;
763 }
764 if(bDisable)
765 rSet.DisableItem(nWhich);
766 }
767 break;
768 }
769 nWhich = aIter.NextWhich();
770 }
771}
772
774{
775 SwWrtShell &rSh = GetShell();
776 switch( rReq.GetSlot() )
777 {
778 case FN_DELETE_SENT:
779 if( rSh.IsTableMode() )
780 {
781 rSh.DeleteRow();
782 rSh.EnterStdMode();
783 }
784 else
785 rSh.DelToEndOfSentence();
786 break;
789 break;
790 case FN_DELETE_WORD:
791 rSh.DelNxtWord();
792 break;
794 rSh.DelPrvWord();
795 break;
796 case FN_DELETE_LINE:
797 rSh.DelToEndOfLine();
798 break;
800 rSh.DelToStartOfLine();
801 break;
802 case FN_DELETE_PARA:
803 rSh.DelToEndOfPara();
804 break;
806 rSh.DelToStartOfPara();
807 break;
809 rSh.DelLine();
810 break;
811 default:
812 OSL_ENSURE(false, "wrong dispatcher");
813 return;
814 }
815 rReq.Done();
816}
817
819{
820 using namespace ::com::sun::star::i18n;
821 TransliterationFlags nMode = TransliterationFlags::NONE;
822
823 switch( rReq.GetSlot() )
824 {
825 case SID_TRANSLITERATE_SENTENCE_CASE:
826 nMode = TransliterationFlags::SENTENCE_CASE;
827 break;
828 case SID_TRANSLITERATE_TITLE_CASE:
829 nMode = TransliterationFlags::TITLE_CASE;
830 break;
831 case SID_TRANSLITERATE_TOGGLE_CASE:
832 nMode = TransliterationFlags::TOGGLE_CASE;
833 break;
834 case SID_TRANSLITERATE_UPPER:
835 nMode = TransliterationFlags::LOWERCASE_UPPERCASE;
836 break;
837 case SID_TRANSLITERATE_LOWER:
838 nMode = TransliterationFlags::UPPERCASE_LOWERCASE;
839 break;
840
841 case SID_TRANSLITERATE_HALFWIDTH:
842 nMode = TransliterationFlags::FULLWIDTH_HALFWIDTH;
843 break;
844 case SID_TRANSLITERATE_FULLWIDTH:
845 nMode = TransliterationFlags::HALFWIDTH_FULLWIDTH;
846 break;
847
848 case SID_TRANSLITERATE_HIRAGANA:
849 nMode = TransliterationFlags::KATAKANA_HIRAGANA;
850 break;
851 case SID_TRANSLITERATE_KATAKANA:
852 nMode = TransliterationFlags::HIRAGANA_KATAKANA;
853 break;
854
855 default:
856 OSL_ENSURE(false, "wrong dispatcher");
857 }
858
859 if( nMode != TransliterationFlags::NONE )
860 GetShell().TransliterateText( nMode );
861}
862
864{
865 if( rReq.GetSlot() == SID_TRANSLITERATE_ROTATE_CASE )
867}
868
870 SwBaseShell(_rView)
871{
872 SetName("Text");
874}
875
877{
878}
879
881{
884 XATTR_FILL_FIRST, XATTR_FILL_LAST, // tdf#95003
885 SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER,
886 SID_ATTR_PAGE_SIZE, SID_ATTR_PAGE_SIZE,
887 SID_COLOR_TABLE, SID_PATTERN_LIST,
888 SID_HTML_MODE, SID_HTML_MODE,
891 aSet.Put(SfxUInt16Item(SID_HTML_MODE, ::GetHtmlMode(GetView().GetDocShell())));
892
893 // For the Area tab page.
895
897 SwFormatFrameSize aFrameSize(SwFrameSize::Variable, rPg.Width(), rPg.Height());
898 aFrameSize.SetWhich(GetPool().GetWhich(SID_ATTR_PAGE_SIZE));
899 aSet.Put(aFrameSize);
900
902 SwFormatFrameSize aPrtSize(SwFrameSize::Variable, rPr.Width(), rPr.Height());
903 aPrtSize.SetWhich(GetPool().GetWhich(FN_GET_PRINT_AREA));
904 aSet.Put(aPrtSize);
905
906 aSet.Put(rMgr.GetAttrSet());
907 aSet.SetParent( rMgr.GetAttrSet().GetParent() );
908
909 // Delete minimum size in columns.
910 SvxBoxInfoItem aBoxInfo(aSet.Get(SID_ATTR_BORDER_INNER));
911 const SvxBoxItem& rBox = aSet.Get(RES_BOX);
912 aBoxInfo.SetMinDist(false);
913 aBoxInfo.SetDefDist(rBox.GetDistance(SvxBoxItemLine::LEFT));
914 aSet.Put(aBoxInfo);
915
916 return aSet;
917}
918
920{
921 const SfxItemSet *pArgs = rReq.GetArgs();
922 const SfxStringItem* pItem = nullptr;
923 if( pArgs )
924 pItem = pArgs->GetItemIfSet(SID_CHARMAP, false);
925
926 OUString aChars, aFontName;
927 if ( pItem )
928 {
929 aChars = pItem->GetValue();
930 const SfxStringItem* pFontItem = pArgs->GetItemIfSet( SID_ATTR_SPECIALCHAR, false );
931 if ( pFontItem )
932 aFontName = pFontItem->GetValue();
933 }
934
935 SwWrtShell &rSh = GetShell();
939 rSh.GetCurAttr( aSet );
940 SvtScriptType nScript = rSh.GetScriptType();
941
942 std::shared_ptr<SvxFontItem> aFont(std::make_shared<SvxFontItem>(RES_CHRATR_FONT));
943 {
944 SvxScriptSetItem aSetItem( SID_ATTR_CHAR_FONT, *aSet.GetPool() );
945 aSetItem.GetItemSet().Put( aSet, false );
946 const SfxPoolItem* pI = aSetItem.GetItemOfScript( nScript );
947 if( pI )
948 {
949 aFont.reset(static_cast<SvxFontItem*>(pI->Clone()));
950 }
951 else
952 {
953 TypedWhichId<SvxFontItem> nFontWhich =
957 aFont.reset(aSet.Get(nFontWhich).Clone());
958 }
959
960 if (aFontName.isEmpty())
961 aFontName = aFont->GetFamilyName();
962 }
963
964 vcl::Font aNewFont(aFontName, Size(1,1)); // Size only because CTOR.
965 if( aChars.isEmpty() )
966 {
967 // Set selected font as default.
968 SfxAllItemSet aAllSet( rSh.GetAttrPool() );
969 aAllSet.Put( SfxBoolItem( FN_PARAM_1, false ) );
970
971 SwViewOption aOpt(*GetShell().GetViewOptions());
972 const OUString& sSymbolFont = aOpt.GetSymbolFont();
973 if( aFontName.isEmpty() && !sSymbolFont.isEmpty() )
974 aAllSet.Put( SfxStringItem( SID_FONT_NAME, sSymbolFont ) );
975 else
976 aAllSet.Put( SfxStringItem( SID_FONT_NAME, aFont->GetFamilyName() ) );
977
981 pDlg->Execute();
982 return;
983 }
984
985 if( aChars.isEmpty() )
986 return;
987
988 rSh.StartAllAction();
989
990 // Delete selected content.
991 SwRewriter aRewriter;
992 aRewriter.AddRule(UndoArg1, SwResId(STR_SPECIALCHAR));
993
994 rSh.StartUndo( SwUndoId::INSERT, &aRewriter );
995 if ( rSh.HasSelection() )
996 {
997 rSh.DelRight();
998 aSet.ClearItem();
999 rSh.GetCurAttr( aSet );
1000
1001 SvxScriptSetItem aSetItem( SID_ATTR_CHAR_FONT, *aSet.GetPool() );
1002 aSetItem.GetItemSet().Put( aSet, false );
1003 const SfxPoolItem* pI = aSetItem.GetItemOfScript( nScript );
1004 if( pI )
1005 {
1006 aFont.reset(static_cast<SvxFontItem*>(pI->Clone()));
1007 }
1008 else
1009 {
1010 TypedWhichId<SvxFontItem> nFontWhich =
1014 aFont.reset(aSet.Get( nFontWhich ).Clone());
1015 }
1016 }
1017
1018 // Insert character.
1019 rSh.Insert( aChars );
1020
1021 // #108876# a font attribute has to be set always due to a guessed script type
1022 if( !aNewFont.GetFamilyName().isEmpty() )
1023 {
1024 std::unique_ptr<SvxFontItem> aNewFontItem(aFont->Clone());
1025 aNewFontItem->SetFamilyName( aNewFont.GetFamilyName() );
1026 aNewFontItem->SetFamily( aNewFont.GetFamilyType());
1027 aNewFontItem->SetPitch( aNewFont.GetPitch());
1028 aNewFontItem->SetCharSet( aNewFont.GetCharSet() );
1029
1033
1034 nScript = g_pBreakIt->GetAllScriptsOfText( aChars );
1035 if( SvtScriptType::LATIN & nScript )
1036 {
1037 aRestoreSet.Put( aSet.Get( RES_CHRATR_FONT ) );
1038 aNewFontItem->SetWhich(RES_CHRATR_FONT);
1039 aSet.Put( *aNewFontItem );
1040 }
1041 if( SvtScriptType::ASIAN & nScript )
1042 {
1043 aRestoreSet.Put( aSet.Get( RES_CHRATR_CJK_FONT ) );
1044 aNewFontItem->SetWhich(RES_CHRATR_CJK_FONT);
1045 aSet.Put( *aNewFontItem );
1046 }
1047 if( SvtScriptType::COMPLEX & nScript )
1048 {
1049 aRestoreSet.Put( aSet.Get( RES_CHRATR_CTL_FONT ) );
1050 aNewFontItem->SetWhich(RES_CHRATR_CTL_FONT);
1051 aSet.Put( *aNewFontItem );
1052 }
1053
1054 rSh.SetMark();
1055 rSh.ExtendSelection( false, aChars.getLength() );
1057 if( !rSh.IsCursorPtAtEnd() )
1058 rSh.SwapPam();
1059
1060 rSh.ClearMark();
1061
1062 // #i75891#
1063 // SETATTR_DONTEXPAND does not work if there are already hard attributes.
1064 // Therefore we have to restore the font attributes.
1065 rSh.SetMark();
1066 rSh.SetAttrSet( aRestoreSet );
1067 rSh.ClearMark();
1068
1069 rSh.UpdateAttr();
1070
1071 // Why was this done? aFont is not used anymore below, we are not
1072 // in a loop and it's a local variable...?
1073 // aFont = aNewFontItem;
1074 }
1075
1076 rSh.EndAllAction();
1077 rSh.EndUndo();
1078
1079 if ( !aChars.isEmpty() )
1080 {
1081 rReq.AppendItem( SfxStringItem( SID_CHARMAP, aChars ) );
1082 rReq.AppendItem( SfxStringItem( SID_ATTR_SPECIALCHAR, aNewFont.GetFamilyName() ) );
1083 rReq.Done();
1084 }
1085}
1086
1087/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
@ FRAME_CAP
@ UndoArg1
Definition: SwRewriter.hxx:29
const char * pName
SwBreakIt * g_pBreakIt
Definition: breakit.cxx:34
#define GetWhich(nSlot)
sal_uInt16 GetValue() const
const OUString & GetValue() const
virtual const SwDrawModel * GetDrawModel() const =0
Draw Model and id accessors.
tools::Long AdjustY(tools::Long nVertMove)
tools::Long AdjustX(tools::Long nHorzMove)
TransliterationFlags getNextMode()
const css::uno::Reference< css::frame::XDispatchRecorder > & GetRecorder() const
const css::uno::Reference< css::frame::XFrame > & GetFrameInterface() const
const SvGlobalName & GetValue() const
void RegisterPopupMenu(const OUString &)
void RegisterChildWindow(sal_uInt16, bool bContext=false)
void RegisterObjectBar(sal_uInt16, SfxVisibilityFlags nFlags, ToolbarId eId)
void SetParent(const SfxItemSet *pNew)
const T * GetItemIfSet(TypedWhichId< T > nWhich, bool bSrchInParent=true) const
const SfxItemSet * GetParent() 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)
SfxObjectCreateMode GetCreateMode() const
const Point & GetValue() const
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const=0
sal_uInt16 GetSlot() const
void Ignore()
const SfxItemSet * GetArgs() const
const T * GetArg(sal_uInt16 nSlotId) const
void AppendItem(const SfxPoolItem &)
void SetReturnValue(const SfxPoolItem &)
sal_uInt16 GetModifier() const
bool IsAPI() const
void Done(bool bRemove=false)
SfxItemPool & GetPool() const
void SetContextName(const OUString &rsContextName)
static SfxInterface * GetStaticInterface()
void SetName(const OUString &rName)
SfxBindings & GetBindings()
SfxFrame & GetFrame() const
SfxViewFrame & GetViewFrame() const
sal_uInt16 FirstWhich()
sal_uInt16 NextWhich()
constexpr tools::Long Height() const
void setWidth(tools::Long nWidth)
constexpr tools::Long Width() const
css::uno::Sequence< sal_Int8 > GetByteSequence() const
bool IsMath() const
bool IsChart() const
virtual VclPtr< SfxAbstractDialog > CreateCharMapDialog(weld::Window *pParent, const SfxItemSet &rAttr, const css::uno::Reference< css::frame::XFrame > &rFrame)=0
static SvxAbstractDialogFactory * Create()
bool IsAutoFormatByInput() const
SvxAutoCorrect * GetAutoCorrect()
static SvxAutoCorrCfg & Get()
bool IsAutoCorrFlag(ACFlags nFlag) const
void SetMinDist(bool bNew)
void SetDefDist(sal_uInt16 nNew)
sal_Int16 GetDistance(SvxBoxItemLine nLine, bool bAllowNegative=false) const
void SetMacroEvents(const HyperDialogEvent nEvents)
SvxLinkInsertMode GetInsertMode() const
void SetIntName(const OUString &rIntName)
void SetName(const OUString &rName)
void SetInsertMode(SvxLinkInsertMode eNew)
void SetURL(const OUString &rURL)
void SetMacro(HyperDialogEvent nEvent, const SvxMacro &rMacro)
void SetTargetFrame(const OUString &rTarget)
const SfxPoolItem * GetItemOfScript(SvtScriptType nScript) const
const Size & GetSize() const
virtual VclPtr< VclAbstractDialog > CreateSwContentControlDlg(weld::Window *pParent, SwWrtShell &rSh)=0
virtual VclPtr< VclAbstractDialog > CreateSwColumnDialog(weld::Window *pParent, SwWrtShell &rSh)=0
virtual VclPtr< SfxAbstractTabDialog > CreateFrameTabDialog(const OUString &rDialogType, SfxViewFrame &rFrame, weld::Window *pParent, const SfxItemSet &rCoreSet, bool bNewFrame=true, const OUString &sDefPage={})=0
static SwAbstractDialogFactory * Create()
Definition: swabstdlg.cxx:36
SwWrtShell & GetShell()
Definition: basesh.cxx:3001
SwView & GetView()
Definition: basesh.hxx:59
void InsertTable(SfxRequest &_rRequest)
Definition: basesh.cxx:3063
SwWrtShell * GetShellPtr()
Definition: basesh.cxx:3006
SvtScriptType GetAllScriptsOfText(const OUString &rText) const
Definition: breakit.cxx:128
OUString GetBoxNms() const
Definition: trvltbl.cxx:743
void StartAction()
Definition: crsrsh.cxx:226
void SwapPam()
Definition: crsrsh.cxx:1262
bool IsInHiddenRange(const bool bSelect)
If the current cursor position is inside a hidden range true is returned.
Definition: crsrsh.cxx:3780
OUString GetSelText() const
get selected text of a node at current cursor
Definition: crsrsh.cxx:2862
bool ExtendSelection(bool bEnd=true, sal_Int32 nCount=1)
extend current SSelection by n characters
Definition: crsrsh.cxx:2944
bool CursorInsideInputField() const
Definition: crstrvl.cxx:1094
void UpdateAttr()
Definition: crsrsh.hxx:787
SwPaM * CreateCursor()
delete the current cursor and make the following into the current
Definition: crsrsh.cxx:123
void EndAction(const bool bIdleEnd=false)
Definition: crsrsh.cxx:243
void ClearMark()
Definition: crsrsh.cxx:1225
void SetMark()
Definition: crsrsh.hxx:906
SwTextContentControl * CursorInsideContentControl() const
Definition: crstrvl.cxx:1104
void DestroyCursor()
transform TableCursor to normal cursor, nullify Tablemode
Definition: crsrsh.cxx:151
bool IsCursorPtAtEnd() const
Definition: crsrsh.hxx:920
bool IsTableMode() const
Definition: crsrsh.hxx:668
IDocumentDrawModelAccess const & getIDocumentDrawModelAccess() const
Definition: doc.cxx:169
void PutAreaListItems(SfxItemSet &rSet) const
Put needed items for XPropertyList entries from the DrawModel.
Definition: drawdoc.cxx:151
bool GetCurAttr(SfxItemSet &, const bool bMergeIndentValuesOfNumRule=false) const
Definition: edattr.cxx:171
void StartAllAction()
For all views of this document.
Definition: edws.cxx:86
SwUndoId StartUndo(SwUndoId eUndoId=SwUndoId::EMPTY, const SwRewriter *pRewriter=nullptr)
Undo: set up Undo parenthesis, return nUndoId of this parenthesis.
Definition: edws.cxx:223
void SetAttrSet(const SfxItemSet &, SetAttrMode nFlags=SetAttrMode::DEFAULT, SwPaM *pCursor=nullptr, const bool bParagraphSetting=false)
Definition: edatmisc.cxx:129
SwFrameFormat * GetTableFormat()
Definition: edws.cxx:183
svt::EmbeddedObjectRef & GetOLEObject() const
Get OLE object at pointer.
Definition: editsh.cxx:358
sal_uInt16 GetFullSelectedSectionCount() const
Search inside the cursor selection for full selected sections.
Definition: edsect.cxx:246
const SwSection * GetCurrSection() const
Definition: edsect.cxx:71
SvtScriptType GetScriptType() const
returns the script type of the selection
Definition: edattr.cxx:662
void Undo(sal_uInt16 const nCount=1, sal_uInt16 nOffset=0)
Definition: edundo.cxx:105
bool IsInsRegionAvailable() const
Definition: edsect.cxx:58
SwUndoId EndUndo(SwUndoId eUndoId=SwUndoId::EMPTY, const SwRewriter *pRewriter=nullptr)
Closes parenthesis of nUndoId, not used by UI.
Definition: edws.cxx:234
void EndAllAction()
Definition: edws.cxx:97
void TransliterateText(TransliterationFlags nType)
Change text to Upper/Lower/Hiragana/Katakana/...
Definition: editsh.cxx:1058
Window class for the Writer edit area, this is the one handling mouse and keyboard events and doing t...
Definition: edtwin.hxx:61
void StopQuickHelp()
Definition: edtwin.cxx:6192
const SwPageDesc * GetSelectedPageDescs() const
if inside all selection only one PageDesc,
Definition: fedesc.cxx:185
bool IsFrameSelected() const
Definition: feshview.cxx:1133
Size GetObjSize() const
Definition: feshview.cxx:2270
Point GetObjAbsPos() const
Definition: feshview.cxx:2312
bool DeleteRow(bool bCompleteTable=false)
Definition: fetab.cxx:382
const SwRect & GetAnyCurRect(CurRectType eType, const Point *pPt=nullptr, const css::uno::Reference< css::embed::XEmbeddedObject > &=css::uno::Reference< css::embed::XEmbeddedObject >()) const
Definition: fews.cxx:90
size_t IsObjSelected() const
Definition: feshview.cxx:1125
const SwFrameFormat * GetFlyFrameFormat() const
Get FlyFrameFormat; for UI macro linkage at Flys.
Definition: fefly1.cxx:1270
void InsertFlyFrame()
Definition: frmmgr.cxx:189
RndStdIds GetAnchor() const
Definition: frmmgr.hxx:167
Point GetPos() const
Definition: frmmgr.hxx:163
void SetCol(const SwFormatCol &rCol)
Definition: frmmgr.cxx:244
void SetAttrSet(const SfxItemSet &rSet)
Definition: frmmgr.cxx:619
const Size & GetSize() const
Definition: frmmgr.hxx:138
const SfxItemSet & GetAttrSet() const
Definition: frmmgr.hxx:124
sal_uInt16 GetGutterWidth(bool bMin=false) const
Definition: atrfrm.cxx:918
sal_uInt16 GetWishWidth() const
Definition: fmtclds.hxx:122
void Init(sal_uInt16 nNumCols, sal_uInt16 nGutterWidth, sal_uInt16 nAct)
This function allows to (repeatedly) initialize the columns.
Definition: atrfrm.cxx:969
const OUString & GetName() const
Definition: format.hxx:131
Style of a layout element.
Definition: frmfmt.hxx:72
Of course Writer needs its own rectangles.
Definition: swrect.hxx:35
void Height(tools::Long nNew)
Definition: swrect.hxx:193
void Width(tools::Long nNew)
Definition: swrect.hxx:189
void AddRule(SwUndoArg eWhat, const OUString &rWith)
Definition: SwRewriter.cxx:25
css::uno::Reference< css::frame::XModel > InsertChart(css::uno::Reference< css::chart2::data::XDataProvider > const &rxDataProvider, bool bFillWithData, const OUString &rCellRange, SwFlyFrameFormat **ppFlyFrameFormat=nullptr)
Definition: tablemgr.cxx:185
void InsertSymbol(SfxRequest &)
Definition: textsh.cxx:919
void InsertHyperlink(const SvxHyperlinkItem &rHlnkItem)
Definition: textfld.cxx:1614
virtual ~SwTextShell() override
Definition: textsh.cxx:876
void ExecTransliteration(SfxRequest const &)
Definition: textsh.cxx:818
RotateTransliteration m_aRotateCase
Definition: textsh.hxx:35
void StateInsert(SfxItemSet &)
Definition: textsh.cxx:602
bool InsertMediaDlg(SfxRequest const &)
Definition: grfshex.cxx:42
void ExecInsert(SfxRequest &)
Definition: textsh.cxx:133
SfxItemSet CreateInsertFrameItemSet(SwFlyFrameAttrMgr &rMgr)
Create item set for the insert frame dialog.
Definition: textsh.cxx:880
void ExecDelete(SfxRequest &)
Definition: textsh.cxx:773
static void InitInterface_Impl()
SfxInterface initializer.
Definition: textsh.cxx:118
SwTextShell(SwView &rView)
Definition: textsh.cxx:869
void ExecRotateTransliteration(SfxRequest const &)
Definition: textsh.cxx:863
const OUString & GetSymbolFont() const
Definition: viewopt.hxx:739
void UnlockPaint(bool bVirDev=false)
Definition: viewsh.hxx:639
IDocumentUndoRedo const & GetIDocumentUndoRedo() const
Provides access to the document undo/redo interface.
Definition: viewsh.cxx:2835
SwDoc * GetDoc() const
Definition: viewsh.hxx:308
void LockPaint(LockPaintReason eReason)
Definition: viewsh.hxx:632
const SfxItemPool & GetAttrPool() const
Definition: viewsh.hxx:648
Definition: view.hxx:146
void AutoCaption(const sal_uInt16 nType, const SvGlobalName *pOleId=nullptr)
Definition: viewdlg2.cxx:183
SwEditWin & GetEditWin()
Definition: view.hxx:426
SwDocShell * GetDocShell()
Definition: view.cxx:1193
void InsFrameMode(sal_uInt16 nCols)
Definition: view2.cxx:2419
Used by the UI to modify the document model.
Definition: wrtsh.hxx:97
bool IsSelFrameMode() const
Definition: wrtsh.hxx:177
void DelToEndOfLine()
Definition: delete.cxx:128
void DelPrvWord()
Definition: delete.cxx:641
void InsertLineBreak(std::optional< SwLineBreakClear > oClear=std::nullopt)
Definition: wrtsh1.cxx:979
void Insert(const OUString &)
Definition: wrtsh1.cxx:226
SelectionType GetSelectionType() const
Definition: wrtsh1.cxx:1723
void EnterStdMode()
Definition: select.cxx:560
bool InsertOleObject(const svt::EmbeddedObjectRef &xObj, SwFlyFrameFormat **pFlyFrameFormat=nullptr)
Definition: wrtsh1.cxx:513
void SplitNode(bool bAutoFormat=false)
Definition: wrtsh1.cxx:1317
void DelToStartOfSentence()
Definition: delete.cxx:575
void InsertContentControl(SwContentControlType eType)
Definition: wrtsh1.cxx:1040
void InsertByWord(const OUString &)
Definition: wrtsh1.cxx:206
void InsertColumnBreak()
Definition: wrtsh1.cxx:1017
void DelToEndOfPara()
Definition: delete.cxx:537
bool DelRight(bool isReplaceHeuristic=false)
Definition: delete.cxx:285
void DelLine()
Description: Erase the line.
Definition: delete.cxx:103
void InsertObject(const svt::EmbeddedObjectRef &, SvGlobalName const *pName, sal_uInt16 nSlotId=0)
Definition: wrtsh1.cxx:409
void AutoCorrect(SvxAutoCorrect &rACorr, sal_Unicode cChar)
Definition: wrtsh1.cxx:1955
bool HasSelection() const
Definition: wrtsh.hxx:147
void InsertPageBreak(const OUString *pPageDesc=nullptr, const ::std::optional< sal_uInt16 > &rPgNum=std::nullopt)
Definition: wrtsh1.cxx:941
bool DelToEndOfSentence()
Definition: delete.cxx:584
void DelNxtWord()
Definition: delete.cxx:618
void DelToStartOfPara()
Definition: delete.cxx:554
bool IsInClickToEdit() const
Definition: wrtsh.hxx:669
void LaunchOLEObj(sal_Int32 nVerb=css::embed::EmbedVerbs::MS_OLEVERB_PRIMARY)
Definition: wrtsh1.cxx:654
void DelToStartOfLine()
Definition: delete.cxx:120
css::uno::Reference< css::embed::XEmbeddedObject > CreateEmbeddedObject(const css::uno::Sequence< sal_Int8 > &, OUString &, OUString const *pBaseURL=nullptr)
#define SO3_IFRAME_CLASSID
#define SO3_SM_CLASSID
static bool TryRunningState(const css::uno::Reference< css::embed::XEmbeddedObject > &)
sal_Int64 GetViewAspect() const
void Assign(const css::uno::Reference< css::embed::XEmbeddedObject > &xObj, sal_Int64 nAspect)
const css::uno::Reference< css::embed::XEmbeddedObject > & GetObject() const
static const OUString & GetContextName(const Context eContext)
FontFamily GetFamilyType()
const OUString & GetFamilyName() const
FontPitch GetPitch()
rtl_TextEncoding GetCharSet() const
Point PixelToLogic(const Point &rDevicePt) const
virtual Size GetSizePixel() const
#define FN_INSERT_LINEBREAK
Definition: cmdid.h:222
#define FN_INSERT_COMBO_BOX_CONTENT_CONTROL
Definition: cmdid.h:236
#define FN_INSERT_CONTENT_CONTROL
Definition: cmdid.h:224
#define FN_INSERT_FRAME_INTERACT_NOCOL
Definition: cmdid.h:241
#define FN_INSERT_FRAME_INTERACT
Definition: cmdid.h:237
#define FN_INSERT_TABLE
Definition: cmdid.h:234
#define FN_CONTENT_CONTROL_PROPERTIES
Definition: cmdid.h:229
#define FN_INSERT_IDX_ENTRY_DLG
Definition: cmdid.h:240
#define FN_INSERT_PLAIN_TEXT_CONTENT_CONTROL
Definition: cmdid.h:232
#define FN_INSERT_AUTH_ENTRY_DLG
Definition: cmdid.h:304
#define FN_DELETE_LINE
Definition: cmdid.h:703
#define FN_DELETE_BACK_LINE
Definition: cmdid.h:704
#define FN_EDIT_FORMULA
Definition: cmdid.h:85
#define FN_DELETE_SENT
Definition: cmdid.h:699
#define FN_SET_FRM_NAME
Definition: cmdid.h:888
#define FN_FORMAT_COLUMN
Definition: cmdid.h:351
#define FN_GET_PRINT_AREA
Definition: cmdid.h:773
#define FN_INSERT_FRAME
Definition: cmdid.h:238
#define FN_INSERT_DROPDOWN_CONTENT_CONTROL
Definition: cmdid.h:228
#define FN_DELETE_BACK_PARA
Definition: cmdid.h:706
#define FN_DELETE_PARA
Definition: cmdid.h:705
#define FN_DELETE_WORD
Definition: cmdid.h:701
#define FN_INSERT_PAGEBREAK
Definition: cmdid.h:227
#define FN_DELETE_BACK_WORD
Definition: cmdid.h:702
#define FN_INSERT_DATE_CONTENT_CONTROL
Definition: cmdid.h:231
#define FN_INSERT_STRING
Definition: cmdid.h:235
#define FN_DELETE_WHOLE_LINE
Definition: cmdid.h:707
#define FN_INSERT_SMA
Definition: cmdid.h:251
#define FN_INSERT_FIELD
Definition: cmdid.h:211
#define FN_WORDCOUNT_DIALOG
Definition: cmdid.h:627
#define FN_INSERT_COLUMN_BREAK
Definition: cmdid.h:210
#define FN_INSERT_PICTURE_CONTENT_CONTROL
Definition: cmdid.h:230
#define FN_INSERT_CHECKBOX_CONTENT_CONTROL
Definition: cmdid.h:225
#define FN_DELETE_BACK_SENT
Definition: cmdid.h:700
weld::Window * GetFrameWeld(const SfxFrame *pFrame)
Definition: dialoghelp.cxx:19
@ Page
Rect of current page.
@ PagePrt
Rect of current PrtArea of page.
FieldUnit
@ Variable
Frame is variable in Var-direction.
ScrollingMode
SelectionType
constexpr sal_uInt16 RES_FRMATR_BEGIN(RES_PARATR_LIST_END)
constexpr TypedWhichId< SvxFontItem > RES_CHRATR_CJK_FONT(22)
constexpr TypedWhichId< SvxFontItem > RES_CHRATR_CTL_FONT(27)
constexpr sal_uInt16 RES_FRMATR_END(141)
constexpr TypedWhichId< SwFormatINetFormat > RES_TXTATR_INETFMT(51)
constexpr TypedWhichId< SvxBoxItem > RES_BOX(112)
constexpr TypedWhichId< SvxFontItem > RES_CHRATR_FONT(7)
sal_uInt16 GetWhichOfScript(sal_uInt16 nWhich, sal_uInt16 nScript)
Definition: hints.cxx:184
SvxLinkInsertMode
HLINK_FIELD
HLINK_HTMLMODE
#define HTML_CFG_WRITER
#define HTML_CFG_MSIE
HTMLMODE_ON
LanguageType GetAppLanguage()
Definition: init.cxx:741
OUString aName
constexpr sal_uInt16 KEY_MOD1
SvtScriptType
sal_Int16 GetI18NScriptTypeOfLanguage(LanguageType nLang)
sal_uInt16 GetExportMode()
OString stripEnd(const OString &rIn, char c)
constexpr auto toTwips(N number, Length from)
constexpr Point convert(const Point &rPoint, o3tl::Length eFrom, o3tl::Length eTo)
static constexpr auto Items
long Long
#define SFX_OBJECTBAR_OBJECT
SfxObjectCreateMode
const char GetValue[]
static SfxItemSet & rSet
#define SFX_IMPL_INTERFACE(Class, SuperClass)
std::function< void(sal_Int32)> maEndDialogFn
Reference< XFrame > xFrame
RndStdIds
SwView * GetActiveView()
Definition: swmodul1.cxx:115
OUString SwResId(TranslateId aId)
Definition: swmodule.cxx:168
#define SW_MOD()
Definition: swmodule.hxx:254
#define MINLAY
Definition: swtypes.hxx:62
#define CHAR_HARDBLANK
Definition: swtypes.hxx:173
constexpr SwTwips DEF_GUTTER_WIDTH
Definition: swtypes.hxx:65
#define CHAR_LRM
Definition: swtypes.hxx:177
#define CHAR_SOFTHYPHEN
Definition: swtypes.hxx:175
#define CHAR_WJ
Definition: swtypes.hxx:179
#define CHAR_HARDHYPHEN
Definition: swtypes.hxx:174
#define CHAR_RLM
Definition: swtypes.hxx:176
#define CHAR_ZWSP
Definition: swtypes.hxx:178
#define CHAR_NNBSP
Definition: swtypes.hxx:180
static bool lcl_IsMarkInSameSection(SwWrtShell &rWrtSh, const SwSection *pSect)
Definition: textsh.cxx:594
IMPL_STATIC_LINK(SwTextShell, DialogClosedHdl, css::ui::dialogs::DialogClosedEvent *, pEvent, void)
Definition: textsh.cxx:98
TransliterationFlags
sal_uInt16 sal_Unicode
SW_DLLPUBLIC FieldUnit GetDfltMetric(bool bWeb)
Definition: uitool.cxx:756
RET_OK
sal_uInt16 GetHtmlMode(const SwDocShell *pShell)
Definition: viewopt.cxx:415
constexpr sal_uInt16 XATTR_FILL_FIRST(XATTRSET_LINE+1)
constexpr sal_uInt16 XATTR_FILL_LAST(XATTR_FILLUSESLIDEBACKGROUND)