LibreOffice Module sw (master) 1
wrtsh1.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 <com/sun/star/beans/XPropertySet.hpp>
21#include <com/sun/star/container/XChild.hpp>
22#include <com/sun/star/embed/EmbedMisc.hpp>
23#include <com/sun/star/embed/EmbedStates.hpp>
24#include <com/sun/star/embed/EmbedVerbs.hpp>
25#include <com/sun/star/embed/NoVisualAreaSizeException.hpp>
26#include <com/sun/star/chart2/XChartDocument.hpp>
27#include <com/sun/star/util/XModifiable.hpp>
28#include <com/sun/star/lang/XInitialization.hpp>
29
30#include <hintids.hxx>
31#include <sot/exchange.hxx>
32#include <svx/xfillit0.hxx>
33#include <svx/hdft.hxx>
34#include <svx/svdview.hxx>
35#include <svl/itemiter.hxx>
36#include <tools/bigint.hxx>
37#include <svtools/insdlg.hxx>
38#include <sfx2/ipclient.hxx>
40#include <editeng/svxacorr.hxx>
41#include <editeng/ulspitem.hxx>
42#include <vcl/graph.hxx>
45#include <svx/svxdlg.hxx>
46#include <svx/extrusionbar.hxx>
47#include <svx/fontworkbar.hxx>
48#include <dialoghelp.hxx>
49#include <frmfmt.hxx>
50#include <fmtftn.hxx>
51#include <fmthdft.hxx>
52#include <fmtpdsc.hxx>
53#include <txtfrm.hxx>
54#include <wdocsh.hxx>
55#include <swmodule.hxx>
56#include <wrtsh.hxx>
57#include <view.hxx>
58#include <cmdid.h>
59#include <pagedesc.hxx>
60#include <frmmgr.hxx>
61#include <swundo.hxx>
62#include <swcli.hxx>
63#include <poolfmt.hxx>
64#include <edtwin.hxx>
65#include <fmtcol.hxx>
66#include <swtable.hxx>
67#include <viscrs.hxx>
68#include <swdtflvr.hxx>
69#include <doc.hxx>
71#include <SwCapObjType.hxx>
72#include <SwStyleNameMapper.hxx>
73#include <sfx2/request.hxx>
74#include <paratr.hxx>
75#include <ndtxt.hxx>
76#include <editeng/acorrcfg.hxx>
77#include <IMark.hxx>
78#include <sfx2/bindings.hxx>
79#include <flyfrm.hxx>
80
81// -> #111827#
82#include <SwRewriter.hxx>
83#include <strings.hrc>
84// <- #111827#
85
87#include <sfx2/viewfrm.hxx>
88#include <vcl/uitest/logger.hxx>
90#include <osl/diagnose.h>
92
93#include <PostItMgr.hxx>
95#include <fldmgr.hxx>
96#include <docufld.hxx>
98#include <fmtfld.hxx>
99
100#include <sfx2/msgpool.hxx>
101#include <sfx2/msg.hxx>
102#include <svtools/embedhlp.hxx>
103#include <svx/postattr.hxx>
104#include <comphelper/lok.hxx>
107#include <svl/numformat.hxx>
108#include <svl/zformat.hxx>
109#include <memory>
110
111#include "../../core/crsr/callnk.hxx"
112#include <frmtool.hxx>
113#include <viewopt.hxx>
114
115#include <IDocumentUndoRedo.hxx>
116#include <UndoInsert.hxx>
117#include <UndoCore.hxx>
118#include <formatlinebreak.hxx>
120
121using namespace sw::mark;
122using namespace com::sun::star;
123namespace {
124
125void collectUIInformation(const OUString& rAction, const OUString& aParameters)
126{
127 EventDescription aDescription;
128 aDescription.aAction = rAction;
129 aDescription.aParameters = {{"parameters", aParameters}};
130 aDescription.aID = "writer_edit";
131 aDescription.aKeyWord = "SwEditWinUIObject";
132 aDescription.aParent = "MainWindow";
133 UITestLogger::getInstance().logEvent(aDescription);
134}
135
136}
137
139
140static bool lcl_IsAllowed(const SwWrtShell* rSh)
141{
143 {
144 SwTextNode* pTextNode = rSh->GetCursor()->GetPointNode().GetTextNode();
145 if (pTextNode && pTextNode->IsOutline())
146 {
147 // disallow if this is an outline node having folded content
148 bool bVisible = true;
150 if (!bVisible)
151 return false;
152 }
153 }
154 return true;
155}
156
157#define BITFLD_INI_LIST \
158 m_bClearMark = \
159 m_bIns = true;\
160 m_bAddMode = \
161 m_bBlockMode = \
162 m_bExtMode = \
163 m_bInSelect = \
164 m_bLayoutMode = \
165 m_bSelWrd = \
166 m_bSelLn = \
167 m_bRetainSelection = false; \
168 m_bIsInClickToEdit = false;
169
171{
173 if( pACorr && !pACorr->IsAutoCorrFlag( ACFlags::CapitalStartSentence | ACFlags::CapitalStartWord |
174 ACFlags::AddNonBrkSpace | ACFlags::ChgOrdinalNumber | ACFlags::TransliterateRTL |
175 ACFlags::ChgToEnEmDash | ACFlags::SetINetAttr | ACFlags::Autocorrect ))
176 pACorr = nullptr;
177 return pACorr;
178}
179
180void SwWrtShell::NoEdit(bool bHideCursor)
181{
182 if(bHideCursor)
183 HideCursor();
184}
185
187{
188 if (CanInsert())
189 {
190 ShowCursor();
191 }
192}
193
195{
196 SwMvContext aMvContext(this);
197 if(IsEndPara() && !IsSttPara())
198 return true;
199
200 return IsEndWord();
201}
202
203// Insert string
204void SwWrtShell::InsertByWord( const OUString & rStr)
205{
206 if( rStr.isEmpty() )
207 return;
208
209 bool bDelim = GetAppCharClass().isLetterNumeric( rStr, 0 );
210 sal_Int32 nPos = 0, nStt = 0;
211 for( ; nPos < rStr.getLength(); nPos++ )
212 {
213 bool bTmpDelim = GetAppCharClass().isLetterNumeric( rStr, nPos );
214 if( bTmpDelim != bDelim )
215 {
216 Insert( rStr.copy( nStt, nPos - nStt ));
217 nStt = nPos;
218 }
219 }
220 if( nStt != nPos )
221 Insert( rStr.copy( nStt, nPos - nStt ));
222}
223
224void SwWrtShell::Insert( const OUString &rStr )
225{
227 if( !CanInsert() )
228 return;
229
230 bool bStarted = false;
231 bool bHasSel = HasSelection(),
232 bCallIns = m_bIns /*|| bHasSel*/;
233 bool bDeleted = false;
234
235 if( bHasSel || ( !m_bIns && SelectHiddenRange() ) )
236 {
237 // Only here parenthesizing, because the normal
238 // insert is already in parentheses at Editshell.
240
241 SwRewriter aRewriter;
242
243 aRewriter.AddRule(UndoArg1, GetCursorDescr());
244 aRewriter.AddRule(UndoArg2, SwResId(STR_YIELDS));
245 {
246 OUString aTmpStr = SwResId(STR_START_QUOTE) +
247 rStr + SwResId(STR_END_QUOTE);
248
249 aRewriter.AddRule(UndoArg3, aTmpStr);
250 }
251
252 StartUndo(SwUndoId::REPLACE, &aRewriter);
253 bStarted = true;
254 Push();
255 // let's interpret a selection within the same node as "replace"
256 bDeleted = DelRight(GetCursor()->GetPoint()->GetNode() == GetCursor()->GetMark()->GetNode());
257 Pop(SwCursorShell::PopMode::DeleteCurrent); // Restore selection (if tracking changes)
258 NormalizePam(false); // tdf#127635 put point at the end of deletion
259 ClearMark();
260 }
261
262 bCallIns ?
263 SwEditShell::Insert2( rStr, bDeleted ) : SwEditShell::Overwrite( rStr );
264
265 if( bStarted )
266 {
267 EndUndo();
268 EndAllAction();
269 }
270}
271
272// Maximum height limit not possible, because the maximum height
273// of the current frame can not be obtained.
274
275void SwWrtShell::InsertGraphic( const OUString &rPath, const OUString &rFilter,
276 const Graphic &rGrf, SwFlyFrameAttrMgr *pFrameMgr,
277 RndStdIds nAnchorType )
278{
280 if ( !CanInsert() )
281 return;
282
284
285 SwRewriter aRewriter;
286 aRewriter.AddRule(UndoArg1, SwResId(STR_GRAPHIC));
287
288 StartUndo(SwUndoId::INSERT, &aRewriter);
289
290 if ( HasSelection() )
291 DelRight();
292 // Inserted graphics in its own paragraph,
293 // if at the end of a non-empty paragraph.
294 //For i120928,avoid to split node
295
297
298 bool bSetGrfSize = true;
299 bool bOwnMgr = false;
300
301 if ( !pFrameMgr )
302 {
303 bOwnMgr = true;
304 pFrameMgr = new SwFlyFrameAttrMgr( true, this, Frmmgr_Type::GRF, nullptr );
305
306 // CAUTION
307 // GetAttrSet makes an adjustment
308 // While pasting is a SwFrameSize present
309 // because of the DEF-Framesize
310 // These must be removed explicitly for the optimal size.
311 pFrameMgr->DelAttr(RES_FRM_SIZE);
312
313 if (nAnchorType != RndStdIds::FLY_AT_PARA)
314 // Something other than at-para was requested.
315 pFrameMgr->SetAnchor(nAnchorType);
316 }
317 else
318 {
319 Size aSz( pFrameMgr->GetSize() );
320 if ( !aSz.Width() || !aSz.Height() )
321 {
324 pFrameMgr->SetSize( aSz );
325 }
326 else if ( aSz.Width() != DFLT_WIDTH && aSz.Height() != DFLT_HEIGHT )
327 bSetGrfSize = false;
328
330 }
331
332 // during change tracking, insert the image anchored as character
333 // (to create an SwRangeRedline on its anchor point)
334 if ( IsRedlineOn() && nAnchorType != RndStdIds::FLY_AS_CHAR )
335 pFrameMgr->SetAnchor( RndStdIds::FLY_AS_CHAR );
336
337 // Insert the graphic
338 SwFEShell::Insert(rPath, rFilter, &rGrf, &pFrameMgr->GetAttrSet());
339 if ( bOwnMgr )
340 pFrameMgr->UpdateAttrMgr();
341
342 if( bSetGrfSize )
343 {
344 Size aSizePixel = rGrf.GetSizePixel();
345 Size aBound = GetGraphicDefaultSize();
346
347 sal_Int32 nPreferredDPI = mxDoc->getIDocumentSettingAccess().getImagePreferredDPI();
348 Size aGrfSize;
349
350 if (nPreferredDPI > 0)
351 {
352 auto nWidth = o3tl::toTwips(aSizePixel.Width() / double(nPreferredDPI), o3tl::Length::in);
353 auto nHeight = o3tl::toTwips(aSizePixel.Height() / double(nPreferredDPI), o3tl::Length::in);
354 aGrfSize = Size(nWidth, nHeight);
355 }
356 else
357 {
358 GetGrfSize(aGrfSize);
359 }
360
361 // Add the margin attributes to GrfSize,
362 // because these counts at the margin additionally
363 aGrfSize.AdjustWidth(pFrameMgr->CalcWidthBorder() );
364 aGrfSize.AdjustHeight(pFrameMgr->CalcHeightBorder() );
365
366 const BigInt aTempWidth( aGrfSize.Width() );
367 const BigInt aTempHeight( aGrfSize.Height());
368
369 // Fit width if necessary, scale down the height proportional thereafter.
370 if( aGrfSize.Width() > aBound.Width() )
371 {
372 aGrfSize.setWidth( aBound.Width() );
373 aGrfSize.setHeight( BigInt(aBound.Width()) * aTempHeight / aTempWidth );
374 }
375 // Fit height if necessary, scale down the width proportional thereafter.
376 if( aGrfSize.Height() > aBound.Height() )
377 {
378 aGrfSize.setHeight( aBound.Height() );
379 aGrfSize.setWidth( BigInt(aBound.Height()) * aTempWidth / aTempHeight );
380 }
381 pFrameMgr->SetSize( aGrfSize );
382 pFrameMgr->UpdateFlyFrame();
383 }
384 if ( bOwnMgr )
385 delete pFrameMgr;
386
387 EndUndo();
388 EndAllAction();
389}
390
391// Insert an OLE-Object into the CORE.
392// if no object is transferred, then one will be created.
393
395 sal_uInt16 nSlotId )
396{
398 if( !CanInsert() )
399 return;
400
401 if( !xRef.is() )
402 {
403 // temporary storage
405 uno::Reference < embed::XStorage > xStor = comphelper::OStorageHelper::GetTemporaryStorage();
406 bool bDoVerb = true;
407 if ( pName )
408 {
410 OUString aName;
411 // TODO/LATER: get aspect?
412 xObj.Assign( aCnt.CreateEmbeddedObject( pName->GetByteSequence(), aName ), embed::Aspects::MSOLE_CONTENT );
413 }
414 else
415 {
416 SvObjectServerList aServerList;
417 switch (nSlotId)
418 {
419 case SID_INSERT_OBJECT:
420 {
421 aServerList.FillInsertObjects();
422 aServerList.Remove( SwDocShell::Factory().GetClassId() );
423 [[fallthrough]];
424 }
425
426 // TODO/LATER: recording! Convert properties to items
427 case SID_INSERT_FLOATINGFRAME:
428 {
429 SfxSlotPool* pSlotPool = SW_MOD()->GetSlotPool();
430 const SfxSlot* pSlot = pSlotPool->GetSlot(nSlotId);
431 OString aCmd = OString::Concat(".uno:") + pSlot->GetUnoName();
433 ScopedVclPtr<SfxAbstractInsertObjectDialog> pDlg(pFact->CreateInsertObjectDialog(GetFrameWeld(mxDoc->GetDocShell()),
434 OUString::fromUtf8( aCmd ), xStor, &aServerList));
435 if (pDlg)
436 {
437 pDlg->Execute();
438 bDoVerb = pDlg->IsCreateNew();
439 OUString aIconMediaType;
440 uno::Reference< io::XInputStream > xIconMetaFile = pDlg->GetIconIfIconified( &aIconMediaType );
441 xObj.Assign( pDlg->GetObject(),
442 xIconMetaFile.is() ? embed::Aspects::MSOLE_ICON : embed::Aspects::MSOLE_CONTENT );
443 if ( xIconMetaFile.is() )
444 xObj.SetGraphicStream( xIconMetaFile, aIconMediaType );
445 }
446
447 break;
448 }
449
450 default:
451 break;
452 }
453 }
454
455 if ( xObj.is() )
456 {
457 if( InsertOleObject( xObj ) && bDoVerb )
458 {
459 SfxInPlaceClient* pClient = GetView().FindIPClient( xObj.GetObject(), &GetView().GetEditWin() );
460 if ( !pClient )
461 {
462 pClient = new SwOleClient( &GetView(), &GetView().GetEditWin(), xObj );
464 }
465
466 if ( xObj.GetViewAspect() == embed::Aspects::MSOLE_ICON )
467 {
468 SwRect aArea = GetAnyCurRect( CurRectType::FlyEmbeddedPrt, nullptr, xObj.GetObject() );
469 aArea.Pos() += GetAnyCurRect( CurRectType::FlyEmbedded, nullptr, xObj.GetObject() ).Pos();
470 MapMode aMapMode( MapUnit::MapTwip );
471 Size aSize = xObj.GetSize( &aMapMode );
472 aArea.Width( aSize.Width() );
473 aArea.Height( aSize.Height() );
474 RequestObjectResize( aArea, xObj.GetObject() );
475 }
476 else
477 CalcAndSetScale( xObj );
478
479 //#50270# We don't need to handle error, this is handled by the
480 //DoVerb in the SfxViewShell
481 pClient->DoVerb(embed::EmbedVerbs::MS_OLEVERB_SHOW);
482
483 // TODO/LATER: set document name - should be done in Client
484 }
485 }
486 }
487 else
488 {
489 if( HasSelection() )
490 DelRight();
491 InsertOleObject( xRef );
492 }
493}
494
495// Insert object into the Core.
496// From ClipBoard or Insert
497
499{
500 //tdf#125100 Ensure that ole object is initially shown as pictogram
501 comphelper::EmbeddedObjectContainer& rEmbeddedObjectContainer = mxDoc->GetDocShell()->getEmbeddedObjectContainer();
502 bool bSaveUserAllowsLinkUpdate = rEmbeddedObjectContainer.getUserAllowsLinkUpdate();
503 rEmbeddedObjectContainer.setUserAllowsLinkUpdate(true);
504
507
509
510 //Some differences between StarMath and any other objects:
511 //1. Selections should be deleted. For StarMath the Text should be
512 // passed to the Object
513 //2. If the cursor is at the end of a non empty paragraph a paragraph
514 // break should be inserted. StarMath objects are character bound and
515 // no break should be inserted.
516 //3. If an selection is passed to a StarMath object, this object should
517 // not be activated. false should be returned then.
518 bool bStarMath = true;
519 bool bActivate = true;
520
521 // set parent to get correct VisArea(in case of object needing parent printer)
522 uno::Reference < container::XChild > xChild( xRef.GetObject(), uno::UNO_QUERY );
523 if ( xChild.is() )
524 xChild->setParent( mxDoc->GetDocShell()->GetModel() );
525
526 SvGlobalName aCLSID( xRef->getClassID() );
527 bStarMath = ( SotExchange::IsMath( aCLSID ) != 0 );
528 if( IsSelection() )
529 {
530 if( bStarMath )
531 {
532 OUString aMathData;
534
535 if( !aMathData.isEmpty() && svt::EmbeddedObjectRef::TryRunningState( xRef.GetObject() ) )
536 {
537 uno::Reference < beans::XPropertySet > xSet( xRef->getComponent(), uno::UNO_QUERY );
538 if ( xSet.is() )
539 {
540 try
541 {
542 xSet->setPropertyValue("Formula", uno::Any( aMathData ) );
543 bActivate = false;
544 }
545 catch (const uno::Exception&)
546 {
547 }
548 }
549 }
550 }
551 DelRight();
552 }
553
554 if ( !bStarMath )
555 SwFEShell::SplitNode( false, false );
556
558
559 const SvGlobalName* pName = nullptr;
560 SvGlobalName aObjClsId;
561 if (xRef.is())
562 {
563 aObjClsId = SvGlobalName(xRef.GetObject()->getClassID());
564 pName = &aObjClsId;
565 }
566 SwFlyFrameAttrMgr aFrameMgr( true, this, Frmmgr_Type::OLE, pName );
568
569 SwRect aBound;
570 CalcBoundRect( aBound, aFrameMgr.GetAnchor() );
571
572 //The Size should be suggested by the OLE server
573 MapMode aMapMode( MapUnit::MapTwip );
574 Size aSz = xRef.GetSize( &aMapMode );
575
576 //Object size can be limited
577 if ( aSz.Width() > aBound.Width() )
578 {
579 //Always limit proportional.
580 aSz.setHeight( aSz.Height() * aBound.Width() / aSz.Width() );
581 aSz.setWidth( aBound.Width() );
582 }
583 aFrameMgr.SetSize( aSz );
584 SwFlyFrameFormat *pFormat = SwFEShell::InsertObject( xRef, &aFrameMgr.GetAttrSet() );
585
586 // --> #i972#
587 if ( bStarMath && mxDoc->getIDocumentSettingAccess().get( DocumentSettingId::MATH_BASELINE_ALIGNMENT ) )
589
590 if (pFlyFrameFormat)
591 *pFlyFrameFormat = pFormat;
592
593 if ( SotExchange::IsChart( aCLSID ) )
594 {
595 uno::Reference< embed::XEmbeddedObject > xEmbeddedObj = xRef.GetObject();
596 if ( xEmbeddedObj.is() )
597 {
598 bool bDisableDataTableDialog = false;
600 uno::Reference< beans::XPropertySet > xProps( xEmbeddedObj->getComponent(), uno::UNO_QUERY );
601 if ( xProps.is() &&
602 ( xProps->getPropertyValue("DisableDataTableDialog") >>= bDisableDataTableDialog ) &&
603 bDisableDataTableDialog )
604 {
605 xProps->setPropertyValue("DisableDataTableDialog",
606 uno::Any( false ) );
607 xProps->setPropertyValue("DisableComplexChartTypes",
608 uno::Any( false ) );
609 uno::Reference< util::XModifiable > xModifiable( xProps, uno::UNO_QUERY );
610 if ( xModifiable.is() )
611 {
612 xModifiable->setModified( true );
613 }
614 }
615 }
616 }
617
618 EndAllAction();
619 GetView().AutoCaption(OLE_CAP, &aCLSID);
620
621 SwRewriter aRewriter;
622
623 if ( bStarMath )
624 aRewriter.AddRule(UndoArg1, SwResId(STR_MATH_FORMULA));
625 else if ( SotExchange::IsChart( aCLSID ) )
626 aRewriter.AddRule(UndoArg1, SwResId(STR_CHART));
627 else
628 aRewriter.AddRule(UndoArg1, SwResId(STR_OLE));
629
630 EndUndo(SwUndoId::INSERT, &aRewriter);
631
632 rEmbeddedObjectContainer.setUserAllowsLinkUpdate(bSaveUserAllowsLinkUpdate);
633
634 return bActivate;
635}
636
637// The current selected OLE object will be loaded with the
638// verb into the server.
639void SwWrtShell::LaunchOLEObj(sal_Int32 nVerb)
640{
641 if ( GetCntType() != CNT_OLE ||
642 GetView().GetViewFrame()->GetFrame().IsInPlace() )
643 return;
644
646 OSL_ENSURE( xRef.is(), "OLE not found" );
647
648 // LOK: we don't want to handle any other embedded objects than
649 // charts, there are too many problems with eg. embedded spreadsheets
650 // (like it creates a separate view for the calc sheet)
652 {
653 const auto classId = xRef->getClassID();
654 if (!SotExchange::IsChart(classId) && !SotExchange::IsMath(classId))
655 return;
656 }
657
658 SfxInPlaceClient* pCli = GetView().FindIPClient( xRef.GetObject(), &GetView().GetEditWin() );
659 if ( !pCli )
660 pCli = new SwOleClient( &GetView(), &GetView().GetEditWin(), xRef );
661
662 uno::Reference<lang::XInitialization> xOLEInit(xRef.GetObject(), uno::UNO_QUERY);
663 if (xOLEInit.is())
664 {
665 uno::Sequence<beans::PropertyValue> aArguments
666 = { comphelper::makePropertyValue("ReadOnly", pCli->IsProtected()) };
667 xOLEInit->initialize({ uno::Any(aArguments) });
668 }
669
670 static_cast<SwOleClient*>(pCli)->SetInDoVerb( true );
671
672 CalcAndSetScale( xRef );
673 pCli->DoVerb( nVerb );
674
675 static_cast<SwOleClient*>(pCli)->SetInDoVerb( false );
676 CalcAndSetScale( xRef );
677}
678
680{
681 try
682 {
683 sal_Int32 nState = xObj->getCurrentState();
684 if ( nState == css::embed::EmbedStates::INPLACE_ACTIVE
685 || nState == css::embed::EmbedStates::UI_ACTIVE )
686 {
687 SfxInPlaceClient* pCli =
688 GetView().FindIPClient( xObj.GetObject(), &(GetView().GetEditWin()) );
689 if ( pCli )
690 {
691 tools::Rectangle aArea = pCli->GetObjArea();
692 aArea += rOffset;
693 pCli->SetObjArea( aArea );
694 }
695 }
696 }
697 catch (const uno::Exception&)
698 {
699 }
700}
701
703 const SwRect *pFlyPrtRect,
704 const SwRect *pFlyFrameRect,
705 const bool bNoTextFramePrtAreaChanged )
706{
707 // Setting the scale of the client. This arises from the difference
708 // between the VisArea of the object and the ObjArea.
709 OSL_ENSURE( xObj.is(), "ObjectRef not valid" );
710
711 sal_Int64 nAspect = xObj.GetViewAspect();
712 if ( nAspect == embed::Aspects::MSOLE_ICON )
713 return; // the replacement image is completely controlled by container in this case
714
715 sal_Int64 nMisc = 0;
716 bool bLinkingChart = false;
717
718 try
719 {
720 nMisc = xObj->getStatus( nAspect );
721
722 // This can surely only be a non-active object, if desired they
723 // get the new size set as VisArea (StarChart).
724 if( embed::EmbedMisc::MS_EMBED_RECOMPOSEONRESIZE & nMisc )
725 {
726 // TODO/MBA: testing
727 SwRect aRect( pFlyPrtRect ? *pFlyPrtRect
729 if( !aRect.IsEmpty() )
730 {
731 // TODO/LEAN: getMapUnit can switch object to running state
732 // xObj.TryRunningState();
733
734 MapUnit aUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( xObj->getMapUnit( nAspect ) );
735
736 // TODO/LATER: needs complete VisArea?!
737 Size aSize( OutputDevice::LogicToLogic(aRect.SVRect(), MapMode(MapUnit::MapTwip), MapMode(aUnit)).GetSize() );
738 awt::Size aSz;
739 aSz.Width = aSize.Width();
740 aSz.Height = aSize.Height();
741
742 // Action 'setVisualAreaSize' doesn't have to turn on the
743 // modified state of the document, either.
744 bool bModified = false;
745 uno::Reference<util::XModifiable> xModifiable(xObj->getComponent(), uno::UNO_QUERY);
746 if (xModifiable.is())
747 bModified = xModifiable->isModified();
748 xObj->setVisualAreaSize( nAspect, aSz );
749 xModifiable.set(xObj->getComponent(), uno::UNO_QUERY);
750 if (xModifiable.is() && xModifiable->isModified() && !bModified)
751 xModifiable->setModified(bModified);
752
753 // #i48419# - action 'UpdateReplacement' doesn't
754 // have to change the modified state of the document.
755 // This is only a workaround for the defect, that this action
756 // modifies a document after load, because unnecessarily the
757 // replacement graphic is updated, in spite of the fact that
758 // nothing has been changed.
759 // If the replacement graphic changes by this action, the document
760 // will be already modified via other mechanisms.
761 {
762 bool bResetEnableSetModified(false);
763 if ( GetDoc()->GetDocShell()->IsEnableSetModified() )
764 {
765 GetDoc()->GetDocShell()->EnableSetModified( false );
766 bResetEnableSetModified = true;
767 }
768
769 //#i79576# don't destroy chart replacement images on load
770 //#i79578# don't request a new replacement image for charts to often
771 //a chart sends a modified call to the framework if it was changed
772 //thus the replacement update is already handled elsewhere
773 if ( !SotExchange::IsChart( xObj->getClassID() ) )
774 xObj.UpdateReplacement();
775
776 if ( bResetEnableSetModified )
777 {
779 }
780 }
781 }
782
783 // TODO/LATER: this is only a workaround,
784 uno::Reference< chart2::XChartDocument > xChartDocument( xObj->getComponent(), uno::UNO_QUERY );
785 bLinkingChart = ( xChartDocument.is() && !xChartDocument->hasInternalDataProvider() );
786 }
787 }
788 catch (const uno::Exception&)
789 {
790 // TODO/LATER: handle the error
791 return;
792 }
793
794 SfxInPlaceClient* pCli = GetView().FindIPClient( xObj.GetObject(), &GetView().GetEditWin() );
795 if ( !pCli )
796 {
797 if ( (embed::EmbedMisc::EMBED_ACTIVATEIMMEDIATELY & nMisc)
798 || bLinkingChart
799 // --> OD #i117189# - refine condition for non-resizable objects
800 // non-resizable objects need to be set the size back by this method
801 || ( bNoTextFramePrtAreaChanged && nMisc & embed::EmbedMisc::EMBED_NEVERRESIZE ) )
802 {
803 pCli = new SwOleClient( &GetView(), &GetView().GetEditWin(), xObj );
804 }
805 else
806 return;
807 }
808
809 // TODO/LEAN: getMapUnit can switch object to running state
810 // xObj.TryRunningState();
811
812 awt::Size aSize;
813 try
814 {
815 aSize = xObj->getVisualAreaSize( nAspect );
816 }
817 catch (const embed::NoVisualAreaSizeException&)
818 {
819 OSL_FAIL("Can't get visual area size!" );
820 // the scaling will not be done
821 }
822 catch (const uno::Exception&)
823 {
824 // TODO/LATER: handle the error
825 OSL_FAIL("Can't get visual area size!" );
826 return;
827 }
828
829 Size _aVisArea( aSize.Width, aSize.Height );
830
831 Fraction aScaleWidth( 1, 1 );
832 Fraction aScaleHeight( 1, 1 );
833
834 bool bUseObjectSize = false;
835
836 // As long as there comes no reasonable size from the object,
837 // nothing can be scaled.
838 if( _aVisArea.Width() && _aVisArea.Height() )
839 {
840 const MapMode aTmp( MapUnit::MapTwip );
841 MapUnit aUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( xObj->getMapUnit( nAspect ) );
842 _aVisArea = OutputDevice::LogicToLogic(_aVisArea, MapMode(aUnit), aTmp);
843 Size aObjArea;
844 if ( pFlyPrtRect )
845 aObjArea = pFlyPrtRect->SSize();
846 else
847 aObjArea = GetAnyCurRect( CurRectType::FlyEmbeddedPrt, nullptr, xObj.GetObject() ).SSize();
848
849 // differ the aObjArea and _aVisArea by 1 Pixel then set new VisArea
850 tools::Long nX, nY;
851 SwSelPaintRects::Get1PixelInLogic( *this, &nX, &nY );
852 if( !( _aVisArea.Width() - nX <= aObjArea.Width() &&
853 _aVisArea.Width() + nX >= aObjArea.Width() &&
854 _aVisArea.Height()- nY <= aObjArea.Height()&&
855 _aVisArea.Height()+ nY >= aObjArea.Height() ))
856 {
857 if ( nMisc & embed::EmbedMisc::EMBED_NEVERRESIZE )
858 {
859 // the object must not be scaled,
860 // the size stored in object must be used for restoring
861 bUseObjectSize = true;
862 }
863 else
864 {
865 aScaleWidth = Fraction( aObjArea.Width(), _aVisArea.Width() );
866 aScaleHeight = Fraction( aObjArea.Height(), _aVisArea.Height());
867 }
868 }
869 }
870
871 // Now is the favorable time to set the ObjArea.
872 // The Scaling must be considered.
873 SwRect aArea;
874 if ( pFlyPrtRect )
875 {
876 aArea = *pFlyPrtRect;
877 aArea += pFlyFrameRect->Pos();
878 }
879 else
880 {
881 aArea = GetAnyCurRect( CurRectType::FlyEmbeddedPrt, nullptr, xObj.GetObject() );
882 aArea.Pos() += GetAnyCurRect( CurRectType::FlyEmbedded, nullptr, xObj.GetObject() ).Pos();
883 }
884
885 if ( bUseObjectSize )
886 {
887 // --> this moves non-resizable object so that when adding borders the baseline remains the same
888 const SwFlyFrameFormat *pFlyFrameFormat = dynamic_cast< const SwFlyFrameFormat * >( GetFlyFrameFormat() );
889 OSL_ENSURE( pFlyFrameFormat, "Could not find fly frame." );
890 if ( pFlyFrameFormat )
891 {
892 const Point &rPoint = pFlyFrameFormat->GetLastFlyFramePrtRectPos();
893 SwRect aRect( pFlyPrtRect ? *pFlyPrtRect
895 aArea += rPoint - aRect.Pos(); // adjust area by diff of printing area position in order to keep baseline alignment correct.
896 }
897 aArea.Width ( _aVisArea.Width() );
898 aArea.Height( _aVisArea.Height() );
899 RequestObjectResize( aArea, xObj.GetObject() );
900 }
901 else
902 {
903 aArea.Width ( tools::Long( aArea.Width() / pCli->GetScaleWidth() ) );
904 aArea.Height( tools::Long( aArea.Height() / pCli->GetScaleHeight() ) );
905 }
906
907 pCli->SetObjAreaAndScale( aArea.SVRect(), aScaleWidth, aScaleHeight );
908}
909
911 const SwRect &rFrame )
912{
913 SfxInPlaceClient* pCli = GetView().FindIPClient( xObj.GetObject(), &GetView().GetEditWin());
914 if ( !pCli )
915 new SwOleClient( &GetView(), &GetView().GetEditWin(), xObj );
916 CalcAndSetScale( xObj, &rPrt, &rFrame );
917}
918
919// Insert hard page break;
920// Selections will be overwritten
921void SwWrtShell::InsertPageBreak(const OUString *pPageDesc, const ::std::optional<sal_uInt16>& oPgNum )
922{
923 if (!lcl_IsAllowed(this))
924 return;
925
927 if( CanInsert() )
928 {
929 SwActContext aActContext(this);
931
932 if ( !IsCursorInTable() )
933 {
934 if(HasSelection())
935 DelRight();
937 // delete the numbered attribute of the last line if the last line is empty
938 GetDoc()->ClearLineNumAttrs( *GetCursor()->GetPoint() );
939 }
940
941 const SwPageDesc *pDesc = pPageDesc
942 ? FindPageDescByName( *pPageDesc, true ) : nullptr;
943 if( pDesc )
944 {
945 SwFormatPageDesc aDesc( pDesc );
946 aDesc.SetNumOffset( oPgNum );
947 SetAttrItem( aDesc );
948 }
949 else
950 SetAttrItem( SvxFormatBreakItem(SvxBreak::PageBefore, RES_BREAK) );
952 }
953 collectUIInformation("BREAK_PAGE", "parameter");
954}
955
956// Insert hard page break;
957// Selections will be overwritten
958
959void SwWrtShell::InsertLineBreak(std::optional<SwLineBreakClear> oClear)
960{
961 if (!lcl_IsAllowed(this))
962 return;
963
965 if( CanInsert() )
966 {
967 if(HasSelection())
968 DelRight();
969
970 const sal_Unicode cIns = 0x0A;
972 if (oClear.has_value())
973 {
974 eClear = *oClear;
975 }
976 SvxAutoCorrect* pACorr = lcl_IsAutoCorr();
977 if (pACorr && eClear == SwLineBreakClear::NONE)
978 AutoCorrect( *pACorr, cIns );
979 else
980 {
981 if (eClear == SwLineBreakClear::NONE)
982 {
983 SwWrtShell::Insert(OUString(cIns));
984 }
985 else
986 {
987 SwFormatLineBreak aLineBreak(eClear);
988 SetAttrItem(aLineBreak);
989 }
990 }
991 }
992}
993
994// Insert hard column break;
995// Selections will be overwritten
996
998{
999 if (!lcl_IsAllowed(this))
1000 return;
1001
1002 SwActContext aActContext(this);
1004 if( !CanInsert() )
1005 return;
1006
1008
1009 if ( !IsCursorInTable() )
1010 {
1011 if(HasSelection())
1012 DelRight();
1013 SwFEShell::SplitNode( false, false );
1014 }
1015 SetAttrItem(SvxFormatBreakItem(SvxBreak::ColumnBefore, RES_BREAK));
1016
1018}
1019
1021{
1022 if (!lcl_IsAllowed(this))
1023 {
1024 return;
1025 }
1026
1028 if (!CanInsert())
1029 {
1030 return;
1031 }
1032
1033 auto pContentControl = std::make_shared<SwContentControl>(nullptr);
1034 OUString aPlaceholder;
1035 switch (eType)
1036 {
1039 {
1040 pContentControl->SetShowingPlaceHolder(true);
1042 {
1043 pContentControl->SetPlainText(true);
1044 }
1045 if (!HasSelection())
1046 {
1047 aPlaceholder = SwResId(STR_CONTENT_CONTROL_PLACEHOLDER);
1048 }
1049 break;
1050 }
1052 {
1053 pContentControl->SetCheckbox(true);
1054 // Ballot Box with X
1055 pContentControl->SetCheckedState(u"\u2612");
1056 // Ballot Box
1057 pContentControl->SetUncheckedState(OUString(u"\u2610"));
1058 aPlaceholder = u"\u2610";
1059 break;
1060 }
1062 {
1063 pContentControl->SetComboBox(true);
1064 [[fallthrough]];
1065 }
1067 {
1068 pContentControl->SetShowingPlaceHolder(true);
1069 if (!HasSelection())
1070 {
1071 aPlaceholder = SwResId(STR_DROPDOWN_CONTENT_CONTROL_PLACEHOLDER);
1072 }
1073 SwContentControlListItem aListItem;
1074 aListItem.m_aValue = aPlaceholder;
1075 pContentControl->SetListItems({ aListItem });
1076 break;
1077 }
1079 {
1080 // Set up the picture content control.
1081 pContentControl->SetShowingPlaceHolder(true);
1082 pContentControl->SetPicture(true);
1083
1084 // Create the placeholder bitmap.
1085 BitmapEx aBitmap(Size(1, 1), vcl::PixelFormat::N24_BPP);
1087 aColor.IncreaseLuminance(255 * 0.75);
1088 aBitmap.Erase(aColor);
1089 SwRewriter aRewriter;
1090 aRewriter.AddRule(UndoArg1, SwResId(STR_GRAPHIC_DEFNAME));
1091 StartUndo(SwUndoId::INSERT, &aRewriter);
1092 LockPaint();
1093 StartAction();
1094 InsertGraphic(OUString(), OUString(), aBitmap, nullptr, RndStdIds::FLY_AS_CHAR);
1095
1096 // Set properties on the bitmap.
1098 GetFlyFrameAttr(aSet);
1099 SwFormatFrameSize aSize(SwFrameSize::Fixed, 3000, 3000);
1100 aSet.Put(aSize);
1101 SetFlyFrameAttr(aSet);
1102 SwFrameFormat* pFrameFormat = GetFlyFrameFormat();
1103 EndAction();
1104 UnlockPaint();
1105 EndUndo();
1106
1107 // Go after the anchor position.
1108 UnSelectFrame();
1110 {
1111 SwCursor* pCursor = getShellCursor(true);
1112 pCursor->DeleteMark();
1113 const SwPosition* pAnchor = pFrameFormat->GetAnchor().GetContentAnchor();
1114 pCursor->GetPoint()->Assign( *pAnchor->GetContentNode(), pAnchor->GetContentIndex() + 1);
1115 }
1116
1117 // Select before the anchor position.
1118 Left(SwCursorSkipMode::Chars, /*bSelect=*/true, 1, /*bBasicCall=*/false);
1119 break;
1120 }
1122 {
1123 pContentControl->SetShowingPlaceHolder(true);
1124 pContentControl->SetDate(true);
1125 SvNumberFormatter* pFormatter = GetDoc()->GetNumberFormatter();
1126 sal_uInt32 nStandardFormat = pFormatter->GetStandardFormat(SvNumFormatType::DATE);
1127 const SvNumberformat* pFormat = pFormatter->GetEntry(nStandardFormat);
1128 pContentControl->SetDateFormat(pFormat->GetFormatstring());
1129 pContentControl->SetDateLanguage(LanguageTag(pFormat->GetLanguage()).getBcp47());
1130 if (!HasSelection())
1131 {
1132 aPlaceholder = SwResId(STR_DATE_CONTENT_CONTROL_PLACEHOLDER);
1133 }
1134 break;
1135 }
1136 }
1137 if (aPlaceholder.getLength())
1138 {
1139 Insert(aPlaceholder);
1140 Left(SwCursorSkipMode::Chars, /*bSelect=*/true, aPlaceholder.getLength(),
1141 /*bBasicCall=*/false);
1142 }
1143 SwFormatContentControl aContentControl(pContentControl, RES_TXTATR_CONTENTCONTROL);
1144 SetAttrItem(aContentControl);
1145}
1146
1147// Insert footnote
1148// rStr - optional footnote mark
1149
1150void SwWrtShell::InsertFootnote(const OUString &rStr, bool bEndNote, bool bEdit )
1151{
1153 if( !CanInsert() )
1154 return;
1155
1156 if(HasSelection())
1157 {
1158 //collapse cursor to the end
1159 if(!IsCursorPtAtEnd())
1160 SwapPam();
1161 ClearMark();
1162 }
1163 SwPosition aPos = *GetCursor()->GetPoint();
1164 SwFormatFootnote aFootNote( bEndNote );
1165 if(!rStr.isEmpty())
1166 aFootNote.SetNumStr( rStr );
1167
1168 SetAttrItem(aFootNote);
1169
1170 if( bEdit )
1171 {
1172 // For editing the footnote text.
1173 Left(SwCursorSkipMode::Chars, false, 1, false );
1175 }
1177}
1178
1179// tdf#141634
1181{
1182 SwTextNode* pTextNode = pThis->GetCursor()->GetPointNode().GetTextNode();
1183 if (pTextNode && pTextNode->IsOutline())
1184 {
1185 bool bVisible = true;
1187 if (!bVisible)
1188 {
1189 const SwNodes& rNodes = pThis->GetNodes();
1190 const SwOutlineNodes& rOutlineNodes = rNodes.GetOutLineNds();
1192 (void) rOutlineNodes.Seek_Entry(pTextNode, &nPos);
1193
1194 SwNode* pSttNd = rOutlineNodes[nPos];
1195
1196 // determine end node of folded outline content
1197 SwNode* pEndNd = &rNodes.GetEndOfContent();
1198 if (rOutlineNodes.size() > nPos + 1)
1199 pEndNd = rOutlineNodes[nPos + 1];
1200
1202 {
1203 // get the next outline node after the folded outline content (iPos)
1204 // it is the next outline node with the same level or less
1205 int nLevel = pSttNd->GetTextNode()->GetAttrOutlineLevel();
1207 while (++iPos < rOutlineNodes.size() &&
1208 rOutlineNodes[iPos]->GetTextNode()->GetAttrOutlineLevel() > nLevel);
1209
1210 // get the correct end node
1211 // the outline node may be in frames, headers, footers special section of doc model
1212 SwNode* pStartOfSectionNodeSttNd = pSttNd->StartOfSectionNode();
1213 while (pStartOfSectionNodeSttNd->StartOfSectionNode()
1214 != pStartOfSectionNodeSttNd->StartOfSectionNode()->StartOfSectionNode())
1215 {
1216 pStartOfSectionNodeSttNd = pStartOfSectionNodeSttNd->StartOfSectionNode();
1217 }
1218 pEndNd = pStartOfSectionNodeSttNd->EndOfSectionNode();
1219
1220 if (iPos < rOutlineNodes.size())
1221 {
1222 SwNode* pStartOfSectionNode = rOutlineNodes[iPos]->StartOfSectionNode();
1223 while (pStartOfSectionNode->StartOfSectionNode()
1224 != pStartOfSectionNode->StartOfSectionNode()->StartOfSectionNode())
1225 {
1226 pStartOfSectionNode = pStartOfSectionNode->StartOfSectionNode();
1227 }
1228 if (pStartOfSectionNodeSttNd == pStartOfSectionNode)
1229 pEndNd = rOutlineNodes[iPos];
1230 }
1231 }
1232
1233 // table, text box, header, footer
1234 if (pSttNd->GetTableBox() || pSttNd->GetIndex() < rNodes.GetEndOfExtras().GetIndex())
1235 {
1236 // insert before section end node
1237 if (pSttNd->EndOfSectionIndex() < pEndNd->GetIndex())
1238 {
1239 SwNodeIndex aIdx(*pSttNd->EndOfSectionNode());
1240 while (aIdx.GetNode().IsEndNode())
1241 --aIdx;
1242 ++aIdx;
1243 pEndNd = &aIdx.GetNode();
1244 }
1245 }
1246 // if pSttNd isn't in table but pEndNd is then insert after table
1247 else if (pEndNd->GetTableBox())
1248 {
1249 pEndNd = pEndNd->FindTableNode();
1250 SwNodeIndex aIdx(*pEndNd, -1);
1251 // account for nested tables
1252 while (aIdx.GetNode().GetTableBox())
1253 {
1254 pEndNd = aIdx.GetNode().FindTableNode();
1255 aIdx.Assign(*pEndNd, -1);
1256 }
1257 aIdx.Assign(*pEndNd->EndOfSectionNode(), +1);
1258 pEndNd = &aIdx.GetNode();
1259 }
1260 // end node determined
1261
1262 // now insert the new outline node
1263 SwDoc* pDoc = pThis->GetDoc();
1264
1265 // insert at end of tablebox doesn't work correct without
1267
1268 SwTextNode* pNd = pDoc->GetNodes().MakeTextNode(*pEndNd, pTextNode->GetTextColl(), true);
1269
1270 (void) rOutlineNodes.Seek_Entry(pNd, &nPos);
1271 pThis->GotoOutline(nPos);
1272
1273 if (pDoc->GetIDocumentUndoRedo().DoesUndo())
1274 {
1276 pDoc->GetIDocumentUndoRedo().AppendUndo(std::make_unique<SwUndoInsert>(*pNd));
1277 pDoc->GetIDocumentUndoRedo().AppendUndo(std::make_unique<SwUndoFormatColl>
1278 (SwPaM(*pNd), pNd->GetTextColl(), true, true));
1279 }
1280
1281 pThis->SetModified();
1282 return true;
1283 }
1284 }
1285 return false;
1286}
1287
1288// SplitNode; also, because
1289// - of deleting selected content;
1290// - of reset of the Cursorstack if necessary.
1291
1292void SwWrtShell::SplitNode( bool bAutoFormat )
1293{
1295 if( !CanInsert() )
1296 return;
1297
1298 SwActContext aActContext(this);
1299
1302
1303 bool bHasSel = HasSelection();
1304 if (bHasSel)
1305 DelRight();
1306
1307 bool bHandled = false;
1308 if (GetViewOptions()->IsShowOutlineContentVisibilityButton() && IsEndPara())
1309 bHandled = lcl_FoldedOutlineNodeEndOfParaSplit(this);
1310
1311 if (!bHandled)
1312 SwFEShell::SplitNode( bAutoFormat );
1313
1315}
1316
1317// Turn on numbering
1318// Parameter: Optional specification of a name for the named list;
1319// this indicates a position if it is possible to convert them
1320// into a number and less than nMaxRules.
1321
1322// To test the CharFormats at the numbering
1323// external void SetNumChrFormat( SwWrtShell*, SwNumRules& );
1324
1325// -> #i40041#
1326// Preconditions (as far as OD has figured out):
1327// - <SwEditShell::HasNumber()> is false, if <bNum> is true
1328// - <SwEditShell::HasBullet()> is false, if <bNum> is false
1329// Behavior of method is determined by the current situation at the current
1330// cursor position in the document.
1332{
1333 // determine numbering rule found at current cursor position in the document.
1334 const SwNumRule* pCurRule = GetNumRuleAtCurrCursorPos();
1335
1337
1338 const SwNumRule * pNumRule = pCurRule;
1339
1340 // - activate outline rule respectively turning on outline rule for
1341 // current text node. But, only for turning on a numbering (<bNum> == true).
1342 // - overwrite found numbering rule at current cursor position, if
1343 // no numbering rule can be retrieved from the paragraph style.
1344 bool bContinueFoundNumRule( false );
1345 bool bActivateOutlineRule( false );
1346 int nActivateOutlineLvl( MAXLEVEL ); // only relevant, if <bActivateOutlineRule> == true
1348 if ( pColl )
1349 {
1350 // retrieve numbering rule at paragraph
1351 // style, which is found at current cursor position in the document.
1352 SwNumRule* pCollRule = mxDoc->FindNumRulePtr(pColl->GetNumRule().GetValue());
1353 // #125993# - The outline numbering rule isn't allowed
1354 // to be derived from a parent paragraph style to a derived one.
1355 // Thus check, if the found outline numbering rule is directly
1356 // set at the paragraph style <pColl>. If not, set <pCollRule> to NULL
1357 if ( pCollRule && pCollRule == GetDoc()->GetOutlineNumRule() )
1358 {
1359 const SwNumRule* pDirectCollRule =
1360 mxDoc->FindNumRulePtr(pColl->GetNumRule( false ).GetValue());
1361 if ( !pDirectCollRule )
1362 {
1363 pCollRule = nullptr;
1364 }
1365 }
1366
1367 if ( !pCollRule )
1368 {
1369 pNumRule = pCollRule;
1370 }
1371 // no activation or continuation of outline numbering in Writer/Web document
1372 else if ( bNum &&
1373 !dynamic_cast<SwWebDocShell*>(GetDoc()->GetDocShell()) &&
1374 pCollRule == GetDoc()->GetOutlineNumRule() )
1375 {
1376 if ( pNumRule == pCollRule )
1377 {
1378 // check, if text node at current cursor positioned is counted.
1379 // If not, let it been counted. Then it has to be checked,
1380 // of the outline numbering has to be activated or continued.
1381 SwTextNode const*const pTextNode = sw::GetParaPropsNode(
1382 *GetLayout(), GetCursor()->GetPoint()->GetNode());
1383 if ( pTextNode && !pTextNode->IsCountedInList() )
1384 {
1385 // check, if numbering of the outline level of the paragraph
1386 // style is active. If not, activate this outline level.
1387 nActivateOutlineLvl = pColl->GetAssignedOutlineStyleLevel();
1388 OSL_ENSURE( pColl->IsAssignedToListLevelOfOutlineStyle(),
1389 "<SwWrtShell::NumOrBulletOn(..)> - paragraph style with outline rule, but no outline level" );
1391 pCollRule->Get( o3tl::narrowing<sal_uInt16>(nActivateOutlineLvl) ).GetNumberingType()
1393 {
1394 // activate outline numbering
1395 bActivateOutlineRule = true;
1396 }
1397 else
1398 {
1399 // turning on outline numbering at current cursor position
1400 bContinueFoundNumRule = true;
1401 }
1402 }
1403 else
1404 {
1405 // #i101234#
1406 // activate outline numbering, because from the precondition
1407 // it's known, that <SwEdit::HasNumber()> == false
1408 bActivateOutlineRule = true;
1409 nActivateOutlineLvl = pColl->GetAssignedOutlineStyleLevel();
1410 }
1411 }
1412 else if ( !pNumRule )
1413 {
1414 // #i101234#
1415 // Check, if corresponding list level of the outline numbering
1416 // has already a numbering format set.
1417 nActivateOutlineLvl = pColl->GetAssignedOutlineStyleLevel();
1418 if ( pCollRule->Get( o3tl::narrowing<sal_uInt16>(nActivateOutlineLvl) ).GetNumberingType()
1420 {
1421 // activate outline numbering, because from the precondition
1422 // it's known, that <SwEdit::HasNumber()> == false
1423 bActivateOutlineRule = true;
1424 }
1425 else
1426 {
1427 // turning on outline numbering at current cursor position
1428 bContinueFoundNumRule = true;
1429 }
1430 }
1431 else
1432 {
1433 // check, if numbering of the outline level of the paragraph
1434 // style is active. If not, activate this outline level.
1435 nActivateOutlineLvl = pColl->GetAssignedOutlineStyleLevel();
1436 OSL_ENSURE( pColl->IsAssignedToListLevelOfOutlineStyle(),
1437 "<SwWrtShell::NumOrBulletOn(..)> - paragraph style with outline rule, but no outline level" );
1439 pCollRule->Get( o3tl::narrowing<sal_uInt16>(nActivateOutlineLvl) ).GetNumberingType()
1441 {
1442 // activate outline numbering
1443 bActivateOutlineRule = true;
1444 }
1445 else
1446 {
1447 // turning on outline numbering at current cursor position
1448 bContinueFoundNumRule = true;
1449 }
1450 }
1451 pNumRule = pCollRule;
1452 }
1453 }
1454
1455 // Only automatic numbering/bullet rules should be changed.
1456 // Note: The outline numbering rule is also an automatic one. It's only
1457 // changed, if it has to be activated.
1458 if ( pNumRule )
1459 {
1460 if ( !pNumRule->IsAutoRule() )
1461 {
1462 pNumRule = nullptr;
1463 }
1464 else if ( pNumRule == GetDoc()->GetOutlineNumRule() &&
1465 !bActivateOutlineRule && !bContinueFoundNumRule )
1466 {
1467 pNumRule = nullptr;
1468 }
1469 }
1470
1471 // Search for a previous numbering/bullet rule to continue it.
1472 OUString sContinuedListId;
1473 if ( !pNumRule )
1474 {
1475 pNumRule = GetDoc()->SearchNumRule( *GetCursor()->GetPoint(),
1476 false, bNum, false, 0,
1477 sContinuedListId, GetLayout() );
1478 bContinueFoundNumRule = pNumRule != nullptr;
1479 }
1480
1481 if (pNumRule)
1482 {
1483 SwNumRule aNumRule(*pNumRule);
1484
1485 // do not change found numbering/bullet rule, if it should only be continued.
1486 if ( !bContinueFoundNumRule )
1487 {
1488 SwTextNode const*const pTextNode = sw::GetParaPropsNode(
1489 *GetLayout(), GetCursor()->GetPoint()->GetNode());
1490
1491 if (pTextNode)
1492 {
1493 // use above retrieve outline level, if outline numbering has to be activated.
1494 int nLevel = bActivateOutlineRule
1495 ? nActivateOutlineLvl
1496 : pTextNode->GetActualListLevel();
1497
1498 if (nLevel < 0)
1499 nLevel = 0;
1500
1501 if (nLevel >= MAXLEVEL)
1502 nLevel = MAXLEVEL - 1;
1503
1504 SwNumFormat aFormat(aNumRule.Get(o3tl::narrowing<sal_uInt16>(nLevel)));
1505
1506 if (bNum)
1508 else
1509 {
1510 // #i63395# Only apply user defined default bullet font
1512 {
1513 const vcl::Font* pFnt = &numfunc::GetDefBulletFont();
1514 aFormat.SetBulletFont( pFnt );
1515 }
1516 aFormat.SetBulletChar( numfunc::GetBulletChar(static_cast<sal_uInt8>(nLevel)));
1518 // #i93908# clear suffix for bullet lists
1519 aFormat.SetListFormat("", "", nLevel);
1520 }
1521 aNumRule.Set(o3tl::narrowing<sal_uInt16>(nLevel), aFormat);
1522 }
1523 }
1524
1525 // reset indent attribute on applying list style
1526 SetCurNumRule( aNumRule, false, sContinuedListId, true );
1527 }
1528 else
1529 {
1530 // #i95907#
1531 const SvxNumberFormat::SvxNumPositionAndSpaceMode ePosAndSpaceMode(
1533 SwNumRule aNumRule( GetUniqueNumRuleName(), ePosAndSpaceMode );
1534 // Append the character template at the numbering.
1535 SwCharFormat* pChrFormat;
1536 SwDocShell* pDocSh = GetView().GetDocShell();
1537 // #i63395#
1538 // Only apply user defined default bullet font
1541 : nullptr;
1542
1543 if (bNum)
1544 {
1546 }
1547 else
1548 {
1550 }
1551
1552 const SwTextNode *const pTextNode = sw::GetParaPropsNode(*GetLayout(),
1553 GetCursor()->GetPoint()->GetNode());
1554 const SwTwips nWidthOfTabs = pTextNode
1555 ? pTextNode->GetWidthOfLeadingTabs()
1556 : 0;
1558
1559 const bool bHtml = dynamic_cast<SwWebDocShell*>( pDocSh ) != nullptr;
1560 const bool bRightToLeft = IsInRightToLeftText();
1561 for( sal_uInt8 nLvl = 0; nLvl < MAXLEVEL; ++nLvl )
1562 {
1563 SwNumFormat aFormat( aNumRule.Get( nLvl ) );
1564 aFormat.SetCharFormat( pChrFormat );
1565
1566 if (! bNum)
1567 {
1568 // #i63395#
1569 // Only apply user defined default bullet font
1570 if ( pFnt )
1571 {
1572 aFormat.SetBulletFont( pFnt );
1573 }
1574 aFormat.SetBulletChar( numfunc::GetBulletChar(nLvl) );
1576 // #i93908# clear suffix for bullet lists
1577 aFormat.SetListFormat("", "", nLvl);
1578 }
1579
1580 // #i95907#
1581 if ( ePosAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
1582 {
1583 if(bHtml && nLvl)
1584 {
1585 // 1/2" for HTML
1586 aFormat.SetAbsLSpace(nLvl * 720);
1587 }
1588 else if ( nWidthOfTabs > 0 )
1589 {
1590 aFormat.SetAbsLSpace(nWidthOfTabs + nLvl * 720);
1591 }
1592 }
1593
1594 // #i38904# Default alignment for
1595 // numbering/bullet should be rtl in rtl paragraph:
1596 if ( bRightToLeft )
1597 {
1598 aFormat.SetNumAdjust( SvxAdjust::Right );
1599 }
1600
1601 aNumRule.Set( nLvl, aFormat );
1602 }
1603
1604 // #i95907#
1605 if ( pTextNode &&
1606 ePosAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
1607 {
1608
1609 const SwTwips nTextNodeIndent = pTextNode->GetAdditionalIndentForStartingNewList();
1610 if ( ( nTextNodeIndent + nWidthOfTabs ) != 0 )
1611 {
1612 // #i111172#/fdo#85666
1613 // If text node is already inside a list, assure that the indents
1614 // are the same. Thus, adjust the indent change value by subtracting
1615 // indents of to be applied list style.
1616 SwTwips nIndentChange = nTextNodeIndent + nWidthOfTabs;
1617 if ( pTextNode->GetNumRule() )
1618 {
1619 int nLevel = pTextNode->GetActualListLevel();
1620
1621 if (nLevel < 0)
1622 nLevel = 0;
1623
1624 if (nLevel >= MAXLEVEL)
1625 nLevel = MAXLEVEL - 1;
1626
1627 const SwNumFormat& aFormat( aNumRule.Get( nLevel ) );
1629 {
1630 nIndentChange -= aFormat.GetIndentAt() + aFormat.GetFirstLineIndent();
1631 }
1632 }
1633 aNumRule.ChangeIndent( nIndentChange );
1634 }
1635 }
1636 // reset indent attribute on applying list style
1637 // start new list
1638 SetCurNumRule( aNumRule, true, OUString(), true );
1639 }
1640
1642}
1643// <- #i40041#
1644
1646{
1647 NumOrBulletOn(true);
1648}
1649
1651{
1652 const SwNumRule * pCurNumRule = GetNumRuleAtCurrCursorPos();
1653
1654 if (!pCurNumRule)
1655 return;
1656
1657 if (pCurNumRule->IsOutlineRule())
1658 {
1659 SwNumRule aNumRule(*pCurNumRule);
1660
1661 SwTextNode * pTextNode =
1662 sw::GetParaPropsNode(*GetLayout(), GetCursor()->GetPoint()->GetNode());
1663
1664 if (pTextNode)
1665 {
1666 int nLevel = pTextNode->GetActualListLevel();
1667
1668 if (nLevel < 0)
1669 nLevel = 0;
1670
1671 if (nLevel >= MAXLEVEL)
1672 nLevel = MAXLEVEL - 1;
1673
1674 SwNumFormat aFormat(aNumRule.Get(o3tl::narrowing<sal_uInt16>(nLevel)));
1675
1677 aNumRule.Set(nLevel, aFormat);
1678
1679 // no start or continuation of a list - the outline style is only changed.
1680 SetCurNumRule( aNumRule, false );
1681 }
1682 }
1683 else
1684 {
1685 DelNumRules();
1686 }
1687
1688 // #126346# - Cursor can not be anymore in front of
1689 // a label, because numbering/bullet is switched off.
1690 SetInFrontOfLabel( false );
1691}
1692// <- #i29560#
1693
1694// Request Default-Bulletlist
1695
1697{
1698 NumOrBulletOn(false);
1699}
1700
1702{
1703 // ContentType cannot be determined within a Start-/EndAction.
1704 // Because there is no invalid value TEXT will be returned.
1705 // The value does not matter, it may be updated in EndAction anyway.
1706
1707 if (ActionPend())
1709
1710 SwView &_rView = const_cast<SwView&>(GetView());
1711 if (_rView.GetPostItMgr() && _rView.GetPostItMgr()->HasActiveSidebarWin() )
1712 return SelectionType::PostIt;
1713
1714 // Inserting a frame is not a DrawMode
1715 SelectionType nCnt;
1716 if ( !_rView.GetEditWin().IsFrameAction() &&
1717 (IsObjSelected() || (_rView.IsDrawMode() && !IsFrameSelected()) ))
1718 {
1719 if (GetDrawView()->IsTextEdit())
1721 else
1722 {
1723 if (GetView().IsFormMode()) // Only Form selected
1724 nCnt = SelectionType::DbForm;
1725 else
1726 nCnt = SelectionType::DrawObject; // Any draw object
1727
1728 if (_rView.IsBezierEditMode())
1730 else if( GetDrawView()->GetContext() == SdrViewContext::Media )
1731 nCnt |= SelectionType::Media;
1732
1733 if (svx::checkForSelectedCustomShapes( GetDrawView(), true /* bOnlyExtruded */ ))
1734 {
1736 }
1737
1739 {
1741 }
1742 }
1743
1744 return nCnt;
1745 }
1746
1747 nCnt = static_cast<SelectionType>(GetCntType());
1748
1749 if ( IsFrameSelected() )
1750 {
1751 if (_rView.IsDrawMode())
1752 _rView.LeaveDrawCreate(); // clean up (Bug #45639)
1753 if ( !(nCnt & (SelectionType::Graphic | SelectionType::Ole)) )
1754 return SelectionType::Frame;
1755 }
1756
1757 if ( IsCursorInTable() )
1758 nCnt |= SelectionType::Table;
1759
1760 if ( IsTableMode() )
1761 {
1764 if ( eTableSel == SwTable::SEARCH_ROW )
1766 else if ( eTableSel == SwTable::SEARCH_COL )
1768 }
1769
1770 // Do not pop up numbering toolbar, if the text node has a numbering of type SVX_NUM_NUMBER_NONE.
1771 const SwNumRule* pNumRule = GetNumRuleAtCurrCursorPos();
1772 if ( pNumRule )
1773 {
1774 const SwTextNode* pTextNd =
1775 sw::GetParaPropsNode(*GetLayout(), GetCursor()->GetPoint()->GetNode());
1776
1777 if ( pTextNd && pTextNd->IsInList() )
1778 {
1779 int nLevel = pTextNd->GetActualListLevel();
1780
1781 if (nLevel < 0)
1782 nLevel = 0;
1783
1784 if (nLevel >= MAXLEVEL)
1785 nLevel = MAXLEVEL - 1;
1786
1787 const SwNumFormat& rFormat = pNumRule->Get(nLevel);
1788 if ( SVX_NUM_NUMBER_NONE != rFormat.GetNumberingType() )
1790 }
1791 }
1792
1793 return nCnt;
1794}
1795
1796// Find the text collection with the name rCollname
1797// Returns: Pointer at the collection or 0, if no
1798// text collection with this name exists, or
1799// this is a default template.
1800
1801SwTextFormatColl *SwWrtShell::GetParaStyle(const OUString &rCollName, GetStyle eCreate )
1802{
1803 SwTextFormatColl* pColl = FindTextFormatCollByName( rCollName );
1804 if( !pColl && GETSTYLE_NOCREATE != eCreate )
1805 {
1807 if( USHRT_MAX != nId || GETSTYLE_CREATEANY == eCreate )
1808 pColl = GetTextCollFromPool( nId );
1809 }
1810 return pColl;
1811}
1812
1813// Find the text collection with the name rCollname
1814// Returns: Pointer at the collection or 0, if no
1815// character template with this name exists, or
1816// this is a default template or template is automatic.
1817
1818SwCharFormat *SwWrtShell::GetCharStyle(const OUString &rFormatName, GetStyle eCreate )
1819{
1820 SwCharFormat* pFormat = FindCharFormatByName( rFormatName );
1821 if( !pFormat && GETSTYLE_NOCREATE != eCreate )
1822 {
1824 if( USHRT_MAX != nId || GETSTYLE_CREATEANY == eCreate )
1825 pFormat = static_cast<SwCharFormat*>(GetFormatFromPool( nId ));
1826 }
1827 return pFormat;
1828}
1829
1830// Find the table format with the name rFormatname
1831// Returns: Pointer at the collection or 0, if no
1832// frame format with this name exists or
1833// this is a default format or the format is automatic.
1834
1835SwFrameFormat *SwWrtShell::GetTableStyle(std::u16string_view rFormatName)
1836{
1837 for( size_t i = GetTableFrameFormatCount(); i; )
1838 {
1839 SwFrameFormat *pFormat = &GetTableFrameFormat( --i );
1840 if( !pFormat->IsDefault() &&
1841 pFormat->GetName() == rFormatName && IsUsed( *pFormat ) )
1842 return pFormat;
1843 }
1844 return nullptr;
1845}
1846
1848 SwPaM* pPaM = GetCursor();
1850}
1851
1852// Applying templates
1853
1854void SwWrtShell::SetPageStyle(const OUString &rCollName)
1855{
1857 {
1858 SwPageDesc* pDesc = FindPageDescByName( rCollName, true );
1859 if( pDesc )
1860 ChgCurPageDesc( *pDesc );
1861 }
1862}
1863
1864// Access templates
1865
1866OUString const & SwWrtShell::GetCurPageStyle() const
1867{
1868 return GetPageDesc(GetCurPageDesc( false/*bCalcFrame*/ )).GetName();
1869}
1870
1871// Change the current template referring to the existing change.
1872
1874{
1876
1877 // Default cannot be changed
1878 if(pColl && !pColl->IsDefault())
1879 {
1880 FillByEx(pColl);
1881 // Also apply the template to remove hard attribute assignment.
1882 SetTextFormatColl(pColl);
1883 }
1884}
1885
1886void SwWrtShell::AutoUpdatePara(SwTextFormatColl* pColl, const SfxItemSet& rStyleSet, SwPaM* pPaM )
1887{
1888 SwPaM* pCursor = pPaM ? pPaM : GetCursor( );
1893 SID_ATTR_TABSTOP_DEFAULTS,SID_ATTR_TABSTOP_OFFSET,
1894 SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER,
1895 SID_ATTR_PARA_MODEL, SID_ATTR_PARA_KEEP,
1896 SID_ATTR_PARA_PAGENUM, SID_ATTR_PARA_PAGENUM> aCoreSet( GetAttrPool() );
1897 GetPaMAttr( pCursor, aCoreSet );
1898 bool bReset = false;
1899 SfxItemIter aParaIter( aCoreSet );
1900 for (auto pParaItem = aParaIter.GetCurItem(); pParaItem; pParaItem = aParaIter.NextItem())
1901 {
1902 if(!IsInvalidItem(pParaItem))
1903 {
1904 sal_uInt16 nWhich = pParaItem->Which();
1905 if(SfxItemState::SET == aParaIter.GetItemState() &&
1906 SfxItemState::SET == rStyleSet.GetItemState(nWhich))
1907 {
1908 aParaIter.ClearItem();
1909 bReset = true;
1910 }
1911 }
1912 }
1913 StartAction();
1914 if(bReset)
1915 {
1916 ResetAttr({}, pCursor);
1917 SetAttrSet(aCoreSet, SetAttrMode::DEFAULT, pCursor);
1918 }
1919 mxDoc->ChgFormat(*pColl, rStyleSet );
1920 EndAction();
1921}
1922
1923void SwWrtShell::AutoUpdateFrame( SwFrameFormat* pFormat, const SfxItemSet& rStyleSet )
1924{
1925 StartAction();
1926
1927 ResetFlyFrameAttr( &rStyleSet );
1928 pFormat->SetFormatAttr( rStyleSet );
1929
1930 EndAction();
1931}
1932
1934{
1936 if(!CanInsert())
1937 return;
1938
1939 bool bStarted = false;
1940 SwRewriter aRewriter;
1941
1942 if(HasSelection())
1943 {
1944 // Only parentheses here, because the regular insert
1945 // is already clipped to the editshell
1947
1948 OUString aTmpStr1 = SwResId(STR_START_QUOTE) +
1949 GetSelText() +
1950 SwResId(STR_END_QUOTE);
1951 OUString aTmpStr3 = SwResId(STR_START_QUOTE) +
1952 OUStringChar(cChar) +
1953 SwResId(STR_END_QUOTE);
1954 aRewriter.AddRule( UndoArg1, aTmpStr1 );
1955 aRewriter.AddRule( UndoArg2, SwResId(STR_YIELDS) );
1956 aRewriter.AddRule( UndoArg3, aTmpStr3 );
1957
1958 StartUndo( SwUndoId::REPLACE, &aRewriter );
1959 bStarted = true;
1960 DelRight(true);
1961 }
1962 SwEditShell::AutoCorrect( rACorr, IsInsMode(), cChar );
1963
1964 if(bStarted)
1965 {
1966 EndAllAction();
1967 EndUndo( SwUndoId::REPLACE, &aRewriter );
1968 }
1969}
1970
1971// Some kind of controlled copy ctor
1972
1974 : SwFEShell(rSh, _pWin)
1975 , m_rView(rShell)
1976 , m_aNavigationMgr(*this)
1977{
1979 CurrShell aCurr( this );
1980
1981 SetSfxViewShell( static_cast<SfxViewShell *>(&rShell) );
1982 SetFlyMacroLnk( LINK(this, SwWrtShell, ExecFlyMac) );
1983
1984 // place the cursor on the first field...
1985 IFieldmark *pBM = nullptr;
1986 if ( IsFormProtected() && ( pBM = GetFieldmarkAfter( ) ) !=nullptr ) {
1987 GotoFieldmark(pBM);
1988 }
1989}
1990
1992 const SwViewOption *pViewOpt )
1993 : SwFEShell(rDoc, _pWin, pViewOpt)
1994 , m_rView(rShell)
1995 , m_aNavigationMgr(*this)
1996{
1998 CurrShell aCurr( this );
1999 SetSfxViewShell( static_cast<SfxViewShell *>(&rShell) );
2000 SetFlyMacroLnk( LINK(this, SwWrtShell, ExecFlyMac) );
2001
2002 // place the cursor on the first field...
2003 IFieldmark *pBM = nullptr;
2004 if ( IsFormProtected() && ( pBM = GetFieldmarkAfter( ) ) !=nullptr ) {
2005 GotoFieldmark(pBM);
2006 }
2007}
2008
2010{
2011 CurrShell aCurr( this );
2012 while(IsModePushed())
2013 PopMode();
2014 while(PopCursor(false))
2015 ;
2017}
2018
2020{
2021 ::std::optional<SwCallLink> aLink(std::in_place, *this);
2022 return Pop(eDelete, aLink);
2023}
2024
2025bool SwWrtShell::Pop(SwCursorShell::PopMode const eDelete, ::std::optional<SwCallLink>& roLink)
2026{
2027 bool bRet = SwCursorShell::Pop(eDelete, roLink);
2028 if( bRet && IsSelection() )
2029 {
2030 if (!IsAddMode())
2031 {
2034 }
2035 }
2036 return bRet;
2037}
2038
2040{
2041 if(IsSelFrameMode())
2042 {
2043 return false;
2044 }
2045
2046 if(IsObjSelected())
2047 {
2048 return false;
2049 }
2050
2051 if(GetView().GetDrawFuncPtr())
2052 {
2053 return false;
2054 }
2055
2056 if(GetView().GetPostItMgr()->GetActiveSidebarWin())
2057 {
2058 return false;
2059 }
2060
2061 return true;
2062}
2063
2065{
2066 SwEditShell::ChgDBData(aDBData);
2067 //notify the db-beamer if available
2069}
2070
2072{
2073 OUString aResult;
2074
2075 SelectionType nSelType = GetSelectionType();
2076 switch (nSelType)
2077 {
2079 aResult = SwResId(STR_GRAPHIC);
2080
2081 break;
2083 {
2084 const SwFrameFormat * pFrameFormat = GetSelectedFrameFormat();
2085
2086 if (pFrameFormat)
2087 aResult = pFrameFormat->GetDescription();
2088 }
2089 break;
2091 {
2092 aResult = SwResId(STR_DRAWING_OBJECTS);
2093 }
2094 break;
2095 default:
2096 if (mxDoc)
2097 aResult = GetCursorDescr();
2098 }
2099
2100 return aResult;
2101}
2102
2104{
2106 //#i115062# invalidate meta character slot
2108}
2109
2111{
2114}
2115
2116// Switch on/off header or footer of a page style - if an empty name is
2117// given all styles are changed
2118
2120 std::u16string_view rStyleName, bool bHeader, bool bOn, bool bShowWarning)
2121{
2122 SdrView *const pSdrView = GetDrawView();
2123 if (pSdrView && pSdrView->IsTextEdit())
2124 { // tdf#107474 deleting header may delete active drawing object
2125 pSdrView->SdrEndTextEdit(true);
2126 }
2129 StartUndo( SwUndoId::HEADER_FOOTER ); // #i7983#
2130 bool bExecute = true;
2131 bool bCursorSet = false;
2132 for( size_t nFrom = 0, nTo = GetPageDescCnt();
2133 nFrom < nTo; ++nFrom )
2134 {
2135 SwPageDesc aDesc( GetPageDesc( nFrom ));
2136 OUString sTmp(aDesc.GetName());
2137 if( rStyleName.empty() || rStyleName == sTmp )
2138 {
2139 bool bChgd = false;
2140
2141 if( bShowWarning && !bOn && GetActiveView() && GetActiveView() == &GetView() &&
2142 ( (bHeader && aDesc.GetMaster().GetHeader().IsActive()) ||
2143 (!bHeader && aDesc.GetMaster().GetFooter().IsActive()) ) )
2144 {
2145 bShowWarning = false;
2146 //Actions have to be closed while the dialog is showing
2147 EndAllAction();
2148
2149 weld::Window* pParent = GetView().GetFrameWeld();
2150 short nResult;
2151 if (bHeader) {
2152 nResult = DeleteHeaderDialog(pParent).run();
2153 } else {
2154 nResult = DeleteFooterDialog(pParent).run();
2155 }
2156
2157 bExecute = nResult == RET_YES;
2159 if (nResult == RET_YES)
2161 }
2162 if( bExecute )
2163 {
2164 bChgd = true;
2165 SwFrameFormat &rMaster = aDesc.GetMaster();
2166 if(bHeader)
2167 rMaster.SetFormatAttr( SwFormatHeader( bOn ));
2168 else
2169 rMaster.SetFormatAttr( SwFormatFooter( bOn ));
2170 if( bOn )
2171 {
2173 SvxULSpaceItem aUL(bHeader ? 0 : constTwips_5mm, bHeader ? constTwips_5mm : 0, RES_UL_SPACE );
2174 SwFrameFormat* pFormat = bHeader ?
2175 const_cast<SwFrameFormat*>(rMaster.GetHeader().GetHeaderFormat()) :
2176 const_cast<SwFrameFormat*>(rMaster.GetFooter().GetFooterFormat());
2177 pFormat->SetFormatAttr( aUL );
2178 XFillStyleItem aFill(drawing::FillStyle_NONE);
2179 pFormat->SetFormatAttr(aFill);
2180 }
2181 }
2182 if( bChgd )
2183 {
2184 ChgPageDesc( nFrom, aDesc );
2185
2186 if( !bCursorSet && bOn )
2187 {
2188 if ( !IsHeaderFooterEdit() )
2190 bCursorSet = SetCursorInHdFt(
2191 rStyleName.empty() ? SIZE_MAX : nFrom,
2192 bHeader );
2193 }
2194 }
2195 }
2196 }
2197 EndUndo( SwUndoId::HEADER_FOOTER ); // #i7983#
2198 EndAllAction();
2199}
2200
2202{
2204 if ( !bShow )
2206}
2207
2209{
2210 SwPostItField* pPostIt = dynamic_cast<SwPostItField*>(rFieldMgr.GetCurField());
2211 bool bNew = !(pPostIt && pPostIt->GetTyp()->Which() == SwFieldIds::Postit);
2212 if (bNew || GetView().GetPostItMgr()->IsAnswer())
2213 {
2214 const SvxPostItAuthorItem* pAuthorItem = rReq.GetArg<SvxPostItAuthorItem>(SID_ATTR_POSTIT_AUTHOR);
2215 OUString sAuthor;
2216 if ( pAuthorItem )
2217 sAuthor = pAuthorItem->GetValue();
2218 else
2219 {
2220 std::size_t nAuthor = SW_MOD()->GetRedlineAuthor();
2221 sAuthor = SW_MOD()->GetRedlineAuthor(nAuthor);
2222 }
2223
2224 const SvxPostItTextItem* pTextItem = rReq.GetArg<SvxPostItTextItem>(SID_ATTR_POSTIT_TEXT);
2225 OUString sText;
2226 if ( pTextItem )
2227 sText = pTextItem->GetValue();
2228
2229 // If we have a text already registered for answer, use that
2230 if (GetView().GetPostItMgr()->IsAnswer() && !GetView().GetPostItMgr()->GetAnswerText().isEmpty())
2231 {
2232 sText = GetView().GetPostItMgr()->GetAnswerText();
2233 GetView().GetPostItMgr()->RegisterAnswerText(OUString());
2234 }
2235
2236 if ( HasSelection() && !IsTableMode() )
2237 {
2238 KillPams();
2239 }
2240
2241 // #i120513# Inserting a comment into an autocompletion crashes
2242 // --> suggestion has to be removed before
2244
2245 SwInsertField_Data aData(SwFieldTypesEnum::Postit, 0, sAuthor, sText, 0);
2246
2247 if (IsSelFrameMode())
2248 {
2250
2251 // Remember the anchor of the selected object before deletion.
2252 std::optional<SwPosition> oAnchor;
2253 if (pFly)
2254 {
2255 SwFrameFormat* pFormat = pFly->GetFormat();
2256 if (pFormat)
2257 {
2258 RndStdIds eAnchorId = pFormat->GetAnchor().GetAnchorId();
2259 if ((eAnchorId == RndStdIds::FLY_AS_CHAR || eAnchorId == RndStdIds::FLY_AT_CHAR) && pFormat->GetAnchor().GetContentAnchor())
2260 {
2261 oAnchor.emplace(*pFormat->GetAnchor().GetContentAnchor());
2262 }
2263 }
2264 }
2265
2266 // A frame is selected, end frame selection.
2267 EnterStdMode();
2268 GetView().AttrChangedNotify(nullptr);
2269
2270 // Set up text selection, so the anchor of the frame will be the anchor of the
2271 // comment.
2272 if (pFly)
2273 {
2274 if (oAnchor)
2275 *GetCurrentShellCursor().GetPoint() = *oAnchor;
2276 SwFrameFormat* pFormat = pFly->GetFormat();
2277 if (pFormat && pFormat->GetAnchor().GetAnchorId() == RndStdIds::FLY_AS_CHAR)
2278 {
2279 Right(SwCursorSkipMode::Cells, /*bSelect=*/true, 1, /*bBasicCall=*/false, /*bVisual=*/true);
2280 }
2281 else if (pFormat && pFormat->GetAnchor().GetAnchorId() == RndStdIds::FLY_AT_CHAR)
2282 {
2283 aData.m_oAnnotationRange.emplace(*GetCurrentShellCursor().Start(),
2285 }
2286 }
2287 }
2288
2289 rFieldMgr.InsertField( aData );
2290
2291 Push();
2293 pPostIt = static_cast<SwPostItField*>(rFieldMgr.GetCurField());
2294 Pop(SwCursorShell::PopMode::DeleteCurrent); // Restore cursor position
2295 }
2296
2297 // Client has disabled annotations rendering, no need to
2298 // focus the postit field
2300 return;
2301
2302 if (pPostIt)
2303 {
2305 if(auto pFormat = pType->FindFormatForField(pPostIt))
2306 pFormat->Broadcast( SwFormatFieldHint( nullptr, SwFormatFieldHintWhich::FOCUS, &GetView() ) );
2307 }
2308}
2309
2311{
2312 const SwOutlineNodes& rOutlineNodes = GetDoc()->GetNodes().GetOutLineNds();
2313 const SwNode* pOutlineNode = rOutlineNodes[nPos];
2314
2315 // no layout frame means outline folding is set to include sub levels and the outline node has
2316 // a parent outline node with outline content visible attribute false (folded outline content)
2317 if (!pOutlineNode->GetTextNode()->getLayoutFrame(nullptr))
2318 return false;
2319
2320 // try the next node to determine if this outline node has visible content
2321 SwNodeIndex aIdx(*pOutlineNode, +1);
2322 if (aIdx.GetNode() == aIdx.GetNodes().GetEndOfContent()) // end of regular content
2323 return false;
2324
2325 if (aIdx.GetNode().IsTextNode() || aIdx.GetNode().IsTableNode() ||
2326 aIdx.GetNode().IsSectionNode())
2327 {
2328 // * sublevels treated as outline content
2329 // If next node (aIdx) doesn't have a layout frame
2330 // then this outline node does not have visible outline content.
2331 // * sublevels NOT treated as outline content
2332 // If the next node (aIdx) is the next outline node
2333 // then return the outline content visible attribute value.
2334 if (!GetViewOptions()->IsTreatSubOutlineLevelsAsContent() &&
2335 nPos + 1 < rOutlineNodes.size() &&
2336 rOutlineNodes[nPos + 1] == &aIdx.GetNode())
2338
2339 if (aIdx.GetNode().IsTextNode())
2340 return aIdx.GetNode().GetTextNode()->getLayoutFrame(nullptr);
2341 if (aIdx.GetNode().IsTableNode())
2342 {
2343 SwTable& rTable = aIdx.GetNode().GetTableNode()->GetTable();
2344 return rTable.HasLayout();
2345 }
2346 if (aIdx.GetNode().IsSectionNode())
2347 {
2348 const SwSectionFormat* pFormat =
2350 if (!pFormat)
2351 return false;
2352 SwPtrMsgPoolItem aAskItem(RES_CONTENT_VISIBLE, nullptr);
2353 pFormat->GetInfo(aAskItem);
2354 return aAskItem.pObject;
2355 }
2356 }
2357
2358 return true;
2359}
2360
2361void SwWrtShell::MakeOutlineContentVisible(const size_t nPos, bool bMakeVisible)
2362{
2363 const SwNodes& rNodes = GetNodes();
2364 const SwOutlineNodes& rOutlineNodes = rNodes.GetOutLineNds();
2365
2366 SwNode* pSttNd = rOutlineNodes[nPos];
2367
2368 // determine end node
2369 SwNode* pEndNd = &rNodes.GetEndOfContent();
2370 if (rOutlineNodes.size() > nPos + 1)
2371 pEndNd = rOutlineNodes[nPos + 1];
2372
2373 if (GetViewOptions()->IsTreatSubOutlineLevelsAsContent())
2374 {
2375 // get the last outline node to include (iPos)
2376 int nLevel = pSttNd->GetTextNode()->GetAttrOutlineLevel();
2378 while (++iPos < rOutlineNodes.size() &&
2379 rOutlineNodes[iPos]->GetTextNode()->GetAttrOutlineLevel() > nLevel);
2380
2381 // get the correct end node
2382 // the outline node may be in frames, headers, footers special section of doc model
2383 SwNode* pStartOfSectionNodeSttNd = pSttNd->StartOfSectionNode();
2384 while (pStartOfSectionNodeSttNd->StartOfSectionNode()
2385 != pStartOfSectionNodeSttNd->StartOfSectionNode()->StartOfSectionNode())
2386 {
2387 pStartOfSectionNodeSttNd = pStartOfSectionNodeSttNd->StartOfSectionNode();
2388 }
2389 pEndNd = pStartOfSectionNodeSttNd->EndOfSectionNode();
2390
2391 if (iPos < rOutlineNodes.size())
2392 {
2393 SwNode* pStartOfSectionNode = rOutlineNodes[iPos]->StartOfSectionNode();
2394 while (pStartOfSectionNode->StartOfSectionNode()
2395 != pStartOfSectionNode->StartOfSectionNode()->StartOfSectionNode())
2396 {
2397 pStartOfSectionNode = pStartOfSectionNode->StartOfSectionNode();
2398 }
2399 if (pStartOfSectionNodeSttNd == pStartOfSectionNode)
2400 pEndNd = rOutlineNodes[iPos];
2401 }
2402 }
2403
2404 // table, text box, header, footer
2405 if (pSttNd->GetTableBox() || pSttNd->GetIndex() < rNodes.GetEndOfExtras().GetIndex())
2406 {
2407 // limit to within section
2408 if (pSttNd->EndOfSectionIndex() < pEndNd->GetIndex())
2409 pEndNd = pSttNd->EndOfSectionNode();
2410 }
2411 // if pSttNd isn't in table but pEndNd is, skip over all outline nodes in table
2412 else if (pEndNd->GetTableBox())
2413 {
2414 pEndNd = &rNodes.GetEndOfContent();
2415 for (size_t nOutlinePos = nPos + 2; nOutlinePos < rOutlineNodes.size(); nOutlinePos++)
2416 {
2417 if (!(rOutlineNodes[nOutlinePos]->GetTableBox()))
2418 {
2419 pEndNd = rOutlineNodes[nOutlinePos];
2420 break;
2421 }
2422 }
2423 }
2424 // end node determined
2425
2426 // Remove content frames from the next node after the starting outline node to
2427 // the determined ending node. Always do this to prevent the chance of duplicate
2428 // frames being made. They will be remade below if needed.
2429 SwNodeIndex aIdx(*pSttNd, +1);
2430 while (aIdx != *pEndNd)
2431 {
2432 SwNode* pNd = &aIdx.GetNode();
2433 if (pNd->IsContentNode())
2434 pNd->GetContentNode()->DelFrames(nullptr);
2435 else if (pNd->IsTableNode())
2436 pNd->GetTableNode()->DelFrames(nullptr);
2437 aIdx++;
2438 }
2439
2440 if (bMakeVisible) // make outline nodes outline content visible
2441 {
2442 // reset the index marker and make frames
2443 aIdx.Assign(*pSttNd, +1);
2444 MakeFrames(GetDoc(), aIdx.GetNode(), *pEndNd);
2445
2447
2448 // make outline content made visible that have outline visible attribute false not visible
2449 while (aIdx != *pEndNd)
2450 {
2451 SwNode* pNd = &aIdx.GetNode();
2452 if (pNd->IsTextNode() && pNd->GetTextNode()->IsOutline())
2453 {
2454 SwTextNode* pTextNd = pNd->GetTextNode();
2455 bool bOutlineContentVisibleAttr = true;
2456 pTextNd->GetAttrOutlineContentVisible(bOutlineContentVisibleAttr);
2457 if (!bOutlineContentVisibleAttr)
2458 {
2460 if (rOutlineNodes.Seek_Entry(pTextNd, &iPos))
2461 {
2462 if (pTextNd->getLayoutFrame(nullptr))
2463 MakeOutlineContentVisible(iPos, false);
2464 }
2465 }
2466 }
2467 aIdx++;
2468 }
2469 }
2470 else
2471 pSttNd->GetTextNode()->SetAttrOutlineContentVisible(false);
2472}
2473
2474// make content visible or not visible only if needed
2476{
2478
2479 const SwOutlineNodes& rOutlineNds = GetNodes().GetOutLineNds();
2480 for (SwOutlineNodes::size_type nPos = 0; nPos < rOutlineNds.size(); ++nPos)
2481 {
2482 bool bIsOutlineContentVisible = IsOutlineContentVisible(nPos);
2483 bool bOutlineContentVisibleAttr = true;
2484 rOutlineNds[nPos]->GetTextNode()->GetAttrOutlineContentVisible(bOutlineContentVisibleAttr);
2485 if (!bIsOutlineContentVisible && bOutlineContentVisibleAttr)
2487 else if (bIsOutlineContentVisible && !bOutlineContentVisibleAttr)
2489 }
2490}
2491
2493{
2494 // deselect any drawing or frame and leave editing mode
2495 SdrView* pSdrView = GetDrawView();
2496 if (pSdrView && pSdrView->IsTextEdit() )
2497 {
2498 bool bLockView = IsViewLocked();
2499 LockView(true);
2500 EndTextEdit();
2501 LockView(bLockView);
2502 }
2503
2504 if (IsSelFrameMode() || IsObjSelected())
2505 {
2506 UnSelectFrame();
2509 EnterStdMode();
2512 }
2513 else
2514 EnterStdMode();
2515
2517
2518 if (bMakeVisible)
2519 {
2520 // make all content visible
2521
2522 // When shortcut is assigned to the show outline content visibility button and used to
2523 // toggle the feature and the mouse pointer is on an outline frame the button will not
2524 // be removed. An easy way to make sure the button does not remain shown is to use the
2525 // HideControls function.
2527
2528 // temporarily set outline content visible attribute true for folded outline nodes
2529 std::vector<SwNode*> aFoldedOutlineNodeArray;
2530 for (SwNode* pNd: GetNodes().GetOutLineNds())
2531 {
2532 bool bOutlineContentVisibleAttr = true;
2533 pNd->GetTextNode()->GetAttrOutlineContentVisible(bOutlineContentVisibleAttr);
2534 if (!bOutlineContentVisibleAttr)
2535 {
2536 aFoldedOutlineNodeArray.push_back(pNd);
2537 pNd->GetTextNode()->SetAttrOutlineContentVisible(true);
2538 }
2539 }
2540
2541 StartAction();
2543 EndAction();
2544
2545 // restore outline content visible attribute for folded outline nodes
2546 for (SwNode* pNd: aFoldedOutlineNodeArray)
2547 pNd->GetTextNode()->SetAttrOutlineContentVisible(false);
2548 }
2549 else
2550 {
2551 StartAction();
2553 EndAction();
2554
2555 // If needed, find visible outline node to place cursor.
2557 {
2558 while (nPos != SwOutlineNodes::npos && !GetNodes().GetOutLineNds()[nPos]->GetTextNode()->getLayoutFrame(nullptr))
2559 --nPos;
2562 }
2563 }
2564 GetView().GetDocShell()->Broadcast(SfxHint(SfxHintId::DocChanged));
2565}
2566
2568{
2569 bool bVisibleAttr = true;
2570 GetNodes().GetOutLineNds()[nPos]->GetTextNode()->GetAttrOutlineContentVisible(bVisibleAttr);
2571 return bVisibleAttr;
2572}
2573
2574/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
@ OLE_CAP
@ UndoArg1
Definition: SwRewriter.hxx:29
@ UndoArg3
Definition: SwRewriter.hxx:31
@ UndoArg2
Definition: SwRewriter.hxx:30
const char * pName
bool Erase(const Color &rFillColor)
bool isLetterNumeric(const OUString &rStr, sal_Int32 nPos) const
const OUString & GetValue() const
void IncreaseLuminance(sal_uInt8 cLumInc)
Size GetSizePixel(const OutputDevice *pRefDevice=nullptr) const
virtual void RemoveLeadingWhiteSpace(const SwPosition &rPos)=0
Removes any leading white space from the paragraph.
virtual SwFieldType * GetFieldType(SwFieldIds nResId, const OUString &rName, bool bDbFieldMatching) const =0
virtual void AppendUndo(std::unique_ptr< SwUndo > pUndo)=0
Add new Undo action.
virtual bool DoesUndo() const =0
Is Undo enabled?
virtual void ClearRedo()=0
Delete all Redo actions.
const OUString & getBcp47(bool bResolveSystem=true) const
SAL_WARN_UNUSED_RESULT Point LogicToLogic(const Point &rPtSource, const MapMode *pMapModeSource, const MapMode *pMapModeDest) const
virtual SdrEndTextEditKind SdrEndTextEdit(bool bDontDeleteReally=false)
virtual bool IsTextEdit() const final override
virtual SdrViewContext GetContext() const
void Invalidate(sal_uInt16 nId)
bool SetObjArea(const tools::Rectangle &)
void SetObjAreaAndScale(const tools::Rectangle &, const Fraction &, const Fraction &)
const Fraction & GetScaleHeight() const
const tools::Rectangle & GetObjArea() const
ErrCode DoVerb(sal_Int32 nVerb)
const Fraction & GetScaleWidth() const
virtual bool IsProtected() const
void ClearItem()
const SfxPoolItem * GetCurItem() const
const SfxPoolItem * NextItem()
SfxItemState GetItemState(bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
void EnableSetModified(bool bEnable=true)
const T * GetArg(sal_uInt16 nSlotId) const
const SfxSlot * GetSlot(sal_uInt16 nId) const
const char * GetUnoName() const
SfxBindings & GetBindings()
weld::Window * GetFrameWeld() const
SfxInPlaceClient * FindIPClient(const css::uno::Reference< css::embed::XEmbeddedObject > &xObj, vcl::Window *pObjParentWin) const
SfxViewFrame * GetViewFrame() const
constexpr tools::Long Height() const
tools::Long AdjustHeight(tools::Long n)
void setWidth(tools::Long nWidth)
tools::Long AdjustWidth(tools::Long n)
void setHeight(tools::Long nHeight)
constexpr tools::Long Width() const
static sal_uInt16 IsChart(const SvGlobalName &rName)
static sal_uInt16 IsMath(const SvGlobalName &rName)
sal_uInt32 GetStandardFormat(SvNumFormatType eType, LanguageType eLnge=LANGUAGE_DONTKNOW)
const SvNumberformat * GetEntry(sal_uInt32 nKey) const
LanguageType GetLanguage() const
const OUString & GetFormatstring() const
void Remove(const SvGlobalName &)
static SvxAbstractDialogFactory * Create()
SvxAutoCorrect * GetAutoCorrect()
static SvxAutoCorrCfg & Get()
bool IsAutoCorrFlag(ACFlags nFlag) const
tools::Long GetIndentAt() const
void SetAbsLSpace(sal_Int32 nSet)
void SetBulletFont(const vcl::Font *pFont)
tools::Long GetFirstLineIndent() const
void SetListFormat(const OUString &rPrefix, const OUString &rSuffix, int nLevel)
void SetNumAdjust(SvxAdjust eSet)
SvxNumPositionAndSpaceMode GetPositionAndSpaceMode() const
void SetBulletChar(sal_UCS4 cSet)
void SetNumberingType(SvxNumType nSet)
SvxNumType GetNumberingType() const
Class for automated call of Start- and EndAction().
Definition: editsh.hxx:1019
Represents the style of a text portion.
Definition: charfmt.hxx:27
Represents one list item in a content control dropdown list.
OUString m_aValue
This must not be empty.
SwContentFrame * getLayoutFrame(const SwRootFrame *, const SwPosition *pPos=nullptr, std::pair< Point, bool > const *pViewPosAndCalcFrame=nullptr) const
Definition: node.cxx:1224
void DelFrames(SwRootFrame const *pLayout)
Method deletes all views of document for the node.
Definition: node.cxx:1433
bool Pop(PopMode, ::std::optional< SwCallLink > &roLink)
OUString GetCursorDescr() const
Returns textual description of the current selection.
Definition: crsrsh.cxx:3683
void Push()
store a copy of the current cursor on the cursor stack
Definition: crsrsh.cxx:2246
void ShowCursor()
Definition: crsrsh.cxx:2405
void StartAction()
Definition: crsrsh.cxx:225
const SwTableNode * IsCursorInTable() const
Definition: crsrsh.hxx:909
bool SetCursorInHdFt(size_t nDescNo, bool bInHeader)
Definition: crstrvl.cxx:192
void SwapPam()
Definition: crsrsh.cxx:975
void HideCursor()
Definition: crsrsh.cxx:2424
bool HasSelection() const
Does the current cursor create a selection?
Definition: crsrsh.cxx:2530
void SetFlyMacroLnk(const Link< const SwFlyFrameFormat *, void > &rLnk)
Definition: crsrsh.hxx:495
virtual SwCursor & GetCurrentShellCursor() override
Return the current shell cursor.
Definition: crsrsh.cxx:184
void NormalizePam(bool bPointFirst=true)
Ensure point and mark of the current PaM are in a specific order.
Definition: crsrsh.cxx:969
bool IsEndPara() const
Definition: crsrsh.cxx:1113
SwCursor * GetCursor(bool bMakeTableCursor=true) const
Return pointer to the current shell cursor.
Definition: crsrsh.cxx:193
OUString GetSelText() const
get selected text of a node at current cursor
Definition: crsrsh.cxx:2554
bool IsSttPara() const
Definition: crsrsh.cxx:1094
bool IsFormProtected()
Definition: crbm.cxx:281
bool IsSelection() const
Definition: crsrsh.hxx:899
bool IsEndWord(sal_Int16 nWordType=css::i18n::WordType::ANYWORD_IGNOREWHITESPACES) const
Definition: crstrvl1.cxx:31
void EndAction(const bool bIdleEnd=false)
Definition: crsrsh.cxx:242
bool GotoFootnoteText()
jump from content to footnote
Definition: trvlfnfl.cxx:89
bool IsInRightToLeftText() const
Definition: crsrsh.cxx:3447
void ClearMark()
Definition: crsrsh.cxx:938
bool SetInFrontOfLabel(bool bNew)
Definition: crsrsh.cxx:1161
SwShellCursor * getShellCursor(bool bBlock)
Delivers the current shell cursor.
Definition: crsrsh.cxx:3048
SwTable::SearchType GetEnhancedTableSelection() const
Definition: crsrsh.hxx:826
bool Left(sal_uInt16 nCnt, SwCursorSkipMode nMode, bool bAllowVisual=false)
Definition: crsrsh.hxx:361
void KillPams()
Definition: crsrsh.cxx:1021
SwOutlineNodes::size_type GetOutlinePos(sal_uInt8 nLevel=UCHAR_MAX, SwPaM *pPaM=nullptr)
search "outline position" before previous outline node at given level
Definition: crstrvl.cxx:1188
::sw::mark::IFieldmark * GetFieldmarkAfter()
Definition: crbm.cxx:293
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:3457
Definition: doc.hxx:192
void ClearLineNumAttrs(SwPosition const &rPos)
Definition: ndtbl.cxx:4195
IDocumentContentOperations const & getIDocumentContentOperations() const
Definition: doc.cxx:316
IDocumentUndoRedo & GetIDocumentUndoRedo()
Definition: doc.cxx:145
SwNodes & GetNodes()
Definition: doc.hxx:413
IDocumentFieldsAccess const & getIDocumentFieldsAccess() const
Definition: doc.cxx:358
const SwNumRule * SearchNumRule(const SwPosition &rPos, const bool bForward, const bool bNum, const bool bOutline, int nNonEmptyAllowed, OUString &sListId, SwRootFrame const *pLayout, const bool bInvestigateStartNode=false)
Searches for a text node with a numbering rule.
Definition: docnum.cxx:1607
SvNumberFormatter * GetNumberFormatter(bool bCreate=true)
Definition: doc.hxx:1414
SwDocShell * GetDocShell()
Definition: doc.hxx:1355
sal_uInt16 GetCntType() const
Determine form of content. Return Type at CurrentCursor->SPoint.
Definition: edws.cxx:126
void StartAllAction()
For all views of this document.
Definition: edws.cxx:86
void SplitNode(bool bAutoFormat=false, bool bCheckTableStart=true)
Definition: editsh.cxx:183
size_t GetTableFrameFormatCount(bool bUsed=false) const
TABLE.
Definition: edfmt.cxx:99
SwFormat * GetFormatFromPool(sal_uInt16 nId)
return the requested automatic format - base-class !
Definition: edfmt.cxx:127
bool IsRedlineOn() const
Definition: edredln.cxx:43
void ChgDBData(const SwDBData &SwDBData)
Definition: edfld.cxx:296
virtual void ApplyViewOptions(const SwViewOption &rOpt) override
Apply ViewOptions with Start-/EndAction.
Definition: editsh.cxx:1092
SwFrameFormat & GetTableFrameFormat(size_t nFormat, bool bUsed=false) const
Definition: edfmt.cxx:104
SwCharFormat * GetCharFormatFromPool(sal_uInt16 nId)
Definition: editsh.hxx:354
SwUndoId StartUndo(SwUndoId eUndoId=SwUndoId::EMPTY, const SwRewriter *pRewriter=nullptr)
Undo: set up Undo parenthesis, return nUndoId of this parenthesis.
Definition: edws.cxx:223
bool GetGrfSize(Size &) const
Definition: editsh.cxx:279
void SetAttrItem(const SfxPoolItem &, SetAttrMode nFlags=SetAttrMode::DEFAULT, const bool bParagraphSetting=false)
Definition: edatmisc.cxx:98
void SetAttrSet(const SfxItemSet &, SetAttrMode nFlags=SetAttrMode::DEFAULT, SwPaM *pCursor=nullptr, const bool bParagraphSetting=false)
Definition: edatmisc.cxx:129
SwCharFormat * FindCharFormatByName(const OUString &rName) const
Definition: edfmt.cxx:147
void Overwrite(const OUString &)
Definition: editsh.cxx:169
svt::EmbeddedObjectRef & GetOLEObject() const
Get OLE object at pointer.
Definition: editsh.cxx:359
void Insert2(const OUString &, const bool bForceExpandHints=false)
Definition: editsh.cxx:79
void SetTextFormatColl(SwTextFormatColl *, const bool bResetListAttrs=false)
Add 2nd optional parameter <bResetListAttrs> - see also <SwDoc::SetTextFormatColl(....
Definition: edfcol.cxx:2189
void SetCurNumRule(const SwNumRule &, const bool bCreateNewList, const OUString &sContinuedListId=OUString(), const bool bResetIndentAttrs=false)
Optional parameter <bResetIndentAttrs> (default value false).
Definition: ednumber.cxx:738
SwTextFormatColl * FindTextFormatCollByName(const OUString &rName) const
Definition: edfmt.cxx:152
const SwNumRule * GetOutlineNumRule() const
Definition: ednumber.cxx:117
bool GetPaMAttr(SwPaM *pPaM, SfxItemSet &, const bool bMergeIndentValuesOfNumRule=false) const
Apply / remove attributes.
Definition: edattr.cxx:59
SwTextFormatColl * GetTextCollFromPool(sal_uInt16 nId)
Definition: edfmt.cxx:121
const SwNumRule * GetNumRuleAtCurrCursorPos() const
Definition: ednumber.cxx:694
void DelNumRules()
Delete, split enumeration list.
Definition: ednumber.cxx:249
void SetModified()
Definition: edws.cxx:70
SwUndoId EndUndo(SwUndoId eUndoId=SwUndoId::EMPTY, const SwRewriter *pRewriter=nullptr)
Closes parenthesis of nUndoId, not used by UI.
Definition: edws.cxx:234
void AutoCorrect(SvxAutoCorrect &rACorr, bool bInsertMode, sal_Unicode cChar)
Call AutoCorrect.
Definition: edws.cxx:255
SwTextFormatColl * GetCurTextFormatColl() const
Get the named paragraph format of the current selection.
Definition: edattr.cxx:238
OUString GetUniqueNumRuleName() const
Definition: ednumber.cxx:780
void GetSelectedText(OUString &rBuf, ParaBreakType nHndlParaBreak=ParaBreakType::ToBlank)
Query text within selection.
Definition: edglss.cxx:260
void FillByEx(SwCharFormat *)
Definition: edfmt.cxx:51
void ResetAttr(const o3tl::sorted_vector< sal_uInt16 > &attrs=o3tl::sorted_vector< sal_uInt16 >(), SwPaM *pCursor=nullptr)
Definition: edatmisc.cxx:32
void EndAllAction()
Definition: edws.cxx:97
bool IsUsed(const sw::BroadcastingModify &) const
Query if the paragraph-/character-/frame-/page-style is used.
Definition: edfmt.cxx:137
void FlushInBuffer()
Character buffer is inserted into the document.
Definition: edtwin.cxx:881
void StopQuickHelp()
Definition: edtwin.cxx:6142
bool IsFrameAction() const
Definition: edtwin.hxx:219
SwFrameControlsManager & GetFrameControlsManager()
Definition: edtwin.cxx:6815
SwFlyFrame * GetSelectedFlyFrame() const
Definition: fefly1.cxx:277
bool SetFlyFrameAttr(SfxItemSet &rSet)
Definition: fefly1.cxx:1105
void AlignFormulaToBaseline(const css::uno::Reference< css::embed::XEmbeddedObject > &xObj)
for starmath formulas anchored 'as char' it aligns it baseline to baseline changing the previous vert...
Definition: fefly1.cxx:2050
void ChgPageDesc(size_t i, const SwPageDesc &)
Definition: fedesc.cxx:111
SwFlyFrameFormat * InsertObject(const svt::EmbeddedObjectRef &, SfxItemSet *pFlyAttrSet)
Definition: fefly1.cxx:930
SwPageDesc * FindPageDescByName(const OUString &rName, bool bGetFromPool=false, size_t *pPos=nullptr)
Definition: fedesc.cxx:131
bool IsFrameSelected() const
Definition: feshview.cxx:1253
void SetCheckForOLEInCaption(bool bFlag)
Definition: fesh.hxx:459
size_t GetPageDescCnt() const
Definition: fedesc.cxx:38
SwFrameFormat * GetSelectedFrameFormat() const
If frame then frame style, else 0.
Definition: fefly1.cxx:1215
void ToggleHeaderFooterEdit()
Definition: fews.cxx:1319
void Insert(const OUString &rGrfName, const OUString &rFltName, const Graphic *pGraphic, const SfxItemSet *pFlyAttrSet)
Definition: fefly1.cxx:839
size_t GetCurPageDesc(const bool bCalcFrame=true) const
Definition: fedesc.cxx:167
Size GetGraphicDefaultSize() const
Definition: fews.cxx:1241
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
bool GetFlyFrameAttr(SfxItemSet &rSet) const
Definition: fefly1.cxx:1063
Size RequestObjectResize(const SwRect &rRect, const css::uno::Reference< css::embed::XEmbeddedObject > &)
OLE.
Definition: fefly1.cxx:1320
void EndTextEdit()
Deletes object if required.
Definition: feshview.cxx:1313
void ChgCurPageDesc(const SwPageDesc &)
PageDescriptor-interface.
Definition: fedesc.cxx:43
size_t IsObjSelected() const
Definition: feshview.cxx:1245
void CalcBoundRect(SwRect &_orRect, const RndStdIds _nAnchorId, const sal_Int16 _eHoriRelOrient=css::text::RelOrientation::FRAME, const sal_Int16 _eVertRelOrient=css::text::RelOrientation::FRAME, const SwPosition *_pToCharContentPos=nullptr, const bool _bFollowTextFlow=false, bool _bMirror=false, Point *_opRef=nullptr, Size *_opPercent=nullptr, const SwFormatFrameSize *pFormatFrameSize=nullptr) const
i#17567 - adjustments to allow negative vertical positions for fly frames anchored to paragraph or to...
Definition: fews.cxx:690
const SwPageDesc & GetPageDesc(size_t i) const
Definition: fedesc.cxx:126
void ResetFlyFrameAttr(const SfxItemSet *pSet)
Definition: fefly1.cxx:1188
const SwFrameFormat * GetFlyFrameFormat() const
Get FlyFrameFormat; for UI macro linkage at Flys.
Definition: fefly1.cxx:1272
bool InsertField(SwInsertField_Data &rData)
Definition: fldmgr.cxx:895
SwField * GetCurField()
Definition: fldmgr.cxx:430
Instances of SwFields and those derived from it occur 0 to n times.
Definition: fldbas.hxx:242
SwFieldIds Which() const
Definition: fldbas.hxx:273
SwFormatField * FindFormatForField(const SwField *) const
Definition: fldbas.cxx:169
SwFieldType * GetTyp() const
Definition: fldbas.hxx:398
void SetAnchor(RndStdIds eId)
Definition: frmmgr.cxx:225
tools::Long CalcWidthBorder()
Definition: frmmgr.hxx:134
void SetSize(const Size &rLSize)
Definition: frmmgr.cxx:612
RndStdIds GetAnchor() const
Definition: frmmgr.hxx:167
const Size & GetSize() const
Definition: frmmgr.hxx:138
void DelAttr(sal_uInt16 nId)
Definition: frmmgr.cxx:533
tools::Long CalcHeightBorder()
Definition: frmmgr.hxx:135
const SfxItemSet & GetAttrSet() const
Definition: frmmgr.hxx:124
void UpdateFlyFrame()
Definition: frmmgr.cxx:159
void SetHeightSizeType(SwFrameSize eType)
Definition: frmmgr.cxx:591
void UpdateAttrMgr()
Definition: frmmgr.cxx:137
const Point & GetLastFlyFramePrtRectPos() const
Definition: frmfmt.hxx:255
general base class for all free-flowing frames
Definition: flyfrm.hxx:79
virtual const SwFlyFrameFormat * GetFormat() const override
Definition: fly.cxx:2897
RndStdIds GetAnchorId() const
Definition: fmtanchr.hxx:67
const SwPosition * GetContentAnchor() const
Definition: fmtanchr.hxx:69
SfxPoolItem subclass that wraps an SwContentControl.
Footer, for pageformats Client of FrameFormat describing the footer.
Definition: fmthdft.hxx:65
bool IsActive() const
Definition: fmthdft.hxx:89
const SwFrameFormat * GetFooterFormat() const
Definition: fmthdft.hxx:85
void SetNumStr(const OUString &rStr)
Definition: fmtftn.hxx:75
Header, for PageFormats Client of FrameFormat describing the header.
Definition: fmthdft.hxx:34
bool IsActive() const
Definition: fmthdft.hxx:58
const SwFrameFormat * GetHeaderFormat() const
Definition: fmthdft.hxx:54
SfxPoolItem subclass that wraps an SwLineBreakClear.
Pagedescriptor Client of SwPageDesc that is "described" by the attribute.
Definition: fmtpdsc.hxx:36
void SetNumOffset(const ::std::optional< sal_uInt16 > &oNum)
Definition: fmtpdsc.hxx:65
bool IsDefault() const
Definition: format.hxx:129
const SwFormatFooter & GetFooter(bool=true) const
Definition: fmthdft.hxx:99
const OUString & GetName() const
Definition: format.hxx:131
const SwFormatHeader & GetHeader(bool=true) const
Definition: fmthdft.hxx:97
const SwNumRuleItem & GetNumRule(bool=true) const
Definition: paratr.hxx:232
const SwFormatAnchor & GetAnchor(bool=true) const
Definition: fmtanchr.hxx:83
virtual bool SetFormatAttr(const SfxPoolItem &rAttr)
Definition: format.cxx:447
void HideControls(FrameControlType eType)
void SetReadonlyControls(bool bReadonly)
Style of a layout element.
Definition: frmfmt.hxx:62
virtual OUString GetDescription() const
Definition: atrfrm.cxx:2858
Class for automated call of Start- and EndCursorMove().
Definition: editsh.hxx:1027
bool addEntry(const SwPosition &rPos)
Definition: navmgr.cxx:168
Marks a node in the document model.
Definition: ndindex.hxx:31
SwNodeIndex & Assign(SwNodes const &rNds, SwNodeOffset)
Definition: ndindex.hxx:291
const SwNodes & GetNodes() const
Definition: ndindex.hxx:175
SwNode & GetNode() const
Definition: ndindex.hxx:136
Base class of the Writer document model elements.
Definition: node.hxx:84
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
Definition: ndtxt.hxx:877
SwSectionNode * GetSectionNode()
Definition: node.hxx:636
SwNodeOffset GetIndex() const
Definition: node.hxx:296
SwTableBox * GetTableBox() const
If node is in a table return the respective table box.
Definition: node.cxx:766
bool IsContentNode() const
Definition: node.hxx:657
bool IsEndNode() const
Definition: node.hxx:661
bool IsSectionNode() const
Definition: node.hxx:673
bool IsTableNode() const
Definition: node.hxx:669
bool IsTextNode() const
Definition: node.hxx:665
SwTableNode * FindTableNode()
Search table node, in which it is.
Definition: node.cxx:370
const SwStartNode * StartOfSectionNode() const
Definition: node.hxx:137
SwNodeOffset EndOfSectionIndex() const
Definition: node.hxx:706
SwContentNode * GetContentNode()
Definition: node.hxx:644
SwTableNode * GetTableNode()
Definition: node.hxx:628
const SwEndNode * EndOfSectionNode() const
Definition: node.hxx:711
const SwOutlineNodes & GetOutLineNds() const
Array of all OutlineNodes.
Definition: ndarr.hxx:240
SwNode & GetEndOfExtras() const
This is the last EndNode of a special section.
Definition: ndarr.hxx:163
SwTextNode * MakeTextNode(SwNode &rWhere, SwTextFormatColl *pColl, bool bNewFrames=true)
Implementations of "Make...Node" are in the given .cxx-files.
Definition: ndtxt.cxx:120
SwNode & GetEndOfContent() const
Regular ContentSection (i.e. the BodyText).
Definition: ndarr.hxx:165
void SetCharFormat(SwCharFormat *)
Definition: number.cxx:281
bool IsAutoRule() const
Definition: numrule.hxx:229
bool IsOutlineRule() const
Definition: numrule.hxx:241
void ChangeIndent(const sal_Int32 nDiff)
change indent of all list levels by given difference
Definition: number.cxx:981
const SwNumFormat & Get(sal_uInt16 i) const
Definition: number.cxx:87
void Set(sal_uInt16 i, const SwNumFormat *)
Definition: number.cxx:618
bool Seek_Entry(SwNode *rP, size_type *pnPos) const
Definition: ndnum.cxx:32
static constexpr auto npos
Definition: ndarr.hxx:81
PaM is Point and Mark: a selection of the document model.
Definition: pam.hxx:187
SwNode & GetPointNode() const
Definition: pam.hxx:283
void DeleteMark()
Definition: pam.hxx:231
const SwPosition * GetPoint() const
Definition: pam.hxx:261
const OUString & GetName() const
Definition: pagedesc.hxx:196
SwFrameFormat & GetMaster()
Definition: pagedesc.hxx:238
void RegisterAnswerText(const OUString &aAnswerText)
Definition: PostItMgr.hxx:258
OutlinerParaObject * IsAnswer()
Definition: PostItMgr.hxx:257
const OUString & GetAnswerText() const
Definition: PostItMgr.hxx:259
SW_DLLPUBLIC bool HasActiveSidebarWin() const
Definition: PostItMgr.cxx:2378
void * pObject
Definition: hints.hxx:61
Of course Writer needs its own rectangles.
Definition: swrect.hxx:35
void Height(tools::Long nNew)
Definition: swrect.hxx:193
bool IsEmpty() const
Definition: swrect.hxx:304
void Pos(const Point &rNew)
Definition: swrect.hxx:171
void SSize(const Size &rNew)
Definition: swrect.hxx:180
tools::Rectangle SVRect() const
Definition: swrect.hxx:292
void Width(tools::Long nNew)
Definition: swrect.hxx:189
void AddRule(SwUndoArg eWhat, const OUString &rWith)
Definition: SwRewriter.cxx:25
virtual bool GetInfo(SfxPoolItem &) const override
Definition: section.cxx:806
const SwSection & GetSection() const
Definition: node.hxx:568
SwSectionFormat * GetFormat()
Definition: section.hxx:337
static void Get1PixelInLogic(const SwViewShell &rSh, tools::Long *pX=nullptr, tools::Long *pY=nullptr)
Definition: viscrs.cxx:832
static SW_DLLPUBLIC sal_uInt16 GetPoolIdFromUIName(const OUString &rName, SwGetPoolIdFromName)
const SwTable & GetTable() const
Definition: node.hxx:522
void DelFrames(SwRootFrame const *pLayout=nullptr)
Method deletes all views of document for the node.
Definition: ndtbl.cxx:2428
SwTable is one table in the document model, containing rows (which contain cells).
Definition: swtable.hxx:113
@ SEARCH_COL
Definition: swtable.hxx:148
@ SEARCH_ROW
Definition: swtable.hxx:147
bool HasLayout() const
Definition: swtable.cxx:2938
Represents the style of a paragraph.
Definition: fmtcol.hxx:59
bool IsAssignedToListLevelOfOutlineStyle() const
Definition: fmtcol.hxx:120
int GetAssignedOutlineStyleLevel() const
Definition: fmtcol.cxx:604
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:89
bool IsOutline() const
Returns if this text node is an outline.
Definition: ndtxt.cxx:4101
bool IsInList() const
Definition: ndtxt.cxx:4509
void GetAttrOutlineContentVisible(bool &bOutlineContentVisibleAttr)
GetAttrOutlineContentVisible.
Definition: ndtxt.cxx:4146
bool IsCountedInList() const
Definition: ndtxt.cxx:4356
SwTwips GetAdditionalIndentForStartingNewList() const
Definition: ndtxt.cxx:3332
SwTwips GetWidthOfLeadingTabs() const
Returns the width of leading tabs/blanks in this paragraph.
Definition: itratr.cxx:1451
SwNumRule * GetNumRule(bool bInParent=true) const
Returns numbering rule of this text node.
Definition: ndtxt.cxx:2889
int GetActualListLevel(SwListRedlineType eRedline=SwListRedlineType::SHOW) const
Returns the actual list level of this text node, when it is a list item.
Definition: ndtxt.cxx:4211
int GetAttrOutlineLevel() const
Returns outline level of this text node.
Definition: ndtxt.cxx:4131
void SetAttrOutlineContentVisible(bool bVisible)
Definition: ndtxt.cxx:4154
SwTextFormatColl * GetTextColl() const
Definition: ndtxt.hxx:871
static void ClearSelection(const SwWrtShell &rSh, const SwFrameShell *pCreator=nullptr)
Definition: swdtflvr.cxx:4324
bool IsShowOutlineContentVisibilityButton() const
Definition: viewopt.cxx:99
bool IsTreatSubOutlineLevelsAsContent() const
Definition: viewopt.cxx:104
bool IsViewLocked() const
Definition: viewsh.hxx:474
bool IsHeaderFooterEdit() const
Acts both for headers / footers, depending on the bShow(Header|Footer)Separator flags.
Definition: viewsh.hxx:575
const SwViewOption * GetViewOptions() const
Definition: viewsh.hxx:436
void UnlockPaint(bool bVirDev=false)
Definition: viewsh.hxx:622
const SwNodes & GetNodes() const
Definition: viewsh.cxx:2190
rtl::Reference< SwDoc > mxDoc
The document; never 0.
Definition: viewsh.hxx:179
bool ActionPend() const
Definition: viewsh.hxx:204
SwRootFrame * GetLayout() const
Definition: viewsh.cxx:2172
void LockPaint()
Definition: viewsh.hxx:617
virtual void SetReadonlyOption(bool bSet)
Definition: viewsh.cxx:2474
SwDoc * GetDoc() const
Definition: viewsh.hxx:290
void LockView(bool b)
Definition: viewsh.hxx:475
const SwPostItMgr * GetPostItMgr() const
Definition: viewsh.hxx:569
void SetSfxViewShell(SfxViewShell *pNew)
Definition: viewsh.hxx:455
const SfxItemPool & GetAttrPool() const
Definition: viewsh.hxx:627
virtual void SetShowHeaderFooterSeparator(FrameControlType eControl, bool bShow)
Definition: viewsh.cxx:99
SdrView * GetDrawView()
Definition: vnew.cxx:373
Definition: view.hxx:146
bool IsFormMode() const
Definition: viewdraw.cxx:631
void AutoCaption(const sal_uInt16 nType, const SvGlobalName *pOleId=nullptr)
Definition: viewdlg2.cxx:180
bool IsBezierEditMode() const
Definition: viewdraw.cxx:626
SwPostItMgr * GetPostItMgr()
Definition: view.hxx:639
void StopShellTimer()
Definition: view.cxx:1819
SwEditWin & GetEditWin()
Definition: view.hxx:416
SwDocShell * GetDocShell()
Definition: view.cxx:1160
bool IsDrawMode() const
Definition: view.hxx:539
void LeaveDrawCreate()
Definition: view.hxx:538
void NotifyDBChanged()
Definition: view.cxx:1914
Used by the UI to modify the document model.
Definition: wrtsh.hxx:97
OUString const & GetCurPageStyle() const
Definition: wrtsh1.cxx:1866
bool IsSelFrameMode() const
Definition: wrtsh.hxx:177
SAL_DLLPRIVATE tools::Long SetCursorKillSel(const Point *, bool bProp)
Definition: select.cxx:316
void AutoUpdatePara(SwTextFormatColl *pColl, const SfxItemSet &rStyleSet, SwPaM *pPaM=nullptr)
Definition: wrtsh1.cxx:1886
void EnterSelFrameMode(const Point *pStartDrag=nullptr)
Definition: select.cxx:702
virtual void ConnectObj(svt::EmbeddedObjectRef &xIPObj, const SwRect &rPrt, const SwRect &rFrame) override
Connect objects with ActivateWhenVisible at Paint.
Definition: wrtsh1.cxx:910
bool Right(SwCursorSkipMode nMode, bool bSelect, sal_uInt16 nCount, bool bBasicCall, bool bVisual=false)
Definition: move.cxx:127
void LeaveSelFrameMode()
Definition: select.cxx:720
void InsertPostIt(SwFieldMgr &rFieldMgr, const SfxRequest &rReq)
Inserts a new annotation/comment at the current cursor position / selection.
Definition: wrtsh1.cxx:2208
bool IsOutlineContentVisible(const size_t nPos)
Definition: wrtsh1.cxx:2310
void addCurrentPosition()
Definition: wrtsh1.cxx:1847
void PopMode()
Definition: select.cxx:284
SwWrtShell(SwWrtShell &, vcl::Window *pWin, SwView &rShell)
Definition: wrtsh1.cxx:1973
void InsertLineBreak(std::optional< SwLineBreakClear > oClear=std::nullopt)
Definition: wrtsh1.cxx:959
void AutoUpdateFrame(SwFrameFormat *pFormat, const SfxItemSet &rStyleSet)
Definition: wrtsh1.cxx:1923
bool GotoFieldmark(::sw::mark::IFieldmark const *const pMark)
Definition: wrtsh3.cxx:225
void NumOn()
Definition: wrtsh1.cxx:1645
bool GetAttrOutlineContentVisible(const size_t nPos)
Definition: wrtsh1.cxx:2567
bool IsModePushed() const
Definition: wrtsh.hxx:138
void NumOrBulletOff()
Definition: wrtsh1.cxx:1650
bool Left(SwCursorSkipMode nMode, bool bSelect, sal_uInt16 nCount, bool bBasicCall, bool bVisual=false)
Definition: move.cxx:110
virtual void CalcAndSetScale(svt::EmbeddedObjectRef &xObj, const SwRect *pFlyPrtRect=nullptr, const SwRect *pFlyFrameRect=nullptr, const bool bNoTextFramePrtAreaChanged=false) override
Client for OleObject has to be up-to-date regarding scaling.
Definition: wrtsh1.cxx:702
void Insert(const OUString &)
Definition: wrtsh1.cxx:224
virtual void MoveObjectIfActive(svt::EmbeddedObjectRef &xObj, const Point &rOffset) override
The layout has been changed, so the active object has to be moved after that.
Definition: wrtsh1.cxx:679
void ResetCursorStack()
Definition: wrtsh.hxx:639
SelectionType GetSelectionType() const
Definition: wrtsh1.cxx:1701
void InsertGraphic(const OUString &rPath, const OUString &rFilter, const Graphic &, SwFlyFrameAttrMgr *=nullptr, RndStdIds nAnchorType=RndStdIds::FLY_AT_PARA)
Definition: wrtsh1.cxx:275
void EnterStdMode()
Definition: select.cxx:551
virtual void SetReadonlyOption(bool bSet) override
Definition: wrtsh1.cxx:2110
bool InsertOleObject(const svt::EmbeddedObjectRef &xObj, SwFlyFrameFormat **pFlyFrameFormat=nullptr)
Definition: wrtsh1.cxx:498
SELECTFUNC m_fnKillSel
Definition: wrtsh.hxx:117
SwFrameFormat * GetTableStyle(std::u16string_view rFormatName)
Definition: wrtsh1.cxx:1835
void QuickUpdateStyle()
Definition: wrtsh1.cxx:1873
void SplitNode(bool bAutoFormat=false)
Definition: wrtsh1.cxx:1292
void InsertContentControl(SwContentControlType eType)
Definition: wrtsh1.cxx:1020
SwCharFormat * GetCharStyle(const OUString &rFormatName, GetStyle eCreate=GETSTYLE_NOCREATE)
Definition: wrtsh1.cxx:1818
@ GETSTYLE_NOCREATE
Definition: wrtsh.hxx:361
@ GETSTYLE_CREATEANY
Definition: wrtsh.hxx:363
virtual void ApplyViewOptions(const SwViewOption &rOpt) override
Apply ViewOptions with Start-/EndAction.
Definition: wrtsh1.cxx:2103
void ChgDBData(const SwDBData &SwDBData)
Definition: wrtsh1.cxx:2064
void NoEdit(bool bHideCursor=true)
Definition: wrtsh1.cxx:180
void InsertByWord(const OUString &)
Definition: wrtsh1.cxx:204
void MakeAllFoldedOutlineContentVisible(bool bMakeVisible=true)
Definition: wrtsh1.cxx:2492
SAL_DLLPRIVATE bool PopCursor(bool bUpdate, bool bSelect=false)
Definition: move.cxx:485
void InsertColumnBreak()
Definition: wrtsh1.cxx:997
void InsertFootnote(const OUString &, bool bEndNote=false, bool bEdit=true)
Definition: wrtsh1.cxx:1150
virtual void SetShowHeaderFooterSeparator(FrameControlType eControl, bool bShow) override
Definition: wrtsh1.cxx:2201
SwView & m_rView
Definition: wrtsh.hxx:561
SwNavigationMgr m_aNavigationMgr
Definition: wrtsh.hxx:562
void BulletOn()
Definition: wrtsh1.cxx:1696
void GotoOutline(SwOutlineNodes::size_type nIdx)
Definition: move.cxx:617
void MakeOutlineContentVisible(const size_t nPos, bool bMakeVisible=true)
Definition: wrtsh1.cxx:2361
void ChangeHeaderOrFooter(std::u16string_view rStyleName, bool bHeader, bool bOn, bool bShowWarning)
Definition: wrtsh1.cxx:2119
bool DelRight(bool isReplaceHeuristic=false)
Definition: delete.cxx:293
SELECTFUNC m_fnSetCursor
Definition: wrtsh.hxx:115
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:1933
bool HasSelection() const
Definition: wrtsh.hxx:147
virtual void DrawSelChanged() override
Definition: wrtsh3.cxx:244
bool IsInsMode() const
Definition: wrtsh.hxx:172
void InsertPageBreak(const OUString *pPageDesc=nullptr, const ::std::optional< sal_uInt16 > &rPgNum=std::nullopt)
Definition: wrtsh1.cxx:921
bool m_bIns
Definition: wrtsh.hxx:584
void Edit()
Definition: wrtsh1.cxx:186
bool IsAddMode() const
Definition: wrtsh.hxx:163
void UnSelectFrame()
Definition: select.cxx:323
void InvalidateOutlineContentVisibility()
Definition: wrtsh1.cxx:2475
bool IsEndWrd()
Definition: wrtsh1.cxx:194
virtual ~SwWrtShell() override
Definition: wrtsh1.cxx:2009
SwTextFormatColl * GetParaStyle(const OUString &rCollName, GetStyle eCreate=GETSTYLE_NOCREATE)
Definition: wrtsh1.cxx:1801
tools::Long ResetSelect(const Point *, bool)
Definition: select.cxx:333
void SetPageStyle(const OUString &rCollName)
Definition: wrtsh1.cxx:1854
bool CanInsert()
Definition: wrtsh1.cxx:2039
void LaunchOLEObj(sal_Int32 nVerb=css::embed::EmbedVerbs::MS_OLEVERB_PRIMARY)
Definition: wrtsh1.cxx:639
void NumOrBulletOn(bool bNum)
Turns on numbering or bullets.
Definition: wrtsh1.cxx:1331
OUString GetSelDescr() const
Definition: wrtsh1.cxx:2071
bool Pop(SwCursorShell::PopMode, ::std::optional< SwCallLink > &roLink)
Definition: wrtsh1.cxx:2025
const SwView & GetView() const
Definition: wrtsh.hxx:438
static UITestLogger & getInstance()
void logEvent(const EventDescription &rDescription)
static MapUnit UnoEmbed2VCLMapUnit(sal_Int32 nUnoEmbedMapUnit)
css::uno::Reference< css::embed::XEmbeddedObject > CreateEmbeddedObject(const css::uno::Sequence< sal_Int8 > &, OUString &, OUString const *pBaseURL=nullptr)
static css::uno::Reference< css::embed::XStorage > GetTemporaryStorage(const css::uno::Reference< css::uno::XComponentContext > &rxContext=css::uno::Reference< css::uno::XComponentContext >())
size_type size() const
static bool TryRunningState(const css::uno::Reference< css::embed::XEmbeddedObject > &)
void SetGraphicStream(const css::uno::Reference< css::io::XInputStream > &xInGrStream, const OUString &rMediaType)
void UpdateReplacement(bool bUpdateOle=false)
sal_Int64 GetViewAspect() const
Size GetSize(MapMode const *pTargetMapMode) const
void Assign(const css::uno::Reference< css::embed::XEmbeddedObject > &xObj, sal_Int64 nAspect)
const css::uno::Reference< css::embed::XEmbeddedObject > & GetObject() const
#define FN_VIEW_META_CHARS
Definition: cmdid.h:163
weld::Window * GetFrameWeld(const SfxFrame *pFrame)
Definition: dialoghelp.cxx:19
float u
#define CNT_OLE
Definition: editsh.hxx:132
sal_Int32 nState
@ FlyEmbeddedPrt
Rect of PrtArea of FlyFrame.
@ FlyEmbedded
Rect of current FlyFrame.
DocumentType eType
@ Fixed
Frame cannot be moved in Var-direction.
SwContentControlType
SwLineBreakClear
Defines the location of a line break text wrapping restart.
constexpr SwTwips DFLT_HEIGHT
Definition: frmmgr.hxx:39
constexpr SwTwips DFLT_WIDTH
Definition: frmmgr.hxx:38
void MakeFrames(SwDoc *pDoc, SwNode &rSttIdx, SwNode &rEndIdx)
Definition: frmtool.cxx:2013
SelectionType
constexpr TypedWhichId< SvxFormatBreakItem > RES_BREAK(94)
constexpr sal_uInt16 RES_FRMATR_BEGIN(RES_PARATR_LIST_END)
constexpr sal_uInt16 RES_FRMATR_END(133)
constexpr sal_uInt16 RES_CHRATR_END(46)
constexpr sal_uInt16 RES_PARATR_BEGIN(RES_TXTATR_END)
constexpr TypedWhichId< SwFormatFrameSize > RES_FRM_SIZE(89)
constexpr TypedWhichId< SvxULSpaceItem > RES_UL_SPACE(92)
constexpr sal_uInt16 RES_PARATR_END(82)
constexpr sal_uInt16 RES_CHRATR_BEGIN(HINT_BEGIN)
constexpr TypedWhichId< SwFormatContentControl > RES_TXTATR_CONTENTCONTROL(56)
constexpr TypedWhichId< SwPtrMsgPoolItem > RES_CONTENT_VISIBLE(185)
CharClass & GetAppCharClass()
Definition: init.cxx:705
Sequence< PropertyValue > aArguments
OUString aName
uno_Any a
sal_uInt16 nPos
MapUnit
constexpr OUStringLiteral aData
Definition: ww8scan.hxx:48
css::beans::PropertyValue makePropertyValue(const OUString &rName, T &&rValue)
int i
bool IsDefBulletFontUserDefined()
determine if default bullet font is user defined
Definition: number.cxx:1387
SvxNumberFormat::SvxNumPositionAndSpaceMode GetDefaultPositionAndSpaceMode()
Definition: number.cxx:1558
sal_Unicode GetBulletChar(sal_uInt8 nLevel)
retrieve unicode of character used for the default bullet list for the given list level
Definition: number.cxx:1397
const vcl::Font & GetDefBulletFont()
retrieve font used for the default bullet list characters
Definition: number.cxx:1392
constexpr auto toTwips(N number, Length from)
bool checkForSelectedCustomShapes(SdrView const *pSdrView, bool bOnlyExtruded)
bool checkForSelectedFontWork(SdrView const *pSdrView)
SwTextNode * GetParaPropsNode(SwRootFrame const &rLayout, SwNode const &rNode)
Definition: txtfrm.cxx:330
long Long
sal_Int16 nId
SwContentNode * GetNode(SwPaM &rPam, bool &rbFirst, SwMoveFnCollection const &fnMove, bool const bInReadOnly, SwRootFrame const *const i_pLayout)
This function returns the next node in direction of search.
Definition: pam.cxx:1012
constexpr tools::Long constTwips_5mm
Definition: pggrid.cxx:38
@ RES_POOLCHR_BULLET_LEVEL
Bullets.
Definition: poolfmt.hxx:118
@ RES_POOLCHR_NUM_LEVEL
Numbering symbols.
Definition: poolfmt.hxx:117
bool IsInvalidItem(const SfxPoolItem *pItem)
std::map< OUString, OUString > aParameters
Marks a position in the document model.
Definition: pam.hxx:37
void Assign(const SwNode &rNd, SwNodeOffset nDelta, sal_Int32 nContentOffset=0)
These all set both nNode and nContent.
Definition: pam.cxx:230
const SwContentNode * GetContentNode() const
Definition: pam.hxx:83
sal_Int32 GetContentIndex() const
Definition: pam.hxx:84
SVX_NUM_NUMBER_NONE
SVX_NUM_ARABIC
SVX_NUM_CHAR_SPECIAL
RndStdIds
SwView * GetActiveView()
Definition: swmodul1.cxx:116
OUString SwResId(TranslateId aId)
Definition: swmodule.cxx:164
#define SW_MOD()
Definition: swmodule.hxx:256
tools::Long SwTwips
Definition: swtypes.hxx:51
constexpr sal_uInt8 MAXLEVEL
Definition: swtypes.hxx:92
FrameControlType
Definition: swtypes.hxx:244
@ UI_INSERT_COLUMN_BREAK
@ UI_INSERT_PAGE_BREAK
bool bVisible
unsigned char sal_uInt8
sal_uInt16 sal_Unicode
RET_YES
static bool lcl_IsAllowed(const SwWrtShell *rSh)
Definition: wrtsh1.cxx:140
static bool lcl_FoldedOutlineNodeEndOfParaSplit(SwWrtShell *pThis)
Definition: wrtsh1.cxx:1180
static SvxAutoCorrect * lcl_IsAutoCorr()
Definition: wrtsh1.cxx:170
#define BITFLD_INI_LIST
Definition: wrtsh1.cxx:157