LibreOffice Module sw (master) 1
feshview.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 <hintids.hxx>
21#include <svx/strings.hrc>
23#include <svx/svddrgmt.hxx>
24#include <svx/svditer.hxx>
25#include <svx/svdobj.hxx>
26#include <svx/svdouno.hxx>
27#include <svx/svdogrp.hxx>
28#include <svx/svdocirc.hxx>
29#include <svx/svdopath.hxx>
30#include <svx/sxciaitm.hxx>
31#include <svx/svdocapt.hxx>
32#include <svx/xlnwtit.hxx>
33#include <svx/xlnstwit.hxx>
34#include <svx/xlnedwit.hxx>
35#include <svx/xlnedit.hxx>
36#include <svx/xlnstit.hxx>
37#include <svx/svdomeas.hxx>
38#include <svx/sdtagitm.hxx>
39#include <svx/sdtacitm.hxx>
40#include <svx/sdtaaitm.hxx>
41#include <editeng/opaqitem.hxx>
42#include <editeng/protitem.hxx>
43#include <svx/svdpage.hxx>
44#include <svx/svdpagv.hxx>
45#include <svx/dialmgr.hxx>
46#include <tools/globname.hxx>
47#include <sot/exchange.hxx>
51#include <IDocumentState.hxx>
53#include <drawdoc.hxx>
54#include <textboxhelper.hxx>
55#include <frmfmt.hxx>
56#include <frmatr.hxx>
57#include <frmtool.hxx>
58#include <fmtfsize.hxx>
59#include <fmtanchr.hxx>
60#include <fmtornt.hxx>
61#include <fmtsrnd.hxx>
62#include <fmtcntnt.hxx>
63#include <fmtflcnt.hxx>
64#include <fmtcnct.hxx>
65#include <swmodule.hxx>
66#include <fesh.hxx>
67#include <rootfrm.hxx>
68#include <pagefrm.hxx>
69#include <sectfrm.hxx>
70#include <doc.hxx>
71#include <IDocumentUndoRedo.hxx>
72#include <dview.hxx>
73#include <dflyobj.hxx>
74#include <dcontact.hxx>
75#include <viewimp.hxx>
76#include <flyfrm.hxx>
77#include <pam.hxx>
78#include <ndole.hxx>
79#include <ndgrf.hxx>
80#include <ndtxt.hxx>
81#include <viewopt.hxx>
82#include <swundo.hxx>
83#include <notxtfrm.hxx>
84#include <txtfrm.hxx>
85#include <mdiexp.hxx>
86#include <sortedobjs.hxx>
89#include <comphelper/lok.hxx>
90#include <sfx2/lokhelper.hxx>
91#include <LibreOfficeKit/LibreOfficeKitEnums.h>
92#include <calbck.hxx>
94#include <svx/svxids.hrc>
95#include <osl/diagnose.h>
96
97#include <com/sun/star/embed/EmbedMisc.hpp>
98#include <com/sun/star/embed/Aspects.hpp>
99#include <com/sun/star/embed/XEmbeddedObject.hpp>
100
101#include <svx/srchdlg.hxx>
102
103#define SCROLLVAL 75
104
105using namespace com::sun::star;
106
111namespace {
112
113::basegfx::B2DPolyPolygon getPolygon(TranslateId pResId, const SdrModel& rModel)
114{
116 XLineEndListRef pLineEndList(rModel.GetLineEndList());
117
118 if( pLineEndList.is() )
119 {
120 OUString aArrowName( SvxResId(pResId) );
121 tools::Long nCount = pLineEndList->Count();
123 for( nIndex = 0; nIndex < nCount; nIndex++ )
124 {
125 const XLineEndEntry* pEntry = pLineEndList->GetLineEnd(nIndex);
126 if( pEntry->GetName() == aArrowName )
127 {
128 aRetval = pEntry->GetLineEnd();
129 break;
130 }
131 }
132 }
133
134 return aRetval;
135}
136
137}
138
140{
141 if ( !pLst )
142 pLst = pSh->HasDrawView() ? &pSh->Imp()->GetDrawView()->GetMarkedObjectList():nullptr;
143
144 if ( pLst && pLst->GetMarkCount() == 1 )
145 {
146 SdrObject *pO = pLst->GetMark( 0 )->GetMarkedSdrObj();
147 if (SwVirtFlyDrawObj* pVirtO = dynamic_cast<SwVirtFlyDrawObj*>(pO))
148 return pVirtO->GetFlyFrame();
149 }
150 return nullptr;
151}
152
153static void lcl_GrabCursor( SwFEShell* pSh, SwFlyFrame* pOldSelFly)
154{
155 const SwFrameFormat *pFlyFormat = pSh->SelFlyGrabCursor();
156 if( pFlyFormat && !pSh->ActionPend() &&
157 (!pOldSelFly || pOldSelFly->GetFormat() != pFlyFormat) )
158 {
159 // now call set macro if applicable
160 pSh->GetFlyMacroLnk().Call( static_cast<const SwFlyFrameFormat*>(pFlyFormat) );
161 // if a dialog was started inside a macro, then
162 // MouseButtonUp arrives at macro and not to us. Therefore
163 // flag is always set here and will never be switched to
164 // respective Shell !!!!!!!
165
166 g_bNoInterrupt = false;
167 }
168 else if( !pFlyFormat || RES_DRAWFRMFMT == pFlyFormat->Which() )
169 {
170 // --> assure consistent cursor
171 pSh->KillPams();
172 pSh->ClearMark();
173 pSh->SetCursor( pSh->Imp()->GetDrawView()->GetAllMarkedRect().TopLeft(), true);
174 }
175}
176
177bool SwFEShell::SelectObj( const Point& rPt, sal_uInt8 nFlag, SdrObject *pObj )
178{
179 SwDrawView *pDView = Imp()->GetDrawView();
180 if(!pDView)
181 return false;
182 CurrShell aCurr( this );
183 StartAction(); // action is necessary to assure only one AttrChgdNotify
184 // (e.g. due to Unmark->MarkListHasChgd) arrives
185
186 const SdrMarkList &rMrkList = pDView->GetMarkedObjectList();
187 const bool bHadSelection = rMrkList.GetMarkCount();
188 const bool bAddSelect = 0 != (SW_ADD_SELECT & nFlag);
189 const bool bEnterGroup = 0 != (SW_ENTER_GROUP & nFlag);
190 SwFlyFrame* pOldSelFly = nullptr;
191 const Point aOldPos( pDView->GetAllMarkedRect().TopLeft() );
192
193 if( bHadSelection )
194 {
195 // call Unmark when !bAddSelect or if fly was selected
196 bool bUnmark = !bAddSelect;
197
198 if ( rMrkList.GetMarkCount() == 1 )
199 {
200 // if fly was selected, deselect it first
201 pOldSelFly = ::GetFlyFromMarked( &rMrkList, this );
202 if ( pOldSelFly )
203 {
204 const sal_uInt16 nType = GetCntType();
205 if( nType != CNT_TXT || (SW_LEAVE_FRAME & nFlag) ||
206 ( pOldSelFly->GetFormat()->GetProtect().IsContentProtected()
207 && !IsReadOnlyAvailable() ))
208 {
209 // If a fly is deselected, which contains graphic, OLE or
210 // otherwise, the cursor should be removed from it.
211 // Similar if a fly with protected content is deselected.
212 // For simplicity we put the cursor next to the upper-left
213 // corner.
214 Point aPt( pOldSelFly->getFrameArea().Pos() );
215 aPt.setX(aPt.getX() - 1);
216 bool bUnLockView = !IsViewLocked();
217 LockView( true );
218 SetCursor( aPt, true );
219 if( bUnLockView )
220 LockView( false );
221 }
222 if ( nType & CNT_GRF &&
223 static_cast<SwNoTextFrame*>(pOldSelFly->Lower())->HasAnimation() )
224 {
225 GetWin()->Invalidate( pOldSelFly->getFrameArea().SVRect() );
226 }
227
228 // Cancel crop mode
229 if ( SdrDragMode::Crop == GetDragMode() )
230 SetDragMode( SdrDragMode::Move );
231
232 bUnmark = true;
233 }
234 }
235 if ( bUnmark )
236 {
237 pDView->UnmarkAll();
238 if (pOldSelFly)
239 pOldSelFly->SelectionHasChanged(this);
240 }
241 }
242 else
243 {
244 KillPams();
245 ClearMark();
246 }
247
248 if ( pObj )
249 {
250 OSL_ENSURE( !bEnterGroup, "SW_ENTER_GROUP is not supported" );
251 pDView->MarkObj( pObj, Imp()->GetPageView() );
252 }
253 else
254 {
255 // tolerance limit of Drawing-SS
256 const auto nHdlSizePixel = Imp()->GetDrawView()->GetMarkHdlSizePixel();
257 const short nMinMove = static_cast<short>(GetOut()->PixelToLogic(Size(nHdlSizePixel/2, 0)).Width());
258 pDView->MarkObj( rPt, nMinMove, bAddSelect, bEnterGroup );
259 }
260
261 const bool bRet = 0 != rMrkList.GetMarkCount();
262
263 if ( rMrkList.GetMarkCount() > 1 )
264 {
265 // It sucks if Drawing objects were selected and now
266 // additionally a fly is selected.
267 for ( size_t i = 0; i < rMrkList.GetMarkCount(); ++i )
268 {
269 SdrObject *pTmpObj = rMrkList.GetMark( i )->GetMarkedSdrObj();
270 bool bForget = dynamic_cast<const SwVirtFlyDrawObj*>( pTmpObj) != nullptr;
271 if( bForget )
272 {
273 pDView->UnmarkAll();
274 pDView->MarkObj( pTmpObj, Imp()->GetPageView(), bAddSelect, bEnterGroup );
275 break;
276 }
277 }
278 }
279
280 if ( rMrkList.GetMarkCount() == 1 )
281 {
282 SwFlyFrame *pSelFly = ::GetFlyFromMarked( &rMrkList, this );
283 if (pSelFly)
284 pSelFly->SelectionHasChanged(this);
285 }
286
287 if (!(nFlag & SW_ALLOW_TEXTBOX))
288 {
289 // If the fly frame is a textbox of a shape, then select the shape instead.
290 for (size_t i = 0; i < rMrkList.GetMarkCount(); ++i)
291 {
292 SdrObject* pObject = rMrkList.GetMark(i)->GetMarkedSdrObj();
293 SwContact* pContact = GetUserCall(pObject);
294 if (!pContact)
295 {
296 continue;
297 }
298
299 SwFrameFormat* pFormat = pContact->GetFormat();
301 {
302 SdrObject* pShape = pShapeFormat->FindSdrObject();
303 pDView->UnmarkAll();
304 pDView->MarkObj(pShape, Imp()->GetPageView(), bAddSelect, bEnterGroup);
305 break;
306 }
307 }
308 }
309
310 if ( bRet )
311 {
312 ::lcl_GrabCursor(this, pOldSelFly);
313 if ( GetCntType() & CNT_GRF )
314 {
315 const SwFlyFrame *pTmp = GetFlyFromMarked( &rMrkList, this );
316 OSL_ENSURE( pTmp, "Graphic without Fly" );
317 if ( pTmp && static_cast<const SwNoTextFrame*>(pTmp->Lower())->HasAnimation() )
318 static_cast<const SwNoTextFrame*>(pTmp->Lower())->StopAnimation( GetOut() );
319 }
320 }
321 else if ( !pOldSelFly && bHadSelection )
322 SetCursor( aOldPos, true);
323
324 if( bRet || !bHadSelection )
325 CallChgLnk();
326
327 // update status line
328 ::FrameNotify( this, bRet ? FLY_DRAG_START : FLY_DRAG_END );
329
330 EndAction();
331 return bRet;
332}
333
334/*
335 * Description: MoveAnchor( nDir ) looked for an another Anchor for
336 * the selected drawing object (or fly frame) in the given direction.
337 * An object "as character" doesn't moves anyway.
338 * A page bounded object could move to the previous/next page with up/down,
339 * an object bounded "at paragraph" moves to the previous/next paragraph, too.
340 * An object bounded "at character" moves to the previous/next paragraph
341 * with up/down and to the previous/next character with left/right.
342 * If the anchor for at paragraph/character bounded objects has vertical or
343 * right_to_left text direction, the directions for up/down/left/right will
344 * interpreted accordingly.
345 * An object bounded "at fly" takes the center of the actual anchor and looks
346 * for the nearest fly frame in the given direction.
347 */
348
349static bool LessX( Point const & aPt1, Point const & aPt2, bool bOld )
350{
351 return aPt1.getX() < aPt2.getX()
352 || ( aPt1.getX() == aPt2.getX()
353 && ( aPt1.getY() < aPt2.getY()
354 || ( aPt1.getY() == aPt2.getY() && bOld ) ) );
355}
356static bool LessY( Point const & aPt1, Point const & aPt2, bool bOld )
357{
358 return aPt1.getY() < aPt2.getY()
359 || ( aPt1.getY() == aPt2.getY()
360 && ( aPt1.getX() < aPt2.getX()
361 || ( aPt1.getX() == aPt2.getX() && bOld ) ) );
362}
363
365{
366 if (!Imp()->GetDrawView())
367 return false;
368 const SdrMarkList& pMrkList = Imp()->GetDrawView()->GetMarkedObjectList();
369 if (1 != pMrkList.GetMarkCount())
370 return false;
371 SwFrame* pOld;
372 SwFlyFrame* pFly = nullptr;
373 SdrObject *pObj = pMrkList.GetMark( 0 )->GetMarkedSdrObj();
374 if (SwVirtFlyDrawObj* pVirtO = dynamic_cast<SwVirtFlyDrawObj*>(pObj))
375 {
376 pFly = pVirtO->GetFlyFrame();
377 pOld = pFly->AnchorFrame();
378 }
379 else
380 pOld = static_cast<SwDrawContact*>(GetUserCall(pObj))->GetAnchorFrame( pObj );
381 bool bRet = false;
382 if( pOld )
383 {
384 SwFrame* pNew = pOld;
385 // #i28701#
386 SwAnchoredObject* pAnchoredObj = ::GetUserCall( pObj )->GetAnchoredObj( pObj );
387 SwFrameFormat& rFormat = pAnchoredObj->GetFrameFormat();
388 SwFormatAnchor aAnch( rFormat.GetAnchor() );
389 RndStdIds nAnchorId = aAnch.GetAnchorId();
390 if ( RndStdIds::FLY_AS_CHAR == nAnchorId )
391 return false;
392 if( pOld->IsVertical() )
393 {
394 if( pOld->IsTextFrame() )
395 {
396 switch( nDir ) {
397 case SwMove::UP: nDir = SwMove::LEFT; break;
398 case SwMove::DOWN: nDir = SwMove::RIGHT; break;
399 case SwMove::LEFT: nDir = SwMove::DOWN; break;
400 case SwMove::RIGHT: nDir = SwMove::UP; break;
401 }
402 if( pOld->IsRightToLeft() )
403 {
404 if( nDir == SwMove::LEFT )
405 nDir = SwMove::RIGHT;
406 else if( nDir == SwMove::RIGHT )
407 nDir = SwMove::LEFT;
408 }
409 }
410 }
411 switch ( nAnchorId ) {
412 case RndStdIds::FLY_AT_PAGE:
413 {
414 OSL_ENSURE( pOld->IsPageFrame(), "Wrong anchor, page expected." );
415 if( SwMove::UP == nDir )
416 pNew = pOld->GetPrev();
417 else if( SwMove::DOWN == nDir )
418 pNew = pOld->GetNext();
419 if( pNew && pNew != pOld )
420 {
421 aAnch.SetPageNum( static_cast<SwPageFrame*>(pNew)->GetPhyPageNum() );
422 bRet = true;
423 }
424 break;
425 }
426 case RndStdIds::FLY_AT_CHAR:
427 {
428 OSL_ENSURE(pOld->IsTextFrame(), "Wrong anchor, text frame expected.");
429 if( SwMove::LEFT == nDir || SwMove::RIGHT == nDir )
430 {
432 SwTextFrame *const pOldFrame(static_cast<SwTextFrame*>(pOld));
433 TextFrameIndex const nAct(pOldFrame->MapModelToViewPos(pos));
434 if( SwMove::LEFT == nDir )
435 {
436 bRet = true;
437 if( nAct )
438 {
439 pos = pOldFrame->MapViewToModelPos(nAct - TextFrameIndex(1));
440 }
441 else
442 nDir = SwMove::UP;
443 }
444 else
445 {
446 TextFrameIndex const nMax(pOldFrame->GetText().getLength());
447 if( nAct < nMax )
448 {
449 bRet = true;
450 pos = pOldFrame->MapViewToModelPos(nAct + TextFrameIndex(1));
451 }
452 else
453 nDir = SwMove::DOWN;
454 }
455 if( pos != *aAnch.GetContentAnchor())
456 aAnch.SetAnchor( &pos );
457 }
458 [[fallthrough]];
459 }
460 case RndStdIds::FLY_AT_PARA:
461 {
462 OSL_ENSURE(pOld->IsTextFrame(), "Wrong anchor, text frame expected.");
463 if( SwMove::UP == nDir )
464 pNew = pOld->FindPrev();
465 else if( SwMove::DOWN == nDir )
466 pNew = pOld->FindNext();
467 if( pNew && pNew != pOld && pNew->IsContentFrame() )
468 {
469 SwTextFrame *const pNewFrame(static_cast<SwTextFrame*>(pNew));
470 SwPosition const pos = pNewFrame->MapViewToModelPos(
472 (bRet && pNewFrame->GetText().getLength() != 0)
473 ? pNewFrame->GetText().getLength() - 1
474 : 0));
475 aAnch.SetAnchor( &pos );
476 bRet = true;
477 }
478 else if( SwMove::UP == nDir || SwMove::DOWN == nDir )
479 bRet = false;
480 break;
481 }
482 case RndStdIds::FLY_AT_FLY:
483 {
484 OSL_ENSURE( pOld->IsFlyFrame(), "Wrong anchor, fly frame expected.");
485 SwPageFrame* pPage = pOld->FindPageFrame();
486 OSL_ENSURE( pPage, "Where's my page?" );
487 SwFlyFrame* pNewFly = nullptr;
488 if( pPage->GetSortedObjs() )
489 {
490 bool bOld = false;
491 Point aCenter( pOld->getFrameArea().Left() + pOld->getFrameArea().Width()/2,
492 pOld->getFrameArea().Top() + pOld->getFrameArea().Height()/2 );
493 Point aBest;
494 for(SwAnchoredObject* pAnchObj : *pPage->GetSortedObjs())
495 {
496 if( auto pTmp = pAnchObj->DynCastFlyFrame() )
497 {
498 if( pTmp == pOld )
499 bOld = true;
500 else
501 {
502 const SwFlyFrame* pCheck = pFly ? pTmp : nullptr;
503 while( pCheck )
504 {
505 if( pCheck == pFly )
506 break;
507 const SwFrame *pNxt = pCheck->GetAnchorFrame();
508 pCheck = pNxt ? pNxt->FindFlyFrame() : nullptr;
509 }
510 if( pCheck || pTmp->IsProtected() )
511 continue;
512 Point aNew( pTmp->getFrameArea().Left() +
513 pTmp->getFrameArea().Width()/2,
514 pTmp->getFrameArea().Top() +
515 pTmp->getFrameArea().Height()/2 );
516 bool bAccept = false;
517 switch( nDir ) {
518 case SwMove::RIGHT:
519 {
520 bAccept = LessX( aCenter, aNew, bOld )
521 && ( !pNewFly ||
522 LessX( aNew, aBest, false ) );
523 break;
524 }
525 case SwMove::LEFT:
526 {
527 bAccept = LessX( aNew, aCenter, !bOld )
528 && ( !pNewFly ||
529 LessX( aBest, aNew, true ) );
530 break;
531 }
532 case SwMove::UP:
533 {
534 bAccept = LessY( aNew, aCenter, !bOld )
535 && ( !pNewFly ||
536 LessY( aBest, aNew, true ) );
537 break;
538 }
539 case SwMove::DOWN:
540 {
541 bAccept = LessY( aCenter, aNew, bOld )
542 && ( !pNewFly ||
543 LessY( aNew, aBest, false ) );
544 break;
545 }
546 }
547 if( bAccept )
548 {
549 pNewFly = pTmp;
550 aBest = aNew;
551 }
552 }
553 }
554 }
555 }
556
557 if( pNewFly )
558 {
559 SwPosition aPos( *pNewFly->GetFormat()->
560 GetContent().GetContentIdx());
561 aAnch.SetAnchor( &aPos );
562 bRet = true;
563 }
564 break;
565 }
566 default: break;
567 }
568 if( bRet )
569 {
571 // --> handle change of anchor node:
572 // if count of the anchor frame also change, the fly frames have to be
573 // re-created. Thus, delete all fly frames except the <this> before the
574 // anchor attribute is change and re-create them afterwards.
575 {
576 std::unique_ptr<SwHandleAnchorNodeChg> pHandleAnchorNodeChg;
577 SwFlyFrameFormat* pFlyFrameFormat( dynamic_cast<SwFlyFrameFormat*>(&rFormat) );
578 if ( pFlyFrameFormat )
579 {
580 pHandleAnchorNodeChg.reset(
581 new SwHandleAnchorNodeChg( *pFlyFrameFormat, aAnch ));
582 }
583 rFormat.GetDoc()->SetAttr( aAnch, rFormat );
584 }
585 // #i28701# - no call of method
586 // <CheckCharRectAndTopOfLine()> for to-character anchored
587 // Writer fly frame needed. This method call can cause a
588 // format of the anchor frame, which is no longer intended.
589 // Instead clear the anchor character rectangle and
590 // the top of line values for all to-character anchored objects.
591 pAnchoredObj->ClearCharRectAndTopOfLine();
592 EndAllAction();
593 }
594 }
595 return bRet;
596}
597
599{
600 const SdrMarkList* pMarkList = nullptr;
601 if( Imp()->GetDrawView() != nullptr )
602 pMarkList = &Imp()->GetDrawView()->GetMarkedObjectList();
603 return pMarkList;
604}
605
607{
609
610 // get marked frame list, and check if anything is selected
611 const SdrMarkList* pMarkList = GetMarkList_();
612 if( pMarkList == nullptr || pMarkList->GetMarkCount() == 0 )
614 else
615 {
616 // obtain marked item as fly frame; if no fly frame, it must
617 // be a draw object
618 const SwFlyFrame* pFly = ::GetFlyFromMarked(pMarkList, const_cast<SwFEShell*>(this));
619 if ( pFly != nullptr )
620 {
621 if( pFly->IsFlyLayFrame() )
623 else if( pFly->IsFlyAtContentFrame() )
625 else
626 {
627 OSL_ENSURE( pFly->IsFlyInContentFrame(), "New frametype?" );
629 }
630 }
631 else
633 }
634
635 return eType;
636}
637
638// does the draw selection contain a control?
640{
641 bool bRet = false;
642
643 // basically, copy the mechanism from GetSelFrameType(), but call
644 // CheckControl... if you get a drawing object
645 const SdrMarkList* pMarkList = GetMarkList_();
646 if( pMarkList != nullptr && pMarkList->GetMarkCount() == 1 )
647 {
648 // if we have one marked object, get the SdrObject and check
649 // whether it contains a control
650 const SdrObject* pSdrObject = pMarkList->GetMark( 0 )->GetMarkedSdrObj();
651 bRet = pSdrObject && ::CheckControlLayer( pSdrObject );
652 }
653 return bRet;
654}
655
656void SwFEShell::ScrollTo( const Point &rPt )
657{
658 const SwRect aRect( rPt, rPt );
659 if ( IsScrollMDI( this, aRect ) &&
660 (!Imp()->GetDrawView()->GetMarkedObjectList().GetMarkCount() ||
661 Imp()->IsDragPossible( rPt )) )
662 {
663 ScrollMDI( this, aRect, SCROLLVAL, SCROLLVAL );
664 }
665}
666
668{
669 if ( Imp()->HasDrawView() )
670 Imp()->GetDrawView()->SetDragMode( eDragMode );
671}
672
674{
675 SdrDragMode nRet = SdrDragMode(0);
676 if ( Imp()->HasDrawView() )
677 {
678 nRet = Imp()->GetDrawView()->GetDragMode();
679 }
680 return nRet;
681}
682
684{
685 if ( !Imp()->HasDrawView() )
686 {
687 return;
688 }
689 SdrView *pView = Imp()->GetDrawView();
690 if (!pView) return;
691
692 const SdrMarkList &rMarkList = pView->GetMarkedObjectList();
693 if( 0 == rMarkList.GetMarkCount() ) {
694 // No object selected
695 return;
696 }
697
698 // If more than a single SwVirtFlyDrawObj is selected, select only the first SwVirtFlyDrawObj
699 if ( rMarkList.GetMarkCount() > 1 )
700 {
701 for ( size_t i = 0; i < rMarkList.GetMarkCount(); ++i )
702 {
703 SdrObject *pTmpObj = rMarkList.GetMark( i )->GetMarkedSdrObj();
704 bool bForget = dynamic_cast<const SwVirtFlyDrawObj*>( pTmpObj) != nullptr;
705 if( bForget )
706 {
707 pView->UnmarkAll();
708 pView->MarkObj( pTmpObj, Imp()->GetPageView() );
709 break;
710 }
711 }
712 }
713
714 // Activate CROP mode
715 pView->SetEditMode( SdrViewEditMode::Edit );
716 SetDragMode( SdrDragMode::Crop );
717}
718
719void SwFEShell::BeginDrag( const Point* pPt, bool bIsShift)
720{
721 SdrView *pView = Imp()->GetDrawView();
722 if ( pView && pView->AreObjectsMarked() )
723 {
724 m_pChainFrom.reset();
725 m_pChainTo.reset();
726 SdrHdl* pHdl = pView->PickHandle( *pPt );
727 if (pView->BegDragObj( *pPt, nullptr, pHdl ))
728 pView->GetDragMethod()->SetShiftPressed( bIsShift );
729 ::FrameNotify( this );
730 }
731}
732
733void SwFEShell::Drag( const Point *pPt, bool )
734{
735 OSL_ENSURE( Imp()->HasDrawView(), "Drag without DrawView?" );
736 if ( HasDrawViewDrag() )
737 {
738 ScrollTo( *pPt );
739 Imp()->GetDrawView()->MovDragObj( *pPt );
741 ::FrameNotify( this );
742 }
743}
744
746{
747 OSL_ENSURE( Imp()->HasDrawView(), "EndDrag without DrawView?" );
748 SdrView *pView = Imp()->GetDrawView();
749 if ( !pView->IsDragObj() )
750 return;
751
752 for(SwViewShell& rSh : GetRingContainer())
753 rSh.StartAction();
754
756
757 // #50778# Bug during dragging: In StartAction a HideShowXor is called.
758 // In EndDragObj() this is reversed, for no reason and even wrong.
759 // To restore consistency we should bring up the Xor again.
760
761 // Reanimation from the hack #50778 to fix bug #97057
762 // May be not the best solution, but the one with lowest risc at the moment.
763 // pView->ShowShownXor( GetOut() );
764
765 pView->EndDragObj();
766
767 // DrawUndo on to flyframes are not stored
768 // The flys change the flag.
769 GetDoc()->GetIDocumentUndoRedo().DoDrawUndo(true);
770 ChgAnchor( RndStdIds::FLY_AT_PARA, true );
771
773
774 for(SwViewShell& rSh : GetRingContainer())
775 {
776 rSh.EndAction();
777 if( auto pCursorShell = dynamic_cast<SwCursorShell *>(&rSh) )
778 pCursorShell->CallChgLnk();
779 }
780
782 ::FrameNotify( this );
783}
784
786{
787 OSL_ENSURE( Imp()->HasDrawView(), "BreakDrag without DrawView?" );
788 if( HasDrawViewDrag() )
789 Imp()->GetDrawView()->BrkDragObj();
791}
792
793// If a fly is selected, pulls the crsr in the first ContentFrame
795{
796 if ( Imp()->HasDrawView() )
797 {
798 const SdrMarkList &rMrkList = Imp()->GetDrawView()->GetMarkedObjectList();
799 SwFlyFrame *pFly = ::GetFlyFromMarked( &rMrkList, this );
800
801 if( pFly )
802 {
803 SwContentFrame *pCFrame = pFly->ContainsContent();
804 if ( pCFrame )
805 {
806 // --> assure, that the cursor is consistent.
807 KillPams();
808 ClearMark();
809 SwPaM *pCursor = GetCursor();
810
811 if (pCFrame->IsTextFrame())
812 {
813 *pCursor->GetPoint() = static_cast<SwTextFrame *>(pCFrame)
814 ->MapViewToModelPos(TextFrameIndex(0));
815 }
816 else
817 {
818 assert(pCFrame->IsNoTextFrame());
819 SwContentNode *const pCNode = static_cast<SwNoTextFrame *>(pCFrame)->GetNode();
820 pCursor->GetPoint()->Assign(*pCNode);
821 }
822
823 SwRect& rChrRect = const_cast<SwRect&>(GetCharRect());
824 rChrRect = pFly->getFramePrintArea();
825 rChrRect.Pos() += pFly->getFrameArea().Pos();
826 GetCursorDocPos() = rChrRect.Pos();
827 }
828 return pFly->GetFormat();
829 }
830 }
831 return nullptr;
832}
833
834// Selection to above/below (Z-Order)
835static void lcl_NotifyNeighbours( const SdrMarkList *pLst )
836{
837 // Rules for evasion have changed.
838 // 1. The environment of the fly and everything inside should be notified
839 // 2. The content of the frame itself has to be notified
840 // 3. Frames displaced by the frame have to be notified
841 // 4. Also Drawing objects can displace frames
842 for( size_t j = 0; j < pLst->GetMarkCount(); ++j )
843 {
844 SwPageFrame *pPage;
845 bool bCheckNeighbours = false;
846 sal_Int16 aHori = text::HoriOrientation::NONE;
847 SwRect aRect;
848 SdrObject *pO = pLst->GetMark( j )->GetMarkedSdrObj();
849 if (SwVirtFlyDrawObj* pVirtO = dynamic_cast<SwVirtFlyDrawObj*>(pO))
850 {
851 SwFlyFrame *pFly = pVirtO->GetFlyFrame();
852
853 const SwFormatHoriOrient &rHori = pFly->GetFormat()->GetHoriOrient();
854 aHori = rHori.GetHoriOrient();
855 if( text::HoriOrientation::NONE != aHori && text::HoriOrientation::CENTER != aHori &&
856 pFly->IsFlyAtContentFrame() )
857 {
858 bCheckNeighbours = true;
859 pFly->InvalidatePos();
861 aFrm.Pos().AdjustY(1 );
862 }
863
864 pPage = pFly->FindPageFrame();
865 aRect = pFly->getFrameArea();
866 }
867 else
868 {
869 SwFrame* pAnch = static_cast<SwDrawContact*>( GetUserCall(pO) )->GetAnchorFrame( pO );
870 if( !pAnch )
871 continue;
872 pPage = pAnch->FindPageFrame();
873 // #i68520# - naming changed
874 aRect = GetBoundRectOfAnchoredObj( pO );
875 }
876
877 const size_t nCount = pPage->GetSortedObjs() ? pPage->GetSortedObjs()->size() : 0;
878 for ( size_t i = 0; i < nCount; ++i )
879 {
880 SwAnchoredObject* pAnchoredObj = (*pPage->GetSortedObjs())[i];
881 SwFlyFrame* pAct = pAnchoredObj->DynCastFlyFrame();
882 if ( !pAct )
883 continue;
884
885 SwRect aTmpCalcPnt( pAct->getFramePrintArea() );
886 aTmpCalcPnt += pAct->getFrameArea().Pos();
887 if ( aRect.Overlaps( aTmpCalcPnt ) )
888 {
889 SwContentFrame *pCnt = pAct->ContainsContent();
890 while ( pCnt )
891 {
892 aTmpCalcPnt = pCnt->getFramePrintArea();
893 aTmpCalcPnt += pCnt->getFrameArea().Pos();
894 if ( aRect.Overlaps( aTmpCalcPnt ) )
896 pCnt = pCnt->GetNextContentFrame();
897 }
898 }
899 if ( bCheckNeighbours && pAct->IsFlyAtContentFrame() )
900 {
901 const SwFormatHoriOrient &rH = pAct->GetFormat()->GetHoriOrient();
902 if ( rH.GetHoriOrient() == aHori &&
903 pAct->getFrameArea().Top() <= aRect.Bottom() &&
904 pAct->getFrameArea().Bottom() >= aRect.Top() )
905 {
906 pAct->InvalidatePos();
908 aFrm.Pos().AdjustY(1 );
909 }
910 }
911 }
912 }
913}
914
915void SwFEShell::SetLineEnds(SfxItemSet& rAttr, SdrObject const & rObj, sal_uInt16 nSlotId)
916{
917 SdrModel& rModel(rObj.getSdrModelFromSdrObject());
918
919 if ( !(nSlotId == SID_LINE_ARROW_START ||
920 nSlotId == SID_LINE_ARROW_END ||
921 nSlotId == SID_LINE_ARROWS ||
922 nSlotId == SID_LINE_ARROW_CIRCLE ||
923 nSlotId == SID_LINE_CIRCLE_ARROW ||
924 nSlotId == SID_LINE_ARROW_SQUARE ||
925 nSlotId == SID_LINE_SQUARE_ARROW ||
926 nSlotId == SID_DRAW_MEASURELINE) )
927 return;
928
929 // set attributes of line start and ends
930
931 // arrowhead
932 ::basegfx::B2DPolyPolygon aArrow( getPolygon( RID_SVXSTR_ARROW, rModel ) );
933 if( !aArrow.count() )
934 {
935 ::basegfx::B2DPolygon aNewArrow;
936 aNewArrow.append(::basegfx::B2DPoint(10.0, 0.0));
937 aNewArrow.append(::basegfx::B2DPoint(0.0, 30.0));
938 aNewArrow.append(::basegfx::B2DPoint(20.0, 30.0));
939 aNewArrow.setClosed(true);
940 aArrow.append(aNewArrow);
941 }
942
943 // Circles
944 ::basegfx::B2DPolyPolygon aCircle( getPolygon( RID_SVXSTR_CIRCLE, rModel ) );
945 if( !aCircle.count() )
946 {
947 ::basegfx::B2DPolygon aNewCircle = ::basegfx::utils::createPolygonFromEllipse(::basegfx::B2DPoint(0.0, 0.0), 250.0, 250.0);
948 aNewCircle.setClosed(true);
949 aCircle.append(aNewCircle);
950 }
951
952 // Square
953 ::basegfx::B2DPolyPolygon aSquare( getPolygon( RID_SVXSTR_SQUARE, rModel ) );
954 if( !aSquare.count() )
955 {
956 ::basegfx::B2DPolygon aNewSquare;
957 aNewSquare.append(::basegfx::B2DPoint(0.0, 0.0));
958 aNewSquare.append(::basegfx::B2DPoint(10.0, 0.0));
959 aNewSquare.append(::basegfx::B2DPoint(10.0, 10.0));
960 aNewSquare.append(::basegfx::B2DPoint(0.0, 10.0));
961 aNewSquare.setClosed(true);
962 aSquare.append(aNewSquare);
963 }
964
965 SfxItemSet aSet( rModel.GetItemPool() );
966 tools::Long nWidth = 100; // (1/100th mm)
967
968 // determine line width and calculate with it the line end width
969 if( aSet.GetItemState( XATTR_LINEWIDTH ) != SfxItemState::DONTCARE )
970 {
971 tools::Long nValue = aSet.Get( XATTR_LINEWIDTH ).GetValue();
972 if( nValue > 0 )
973 nWidth = nValue * 3;
974 }
975
976 switch (nSlotId)
977 {
978 case SID_LINE_ARROWS:
979 case SID_DRAW_MEASURELINE:
980 {
981 // connector with arrow ends
982 rAttr.Put(XLineStartItem(SvxResId(RID_SVXSTR_ARROW), aArrow));
983 rAttr.Put(XLineStartWidthItem(nWidth));
984 rAttr.Put(XLineEndItem(SvxResId(RID_SVXSTR_ARROW), aArrow));
985 rAttr.Put(XLineEndWidthItem(nWidth));
986 }
987 break;
988
989 case SID_LINE_ARROW_START:
990 case SID_LINE_ARROW_CIRCLE:
991 case SID_LINE_ARROW_SQUARE:
992 {
993 // connector with arrow start
994 rAttr.Put(XLineStartItem(SvxResId(RID_SVXSTR_ARROW), aArrow));
995 rAttr.Put(XLineStartWidthItem(nWidth));
996 }
997 break;
998
999 case SID_LINE_ARROW_END:
1000 case SID_LINE_CIRCLE_ARROW:
1001 case SID_LINE_SQUARE_ARROW:
1002 {
1003 // connector with arrow end
1004 rAttr.Put(XLineEndItem(SvxResId(RID_SVXSTR_ARROW), aArrow));
1005 rAttr.Put(XLineEndWidthItem(nWidth));
1006 }
1007 break;
1008 }
1009
1010 // and again, for the still missing ends
1011 switch (nSlotId)
1012 {
1013 case SID_LINE_ARROW_CIRCLE:
1014 {
1015 // circle end
1016 rAttr.Put(XLineEndItem(SvxResId(RID_SVXSTR_CIRCLE), aCircle));
1017 rAttr.Put(XLineEndWidthItem(nWidth));
1018 }
1019 break;
1020
1021 case SID_LINE_CIRCLE_ARROW:
1022 {
1023 // circle start
1024 rAttr.Put(XLineStartItem(SvxResId(RID_SVXSTR_CIRCLE), aCircle));
1025 rAttr.Put(XLineStartWidthItem(nWidth));
1026 }
1027 break;
1028
1029 case SID_LINE_ARROW_SQUARE:
1030 {
1031 // square end
1032 rAttr.Put(XLineEndItem(SvxResId(RID_SVXSTR_SQUARE), aSquare));
1033 rAttr.Put(XLineEndWidthItem(nWidth));
1034 }
1035 break;
1036
1037 case SID_LINE_SQUARE_ARROW:
1038 {
1039 // square start
1040 rAttr.Put(XLineStartItem(SvxResId(RID_SVXSTR_SQUARE), aSquare));
1041 rAttr.Put(XLineStartWidthItem(nWidth));
1042 }
1043 break;
1044 }
1045
1046}
1047
1049{
1050 OSL_ENSURE( Imp()->HasDrawView(), "SelectionToTop without DrawView?" );
1051 const SdrMarkList &rMrkList = Imp()->GetDrawView()->GetMarkedObjectList();
1052 OSL_ENSURE( rMrkList.GetMarkCount(), "No object selected." );
1053
1054 SwFlyFrame *pFly = ::GetFlyFromMarked( &rMrkList, this );
1055 if ( pFly && pFly->IsFlyInContentFrame() )
1056 return;
1057
1059 if ( bTop )
1061 else
1063 ::lcl_NotifyNeighbours( &rMrkList );
1064
1065 // Does the selection contain a textbox?
1066 for (size_t i = 0; i < rMrkList.GetMarkCount(); i++)
1067 if (auto pObj = rMrkList.GetMark(i)->GetMarkedSdrObj())
1068 // Get the textbox-shape
1069 if (auto pFormat = FindFrameFormat(pObj))
1070 {
1071 // If it has not textframe skip...
1072 if (!SwTextBoxHelper::isTextBox(pFormat, RES_DRAWFRMFMT, pObj))
1073 continue;
1074 // If it has a textframe so it is a textbox, get its page
1075 if (auto pDrwModel
1076 = pFormat->GetDoc()->getIDocumentDrawModelAccess().GetDrawModel())
1077 // Not really understood why everything is on page 0...
1078 // but it is easier to handle sdrobjects, that's true
1079 if (auto pPage = pDrwModel->GetPage(0))
1080 {
1081 // nShift: it means how many layers the pObj have to be shifted up,
1082 // in order not to interfere with other shapes and textboxes.
1083 // Situations:
1084 // - The next shape has textframe: This shape have to shifted with
1085 // two layers.
1086 // - The next shape has not got textframe: This shape have to be
1087 // shifted only one layer up.
1088 // - The next shape is null:
1089 // - This shape is already at heaven: Only the textframe have
1090 // to be adjusted.
1091 sal_uInt32 nShift = 0;
1092 // Get the one level higher object (note: can be nullptr!)
1093 const auto pNextObj = pPage->SetObjectOrdNum(pObj->GetOrdNum() + 1, pObj->GetOrdNum() + 1);
1094 // If there is a higher object (not null)...
1095 if (pNextObj)
1096 {
1097 // One level shift is necessary
1098 nShift++;
1099 // If this object is a textbox, two level increasing needed
1100 // (one for the shape and one for the frame)
1101 if (auto pNextFormat = FindFrameFormat(pNextObj))
1102 if (SwTextBoxHelper::isTextBox(pNextFormat, RES_DRAWFRMFMT, pNextObj)
1104 nShift++;
1105 }
1106 // Set the new z-order.
1107 pPage->SetObjectOrdNum(pObj->GetOrdNum(), pObj->GetOrdNum() + nShift);
1108 }
1109 // The shape is on the right level, correct the layer of the frame
1111 }
1112
1114 EndAllAction();
1115}
1116
1118{
1119 OSL_ENSURE( Imp()->HasDrawView(), "SelectionToBottom without DrawView?" );
1120 const SdrMarkList &rMrkList = Imp()->GetDrawView()->GetMarkedObjectList();
1121 OSL_ENSURE( rMrkList.GetMarkCount(), "No object selected." );
1122
1123 SwFlyFrame *pFly = ::GetFlyFromMarked( &rMrkList, this );
1124 if ( pFly && pFly->IsFlyInContentFrame() )
1125 return;
1126
1128 if ( bBottom )
1130 else
1132 ::lcl_NotifyNeighbours( &rMrkList );
1133
1134 // If the selection has textbox
1135 for(size_t i = 0; i < rMrkList.GetMarkCount(); i++)
1136 if (auto pObj = rMrkList.GetMark(i)->GetMarkedSdrObj())
1137 // Get the shape of the textbox
1138 if (auto pFormat = FindFrameFormat(pObj))
1139 {
1140 // If the shape has not textframes skip.
1141 if (!SwTextBoxHelper::isTextBox(pFormat, RES_DRAWFRMFMT, pObj))
1142 continue;
1143 // If has, move the shape to correct level with...
1144 if (auto pDrwModel
1145 = pFormat->GetDoc()->getIDocumentDrawModelAccess().GetDrawModel())
1146 if (auto pPage = pDrwModel->GetPage(0))
1147 {
1148 const auto pNextObj = pPage->SetObjectOrdNum(pObj->GetOrdNum() - 1, pObj->GetOrdNum() - 1);
1149 // If there is a lower object (not null)...
1150 if (pNextObj)
1151 {
1152 // If the lower has no textframe, just do nothing, else move by one lower
1153 if (auto pNextFormat = FindFrameFormat(pNextObj))
1154 if (SwTextBoxHelper::isTextBox(pNextFormat, RES_DRAWFRMFMT, pNextObj)
1156 pPage->SetObjectOrdNum(pObj->GetOrdNum(), pObj->GetOrdNum() - 1);
1157 }
1158 }
1159 // And set correct layer for the selected textbox.
1161 }
1162
1164 EndAllAction();
1165}
1166
1167// Object above/below the document? 2 Controls, 1 Heaven, 0 Hell,
1168// SDRLAYER_NOTFOUND Ambiguous
1170{
1171 if ( !Imp()->HasDrawView() )
1172 return SDRLAYER_NOTFOUND;
1173
1175 const SdrMarkList &rMrkList = Imp()->GetDrawView()->GetMarkedObjectList();
1176 for ( size_t i = 0; i < rMrkList.GetMarkCount(); ++i )
1177 {
1178 const SdrObject *pObj = rMrkList.GetMark( i )->GetMarkedSdrObj();
1179 if( !pObj )
1180 continue;
1181 if ( nRet == SDRLAYER_NOTFOUND )
1182 nRet = pObj->GetLayer();
1183 else if ( nRet != pObj->GetLayer() )
1184 {
1185 return SDRLAYER_NOTFOUND;
1186 }
1187 }
1188 return nRet;
1189}
1190
1191// Object above/below the document
1192// Note: only visible objects can be marked. Thus, objects with invisible
1193// layer IDs have not to be considered.
1194// If <SwFEShell> exists, layout exists!!
1196{
1197 if ( !Imp()->HasDrawView() )
1198 return;
1199
1200 const SdrMarkList &rMrkList = Imp()->GetDrawView()->GetMarkedObjectList();
1202 // correct type of <nControls>
1203 for ( size_t i = 0; i < rMrkList.GetMarkCount(); ++i )
1204 {
1205 SdrObject* pObj = rMrkList.GetMark( i )->GetMarkedSdrObj();
1206 if( !pObj )
1207 continue;
1208 // or group objects containing controls.
1209 // --> #i113730#
1210 // consider that a member of a drawing group has been selected.
1211 const SwContact* pContact = ::GetUserCall( pObj );
1212 OSL_ENSURE( pContact && pContact->GetMaster(), "<SwFEShell::ChangeOpaque(..)> - missing contact or missing master object at contact!" );
1213 const bool bControlObj = ( pContact && pContact->GetMaster() )
1214 ? ::CheckControlLayer( pContact->GetMaster() )
1215 : ::CheckControlLayer( pObj );
1216 if ( !bControlObj && pObj->GetLayer() != nLayerId )
1217 {
1218 pObj->SetLayer( nLayerId );
1220 if (SwVirtFlyDrawObj* pVirtO = dynamic_cast<SwVirtFlyDrawObj*>(pObj))
1221 {
1222 SwFormat *pFormat = pVirtO->GetFlyFrame()->GetFormat();
1223 SvxOpaqueItem aOpa( pFormat->GetOpaque() );
1224 aOpa.SetValue( nLayerId == rIDDMA.GetHellId() );
1225 pFormat->SetFormatAttr( aOpa );
1226 // If pObj has textframe, put its textframe to the right level
1227 if (auto pTextBx = FindFrameFormat(pObj))
1229 }
1230 }
1231 }
1233}
1234
1236{
1237 ChangeOpaque( getIDocumentDrawModelAccess().GetHeavenId() );
1238}
1239
1241{
1243}
1244
1246{
1247 if ( IsFrameSelected() || !Imp()->HasDrawView() )
1248 return 0;
1249
1251}
1252
1254{
1255 if ( !Imp()->HasDrawView() )
1256 return false;
1257 else
1258 return nullptr != ::GetFlyFromMarked( &Imp()->GetDrawView()->GetMarkedObjectList(),
1259 const_cast<SwFEShell*>(this) );
1260}
1261
1262bool SwFEShell::IsObjSelected( const SdrObject& rObj ) const
1263{
1264 if ( IsFrameSelected() || !Imp()->HasDrawView() )
1265 return false;
1266 else
1267 return Imp()->GetDrawView()->IsObjMarked( &rObj );
1268}
1269
1271{
1272 // RotGrfFlyFrame: check if RotationMode is possible
1273 const SdrView *pSdrView = Imp()->GetDrawView();
1274
1275 if(pSdrView)
1276 {
1277 const SdrMarkList& rList(pSdrView->GetMarkedObjectList());
1278
1279 if(1 == rList.GetMarkCount())
1280 {
1281 const SwVirtFlyDrawObj* pVirtFlyDraw(dynamic_cast< const SwVirtFlyDrawObj* >(rList.GetMark(0)->GetMarkedSdrObj()));
1282
1283 if(nullptr != pVirtFlyDraw)
1284 {
1285 return pVirtFlyDraw->ContainsSwGrfNode();
1286 }
1287 }
1288 }
1289
1290 return false;
1291}
1292
1294{
1295 if (pObj)
1296 {
1297 const SdrMarkList& aMarkList = Imp()->GetDrawView()->GetMarkedObjectList();
1298 if (aMarkList.GetMarkCount() == 0)
1299 {
1300 return true;
1301 }
1302 SdrMark* pM=aMarkList.GetMark(0);
1303 if (pM)
1304 {
1305 SdrObject* pMarkObj = pM->GetMarkedSdrObj();
1306 if (pMarkObj && pMarkObj->getParentSdrObjectFromSdrObject() == pObj->getParentSdrObjectFromSdrObject())
1307 return true;
1308 }
1309 }
1310 return false;
1311}
1312
1314{
1315 // Terminate the TextEditMode. If required (default if the object
1316 // does not contain any more text and does not carry attributes) the object
1317 // is deleted. All other objects marked are preserved.
1318
1319 OSL_ENSURE( Imp()->HasDrawView() && Imp()->GetDrawView()->IsTextEdit(),
1320 "EndTextEdit a no Object" );
1321
1323 SdrView *pView = Imp()->GetDrawView();
1324 SdrObject *pObj = pView->GetTextEditObject();
1325 SdrObjUserCall* pUserCall = GetUserCall(pObj);
1326 if( nullptr != pUserCall )
1327 {
1328 SdrObject *pTmp = static_cast<SwContact*>(pUserCall)->GetMaster();
1329 if( !pTmp )
1330 pTmp = pObj;
1331 pUserCall->Changed( *pTmp, SdrUserCallType::Resize, pTmp->GetLastBoundRect() );
1332 }
1333 if ( !pObj->getParentSdrObjectFromSdrObject() )
1334 {
1335 if ( SdrEndTextEditKind::ShouldBeDeleted == pView->SdrEndTextEdit(true) )
1336 {
1337 if ( pView->GetMarkedObjectList().GetMarkCount() > 1 )
1338 {
1339 SdrMarkList aSave( pView->GetMarkedObjectList() );
1340 aSave.DeleteMark( aSave.FindObject( pObj ) );
1341 if ( aSave.GetMarkCount() )
1342 {
1343 pView->UnmarkAll();
1344 pView->MarkObj( pObj, Imp()->GetPageView() );
1345 }
1347 for ( size_t i = 0; i < aSave.GetMarkCount(); ++i )
1348 pView->MarkObj( aSave.GetMark( i )->GetMarkedSdrObj(), Imp()->GetPageView() );
1349 }
1350 else
1352 }
1353 }
1354 else
1355 pView->SdrEndTextEdit();
1356
1358 SfxLokHelper::notifyOtherViews(GetSfxViewShell(), LOK_CALLBACK_VIEW_LOCK, "rectangle", "EMPTY");
1359
1360 EndAllAction();
1361}
1362
1363bool SwFEShell::IsInsideSelectedObj( const Point &rPt )
1364{
1365 if( Imp()->HasDrawView() )
1366 {
1367 SwDrawView *pDView = Imp()->GetDrawView();
1368
1369 if( pDView->GetMarkedObjectList().GetMarkCount() &&
1370 pDView->IsMarkedObjHit( rPt ) )
1371 {
1372 return true;
1373 }
1374 }
1375 return false;
1376}
1377
1378bool SwFEShell::IsObjSelectable( const Point& rPt )
1379{
1380 CurrShell aCurr(this);
1381 SwDrawView *pDView = Imp()->GetDrawView();
1382 bool bRet = false;
1383 if( pDView )
1384 {
1385 SdrPageView* pPV;
1386 const auto nOld = pDView->GetHitTolerancePixel();
1387 pDView->SetHitTolerancePixel( pDView->GetMarkHdlSizePixel()/2 );
1388
1389 bRet = pDView->PickObj(rPt, pDView->getHitTolLog(), pPV, SdrSearchOptions::PICKMARKABLE) != nullptr;
1390 pDView->SetHitTolerancePixel( nOld );
1391 }
1392 return bRet;
1393}
1394
1395SdrObject* SwFEShell::GetObjAt( const Point& rPt )
1396{
1397 SdrObject* pRet = nullptr;
1398 CurrShell aCurr(this);
1399 SwDrawView *pDView = Imp()->GetDrawView();
1400 if( pDView )
1401 {
1402 SdrPageView* pPV;
1403 const auto nOld = pDView->GetHitTolerancePixel();
1404 pDView->SetHitTolerancePixel( pDView->GetMarkHdlSizePixel()/2 );
1405
1406 pRet = pDView->PickObj(rPt, pDView->getHitTolLog(), pPV, SdrSearchOptions::PICKMARKABLE);
1407 pDView->SetHitTolerancePixel( nOld );
1408 }
1409 return pRet;
1410}
1411
1412// Test if there is an object at that position and if it should be selected.
1414{
1415 CurrShell aCurr(this);
1416 SwDrawView *pDrawView = Imp()->GetDrawView();
1417 bool bRet(false);
1418
1419 if(pDrawView)
1420 {
1421 SdrPageView* pPV;
1422 const auto nOld(pDrawView->GetHitTolerancePixel());
1423
1424 pDrawView->SetHitTolerancePixel(pDrawView->GetMarkHdlSizePixel()/2);
1425 SdrObject* pObj = pDrawView->PickObj(rPt, pDrawView->getHitTolLog(), pPV, SdrSearchOptions::PICKMARKABLE);
1426 pDrawView->SetHitTolerancePixel(nOld);
1427
1428 if (pObj)
1429 {
1430 bRet = true;
1432 // #i89920#
1433 // Do not select object in background which is overlapping this text
1434 // at the given position.
1435 bool bObjInBackground( false );
1436 {
1437 if ( pObj->GetLayer() == rIDDMA.GetHellId() )
1438 {
1439 const SwAnchoredObject* pAnchoredObj = ::GetUserCall( pObj )->GetAnchoredObj( pObj );
1440 const SwFrameFormat& rFormat = pAnchoredObj->GetFrameFormat();
1441 const SwFormatSurround& rSurround = rFormat.GetSurround();
1442 if ( rSurround.GetSurround() == css::text::WrapTextMode_THROUGH )
1443 {
1444 bObjInBackground = true;
1445 }
1446 }
1447 }
1448 if ( bObjInBackground )
1449 {
1450 const SwPageFrame* pPageFrame = GetLayout()->GetPageAtPos( rPt );
1451 if( pPageFrame )
1452 {
1453 const SwContentFrame* pContentFrame( pPageFrame->ContainsContent() );
1454 while ( pContentFrame )
1455 {
1456 if ( pContentFrame->UnionFrame().Contains( rPt ) )
1457 {
1458 const SwTextFrame* pTextFrame = pContentFrame->DynCastTextFrame();
1459 if ( pTextFrame )
1460 {
1461 SwPosition aPos(GetDoc()->GetNodes());
1462 Point aTmpPt( rPt );
1463 if (pTextFrame->GetKeyCursorOfst(&aPos, aTmpPt))
1464 {
1465 SwRect aCursorCharRect;
1466 if (pTextFrame->GetCharRect(aCursorCharRect,
1467 aPos))
1468 {
1469 if ( aCursorCharRect.Overlaps( SwRect( pObj->GetLastBoundRect() ) ) )
1470 {
1471 bRet = false;
1472 }
1473 }
1474 }
1475 }
1476 else
1477 {
1478 bRet = false;
1479 }
1480 break;
1481 }
1482
1483 pContentFrame = pContentFrame->GetNextContentFrame();
1484 }
1485 }
1486 }
1487
1488 // Don't select header / footer objects in body edition and vice-versa
1489 SwContact* pContact = static_cast<SwContact*>(pObj->GetUserCall());
1490 if (pContact && !pContact->ObjAnchoredAtPage() )
1491 {
1492 const SwNode& rAnchorNode = pContact->GetAnchorNode();
1493 bool bInHdrFtr = GetDoc()->IsInHeaderFooter( rAnchorNode );
1494 if (IsHeaderFooterEdit() != bInHdrFtr)
1495 {
1496 bRet = false;
1497 }
1498 }
1499
1500 if ( bRet )
1501 {
1502 const SdrPage* pPage = rIDDMA.GetDrawModel()->GetPage(0);
1503 for(size_t a = pObj->GetOrdNum()+1; bRet && a < pPage->GetObjCount(); ++a)
1504 {
1505 SdrObject *pCandidate = pPage->GetObj(a);
1506
1507 SwVirtFlyDrawObj* pDrawObj = dynamic_cast<SwVirtFlyDrawObj*>(pCandidate);
1508 if (pDrawObj && pDrawObj->GetCurrentBoundRect().Contains(rPt))
1509 {
1510 bRet = false;
1511 }
1512 }
1513 }
1514 }
1515 }
1516
1517 return bRet;
1518}
1519
1520/*
1521 * If an object was selected, we assume its upper-left corner
1522 * otherwise the middle of the current CharRects.
1523 * Does the object include a control or groups,
1524 * which comprise only controls
1525 */
1526static bool lcl_IsControlGroup( const SdrObject *pObj )
1527{
1528 bool bRet = false;
1529 if(dynamic_cast<const SdrUnoObj*>( pObj) != nullptr)
1530 bRet = true;
1531 else if( auto pObjGroup = dynamic_cast<const SdrObjGroup*>( pObj) )
1532 {
1533 bRet = true;
1534 const SdrObjList *pLst = pObjGroup->GetSubList();
1535 for ( size_t i = 0; i < pLst->GetObjCount(); ++i )
1536 if( !::lcl_IsControlGroup( pLst->GetObj( i ) ) )
1537 return false;
1538 }
1539 return bRet;
1540}
1541
1542namespace
1543{
1544 class MarkableObjectsOnly : public svx::ISdrObjectFilter
1545 {
1546 public:
1547 explicit MarkableObjectsOnly( SdrPageView* i_pPV )
1548 :m_pPV( i_pPV )
1549 {
1550 }
1551
1552 virtual bool includeObject( const SdrObject& i_rObject ) const override
1553 {
1554 return m_pPV && m_pPV->GetView().IsObjMarkable( &i_rObject, m_pPV );
1555 }
1556
1557 private:
1558 SdrPageView* m_pPV;
1559 };
1560}
1561
1562const SdrObject* SwFEShell::GetBestObject(bool bNext, GotoObjFlags eType, bool bFlat,
1563 const svx::ISdrObjectFilter* pFilter,
1564 bool* pbWrapped)
1565{
1566 if (pbWrapped)
1567 *pbWrapped = false;
1568
1569 if( !Imp()->HasDrawView() )
1570 return nullptr;
1571
1572 const SdrObject *pBest = nullptr,
1573 *pTop = nullptr;
1574
1575 const tools::Long nTmp = bNext ? LONG_MAX : 0;
1576 Point aBestPos( nTmp, nTmp );
1577 Point aTopPos( nTmp, nTmp );
1578 Point aCurPos;
1579 Point aPos;
1580 bool bNoDraw((GotoObjFlags::DrawAny & eType) == GotoObjFlags::NONE);
1581 bool bNoFly((GotoObjFlags::FlyAny & eType) == GotoObjFlags::NONE);
1582
1583 if( !bNoFly && bNoDraw )
1584 {
1585 SwFlyFrame *pFly = GetCurrFrame( false )->FindFlyFrame();
1586 if( pFly )
1587 pBest = pFly->GetVirtDrawObj();
1588 }
1589 const SdrMarkList &rMrkList = Imp()->GetDrawView()->GetMarkedObjectList();
1591
1592 MarkableObjectsOnly aDefaultFilter( pPV );
1593 if ( !pFilter )
1594 pFilter = &aDefaultFilter;
1595
1596 if( !pBest || rMrkList.GetMarkCount() == 1 )
1597 {
1598 // Determine starting point
1599 SdrObjList* pList = nullptr;
1600 if ( rMrkList.GetMarkCount() )
1601 {
1602 const SdrObject* pStartObj = rMrkList.GetMark(0)->GetMarkedSdrObj();
1603 if( auto pVirtFlyDrawObj = dynamic_cast<const SwVirtFlyDrawObj*>( pStartObj) )
1604 aPos = pVirtFlyDrawObj->GetFlyFrame()->getFrameArea().Pos();
1605 else
1606 aPos = pStartObj->GetSnapRect().TopLeft();
1607
1608 // If an object inside a group is selected, we want to
1609 // iterate over the group members.
1610 if ( ! pStartObj->GetUserCall() )
1611 pList = pStartObj->getParentSdrObjListFromSdrObject();
1612 }
1613 else
1614 {
1615 // If no object is selected, we check if we just entered a group.
1616 // In this case we want to iterate over the group members.
1617 aPos = GetCharRect().Center();
1618 const SdrObject* pStartObj = pPV ? pPV->GetCurrentGroup() : nullptr;
1619 if ( dynamic_cast<const SdrObjGroup*>( pStartObj) )
1620 pList = pStartObj->GetSubList();
1621 }
1622
1623 if ( ! pList )
1624 {
1625 // Here we are if
1626 // A No object has been selected and no group has been entered or
1627 // B An object has been selected and it is not inside a group
1629 }
1630
1631 OSL_ENSURE( pList, "No object list to iterate" );
1632
1633 SdrObjListIter aObjIter( pList, bFlat ? SdrIterMode::Flat : SdrIterMode::DeepNoGroups );
1634 while ( aObjIter.IsMore() )
1635 {
1636 SdrObject* pObj = aObjIter.Next();
1637 SwVirtFlyDrawObj *pVirtO = dynamic_cast<SwVirtFlyDrawObj*>(pObj);
1638 if( ( bNoFly && pVirtO ) ||
1639 ( bNoDraw && !pVirtO ) ||
1640 // Ignore TextBoxes of draw shapes here, so that
1641 // SwFEShell::SelectObj() won't jump back on this list, meaning
1642 // we never jump to the next draw shape.
1643 (pVirtO && pVirtO->IsTextBox()) ||
1646 !pFilter->includeObject( *pObj ) )
1647 continue;
1648 if (pVirtO)
1649 {
1650 SwFlyFrame *pFly = pVirtO->GetFlyFrame();
1652 {
1653 switch ( eType )
1654 {
1656 if ( pFly->Lower() && pFly->Lower()->IsNoTextFrame() )
1657 continue;
1658 break;
1660 if ( pFly->Lower() &&
1661 (!pFly->Lower()->IsNoTextFrame() ||
1662 !static_cast<SwNoTextFrame*>(pFly->Lower())->GetNode()->GetGrfNode()))
1663 continue;
1664 break;
1666 if ( pFly->Lower() &&
1667 (!pFly->Lower()->IsNoTextFrame() ||
1668 !static_cast<SwNoTextFrame*>(pFly->Lower())->GetNode()->GetOLENode()))
1669 continue;
1670 break;
1671 default: break;
1672 }
1673 }
1674 aCurPos = pFly->getFrameArea().Pos();
1675 }
1676 else
1677 aCurPos = pObj->GetSnapRect().TopLeft();
1678
1679 // Special case if another object is on same Y.
1680 if( aCurPos != aPos && // only when it is not me
1681 aCurPos.getY() == aPos.getY() && // Y positions equal
1682 (bNext? (aCurPos.getX() > aPos.getX()) : // lies next to me
1683 (aCurPos.getX() < aPos.getX())) ) // " reverse
1684 {
1685 aBestPos = Point( nTmp, nTmp );
1686 SdrObjListIter aTmpIter( pList, bFlat ? SdrIterMode::Flat : SdrIterMode::DeepNoGroups );
1687 while ( aTmpIter.IsMore() )
1688 {
1689 SdrObject* pTmpObj = aTmpIter.Next();
1690 pVirtO = dynamic_cast<SwVirtFlyDrawObj*>(pTmpObj);
1691 if( ( bNoFly && pVirtO ) || ( bNoDraw && !pVirtO ) )
1692 continue;
1693 if (pVirtO)
1694 {
1695 aCurPos = pVirtO->GetFlyFrame()->getFrameArea().Pos();
1696 }
1697 else
1698 aCurPos = pTmpObj->GetCurrentBoundRect().TopLeft();
1699
1700 if( aCurPos != aPos && aCurPos.Y() == aPos.Y() &&
1701 (bNext? (aCurPos.getX() > aPos.getX()) : // lies next to me
1702 (aCurPos.getX() < aPos.getX())) && // " reverse
1703 (bNext? (aCurPos.getX() < aBestPos.getX()) : // better as best
1704 (aCurPos.getX() > aBestPos.getX())) ) // " reverse
1705 {
1706 aBestPos = aCurPos;
1707 pBest = pTmpObj;
1708 }
1709 }
1710 break;
1711 }
1712
1713 if( (
1714 (bNext? (aPos.getY() < aCurPos.getY()) : // only below me
1715 (aPos.getY() > aCurPos.getY())) && // " reverse
1716 (bNext? (aBestPos.getY() > aCurPos.getY()) : // closer below
1717 (aBestPos.getY() < aCurPos.getY()))
1718 ) || // " reverse
1719 (aBestPos.getY() == aCurPos.getY() &&
1720 (bNext? (aBestPos.getX() > aCurPos.getX()) : // further left
1721 (aBestPos.getX() < aCurPos.getX())))) // " reverse
1722
1723 {
1724 aBestPos = aCurPos;
1725 pBest = pObj;
1726 }
1727
1728 if( (bNext? (aTopPos.getY() > aCurPos.getY()) : // higher as best
1729 (aTopPos.getY() < aCurPos.getY())) || // " reverse
1730 (aTopPos.getY() == aCurPos.getY() &&
1731 (bNext? (aTopPos.getX() > aCurPos.getX()) : // further left
1732 (aTopPos.getX() < aCurPos.getX())))) // " reverse
1733 {
1734 aTopPos = aCurPos;
1735 pTop = pObj;
1736 }
1737 }
1738 // unfortunately nothing found
1739 if( bNext ? (aBestPos.getX() == LONG_MAX) : (aBestPos.getX() == 0) )
1740 {
1741 pBest = pTop;
1742 if (pbWrapped && pBest)
1743 *pbWrapped = true;
1744 }
1745 }
1746
1747 return pBest;
1748}
1749
1750bool SwFEShell::GotoObj( bool bNext, GotoObjFlags eType )
1751{
1752 SvxSearchDialogWrapper::SetSearchLabel( SearchLabel::Empty );
1753
1754 bool bWrapped(false);
1755 const SdrObject* pBest = GetBestObject(bNext, eType, true, nullptr, &bWrapped);
1756
1757 if ( !pBest )
1758 {
1759 SvxSearchDialogWrapper::SetSearchLabel( SearchLabel::NavElementNotFound );
1760 return false;
1761 }
1762
1763 const SwVirtFlyDrawObj *pVirtO = dynamic_cast<const SwVirtFlyDrawObj*>(pBest);
1764 if (pVirtO)
1765 {
1766 const SwRect& rFrame = pVirtO->GetFlyFrame()->getFrameArea();
1767 SelectObj( rFrame.Pos(), 0, const_cast<SdrObject*>(pBest) );
1768 if( !ActionPend() )
1769 MakeVisible( rFrame );
1770 }
1771 else
1772 {
1773 SelectObj( Point(), 0, const_cast<SdrObject*>(pBest) );
1774 if( !ActionPend() )
1776 }
1777 CallChgLnk();
1778
1779 if (bWrapped)
1780 SvxSearchDialogWrapper::SetSearchLabel(bNext ? SearchLabel::EndWrapped :
1781 SearchLabel::StartWrapped);
1782
1783 return true;
1784}
1785
1786bool SwFEShell::BeginCreate( SdrObjKind eSdrObjectKind, const Point &rPos )
1787{
1788 bool bRet = false;
1789
1790 if ( !Imp()->HasDrawView() )
1791 Imp()->MakeDrawView();
1792
1793 if ( GetPageNumber( rPos ) )
1794 {
1795 Imp()->GetDrawView()->SetCurrentObj( eSdrObjectKind );
1796 if ( eSdrObjectKind == SdrObjKind::Caption )
1797 bRet = Imp()->GetDrawView()->BegCreateCaptionObj(
1798 rPos, Size( lMinBorder - MINFLY, lMinBorder - MINFLY ),
1799 GetOut() );
1800 else
1801 bRet = Imp()->GetDrawView()->BegCreateObj( rPos, GetOut() );
1802 }
1803 if ( bRet )
1804 {
1806 }
1807 return bRet;
1808}
1809
1810bool SwFEShell::BeginCreate( SdrObjKind eSdrObjectKind, SdrInventor eObjInventor,
1811 const Point &rPos )
1812{
1813 bool bRet = false;
1814
1815 if ( !Imp()->HasDrawView() )
1816 Imp()->MakeDrawView();
1817
1818 if ( GetPageNumber( rPos ) )
1819 {
1820 Imp()->GetDrawView()->SetCurrentObj( eSdrObjectKind, eObjInventor );
1821 bRet = Imp()->GetDrawView()->BegCreateObj( rPos, GetOut() );
1822 }
1823 if ( bRet )
1825 return bRet;
1826}
1827
1828void SwFEShell::MoveCreate( const Point &rPos )
1829{
1830 OSL_ENSURE( Imp()->HasDrawView(), "MoveCreate without DrawView?" );
1831 if ( GetPageNumber( rPos ) )
1832 {
1833 ScrollTo( rPos );
1834 Imp()->GetDrawView()->MovCreateObj( rPos );
1835 ::FrameNotify( this );
1836 }
1837}
1838
1840{
1841 // To assure undo-object from the DrawEngine is not stored,
1842 // (we create our own undo-object!), temporarily switch-off Undo
1843 OSL_ENSURE( Imp()->HasDrawView(), "EndCreate without DrawView?" );
1844 if( !Imp()->GetDrawView()->IsGroupEntered() )
1845 {
1846 GetDoc()->GetIDocumentUndoRedo().DoDrawUndo(false);
1847 }
1848 bool bCreate = Imp()->GetDrawView()->EndCreateObj( eSdrCreateCmd );
1849 GetDoc()->GetIDocumentUndoRedo().DoDrawUndo(true);
1850
1851 if ( !bCreate )
1852 {
1853 ::FrameNotify( this, FLY_DRAG_END );
1854 return false;
1855 }
1856
1857 if ( eSdrCreateCmd == SdrCreateCmd::NextPoint )
1858 {
1859 ::FrameNotify( this );
1860 return true;
1861 }
1862 return ImpEndCreate();
1863}
1864
1866{
1867 if (Imp()->GetDrawView()->GetMarkedObjectList().GetMarkCount() == 0)
1868 return false;
1869
1871
1872 if( rSdrObj.GetSnapRect().IsEmpty() )
1873 {
1874 // preferably we forget the object, only gives problems
1876 Imp()->GetDrawView()->UnmarkAll();
1877 ::FrameNotify( this, FLY_DRAG_END );
1878 return false;
1879 }
1880
1881 if( rSdrObj.getParentSdrObjectFromSdrObject() )
1882 {
1883 Point aTmpPos( rSdrObj.GetSnapRect().TopLeft() );
1884 Point aNewAnchor( rSdrObj.getParentSdrObjectFromSdrObject()->GetAnchorPos() );
1885 // OD 2004-04-05 #i26791# - direct object positioning for group members
1886 rSdrObj.NbcSetRelativePos( aTmpPos - aNewAnchor );
1887 rSdrObj.NbcSetAnchorPos( aNewAnchor );
1888 ::FrameNotify( this );
1889 return true;
1890 }
1891
1892 LockPaint();
1894
1895 Imp()->GetDrawView()->UnmarkAll();
1896
1897 const tools::Rectangle &rBound = rSdrObj.GetSnapRect();
1898 Point aPt( rBound.TopRight() );
1899
1900 // default for controls character bound, otherwise paragraph bound.
1901 SwFormatAnchor aAnch;
1902 const SwFrame *pAnch = nullptr;
1903 bool bCharBound = false;
1904 if( dynamic_cast<const SdrUnoObj*>( &rSdrObj) != nullptr )
1905 {
1906 SwPosition aPos( GetDoc()->GetNodes() );
1908 Point aPoint( aPt.getX(), aPt.getY() + rBound.GetHeight()/2 );
1909 GetLayout()->GetModelPositionForViewPoint( &aPos, aPoint, &aState );
1910
1911 // characterbinding not allowed in readonly-content
1912 if( !aPos.GetNode().IsProtect() )
1913 {
1914 std::pair<Point, bool> const tmp(aPoint, true);
1915 pAnch = aPos.GetNode().GetContentNode()->getLayoutFrame(GetLayout(), &aPos, &tmp);
1916 SwRect aTmp;
1917 pAnch->GetCharRect( aTmp, aPos );
1918
1919 // The crsr should not be too far away
1920 bCharBound = true;
1921 constexpr tools::Long constTwips_1cm = o3tl::toTwips(1, o3tl::Length::cm);
1922 tools::Rectangle aRect( aTmp.SVRect() );
1923 // Extend by 1 cm in each direction
1924 aRect.AdjustLeft(-constTwips_1cm);
1925 aRect.AdjustTop(-constTwips_1cm);
1926 aRect.AdjustRight(constTwips_1cm);
1927 aRect.AdjustBottom(constTwips_1cm);
1928
1929 if( !aRect.Overlaps( rBound ) && !::GetHtmlMode( GetDoc()->GetDocShell() ))
1930 bCharBound = false;
1931
1932 // anchor in header/footer also not allowed.
1933 if( bCharBound )
1934 bCharBound = !GetDoc()->IsInHeaderFooter( aPos.GetNode() );
1935
1936 if( bCharBound )
1937 {
1938 aAnch.SetType( RndStdIds::FLY_AS_CHAR );
1939 aAnch.SetAnchor( &aPos );
1940 }
1941 }
1942 }
1943
1944 if( !bCharBound )
1945 {
1946 // allow native drawing objects in header/footer.
1947 // Thus, set <bBodyOnly> to <false> for these objects using value
1948 // of <nIdent> - value <0xFFFF> indicates control objects, which aren't
1949 // allowed in header/footer.
1950 //bool bBodyOnly = OBJ_NONE != nIdent;
1951 bool bBodyOnly = SdrInventor::Default != rSdrObj.GetObjInventor();
1952 bool bAtPage = false;
1953 const SwFrame* pPage = nullptr;
1955 Point aPoint( aPt );
1956 SwPosition aPos( GetDoc()->GetNodes() );
1957 GetLayout()->GetModelPositionForViewPoint( &aPos, aPoint, &aState );
1958
1959 // do not set in ReadnOnly-content
1960 if (aPos.GetNode().IsProtect())
1961 {
1962 // then only page bound. Or should we
1963 // search the next not-readonly position?
1964 bAtPage = true;
1965 }
1966
1967 SwContentNode* pCNode = aPos.GetNode().GetContentNode();
1968 std::pair<Point, bool> const tmp(aPoint, false);
1969 pAnch = pCNode ? pCNode->getLayoutFrame(GetLayout(), nullptr, &tmp) : nullptr;
1970 if (!pAnch)
1971 {
1972 // Hidden content. Anchor to the page instead
1973 bAtPage = true;
1974 }
1975
1976 if( !bAtPage )
1977 {
1978 const SwFlyFrame *pTmp = pAnch->FindFlyFrame();
1979 if( pTmp )
1980 {
1981 const SwFrame* pTmpFrame = pAnch;
1982 SwRect aBound( rBound );
1983 while( pTmp )
1984 {
1985 if( pTmp->getFrameArea().Contains( aBound ) )
1986 {
1987 if( !bBodyOnly || !pTmp->FindFooterOrHeader() )
1988 pPage = pTmpFrame;
1989 break;
1990 }
1991 pTmp = pTmp->GetAnchorFrame()
1992 ? pTmp->GetAnchorFrame()->FindFlyFrame()
1993 : nullptr;
1994 pTmpFrame = pTmp;
1995 }
1996 }
1997
1998 if( !pPage )
1999 pPage = pAnch->FindPageFrame();
2000
2001 // Always via FindAnchor, to assure the frame will be bound
2002 // to the previous. With GetCrsOfst we can also reach the next. THIS IS WRONG.
2003 pAnch = ::FindAnchor( pPage, aPt, bBodyOnly );
2004 if (pAnch->IsTextFrame())
2005 {
2006 std::pair<SwTextNode const*, sal_Int32> const pos(
2007 static_cast<SwTextFrame const*>(pAnch)->MapViewToModel(TextFrameIndex(0)));
2008 aPos.Assign( *pos.first );
2009 }
2010 else
2011 {
2012 aPos.Assign( *static_cast<const SwNoTextFrame*>(pAnch)->GetNode() );
2013 }
2014
2015 // do not set in ReadnOnly-content
2016 if( aPos.GetNode().IsProtect() )
2017 // then only page bound. Or should we
2018 // search the next not-readonly position?
2019 bAtPage = true;
2020 else
2021 {
2022 aAnch.SetType( RndStdIds::FLY_AT_PARA );
2023 aAnch.SetAnchor( &aPos );
2024 }
2025 }
2026
2027 if( bAtPage )
2028 {
2029 pPage = pAnch ? pAnch->FindPageFrame() : GetLayout()->GetPageAtPos(aPoint);
2030
2031 aAnch.SetType( RndStdIds::FLY_AT_PAGE );
2032 aAnch.SetPageNum( pPage->GetPhyPageNum() );
2033 pAnch = pPage; // page becomes an anchor
2034 }
2035 }
2036
2039 aSet.Put( aAnch );
2040
2041 // OD 2004-03-30 #i26791# - determine relative object position
2042 SwTwips nXOffset;
2043 SwTwips nYOffset = rBound.Top() - pAnch->getFrameArea().Top();
2044 {
2045 if( pAnch->IsVertical() )
2046 {
2047 nXOffset = nYOffset;
2048 nYOffset = pAnch->getFrameArea().Left()+pAnch->getFrameArea().Width()-rBound.Right();
2049 }
2050 else if( pAnch->IsRightToLeft() )
2051 nXOffset = pAnch->getFrameArea().Left()+pAnch->getFrameArea().Width()-rBound.Right();
2052 else
2053 nXOffset = rBound.Left() - pAnch->getFrameArea().Left();
2054 if (pAnch->IsTextFrame())
2055 {
2056 const SwTextFrame* pTmp = static_cast<const SwTextFrame*>(pAnch);
2057 if (pTmp->IsFollow())
2058 {
2059 do {
2060 pTmp = pTmp->FindMaster();
2061 OSL_ENSURE(pTmp, "Where's my Master?");
2062 // OD 2004-03-30 #i26791# - correction: add frame area height
2063 // of master frames.
2064 nYOffset += pTmp->IsVertical() ?
2065 pTmp->getFrameArea().Width() : pTmp->getFrameArea().Height();
2066 } while (pTmp->IsFollow());
2067 }
2068
2069 nYOffset -= pTmp->GetBaseVertOffsetForFly(false);
2070 }
2071 }
2072
2073 if( SdrInventor::Default == rSdrObj.GetObjInventor() && rSdrObj.GetObjIdentifier() == SdrObjKind::NONE )
2074 {
2075 // For OBJ_NONE a fly is inserted.
2076 const tools::Long nWidth = rBound.Right() - rBound.Left();
2077 const tools::Long nHeight= rBound.Bottom() - rBound.Top();
2078 aSet.Put( SwFormatFrameSize( SwFrameSize::Minimum, std::max( nWidth, tools::Long(MINFLY) ),
2079 std::max( nHeight, tools::Long(MINFLY) )));
2080
2081 SwFormatHoriOrient aHori( nXOffset, text::HoriOrientation::NONE, text::RelOrientation::FRAME );
2082 SwFormatVertOrient aVert( nYOffset, text::VertOrientation::NONE, text::RelOrientation::FRAME );
2083 aSet.Put( SwFormatSurround( css::text::WrapTextMode_PARALLEL ) );
2084 aSet.Put( aHori );
2085 aSet.Put( aVert );
2086
2087 // Quickly store the square
2088 const SwRect aFlyRect( rBound );
2089
2090 // Throw away generated object, now the fly can nicely
2091 // via the available SS be generated.
2092 GetDoc()->GetIDocumentUndoRedo().DoDrawUndo(false); // see above
2093 // #i52858# - method name changed
2095 if( !pPg )
2096 {
2098 auto pNewPage = pTmpSdrModel->AllocPage( false );
2099 pTmpSdrModel->InsertPage( pNewPage.get() );
2100 pPg = pNewPage.get();
2101 }
2102 pPg->RecalcObjOrdNums();
2103 pPg->RemoveObject( rSdrObj.GetOrdNumDirect() );
2104 GetDoc()->GetIDocumentUndoRedo().DoDrawUndo(true);
2105
2106 SwFlyFrame* pFlyFrame;
2107 if( NewFlyFrame( aSet, true ) &&
2108 ::GetHtmlMode( GetDoc()->GetDocShell() ) &&
2109 nullptr != ( pFlyFrame = GetSelectedFlyFrame() ))
2110 {
2112 // horizontal orientation:
2113 const bool bLeftFrame = aFlyRect.Left() <
2114 pAnch->getFrameArea().Left() + pAnch->getFramePrintArea().Left(),
2115 bLeftPrt = aFlyRect.Left() + aFlyRect.Width() <
2116 pAnch->getFrameArea().Left() + pAnch->getFramePrintArea().Width()/2;
2117 if( bLeftFrame || bLeftPrt )
2118 {
2119 aHori.SetHoriOrient( text::HoriOrientation::LEFT );
2120 aHori.SetRelationOrient( bLeftFrame ? text::RelOrientation::FRAME : text::RelOrientation::PRINT_AREA );
2121 }
2122 else
2123 {
2124 const bool bRightFrame = aFlyRect.Left() >
2125 pAnch->getFrameArea().Left() + pAnch->getFramePrintArea().Width();
2126 aHori.SetHoriOrient( text::HoriOrientation::RIGHT );
2127 aHori.SetRelationOrient( bRightFrame ? text::RelOrientation::FRAME : text::RelOrientation::PRINT_AREA );
2128 }
2129 aHtmlSet.Put( aHori );
2130 aVert.SetVertOrient( text::VertOrientation::TOP );
2131 aVert.SetRelationOrient( text::RelOrientation::PRINT_AREA );
2132 aHtmlSet.Put( aVert );
2133
2134 GetDoc()->SetAttr( aHtmlSet, *pFlyFrame->GetFormat() );
2135 }
2136 }
2137 else
2138 {
2139 if (rSdrObj.GetName().isEmpty())
2140 {
2141 bool bRestore = GetDoc()->GetIDocumentUndoRedo().DoesDrawUndo();
2142 GetDoc()->GetIDocumentUndoRedo().DoDrawUndo(false);
2143 rSdrObj.MakeNameUnique();
2144 GetDoc()->GetIDocumentUndoRedo().DoDrawUndo(bRestore);
2145 }
2146
2147 aSet.Put( aAnch );
2148 aSet.Put( SwFormatSurround( css::text::WrapTextMode_THROUGH ) );
2149 // OD 2004-03-30 #i26791# - set horizontal position
2150 SwFormatHoriOrient aHori( nXOffset, text::HoriOrientation::NONE, text::RelOrientation::FRAME );
2151 aSet.Put( aHori );
2152 // OD 2004-03-30 #i26791# - set vertical position
2153 if( pAnch->IsTextFrame() && static_cast<const SwTextFrame*>(pAnch)->IsFollow() )
2154 {
2155 const SwTextFrame* pTmp = static_cast<const SwTextFrame*>(pAnch);
2156 do {
2157 pTmp = pTmp->FindMaster();
2158 assert(pTmp && "Where's my Master?");
2159 nYOffset += pTmp->IsVertical() ?
2160 pTmp->getFramePrintArea().Width() : pTmp->getFramePrintArea().Height();
2161 } while ( pTmp->IsFollow() );
2162 }
2163 SwFormatVertOrient aVert( nYOffset, text::VertOrientation::NONE, text::RelOrientation::FRAME );
2164 aSet.Put( aVert );
2165 SwDrawFrameFormat* pFormat = static_cast<SwDrawFrameFormat*>(getIDocumentLayoutAccess().MakeLayoutFormat( RndStdIds::DRAW_OBJECT, &aSet ));
2166 // #i36010# - set layout direction of the position
2167 pFormat->SetPositionLayoutDir(
2168 text::PositionLayoutDir::PositionInLayoutDirOfAnchor );
2169 // #i44344#, #i44681# - positioning attributes already set
2170 pFormat->PosAttrSet();
2171 pFormat->SetFormatName(rSdrObj.GetName());
2172
2173 SwDrawContact *pContact = new SwDrawContact( pFormat, &rSdrObj );
2174 // #i35635#
2175 pContact->MoveObjToVisibleLayer( &rSdrObj );
2176 if( bCharBound )
2177 {
2178 OSL_ENSURE( aAnch.GetAnchorId() == RndStdIds::FLY_AS_CHAR, "wrong AnchorType" );
2179 SwTextNode *pNd = aAnch.GetAnchorNode()->GetTextNode();
2180 SwFormatFlyCnt aFormat( pFormat );
2181 pNd->InsertItem(aFormat,
2182 aAnch.GetAnchorContentOffset(), 0 );
2184 aVertical.SetVertOrient( text::VertOrientation::LINE_CENTER );
2185 pFormat->SetFormatAttr( aVertical );
2186 }
2187 if( pAnch->IsTextFrame() && static_cast<const SwTextFrame*>(pAnch)->IsFollow() )
2188 {
2189 const SwTextFrame* pTmp = static_cast<const SwTextFrame*>(pAnch);
2190 do {
2191 pTmp = pTmp->FindMaster();
2192 OSL_ENSURE( pTmp, "Where's my Master?" );
2193 } while( pTmp->IsFollow() );
2194 pAnch = pTmp;
2195 }
2196
2197 pContact->ConnectToLayout();
2198
2199 // mark object at frame the object is inserted at.
2200 {
2201 SdrObject* pMarkObj = pContact->GetDrawObjectByAnchorFrame( *pAnch );
2202 if ( pMarkObj )
2203 {
2204 Imp()->GetDrawView()->MarkObj( pMarkObj, Imp()->GetPageView() );
2205 }
2206 else
2207 {
2208 Imp()->GetDrawView()->MarkObj( &rSdrObj, Imp()->GetPageView() );
2209 }
2210 }
2211 }
2212
2214
2215 KillPams();
2217 UnlockPaint();
2218 return true;
2219}
2220
2222{
2223 OSL_ENSURE( Imp()->HasDrawView(), "BreakCreate without DrawView?" );
2225 ::FrameNotify( this, FLY_DRAG_END );
2226}
2227
2229{
2230 return Imp()->HasDrawView() && Imp()->GetDrawView()->IsCreateObj();
2231}
2232
2233bool SwFEShell::BeginMark( const Point &rPos )
2234{
2235 if ( !Imp()->HasDrawView() )
2236 Imp()->MakeDrawView();
2237
2238 if ( GetPageNumber( rPos ) )
2239 {
2240 SwDrawView* pDView = Imp()->GetDrawView();
2241
2242 if (pDView->HasMarkablePoints())
2243 return pDView->BegMarkPoints( rPos );
2244 else
2245 {
2246 pDView->BegMarkObj( rPos );
2247 return true;
2248 }
2249 }
2250 else
2251 return false;
2252}
2253
2254void SwFEShell::MoveMark( const Point &rPos )
2255{
2256 OSL_ENSURE( Imp()->HasDrawView(), "MoveMark without DrawView?" );
2257
2258 if ( GetPageNumber( rPos ) )
2259 {
2260 ScrollTo( rPos );
2261 SwDrawView* pDView = Imp()->GetDrawView();
2262
2263 if (pDView->IsInsObjPoint())
2264 pDView->MovInsObjPoint( rPos );
2265 else if (pDView->IsMarkPoints())
2266 pDView->MovMarkPoints( rPos );
2267 else
2268 pDView->MovAction( rPos );
2269 }
2270}
2271
2273{
2274 bool bRet = false;
2275 OSL_ENSURE( Imp()->HasDrawView(), "EndMark without DrawView?" );
2276
2277 if (Imp()->GetDrawView()->IsMarkObj())
2278 {
2279 bRet = Imp()->GetDrawView()->EndMarkObj();
2280
2281 if ( bRet )
2282 {
2283 bool bShowHdl = false;
2284 SwDrawView* pDView = Imp()->GetDrawView();
2285 // frames are not selected this way, except when
2286 // it is only one frame
2287 SdrMarkList &rMrkList = const_cast<SdrMarkList&>(pDView->GetMarkedObjectList());
2288 SwFlyFrame* pOldSelFly = ::GetFlyFromMarked( &rMrkList, this );
2289
2290 if ( rMrkList.GetMarkCount() > 1 )
2291 for ( size_t i = 0; i < rMrkList.GetMarkCount(); ++i )
2292 {
2293 SdrObject *pObj = rMrkList.GetMark( i )->GetMarkedSdrObj();
2294 if( dynamic_cast<const SwVirtFlyDrawObj*>( pObj) != nullptr )
2295 {
2296 if ( !bShowHdl )
2297 {
2298 bShowHdl = true;
2299 }
2300 rMrkList.DeleteMark( i );
2301 --i; // no exceptions
2302 }
2303 }
2304
2305 if( bShowHdl )
2306 {
2307 pDView->MarkListHasChanged();
2308 pDView->AdjustMarkHdl();
2309 }
2310
2311 if ( rMrkList.GetMarkCount() )
2312 ::lcl_GrabCursor(this, pOldSelFly);
2313 else
2314 bRet = false;
2315 }
2316 if ( bRet )
2318 }
2319 else
2320 {
2321 if (Imp()->GetDrawView()->IsMarkPoints())
2322 bRet = Imp()->GetDrawView()->EndMarkPoints();
2323 }
2324
2326 return bRet;
2327}
2328
2330{
2331 RndStdIds nRet = RndStdIds(SHRT_MAX);
2332 if ( Imp()->HasDrawView() )
2333 {
2334 const SdrMarkList &rMrkList = Imp()->GetDrawView()->GetMarkedObjectList();
2335 for ( size_t i = 0; i < rMrkList.GetMarkCount(); ++i )
2336 {
2337 SdrObject *pObj = rMrkList.GetMark( i )->GetMarkedSdrObj();
2338 if ( dynamic_cast<const SwVirtFlyDrawObj*>( pObj) != nullptr )
2339 {
2340 nRet = RndStdIds::UNKNOWN;
2341 break;
2342 }
2343 SwDrawContact *pContact = static_cast<SwDrawContact*>(GetUserCall(pObj));
2344 RndStdIds nId = pContact->GetFormat()->GetAnchor().GetAnchorId();
2345 if ( nRet == RndStdIds(SHRT_MAX) )
2346 nRet = nId;
2347 else if ( nRet != nId )
2348 {
2349 nRet = RndStdIds::UNKNOWN;
2350 break;
2351 }
2352 }
2353 }
2354 if ( nRet == RndStdIds(SHRT_MAX) )
2355 nRet = RndStdIds::UNKNOWN;
2356 return nRet;
2357}
2358
2359void SwFEShell::ChgAnchor( RndStdIds eAnchorId, bool bSameOnly, bool bPosCorr )
2360{
2361 OSL_ENSURE( Imp()->HasDrawView(), "ChgAnchor without DrawView?" );
2362 const SdrMarkList &rMrkList = Imp()->GetDrawView()->GetMarkedObjectList();
2363 if( rMrkList.GetMarkCount() &&
2365 {
2367
2368 if( GetDoc()->ChgAnchor( rMrkList, eAnchorId, bSameOnly, bPosCorr ))
2369 Imp()->GetDrawView()->UnmarkAll();
2370
2371 EndAllAction();
2372
2373 ::FrameNotify( this );
2374 }
2375}
2376
2378{
2379 OSL_ENSURE( Imp()->HasDrawView(), "DelSelectedObj(), no DrawView available" );
2380 if ( Imp()->HasDrawView() )
2381 {
2384 EndAllAction();
2385 ::FrameNotify( this, FLY_DRAG_END );
2386 }
2387}
2388
2389// For the statusline to request the current conditions
2391{
2392 tools::Rectangle aRect;
2393 if ( Imp()->HasDrawView() )
2394 {
2395 if ( Imp()->GetDrawView()->IsAction() )
2396 Imp()->GetDrawView()->TakeActionRect( aRect );
2397 else
2398 aRect = Imp()->GetDrawView()->GetAllMarkedRect();
2399 }
2400 return aRect.GetSize();
2401}
2402
2404{
2405 const SdrView *pView = Imp()->GetDrawView();
2406 OSL_ENSURE( pView, "GetAnchorObjDiff without DrawView?" );
2407
2408 tools::Rectangle aRect;
2409 if ( Imp()->GetDrawView()->IsAction() )
2410 Imp()->GetDrawView()->TakeActionRect( aRect );
2411 else
2412 aRect = Imp()->GetDrawView()->GetAllMarkedRect();
2413
2414 Point aRet( aRect.TopLeft() );
2415
2416 if ( IsFrameSelected() )
2417 {
2419 aRet -= pFly->GetAnchorFrame()->getFrameArea().Pos();
2420 }
2421 else
2422 {
2423 const SdrObject *pObj = pView->GetMarkedObjectList().GetMarkCount() == 1 ?
2424 pView->GetMarkedObjectList().GetMark(0)->GetMarkedSdrObj() : nullptr;
2425 if ( pObj )
2426 aRet -= pObj->GetAnchorPos();
2427 }
2428
2429 return aRet;
2430}
2431
2433{
2434 OSL_ENSURE( Imp()->GetDrawView(), "GetObjAbsPos() without DrawView?" );
2435 return Imp()->GetDrawView()->GetDragStat().GetActionRect().TopLeft();
2436}
2437
2438bool SwFEShell::IsGroupSelected(bool bAllowDiagams)
2439{
2440 if ( IsObjSelected() )
2441 {
2442 const SdrMarkList &rMrkList = Imp()->GetDrawView()->GetMarkedObjectList();
2443 for ( size_t i = 0; i < rMrkList.GetMarkCount(); ++i )
2444 {
2445 SdrObject *pObj = rMrkList.GetMark( i )->GetMarkedSdrObj();
2446 // consider 'virtual' drawing objects.
2447 // Thus, use corresponding method instead of checking type.
2448 if ( pObj->IsGroupObject() &&
2449 // --> #i38505# No ungroup allowed for 3d objects
2450 !pObj->Is3DObj() &&
2451 RndStdIds::FLY_AS_CHAR != static_cast<SwDrawContact*>(GetUserCall(pObj))->
2452 GetFormat()->GetAnchor().GetAnchorId() )
2453 {
2454 if(!bAllowDiagams)
2455 {
2456 // Don't allow enter Diagrams
2457 if(pObj->isDiagram())
2458 {
2459 return false;
2460 }
2461 }
2462
2463 return true;
2464 }
2465 }
2466 }
2467 return false;
2468}
2469
2470namespace
2471{
2472 bool HasSuitableGroupingAnchor(const SdrObject* pObj)
2473 {
2474 bool bSuitable = true;
2475 SwFrameFormat* pFrameFormat(::FindFrameFormat(const_cast<SdrObject*>(pObj)));
2476 if (!pFrameFormat)
2477 {
2478 OSL_FAIL( "<HasSuitableGroupingAnchor> - missing frame format" );
2479 bSuitable = false;
2480 }
2481 else if (RndStdIds::FLY_AS_CHAR == pFrameFormat->GetAnchor().GetAnchorId())
2482 {
2483 bSuitable = false;
2484 }
2485 return bSuitable;
2486 }
2487}
2488
2489// Change return type.
2490// Adjustments for drawing objects in header/footer:
2491// allow group, only if all selected objects are in the same header/footer
2492// or not in header/footer.
2494{
2495 bool bIsGroupAllowed = false;
2496 if ( IsObjSelected() > 1 )
2497 {
2498 bIsGroupAllowed = true;
2499 const SdrObject* pUpGroup = nullptr;
2500 const SwFrame* pHeaderFooterFrame = nullptr;
2501 const SdrMarkList &rMrkList = Imp()->GetDrawView()->GetMarkedObjectList();
2502 for ( size_t i = 0; bIsGroupAllowed && i < rMrkList.GetMarkCount(); ++i )
2503 {
2504 const SdrObject* pObj = rMrkList.GetMark( i )->GetMarkedSdrObj();
2505 if ( i )
2506 bIsGroupAllowed = pObj->getParentSdrObjectFromSdrObject() == pUpGroup;
2507 else
2508 pUpGroup = pObj->getParentSdrObjectFromSdrObject();
2509
2510 if ( bIsGroupAllowed )
2511 bIsGroupAllowed = HasSuitableGroupingAnchor(pObj);
2512
2513 // check, if all selected objects are in the
2514 // same header/footer or not in header/footer.
2515 if ( bIsGroupAllowed )
2516 {
2517 const SwFrame* pAnchorFrame = nullptr;
2518 if ( auto pVirtFlyDrawObj = dynamic_cast<const SwVirtFlyDrawObj*>( pObj) )
2519 {
2520 const SwFlyFrame* pFlyFrame = pVirtFlyDrawObj->GetFlyFrame();
2521 if ( pFlyFrame )
2522 {
2523 pAnchorFrame = pFlyFrame->GetAnchorFrame();
2524 }
2525 }
2526 else
2527 {
2528 SwDrawContact* pDrawContact = static_cast<SwDrawContact*>(GetUserCall( pObj ));
2529 if ( pDrawContact )
2530 {
2531 pAnchorFrame = pDrawContact->GetAnchorFrame( pObj );
2532 }
2533 }
2534 if ( pAnchorFrame )
2535 {
2536 if ( i )
2537 {
2538 bIsGroupAllowed =
2539 ( pAnchorFrame->FindFooterOrHeader() == pHeaderFooterFrame );
2540 }
2541 else
2542 {
2543 pHeaderFooterFrame = pAnchorFrame->FindFooterOrHeader();
2544 }
2545 }
2546 }
2547 }
2548 }
2549
2550 return bIsGroupAllowed;
2551}
2552
2554{
2555 bool bIsUnGroupAllowed = false;
2556
2557 const SdrMarkList &rMrkList = Imp()->GetDrawView()->GetMarkedObjectList();
2558 for (size_t i = 0; i < rMrkList.GetMarkCount(); ++i)
2559 {
2560 const SdrObject* pObj = rMrkList.GetMark(i)->GetMarkedSdrObj();
2561 bIsUnGroupAllowed = HasSuitableGroupingAnchor(pObj);
2562 if (!bIsUnGroupAllowed)
2563 break;
2564 }
2565
2566 return bIsUnGroupAllowed;
2567}
2568
2569// The group gets the anchor and the contactobject of the first in the selection
2571{
2572 if ( IsGroupAllowed() )
2573 {
2576
2578
2580 EndAllAction();
2581 }
2582}
2583
2584// The individual objects get a copy of the anchor and the contactobject of the group
2586{
2587 if ( IsGroupSelected(true) )
2588 {
2591
2593
2595 EndAllAction();
2596 }
2597}
2598
2599void SwFEShell::MirrorSelection( bool bHorizontal )
2600{
2601 SdrView *pView = Imp()->GetDrawView();
2602 if ( IsObjSelected() && pView->IsMirrorAllowed() )
2603 {
2604 if ( bHorizontal )
2606 else
2607 pView->MirrorAllMarkedVertical();
2608 }
2609}
2610
2611// jump to named frame (Graphic/OLE)
2612
2613bool SwFEShell::GotoFly( const OUString& rName, FlyCntType eType, bool bSelFrame )
2614{
2615 bool bRet = false;
2616 static SwNodeType const aChkArr[ 4 ] = {
2617 /* FLYCNTTYPE_ALL */ SwNodeType::NONE,
2618 /* FLYCNTTYPE_FRM */ SwNodeType::Text,
2619 /* FLYCNTTYPE_GRF */ SwNodeType::Grf,
2620 /* FLYCNTTYPE_OLE */ SwNodeType::Ole
2621 };
2622
2623 const SwFlyFrameFormat* pFlyFormat = mxDoc->FindFlyByName( rName, aChkArr[ eType]);
2624 if( pFlyFormat )
2625 {
2626 CurrShell aCurr( this );
2627
2628 SwFlyFrame* pFrame = SwIterator<SwFlyFrame,SwFormat>( *pFlyFormat ).First();
2629 if( pFrame )
2630 {
2631 if( bSelFrame )
2632 {
2633 // first make visible, to get a11y events in proper order
2634 if (!ActionPend())
2635 MakeVisible( pFrame->getFrameArea() );
2636 SelectObj( pFrame->getFrameArea().Pos(), 0, pFrame->GetVirtDrawObj() );
2637 }
2638 else
2639 {
2640 SwContentFrame *pCFrame = pFrame->ContainsContent();
2641 if ( pCFrame )
2642 {
2643 ClearMark();
2644 SwPaM* pCursor = GetCursor();
2645
2646 if (pCFrame->IsTextFrame())
2647 {
2648 *pCursor->GetPoint() = static_cast<SwTextFrame *>(pCFrame)
2649 ->MapViewToModelPos(TextFrameIndex(0));
2650 }
2651 else
2652 {
2653 assert(pCFrame->IsNoTextFrame());
2654 SwContentNode *const pCNode = static_cast<SwNoTextFrame *>(pCFrame)->GetNode();
2655
2656 pCursor->GetPoint()->Assign(*pCNode);
2657 }
2658
2659 SwRect& rChrRect = const_cast<SwRect&>(GetCharRect());
2660 rChrRect = pFrame->getFramePrintArea();
2661 rChrRect.Pos() += pFrame->getFrameArea().Pos();
2662 GetCursorDocPos() = rChrRect.Pos();
2663 }
2664 }
2665 bRet = true;
2666 }
2667 }
2668 return bRet;
2669}
2670
2671size_t SwFEShell::GetFlyCount( FlyCntType eType, bool bIgnoreTextBoxes ) const
2672{
2673 return GetDoc()->GetFlyCount(eType, bIgnoreTextBoxes);
2674}
2675
2676const SwFrameFormat* SwFEShell::GetFlyNum(size_t nIdx, FlyCntType eType, bool bIgnoreTextBoxes ) const
2677{
2678 return GetDoc()->GetFlyNum(nIdx, eType, bIgnoreTextBoxes);
2679}
2680
2681std::vector<SwFrameFormat const*> SwFEShell::GetFlyFrameFormats(
2682 FlyCntType const eType, bool const bIgnoreTextBoxes)
2683{
2684 return GetDoc()->GetFlyFrameFormats(eType, bIgnoreTextBoxes);
2685}
2686
2687// show the current selected object
2689{
2690 if ( Imp()->HasDrawView() &&
2691 Imp()->GetDrawView()->GetMarkedObjectList().GetMarkCount() )
2692 {
2693 GetCurrFrame(); // just to trigger formatting in case the selected object is not formatted.
2694 MakeVisible( SwRect(Imp()->GetDrawView()->GetAllMarkedRect()) );
2695 }
2696 else
2698}
2699
2700// how is the selected object protected?
2702{
2704 const bool bParent(eType & FlyProtectFlags::Parent);
2705 if( Imp()->HasDrawView() )
2706 {
2707 const SdrMarkList &rMrkList = Imp()->GetDrawView()->GetMarkedObjectList();
2708 for( size_t i = rMrkList.GetMarkCount(); i; )
2709 {
2710 SdrObject *pObj = rMrkList.GetMark( --i )->GetMarkedSdrObj();
2711 if (!pObj)
2712 {
2713 continue;
2714 }
2715
2716 if( !bParent )
2717 {
2720
2721 if (SwVirtFlyDrawObj* pVirtO = dynamic_cast<SwVirtFlyDrawObj*>(pObj))
2722 {
2723 SwFlyFrame *pFly = pVirtO->GetFlyFrame();
2726
2727 if ( pFly->Lower() && pFly->Lower()->IsNoTextFrame() )
2728 {
2729 SwOLENode *pNd = static_cast<SwNoTextFrame*>(pFly->Lower())->GetNode()->GetOLENode();
2730 uno::Reference < embed::XEmbeddedObject > xObj( pNd ? pNd->GetOLEObj().GetOleRef() : nullptr );
2731 if ( xObj.is() )
2732 {
2733 // TODO/LATER: use correct aspect
2734 const bool bNeverResize = (embed::EmbedMisc::EMBED_NEVERRESIZE & xObj->getStatus( embed::Aspects::MSOLE_CONTENT ));
2735 if ( ( (FlyProtectFlags::Content & eType) || (FlyProtectFlags::Size & eType) ) && bNeverResize )
2736 {
2737 nChk |= FlyProtectFlags::Size;
2738 nChk |= FlyProtectFlags::Fixed;
2739 }
2740
2741 // set FlyProtectFlags::Pos if it is a Math object anchored 'as char' and baseline alignment is activated
2742 const bool bProtectMathPos = SotExchange::IsMath( xObj->getClassID() )
2743 && RndStdIds::FLY_AS_CHAR == pFly->GetFormat()->GetAnchor().GetAnchorId()
2744 && mxDoc->GetDocumentSettingManager().get( DocumentSettingId::MATH_BASELINE_ALIGNMENT );
2745 if ((FlyProtectFlags::Pos & eType) && bProtectMathPos)
2746 nChk |= FlyProtectFlags::Pos;
2747 }
2748 }
2749 }
2750 nChk &= eType;
2751 if( nChk == eType )
2752 return eType;
2753 }
2754 const SwFrame* pAnch;
2755 if (SwVirtFlyDrawObj* pVirtO = dynamic_cast<SwVirtFlyDrawObj*>(pObj))
2756 pAnch = pVirtO->GetFlyFrame()->GetAnchorFrame();
2757 else
2758 {
2759 SwDrawContact* pTmp = static_cast<SwDrawContact*>(GetUserCall(pObj));
2760 pAnch = pTmp ? pTmp->GetAnchorFrame( pObj ) : nullptr;
2761 }
2762 if( pAnch && pAnch->IsProtected() )
2763 return eType;
2764 }
2765 }
2766 return nChk;
2767}
2768
2770{
2771 if ( !IsObjSelected() )
2772 return false;
2773
2774 const SdrMarkList &rMrkList = Imp()->GetDrawView()->GetMarkedObjectList();
2775 for ( size_t i = 0; i < rMrkList.GetMarkCount(); ++i )
2776 {
2777 SdrObject *pObj = rMrkList.GetMark( i )->GetMarkedSdrObj();
2778 SwDrawContact *pContact = static_cast<SwDrawContact*>(GetUserCall(pObj));
2779 // --> make code robust
2780 OSL_ENSURE( pContact, "<SwFEShell::GetObjAttr(..)> - missing <pContact>." );
2781 if ( pContact )
2782 {
2783 if ( i )
2784 rSet.MergeValues( pContact->GetFormat()->GetAttrSet() );
2785 else
2786 rSet.Put( pContact->GetFormat()->GetAttrSet() );
2787 }
2788 }
2789 return true;
2790}
2791
2793{
2794 CurrShell aCurr( this );
2795
2796 if ( !rSet.Count() )
2797 {
2798 OSL_ENSURE( false, "SetObjAttr, empty set." );
2799 return;
2800 }
2801
2804
2805 const SdrMarkList &rMrkList = Imp()->GetDrawView()->GetMarkedObjectList();
2806 for ( size_t i = 0; i < rMrkList.GetMarkCount(); ++i )
2807 {
2808 SdrObject *pObj = rMrkList.GetMark( i )->GetMarkedSdrObj();
2809 SwDrawContact *pContact = static_cast<SwDrawContact*>(GetUserCall(pObj));
2810 GetDoc()->SetAttr( rSet, *pContact->GetFormat() );
2811 }
2812
2816}
2817
2819{
2820 return Imp()->GetDrawView()->IsAlignPossible();
2821}
2822
2824{
2825 CurrShell aCurr( this );
2826
2827 const SdrMarkList &rMrkList = Imp()->GetDrawView()->GetMarkedObjectList();
2828 for ( size_t i = 0; i < rMrkList.GetMarkCount(); ++i )
2829 {
2830 SdrObject *pObj = rMrkList.GetMark( i )->GetMarkedSdrObj();
2831 if ( !GetUserCall(pObj) )
2832 {
2833 const tools::Rectangle &rBound = pObj->GetSnapRect();
2834 const Point aPt( rBound.TopLeft() );
2835 const SwFrame *pPage = GetLayout()->Lower();
2836 const SwFrame *pLast = pPage;
2837 while ( pPage && !pPage->getFrameArea().Contains( aPt ) )
2838 {
2839 if ( aPt.Y() > pPage->getFrameArea().Bottom() )
2840 pLast = pPage;
2841 pPage = pPage->GetNext();
2842 }
2843 if ( !pPage )
2844 pPage = pLast;
2845 OSL_ENSURE( pPage, "Page not found." );
2846
2847 SwFormatAnchor aAnch;
2848 {
2849 const SwContentFrame *const pAnch = ::FindAnchor(pPage, aPt, true);
2850 SwPosition aPos( pAnch->IsTextFrame()
2851 ? *static_cast<SwTextFrame const*>(pAnch)->GetTextNodeForParaProps()
2852 : *static_cast<SwNoTextFrame const*>(pAnch)->GetNode() );
2853 aAnch.SetType( RndStdIds::FLY_AT_PARA );
2854 aAnch.SetAnchor( &aPos );
2855 const_cast<SwRect&>(GetCharRect()).Pos() = aPt;
2856 }
2857
2858 // First the action here, to assure GetCharRect delivers current values.
2860
2863 aSet.Put( aAnch );
2864 aSet.Put( SwFormatSurround( css::text::WrapTextMode_THROUGH ) );
2865 SwFrameFormat* pFormat = getIDocumentLayoutAccess().MakeLayoutFormat( RndStdIds::DRAW_OBJECT, &aSet );
2866
2867 SwDrawContact *pContact = new SwDrawContact(
2868 static_cast<SwDrawFrameFormat*>(pFormat), pObj );
2869
2870 // #i35635#
2871 pContact->MoveObjToVisibleLayer( pObj );
2872 pContact->ConnectToLayout();
2873
2874 EndAllAction();
2875 }
2876 }
2877}
2878
2880{
2881 GetDoc()->SetCalcFieldValueHdl(pOutliner);
2882}
2883
2885 const Point &rPt ) const
2886{
2887 rRect.Clear();
2888
2889 // The source is not allowed to have a follow.
2890 const SwFormatChain &rChain = rSource.GetChain();
2891 if ( rChain.GetNext() )
2893
2895 if( Imp()->HasDrawView() )
2896 {
2897 SdrPageView* pPView;
2898 SwDrawView *pDView = const_cast<SwDrawView*>(Imp()->GetDrawView());
2899 const auto nOld = pDView->GetHitTolerancePixel();
2900 pDView->SetHitTolerancePixel( 0 );
2901 SdrObject* pObj = pDView->PickObj(rPt, pDView->getHitTolLog(), pPView, SdrSearchOptions::PICKMARKABLE);
2902 SwVirtFlyDrawObj* pDrawObj = dynamic_cast<SwVirtFlyDrawObj*>(pObj);
2903 if (pDrawObj)
2904 {
2905 SwFlyFrame *pFly = pDrawObj->GetFlyFrame();
2906 rRect = pFly->getFrameArea();
2907
2908 // Target and source should not be equal and the list
2909 // should not be cyclic
2910 SwFrameFormat *pFormat = pFly->GetFormat();
2911 nRet = GetDoc()->Chainable(rSource, *pFormat);
2912 }
2913 pDView->SetHitTolerancePixel( nOld );
2914 }
2915 return nRet;
2916}
2917
2918void SwFEShell::Chain( SwFrameFormat &rSource, const SwFrameFormat &rDest )
2919{
2920 GetDoc()->Chain(rSource, rDest);
2921}
2922
2923SwChainRet SwFEShell::Chain( SwFrameFormat &rSource, const Point &rPt )
2924{
2925 SwRect aDummy;
2926 SwChainRet nErr = Chainable( aDummy, rSource, rPt );
2927 if ( nErr == SwChainRet::OK )
2928 {
2930 SdrPageView* pPView;
2931 SwDrawView *pDView = Imp()->GetDrawView();
2932 const auto nOld = pDView->GetHitTolerancePixel();
2933 pDView->SetHitTolerancePixel( 0 );
2934 SdrObject* pObj = pDView->PickObj(rPt, pDView->getHitTolLog(), pPView, SdrSearchOptions::PICKMARKABLE);
2935 pDView->SetHitTolerancePixel( nOld );
2936 SwFlyFrame *pFly = static_cast<SwVirtFlyDrawObj*>(pObj)->GetFlyFrame();
2937
2938 SwFlyFrameFormat *pFormat = pFly->GetFormat();
2939 GetDoc()->Chain(rSource, *pFormat);
2940 EndAllAction();
2942 }
2943 return nErr;
2944}
2945
2947{
2949 GetDoc()->Unchain(rFormat);
2950 EndAllAction();
2951}
2952
2954{
2955 m_pChainFrom.reset();
2956 m_pChainTo.reset();
2957}
2958
2960{
2961 bool bDelFrom = true,
2962 bDelTo = true;
2963 if ( IsFrameSelected() )
2964 {
2966
2967 if ( pFly->GetPrevLink() )
2968 {
2969 bDelFrom = false;
2970 const SwFrame *pPre = pFly->GetPrevLink();
2971
2972 Point aStart( pPre->getFrameArea().Right(), pPre->getFrameArea().Bottom());
2973 Point aEnd(pFly->getFrameArea().Pos());
2974
2975 if (!m_pChainFrom)
2976 {
2977 m_pChainFrom.reset(
2978 new SdrDropMarkerOverlay( *GetDrawView(), aStart, aEnd ));
2979 }
2980 }
2981 if ( pFly->GetNextLink() )
2982 {
2983 bDelTo = false;
2984 const SwFlyFrame *pNxt = pFly->GetNextLink();
2985
2986 Point aStart( pFly->getFrameArea().Right(), pFly->getFrameArea().Bottom());
2987 Point aEnd(pNxt->getFrameArea().Pos());
2988
2989 if (!m_pChainTo)
2990 {
2991 m_pChainTo.reset(
2992 new SdrDropMarkerOverlay( *GetDrawView(), aStart, aEnd ));
2993 }
2994 }
2995 }
2996
2997 if ( bDelFrom )
2998 {
2999 m_pChainFrom.reset();
3000 }
3001
3002 if ( bDelTo )
3003 {
3004 m_pChainTo.reset();
3005 }
3006}
3007
3009{
3010 SwFrame *pFrame = GetCurrFrame();
3011 // Is the cursor at this moment in a SectionFrame?
3012 if( pFrame && pFrame->IsInSct() )
3013 {
3014 SwSectionFrame* pSect = pFrame->FindSctFrame();
3015 do
3016 {
3017 // Is it the right one?
3018 if( pSect->KnowsFormat( rFormat ) )
3019 return pSect->getFrameArea().Width();
3020 // for nested areas
3021 pSect = pSect->GetUpper()->FindSctFrame();
3022 }
3023 while( pSect );
3024 }
3025 SwIterator<SwSectionFrame,SwFormat> aIter( rFormat );
3026 for ( SwSectionFrame* pSct = aIter.First(); pSct; pSct = aIter.Next() )
3027 {
3028 if( !pSct->IsFollow() )
3029 {
3030 return pSct->getFrameArea().Width();
3031 }
3032 }
3033 return 0;
3034}
3035
3037 sal_uInt16 nSlotId)
3038{
3039 SdrView* pDrawView = GetDrawView();
3040 SdrModel* pDrawModel = pDrawView->GetModel();
3042 *pDrawModel,
3043 SdrInventor::Default,
3044 eSdrObjectKind);
3045
3046 if(pObj)
3047 {
3048 tools::Rectangle aRect(rRect);
3049 if(SdrObjKind::CircleArc == eSdrObjectKind || SdrObjKind::CircleCut == eSdrObjectKind)
3050 {
3051 // force quadratic
3052 if(aRect.GetWidth() > aRect.GetHeight())
3053 {
3054 aRect = tools::Rectangle(
3055 Point(aRect.Left() + ((aRect.GetWidth() - aRect.GetHeight()) / 2), aRect.Top()),
3056 Size(aRect.GetHeight(), aRect.GetHeight()));
3057 }
3058 else
3059 {
3060 aRect = tools::Rectangle(
3061 Point(aRect.Left(), aRect.Top() + ((aRect.GetHeight() - aRect.GetWidth()) / 2)),
3062 Size(aRect.GetWidth(), aRect.GetWidth()));
3063 }
3064 }
3065 pObj->SetLogicRect(aRect);
3066
3067 Point aStart = aRect.TopLeft();
3068 Point aEnd = aRect.BottomRight();
3069
3070 if(dynamic_cast<const SdrCircObj*>( pObj.get()) != nullptr)
3071 {
3072 SfxItemSet aAttr(pDrawModel->GetItemPool());
3073 aAttr.Put(makeSdrCircStartAngleItem(9000_deg100));
3074 aAttr.Put(makeSdrCircEndAngleItem(0_deg100));
3075 pObj->SetMergedItemSet(aAttr);
3076 }
3077 else if(auto pPathObj = dynamic_cast<SdrPathObj*>( pObj.get()))
3078 {
3080
3081 switch(eSdrObjectKind)
3082 {
3083 case SdrObjKind::PathLine:
3084 case SdrObjKind::PathFill:
3085 {
3086 basegfx::B2DPolygon aInnerPoly;
3087
3088 aInnerPoly.append(basegfx::B2DPoint(aRect.Left(), aRect.Bottom()));
3089
3090 const basegfx::B2DPoint aCenterBottom(aRect.Center().getX(), aRect.Bottom());
3091 aInnerPoly.appendBezierSegment(
3092 aCenterBottom,
3093 aCenterBottom,
3094 basegfx::B2DPoint(aRect.Center().getX(), aRect.Center().getY()));
3095
3096 const basegfx::B2DPoint aCenterTop(aRect.Center().getX(), aRect.Top());
3097 aInnerPoly.appendBezierSegment(
3098 aCenterTop,
3099 aCenterTop,
3100 basegfx::B2DPoint(aRect.Right(), aRect.Top()));
3101
3102 aInnerPoly.setClosed(true);
3103 aPoly.append(aInnerPoly);
3104 }
3105 break;
3106 case SdrObjKind::FreehandLine:
3107 case SdrObjKind::FreehandFill:
3108 {
3109 basegfx::B2DPolygon aInnerPoly;
3110
3111 aInnerPoly.append(basegfx::B2DPoint(aRect.Left(), aRect.Bottom()));
3112
3113 aInnerPoly.appendBezierSegment(
3114 basegfx::B2DPoint(aRect.Left(), aRect.Top()),
3115 basegfx::B2DPoint(aRect.Center().getX(), aRect.Top()),
3116 basegfx::B2DPoint(aRect.Center().getX(), aRect.Center().getY()));
3117
3118 aInnerPoly.appendBezierSegment(
3119 basegfx::B2DPoint(aRect.Center().getX(), aRect.Bottom()),
3120 basegfx::B2DPoint(aRect.Right(), aRect.Bottom()),
3121 basegfx::B2DPoint(aRect.Right(), aRect.Top()));
3122
3123 aInnerPoly.append(basegfx::B2DPoint(aRect.Right(), aRect.Bottom()));
3124 aInnerPoly.setClosed(true);
3125 aPoly.append(aInnerPoly);
3126 }
3127 break;
3128 case SdrObjKind::Polygon:
3129 case SdrObjKind::PolyLine:
3130 {
3131 basegfx::B2DPolygon aInnerPoly;
3132 sal_Int32 nWdt(aRect.GetWidth());
3133 sal_Int32 nHgt(aRect.GetHeight());
3134
3135 aInnerPoly.append(basegfx::B2DPoint(aRect.Left(), aRect.Bottom()));
3136 aInnerPoly.append(basegfx::B2DPoint(aRect.Left() + (nWdt * 30) / 100, aRect.Top() + (nHgt * 70) / 100));
3137 aInnerPoly.append(basegfx::B2DPoint(aRect.Left(), aRect.Top() + (nHgt * 15) / 100));
3138 aInnerPoly.append(basegfx::B2DPoint(aRect.Left() + (nWdt * 65) / 100, aRect.Top()));
3139 aInnerPoly.append(basegfx::B2DPoint(aRect.Left() + nWdt, aRect.Top() + (nHgt * 30) / 100));
3140 aInnerPoly.append(basegfx::B2DPoint(aRect.Left() + (nWdt * 80) / 100, aRect.Top() + (nHgt * 50) / 100));
3141 aInnerPoly.append(basegfx::B2DPoint(aRect.Left() + (nWdt * 80) / 100, aRect.Top() + (nHgt * 75) / 100));
3142 aInnerPoly.append(basegfx::B2DPoint(aRect.Bottom(), aRect.Right()));
3143
3144 if(SdrObjKind::PolyLine == eSdrObjectKind)
3145 {
3146 aInnerPoly.append(basegfx::B2DPoint(aRect.Center().getX(), aRect.Bottom()));
3147 }
3148 else
3149 {
3150 aInnerPoly.setClosed(true);
3151 }
3152
3153 aPoly.append(aInnerPoly);
3154 }
3155 break;
3156 case SdrObjKind::Line :
3157 {
3158 sal_Int32 nYMiddle((aRect.Top() + aRect.Bottom()) / 2);
3159 basegfx::B2DPolygon aTempPoly;
3160 aTempPoly.append(basegfx::B2DPoint(aRect.TopLeft().getX(), nYMiddle));
3161 aTempPoly.append(basegfx::B2DPoint(aRect.BottomRight().getX(), nYMiddle));
3162 aPoly.append(aTempPoly);
3163
3164 SfxItemSet aAttr(pObj->getSdrModelFromSdrObject().GetItemPool());
3165 SetLineEnds(aAttr, *pObj, nSlotId);
3166 pObj->SetMergedItemSet(aAttr);
3167 }
3168 break;
3169 default:
3170 break;
3171 }
3172
3173 pPathObj->SetPathPoly(aPoly);
3174 }
3175 else if(auto pMeasureObj = dynamic_cast<SdrMeasureObj*>( pObj.get()))
3176 {
3177 sal_Int32 nYMiddle((aRect.Top() + aRect.Bottom()) / 2);
3178 pMeasureObj->SetPoint(Point(aStart.X(), nYMiddle), 0);
3179 pMeasureObj->SetPoint(Point(aEnd.X(), nYMiddle), 1);
3180
3181 SfxItemSet aAttr(pObj->getSdrModelFromSdrObject().GetItemPool());
3182 SetLineEnds(aAttr, *pObj, nSlotId);
3183 pObj->SetMergedItemSet(aAttr);
3184 }
3185 else if(auto pCaptionObj = dynamic_cast<SdrCaptionObj*>( pObj.get()))
3186 {
3187 bool bVerticalText = ( SID_DRAW_TEXT_VERTICAL == nSlotId ||
3188 SID_DRAW_CAPTION_VERTICAL == nSlotId );
3189 pCaptionObj->SetVerticalWriting(bVerticalText);
3190 if(bVerticalText)
3191 {
3192 SfxItemSet aSet(pObj->GetMergedItemSet());
3195 pObj->SetMergedItemSet(aSet);
3196 }
3197
3198 pCaptionObj->SetLogicRect(aRect);
3199 pCaptionObj->SetTailPos(
3200 aRect.TopLeft() - Point(aRect.GetWidth() / 2, aRect.GetHeight() / 2));
3201 }
3202 else if(auto pText = DynCastSdrTextObj( pObj.get()))
3203 {
3204 pText->SetLogicRect(aRect);
3205
3206 bool bVertical = (SID_DRAW_TEXT_VERTICAL == nSlotId);
3207 bool bMarquee = (SID_DRAW_TEXT_MARQUEE == nSlotId);
3208
3209 pText->SetVerticalWriting(bVertical);
3210
3211 if(bVertical)
3212 {
3213 SfxItemSet aSet(pDrawModel->GetItemPool());
3218 pText->SetMergedItemSet(aSet);
3219 }
3220
3221 if(bMarquee)
3222 {
3224 aSet.Put( makeSdrTextAutoGrowWidthItem( false ) );
3225 aSet.Put( makeSdrTextAutoGrowHeightItem( false ) );
3226 aSet.Put( SdrTextAniKindItem( SdrTextAniKind::Slide ) );
3227 aSet.Put( SdrTextAniDirectionItem( SdrTextAniDirection::Left ) );
3228 aSet.Put( SdrTextAniCountItem( 1 ) );
3229 aSet.Put( SdrTextAniAmountItem( static_cast<sal_Int16>(GetWin()->PixelToLogic(Size(2,1)).Width())) );
3230 pObj->SetMergedItemSetAndBroadcast(aSet);
3231 }
3232 }
3233 SdrPageView* pPageView = pDrawView->GetSdrPageView();
3234 SdrCreateView::SetupObjLayer(pPageView, pDrawView->GetActiveLayer(), pObj.get());
3235 // switch undo off or this combined with ImpEndCreate will cause two undos
3236 // see comment made in SwFEShell::EndCreate (we create our own undo-object!)
3237 const bool bUndo(GetDoc()->GetIDocumentUndoRedo().DoesUndo());
3238 GetDoc()->GetIDocumentUndoRedo().DoUndo(false);
3239 pDrawView->InsertObjectAtView(pObj.get(), *pPageView);
3240 GetDoc()->GetIDocumentUndoRedo().DoUndo(bUndo);
3241 }
3242 ImpEndCreate();
3243}
3244
3255{
3256 Color aRetColor;
3257
3258 // check, if a draw view exists
3259 OSL_ENSURE( Imp()->GetDrawView(), "wrong usage of SwFEShell::GetShapeBackground - no draw view!");
3260 if( Imp()->GetDrawView() )
3261 {
3262 // determine list of selected objects
3263 const SdrMarkList* pMrkList = &Imp()->GetDrawView()->GetMarkedObjectList();
3264 // check, if exactly one object is selected.
3265 OSL_ENSURE( pMrkList->GetMarkCount() == 1, "wrong usage of SwFEShell::GetShapeBackground - no selected object!");
3266 if ( pMrkList->GetMarkCount() == 1)
3267 {
3268 // get selected object
3269 const SdrObject *pSdrObj = pMrkList->GetMark( 0 )->GetMarkedSdrObj();
3270 // check, if selected object is a shape (drawing object)
3271 OSL_ENSURE( dynamic_cast<const SwVirtFlyDrawObj*>( pSdrObj) == nullptr, "wrong usage of SwFEShell::GetShapeBackground - selected object is not a drawing object!");
3272 if ( dynamic_cast<const SwVirtFlyDrawObj*>( pSdrObj) == nullptr )
3273 {
3274 // determine page frame of the frame the shape is anchored.
3275 const SwFrame* pAnchorFrame =
3276 static_cast<SwDrawContact*>(GetUserCall(pSdrObj))->GetAnchorFrame( pSdrObj );
3277 OSL_ENSURE( pAnchorFrame, "inconsistent model - no anchor at shape!");
3278 if ( pAnchorFrame )
3279 {
3280 const SwPageFrame* pPageFrame = pAnchorFrame->FindPageFrame();
3281 OSL_ENSURE( pPageFrame, "inconsistent model - no page!");
3282 if ( pPageFrame )
3283 {
3284 aRetColor = pPageFrame->GetDrawBackgroundColor();
3285 }
3286 }
3287 }
3288 }
3289 }
3290
3291 return aRetColor;
3292}
3293
3303{
3304 bool bRet = false;
3305
3306 // check, if a draw view exists
3307 OSL_ENSURE( Imp()->GetDrawView(), "wrong usage of SwFEShell::GetShapeBackground - no draw view!");
3308 if( Imp()->GetDrawView() )
3309 {
3310 // determine list of selected objects
3311 const SdrMarkList* pMrkList = &Imp()->GetDrawView()->GetMarkedObjectList();
3312 // check, if exactly one object is selected.
3313 OSL_ENSURE( pMrkList->GetMarkCount() == 1, "wrong usage of SwFEShell::GetShapeBackground - no selected object!");
3314 if ( pMrkList->GetMarkCount() == 1)
3315 {
3316 // get selected object
3317 const SdrObject *pSdrObj = pMrkList->GetMark( 0 )->GetMarkedSdrObj();
3318 // check, if selected object is a shape (drawing object)
3319 OSL_ENSURE( dynamic_cast<const SwVirtFlyDrawObj*>( pSdrObj) == nullptr, "wrong usage of SwFEShell::GetShapeBackground - selected object is not a drawing object!");
3320 if ( dynamic_cast<const SwVirtFlyDrawObj*>( pSdrObj) == nullptr )
3321 {
3322 // determine page frame of the frame the shape is anchored.
3323 const SwFrame* pAnchorFrame =
3324 static_cast<SwDrawContact*>(GetUserCall(pSdrObj))->GetAnchorFrame( pSdrObj );
3325 OSL_ENSURE( pAnchorFrame, "inconsistent model - no anchor at shape!");
3326 if ( pAnchorFrame )
3327 {
3328 const SwPageFrame* pPageFrame = pAnchorFrame->FindPageFrame();
3329 OSL_ENSURE( pPageFrame, "inconsistent model - no page!");
3330 if ( pPageFrame )
3331 {
3332 bRet = pPageFrame->IsRightToLeft();
3333 }
3334 }
3335 }
3336 }
3337 }
3338
3339 return bRet;
3340}
3341
3343{
3344 Point aRet(-1, -1);
3345 const SwFrame *pPage = GetLayout()->Lower();
3346 while ( pPage && !pPage->getFrameArea().Contains( rDocPos ) )
3347 {
3348 pPage = pPage->GetNext();
3349 }
3350 if(pPage)
3351 {
3352 aRet = rDocPos - pPage->getFrameArea().TopLeft();
3353 }
3354 return aRet;
3355}
3356
3357/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
o3tl::strong_int< sal_Int32, struct Tag_TextFrameIndex > TextFrameIndex
Denotes a character index in a text frame at a layout level, after extent mapping from a text node at...
virtual void MovAction(const Point &rPnt) override
virtual SwDrawModel * GetOrCreateDrawModel()=0
virtual SdrLayerID GetHellId() const =0
virtual const SwDrawModel * GetDrawModel() const =0
Draw Model and id accessors.
virtual SwFrameFormat * MakeLayoutFormat(RndStdIds eRequest, const SfxItemSet *pSet)=0
virtual void SetModified()=0
Must be called manually at changes of format.
SAL_WARN_UNUSED_RESULT Point PixelToLogic(const Point &rDevicePt) const
bool BegCreateObj(const Point &rPnt, OutputDevice *pOut=nullptr, short nMinMov=-3)
bool IsCreateObj() const
void SetEditMode(SdrViewEditMode eMode)
static void SetupObjLayer(const SdrPageView *pPageView, const OUString &aActiveLayer, SdrObject *pObj)
bool EndCreateObj(SdrCreateCmd eCmd)
void SetCurrentObj(SdrObjKind nIdent, SdrInventor nInvent=SdrInventor::Default)
virtual void TakeActionRect(tools::Rectangle &rRect) const override
bool BegCreateCaptionObj(const Point &rPnt, const Size &rObjSiz, OutputDevice *pOut=nullptr, short nMinMov=-3)
void BrkCreateObj()
void MovCreateObj(const Point &rPnt)
void SetShiftPressed(bool bShiftPressed)
const tools::Rectangle & GetActionRect() const
SdrDragMethod * GetDragMethod() const
bool EndDragObj(bool bCopy=false)
virtual bool BegDragObj(const Point &rPnt, OutputDevice *pOut, SdrHdl *pHdl, short nMinMov=-3, SdrDragMethod *pForcedMeth=nullptr)
void BrkDragObj()
bool IsInsObjPoint() const
void MovInsObjPoint(const Point &rPnt)
void MovDragObj(const Point &rPnt)
bool IsDragObj() const
void PutMarkedToTop()
void MirrorAllMarkedVertical()
void MovMarkedToTop()
bool InsertObjectAtView(SdrObject *pObj, SdrPageView &rPV, SdrInsertFlags nOptions=SdrInsertFlags::NONE)
void MirrorAllMarkedHorizontal()
void MovMarkedToBtm()
bool IsAlignPossible() const
void PutMarkedToBtm()
bool IsMirrorAllowed(bool b45Deg=false, bool b90Deg=false) const
size_t FindObject(const SdrObject *pObj) const
size_t GetMarkCount() const
SdrMark * GetMark(size_t nNum) const
void DeleteMark(size_t nNum)
void SetDragMode(SdrDragMode eMode)
SdrHdl * PickHandle(const Point &rPnt) const
bool EndMarkPoints()
bool IsObjMarked(SdrObject const *pObj) const
bool IsMarkPoints() const
const SdrMarkList & GetMarkedObjectList() const
bool IsMarkedObjHit(const Point &rPnt, short nTol=-2) const
bool AreObjectsMarked() const
void BegMarkObj(const Point &rPnt, bool bUnmark=false)
bool BegMarkPoints(const Point &rPnt, bool bUnmark=false)
SdrObject * PickObj(const Point &rPnt, short nTol, SdrPageView *&rpPV, SdrSearchOptions nOptions, SdrObject **ppRootObj, bool *pbHitPassDirect=nullptr) const
SdrDragMode GetDragMode() const
sal_uInt16 GetMarkHdlSizePixel() const
void MovMarkPoints(const Point &rPnt)
virtual bool HasMarkablePoints() const
void AdjustMarkHdl(SfxViewShell *pOtherShell=nullptr)
const tools::Rectangle & GetAllMarkedRect() const
bool EndMarkObj()
bool MarkObj(const Point &rPnt, short nTol=-2, bool bToggle=false, bool bDeep=false)
SdrObject * GetMarkedSdrObj() const
virtual void InsertPage(SdrPage *pPage, sal_uInt16 nPos=0xFFFF)
virtual rtl::Reference< SdrPage > AllocPage(bool bMasterPage)
XLineEndListRef GetLineEndList() const
const SfxItemPool & GetItemPool() const
const SdrPage * GetPage(sal_uInt16 nPgNum) const
SdrTextObj * GetTextEditObject() const
virtual SdrEndTextEditKind SdrEndTextEdit(bool bDontDeleteReally=false)
static rtl::Reference< SdrObject > MakeNewObject(SdrModel &rSdrModel, SdrInventor nInventor, SdrObjKind nObjIdentifier, const tools::Rectangle *pSnapRect=nullptr)
SdrObject * Next()
bool IsMore() const
SdrObject * GetObj(size_t nNum) const
size_t GetObjCount() const
void RecalcObjOrdNums()
virtual rtl::Reference< SdrObject > RemoveObject(size_t nObjNum)
virtual void Changed(const SdrObject &rObj, SdrUserCallType eType, const tools::Rectangle &rOldBoundRect)
sal_uInt32 GetOrdNumDirect() const
virtual void NbcSetAnchorPos(const Point &rPnt)
bool IsResizeProtect() const
SdrObjUserCall * GetUserCall() const
const Point & GetAnchorPos() const
void MakeNameUnique()
bool isDiagram() const
bool IsMoveProtect() const
virtual void NbcSetRelativePos(const Point &rPnt)
virtual SdrInventor GetObjInventor() const
sal_uInt32 GetOrdNum() const
virtual SdrObjList * GetSubList() const
bool Is3DObj() const
virtual const tools::Rectangle & GetCurrentBoundRect() const
SdrObjList * getParentSdrObjListFromSdrObject() const
SdrModel & getSdrModelFromSdrObject() const
virtual const tools::Rectangle & GetSnapRect() const
virtual const OUString & GetName() const
bool IsGroupObject() const
virtual SdrObjKind GetObjIdentifier() const
virtual const tools::Rectangle & GetLastBoundRect() const
SdrObject * getParentSdrObjectFromSdrObject() const
virtual SdrLayerID GetLayer() const
virtual void SetLayer(SdrLayerID nLayer)
SdrObject * GetCurrentGroup() const
sal_uInt16 GetHitTolerancePixel() const
SdrModel * GetModel() const
void SetHitTolerancePixel(sal_uInt16 nVal)
const SdrDragStat & GetDragStat() const
SdrPageView * GetSdrPageView() const
sal_uInt16 getHitTolLog() const
const OUString & GetActiveLayer() const
void UnmarkAll()
void MergeValues(const SfxItemSet &rSet)
sal_uInt16 Count() const
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
static void notifyOtherViews(const SfxViewShell *pThisView, int nType, std::string_view rKey, const OString &rPayload)
static sal_uInt16 IsMath(const SvGlobalName &rName)
bool IsContentProtected() const
static void SetSearchLabel(const SearchLabel &rSL)
wrapper class for the positioning of Writer fly frames and drawing objects
const SwFrame * GetAnchorFrame() const
SwFrame * AnchorFrame()
void ClearCharRectAndTopOfLine()
reset members <maLastCharRect> and <mnLastTopOfLine>
virtual SwFrameFormat & GetFrameFormat()=0
virtual const SwFlyFrame * DynCastFlyFrame() const
Base class for the following contact objects (frame + draw objects).
Definition: dcontact.hxx:67
virtual const SwAnchoredObject * GetAnchoredObj(const SdrObject *_pSdrObj) const =0
const SwNode & GetAnchorNode() const
Definition: dcontact.hxx:152
virtual const SdrObject * GetMaster() const =0
bool ObjAnchoredAtPage() const
Definition: dcontact.hxx:146
virtual void MoveObjToVisibleLayer(SdrObject *_pDrawObj)
method to move drawing object to corresponding visible layer
Definition: dcontact.cxx:210
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
SwContentFrame * GetNextContentFrame() const
Definition: cntfrm.hxx:119
SwTextFrame * FindMaster() const
Definition: flowfrm.cxx:737
SwContentFrame * getLayoutFrame(const SwRootFrame *, const SwPosition *pPos=nullptr, std::pair< Point, bool > const *pViewPosAndCalcFrame=nullptr) const
Definition: node.cxx:1230
bool IsReadOnlyAvailable() const
Definition: crsrsh.hxx:490
void StartAction()
Definition: crsrsh.cxx:226
const SwRect & GetCharRect() const
Definition: crsrsh.hxx:532
Point & GetCursorDocPos() const
Definition: crsrsh.hxx:919
int SetCursor(const Point &rPt, bool bOnlyText=false, bool bBlock=true)
Definition: crsrsh.cxx:761
SwCursor * GetCursor(bool bMakeTableCursor=true) const
Return pointer to the current shell cursor.
Definition: crsrsh.cxx:194
void EndAction(const bool bIdleEnd=false)
Definition: crsrsh.cxx:243
SwContentFrame * GetCurrFrame(const bool bCalcFrame=true) const
Get current frame in which the cursor is positioned.
Definition: crsrsh.cxx:2469
const Link< const SwFlyFrameFormat *, void > & GetFlyMacroLnk() const
Definition: crsrsh.hxx:496
virtual void MakeSelVisible()
show the current selected "object"
Definition: crsrsh.cxx:3089
void ClearMark()
Definition: crsrsh.cxx:939
void CallChgLnk()
Definition: crsrsh.cxx:2544
void KillPams()
Definition: crsrsh.cxx:1022
SwChainRet Chainable(const SwFrameFormat &rSource, const SwFrameFormat &rDest)
Definition: docfly.cxx:1004
IDocumentState const & getIDocumentState() const
Definition: doc.cxx:400
SwChainRet Chain(SwFrameFormat &rSource, const SwFrameFormat &rDest)
Definition: docfly.cxx:1101
SwFrameFormat * GetFlyNum(size_t nIdx, FlyCntType eType, bool bIgnoreTextBoxes=false)
Definition: docfly.cxx:115
void Unchain(SwFrameFormat &rFormat)
Definition: docfly.cxx:1144
void SetAttr(const SfxPoolItem &, SwFormat &)
Set attribute in given format.1y If Undo is enabled, the old values is added to the Undo history.
Definition: docfmt.cxx:452
std::vector< SwFrameFormat const * > GetFlyFrameFormats(FlyCntType eType, bool bIgnoreTextBoxes)
Definition: docfly.cxx:159
IDocumentUndoRedo & GetIDocumentUndoRedo()
Definition: doc.cxx:150
size_t GetFlyCount(FlyCntType eType, bool bIgnoreTextBoxes=false) const
Access to frames.
Definition: docfly.cxx:68
SwDrawContact * GroupSelection(SdrView &)
Definition: docdraw.cxx:182
void UnGroupSelection(SdrView &)
Definition: docdraw.cxx:327
void SetCalcFieldValueHdl(Outliner *pOutliner)
In the Outliner, set a link to the method for field display in edit objects.
Definition: docdraw.cxx:540
bool IsInHeaderFooter(const SwNode &) const
Definition: doclay.cxx:1566
ContactObject for connection of formats as representatives of draw objects in SwClient and the object...
Definition: dcontact.hxx:305
const SwFrame * GetAnchorFrame(const SdrObject *_pDrawObj=nullptr) const
Definition: dcontact.cxx:804
void ConnectToLayout(const SwFormatAnchor *pAnch=nullptr)
Inserts SdrObject in the arrays of the layout ((SwPageFrame and SwFrame).
Definition: dcontact.cxx:1796
SdrObject * GetDrawObjectByAnchorFrame(const SwFrame &_rAnchorFrame)
get drawing object ('master' or 'virtual') by frame.
Definition: dcontact.cxx:857
virtual void SetPositionLayoutDir(const sal_Int16 _nPositionLayoutDir) override
Definition: atrfrm.cxx:3519
void PosAttrSet()
Definition: frmfmt.hxx:427
virtual void MarkListHasChanged() override
Definition: dview.cxx:775
virtual void DeleteMarked() override
Definition: dview.cxx:960
void ShowDragAnchor()
Definition: dview.cxx:762
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
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 DoesUndo() const
Definition: edws.cxx:203
SwUndoId EndUndo(SwUndoId eUndoId=SwUndoId::EMPTY, const SwRewriter *pRewriter=nullptr)
Closes parenthesis of nUndoId, not used by UI.
Definition: edws.cxx:234
void EndAllAction()
Definition: edws.cxx:97
SwFlyFrame * GetSelectedFlyFrame() const
Definition: fefly1.cxx:277
void Unchain(SwFrameFormat &rFormat)
Definition: feshview.cxx:2946
void Drag(const Point *pPt, bool bProp)
Definition: feshview.cxx:733
void SelectionToHell()
Below document.
Definition: feshview.cxx:1240
void SetObjAttr(const SfxItemSet &rSet)
Definition: feshview.cxx:2792
Point GetAnchorObjDiff() const
Methods for status line.
Definition: feshview.cxx:2403
FlyProtectFlags IsSelObjProtected(FlyProtectFlags eType) const
Which Protection is set at selected object?
Definition: feshview.cxx:2701
std::vector< SwFrameFormat const * > GetFlyFrameFormats(FlyCntType eType, bool bIgnoreTextBoxes)
Definition: feshview.cxx:2681
SdrDragMode GetDragMode() const
Definition: feshview.cxx:673
void HideChainMarker()
Definition: feshview.cxx:2953
bool IsObjSameLevelWithMarked(const SdrObject *pObj) const
Definition: feshview.cxx:1293
RndStdIds GetAnchorId() const
Anchor type of selected object, RndStdIds::UNKNOWN if ambiguous or in case of frame selection.
Definition: feshview.cxx:2329
SAL_DLLPRIVATE bool ImpEndCreate()
Definition: feshview.cxx:1865
bool BeginMark(const Point &rPos)
Functions for Rubberbox, it selects Draw-Objects.
Definition: feshview.cxx:2233
bool ShouldObjectBeSelected(const Point &rPt)
Test if there is a draw object at that position and if it should be selected.
Definition: feshview.cxx:1413
const SwFrameFormat * SelFlyGrabCursor()
If a fly is selected, it draws cursor into the first ContentFrame.
Definition: feshview.cxx:794
void SelectionToHeaven()
Above document.
Definition: feshview.cxx:1235
bool IsFrameSelected() const
Definition: feshview.cxx:1253
void GroupSelection()
Afterwards the group is selected.
Definition: feshview.cxx:2570
bool GotoObj(bool bNext, GotoObjFlags eType=GotoObjFlags::DrawAny)
Definition: feshview.cxx:1750
bool EndMark()
Definition: feshview.cxx:2272
Size GetObjSize() const
Definition: feshview.cxx:2390
bool IsRotationOfSwGrfNodePossible() const
Definition: feshview.cxx:1270
void EndDrag()
Definition: feshview.cxx:745
const SwFrameFormat * GetFlyNum(size_t nIdx, FlyCntType eType, bool bIgnoreTextBoxes=false) const
Definition: feshview.cxx:2676
virtual void MakeSelVisible() override
Show current selection (frame / draw object as required).
Definition: feshview.cxx:2688
bool MoveAnchor(SwMove nDir)
Definition: feshview.cxx:364
FrameTypeFlags GetSelFrameType() const
Definition: feshview.cxx:606
void SelectionToTop(bool bTop=true)
Move selection upwards or downwards (Z-Order).
Definition: feshview.cxx:1048
void SelectionToBottom(bool bBottom=true)
Definition: feshview.cxx:1117
bool IsObjSelectable(const Point &rPt)
The following two methods return enum SdrHdlKind.
Definition: feshview.cxx:1378
void ChgAnchor(RndStdIds eAnchorId, bool bSameOnly=false, bool bPosCorr=true)
frmatr.hxx.
Definition: feshview.cxx:2359
SAL_DLLPRIVATE void EndAllActionAndCall()
Terminate actions for all shells and call ChangeLink.
Definition: fews.cxx:69
void SetChainMarker()
Definition: feshview.cxx:2959
std::unique_ptr< SdrDropMarkerOverlay > m_pChainTo
Definition: fesh.hxx:206
bool GotoFly(const OUString &rName, FlyCntType eType, bool bSelFrame)
Jump to named Fly (graphic/OLE).
Definition: feshview.cxx:2613
SdrObject * GetObjAt(const Point &rPt)
Same as IsObjSelectable(), but return the object as well.
Definition: feshview.cxx:1395
bool BeginCreate(SdrObjKind eSdrObjectKind, const Point &rPos)
Process of creating draw objects.
Definition: feshview.cxx:1786
SAL_DLLPRIVATE void ScrollTo(const Point &rPt)
Definition: feshview.cxx:656
bool IsSelContainsControl() const
check whether selected frame contains a control; companion method to GetSelFrameType,...
Definition: feshview.cxx:639
void DelSelectedObj()
Definition: feshview.cxx:2377
SAL_DLLPRIVATE const SdrMarkList * GetMarkList_() const
Get list of marked SdrObjects; helper method for GetSelFrameType, IsSelContainsControl.
Definition: feshview.cxx:598
SAL_DLLPRIVATE void ChangeOpaque(SdrLayerID nLayerId)
Definition: feshview.cxx:1195
bool GetObjAttr(SfxItemSet &rSet) const
Attention: Ambiguities if multiple selections.
Definition: feshview.cxx:2769
void CheckUnboundObjects()
Temporary work around for bug.
Definition: feshview.cxx:2823
const SwFrameFormat * NewFlyFrame(const SfxItemSet &rSet, bool bAnchValid=false, SwFrameFormat *pParent=nullptr)
Definition: fefly1.cxx:660
void BreakDrag()
Definition: feshview.cxx:785
size_t GetFlyCount(FlyCntType eType, bool bIgnoreTextBoxes=false) const
Iterate over flys - for Basic-collections.
Definition: feshview.cxx:2671
bool IsGroupSelected(bool bAllowDiagams)
Create and destroy group, don't when frame is selected.
Definition: feshview.cxx:2438
void SetDragMode(SdrDragMode eSdrDragMode)
Set DragMode (e.g. Rotate), but do nothing when frame is selected.
Definition: feshview.cxx:667
bool EndCreate(SdrCreateCmd eSdrCreateCmd)
Definition: feshview.cxx:1839
Point GetObjAbsPos() const
Definition: feshview.cxx:2432
void CreateDefaultShape(SdrObjKind eSdrObjectKind, const tools::Rectangle &rRect, sal_uInt16 nSlotId)
Definition: feshview.cxx:3036
void MirrorSelection(bool bHorizontal)
Vertical if FALSE.
Definition: feshview.cxx:2599
sal_uInt16 GetPhyPageNum() const
Phy: real page count.
Definition: fews.cxx:335
void SetCalcFieldValueHdl(Outliner *pOutliner)
Definition: feshview.cxx:2879
bool IsDrawCreate() const
Definition: feshview.cxx:2228
SdrLayerID GetLayerId() const
1 Heaven, 0 Hell, SDRLAYER_NOTFOUND Ambiguous.
Definition: feshview.cxx:1169
SwChainRet Chain(SwFrameFormat &rSource, const Point &rPt)
Definition: feshview.cxx:2923
void StartCropImage()
Definition: feshview.cxx:683
const SdrObject * GetBestObject(bool bNext, GotoObjFlags eType, bool bFlat=true, const svx::ISdrObjectFilter *pFilter=nullptr, bool *pbWrapped=nullptr)
Definition: feshview.cxx:1562
bool IsUnGroupAllowed() const
Definition: feshview.cxx:2553
void BreakCreate()
Definition: feshview.cxx:2221
void EndTextEdit()
Deletes object if required.
Definition: feshview.cxx:1313
std::unique_ptr< SdrDropMarkerOverlay > m_pChainFrom
Definition: fesh.hxx:207
size_t IsObjSelected() const
Definition: feshview.cxx:1245
bool SelectObj(const Point &rSelPt, sal_uInt8 nFlag=0, SdrObject *pObj=nullptr)
If an object has been given, exactly this object is selected (instead of searching over position).
Definition: feshview.cxx:177
void MoveCreate(const Point &rPos)
Definition: feshview.cxx:1828
void MoveMark(const Point &rPos)
Definition: feshview.cxx:2254
void BeginDrag(const Point *pPt, bool bProp)
Definition: feshview.cxx:719
void UnGroupSelection()
The individual objects are selected, but it is possible that there are groups included.
Definition: feshview.cxx:2585
bool IsAlignPossible() const
Definition: feshview.cxx:2818
Point GetRelativePagePosition(const Point &rDocPos)
Convert document position into position relative to the current page.
Definition: feshview.cxx:3342
SwChainRet Chainable(SwRect &rRect, const SwFrameFormat &rSource, const Point &rPt) const
For Chain always connect Fly specified by format with that hit by point.
Definition: feshview.cxx:2884
bool IsInsideSelectedObj(const Point &rPt)
returns enum values
Definition: feshview.cxx:1363
tools::Long GetSectionWidth(SwFormat const &rFormat) const
Width of current range for column-dialog.
Definition: feshview.cxx:3008
sal_uInt16 GetPageNumber(const Point &rPoint) const
Page number of the page containing Point, O if no page.
Definition: fews.cxx:185
bool IsGroupAllowed() const
Definition: feshview.cxx:2493
bool IsShapeDefaultHoriTextDirR2L() const
Is default horizontal text direction for selected drawing object right-to-left.
Definition: feshview.cxx:3302
static void SetLineEnds(SfxItemSet &rAttr, SdrObject const &rObj, sal_uInt16 nSlotId)
Definition: feshview.cxx:915
Color GetShapeBackground() const
SwFEShell::GetShapeBackground.
Definition: feshview.cxx:3254
general base class for all free-flowing frames
Definition: flyfrm.hxx:79
const SwVirtFlyDrawObj * GetVirtDrawObj() const
Definition: fly.cxx:2811
SwFlyFrame * GetPrevLink() const
Definition: flyfrm.hxx:194
virtual const SwFlyFrameFormat * GetFormat() const override
Definition: fly.cxx:2905
bool IsFlyAtContentFrame() const
Definition: flyfrm.hxx:218
void SelectionHasChanged(SwFEShell *pShell)
Definition: fly.cxx:1854
SwFlyFrame * GetNextLink() const
Definition: flyfrm.hxx:195
bool IsFlyInContentFrame() const
Definition: flyfrm.hxx:215
bool IsFlyLayFrame() const
Definition: flyfrm.hxx:217
FlyAnchors.
Definition: fmtanchr.hxx:37
sal_Int32 GetAnchorContentOffset() const
Definition: atrfrm.cxx:1623
void SetPageNum(sal_uInt16 nNew)
Definition: fmtanchr.hxx:71
void SetAnchor(const SwPosition *pPos)
Definition: atrfrm.cxx:1586
RndStdIds GetAnchorId() const
Definition: fmtanchr.hxx:67
void SetType(RndStdIds nRndId)
Definition: fmtanchr.hxx:68
const SwPosition * GetContentAnchor() const
Definition: fmtanchr.hxx:74
SwNode * GetAnchorNode() const
Definition: atrfrm.cxx:1606
Connection (text flow) between two FlyFrames.
Definition: fmtcnct.hxx:32
SwFlyFrameFormat * GetNext() const
Definition: fmtcnct.hxx:54
Format of a fly content.
Definition: fmtflcnt.hxx:33
Defines the horizontal position of a fly frame.
Definition: fmtornt.hxx:73
void SetHoriOrient(sal_Int16 eNew)
Definition: fmtornt.hxx:96
sal_Int16 GetHoriOrient() const
Definition: fmtornt.hxx:94
void SetRelationOrient(sal_Int16 eNew)
Definition: fmtornt.hxx:97
css::text::WrapTextMode GetSurround() const
Definition: fmtsrnd.hxx:51
Defines the vertical position of a fly frame.
Definition: fmtornt.hxx:37
void SetVertOrient(sal_Int16 eNew)
Definition: fmtornt.hxx:59
void SetRelationOrient(sal_Int16 eNew)
Definition: fmtornt.hxx:60
Base class for various Writer styles.
Definition: format.hxx:47
const SwDoc * GetDoc() const
The document is set in SwAttrPool now, therefore you always can access it.
Definition: format.hxx:139
const SwFormatChain & GetChain(bool=true) const
Definition: fmtcnct.hxx:70
const SvxOpaqueItem & GetOpaque(bool=true) const
Definition: frmatr.hxx:80
sal_uInt16 Which() const
for Querying of Writer-functions.
Definition: format.hxx:82
const SwFormatVertOrient & GetVertOrient(bool=true) const
Definition: fmtornt.hxx:113
const SvxProtectItem & GetProtect(bool=true) const
Definition: frmatr.hxx:82
const SwFormatAnchor & GetAnchor(bool=true) const
Definition: fmtanchr.hxx:88
const SwAttrSet & GetAttrSet() const
For querying the attribute array.
Definition: format.hxx:136
const SwFormatSurround & GetSurround(bool=true) const
Definition: fmtsrnd.hxx:66
const SwFormatHoriOrient & GetHoriOrient(bool=true) const
Definition: fmtornt.hxx:115
virtual bool SetFormatAttr(const SfxPoolItem &rAttr)
Definition: format.cxx:447
const SwRect & getFrameArea() const
Definition: frame.hxx:179
const SwRect & getFramePrintArea() const
Definition: frame.hxx:180
Style of a layout element.
Definition: frmfmt.hxx:62
virtual void SetFormatName(const OUString &rNewName, bool bBroadcast=false) override
Definition: atrfrm.cxx:2593
Base class of the Writer layout elements.
Definition: frame.hxx:315
bool IsTextFrame() const
Definition: frame.hxx:1234
SwTextFrame * DynCastTextFrame()
Definition: findfrm.cxx:1895
SwFlyFrame * FindFlyFrame()
Definition: frame.hxx:1111
SwSectionFrame * FindSctFrame()
Definition: frame.hxx:1115
SwFrame * FindNext()
Definition: frame.hxx:1141
SwFrame * GetNext()
Definition: frame.hxx:676
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:1639
SwFrame * FindPrev()
Definition: frame.hxx:1155
bool KnowsFormat(const SwFormat &rFormat) const
Definition: wsfrm.cxx:331
bool IsRightToLeft() const
Definition: frame.hxx:987
SwRect UnionFrame(bool bBorder=false) const
|* The unionframe is the framearea (getFrameArea()) of a frame expanded by the |* printarea,...
Definition: ssfrm.cxx:701
void InvalidatePos()
Definition: frame.hxx:1043
SwLayoutFrame * GetUpper()
Definition: frame.hxx:678
bool IsVertical() const
Definition: frame.hxx:973
bool IsNoTextFrame() const
Definition: frame.hxx:1238
bool IsFlyFrame() const
Definition: frame.hxx:1210
bool IsContentFrame() const
Definition: frame.hxx:1230
SwFrame * GetPrev()
Definition: frame.hxx:677
SwPageFrame * FindPageFrame()
Definition: frame.hxx:680
SwFrame * FindFooterOrHeader()
Definition: findfrm.cxx:602
sal_uInt16 GetPhyPageNum() const
Definition: trvlfrm.cxx:1706
virtual bool GetCharRect(SwRect &, const SwPosition &, SwCursorMoveState *=nullptr, bool bAllowFarAway=true) const
Definition: unusedf.cxx:72
bool IsInSct() const
Definition: frame.hxx:967
TElementType * Next()
Definition: calbck.hxx:373
TElementType * First()
Definition: calbck.hxx:365
const SwContentFrame * ContainsContent() const
Checks if the frame contains one or more ContentFrame's anywhere in his subsidiary structure; if so t...
Definition: findfrm.cxx:70
const SwFrame * Lower() const
Definition: layfrm.hxx:101
bool HasAnimation() const
Definition: notxtfrm.cxx:1489
const SwContentNode * GetNode() const
Definition: notxtfrm.hxx:77
Base class of the Writer document model elements.
Definition: node.hxx:98
SwGrfNode * GetGrfNode()
Definition: ndgrf.hxx:154
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
Definition: ndtxt.hxx:897
bool IsProtect() const
Is node in something that is protected (range, frame, table cells ... including anchor in case of fra...
Definition: node.cxx:449
SwOLENode * GetOLENode()
Inline methods from Node.hxx.
Definition: ndole.hxx:165
SwContentNode * GetContentNode()
Definition: node.hxx:664
const SwOLEObj & GetOLEObj() const
Definition: ndole.hxx:116
css::uno::Reference< css::embed::XEmbeddedObject > const & GetOleRef()
Definition: ndole.cxx:942
PaM is Point and Mark: a selection of the document model.
Definition: pam.hxx:187
const SwPosition * GetPoint() const
Definition: pam.hxx:261
A page of the document layout.
Definition: pagefrm.hxx:58
Color GetDrawBackgroundColor() const
SwPageFrame::GetDrawBackgroundColor.
Definition: paintfrm.cxx:7238
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
Point TopLeft() const
Definition: swrect.hxx:254
void Top(const tools::Long nTop)
Definition: swrect.hxx:206
void Right(const tools::Long nRight)
Definition: swrect.hxx:202
void Clear()
Definition: swrect.hxx:308
void Bottom(const tools::Long nBottom)
Definition: swrect.hxx:211
void Pos(const Point &rNew)
Definition: swrect.hxx:171
bool Contains(const Point &rPOINT) const
Definition: swrect.hxx:356
Point Center() const
Definition: swrect.hxx:338
bool Overlaps(const SwRect &rRect) const
Definition: swrect.hxx:374
tools::Rectangle SVRect() const
Definition: swrect.hxx:292
void Left(const tools::Long nLeft)
Definition: swrect.hxx:197
void Width(tools::Long nNew)
Definition: swrect.hxx:189
const SwPageFrame * GetPageAtPos(const Point &rPt, const Size *pSize=nullptr, bool bExtend=false) const
Point rPt: The point that should be used to find the page Size pSize: If given, we return the (first)...
Definition: findfrm.cxx:627
virtual bool GetModelPositionForViewPoint(SwPosition *, Point &, SwCursorMoveState *=nullptr, bool bTestBackground=false) const override
Primary passes the call to the first page.
Definition: trvlfrm.cxx:425
size_t size() const
Definition: sortedobjs.cxx:43
static bool DoTextBoxZOrderCorrection(SwFrameFormat *pShape, const SdrObject *pObj)
static SwFrameFormat * getOtherTextBoxFormat(const SwFrameFormat *pFormat, sal_uInt16 nType, const SdrObject *pObject=nullptr)
If we have an associated TextFrame, then return that.
static bool isTextBox(const SwFrameFormat *pFormat, sal_uInt16 nType, const SdrObject *pObject=nullptr)
Is the frame format a text box?
Represents the visualization of a paragraph.
Definition: txtfrm.hxx:165
SwPosition MapViewToModelPos(TextFrameIndex nIndex) const
Definition: txtfrm.cxx:1246
SwTwips GetBaseVertOffsetForFly(bool bIgnoreFlysAnchoredAtThisFrame) const
Definition: txtfrm.cxx:4082
bool GetKeyCursorOfst(SwPosition *pPos, const Point &rPoint) const
Makes sure that the Frame is not switched (e.g.
Definition: txtfrm.hxx:408
TextFrameIndex MapModelToViewPos(SwPosition const &rPos) const
Definition: txtfrm.cxx:1267
virtual bool GetCharRect(SwRect &rRect, const SwPosition &rPos, SwCursorMoveState *pCMS=nullptr, bool bAllowFarAway=true) const override
Returns the view rectangle for the rPos model position.
Definition: frmcrsr.cxx:178
const OUString & GetText() const
Returns the text portion we want to edit (for inline see underneath)
Definition: txtfrm.cxx:1293
SwTextNode const * GetTextNodeForParaProps() const
Definition: txtfrm.cxx:1303
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:111
SwTextAttr * InsertItem(SfxPoolItem &rAttr, const sal_Int32 nStart, const sal_Int32 nEnd, const SetAttrMode nMode=SetAttrMode::DEFAULT)
create new text attribute from rAttr and insert it
Definition: thints.cxx:1305
void MakeDrawView()
Definition: viewimp.cxx:240
bool HasDrawView() const
New Interface for StarView Drawing.
Definition: viewimp.hxx:163
SwDrawView * GetDrawView()
Definition: viewimp.hxx:164
SdrPageView * GetPageView()
Definition: viewimp.hxx:166
bool IsViewLocked() const
Definition: viewsh.hxx:471
vcl::RenderContext * GetOut() const
Definition: viewsh.hxx:347
bool IsHeaderFooterEdit() const
Acts both for headers / footers, depending on the bShow(Header|Footer)Separator flags.
Definition: viewsh.hxx:572
bool HasDrawView() const
Definition: vnew.cxx:358
void UnlockPaint(bool bVirDev=false)
Definition: viewsh.hxx:619
const SwNodes & GetNodes() const
Definition: viewsh.cxx:2178
rtl::Reference< SwDoc > mxDoc
The document; never 0.
Definition: viewsh.hxx:179
SwViewShellImp * Imp()
Definition: viewsh.hxx:190
bool ActionPend() const
Definition: viewsh.hxx:204
bool HasDrawViewDrag() const
Definition: vnew.cxx:368
SwRootFrame * GetLayout() const
Definition: viewsh.cxx:2160
vcl::Window * GetWin() const
Definition: viewsh.hxx:346
const IDocumentDrawModelAccess & getIDocumentDrawModelAccess() const
Provides access to the document draw model interface.
Definition: viewsh.cxx:2809
void LockPaint()
Definition: viewsh.hxx:614
IDocumentUndoRedo const & GetIDocumentUndoRedo() const
Provides access to the document undo/redo interface.
Definition: viewsh.cxx:2821
void InvalidateWindows(const SwRect &rRect)
Definition: viewsh.cxx:556
const IDocumentLayoutAccess & getIDocumentLayoutAccess() const
Provides access to the document layout interface.
Definition: viewsh.cxx:2813
SwDoc * GetDoc() const
Definition: viewsh.hxx:290
SfxViewShell * GetSfxViewShell() const
Definition: viewsh.hxx:451
void LockView(bool b)
Definition: viewsh.hxx:472
const SfxItemPool & GetAttrPool() const
Definition: viewsh.hxx:624
void MakeVisible(const SwRect &)
Definition: viewsh.cxx:637
SdrView * GetDrawView()
Definition: vnew.cxx:373
virtual bool IsTextBox() const override
Definition: dflyobj.cxx:1300
SwFlyFrame * GetFlyFrame()
Definition: dflyobj.hxx:128
bool ContainsSwGrfNode() const
Definition: dflyobj.cxx:359
virtual const tools::Rectangle & GetCurrentBoundRect() const override
Definition: dflyobj.cxx:559
const basegfx::B2DPolyPolygon & GetLineEnd() const
const OUString & GetName() const
void append(const B2DPolygon &rPolygon, sal_uInt32 nCount=1)
sal_uInt32 count() const
void append(const basegfx::B2DPoint &rPoint, sal_uInt32 nCount)
void setClosed(bool bNew)
void appendBezierSegment(const basegfx::B2DPoint &rNextControlPoint, const basegfx::B2DPoint &rPrevControlPoint, const basegfx::B2DPoint &rPoint)
virtual bool includeObject(const SdrObject &i_rObject) const=0
ring_container GetRingContainer()
Definition: ring.hxx:240
constexpr Point Center() const
constexpr tools::Long GetWidth() const
bool Contains(const Point &rPOINT) const
bool Overlaps(const tools::Rectangle &rRect) const
constexpr tools::Long Top() const
constexpr Point TopLeft() const
constexpr Size GetSize() const
constexpr tools::Long Right() const
tools::Long AdjustTop(tools::Long nVertMoveDelta)
tools::Long AdjustRight(tools::Long nHorzMoveDelta)
constexpr Point BottomRight() const
constexpr Point TopRight() const
constexpr tools::Long GetHeight() const
tools::Long AdjustBottom(tools::Long nVertMoveDelta)
tools::Long AdjustLeft(tools::Long nHorzMoveDelta)
constexpr tools::Long Left() const
constexpr tools::Long Bottom() const
constexpr bool IsEmpty() const
virtual void Invalidate(InvalidateFlags nFlags=InvalidateFlags::NONE)
@ SetOnlyText
stay with the cursor inside text
int nCount
SwRect GetBoundRectOfAnchoredObj(const SdrObject *pObj)
returns the BoundRect inclusive distance of the object.
Definition: dcontact.cxx:155
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 CheckControlLayer(const SdrObject *pObj)
Definition: dcontact.cxx:683
SVXCORE_DLLPUBLIC OUString SvxResId(TranslateId aId)
virtual SotClipboardFormatId GetFormat(const TransferableDataHelper &aHelper) override
#define CNT_TXT
Definition: editsh.hxx:130
#define CNT_GRF
Definition: editsh.hxx:131
bool IsScrollMDI(SwViewShell const *pVwSh, const SwRect &rRect)
Definition: edtwin3.cxx:45
void FrameNotify(SwViewShell *pVwSh, FlyMode eMode)
Definition: edtwin3.cxx:78
void ScrollMDI(SwViewShell const *pVwSh, const SwRect &rRect, sal_uInt16 nRangeX, sal_uInt16 nRangeY)
Definition: edtwin3.cxx:35
EmbeddedObjectRef * pObject
GotoObjFlags
values can be combined via logical or
Definition: fesh.hxx:88
#define SW_ENTER_GROUP
Definition: fesh.hxx:167
SwMove
Definition: fesh.hxx:173
#define SW_ADD_SELECT
Definition: fesh.hxx:166
FrameTypeFlags
values can be combined via logical or
Definition: fesh.hxx:63
#define SW_LEAVE_FRAME
Definition: fesh.hxx:168
#define SW_ALLOW_TEXTBOX
Allow SwFEShell::SelectObj() to select the TextBox of a shape.
Definition: fesh.hxx:170
FlyProtectFlags
values can be combined via logical or
Definition: fesh.hxx:106
@ Parent
Check only parents.
@ Fixed
Only protection that cannot be withdrawn e.g.
#define SCROLLVAL
Definition: feshview.cxx:103
static void lcl_NotifyNeighbours(const SdrMarkList *pLst)
Definition: feshview.cxx:835
static void lcl_GrabCursor(SwFEShell *pSh, SwFlyFrame *pOldSelFly)
Definition: feshview.cxx:153
SwFlyFrame * GetFlyFromMarked(const SdrMarkList *pLst, SwViewShell *pSh)
Definition: feshview.cxx:139
static bool LessX(Point const &aPt1, Point const &aPt2, bool bOld)
Definition: feshview.cxx:349
static bool LessY(Point const &aPt1, Point const &aPt2, bool bOld)
Definition: feshview.cxx:356
static bool lcl_IsControlGroup(const SdrObject *pObj)
Definition: feshview.cxx:1526
SwChainRet
Definition: flyenum.hxx:34
@ SOURCE_CHAINED
Source already has a follow.
@ NOT_FOUND
Destination and/or source not found.
FlyCntType
Definition: flyenum.hxx:24
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
DocumentType eType
sal_Int16 nValue
@ Minimum
Value in Var-direction gives minimum (can be exceeded but not be less).
constexpr TypedWhichId< SwFlyFrameFormat > RES_FLYFRMFMT(156)
constexpr TypedWhichId< SwFormatSurround > RES_SURROUND(101)
constexpr TypedWhichId< SwFormatFrameSize > RES_FRM_SIZE(89)
constexpr TypedWhichId< SwFormatAnchor > RES_ANCHOR(104)
constexpr TypedWhichId< SwDrawFrameFormat > RES_DRAWFRMFMT(159)
sal_Int32 nIndex
uno_Any a
const long LONG_MAX
@ FLY_DRAG_START
Definition: mdiexp.hxx:41
@ FLY_DRAG_END
Definition: mdiexp.hxx:41
int i
constexpr auto toTwips(N number, Length from)
std::pair< SwTextNode *, sal_Int32 > MapViewToModel(MergedPara const &, TextFrameIndex nIndex)
Definition: txtfrm.cxx:1164
long Long
SwNodeType
Definition: ndtyp.hxx:28
static SwRectFnCollection aVertical
Definition: newfrm.cxx:116
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:1019
QPRO_FUNC_TYPE nType
SdrOnOffItem makeSdrTextAutoGrowHeightItem(bool bAuto)
SdrOnOffItem makeSdrTextAutoGrowWidthItem(bool bAuto)
SDRTEXTVERTADJUST_CENTER
SDRTEXTVERTADJUST_TOP
SDRTEXTHORZADJUST_RIGHT
static SfxItemSet & rSet
Marks a position in the document model.
Definition: pam.hxx:37
SwNode & GetNode() const
Definition: pam.hxx:80
void Assign(const SwNode &rNd, SwNodeOffset nDelta, sal_Int32 nContentOffset=0)
These all set both nNode and nContent.
Definition: pam.cxx:230
SdrInventor
SVXCORE_DLLPUBLIC SdrTextObj * DynCastSdrTextObj(SdrObject *)
SdrObjKind
SdrDragMode
SdrCreateCmd
constexpr SdrLayerID SDRLAYER_NOTFOUND(-1)
RndStdIds
bool g_bNoInterrupt
Definition: swmodule.cxx:115
tools::Long SwTwips
Definition: swtypes.hxx:51
@ FlyFrameAttributesChanged
constexpr SwTwips lMinBorder
Definition: swtypes.hxx:74
#define MINFLY
Definition: swtypes.hxx:61
SdrAngleItem makeSdrCircStartAngleItem(Degree100 nAngle)
SdrAngleItem makeSdrCircEndAngleItem(Degree100 nAngle)
unsigned char sal_uInt8
sal_uInt16 GetHtmlMode(const SwDocShell *pShell)
Definition: viewopt.cxx:332
size_t pos
constexpr TypedWhichId< XLineWidthItem > XATTR_LINEWIDTH(XATTR_LINE_FIRST+2)