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 const bool bCursorInHidden = rSh.IsInHiddenRange(/*bSelect=*/false);
609
610 while ( nWhich )
611 {
612 switch ( nWhich )
613 {
614 case SID_INSERT_AVMEDIA:
615 if ( GetShell().IsSelFrameMode()
616 || GetShell().CursorInsideInputField()
617 || SfxObjectCreateMode::EMBEDDED == eCreateMode
618 || bCursorInHidden )
619 {
620 rSet.DisableItem( nWhich );
621 }
622 break;
623
624 case SID_INSERT_DIAGRAM:
625 if( !aMOpt.IsChart()
626 || GetShell().CursorInsideInputField()
627 || eCreateMode == SfxObjectCreateMode::EMBEDDED
628 || bCursorInHidden )
629 {
630 rSet.DisableItem( nWhich );
631 }
632 break;
633
634 case FN_INSERT_SMA:
635 if( !aMOpt.IsMath()
636 || eCreateMode == SfxObjectCreateMode::EMBEDDED
637 || bCursorInHidden
638 || rSh.CursorInsideInputField() )
639 {
640 rSet.DisableItem( nWhich );
641 }
642 break;
643
644 case SID_INSERT_FLOATINGFRAME:
645 case SID_INSERT_OBJECT:
646 {
647 if( eCreateMode == SfxObjectCreateMode::EMBEDDED || bCursorInHidden )
648 {
649 rSet.DisableItem( nWhich );
650 }
651 else if( GetShell().IsSelFrameMode()
652 || GetShell().CursorInsideInputField() )
653 {
654 rSet.DisableItem( nWhich );
655 }
656 else if(SID_INSERT_FLOATINGFRAME == nWhich && bHtmlModeOn)
657 {
658 const sal_uInt16 nExport = SvxHtmlOptions::GetExportMode();
659 if(HTML_CFG_MSIE != nExport && HTML_CFG_WRITER != nExport )
660 rSet.DisableItem(nWhich);
661 }
662 }
663 break;
664
667 {
668 if( GetShell().IsSelFrameMode()
669 || rSh.IsTableMode()
670 || GetShell().CursorInsideInputField()
671 || bCursorInHidden )
672 rSet.DisableItem(nWhich);
673 }
674 break;
675
676 case SID_HYPERLINK_GETLINK:
677 {
679 rSh.GetCurAttr( aSet );
680
681 SvxHyperlinkItem aHLinkItem;
682 if(const SwFormatINetFormat* pINetFormat = aSet.GetItemIfSet(RES_TXTATR_INETFMT, false))
683 {
684 aHLinkItem.SetURL(pINetFormat->GetValue());
685 aHLinkItem.SetTargetFrame(pINetFormat->GetTargetFrame());
686 aHLinkItem.SetIntName(pINetFormat->GetName());
687 const SvxMacro *pMacro = pINetFormat->GetMacro( SvMacroItemId::OnMouseOver );
688 if( pMacro )
689 aHLinkItem.SetMacro(HyperDialogEvent::MouseOverObject, *pMacro);
690
691 pMacro = pINetFormat->GetMacro( SvMacroItemId::OnClick );
692 if( pMacro )
693 aHLinkItem.SetMacro(HyperDialogEvent::MouseClickObject, *pMacro);
694
695 pMacro = pINetFormat->GetMacro( SvMacroItemId::OnMouseOut );
696 if( pMacro )
697 aHLinkItem.SetMacro(HyperDialogEvent::MouseOutObject, *pMacro);
698
699 // Get the text of the Link.
700 rSh.StartAction();
701 const bool bAtEnd(rSh.IsCursorPtAtEnd());
702 if(!bAtEnd) // tdf#91832: ensure forward selection
703 rSh.SwapPam();
704 rSh.CreateCursor();
705 if(!bAtEnd)
706 rSh.SwapPam();
707 rSh.SwCursorShell::SelectTextAttr(RES_TXTATR_INETFMT,true);
708 OUString sLinkName = rSh.GetSelText();
709 aHLinkItem.SetName(sLinkName);
710 aHLinkItem.SetInsertMode(HLINK_FIELD);
711 rSh.DestroyCursor();
712 rSh.EndAction();
713 }
714 else
715 {
716 OUString sReturn = rSh.GetSelText();
717 sReturn = sReturn.copy(0, std::min<sal_Int32>(255, sReturn.getLength()));
718 aHLinkItem.SetName(comphelper::string::stripEnd(sReturn, ' '));
719 }
720
721 aHLinkItem.SetInsertMode(static_cast<SvxLinkInsertMode>(aHLinkItem.GetInsertMode() |
722 (bHtmlModeOn ? HLINK_HTMLMODE : 0)));
723 aHLinkItem.SetMacroEvents ( HyperDialogEvent::MouseOverObject|
724 HyperDialogEvent::MouseClickObject | HyperDialogEvent::MouseOutObject );
725
726 rSet.Put(aHLinkItem);
727 }
728 break;
729
730 case FN_INSERT_FRAME:
731 if (rSh.IsSelFrameMode() )
732 {
733 const SelectionType nSel = rSh.GetSelectionType();
734 if( ((SelectionType::Graphic | SelectionType::Ole ) & nSel ) || bCursorInHidden )
735 rSet.DisableItem(nWhich);
736 }
737 else if ( rSh.CursorInsideInputField() )
738 {
739 rSet.DisableItem(nWhich);
740 }
741 break;
742
743 case FN_FORMAT_COLUMN :
744 {
745 //#i80458# column dialog cannot work if the selection contains different page styles and different sections
746 bool bDisable = true;
747 if( rSh.GetFlyFrameFormat() || rSh.GetSelectedPageDescs() )
748 bDisable = false;
749 if( bDisable )
750 {
751 const SwSection* pCurrSection = rSh.GetCurrSection();
752 const sal_uInt16 nFullSectCnt = rSh.GetFullSelectedSectionCount();
753 if( pCurrSection && ( !rSh.HasSelection() || 0 != nFullSectCnt ))
754 bDisable = false;
755 else if(
756 rSh.HasSelection() && rSh.IsInsRegionAvailable() &&
757 ( !pCurrSection || ( 1 != nFullSectCnt &&
758 lcl_IsMarkInSameSection( rSh, pCurrSection ) )))
759 bDisable = false;
760 }
761 if(bDisable)
762 rSet.DisableItem(nWhich);
763 }
764 break;
765 }
766 nWhich = aIter.NextWhich();
767 }
768}
769
771{
772 SwWrtShell &rSh = GetShell();
773 switch( rReq.GetSlot() )
774 {
775 case FN_DELETE_SENT:
776 if( rSh.IsTableMode() )
777 {
778 rSh.DeleteRow();
779 rSh.EnterStdMode();
780 }
781 else
782 rSh.DelToEndOfSentence();
783 break;
786 break;
787 case FN_DELETE_WORD:
788 rSh.DelNxtWord();
789 break;
791 rSh.DelPrvWord();
792 break;
793 case FN_DELETE_LINE:
794 rSh.DelToEndOfLine();
795 break;
797 rSh.DelToStartOfLine();
798 break;
799 case FN_DELETE_PARA:
800 rSh.DelToEndOfPara();
801 break;
803 rSh.DelToStartOfPara();
804 break;
806 rSh.DelLine();
807 break;
808 default:
809 OSL_ENSURE(false, "wrong dispatcher");
810 return;
811 }
812 rReq.Done();
813}
814
816{
817 using namespace ::com::sun::star::i18n;
818 TransliterationFlags nMode = TransliterationFlags::NONE;
819
820 switch( rReq.GetSlot() )
821 {
822 case SID_TRANSLITERATE_SENTENCE_CASE:
823 nMode = TransliterationFlags::SENTENCE_CASE;
824 break;
825 case SID_TRANSLITERATE_TITLE_CASE:
826 nMode = TransliterationFlags::TITLE_CASE;
827 break;
828 case SID_TRANSLITERATE_TOGGLE_CASE:
829 nMode = TransliterationFlags::TOGGLE_CASE;
830 break;
831 case SID_TRANSLITERATE_UPPER:
832 nMode = TransliterationFlags::LOWERCASE_UPPERCASE;
833 break;
834 case SID_TRANSLITERATE_LOWER:
835 nMode = TransliterationFlags::UPPERCASE_LOWERCASE;
836 break;
837
838 case SID_TRANSLITERATE_HALFWIDTH:
839 nMode = TransliterationFlags::FULLWIDTH_HALFWIDTH;
840 break;
841 case SID_TRANSLITERATE_FULLWIDTH:
842 nMode = TransliterationFlags::HALFWIDTH_FULLWIDTH;
843 break;
844
845 case SID_TRANSLITERATE_HIRAGANA:
846 nMode = TransliterationFlags::KATAKANA_HIRAGANA;
847 break;
848 case SID_TRANSLITERATE_KATAKANA:
849 nMode = TransliterationFlags::HIRAGANA_KATAKANA;
850 break;
851
852 default:
853 OSL_ENSURE(false, "wrong dispatcher");
854 }
855
856 if( nMode != TransliterationFlags::NONE )
857 GetShell().TransliterateText( nMode );
858}
859
861{
862 if( rReq.GetSlot() == SID_TRANSLITERATE_ROTATE_CASE )
864}
865
867 SwBaseShell(_rView)
868{
869 SetName("Text");
871}
872
874{
875}
876
878{
881 XATTR_FILL_FIRST, XATTR_FILL_LAST, // tdf#95003
882 SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER,
883 SID_ATTR_PAGE_SIZE, SID_ATTR_PAGE_SIZE,
884 SID_COLOR_TABLE, SID_PATTERN_LIST,
885 SID_HTML_MODE, SID_HTML_MODE,
888 aSet.Put(SfxUInt16Item(SID_HTML_MODE, ::GetHtmlMode(GetView().GetDocShell())));
889
890 // For the Area tab page.
892
894 SwFormatFrameSize aFrameSize(SwFrameSize::Variable, rPg.Width(), rPg.Height());
895 aFrameSize.SetWhich(GetPool().GetWhich(SID_ATTR_PAGE_SIZE));
896 aSet.Put(aFrameSize);
897
899 SwFormatFrameSize aPrtSize(SwFrameSize::Variable, rPr.Width(), rPr.Height());
900 aPrtSize.SetWhich(GetPool().GetWhich(FN_GET_PRINT_AREA));
901 aSet.Put(aPrtSize);
902
903 aSet.Put(rMgr.GetAttrSet());
904 aSet.SetParent( rMgr.GetAttrSet().GetParent() );
905
906 // Delete minimum size in columns.
907 SvxBoxInfoItem aBoxInfo(aSet.Get(SID_ATTR_BORDER_INNER));
908 const SvxBoxItem& rBox = aSet.Get(RES_BOX);
909 aBoxInfo.SetMinDist(false);
910 aBoxInfo.SetDefDist(rBox.GetDistance(SvxBoxItemLine::LEFT));
911 aSet.Put(aBoxInfo);
912
913 return aSet;
914}
915
917{
918 const SfxItemSet *pArgs = rReq.GetArgs();
919 const SfxStringItem* pItem = nullptr;
920 if( pArgs )
921 pItem = pArgs->GetItemIfSet(SID_CHARMAP, false);
922
923 OUString aChars, aFontName;
924 if ( pItem )
925 {
926 aChars = pItem->GetValue();
927 const SfxStringItem* pFontItem = pArgs->GetItemIfSet( SID_ATTR_SPECIALCHAR, false );
928 if ( pFontItem )
929 aFontName = pFontItem->GetValue();
930 }
931
932 SwWrtShell &rSh = GetShell();
936 rSh.GetCurAttr( aSet );
937 SvtScriptType nScript = rSh.GetScriptType();
938
939 std::shared_ptr<SvxFontItem> aFont(std::make_shared<SvxFontItem>(RES_CHRATR_FONT));
940 {
941 SvxScriptSetItem aSetItem( SID_ATTR_CHAR_FONT, *aSet.GetPool() );
942 aSetItem.GetItemSet().Put( aSet, false );
943 const SfxPoolItem* pI = aSetItem.GetItemOfScript( nScript );
944 if( pI )
945 {
946 aFont.reset(static_cast<SvxFontItem*>(pI->Clone()));
947 }
948 else
949 {
950 TypedWhichId<SvxFontItem> nFontWhich =
954 aFont.reset(aSet.Get(nFontWhich).Clone());
955 }
956
957 if (aFontName.isEmpty())
958 aFontName = aFont->GetFamilyName();
959 }
960
961 vcl::Font aNewFont(aFontName, Size(1,1)); // Size only because CTOR.
962 if( aChars.isEmpty() )
963 {
964 // Set selected font as default.
965 SfxAllItemSet aAllSet( rSh.GetAttrPool() );
966 aAllSet.Put( SfxBoolItem( FN_PARAM_1, false ) );
967
968 SwViewOption aOpt(*GetShell().GetViewOptions());
969 const OUString& sSymbolFont = aOpt.GetSymbolFont();
970 if( aFontName.isEmpty() && !sSymbolFont.isEmpty() )
971 aAllSet.Put( SfxStringItem( SID_FONT_NAME, sSymbolFont ) );
972 else
973 aAllSet.Put( SfxStringItem( SID_FONT_NAME, aFont->GetFamilyName() ) );
974
978 pDlg->Execute();
979 return;
980 }
981
982 if( aChars.isEmpty() )
983 return;
984
985 rSh.StartAllAction();
986
987 // Delete selected content.
988 SwRewriter aRewriter;
989 aRewriter.AddRule(UndoArg1, SwResId(STR_SPECIALCHAR));
990
991 rSh.StartUndo( SwUndoId::INSERT, &aRewriter );
992 if ( rSh.HasSelection() )
993 {
994 rSh.DelRight();
995 aSet.ClearItem();
996 rSh.GetCurAttr( aSet );
997
998 SvxScriptSetItem aSetItem( SID_ATTR_CHAR_FONT, *aSet.GetPool() );
999 aSetItem.GetItemSet().Put( aSet, false );
1000 const SfxPoolItem* pI = aSetItem.GetItemOfScript( nScript );
1001 if( pI )
1002 {
1003 aFont.reset(static_cast<SvxFontItem*>(pI->Clone()));
1004 }
1005 else
1006 {
1007 TypedWhichId<SvxFontItem> nFontWhich =
1011 aFont.reset(aSet.Get( nFontWhich ).Clone());
1012 }
1013 }
1014
1015 // Insert character.
1016 rSh.Insert( aChars );
1017
1018 // #108876# a font attribute has to be set always due to a guessed script type
1019 if( !aNewFont.GetFamilyName().isEmpty() )
1020 {
1021 std::unique_ptr<SvxFontItem> aNewFontItem(aFont->Clone());
1022 aNewFontItem->SetFamilyName( aNewFont.GetFamilyName() );
1023 aNewFontItem->SetFamily( aNewFont.GetFamilyType());
1024 aNewFontItem->SetPitch( aNewFont.GetPitch());
1025 aNewFontItem->SetCharSet( aNewFont.GetCharSet() );
1026
1030
1031 nScript = g_pBreakIt->GetAllScriptsOfText( aChars );
1032 if( SvtScriptType::LATIN & nScript )
1033 {
1034 aRestoreSet.Put( aSet.Get( RES_CHRATR_FONT ) );
1035 aNewFontItem->SetWhich(RES_CHRATR_FONT);
1036 aSet.Put( *aNewFontItem );
1037 }
1038 if( SvtScriptType::ASIAN & nScript )
1039 {
1040 aRestoreSet.Put( aSet.Get( RES_CHRATR_CJK_FONT ) );
1041 aNewFontItem->SetWhich(RES_CHRATR_CJK_FONT);
1042 aSet.Put( *aNewFontItem );
1043 }
1044 if( SvtScriptType::COMPLEX & nScript )
1045 {
1046 aRestoreSet.Put( aSet.Get( RES_CHRATR_CTL_FONT ) );
1047 aNewFontItem->SetWhich(RES_CHRATR_CTL_FONT);
1048 aSet.Put( *aNewFontItem );
1049 }
1050
1051 rSh.SetMark();
1052 rSh.ExtendSelection( false, aChars.getLength() );
1054 if( !rSh.IsCursorPtAtEnd() )
1055 rSh.SwapPam();
1056
1057 rSh.ClearMark();
1058
1059 // #i75891#
1060 // SETATTR_DONTEXPAND does not work if there are already hard attributes.
1061 // Therefore we have to restore the font attributes.
1062 rSh.SetMark();
1063 rSh.SetAttrSet( aRestoreSet );
1064 rSh.ClearMark();
1065
1066 rSh.UpdateAttr();
1067
1068 // Why was this done? aFont is not used anymore below, we are not
1069 // in a loop and it's a local variable...?
1070 // aFont = aNewFontItem;
1071 }
1072
1073 rSh.EndAllAction();
1074 rSh.EndUndo();
1075
1076 if ( !aChars.isEmpty() )
1077 {
1078 rReq.AppendItem( SfxStringItem( SID_CHARMAP, aChars ) );
1079 rReq.AppendItem( SfxStringItem( SID_ATTR_SPECIALCHAR, aNewFont.GetFamilyName() ) );
1080 rReq.Done();
1081 }
1082}
1083
1084/* 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.
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 OString &sDefPage=OString())=0
static SwAbstractDialogFactory * Create()
Definition: swabstdlg.cxx:36
SwWrtShell & GetShell()
Definition: basesh.cxx:3078
SwView & GetView()
Definition: basesh.hxx:59
void InsertTable(SfxRequest &_rRequest)
Definition: basesh.cxx:3140
SwWrtShell * GetShellPtr()
Definition: basesh.cxx:3083
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:990
bool IsInHiddenRange(const bool bSelect)
If the current cursor position is inside a hidden range true is returned.
Definition: crsrsh.cxx:3459
OUString GetSelText() const
get selected text of a node at current cursor
Definition: crsrsh.cxx:2574
bool ExtendSelection(bool bEnd=true, sal_Int32 nCount=1)
extend current SSelection by n characters
Definition: crsrsh.cxx:2656
bool CursorInsideInputField() const
Definition: crstrvl.cxx:1089
void UpdateAttr()
Definition: crsrsh.hxx:779
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:953
void SetMark()
Definition: crsrsh.hxx:898
SwTextContentControl * CursorInsideContentControl() const
Definition: crstrvl.cxx:1099
void DestroyCursor()
transform TableCursor to normal cursor, nullify Tablemode
Definition: crsrsh.cxx:151
bool IsCursorPtAtEnd() const
Definition: crsrsh.hxx:917
bool IsTableMode() const
Definition: crsrsh.hxx:660
IDocumentDrawModelAccess const & getIDocumentDrawModelAccess() const
Definition: doc.cxx:163
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:6197
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:916
void InsertHyperlink(const SvxHyperlinkItem &rHlnkItem)
Definition: textfld.cxx:1376
virtual ~SwTextShell() override
Definition: textsh.cxx:873
void ExecTransliteration(SfxRequest const &)
Definition: textsh.cxx:815
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:877
void ExecDelete(SfxRequest &)
Definition: textsh.cxx:770
static void InitInterface_Impl()
SfxInterface initializer.
Definition: textsh.cxx:116
SwTextShell(SwView &rView)
Definition: textsh.cxx:866
void ExecRotateTransliteration(SfxRequest const &)
Definition: textsh.cxx:860
const OUString & GetSymbolFont() const
Definition: viewopt.hxx:741
void UnlockPaint(bool bVirDev=false)
Definition: viewsh.hxx:620
void LockPaint()
Definition: viewsh.hxx:615
IDocumentUndoRedo const & GetIDocumentUndoRedo() const
Provides access to the document undo/redo interface.
Definition: viewsh.cxx:2827
SwDoc * GetDoc() const
Definition: viewsh.hxx:290
const SfxItemPool & GetAttrPool() const
Definition: viewsh.hxx:625
Definition: view.hxx:146
void AutoCaption(const sal_uInt16 nType, const SvGlobalName *pOleId=nullptr)
Definition: viewdlg2.cxx:183
SwWrtShell & GetWrtShell() const
Definition: view.hxx:421
SwEditWin & GetEditWin()
Definition: view.hxx:424
SwDocShell * GetDocShell()
Definition: view.cxx:1163
void InsFrameMode(sal_uInt16 nCols)
Definition: view2.cxx:2339
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:653
void InsertLineBreak(std::optional< SwLineBreakClear > oClear=std::nullopt)
Definition: wrtsh1.cxx:973
void Insert(const OUString &)
Definition: wrtsh1.cxx:225
SelectionType GetSelectionType() const
Definition: wrtsh1.cxx:1717
void EnterStdMode()
Definition: select.cxx:552
bool InsertOleObject(const svt::EmbeddedObjectRef &xObj, SwFlyFrameFormat **pFlyFrameFormat=nullptr)
Definition: wrtsh1.cxx:512
void SplitNode(bool bAutoFormat=false)
Definition: wrtsh1.cxx:1311
void DelToStartOfSentence()
Definition: delete.cxx:587
void InsertContentControl(SwContentControlType eType)
Definition: wrtsh1.cxx:1034
void InsertByWord(const OUString &)
Definition: wrtsh1.cxx:205
void InsertColumnBreak()
Definition: wrtsh1.cxx:1011
void DelToEndOfPara()
Definition: delete.cxx:549
bool DelRight(bool isReplaceHeuristic=false)
Definition: delete.cxx:293
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:408
void AutoCorrect(SvxAutoCorrect &rACorr, sal_Unicode cChar)
Definition: wrtsh1.cxx:1949
bool HasSelection() const
Definition: wrtsh.hxx:147
void InsertPageBreak(const OUString *pPageDesc=nullptr, const ::std::optional< sal_uInt16 > &rPgNum=std::nullopt)
Definition: wrtsh1.cxx:935
bool DelToEndOfSentence()
Definition: delete.cxx:596
void DelNxtWord()
Definition: delete.cxx:630
void DelToStartOfPara()
Definition: delete.cxx:566
bool IsInClickToEdit() const
Definition: wrtsh.hxx:667
void LaunchOLEObj(sal_Int32 nVerb=css::embed::EmbedVerbs::MS_OLEVERB_PRIMARY)
Definition: wrtsh1.cxx:653
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:219
#define FN_INSERT_COMBO_BOX_CONTENT_CONTROL
Definition: cmdid.h:233
#define FN_INSERT_CONTENT_CONTROL
Definition: cmdid.h:221
#define FN_INSERT_FRAME_INTERACT_NOCOL
Definition: cmdid.h:238
#define FN_INSERT_FRAME_INTERACT
Definition: cmdid.h:234
#define FN_INSERT_TABLE
Definition: cmdid.h:231
#define FN_CONTENT_CONTROL_PROPERTIES
Definition: cmdid.h:226
#define FN_INSERT_IDX_ENTRY_DLG
Definition: cmdid.h:237
#define FN_INSERT_PLAIN_TEXT_CONTENT_CONTROL
Definition: cmdid.h:229
#define FN_INSERT_AUTH_ENTRY_DLG
Definition: cmdid.h:301
#define FN_DELETE_LINE
Definition: cmdid.h:700
#define FN_DELETE_BACK_LINE
Definition: cmdid.h:701
#define FN_EDIT_FORMULA
Definition: cmdid.h:84
#define FN_DELETE_SENT
Definition: cmdid.h:696
#define FN_SET_FRM_NAME
Definition: cmdid.h:885
#define FN_FORMAT_COLUMN
Definition: cmdid.h:348
#define FN_GET_PRINT_AREA
Definition: cmdid.h:770
#define FN_INSERT_FRAME
Definition: cmdid.h:235
#define FN_INSERT_DROPDOWN_CONTENT_CONTROL
Definition: cmdid.h:225
#define FN_DELETE_BACK_PARA
Definition: cmdid.h:703
#define FN_DELETE_PARA
Definition: cmdid.h:702
#define FN_DELETE_WORD
Definition: cmdid.h:698
#define FN_INSERT_PAGEBREAK
Definition: cmdid.h:224
#define FN_DELETE_BACK_WORD
Definition: cmdid.h:699
#define FN_INSERT_DATE_CONTENT_CONTROL
Definition: cmdid.h:228
#define FN_INSERT_STRING
Definition: cmdid.h:232
#define FN_DELETE_WHOLE_LINE
Definition: cmdid.h:704
#define FN_INSERT_SMA
Definition: cmdid.h:248
#define FN_INSERT_FIELD
Definition: cmdid.h:208
#define FN_WORDCOUNT_DIALOG
Definition: cmdid.h:624
#define FN_INSERT_COLUMN_BREAK
Definition: cmdid.h:207
#define FN_INSERT_PICTURE_CONTENT_CONTROL
Definition: cmdid.h:227
#define FN_INSERT_CHECKBOX_CONTENT_CONTROL
Definition: cmdid.h:222
#define FN_DELETE_BACK_SENT
Definition: cmdid.h:697
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:739
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:168
#define SW_MOD()
Definition: swmodule.hxx:256
#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: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:414
constexpr sal_uInt16 XATTR_FILL_FIRST(XATTRSET_LINE+1)
constexpr sal_uInt16 XATTR_FILL_LAST(XATTR_FILLUSESLIDEBACKGROUND)