LibreOffice Module sw (master) 1
dview.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#include <config_wasm_strip.h>
21
22#include <hintids.hxx>
24#include <svx/svdpage.hxx>
25#include <svx/svdpagv.hxx>
26#include <svx/fmmodel.hxx>
27#include <sot/exchange.hxx>
29#include <tools/globname.hxx>
30#include <editeng/outliner.hxx>
31#include <osl/diagnose.h>
32#include <com/sun/star/embed/EmbedMisc.hpp>
33#include <com/sun/star/embed/XEmbeddedObject.hpp>
34
35#include <pagefrm.hxx>
36#include <rootfrm.hxx>
37#include <cntfrm.hxx>
38#include <notxtfrm.hxx>
39#include <flyfrm.hxx>
40#include <frmfmt.hxx>
41#include <dflyobj.hxx>
42#include <dcontact.hxx>
43#include <textboxhelper.hxx>
44#include <viewsh.hxx>
45#include <viewimp.hxx>
46#include <dview.hxx>
47#include <doc.hxx>
48#include <mdiexp.hxx>
49#include <ndole.hxx>
50#include <ndgrf.hxx>
51#include <fmtanchr.hxx>
52#include <IDocumentUndoRedo.hxx>
55
56#include <com/sun/star/embed/Aspects.hpp>
57
58#include <vector>
59
60#include <sortedobjs.hxx>
61
62using namespace com::sun::star;
63
64namespace {
65
66class SwSdrHdl : public SdrHdl
67{
68public:
69 SwSdrHdl(const Point& rPnt, bool bTopRight ) :
70 SdrHdl( rPnt, bTopRight ? SdrHdlKind::Anchor_TR : SdrHdlKind::Anchor ) {}
71 virtual bool IsFocusHdl() const override;
72};
73
74}
75
76bool SwSdrHdl::IsFocusHdl() const
77{
78 if( SdrHdlKind::Anchor == eKind || SdrHdlKind::Anchor_TR == eKind )
79 return true;
80 return SdrHdl::IsFocusHdl();
81}
82
83static const SwFrame *lcl_FindAnchor( const SdrObject *pObj, bool bAll )
84{
85 const SwVirtFlyDrawObj *pVirt = dynamic_cast< const SwVirtFlyDrawObj *>( pObj );
86 if ( pVirt )
87 {
88 if ( bAll || !pVirt->GetFlyFrame()->IsFlyInContentFrame() )
89 return pVirt->GetFlyFrame()->GetAnchorFrame();
90 }
91 else
92 {
93 const SwDrawContact *pCont = static_cast<const SwDrawContact*>(GetUserCall(pObj));
94 if ( pCont )
95 return pCont->GetAnchorFrame( pObj );
96 }
97 return nullptr;
98}
99
101 SwViewShellImp& rI,
102 FmFormModel& rFmFormModel,
103 OutputDevice* pOutDev)
104: FmFormView(rFmFormModel, pOutDev),
105 m_rImp( rI )
106{
107 SetPageVisible( false );
108 SetBordVisible( false );
109 SetGridVisible( false );
110 SetHlplVisible( false );
111 SetGlueVisible( false );
114
117
119
121
122 // #i73602# Use default from the configuration
124
125 // #i74769#, #i75172# Use default from the configuration
127}
128
129// #i99665#
131{
133}
134
135static SdrObject* impLocalHitCorrection(SdrObject* pRetval, const Point& rPnt, sal_uInt16 nTol, const SdrMarkList &rMrkList)
136{
137 if(!nTol)
138 {
139 // the old method forced back to outer bounds test when nTol == 0, so
140 // do not try to correct when nTol is not set (used from HelpContent)
141 }
142 else
143 {
144 // rebuild logic from former SwVirtFlyDrawObj::CheckSdrObjectHit. This is needed since
145 // the SdrObject-specific CheckHit implementations are now replaced with primitives and
146 // 'tricks' like in the old implementation (e.g. using a view from a model-data class to
147 // detect if object is selected) are no longer valid.
148 // The standard primitive hit-test for SwVirtFlyDrawObj now is the outer bound. The old
149 // implementation reduced this excluding the inner bound when the object was not selected.
150 SwVirtFlyDrawObj* pSwVirtFlyDrawObj = dynamic_cast< SwVirtFlyDrawObj* >(pRetval);
151
152 if(pSwVirtFlyDrawObj)
153 {
154 if(pSwVirtFlyDrawObj->GetFlyFrame()->Lower() && pSwVirtFlyDrawObj->GetFlyFrame()->Lower()->IsNoTextFrame())
155 {
156 // the old method used IsNoTextFrame (should be for SW's own OLE and
157 // graphic's) to accept hit only based on outer bounds; nothing to do
158 }
159 else
160 {
161 // check if the object is selected in this view
162 const size_t nMarkCount(rMrkList.GetMarkCount());
163 bool bSelected(false);
164
165 for(size_t a = 0; !bSelected && a < nMarkCount; ++a)
166 {
167 if(pSwVirtFlyDrawObj == rMrkList.GetMark(a)->GetMarkedSdrObj())
168 {
169 bSelected = true;
170 }
171 }
172
173 if(!bSelected)
174 {
175 // when not selected, the object is not hit when hit position is inside
176 // inner range. Get and shrink inner range
177 basegfx::B2DRange aInnerBound(pSwVirtFlyDrawObj->getInnerBound());
178
179 aInnerBound.grow(-1.0 * nTol);
180
181 if(aInnerBound.isInside(basegfx::B2DPoint(rPnt.X(), rPnt.Y())))
182 {
183 // exclude this hit
184 pRetval = nullptr;
185 }
186 }
187 }
188 }
189 }
190
191 return pRetval;
192}
193
194SdrObject* SwDrawView::CheckSingleSdrObjectHit(const Point& rPnt, sal_uInt16 nTol, SdrObject* pObj, SdrPageView* pPV, SdrSearchOptions nOptions, const SdrLayerIDSet* pMVisLay) const
195{
196 // call parent
197 SdrObject* pRetval = FmFormView::CheckSingleSdrObjectHit(rPnt, nTol, pObj, pPV, nOptions, pMVisLay);
198
199 if(pRetval)
200 {
201 // override to allow extra handling when picking SwVirtFlyDrawObj's
202 pRetval = impLocalHitCorrection(pRetval, rPnt, nTol, GetMarkedObjectList());
203 }
204
205 return pRetval;
206}
207
210{
211 const SdrMarkList &rMrkList = GetMarkedObjectList();
212
213 if(rMrkList.GetMarkCount() != 1 || !GetUserCall(rMrkList.GetMark( 0 )->GetMarkedSdrObj()))
214 return;
215
216 SdrObject *pObj = rMrkList.GetMark(0)->GetMarkedSdrObj();
217 // make code robust
218 SwFrameFormat* pFrameFormat( ::FindFrameFormat( pObj ) );
219 if ( !pFrameFormat )
220 {
221 OSL_FAIL( "<SwDrawView::AddCustomHdl()> - missing frame format!" );
222 return;
223 }
224 const SwFormatAnchor &rAnchor = pFrameFormat->GetAnchor();
225
226 if (RndStdIds::FLY_AS_CHAR == rAnchor.GetAnchorId())
227 return;
228
229 const SwFrame* pAnch = CalcAnchor();
230 if(nullptr == pAnch)
231 return;
232
233 Point aPos(m_aAnchorPoint);
234
235 if ( RndStdIds::FLY_AT_CHAR == rAnchor.GetAnchorId() )
236 {
237 // #i28701# - use last character rectangle saved at object
238 // in order to avoid a format of the anchor frame
239 SwAnchoredObject* pAnchoredObj = ::GetUserCall( pObj )->GetAnchoredObj( pObj );
240
241 // Invalidate/recalc LastCharRect which can contain invalid frame offset because
242 // of later frame changes
243 pAnchoredObj->CheckCharRectAndTopOfLine(false);
244
245 SwRect aAutoPos = pAnchoredObj->GetLastCharRect();
246 if ( aAutoPos.Height() )
247 {
248 aPos = aAutoPos.Pos();
249 }
250 }
251
252 // add anchor handle:
253 std::unique_ptr<SdrHdl> hdl = std::make_unique<SwSdrHdl>( aPos, ( pAnch->IsVertical() && !pAnch->IsVertLR() ) ||
254 pAnch->IsRightToLeft() );
255 hdl->SetObjHdlNum(maHdlList.GetHdlCount());
256 maHdlList.AddHdl(std::move(hdl));
257}
258
260{
261 if ( GetUserCall(pObj) )
262 {
263 const SwFrame *pAnch = ::lcl_FindAnchor( pObj, false );
264 if ( pAnch )
265 {
266 //The topmost Obj within the anchor must not be overtaken.
267 const SwFlyFrame *pFly = pAnch->FindFlyFrame();
268 if ( pFly )
269 {
270 const SwPageFrame *pPage = pFly->FindPageFrame();
271 if ( pPage->GetSortedObjs() )
272 {
273 size_t nOrdNum = 0;
274 for (SwAnchoredObject* i : *pPage->GetSortedObjs())
275 {
276 const SdrObject *pO = i->GetDrawObj();
277
278 if ( pO->GetOrdNumDirect() > nOrdNum )
279 {
280 const SwFrame *pTmpAnch = ::lcl_FindAnchor( pO, false );
281 if ( pFly->IsAnLower( pTmpAnch ) )
282 {
283 nOrdNum = pO->GetOrdNumDirect();
284 }
285 }
286 }
287 if ( nOrdNum )
288 {
289 SdrPage *pTmpPage = GetModel()->GetPage( 0 );
290 ++nOrdNum;
291 if ( nOrdNum < pTmpPage->GetObjCount() )
292 {
293 return pTmpPage->GetObj( nOrdNum );
294 }
295 }
296 }
297 }
298 }
299 }
300 return nullptr;
301}
302
304{
305 if ( GetUserCall(pObj) )
306 {
307 const SwFrame *pAnch = ::lcl_FindAnchor( pObj, false );
308 if ( pAnch )
309 {
310 //The Fly of the anchor must not be "flying under".
311 const SwFlyFrame *pFly = pAnch->FindFlyFrame();
312 if ( pFly )
313 {
314 SdrObject *pRet = const_cast<SdrObject*>(static_cast<SdrObject const *>(pFly->GetVirtDrawObj()));
315 return pRet != pObj ? pRet : nullptr;
316 }
317 }
318 }
319 return nullptr;
320}
321
323sal_uInt32 SwDrawView::GetMaxChildOrdNum( const SwFlyFrame& _rParentObj,
324 const SdrObject* _pExclChildObj )
325{
326 sal_uInt32 nMaxChildOrdNum = _rParentObj.GetDrawObj()->GetOrdNum();
327
328 const SdrPage* pDrawPage = _rParentObj.GetDrawObj()->getSdrPageFromSdrObject();
329 OSL_ENSURE( pDrawPage,
330 "<SwDrawView::GetMaxChildOrdNum(..) - missing drawing page at parent object - crash!" );
331
332 const size_t nObjCount = pDrawPage->GetObjCount();
333 for ( size_t i = nObjCount-1; i > _rParentObj.GetDrawObj()->GetOrdNum() ; --i )
334 {
335 const SdrObject* pObj = pDrawPage->GetObj( i );
336
337 // Don't consider 'child' object <_pExclChildObj>
338 if ( pObj == _pExclChildObj )
339 {
340 continue;
341 }
342
343 if ( pObj->GetOrdNum() > nMaxChildOrdNum &&
344 _rParentObj.IsAnLower( lcl_FindAnchor( pObj, true ) ) )
345 {
346 nMaxChildOrdNum = pObj->GetOrdNum();
347 break;
348 }
349 }
350
351 return nMaxChildOrdNum;
352}
353
355void SwDrawView::MoveRepeatedObjs( const SwAnchoredObject& _rMovedAnchoredObj,
356 const std::vector<SdrObject*>& _rMovedChildObjs ) const
357{
358 // determine 'repeated' objects of already moved object <_rMovedAnchoredObj>
359 std::vector<SwAnchoredObject*> aAnchoredObjs;
360 {
361 const SwContact* pContact = ::GetUserCall( _rMovedAnchoredObj.GetDrawObj() );
362 assert(pContact && "SwDrawView::MoveRepeatedObjs(..) - missing contact object -> crash.");
363 pContact->GetAnchoredObjs( aAnchoredObjs );
364 }
365
366 // check, if 'repeated' objects exists.
367 if ( aAnchoredObjs.size() <= 1 )
368 return;
369
370 SdrPage* pDrawPage = GetModel()->GetPage( 0 );
371
372 // move 'repeated' ones to the same order number as the already moved one.
373 const size_t nNewPos = _rMovedAnchoredObj.GetDrawObj()->GetOrdNum();
374 while ( !aAnchoredObjs.empty() )
375 {
376 SwAnchoredObject* pAnchoredObj = aAnchoredObjs.back();
377 if ( pAnchoredObj != &_rMovedAnchoredObj )
378 {
379 pDrawPage->SetObjectOrdNum( pAnchoredObj->GetDrawObj()->GetOrdNum(),
380 nNewPos );
381 pDrawPage->RecalcObjOrdNums();
382 // adjustments for accessibility API
383#if !ENABLE_WASM_STRIP_ACCESSIBILITY
384 if ( auto pTmpFlyFrame = pAnchoredObj->DynCastFlyFrame() )
385 {
386 m_rImp.DisposeAccessibleFrame( pTmpFlyFrame );
387 m_rImp.AddAccessibleFrame( pTmpFlyFrame );
388 }
389 else
390 {
391 m_rImp.DisposeAccessibleObj(pAnchoredObj->GetDrawObj(), true);
392 m_rImp.AddAccessibleObj( pAnchoredObj->GetDrawObj() );
393 }
394#endif
395 }
396 aAnchoredObjs.pop_back();
397 }
398
399 // move 'repeated' ones of 'child' objects
400 for ( SdrObject* pChildObj : _rMovedChildObjs )
401 {
402 {
403 const SwContact* pContact = ::GetUserCall( pChildObj );
404 assert(pContact && "SwDrawView::MoveRepeatedObjs(..) - missing contact object -> crash.");
405 pContact->GetAnchoredObjs( aAnchoredObjs );
406 }
407 // move 'repeated' ones to the same order number as the already moved one.
408 const size_t nTmpNewPos = pChildObj->GetOrdNum();
409 while ( !aAnchoredObjs.empty() )
410 {
411 SwAnchoredObject* pAnchoredObj = aAnchoredObjs.back();
412 if ( pAnchoredObj->GetDrawObj() != pChildObj )
413 {
414 pDrawPage->SetObjectOrdNum( pAnchoredObj->GetDrawObj()->GetOrdNum(),
415 nTmpNewPos );
416 pDrawPage->RecalcObjOrdNums();
417 // adjustments for accessibility API
418#if !ENABLE_WASM_STRIP_ACCESSIBILITY
419 if ( auto pTmpFlyFrame = pAnchoredObj->DynCastFlyFrame() )
420 {
421 m_rImp.DisposeAccessibleFrame( pTmpFlyFrame );
422 m_rImp.AddAccessibleFrame( pTmpFlyFrame );
423 }
424 else
425 {
426 m_rImp.DisposeAccessibleObj(pAnchoredObj->GetDrawObj(), true);
427 m_rImp.AddAccessibleObj( pAnchoredObj->GetDrawObj() );
428 }
429#endif
430 }
431 aAnchoredObjs.pop_back();
432 }
433 }
434}
435
436// --> adjustment and re-factoring of method
437void SwDrawView::ObjOrderChanged( SdrObject* pObj, size_t nOldPos,
438 size_t nNewPos )
439{
440 // nothing to do for group members
442 {
443 return;
444 }
445
446 // determine drawing page and assure that the order numbers are correct.
447 SdrPage* pDrawPage = GetModel()->GetPage( 0 );
448 if ( pDrawPage->IsObjOrdNumsDirty() )
449 pDrawPage->RecalcObjOrdNums();
450 const size_t nObjCount = pDrawPage->GetObjCount();
451
452 SwAnchoredObject* pMovedAnchoredObj =
453 ::GetUserCall( pObj )->GetAnchoredObj( pObj );
454 const SwFlyFrame* pParentAnchoredObj =
455 pMovedAnchoredObj->GetAnchorFrame()->FindFlyFrame();
456
457 const bool bMovedForward = nOldPos < nNewPos;
458
459 // assure for a 'child' object, that it doesn't exceed the limits of its 'parent'
460 if ( pParentAnchoredObj )
461 {
462 if ( bMovedForward )
463 {
464 const size_t nMaxChildOrdNumWithoutMoved =
465 GetMaxChildOrdNum( *pParentAnchoredObj, pMovedAnchoredObj->GetDrawObj() );
466 if ( nNewPos > nMaxChildOrdNumWithoutMoved+1 )
467 {
468 // set position to the top of the 'child' object group
469 pDrawPage->SetObjectOrdNum( nNewPos, nMaxChildOrdNumWithoutMoved+1 );
470 nNewPos = nMaxChildOrdNumWithoutMoved+1;
471 }
472 }
473 else
474 {
475 const size_t nParentOrdNum = pParentAnchoredObj->GetDrawObj()->GetOrdNum();
476 if ( nNewPos < nParentOrdNum )
477 {
478 // set position to the bottom of the 'child' object group
479 pDrawPage->SetObjectOrdNum( nNewPos, nParentOrdNum );
480 nNewPos = nParentOrdNum;
481 }
482 }
483 if ( pDrawPage->IsObjOrdNumsDirty() )
484 pDrawPage->RecalcObjOrdNums();
485 }
486
487 // Assure, that object isn't positioned between 'repeated' ones
488 if ( ( bMovedForward && nNewPos < nObjCount - 1 ) ||
489 ( !bMovedForward && nNewPos > 0 ) )
490 {
491 const SdrObject* pTmpObj =
492 pDrawPage->GetObj( bMovedForward ? nNewPos - 1 : nNewPos + 1 );
493 if ( pTmpObj )
494 {
495 size_t nTmpNewPos( nNewPos );
496 if ( bMovedForward )
497 {
498 // move before the top 'repeated' object
499 const sal_uInt32 nTmpMaxOrdNum =
500 ::GetUserCall( pTmpObj )->GetMaxOrdNum();
501 if ( nTmpMaxOrdNum > nNewPos )
502 nTmpNewPos = nTmpMaxOrdNum;
503 }
504 else
505 {
506 // move behind the bottom 'repeated' object
507 const sal_uInt32 nTmpMinOrdNum =
508 ::GetUserCall( pTmpObj )->GetMinOrdNum();
509 if ( nTmpMinOrdNum < nNewPos )
510 nTmpNewPos = nTmpMinOrdNum;
511 }
512 if ( nTmpNewPos != nNewPos )
513 {
514 pDrawPage->SetObjectOrdNum( nNewPos, nTmpNewPos );
515 nNewPos = nTmpNewPos;
516 pDrawPage->RecalcObjOrdNums();
517 }
518 }
519 }
520
521 // On move forward, assure that object is moved before its own children.
522 // Only Writer fly frames can have children.
523 if ( pMovedAnchoredObj->DynCastFlyFrame() &&
524 bMovedForward && nNewPos < nObjCount - 1 )
525 {
526 sal_uInt32 nMaxChildOrdNum =
527 GetMaxChildOrdNum( *static_cast<const SwFlyFrame*>(pMovedAnchoredObj) );
528 if ( nNewPos < nMaxChildOrdNum )
529 {
530 // determine position before the object before its top 'child' object
531 const SdrObject* pTmpObj = pDrawPage->GetObj( nMaxChildOrdNum );
532 size_t nTmpNewPos = ::GetUserCall( pTmpObj )->GetMaxOrdNum() + 1;
533 if ( nTmpNewPos >= nObjCount )
534 {
535 --nTmpNewPos;
536 }
537 // assure, that determined position isn't between 'repeated' objects
538 pTmpObj = pDrawPage->GetObj( nTmpNewPos );
539 nTmpNewPos = ::GetUserCall( pTmpObj )->GetMaxOrdNum();
540 // apply new position
541 pDrawPage->SetObjectOrdNum( nNewPos, nTmpNewPos );
542 nNewPos = nTmpNewPos;
543 pDrawPage->RecalcObjOrdNums();
544 }
545 }
546
547 // Assure, that object isn't positioned between nested objects
548 if ( ( bMovedForward && nNewPos < nObjCount - 1 ) ||
549 ( !bMovedForward && nNewPos > 0 ) )
550 {
551 size_t nTmpNewPos( nNewPos );
552 const SwFrameFormat* pParentFrameFormat =
553 pParentAnchoredObj ? &(pParentAnchoredObj->GetFrameFormat()) : nullptr;
554 const SdrObject* pTmpObj = pDrawPage->GetObj( nNewPos + 1 );
555 while ( pTmpObj )
556 {
557 // #i38563# - assure, that anchor frame exists.
558 // If object is anchored inside an invisible part of the document
559 // (e.g. page header, whose page style isn't applied, or hidden
560 // section), no anchor frame exists.
561 const SwFrame* pTmpAnchorFrame = lcl_FindAnchor( pTmpObj, true );
562 const SwFlyFrame* pTmpParentObj = pTmpAnchorFrame
563 ? pTmpAnchorFrame->FindFlyFrame() : nullptr;
564 if ( pTmpParentObj &&
565 &(pTmpParentObj->GetFrameFormat()) != pParentFrameFormat )
566 {
567 if ( bMovedForward )
568 {
569 nTmpNewPos = ::GetUserCall( pTmpObj )->GetMaxOrdNum();
570 pTmpObj = pDrawPage->GetObj( nTmpNewPos + 1 );
571 }
572 else
573 {
574 nTmpNewPos = ::GetUserCall( pTmpParentObj->GetDrawObj() )
575 ->GetMinOrdNum();
576 pTmpObj = pTmpParentObj->GetDrawObj();
577 }
578 }
579 else
580 break;
581 }
582 if ( nTmpNewPos != nNewPos )
583 {
584 pDrawPage->SetObjectOrdNum( nNewPos, nTmpNewPos );
585 nNewPos = nTmpNewPos;
586 pDrawPage->RecalcObjOrdNums();
587 }
588 }
589
590 // setup collection of moved 'child' objects to move its 'repeated' objects.
591 std::vector< SdrObject* > aMovedChildObjs;
592
593 // move 'children' accordingly
594 if ( auto pFlyFrame = pMovedAnchoredObj->DynCastFlyFrame() )
595 {
596 // adjustments for accessibility API
597#if !ENABLE_WASM_STRIP_ACCESSIBILITY
598 m_rImp.DisposeAccessibleFrame( pFlyFrame );
599 m_rImp.AddAccessibleFrame( pFlyFrame );
600#endif
601
602 const sal_uInt32 nChildNewPos = bMovedForward ? nNewPos : nNewPos+1;
603 size_t i = bMovedForward ? nOldPos : nObjCount-1;
604 do
605 {
606 SdrObject* pTmpObj = pDrawPage->GetObj( i );
607 if ( pTmpObj == pObj )
608 break;
609
610 // #i38563# - assure, that anchor frame exists.
611 // If object is anchored inside an invisible part of the document
612 // (e.g. page header, whose page style isn't applied, or hidden
613 // section), no anchor frame exists.
614 const SwFrame* pTmpAnchorFrame = lcl_FindAnchor( pTmpObj, true );
615 const SwFlyFrame* pTmpParentObj = pTmpAnchorFrame
616 ? pTmpAnchorFrame->FindFlyFrame() : nullptr;
617 if ( pTmpParentObj &&
618 ( ( pTmpParentObj == pFlyFrame ) ||
619 ( pFlyFrame->IsUpperOf( *pTmpParentObj ) ) ) )
620 {
621 // move child object.,
622 pDrawPage->SetObjectOrdNum( i, nChildNewPos );
623 pDrawPage->RecalcObjOrdNums();
624 // collect 'child' object
625 aMovedChildObjs.push_back( pTmpObj );
626 // adjustments for accessibility API
627#if !ENABLE_WASM_STRIP_ACCESSIBILITY
628 if ( auto pFlyDrawObj = dynamic_cast<SwVirtFlyDrawObj *>( pTmpObj ) )
629 {
630 const SwFlyFrame *pTmpFlyFrame = pFlyDrawObj->GetFlyFrame();
631 m_rImp.DisposeAccessibleFrame( pTmpFlyFrame );
632 m_rImp.AddAccessibleFrame( pTmpFlyFrame );
633 }
634 else
635 {
636 m_rImp.DisposeAccessibleObj(pTmpObj, true);
637 m_rImp.AddAccessibleObj( pTmpObj );
638 }
639#endif
640 }
641 else
642 {
643 // adjust loop counter
644 if ( bMovedForward )
645 ++i;
646 else if (i > 0)
647 --i;
648 }
649
650 } while ( ( bMovedForward && i < ( nObjCount - aMovedChildObjs.size() ) ) ||
651 ( !bMovedForward && i > ( nNewPos + aMovedChildObjs.size() ) ) );
652 }
653#if !ENABLE_WASM_STRIP_ACCESSIBILITY
654 else
655 {
656 // adjustments for accessibility API
657 m_rImp.DisposeAccessibleObj(pObj, true);
658 m_rImp.AddAccessibleObj( pObj );
659 }
660#endif
661
662 MoveRepeatedObjs( *pMovedAnchoredObj, aMovedChildObjs );
663}
664
666 tools::Rectangle& rRect ) const
667{
668 const SdrMarkList &rMrkList = GetMarkedObjectList();
669 bool bRet = false;
670 if( 1 == rMrkList.GetMarkCount() )
671 {
672 const SdrObject *pObj = rMrkList.GetMark( 0 )->GetMarkedSdrObj();
673 SwRect aRect;
674 if( ::CalcClipRect( pObj, aRect, eMode == SdrDragMode::Move ) )
675 {
676 rRect = aRect.SVRect();
677 bRet = true;
678 }
679 }
680 return bRet;
681}
682
684{
685 const SdrMarkList &rMrkList = GetMarkedObjectList();
686 if ( rMrkList.GetMarkCount() != 1 )
687 return nullptr;
688
689 SdrObject* pObj = rMrkList.GetMark( 0 )->GetMarkedSdrObj();
690
691 //Search for paragraph bound objects, otherwise only the
692 //current anchor. Search only if we currently drag.
693 const SwFrame* pAnch;
694 tools::Rectangle aMyRect;
695 auto pFlyDrawObj = dynamic_cast<SwVirtFlyDrawObj *>( pObj );
696 if ( pFlyDrawObj )
697 {
698 pAnch = pFlyDrawObj->GetFlyFrame()->GetAnchorFrame();
699 aMyRect = pFlyDrawObj->GetFlyFrame()->getFrameArea().SVRect();
700 }
701 else
702 {
703 SwDrawContact *pC = static_cast<SwDrawContact*>(GetUserCall(pObj));
704 // determine correct anchor position for 'virtual' drawing objects.
705 // #i26791#
706 pAnch = pC->GetAnchorFrame( pObj );
707 if( !pAnch )
708 {
709 pC->ConnectToLayout();
710 // determine correct anchor position for 'virtual' drawing objects.
711 // #i26791#
712 pAnch = pC->GetAnchorFrame( pObj );
713 }
714 aMyRect = pObj->GetSnapRect();
715 }
716
717 const bool bTopRight = pAnch && ( ( pAnch->IsVertical() &&
718 !pAnch->IsVertLR() ) ||
719 pAnch->IsRightToLeft() );
720 const Point aMyPt = bTopRight ? aMyRect.TopRight() : aMyRect.TopLeft();
721
722 Point aPt;
723 if ( IsAction() )
724 {
725 if ( !TakeDragObjAnchorPos( aPt, bTopRight ) )
726 return nullptr;
727 }
728 else
729 {
730 tools::Rectangle aRect = pObj->GetSnapRect();
731 aPt = bTopRight ? aRect.TopRight() : aRect.TopLeft();
732 }
733
734 if ( aPt != aMyPt )
735 {
736 if ( pAnch && pAnch->IsContentFrame() )
737 {
738 // allow drawing objects in header/footer,
739 // but exclude control objects.
740 bool bBodyOnly = CheckControlLayer( pObj );
741 pAnch = ::FindAnchor( static_cast<const SwContentFrame*>(pAnch), aPt, bBodyOnly );
742 }
743 else if ( !pFlyDrawObj )
744 {
745 const SwRect aRect( aPt.getX(), aPt.getY(), 1, 1 );
746
747 SwDrawContact* pContact = static_cast<SwDrawContact*>(GetUserCall(pObj));
748 if ( pContact->GetAnchorFrame( pObj ) &&
749 pContact->GetAnchorFrame( pObj )->IsPageFrame() )
750 pAnch = pContact->GetPageFrame();
751 else
752 pAnch = pContact->FindPage( aRect );
753 }
754 }
755 if( pAnch && !pAnch->IsProtected() )
756 m_aAnchorPoint = pAnch->GetFrameAnchorPos( ::HasWrap( pObj ) );
757 else
758 pAnch = nullptr;
759 return pAnch;
760}
761
763{
764 SdrHdl* pHdl = maHdlList.GetHdl(SdrHdlKind::Anchor);
765 if ( ! pHdl )
766 pHdl = maHdlList.GetHdl(SdrHdlKind::Anchor_TR);
767
768 if(pHdl)
769 {
770 CalcAnchor();
771 pHdl->SetPos(m_aAnchorPoint);
772 }
773}
774
776{
779}
780
781// #i7672#
783{
784 // The ModelHasChanged() call in DrawingLayer also updates
785 // an eventually active text edit view (OutlinerView). This also leads
786 // to newly setting the background color for that edit view. Thus,
787 // this method rescues the current background color if an OutlinerView
788 // exists and re-establishes it then. To be more safe, the OutlinerView
789 // will be fetched again (maybe textedit has ended).
791 Color aBackColor;
792 bool bColorWasSaved(false);
793
794 if(pView)
795 {
796 aBackColor = pView->GetBackgroundColor();
797 bColorWasSaved = true;
798 }
799
800 // call parent
802
803 if(bColorWasSaved)
804 {
805 pView = GetTextEditOutlinerView();
806
807 if(pView)
808 {
809 pView->SetBackgroundColor(aBackColor);
810 }
811 }
812}
813
815{
816 OSL_ENSURE( m_rImp.GetShell()->GetWin(), "MakeVisible, unknown Window");
817 m_rImp.GetShell()->MakeVisible( SwRect( rRect ) );
818}
819
821{
823
824 //In addition to the existing flags of the objects themselves,
825 //which are evaluated by the DrawingEngine, other circumstances
826 //lead to a protection.
827 //Objects that are anchored in frames need to be protected
828 //if the content of the frame is protected.
829 //OLE-Objects may themselves wish a resize protection (StarMath)
830
831 const SdrMarkList &rMrkList = GetMarkedObjectList();
832 bool bProtect = false;
833 bool bSzProtect = false;
834 bool bRotate(false);
835
836 for ( size_t i = 0; !bProtect && i < rMrkList.GetMarkCount(); ++i )
837 {
838 const SdrObject *pObj = rMrkList.GetMark( i )->GetMarkedSdrObj();
839 const SwFrame *pFrame = nullptr;
840 if ( auto pVirtFlyDrawObj = dynamic_cast< const SwVirtFlyDrawObj *>( pObj ) )
841 {
842 const SwFlyFrame *pFly = pVirtFlyDrawObj->GetFlyFrame();
843 if ( pFly )
844 {
845 pFrame = pFly->GetAnchorFrame();
846 if ( pFly->Lower() && pFly->Lower()->IsNoTextFrame() )
847 {
848 const SwNoTextFrame *const pNTF(static_cast<const SwNoTextFrame*>(pFly->Lower()));
849 const SwOLENode *const pOLENd = pNTF->GetNode()->GetOLENode();
850 const SwGrfNode *const pGrfNd = pNTF->GetNode()->GetGrfNode();
851
852 if ( pOLENd )
853 {
854 const uno::Reference < embed::XEmbeddedObject > xObj = const_cast< SwOLEObj& >(pOLENd->GetOLEObj()).GetOleRef();
855
856 if ( xObj.is() )
857 {
858 // --> improvement for the future, when more
859 // than one Writer fly frame can be selected.
860
861 // TODO/LATER: retrieve Aspect - from where?!
862 bSzProtect |= ( embed::EmbedMisc::EMBED_NEVERRESIZE & xObj->getStatus( embed::Aspects::MSOLE_CONTENT ) ) != 0;
863
864 // #i972: protect position if it is a Math object anchored 'as char' and baseline alignment is activated
865 SwDoc* pDoc = Imp().GetShell()->GetDoc();
866 const bool bProtectMathPos = SotExchange::IsMath( xObj->getClassID() )
867 && RndStdIds::FLY_AS_CHAR == pFly->GetFormat()->GetAnchor().GetAnchorId()
869 if (bProtectMathPos)
870 m_bMoveProtect = true;
871 }
872 }
873 else if(pGrfNd)
874 {
875 // RotGrfFlyFrame: GraphicNode allows rotation(s). The loop ew are in stops
876 // as soon as bMoveProtect is set, but since rotation is valid only with
877 // a single object selected this makes no difference
878 bRotate = true;
879 }
880 }
881 }
882 }
883 else
884 {
885 SwDrawContact *pC = static_cast<SwDrawContact*>(GetUserCall(pObj));
886 if ( pC )
887 pFrame = pC->GetAnchorFrame( pObj );
888 }
889 if ( pFrame )
890 bProtect = pFrame->IsProtected(); //Frames, areas etc.
891 {
892 SwFrameFormat* pFrameFormat( ::FindFrameFormat( const_cast<SdrObject*>(pObj) ) );
893 if ( !pFrameFormat )
894 {
895 OSL_FAIL( "<SwDrawView::CheckPossibilities()> - missing frame format" );
896 bProtect = true;
897 }
898 else if ((RndStdIds::FLY_AS_CHAR == pFrameFormat->GetAnchor().GetAnchorId()) &&
899 rMrkList.GetMarkCount() > 1 )
900 {
901 bProtect = true;
902 }
903 }
904 }
905 m_bMoveProtect |= bProtect;
906 m_bResizeProtect |= bProtect || bSzProtect;
907
908 // RotGrfFlyFrame: allow rotation when SwGrfNode is selected and not size protected
909 m_bRotateFreeAllowed |= bRotate && !bProtect;
911}
912
915{
916 SdrPageView* pDrawPageView = _rMarkView.GetSdrPageView();
917 const SdrMarkList& rMarkList = _rMarkView.GetMarkedObjectList();
918
919 if( !rMarkList.GetMarkCount() )
920 return;
921
922 // collect marked objects in a local data structure
923 std::vector<SdrObject*> aMarkedObjs;
924 for( size_t i = 0; i < rMarkList.GetMarkCount(); ++i )
925 {
926 SdrObject* pMarkedObj = rMarkList.GetMark( i )->GetMarkedSdrObj();
927 aMarkedObjs.push_back( pMarkedObj );
928 }
929 // unmark all objects
930 _rMarkView.UnmarkAllObj();
931 // re-mark objects, but for marked <SwDrawVirtObj>-objects marked its
932 // reference object.
933 while ( !aMarkedObjs.empty() )
934 {
935 SdrObject* pMarkObj = aMarkedObjs.back();
936 if ( auto pVirtObj = dynamic_cast<SwDrawVirtObj *>( pMarkObj ) )
937 {
938 SdrObject* pRefObj = &(pVirtObj->ReferencedObj());
939 if ( !_rMarkView.IsObjMarked( pRefObj ) )
940 {
941 _rMarkView.MarkObj( pRefObj, pDrawPageView );
942 }
943 }
944 else
945 {
946 _rMarkView.MarkObj( pMarkObj, pDrawPageView );
947 }
948
949 aMarkedObjs.pop_back();
950 }
951 // sort marked list in order to assure consistent state in drawing layer
952 _rMarkView.SortMarkedObjects();
953}
954
956{
957 return m_rImp.GetShell()->GetSfxViewShell();
958}
959
961{
962 SwDoc* pDoc = Imp().GetShell()->GetDoc();
964 if ( pTmpRoot )
965 pTmpRoot->StartAllAction();
967 // replace marked <SwDrawVirtObj>-objects by its reference objects.
968 if (SdrPageView* pDrawPageView = m_rImp.GetPageView())
969 {
970 ReplaceMarkedDrawVirtObjs(pDrawPageView->GetView());
971 }
972
973 // Check what textboxes have to be deleted afterwards.
974 const SdrMarkList& rMarkList = GetMarkedObjectList();
975 std::vector<SwFrameFormat*> aTextBoxesToDelete;
976 for (size_t i = 0; i < rMarkList.GetMarkCount(); ++i)
977 {
978 SdrObject *pObject = rMarkList.GetMark(i)->GetMarkedSdrObj();
979 SwContact* pContact = GetUserCall(pObject);
980 SwFrameFormat* pFormat = pContact->GetFormat();
981 if (pObject->getChildrenOfSdrObject())
982 {
983 auto pChildTextBoxes = SwTextBoxHelper::CollectTextBoxes(pObject, pFormat);
984 for (auto& rChildTextBox : pChildTextBoxes)
985 aTextBoxesToDelete.push_back(rChildTextBox);
986 }
987 else
989 aTextBoxesToDelete.push_back(pTextBox);
990 }
991
992 if ( pDoc->DeleteSelection( *this ) )
993 {
996 }
997
998 // Only delete these now: earlier deletion would clear the mark list as well.
999 // Delete in reverse order, assuming that the container is sorted by anchor positions.
1000 for (int i = aTextBoxesToDelete.size() - 1; i >= 0; --i)
1001 {
1002 SwFrameFormat*& rpTextBox = aTextBoxesToDelete[i];
1003 pDoc->getIDocumentLayoutAccess().DelLayoutFormat(rpTextBox);
1004 }
1005
1007 if( pTmpRoot )
1008 pTmpRoot->EndAllAction();
1009}
1010
1011// Create a new view-local UndoManager manager for Writer
1012std::unique_ptr<SdrUndoManager> SwDrawView::createLocalTextUndoManager()
1013{
1014 std::unique_ptr<SdrUndoManager> pUndoManager(new SdrUndoManager);
1015 pUndoManager->SetDocShell(SfxObjectShell::Current());
1016 return pUndoManager;
1017}
1018
1019/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void CheckPossibilities() override
virtual void MarkListHasChanged() override
virtual const SwRootFrame * GetCurrentLayout() const =0
virtual void DelLayoutFormat(SwFrameFormat *pFormat)=0
virtual SwUndoId EndUndo(SwUndoId const eUndoId, SwRewriter const *const pRewriter)=0
Closes undo block.
virtual SwUndoId StartUndo(SwUndoId const eUndoId, SwRewriter const *const pRewriter)=0
Opens undo block.
void SetBackgroundColor(const Color &rColor)
Color const & GetBackgroundColor() const
virtual bool IsAction() const override
bool TakeDragObjAnchorPos(Point &rPos, bool bTopRight) const
bool m_bResizeProtect
bool m_bRotate90Allowed
bool m_bRotateFreeAllowed
bool m_bMoveProtect
size_t GetHdlCount() const
void AddHdl(std::unique_ptr< SdrHdl > pHdl)
SdrHdl * GetHdl(size_t nNum) const
void SetPos(const Point &rPnt)
virtual bool IsFocusHdl() const
size_t GetMarkCount() const
SdrMark * GetMark(size_t nNum) const
void SetFrameDragSingles(bool bOn=true)
bool IsObjMarked(SdrObject const *pObj) const
const SdrMarkList & GetMarkedObjectList() const
void SortMarkedObjects() const
virtual SdrObject * CheckSingleSdrObjectHit(const Point &rPnt, sal_uInt16 nTol, SdrObject *pObj, SdrPageView *pPV, SdrSearchOptions nOptions, const SdrLayerIDSet *pMVisLay) const
SdrHdlList maHdlList
sal_uInt16 GetMarkHdlSizePixel() const
void UnmarkAllObj(SdrPageView const *pPV=nullptr)
bool MarkObj(const Point &rPnt, short nTol=-2, bool bToggle=false, bool bDeep=false)
SdrObject * GetMarkedSdrObj() const
const SdrPage * GetPage(sal_uInt16 nPgNum) const
const OutlinerView * GetTextEditOutlinerView() const
virtual void ModelHasChanged() override
virtual SdrObject * SetObjectOrdNum(size_t nOldObjNum, size_t nNewObjNum)
SdrObject * GetObj(size_t nNum) const
size_t GetObjCount() const
void RecalcObjOrdNums()
bool IsObjOrdNumsDirty() const
sal_uInt32 GetOrdNumDirect() const
sal_uInt32 GetOrdNum() const
virtual const tools::Rectangle & GetSnapRect() const
SdrPage * getSdrPageFromSdrObject() const
SdrObject * getParentSdrObjectFromSdrObject() const
void SetPageVisible(bool bOn=true)
void SetHlplVisible(bool bOn=true)
void SetBufferedOverlayAllowed(bool bNew)
SdrModel * GetModel() const
void SetHitTolerancePixel(sal_uInt16 nVal)
void SetBordVisible(bool bOn=true)
void SetSwapAsynchron(bool bJa=true)
void SetPrintPreview(bool bOn=true)
void SetGlueVisible(bool bOn=true)
SdrPageView * GetSdrPageView() const
void SetBufferedOutputAllowed(bool bNew)
void SetGridVisible(bool bOn)
void EnableExtendedMouseEventDispatcher(bool bOn)
virtual void DeleteMarked()
void EnableExtendedKeyInputDispatcher(bool bOn)
static SfxObjectShell * Current()
static sal_uInt16 IsMath(const SvGlobalName &rName)
wrapper class for the positioning of Writer fly frames and drawing objects
const SwFrame * GetAnchorFrame() const
void CheckCharRectAndTopOfLine(const bool _bCheckForParaPorInf)
check anchor character rectangle and top of line
const SwRect & GetLastCharRect() const
virtual const SwFlyFrame * DynCastFlyFrame() const
const SdrObject * GetDrawObj() const
Base class for the following contact objects (frame + draw objects).
Definition: dcontact.hxx:67
virtual const SwAnchoredObject * GetAnchoredObj(const SdrObject *_pSdrObj) const =0
sal_uInt32 GetMaxOrdNum() const
get maximum order number of anchored objects handled by with contact
Definition: dcontact.cxx:374
sal_uInt32 GetMinOrdNum() const
get minimum order number of anchored objects handled by with contact
Definition: dcontact.cxx:349
virtual void GetAnchoredObjs(std::vector< SwAnchoredObject * > &_roAnchoredObjs) const =0
get data collection of anchored objects, handled by with contact
SwFrameFormat * GetFormat()
Definition: dcontact.hxx:112
SwContentFrame is the layout for content nodes: a common base class for text (paragraph) and non-text...
Definition: cntfrm.hxx:58
Definition: doc.hxx:192
bool DeleteSelection(SwDrawView &)
Definition: docdraw.cxx:438
IDocumentUndoRedo & GetIDocumentUndoRedo()
Definition: doc.cxx:145
IDocumentLayoutAccess const & getIDocumentLayoutAccess() const
Definition: doc.cxx:406
::sw::DocumentSettingManager & GetDocumentSettingManager()
Definition: doc.cxx:187
ContactObject for connection of formats as representatives of draw objects in SwClient and the object...
Definition: dcontact.hxx:304
const SwFrame * GetAnchorFrame(const SdrObject *_pDrawObj=nullptr) const
Definition: dcontact.cxx:804
const SwPageFrame * GetPageFrame() const
Definition: dcontact.hxx:353
void ConnectToLayout(const SwFormatAnchor *pAnch=nullptr)
Inserts SdrObject in the arrays of the layout ((SwPageFrame and SwFrame).
Definition: dcontact.cxx:1797
SwPageFrame * FindPage(const SwRect &rRect)
Definition: dcontact.cxx:2003
virtual SdrObject * GetMaxToBtmObj(SdrObject *pObj) const override
Definition: dview.cxx:303
const SwViewShellImp & Imp() const
Definition: dview.hxx:102
Point m_aAnchorPoint
Definition: dview.hxx:34
virtual void MarkListHasChanged() override
Definition: dview.cxx:775
virtual void CheckPossibilities() override
Definition: dview.cxx:820
static void ReplaceMarkedDrawVirtObjs(SdrMarkView &_rMarkView)
replace marked <SwDrawVirtObj>-objects by its reference object for delete marked objects.
Definition: dview.cxx:914
SwViewShellImp & m_rImp
Definition: dview.hxx:35
void MoveRepeatedObjs(const SwAnchoredObject &_rMovedAnchoredObj, const std::vector< SdrObject * > &_rMovedChildObjs) const
method to move 'repeated' objects of the given moved object to the according level
Definition: dview.cxx:355
std::unique_ptr< SdrUndoManager > createLocalTextUndoManager() override
Definition: dview.cxx:1012
virtual void ObjOrderChanged(SdrObject *pObj, size_t nOldPos, size_t nNewPos) override
Definition: dview.cxx:437
SwDrawView(SwViewShellImp &rI, FmFormModel &rFmFormModel, OutputDevice *pOutDev)
Definition: dview.cxx:100
static bool IsAntiAliasing()
Definition: dview.cxx:130
virtual void DeleteMarked() override
Definition: dview.cxx:960
const SwFrame * CalcAnchor()
Definition: dview.cxx:683
virtual SdrObject * GetMaxToTopObj(SdrObject *pObj) const override
Definition: dview.cxx:259
SfxViewShell * GetSfxViewShell() const override
See SdrMarkView::GetSfxViewShell().
Definition: dview.cxx:955
virtual SdrObject * CheckSingleSdrObjectHit(const Point &rPnt, sal_uInt16 nTol, SdrObject *pObj, SdrPageView *pPV, SdrSearchOptions nOptions, const SdrLayerIDSet *pMVisLay) const override
Definition: dview.cxx:194
virtual void MakeVisible(const tools::Rectangle &, vcl::Window &rWin) override
Definition: dview.cxx:814
static sal_uInt32 GetMaxChildOrdNum(const SwFlyFrame &_rParentObj, const SdrObject *_pExclChildObj=nullptr)
determine maximal order number for a 'child' object of given 'parent' object
Definition: dview.cxx:323
virtual void AddCustomHdl() override
Gets called every time the handles need to be build.
Definition: dview.cxx:209
void ShowDragAnchor()
Definition: dview.cxx:762
virtual bool TakeDragLimit(SdrDragMode eMode, tools::Rectangle &rRect) const override
Definition: dview.cxx:665
virtual void ModelHasChanged() override
Definition: dview.cxx:782
new class for re-direct methods calls at a 'virtual' drawing object to its referenced object.
Definition: dcontact.hxx:211
general base class for all free-flowing frames
Definition: flyfrm.hxx:79
const SwVirtFlyDrawObj * GetVirtDrawObj() const
Definition: fly.cxx:2803
virtual const SwFlyFrameFormat * GetFormat() const override
Definition: fly.cxx:2897
virtual SwFrameFormat & GetFrameFormat() override
Definition: fly.cxx:2822
bool IsFlyInContentFrame() const
Definition: flyfrm.hxx:215
FlyAnchors.
Definition: fmtanchr.hxx:37
RndStdIds GetAnchorId() const
Definition: fmtanchr.hxx:67
const SwFormatAnchor & GetAnchor(bool=true) const
Definition: fmtanchr.hxx:83
Style of a layout element.
Definition: frmfmt.hxx:62
Base class of the Writer layout elements.
Definition: frame.hxx:315
SwFlyFrame * FindFlyFrame()
Definition: frame.hxx:1111
Point GetFrameAnchorPos(bool bIgnoreFlysAnchoredAtThisFrame) const
returns the position for anchors based on frame direction
Definition: ssfrm.cxx:293
bool IsPageFrame() const
Definition: frame.hxx:1178
bool IsProtected() const
Is the Frame or rather the Section in which it lies protected?
Definition: trvlfrm.cxx:1638
bool IsRightToLeft() const
Definition: frame.hxx:987
bool IsVertical() const
Definition: frame.hxx:973
bool IsNoTextFrame() const
Definition: frame.hxx:1238
bool IsContentFrame() const
Definition: frame.hxx:1230
bool IsVertLR() const
Definition: frame.hxx:979
SwPageFrame * FindPageFrame()
Definition: frame.hxx:680
bool IsAnLower(const SwFrame *) const
Definition: findfrm.cxx:231
const SwFrame * Lower() const
Definition: layfrm.hxx:101
const SwContentNode * GetNode() const
Definition: notxtfrm.hxx:66
SwGrfNode * GetGrfNode()
Definition: ndgrf.hxx:154
SwOLENode * GetOLENode()
Inline methods from Node.hxx.
Definition: ndole.hxx:164
const SwOLEObj & GetOLEObj() const
Definition: ndole.hxx:115
A page of the document layout.
Definition: pagefrm.hxx:58
const SwSortedObjs * GetSortedObjs() const
Definition: pagefrm.hxx:132
Of course Writer needs its own rectangles.
Definition: swrect.hxx:35
void Height(tools::Long nNew)
Definition: swrect.hxx:193
void Pos(const Point &rNew)
Definition: swrect.hxx:171
tools::Rectangle SVRect() const
Definition: swrect.hxx:292
The root element of a Writer document layout.
Definition: rootfrm.hxx:82
void StartAllAction()
Set up Start-/EndAction for all Shells on an as high as possible (Shell section) level.
Definition: pagechg.cxx:1911
void EndAllAction(bool bVirDev=false)
Definition: pagechg.cxx:1923
static std::vector< SwFrameFormat * > CollectTextBoxes(const SdrObject *pGroupObject, SwFrameFormat *pFormat)
Collect all textboxes of the group given by the pGroupObj Parameter.
static SwFrameFormat * getOtherTextBoxFormat(const SwFrameFormat *pFormat, sal_uInt16 nType, const SdrObject *pObject=nullptr)
If we have an associated TextFrame, then return that.
void DisposeAccessibleFrame(const SwFrame *pFrame, bool bRecursive=false)
Definition: viewimp.hxx:287
void AddAccessibleObj(const SdrObject *pObj)
Definition: viewimp.hxx:310
void AddAccessibleFrame(const SwFrame *pFrame)
Add a frame in the accessible view.
Definition: viewimp.hxx:304
void DisposeAccessibleObj(const SdrObject *pObj, bool bCanSkipInvisible)
Definition: viewimp.hxx:293
SdrPageView * GetPageView()
Definition: viewimp.hxx:166
const SwViewShell * GetShell() const
Only for SwViewShell::Init()
Definition: viewimp.hxx:141
bool IsPreview() const
Definition: viewsh.hxx:501
virtual void DrawSelChanged()
Definition: viewsh.cxx:2195
vcl::Window * GetWin() const
Definition: viewsh.hxx:346
SwDoc * GetDoc() const
Definition: viewsh.hxx:290
SfxViewShell * GetSfxViewShell() const
Definition: viewsh.hxx:454
void MakeVisible(const SwRect &)
Definition: viewsh.cxx:637
SwFlyFrame * GetFlyFrame()
Definition: dflyobj.hxx:128
basegfx::B2DRange getInnerBound() const
Definition: dflyobj.cxx:335
void grow(TYPE fValue)
bool isInside(const Tuple2D< TYPE > &rTuple) const
virtual bool get(DocumentSettingId id) const override
Return the specified document setting.
constexpr Point TopLeft() const
constexpr Point TopRight() const
SwFrameFormat * FindFrameFormat(SdrObject *pObj)
The Get reverse way: seeks the format to the specified object.
Definition: dcontact.cxx:121
SwContact * GetUserCall(const SdrObject *pObj)
Returns the UserCall if applicable from the group object.
Definition: dcontact.cxx:172
bool HasWrap(const SdrObject *pObj)
Definition: dcontact.cxx:140
bool CheckControlLayer(const SdrObject *pObj)
Definition: dcontact.cxx:683
static SdrObject * impLocalHitCorrection(SdrObject *pRetval, const Point &rPnt, sal_uInt16 nTol, const SdrMarkList &rMrkList)
Definition: dview.cxx:135
static const SwFrame * lcl_FindAnchor(const SdrObject *pObj, bool bAll)
Definition: dview.cxx:83
void FrameNotify(SwViewShell *pVwSh, FlyMode eMode)
Definition: edtwin3.cxx:78
EmbeddedObjectRef * pObject
bool CalcClipRect(const SdrObject *pSdrObj, SwRect &rRect, bool bMove=true)
calculate rectangle in that the object can be moved or rather be resized
Definition: flylay.cxx:1164
const SwContentFrame * FindAnchor(const SwFrame *pOldAnch, const Point &rNew, const bool bBody=false)
search an anchor for paragraph bound frames starting from pOldAnch
Definition: flycnt.cxx:1069
constexpr TypedWhichId< SwDrawFrameFormat > RES_DRAWFRMFMT(159)
Mode eMode
uno_Any a
@ FLY_DRAG_END
Definition: mdiexp.hxx:41
Shell * GetShell()
int i
SdrHdlKind
SdrSearchOptions
SdrDragMode