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 SwView* pView = ::GetActiveView();
101 SwWrtShell& rWrtShell = pView->GetWrtShell();
102
103 sal_Int16 nDialogRet = pEvent->DialogResult;
104 if( nDialogRet == ui::dialogs::ExecutableDialogResults::CANCEL )
105 {
106 rWrtShell.Undo();
107 rWrtShell.GetIDocumentUndoRedo().ClearRedo();
108 }
109 else
110 {
111 OSL_ENSURE( nDialogRet == ui::dialogs::ExecutableDialogResults::OK,
112 "dialog execution failed" );
113 }
114}
115
117{
119
120 GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_OBJECT, SfxVisibilityFlags::Invisible, ToolbarId::Text_Toolbox_Sw);
121
126 GetStaticInterface()->RegisterChildWindow(SID_RUBY_DIALOG);
128}
129
130
132{
133 SwWrtShell &rSh = GetShell();
134
135 OSL_ENSURE( !rSh.IsObjSelected() && !rSh.IsFrameSelected(),
136 "wrong shell on dispatcher" );
137
138 const SfxItemSet *pArgs = rReq.GetArgs();
139 const SfxPoolItem* pItem = nullptr;
140 const sal_uInt16 nSlot = rReq.GetSlot();
141 if(pArgs)
142 pArgs->GetItemState(nSlot, false, &pItem );
143
144 switch( nSlot )
145 {
146 case FN_INSERT_STRING:
147 if( pItem )
148 rSh.InsertByWord(static_cast<const SfxStringItem *>(pItem)->GetValue());
149 break;
150
151 case FN_INSERT_SOFT_HYPHEN:
152 if( CHAR_SOFTHYPHEN != rSh.SwCursorShell::GetChar() &&
153 CHAR_SOFTHYPHEN != rSh.SwCursorShell::GetChar( true, -1 ))
154 rSh.Insert( OUString( CHAR_SOFTHYPHEN ) );
155 break;
156
157 case FN_INSERT_HARDHYPHEN:
158 case FN_INSERT_HARD_SPACE:
159 {
160 const sal_Unicode cIns = FN_INSERT_HARD_SPACE == nSlot ? CHAR_HARDBLANK : CHAR_HARDHYPHEN;
161
163 SvxAutoCorrect* pACorr = rACfg.GetAutoCorrect();
164 if( pACorr && rACfg.IsAutoFormatByInput()
165 && pACorr->IsAutoCorrFlag(
166 ACFlags::CapitalStartSentence | ACFlags::CapitalStartWord |
167 ACFlags::AddNonBrkSpace | ACFlags::ChgOrdinalNumber | ACFlags::TransliterateRTL |
168 ACFlags::ChgToEnEmDash | ACFlags::SetINetAttr | ACFlags::Autocorrect ) )
169 {
170 rSh.AutoCorrect( *pACorr, cIns );
171 }
172 else
173 {
174 rSh.Insert( OUString( cIns ) );
175 }
176 }
177 break;
178
179 case FN_INSERT_NNBSP: // shift+mod2/alt+space inserts some other character w/o going through SwEditWin::KeyInput(), at least on macOS
180 case SID_INSERT_RLM :
181 case SID_INSERT_LRM :
182 case SID_INSERT_WJ :
183 case SID_INSERT_ZWSP:
184 {
185 sal_Unicode cIns = 0;
186 switch(nSlot)
187 {
188 case SID_INSERT_RLM : cIns = CHAR_RLM ; break;
189 case SID_INSERT_LRM : cIns = CHAR_LRM ; break;
190 case SID_INSERT_ZWSP : cIns = CHAR_ZWSP ; break;
191 case SID_INSERT_WJ: cIns = CHAR_WJ; break;
192 case FN_INSERT_NNBSP: cIns = CHAR_NNBSP; break;
193 }
194 rSh.Insert( OUString( cIns ) );
195 }
196 break;
197
198 case FN_INSERT_BREAK:
199 {
201 {
202 rSh.SplitNode();
203 }
204 else
205 {
206 rSh.InsertLineBreak();
207 }
208 }
209 rReq.Done();
210 break;
211
213 rSh.InsertPageBreak();
214 rReq.Done();
215 break;
216
218 rSh.InsertLineBreak();
219 rReq.Done();
220 break;
221
224 rReq.Done();
225 break;
226
229 rReq.Done();
230 break;
231
234 rReq.Done();
235 break;
236
239 rReq.Done();
240 break;
241
244 rReq.Done();
245 break;
246
249 rReq.Done();
250 break;
251
254 rReq.Done();
255 break;
256
258 {
259 SwWrtShell& rWrtSh = GetShell();
263 aContext.maEndDialogFn = [](sal_Int32){};
264 pDlg->StartExecuteAsync(aContext);
265 rReq.Done();
266 break;
267 }
268
270 rSh.InsertColumnBreak();
271 rReq.Done();
272 break;
273
274 case SID_HYPERLINK_SETLINK:
275 if (pItem)
276 InsertHyperlink(*static_cast<const SvxHyperlinkItem *>(pItem));
277 rReq.Done();
278 break;
279
280#if HAVE_FEATURE_AVMEDIA
281 case SID_INSERT_AVMEDIA:
282 rReq.SetReturnValue(SfxBoolItem(nSlot, InsertMediaDlg( rReq )));
283 break;
284#endif
285
286 case SID_INSERT_OBJECT:
287 {
288 const SfxGlobalNameItem* pNameItem = rReq.GetArg<SfxGlobalNameItem>(SID_INSERT_OBJECT);
289 SvGlobalName *pName = nullptr;
291 if ( pNameItem )
292 {
293 aName = pNameItem->GetValue();
294 pName = &aName;
295 }
296
298 rSh.InsertObject( xObj, pName, nSlot);
299 rReq.Done();
300 break;
301 }
302 case SID_INSERT_FLOATINGFRAME:
303 {
305 const SfxStringItem* pNameItem = rReq.GetArg<SfxStringItem>(FN_PARAM_1);
306 const SfxStringItem* pURLItem = rReq.GetArg<SfxStringItem>(FN_PARAM_2);
307 const SvxSizeItem* pMarginItem = rReq.GetArg<SvxSizeItem>(FN_PARAM_3);
308 const SfxByteItem* pScrollingItem = rReq.GetArg<SfxByteItem>(FN_PARAM_4);
309 const SfxBoolItem* pBorderItem = rReq.GetArg<SfxBoolItem>(FN_PARAM_5);
310
311 if(pURLItem) // URL is a _must_
312 {
314 OUString aName;
316 embed::Aspects::MSOLE_CONTENT );
318 uno::Reference < beans::XPropertySet > xSet( xObj->getComponent(), uno::UNO_QUERY );
319 if ( xSet.is() )
320 {
321 try
322 {
323 ScrollingMode eScroll = ScrollingMode::Auto;
324 if( pScrollingItem && pScrollingItem->GetValue() <= int(ScrollingMode::Auto) )
325 eScroll = static_cast<ScrollingMode>(pScrollingItem->GetValue());
326
327 Size aMargin;
328 if ( pMarginItem )
329 aMargin = pMarginItem->GetSize();
330
331 xSet->setPropertyValue("FrameURL", uno::Any( pURLItem->GetValue() ) );
332 if ( pNameItem )
333 xSet->setPropertyValue("FrameName", uno::Any( pNameItem->GetValue() ) );
334
335 if ( eScroll == ScrollingMode::Auto )
336 xSet->setPropertyValue("FrameIsAutoScroll",
337 uno::Any( true ) );
338 else
339 xSet->setPropertyValue("FrameIsScrollingMode",
340 uno::Any( eScroll == ScrollingMode::Yes ) );
341
342 if ( pBorderItem )
343 xSet->setPropertyValue("FrameIsBorder",
344 uno::Any( pBorderItem->GetValue() ) );
345
346 if ( pMarginItem )
347 {
348 xSet->setPropertyValue("FrameMarginWidth",
349 uno::Any( sal_Int32( aMargin.Width() ) ) );
350
351 xSet->setPropertyValue("FrameMarginHeight",
352 uno::Any( sal_Int32( aMargin.Height() ) ) );
353 }
354 }
355 catch (const uno::Exception&)
356 {
357 }
358 }
359
360 rSh.InsertOleObject( xObj );
361 }
362 else
363 {
364 rSh.InsertObject( xObj, nullptr, nSlot);
365 rReq.Done();
366 }
367 }
368 break;
369 case SID_INSERT_DIAGRAM:
370 {
371 SvtModuleOptions aMOpt;
372 if ( !aMOpt.IsChart() )
373 break;
374 if(!rReq.IsAPI())
375 {
376 SwInsertChart( LINK( this, SwTextShell, DialogClosedHdl ) );
377 }
378 else
379 {
380 uno::Reference< chart2::data::XDataProvider > xDataProvider;
381 bool bFillWithData = true;
382 OUString aRangeString;
383 if (!GetShell().IsTableComplexForChart())
384 {
385 SwFrameFormat* pTableFormat = GetShell().GetTableFormat();
386 aRangeString = pTableFormat->GetName() + "."
387 + GetShell().GetBoxNms();
388
389 // get table data provider
390 xDataProvider.set( GetView().GetDocShell()->getIDocumentChartDataProviderAccess().GetChartDataProvider() );
391 }
392 else
393 bFillWithData = false; // will create chart with only it's default image
394
395 SwTableFUNC( &rSh ).InsertChart( xDataProvider, bFillWithData, aRangeString );
396 rSh.LaunchOLEObj();
397
399 if(pItem && xObj.is())
400 {
401 Size aSize(static_cast<const SvxSizeItem*>(pItem)->GetSize());
403
404 if(aSize.Width() > MINLAY&& aSize.Height()> MINLAY)
405 {
406 awt::Size aSz;
407 aSz.Width = aSize.Width();
408 aSz.Height = aSize.Height();
409 xObj->setVisualAreaSize( xObj.GetViewAspect(), aSz );
410 }
411 }
412 }
413 }
414 break;
415
416 case FN_INSERT_SMA:
417 {
418 // #i34343# Inserting a math object into an autocompletion crashes
419 // the suggestion has to be removed before
421 SvGlobalName aGlobalName( SO3_SM_CLASSID );
422 rSh.InsertObject( svt::EmbeddedObjectRef(), &aGlobalName );
423 }
424 break;
425
426 case FN_INSERT_TABLE:
427 InsertTable( rReq );
428 break;
429
432 {
433 sal_uInt16 nCols = 1;
434 bool bModifier1 = rReq.GetModifier() == KEY_MOD1;
435 if(pArgs)
436 {
437 const SfxUInt16Item* pColsItem = nullptr;
438 if(FN_INSERT_FRAME_INTERACT_NOCOL != nSlot &&
439 (pColsItem = pArgs->GetItemIfSet(SID_ATTR_COLUMNS, false)))
440 nCols = pColsItem->GetValue();
441 if(const SfxUInt16Item* pModifierItem = pArgs->GetItemIfSet(SID_MODIFIER, false))
442 bModifier1 |= KEY_MOD1 == pModifierItem->GetValue();
443 }
444 if(bModifier1 )
445 {
446 SwEditWin& rEdtWin = GetView().GetEditWin();
447 Size aWinSize = rEdtWin.GetSizePixel();
448 Point aStartPos(aWinSize.Width()/2, aWinSize.Height() / 2);
449 aStartPos = rEdtWin.PixelToLogic(aStartPos);
450 constexpr tools::Long constTwips_2cm = o3tl::toTwips(2, o3tl::Length::cm);
451 constexpr tools::Long constTwips_4cm = o3tl::toTwips(4, o3tl::Length::cm);
452 aStartPos.AdjustX(-constTwips_4cm);
453 aStartPos.AdjustY(-constTwips_2cm);
454 Size aSize(2 * constTwips_4cm, 2 * constTwips_2cm);
457 SwFlyFrameAttrMgr aMgr( true, GetShellPtr(), Frmmgr_Type::TEXT, nullptr );
458 if(nCols > 1)
459 {
460 SwFormatCol aCol;
461 aCol.Init( nCols, aCol.GetGutterWidth(), aCol.GetWishWidth() );
462 aMgr.SetCol( aCol );
463 }
464 aMgr.InsertFlyFrame(RndStdIds::FLY_AT_PARA, aStartPos, aSize);
467 }
468 else
469 {
470 GetView().InsFrameMode(nCols);
471 }
472 rReq.Ignore();
473 }
474 break;
475 case FN_INSERT_FRAME:
476 {
477 bool bSingleCol = false;
478 if( nullptr!= dynamic_cast< SwWebDocShell*>( GetView().GetDocShell()) )
479 {
481 {
482 bSingleCol = true;
483 }
484
485 }
486 // Create new border
487 SwFlyFrameAttrMgr aMgr( true, GetShellPtr(), Frmmgr_Type::TEXT, nullptr );
488 if(pArgs)
489 {
490 Size aSize(aMgr.GetSize());
491 aSize.setWidth( GetShell().GetAnyCurRect(CurRectType::PagePrt).Width() );
492 Point aPos = aMgr.GetPos();
493 RndStdIds eAnchor = RndStdIds::FLY_AT_PARA;
494 if(pArgs->GetItemState(nSlot, false, &pItem) == SfxItemState::SET)
495 eAnchor = static_cast<RndStdIds>(static_cast<const SfxUInt16Item *>(pItem)->GetValue());
496 if(pArgs->GetItemState(FN_PARAM_1, false, &pItem) == SfxItemState::SET)
497 aPos = static_cast<const SfxPointItem *>(pItem)->GetValue();
498 if(pArgs->GetItemState(FN_PARAM_2, false, &pItem) == SfxItemState::SET)
499 aSize = static_cast<const SvxSizeItem *>(pItem)->GetSize();
500 if(const SfxUInt16Item* pColsItem = pArgs->GetItemIfSet(SID_ATTR_COLUMNS, false))
501 {
502 const sal_uInt16 nCols = pColsItem->GetValue();
503 if( !bSingleCol && 1 < nCols )
504 {
505 SwFormatCol aFormatCol;
506 aFormatCol.Init( nCols , (rReq.IsAPI() ? 0
507 : DEF_GUTTER_WIDTH), USHRT_MAX );
508 aMgr.SetCol(aFormatCol);
509 }
510 }
511
514
515 aMgr.InsertFlyFrame(eAnchor, aPos, aSize);
516
519 }
520 else
521 {
523
524 FieldUnit eMetric = ::GetDfltMetric(dynamic_cast<SwWebDocShell*>( GetView().GetDocShell()) != nullptr );
525 SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast< sal_uInt16 >(eMetric)));
528 GetView().GetViewFrame(),
530 aSet));
531 if(pDlg->Execute() == RET_OK && pDlg->GetOutputItemSet())
532 {
533 //local variable necessary at least after call of .AutoCaption() because this could be deleted at this point
534 SwWrtShell& rShell = GetShell();
535 rShell.LockPaint();
536 rShell.StartAllAction();
538
539 const SfxItemSet* pOutSet = pDlg->GetOutputItemSet();
540 aMgr.SetAttrSet(*pOutSet);
541
542 // At first delete the selection at the ClickToEditField.
543 if( rShell.IsInClickToEdit() )
544 rShell.DelRight();
545
546 aMgr.InsertFlyFrame();
547
548 uno::Reference< frame::XDispatchRecorder > xRecorder =
550 if ( xRecorder.is() )
551 {
552 //FN_INSERT_FRAME
553 sal_uInt16 nAnchor = static_cast<sal_uInt16>(aMgr.GetAnchor());
554 rReq.AppendItem(SfxUInt16Item(nSlot, nAnchor));
555 rReq.AppendItem(SfxPointItem(FN_PARAM_1, rShell.GetObjAbsPos()));
556 rReq.AppendItem(SvxSizeItem(FN_PARAM_2, rShell.GetObjSize()));
557 rReq.Done();
558 }
559
561
562 {
563 SwRewriter aRewriter;
564
565 aRewriter.AddRule(UndoArg1, SwResId(STR_FRAME));
566
567 rShell.EndUndo(SwUndoId::INSERT, &aRewriter);
568 }
569 rShell.EndAllAction();
570 rShell.UnlockPaint();
571 }
572 }
573 break;
574 }
575 case FN_FORMAT_COLUMN :
576 {
579 pColDlg->StartExecuteAsync([=](sal_Int32 /*nResult*/){
580 pColDlg->disposeOnce();
581 });
582 }
583 break;
584
585 default:
586 OSL_ENSURE(false, "wrong dispatcher");
587 return;
588 }
589}
590
591static bool lcl_IsMarkInSameSection( SwWrtShell& rWrtSh, const SwSection* pSect )
592{
593 rWrtSh.SwapPam();
594 bool bRet = pSect == rWrtSh.GetCurrSection();
595 rWrtSh.SwapPam();
596 return bRet;
597}
598
600{
601 const bool bHtmlModeOn = ::GetHtmlMode(GetView().GetDocShell()) & HTMLMODE_ON;
602 SfxWhichIter aIter( rSet );
603 SwWrtShell &rSh = GetShell();
604 sal_uInt16 nWhich = aIter.FirstWhich();
605 SvtModuleOptions aMOpt;
606 SfxObjectCreateMode eCreateMode =
608
609 bool bCursorInHidden = false;
610 if( !rSh.HasMark() )
611 {
612 rSh.Push();
613 bCursorInHidden = rSh.SelectHiddenRange();
614 rSh.Pop();
615 }
616
617 while ( nWhich )
618 {
619 switch ( nWhich )
620 {
621 case SID_INSERT_AVMEDIA:
622 if ( GetShell().IsSelFrameMode()
623 || GetShell().CursorInsideInputField()
624 || SfxObjectCreateMode::EMBEDDED == eCreateMode
625 || bCursorInHidden )
626 {
627 rSet.DisableItem( nWhich );
628 }
629 break;
630
631 case SID_INSERT_DIAGRAM:
632 if( !aMOpt.IsChart()
633 || GetShell().CursorInsideInputField()
634 || eCreateMode == SfxObjectCreateMode::EMBEDDED
635 || bCursorInHidden )
636 {
637 rSet.DisableItem( nWhich );
638 }
639 break;
640
641 case FN_INSERT_SMA:
642 if( !aMOpt.IsMath()
643 || eCreateMode == SfxObjectCreateMode::EMBEDDED
644 || bCursorInHidden
645 || rSh.CursorInsideInputField() )
646 {
647 rSet.DisableItem( nWhich );
648 }
649 break;
650
651 case SID_INSERT_FLOATINGFRAME:
652 case SID_INSERT_OBJECT:
653 {
654 if( eCreateMode == SfxObjectCreateMode::EMBEDDED || bCursorInHidden )
655 {
656 rSet.DisableItem( nWhich );
657 }
658 else if( GetShell().IsSelFrameMode()
659 || GetShell().CursorInsideInputField() )
660 {
661 rSet.DisableItem( nWhich );
662 }
663 else if(SID_INSERT_FLOATINGFRAME == nWhich && bHtmlModeOn)
664 {
665 const sal_uInt16 nExport = SvxHtmlOptions::GetExportMode();
666 if(HTML_CFG_MSIE != nExport && HTML_CFG_WRITER != nExport )
667 rSet.DisableItem(nWhich);
668 }
669 }
670 break;
671
674 {
675 if( GetShell().IsSelFrameMode()
676 || rSh.IsTableMode()
677 || GetShell().CursorInsideInputField()
678 || bCursorInHidden )
679 rSet.DisableItem(nWhich);
680 }
681 break;
682
683 case SID_HYPERLINK_GETLINK:
684 {
686 rSh.GetCurAttr( aSet );
687
688 SvxHyperlinkItem aHLinkItem;
689 if(const SwFormatINetFormat* pINetFormat = aSet.GetItemIfSet(RES_TXTATR_INETFMT, false))
690 {
691 aHLinkItem.SetURL(pINetFormat->GetValue());
692 aHLinkItem.SetTargetFrame(pINetFormat->GetTargetFrame());
693 aHLinkItem.SetIntName(pINetFormat->GetName());
694 const SvxMacro *pMacro = pINetFormat->GetMacro( SvMacroItemId::OnMouseOver );
695 if( pMacro )
696 aHLinkItem.SetMacro(HyperDialogEvent::MouseOverObject, *pMacro);
697
698 pMacro = pINetFormat->GetMacro( SvMacroItemId::OnClick );
699 if( pMacro )
700 aHLinkItem.SetMacro(HyperDialogEvent::MouseClickObject, *pMacro);
701
702 pMacro = pINetFormat->GetMacro( SvMacroItemId::OnMouseOut );
703 if( pMacro )
704 aHLinkItem.SetMacro(HyperDialogEvent::MouseOutObject, *pMacro);
705
706 // Get the text of the Link.
707 rSh.StartAction();
708 const bool bAtEnd(rSh.IsCursorPtAtEnd());
709 if(!bAtEnd) // tdf#91832: ensure forward selection
710 rSh.SwapPam();
711 rSh.CreateCursor();
712 if(!bAtEnd)
713 rSh.SwapPam();
714 rSh.SwCursorShell::SelectTextAttr(RES_TXTATR_INETFMT,true);
715 OUString sLinkName = rSh.GetSelText();
716 aHLinkItem.SetName(sLinkName);
717 aHLinkItem.SetInsertMode(HLINK_FIELD);
718 rSh.DestroyCursor();
719 rSh.EndAction();
720 }
721 else
722 {
723 OUString sReturn = rSh.GetSelText();
724 sReturn = sReturn.copy(0, std::min<sal_Int32>(255, sReturn.getLength()));
725 aHLinkItem.SetName(comphelper::string::stripEnd(sReturn, ' '));
726 }
727
728 aHLinkItem.SetInsertMode(static_cast<SvxLinkInsertMode>(aHLinkItem.GetInsertMode() |
729 (bHtmlModeOn ? HLINK_HTMLMODE : 0)));
730 aHLinkItem.SetMacroEvents ( HyperDialogEvent::MouseOverObject|
731 HyperDialogEvent::MouseClickObject | HyperDialogEvent::MouseOutObject );
732
733 rSet.Put(aHLinkItem);
734 }
735 break;
736
737 case FN_INSERT_FRAME:
738 if (rSh.IsSelFrameMode() )
739 {
740 const SelectionType nSel = rSh.GetSelectionType();
741 if( ((SelectionType::Graphic | SelectionType::Ole ) & nSel ) || bCursorInHidden )
742 rSet.DisableItem(nWhich);
743 }
744 else if ( rSh.CursorInsideInputField() )
745 {
746 rSet.DisableItem(nWhich);
747 }
748 break;
749
750 case FN_FORMAT_COLUMN :
751 {
752 //#i80458# column dialog cannot work if the selection contains different page styles and different sections
753 bool bDisable = true;
754 if( rSh.GetFlyFrameFormat() || rSh.GetSelectedPageDescs() )
755 bDisable = false;
756 if( bDisable )
757 {
758 const SwSection* pCurrSection = rSh.GetCurrSection();
759 const sal_uInt16 nFullSectCnt = rSh.GetFullSelectedSectionCount();
760 if( pCurrSection && ( !rSh.HasSelection() || 0 != nFullSectCnt ))
761 bDisable = false;
762 else if(
763 rSh.HasSelection() && rSh.IsInsRegionAvailable() &&
764 ( !pCurrSection || ( 1 != nFullSectCnt &&
765 lcl_IsMarkInSameSection( rSh, pCurrSection ) )))
766 bDisable = false;
767 }
768 if(bDisable)
769 rSet.DisableItem(nWhich);
770 }
771 break;
772 }
773 nWhich = aIter.NextWhich();
774 }
775}
776
778{
779 SwWrtShell &rSh = GetShell();
780 switch( rReq.GetSlot() )
781 {
782 case FN_DELETE_SENT:
783 if( rSh.IsTableMode() )
784 {
785 rSh.DeleteRow();
786 rSh.EnterStdMode();
787 }
788 else
789 rSh.DelToEndOfSentence();
790 break;
793 break;
794 case FN_DELETE_WORD:
795 rSh.DelNxtWord();
796 break;
798 rSh.DelPrvWord();
799 break;
800 case FN_DELETE_LINE:
801 rSh.DelToEndOfLine();
802 break;
804 rSh.DelToStartOfLine();
805 break;
806 case FN_DELETE_PARA:
807 rSh.DelToEndOfPara();
808 break;
810 rSh.DelToStartOfPara();
811 break;
813 rSh.DelLine();
814 break;
815 default:
816 OSL_ENSURE(false, "wrong dispatcher");
817 return;
818 }
819 rReq.Done();
820}
821
823{
824 using namespace ::com::sun::star::i18n;
825 TransliterationFlags nMode = TransliterationFlags::NONE;
826
827 switch( rReq.GetSlot() )
828 {
829 case SID_TRANSLITERATE_SENTENCE_CASE:
830 nMode = TransliterationFlags::SENTENCE_CASE;
831 break;
832 case SID_TRANSLITERATE_TITLE_CASE:
833 nMode = TransliterationFlags::TITLE_CASE;
834 break;
835 case SID_TRANSLITERATE_TOGGLE_CASE:
836 nMode = TransliterationFlags::TOGGLE_CASE;
837 break;
838 case SID_TRANSLITERATE_UPPER:
839 nMode = TransliterationFlags::LOWERCASE_UPPERCASE;
840 break;
841 case SID_TRANSLITERATE_LOWER:
842 nMode = TransliterationFlags::UPPERCASE_LOWERCASE;
843 break;
844
845 case SID_TRANSLITERATE_HALFWIDTH:
846 nMode = TransliterationFlags::FULLWIDTH_HALFWIDTH;
847 break;
848 case SID_TRANSLITERATE_FULLWIDTH:
849 nMode = TransliterationFlags::HALFWIDTH_FULLWIDTH;
850 break;
851
852 case SID_TRANSLITERATE_HIRAGANA:
853 nMode = TransliterationFlags::KATAKANA_HIRAGANA;
854 break;
855 case SID_TRANSLITERATE_KATAKANA:
856 nMode = TransliterationFlags::HIRAGANA_KATAKANA;
857 break;
858
859 default:
860 OSL_ENSURE(false, "wrong dispatcher");
861 }
862
863 if( nMode != TransliterationFlags::NONE )
864 GetShell().TransliterateText( nMode );
865}
866
868{
869 if( rReq.GetSlot() == SID_TRANSLITERATE_ROTATE_CASE )
871}
872
874 SwBaseShell(_rView)
875{
876 SetName("Text");
878}
879
881{
882}
883
885{
888 XATTR_FILL_FIRST, XATTR_FILL_LAST, // tdf#95003
889 SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER,
890 SID_ATTR_PAGE_SIZE, SID_ATTR_PAGE_SIZE,
891 SID_COLOR_TABLE, SID_PATTERN_LIST,
892 SID_HTML_MODE, SID_HTML_MODE,
895 aSet.Put(SfxUInt16Item(SID_HTML_MODE, ::GetHtmlMode(GetView().GetDocShell())));
896
897 // For the Area tab page.
899
901 SwFormatFrameSize aFrameSize(SwFrameSize::Variable, rPg.Width(), rPg.Height());
902 aFrameSize.SetWhich(GetPool().GetWhich(SID_ATTR_PAGE_SIZE));
903 aSet.Put(aFrameSize);
904
906 SwFormatFrameSize aPrtSize(SwFrameSize::Variable, rPr.Width(), rPr.Height());
907 aPrtSize.SetWhich(GetPool().GetWhich(FN_GET_PRINT_AREA));
908 aSet.Put(aPrtSize);
909
910 aSet.Put(rMgr.GetAttrSet());
911 aSet.SetParent( rMgr.GetAttrSet().GetParent() );
912
913 // Delete minimum size in columns.
914 SvxBoxInfoItem aBoxInfo(aSet.Get(SID_ATTR_BORDER_INNER));
915 const SvxBoxItem& rBox = aSet.Get(RES_BOX);
916 aBoxInfo.SetMinDist(false);
917 aBoxInfo.SetDefDist(rBox.GetDistance(SvxBoxItemLine::LEFT));
918 aSet.Put(aBoxInfo);
919
920 return aSet;
921}
922
924{
925 const SfxItemSet *pArgs = rReq.GetArgs();
926 const SfxStringItem* pItem = nullptr;
927 if( pArgs )
928 pItem = pArgs->GetItemIfSet(SID_CHARMAP, false);
929
930 OUString aChars, aFontName;
931 if ( pItem )
932 {
933 aChars = pItem->GetValue();
934 const SfxStringItem* pFontItem = pArgs->GetItemIfSet( SID_ATTR_SPECIALCHAR, false );
935 if ( pFontItem )
936 aFontName = pFontItem->GetValue();
937 }
938
939 SwWrtShell &rSh = GetShell();
943 rSh.GetCurAttr( aSet );
944 SvtScriptType nScript = rSh.GetScriptType();
945
946 std::shared_ptr<SvxFontItem> aFont(std::make_shared<SvxFontItem>(RES_CHRATR_FONT));
947 {
948 SvxScriptSetItem aSetItem( SID_ATTR_CHAR_FONT, *aSet.GetPool() );
949 aSetItem.GetItemSet().Put( aSet, false );
950 const SfxPoolItem* pI = aSetItem.GetItemOfScript( nScript );
951 if( pI )
952 {
953 aFont.reset(static_cast<SvxFontItem*>(pI->Clone()));
954 }
955 else
956 {
957 TypedWhichId<SvxFontItem> nFontWhich =
961 aFont.reset(aSet.Get(nFontWhich).Clone());
962 }
963
964 if (aFontName.isEmpty())
965 aFontName = aFont->GetFamilyName();
966 }
967
968 vcl::Font aNewFont(aFontName, Size(1,1)); // Size only because CTOR.
969 if( aChars.isEmpty() )
970 {
971 // Set selected font as default.
972 SfxAllItemSet aAllSet( rSh.GetAttrPool() );
973 aAllSet.Put( SfxBoolItem( FN_PARAM_1, false ) );
974
975 SwViewOption aOpt(*GetShell().GetViewOptions());
976 const OUString& sSymbolFont = aOpt.GetSymbolFont();
977 if( aFontName.isEmpty() && !sSymbolFont.isEmpty() )
978 aAllSet.Put( SfxStringItem( SID_FONT_NAME, sSymbolFont ) );
979 else
980 aAllSet.Put( SfxStringItem( SID_FONT_NAME, aFont->GetFamilyName() ) );
981
985 pDlg->Execute();
986 return;
987 }
988
989 if( aChars.isEmpty() )
990 return;
991
992 rSh.StartAllAction();
993
994 // Delete selected content.
995 SwRewriter aRewriter;
996 aRewriter.AddRule(UndoArg1, SwResId(STR_SPECIALCHAR));
997
998 rSh.StartUndo( SwUndoId::INSERT, &aRewriter );
999 if ( rSh.HasSelection() )
1000 {
1001 rSh.DelRight();
1002 aSet.ClearItem();
1003 rSh.GetCurAttr( aSet );
1004
1005 SvxScriptSetItem aSetItem( SID_ATTR_CHAR_FONT, *aSet.GetPool() );
1006 aSetItem.GetItemSet().Put( aSet, false );
1007 const SfxPoolItem* pI = aSetItem.GetItemOfScript( nScript );
1008 if( pI )
1009 {
1010 aFont.reset(static_cast<SvxFontItem*>(pI->Clone()));
1011 }
1012 else
1013 {
1014 TypedWhichId<SvxFontItem> nFontWhich =
1018 aFont.reset(aSet.Get( nFontWhich ).Clone());
1019 }
1020 }
1021
1022 // Insert character.
1023 rSh.Insert( aChars );
1024
1025 // #108876# a font attribute has to be set always due to a guessed script type
1026 if( !aNewFont.GetFamilyName().isEmpty() )
1027 {
1028 std::unique_ptr<SvxFontItem> aNewFontItem(aFont->Clone());
1029 aNewFontItem->SetFamilyName( aNewFont.GetFamilyName() );
1030 aNewFontItem->SetFamily( aNewFont.GetFamilyType());
1031 aNewFontItem->SetPitch( aNewFont.GetPitch());
1032 aNewFontItem->SetCharSet( aNewFont.GetCharSet() );
1033
1037
1038 nScript = g_pBreakIt->GetAllScriptsOfText( aChars );
1039 if( SvtScriptType::LATIN & nScript )
1040 {
1041 aRestoreSet.Put( aSet.Get( RES_CHRATR_FONT ) );
1042 aNewFontItem->SetWhich(RES_CHRATR_FONT);
1043 aSet.Put( *aNewFontItem );
1044 }
1045 if( SvtScriptType::ASIAN & nScript )
1046 {
1047 aRestoreSet.Put( aSet.Get( RES_CHRATR_CJK_FONT ) );
1048 aNewFontItem->SetWhich(RES_CHRATR_CJK_FONT);
1049 aSet.Put( *aNewFontItem );
1050 }
1051 if( SvtScriptType::COMPLEX & nScript )
1052 {
1053 aRestoreSet.Put( aSet.Get( RES_CHRATR_CTL_FONT ) );
1054 aNewFontItem->SetWhich(RES_CHRATR_CTL_FONT);
1055 aSet.Put( *aNewFontItem );
1056 }
1057
1058 rSh.SetMark();
1059 rSh.ExtendSelection( false, aChars.getLength() );
1061 if( !rSh.IsCursorPtAtEnd() )
1062 rSh.SwapPam();
1063
1064 rSh.ClearMark();
1065
1066 // #i75891#
1067 // SETATTR_DONTEXPAND does not work if there are already hard attributes.
1068 // Therefore we have to restore the font attributes.
1069 rSh.SetMark();
1070 rSh.SetAttrSet( aRestoreSet );
1071 rSh.ClearMark();
1072
1073 rSh.UpdateAttr();
1074
1075 // Why was this done? aFont is not used anymore below, we are not
1076 // in a loop and it's a local variable...?
1077 // aFont = aNewFontItem;
1078 }
1079
1080 rSh.EndAllAction();
1081 rSh.EndUndo();
1082
1083 if ( !aChars.isEmpty() )
1084 {
1085 rReq.AppendItem( SfxStringItem( SID_CHARMAP, aChars ) );
1086 rReq.AppendItem( SfxStringItem( SID_ATTR_SPECIALCHAR, aNewFont.GetFamilyName() ) );
1087 rReq.Done();
1088 }
1089}
1090
1091/* 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.
virtual void ClearRedo()=0
Delete all Redo actions.
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 *pFrame, weld::Window *pParent, const SfxItemSet &rCoreSet, bool bNewFrame=true, const OString &sDefPage=OString())=0
static SwAbstractDialogFactory * Create()
Definition: swabstdlg.cxx:36
SwWrtShell & GetShell()
Definition: basesh.cxx:2827
SwView & GetView()
Definition: basesh.hxx:59
void InsertTable(SfxRequest &_rRequest)
Definition: basesh.cxx:2889
SwWrtShell * GetShellPtr()
Definition: basesh.cxx:2832
SvtScriptType GetAllScriptsOfText(const OUString &rText) const
Definition: breakit.cxx:128
void Push()
store a copy of the current cursor on the cursor stack
Definition: crsrsh.cxx:2251
OUString GetBoxNms() const
Definition: trvltbl.cxx:743
void StartAction()
Definition: crsrsh.cxx:226
void SwapPam()
Definition: crsrsh.cxx:976
OUString GetSelText() const
get selected text of a node at current cursor
Definition: crsrsh.cxx:2559
bool ExtendSelection(bool bEnd=true, sal_Int32 nCount=1)
extend current SSelection by n characters
Definition: crsrsh.cxx:2641
bool CursorInsideInputField() const
Definition: crstrvl.cxx:963
void UpdateAttr()
Definition: crsrsh.hxx:776
SwPaM * CreateCursor()
delete the current cursor and make the following into the current
Definition: crsrsh.cxx:123
bool HasMark() const
Definition: crsrsh.hxx:897
void EndAction(const bool bIdleEnd=false)
Definition: crsrsh.cxx:243
void ClearMark()
Definition: crsrsh.cxx:939
void SetMark()
Definition: crsrsh.hxx:895
SwTextContentControl * CursorInsideContentControl() const
Definition: crstrvl.cxx:973
void DestroyCursor()
transform TableCursor to normal cursor, nullify Tablemode
Definition: crsrsh.cxx:151
bool IsCursorPtAtEnd() const
Definition: crsrsh.hxx:914
bool IsTableMode() const
Definition: crsrsh.hxx:659
bool SelectHiddenRange()
If the current cursor position is inside a hidden range, the hidden range is selected.
Definition: crsrsh.cxx:3444
IDocumentDrawModelAccess const & getIDocumentDrawModelAccess() const
Definition: doc.cxx:161
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:6161
const SwPageDesc * GetSelectedPageDescs() const
if inside all selection only one PageDesc,
Definition: fedesc.cxx:185
bool IsFrameSelected() const
Definition: feshview.cxx:1253
Size GetObjSize() const
Definition: feshview.cxx:2390
Point GetObjAbsPos() const
Definition: feshview.cxx:2432
bool DeleteRow(bool bCompleteTable=false)
Definition: fetab.cxx:322
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:1245
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:62
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:923
void InsertHyperlink(const SvxHyperlinkItem &rHlnkItem)
Definition: textfld.cxx:1038
virtual ~SwTextShell() override
Definition: textsh.cxx:880
void ExecTransliteration(SfxRequest const &)
Definition: textsh.cxx:822
RotateTransliteration m_aRotateCase
Definition: textsh.hxx:35
void StateInsert(SfxItemSet &)
Definition: textsh.cxx:599
bool InsertMediaDlg(SfxRequest const &)
Definition: grfshex.cxx:42
void ExecInsert(SfxRequest &)
Definition: textsh.cxx:131
SfxItemSet CreateInsertFrameItemSet(SwFlyFrameAttrMgr &rMgr)
Create item set for the insert frame dialog.
Definition: textsh.cxx:884
void ExecDelete(SfxRequest &)
Definition: textsh.cxx:777
static void InitInterface_Impl()
SfxInterface initializer.
Definition: textsh.cxx:116
SwTextShell(SwView &rView)
Definition: textsh.cxx:873
void ExecRotateTransliteration(SfxRequest const &)
Definition: textsh.cxx:867
const OUString & GetSymbolFont() const
Definition: viewopt.hxx:683
void UnlockPaint(bool bVirDev=false)
Definition: viewsh.hxx:619
void LockPaint()
Definition: viewsh.hxx:614
IDocumentUndoRedo const & GetIDocumentUndoRedo() const
Provides access to the document undo/redo interface.
Definition: viewsh.cxx:2821
SwDoc * GetDoc() const
Definition: viewsh.hxx:290
const SfxItemPool & GetAttrPool() const
Definition: viewsh.hxx:624
Definition: view.hxx:146
void AutoCaption(const sal_uInt16 nType, const SvGlobalName *pOleId=nullptr)
Definition: viewdlg2.cxx:183
SwWrtShell & GetWrtShell() const
Definition: view.hxx:416
SwEditWin & GetEditWin()
Definition: view.hxx:419
SwDocShell * GetDocShell()
Definition: view.cxx:1160
void InsFrameMode(sal_uInt16 nCols)
Definition: view2.cxx:2326
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:126
void DelPrvWord()
Definition: delete.cxx:651
void InsertLineBreak(std::optional< SwLineBreakClear > oClear=std::nullopt)
Definition: wrtsh1.cxx:959
void Insert(const OUString &)
Definition: wrtsh1.cxx:224
SelectionType GetSelectionType() const
Definition: wrtsh1.cxx:1706
void EnterStdMode()
Definition: select.cxx:551
bool InsertOleObject(const svt::EmbeddedObjectRef &xObj, SwFlyFrameFormat **pFlyFrameFormat=nullptr)
Definition: wrtsh1.cxx:498
void SplitNode(bool bAutoFormat=false)
Definition: wrtsh1.cxx:1297
void DelToStartOfSentence()
Definition: delete.cxx:585
void InsertContentControl(SwContentControlType eType)
Definition: wrtsh1.cxx:1020
void InsertByWord(const OUString &)
Definition: wrtsh1.cxx:204
void InsertColumnBreak()
Definition: wrtsh1.cxx:997
void DelToEndOfPara()
Definition: delete.cxx:547
bool DelRight(bool isReplaceHeuristic=false)
Definition: delete.cxx:291
void DelLine()
Description: Erase the line.
Definition: delete.cxx:101
void InsertObject(const svt::EmbeddedObjectRef &, SvGlobalName const *pName, sal_uInt16 nSlotId=0)
Definition: wrtsh1.cxx:394
void AutoCorrect(SvxAutoCorrect &rACorr, sal_Unicode cChar)
Definition: wrtsh1.cxx:1938
bool HasSelection() const
Definition: wrtsh.hxx:147
void InsertPageBreak(const OUString *pPageDesc=nullptr, const ::std::optional< sal_uInt16 > &rPgNum=std::nullopt)
Definition: wrtsh1.cxx:921
bool DelToEndOfSentence()
Definition: delete.cxx:594
void DelNxtWord()
Definition: delete.cxx:628
void DelToStartOfPara()
Definition: delete.cxx:564
bool IsInClickToEdit() const
Definition: wrtsh.hxx:662
void LaunchOLEObj(sal_Int32 nVerb=css::embed::EmbedVerbs::MS_OLEVERB_PRIMARY)
Definition: wrtsh1.cxx:639
bool Pop(SwCursorShell::PopMode, ::std::optional< SwCallLink > &roLink)
Definition: wrtsh1.cxx:2030
void DelToStartOfLine()
Definition: delete.cxx:118
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:216
#define FN_INSERT_COMBO_BOX_CONTENT_CONTROL
Definition: cmdid.h:230
#define FN_INSERT_CONTENT_CONTROL
Definition: cmdid.h:218
#define FN_INSERT_FRAME_INTERACT_NOCOL
Definition: cmdid.h:235
#define FN_INSERT_FRAME_INTERACT
Definition: cmdid.h:231
#define FN_INSERT_TABLE
Definition: cmdid.h:228
#define FN_CONTENT_CONTROL_PROPERTIES
Definition: cmdid.h:223
#define FN_INSERT_IDX_ENTRY_DLG
Definition: cmdid.h:234
#define FN_INSERT_PLAIN_TEXT_CONTENT_CONTROL
Definition: cmdid.h:226
#define FN_INSERT_AUTH_ENTRY_DLG
Definition: cmdid.h:297
#define FN_DELETE_LINE
Definition: cmdid.h:684
#define FN_DELETE_BACK_LINE
Definition: cmdid.h:685
#define FN_EDIT_FORMULA
Definition: cmdid.h:84
#define FN_DELETE_SENT
Definition: cmdid.h:680
#define FN_SET_FRM_NAME
Definition: cmdid.h:869
#define FN_FORMAT_COLUMN
Definition: cmdid.h:333
#define FN_GET_PRINT_AREA
Definition: cmdid.h:754
#define FN_INSERT_FRAME
Definition: cmdid.h:232
#define FN_INSERT_DROPDOWN_CONTENT_CONTROL
Definition: cmdid.h:222
#define FN_DELETE_BACK_PARA
Definition: cmdid.h:687
#define FN_DELETE_PARA
Definition: cmdid.h:686
#define FN_DELETE_WORD
Definition: cmdid.h:682
#define FN_INSERT_PAGEBREAK
Definition: cmdid.h:221
#define FN_DELETE_BACK_WORD
Definition: cmdid.h:683
#define FN_INSERT_DATE_CONTENT_CONTROL
Definition: cmdid.h:225
#define FN_INSERT_STRING
Definition: cmdid.h:229
#define FN_DELETE_WHOLE_LINE
Definition: cmdid.h:688
#define FN_INSERT_SMA
Definition: cmdid.h:244
#define FN_INSERT_FIELD
Definition: cmdid.h:205
#define FN_WORDCOUNT_DIALOG
Definition: cmdid.h:608
#define FN_INSERT_COLUMN_BREAK
Definition: cmdid.h:204
#define FN_INSERT_PICTURE_CONTENT_CONTROL
Definition: cmdid.h:224
#define FN_INSERT_CHECKBOX_CONTENT_CONTROL
Definition: cmdid.h:219
#define FN_DELETE_BACK_SENT
Definition: cmdid.h:681
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 sal_uInt16 RES_FRMATR_END(133)
constexpr TypedWhichId< SvxFontItem > RES_CHRATR_CTL_FONT(27)
constexpr TypedWhichId< SwFormatINetFormat > RES_TXTATR_INETFMT(51)
constexpr TypedWhichId< SvxFontItem > RES_CHRATR_FONT(7)
constexpr TypedWhichId< SvxBoxItem > RES_BOX(106)
sal_uInt16 GetWhichOfScript(sal_uInt16 nWhich, sal_uInt16 nScript)
Definition: hints.cxx:196
SvxLinkInsertMode
HLINK_FIELD
HLINK_HTMLMODE
#define HTML_CFG_WRITER
#define HTML_CFG_MSIE
HTMLMODE_ON
LanguageType GetAppLanguage()
Definition: init.cxx:725
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:116
OUString SwResId(TranslateId aId)
Definition: swmodule.cxx:165
#define SW_MOD()
Definition: swmodule.hxx:256
#define MINLAY
Definition: swtypes.hxx:62
#define CHAR_HARDBLANK
Definition: swtypes.hxx:171
constexpr SwTwips DEF_GUTTER_WIDTH
Definition: swtypes.hxx:65
#define CHAR_LRM
Definition: swtypes.hxx:175
#define CHAR_SOFTHYPHEN
Definition: swtypes.hxx:173
#define CHAR_WJ
Definition: swtypes.hxx:177
#define CHAR_HARDHYPHEN
Definition: swtypes.hxx:172
#define CHAR_RLM
Definition: swtypes.hxx:174
#define CHAR_ZWSP
Definition: swtypes.hxx:176
#define CHAR_NNBSP
Definition: swtypes.hxx:178
static bool lcl_IsMarkInSameSection(SwWrtShell &rWrtSh, const SwSection *pSect)
Definition: textsh.cxx:591
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:755
RET_OK
sal_uInt16 GetHtmlMode(const SwDocShell *pShell)
Definition: viewopt.cxx:332
constexpr sal_uInt16 XATTR_FILL_FIRST(XATTRSET_LINE+1)
constexpr sal_uInt16 XATTR_FILL_LAST(XATTR_FILLUSESLIDEBACKGROUND)