LibreOffice Module sw (master)  1
frmmgr.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 <cmdid.h>
21 #include <hintids.hxx>
22 
23 #include <svl/stritem.hxx>
24 #include <editeng/protitem.hxx>
25 #include <editeng/boxitem.hxx>
26 #include <editeng/opaqitem.hxx>
27 #include <editeng/lrspitem.hxx>
28 #include <editeng/ulspitem.hxx>
29 #include <editeng/shaditem.hxx>
31 #include <svx/xdef.hxx>
32 #include <svx/svxids.hrc>
33 #include <fmtclds.hxx>
34 #include <wrtsh.hxx>
35 #include <view.hxx>
36 #include <viewopt.hxx>
37 #include <uitool.hxx>
38 #include <frmmgr.hxx>
39 #include <format.hxx>
40 #include <mdiexp.hxx>
41 #include <poolfmt.hxx>
42 #include <com/sun/star/text/HoriOrientation.hpp>
43 #include <com/sun/star/text/VertOrientation.hpp>
44 #include <com/sun/star/text/RelOrientation.hpp>
45 #include <grfatr.hxx>
46 
47 using namespace ::com::sun::star;
48 
49 static sal_uInt16 aFrameMgrRange[] = {
50  RES_FRMATR_BEGIN, RES_FRMATR_END-1, // 87-129
51 
52  // RotGrfFlyFrame: Support here, but seems not to be
53  // added in range of m_pOwnSh->GetFlyFrameAttr result
54  // (see below). Tried to find, but could not identify
56 
57  // FillAttribute support
58  XATTR_FILL_FIRST, XATTR_FILL_LAST, // 1014-1033
59 
60  SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER,
62  0};
63 
64 // determine frame attributes via Shell
66  m_aSet( static_cast<SwAttrPool&>(pSh->GetAttrPool()), aFrameMgrRange ),
67  m_pOwnSh( pSh ),
68  m_bAbsPos( false ),
69  m_bNewFrame( bNew ),
70  m_bIsInVertical( false ),
71  m_bIsInVerticalL2R( false )
72 {
73  if ( m_bNewFrame )
74  {
75  sal_uInt16 nId;
76  switch ( nType )
77  {
78  case Frmmgr_Type::TEXT: nId = RES_POOLFRM_FRAME; break;
79  case Frmmgr_Type::OLE: nId = RES_POOLFRM_OLE; break;
80  case Frmmgr_Type::GRF: nId = RES_POOLFRM_GRAPHIC; break;
81  // set defaults:
82  default: nId=0; break;
83  }
86  if ( 0 != ::GetHtmlMode(pSh->GetView().GetDocShell()) )
87  m_aSet.Put( SwFormatHoriOrient( 0, text::HoriOrientation::LEFT, text::RelOrientation::PRINT_AREA ) );
88 
89  if (nType == Frmmgr_Type::GRF || nType == Frmmgr_Type::OLE)
90  {
91  m_aSet.Put(SwFormatAnchor(RndStdIds::FLY_AS_CHAR));
92  }
93  }
94  else if ( nType == Frmmgr_Type::NONE )
95  {
97  bool bRightToLeft;
99  }
101 }
102 
104  m_aSet( rSet ),
105  m_pOwnSh( pSh ),
106  m_bAbsPos( false ),
107  m_bNewFrame( bNew ),
108  m_bIsInVertical(false),
109  m_bIsInVerticalL2R(false)
110 {
111  if(!bNew)
112  {
113  bool bRightToLeft;
114  m_bIsInVertical = pSh->IsFrameVertical(true, bRightToLeft, m_bIsInVerticalL2R);
115  }
116 }
117 
118 // Initialise
120 {
121  if ( !m_bNewFrame && m_pOwnSh->IsFrameSelected() )
124 }
125 
127 {
128  const SfxPoolItem* pItem = nullptr;
129 
130  if (m_aSet.GetItemState(FN_SET_FRM_NAME, false, &pItem) == SfxItemState::SET)
131  m_pOwnSh->SetFlyName(static_cast<const SfxStringItem *>(pItem)->GetValue());
132 
134 
135  if ( m_bAbsPos )
136  {
138  m_bAbsPos = false;
139  }
140 }
141 
142 // change existing Fly-Frame
144 {
145  OSL_ENSURE( m_pOwnSh->IsFrameSelected(),
146  "no frame selected or no shell, update not possible");
147 
148  if( m_pOwnSh->IsFrameSelected() )
149  {
150  //JP 6.8.2001: set never an invalid anchor into the core.
151  const SfxPoolItem *pGItem, *pItem;
152  if( SfxItemState::SET == m_aSet.GetItemState( RES_ANCHOR, false, &pItem ))
153  {
155  if( m_pOwnSh->GetFlyFrameAttr( aGetSet ) && 1 == aGetSet.Count() &&
156  SfxItemState::SET == aGetSet.GetItemState( RES_ANCHOR, false, &pGItem )
157  && static_cast<const SwFormatAnchor*>(pGItem)->GetAnchorId() ==
158  static_cast<const SwFormatAnchor*>(pItem)->GetAnchorId() )
160  }
161 
162  // return wg. BASIC
163  if( m_aSet.Count() )
164  {
167  UpdateFlyFrame_();
169  }
170  }
171 }
172 
173 // insert frame
175 {
177 
178  bool bRet = nullptr != m_pOwnSh->NewFlyFrame( m_aSet );
179 
180  // turn on the right mode at the shell, frame got selected automatically.
181  if ( bRet )
182  {
183  UpdateFlyFrame_();
186  }
188 }
189 
190 // Insert frames of type eAnchorType. Position and size are being set explicitly.
191 // Not-allowed values of the enumeration type get corrected.
193  const Point &rPos,
194  const Size &rSize )
195 {
196  OSL_ENSURE( eAnchorType == RndStdIds::FLY_AT_PAGE ||
197  eAnchorType == RndStdIds::FLY_AT_PARA ||
198  eAnchorType == RndStdIds::FLY_AT_CHAR ||
199  eAnchorType == RndStdIds::FLY_AT_FLY ||
200  eAnchorType == RndStdIds::FLY_AS_CHAR, "invalid frame type" );
201 
202  SetPos( rPos );
203 
204  SetSize( rSize );
205  SetAnchor( eAnchorType );
206  InsertFlyFrame();
207 }
208 
209 // set anchor
211 {
212  sal_uInt16 nPhyPageNum, nVirtPageNum;
213  m_pOwnSh->GetPageNum( nPhyPageNum, nVirtPageNum );
214 
215  m_aSet.Put( SwFormatAnchor( eId, nPhyPageNum ) );
216  if ((RndStdIds::FLY_AT_PAGE == eId) || (RndStdIds::FLY_AT_PARA == eId) || (RndStdIds::FLY_AT_CHAR == eId)
217  || (RndStdIds::FLY_AT_FLY == eId))
218  {
219  SwFormatVertOrient aVertOrient( GetVertOrient() );
220  SwFormatHoriOrient aHoriOrient( GetHoriOrient() );
221  aHoriOrient.SetRelationOrient( text::RelOrientation::FRAME );
222  aVertOrient.SetRelationOrient( text::RelOrientation::FRAME );
223  m_aSet.Put( aVertOrient );
224  m_aSet.Put( aHoriOrient );
225  }
226 }
227 
228 // set the attribute for columns
230 {
231  m_aSet.Put( rCol );
232 }
233 
234 // set absolute position
235 void SwFlyFrameAttrMgr::SetAbsPos( const Point& rPoint )
236 {
237  m_bAbsPos = true;
238  m_aAbsPos = rPoint;
239  SwFormatVertOrient aVertOrient( GetVertOrient() );
240  SwFormatHoriOrient aHoriOrient( GetHoriOrient() );
243  m_aSet.Put( aVertOrient );
244  m_aSet.Put( aHoriOrient );
245 }
246 
247 // check metrics for correctness
249  const SwPosition* pToCharContentPos,
250  bool bOnlyPercentRefValue )
251 {
252  if (!bOnlyPercentRefValue)
253  {
256  }
257 
258  SwRect aBoundRect;
259 
260  // OD 18.09.2003 #i18732# - adjustment for allowing vertical position
261  // aligned to page for fly frame anchored to paragraph or to character.
262  const RndStdIds eAnchorType = rVal.nAnchorType;
263  const SwFormatFrameSize& rSize = m_aSet.Get(RES_FRM_SIZE);
264  m_pOwnSh->CalcBoundRect( aBoundRect, eAnchorType,
265  rVal.nHRelOrient,
266  rVal.nVRelOrient,
267  pToCharContentPos,
268  rVal.bFollowTextFlow,
269  rVal.bMirror, nullptr, &rVal.aPercentSize,
270  &rSize);
271 
272  if (bOnlyPercentRefValue)
273  return;
274 
275  // #mongolianlayout#
277  {
278  Point aPos(aBoundRect.Pos());
279  long nTmp = aPos.X();
280  aPos.setX( aPos.Y() );
281  aPos.setY( nTmp );
282  Size aSize(aBoundRect.SSize());
283  nTmp = aSize.Width();
284  aSize.setWidth( aSize.Height() );
285  aSize.setHeight( nTmp );
286  aBoundRect.Chg( aPos, aSize );
287  //exchange width/height to enable correct values
288  nTmp = rVal.nWidth;
289  rVal.nWidth = rVal.nHeight;
290  rVal.nHeight = nTmp;
291  }
292  if ((eAnchorType == RndStdIds::FLY_AT_PAGE) || (eAnchorType == RndStdIds::FLY_AT_FLY))
293  {
294  // MinimalPosition
295  rVal.nMinHPos = aBoundRect.Left();
296  rVal.nMinVPos = aBoundRect.Top();
297  SwTwips nH = rVal.nHPos;
298  SwTwips nV = rVal.nVPos;
299 
300  if (rVal.nHPos + rVal.nWidth > aBoundRect.Right())
301  {
303  {
304  rVal.nHPos -= ((rVal.nHPos + rVal.nWidth) - aBoundRect.Right());
305  nH = rVal.nHPos;
306  }
307  else
308  rVal.nWidth = aBoundRect.Right() - rVal.nHPos;
309  }
310 
311  if (rVal.nHPos + rVal.nWidth > aBoundRect.Right())
312  rVal.nWidth = aBoundRect.Right() - rVal.nHPos;
313 
314  if (rVal.nVPos + rVal.nHeight > aBoundRect.Bottom())
315  {
317  {
318  rVal.nVPos -= ((rVal.nVPos + rVal.nHeight) - aBoundRect.Bottom());
319  nV = rVal.nVPos;
320  }
321  else
322  rVal.nHeight = aBoundRect.Bottom() - rVal.nVPos;
323  }
324 
325  if (rVal.nVPos + rVal.nHeight > aBoundRect.Bottom())
326  rVal.nHeight = aBoundRect.Bottom() - rVal.nVPos;
327 
329  nV = aBoundRect.Top();
330 
332  nH = aBoundRect.Left();
333 
334  rVal.nMaxHPos = aBoundRect.Right() - rVal.nWidth;
335  rVal.nMaxHeight = aBoundRect.Bottom() - nV;
336 
337  rVal.nMaxVPos = aBoundRect.Bottom() - rVal.nHeight;
338  rVal.nMaxWidth = aBoundRect.Right() - nH;
339  }
340  // OD 12.11.2003 #i22341# - handle to character anchored objects vertical
341  // aligned at character or top of line in a special case
342  else if ((eAnchorType == RndStdIds::FLY_AT_PARA) ||
343  ((eAnchorType == RndStdIds::FLY_AT_CHAR) &&
344  (rVal.nVRelOrient != text::RelOrientation::CHAR) &&
345  (rVal.nVRelOrient != text::RelOrientation::TEXT_LINE) ) )
346  {
347  if (rVal.nHPos + rVal.nWidth > aBoundRect.Right())
348  {
350  {
351  rVal.nHPos -= ((rVal.nHPos + rVal.nWidth) - aBoundRect.Right());
352  }
353  else
354  rVal.nWidth = aBoundRect.Right() - rVal.nHPos;
355  }
356 
357  // OD 29.09.2003 #i17567#, #i18732# - consider following the text flow
358  // and alignment at page areas.
359  const bool bMaxVPosAtBottom = !rVal.bFollowTextFlow ||
360  rVal.nVRelOrient == text::RelOrientation::PAGE_FRAME ||
361  rVal.nVRelOrient == text::RelOrientation::PAGE_PRINT_AREA;
362  {
363  SwTwips nTmpMaxVPos = ( bMaxVPosAtBottom
364  ? aBoundRect.Bottom()
365  : aBoundRect.Height() ) -
366  rVal.nHeight;
367  if ( rVal.nVPos > nTmpMaxVPos )
368  {
370  {
371  rVal.nVPos = nTmpMaxVPos;
372  }
373  else
374  {
375  rVal.nHeight = ( bMaxVPosAtBottom
376  ? aBoundRect.Bottom()
377  : aBoundRect.Height() ) - rVal.nVPos;
378  }
379  }
380  }
381 
382  rVal.nMinHPos = aBoundRect.Left();
383  rVal.nMaxHPos = aBoundRect.Right() - rVal.nWidth;
384 
385  rVal.nMinVPos = aBoundRect.Top();
386  // OD 26.09.2003 #i17567#, #i18732# - determine maximum vertical position
387  if ( bMaxVPosAtBottom )
388  {
389  rVal.nMaxVPos = aBoundRect.Bottom() - rVal.nHeight;
390  }
391  else
392  {
393  rVal.nMaxVPos = aBoundRect.Height() - rVal.nHeight;
394  }
395 
396  // maximum width height
397  const SwTwips nH = ( rVal.nHoriOrient != text::HoriOrientation::NONE )
398  ? aBoundRect.Left()
399  : rVal.nHPos;
400  const SwTwips nV = ( rVal.nVertOrient != text::VertOrientation::NONE )
401  ? aBoundRect.Top()
402  : rVal.nVPos;
403  rVal.nMaxHeight = rVal.nMaxVPos + rVal.nHeight - nV;
404  rVal.nMaxWidth = rVal.nMaxHPos + rVal.nWidth - nH;
405  }
406  // OD 12.11.2003 #i22341# - special case for to character anchored objects
407  // vertical aligned at character or top of line.
408  // Note: (1) positive vertical values are positions above the top of line
409  // (2) negative vertical values are positions below the top of line
410  else if ( (eAnchorType == RndStdIds::FLY_AT_CHAR) &&
411  ( rVal.nVRelOrient == text::RelOrientation::CHAR ||
412  rVal.nVRelOrient == text::RelOrientation::TEXT_LINE ) )
413  {
414  // determine horizontal values
415  rVal.nMinHPos = aBoundRect.Left();
416 
417  rVal.nMaxHPos = aBoundRect.Right() - rVal.nWidth;
418  if (rVal.nHPos + rVal.nWidth > aBoundRect.Right())
419  {
421  {
422  rVal.nHPos -= ((rVal.nHPos + rVal.nWidth) - aBoundRect.Right());
423  }
424  else
425  rVal.nWidth = aBoundRect.Right() - rVal.nHPos;
426  }
427 
428  const SwTwips nH = ( rVal.nHoriOrient != text::HoriOrientation::NONE )
429  ? aBoundRect.Left()
430  : rVal.nHPos;
431  rVal.nMaxWidth = rVal.nMaxHPos + rVal.nWidth - nH;
432 
433  // determine vertical values
434  rVal.nMinVPos = -( aBoundRect.Bottom() - rVal.nHeight );
435  if ( rVal.nVPos < rVal.nMinVPos &&
437  {
438  rVal.nVPos = rVal.nMinVPos;
439  }
440 
441  rVal.nMaxVPos = -aBoundRect.Top();
442  if ( rVal.nVPos > rVal.nMaxVPos &&
444  {
445  rVal.nVPos = rVal.nMaxVPos;
446  }
447 
449  {
450  rVal.nMaxHeight = aBoundRect.Bottom() + rVal.nVPos;
451  }
452  else
453  {
454  rVal.nMaxHeight = aBoundRect.Height();
455  }
456  }
457  else if ( eAnchorType == RndStdIds::FLY_AS_CHAR )
458  {
459  rVal.nMinHPos = 0;
460  rVal.nMaxHPos = 0;
461 
462  rVal.nMaxHeight = aBoundRect.Height();
463  rVal.nMaxWidth = aBoundRect.Width();
464 
465  rVal.nMaxVPos = aBoundRect.Height();
466  rVal.nMinVPos = -aBoundRect.Height() + rVal.nHeight;
467  if (rVal.nMaxVPos < rVal.nMinVPos)
468  {
469  rVal.nMinVPos = rVal.nMaxVPos;
470  rVal.nMaxVPos = -aBoundRect.Height();
471  }
472  }
473  // #mongolianlayout#
475  {
476  //restore width/height exchange
477  long nTmp = rVal.nWidth;
478  rVal.nWidth = rVal.nHeight;
479  rVal.nHeight = nTmp;
480  }
481 
482  if (rVal.nMaxWidth < rVal.nWidth)
483  rVal.nWidth = rVal.nMaxWidth;
484  if (rVal.nMaxHeight < rVal.nHeight)
485  rVal.nHeight = rVal.nMaxHeight;
486 }
487 
488 // correction for border
490 {
491  const SvxShadowItem& rShadow = GetShadow();
492  const SvxBoxItem& rBox = GetBox();
493  return rShadow.CalcShadowSpace(SvxShadowItemSide::TOP ) + rBox.CalcLineSpace(SvxBoxItemLine::TOP);
494 }
495 
497 {
498  const SvxShadowItem& rShadow = GetShadow();
499  const SvxBoxItem& rBox = GetBox();
500  return rShadow.CalcShadowSpace(SvxShadowItemSide::BOTTOM) + rBox.CalcLineSpace(SvxBoxItemLine::BOTTOM);
501 }
502 
504 {
505  const SvxShadowItem& rShadow = GetShadow();
506  const SvxBoxItem& rBox = GetBox();
507  return rShadow.CalcShadowSpace(SvxShadowItemSide::LEFT) + rBox.CalcLineSpace(SvxBoxItemLine::LEFT);
508 }
509 
511 {
512  const SvxShadowItem& rShadow = GetShadow();
513  const SvxBoxItem& rBox = GetBox();
514  return rShadow.CalcShadowSpace(SvxShadowItemSide::RIGHT) + rBox.CalcLineSpace(SvxBoxItemLine::RIGHT);
515 }
516 
517 // erase attribute from the set
518 void SwFlyFrameAttrMgr::DelAttr( sal_uInt16 nId )
519 {
520  m_aSet.ClearItem( nId );
521 }
522 
523 void SwFlyFrameAttrMgr::SetLRSpace( long nLeft, long nRight )
524 {
525  OSL_ENSURE( LONG_MAX != nLeft && LONG_MAX != nRight, "Which border to set?" );
526 
528  if( LONG_MAX != nLeft )
529  aTmp.SetLeft( sal_uInt16(nLeft) );
530  if( LONG_MAX != nRight )
531  aTmp.SetRight( sal_uInt16(nRight) );
532  m_aSet.Put( aTmp );
533 }
534 
535 void SwFlyFrameAttrMgr::SetULSpace( long nTop, long nBottom )
536 {
537  OSL_ENSURE(LONG_MAX != nTop && LONG_MAX != nBottom, "Which border to set?" );
538 
540  if( LONG_MAX != nTop )
541  aTmp.SetUpper( sal_uInt16(nTop) );
542  if( LONG_MAX != nBottom )
543  aTmp.SetLower( sal_uInt16(nBottom) );
544  m_aSet.Put( aTmp );
545 }
546 
547 void SwFlyFrameAttrMgr::SetPos( const Point& rPoint )
548 {
549  SwFormatVertOrient aVertOrient( GetVertOrient() );
550  SwFormatHoriOrient aHoriOrient( GetHoriOrient() );
551 
552  aHoriOrient.SetPos ( rPoint.X() );
554 
555  aVertOrient.SetPos ( rPoint.Y() );
557 
558  m_aSet.Put( aVertOrient );
559  m_aSet.Put( aHoriOrient );
560 }
561 
562 void SwFlyFrameAttrMgr::SetHorzOrientation( sal_Int16 eOrient )
563 {
564  SwFormatHoriOrient aHoriOrient( GetHoriOrient() );
565  aHoriOrient.SetHoriOrient( eOrient );
566  m_aSet.Put( aHoriOrient );
567 }
568 
569 void SwFlyFrameAttrMgr::SetVertOrientation( sal_Int16 eOrient )
570 {
571  SwFormatVertOrient aVertOrient( GetVertOrient() );
572  aVertOrient.SetVertOrient( eOrient );
573  m_aSet.Put( aVertOrient );
574 }
575 
577 {
578  SwFormatFrameSize aSize( GetFrameSize() );
579  aSize.SetHeightSizeType( eType );
580  m_aSet.Put( aSize );
581 }
582 
583 void SwFlyFrameAttrMgr::SetRotation(sal_uInt16 nOld, sal_uInt16 nNew, const Size& rUnrotatedSize)
584 {
585  // RotGrfFlyFrame: Central handling of real change of rotation here, all adaptions use this.
586  // Adaption of pos/size may be wanted in the future. Already tried to keep last Size in
587  // UnrotatedSize in the SwRotationGrf Item, but this will lead to various problems. Also tried
588  // to use m_aSet.Put(...) as in other methods (also tried read methods for Rotation/UnrotatedSize) but
589  // somehow the needed ID (RES_GRFATR_ROTATION) is *not* in the SfxItemSet of the Frame, so for
590  // now set directly. Undo/Redo is preserved by AttributeChange
591  if(nOld != nNew)
592  {
593  m_pOwnSh->SetAttrItem(SwRotationGrf(nNew, rUnrotatedSize));
594  }
595 }
596 
597 void SwFlyFrameAttrMgr::SetSize( const Size& rSize )
598 {
599  SwFormatFrameSize aSize( GetFrameSize() );
600  aSize.SetSize(Size(std::max(rSize.Width(), long(MINFLY)), std::max(rSize.Height(), long(MINFLY))));
601  m_aSet.Put( aSize );
602 }
603 
605 {
606  m_aSet.ClearItem();
607  m_aSet.Put( rSet );
608 }
609 
610 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
long Width() const
void SetFlyName(const OUString &rName)
Set name at selected FlyFrame.
Definition: fefly1.cxx:1436
void FrameNotify(SwViewShell *pVwSh, FlyMode eMode)
Definition: edtwin3.cxx:85
const SwFormatFrameSize & GetFrameSize() const
Definition: frmmgr.hxx:150
#define RES_FRM_SIZE
Definition: hintids.hxx:194
SAL_DLLPRIVATE SwTwips CalcTopSpace()
Definition: frmmgr.cxx:489
Marks a position in the document model.
Definition: pam.hxx:35
void SetPos(const Point &rLPoint)
Definition: frmmgr.cxx:547
void UpdateAttrMgr()
Definition: frmmgr.cxx:119
long Height() const
bool m_bIsInVerticalL2R
Definition: frmmgr.hxx:59
#define MINFLY
Definition: swtypes.hxx:65
#define RES_FRMATR_END
Definition: hintids.hxx:236
void Height(long nNew)
Definition: swrect.hxx:189
sal_Int16 nId
void GetPageNum(sal_uInt16 &rnPhyNum, sal_uInt16 &rnVirtNum, bool bAtCursorPos=true, const bool bCalcFrame=true)
Definition: crsrsh.cxx:1197
void SetCol(const SwFormatCol &rCol)
Definition: frmmgr.cxx:229
long SwTwips
Definition: swtypes.hxx:49
void Pos(const Point &rNew)
Definition: swrect.hxx:167
void SetULSpace(long nTop, long nBottom)
Definition: frmmgr.cxx:535
SwWrtShell * m_pOwnSh
Definition: frmmgr.hxx:53
Of course Writer needs its own rectangles.
Definition: swrect.hxx:34
void SetModified()
Definition: edws.cxx:69
void DelAttr(sal_uInt16 nId)
Definition: frmmgr.cxx:518
void EndAllAction()
Definition: edws.cxx:96
Used by the UI to modify the document model.
Definition: wrtsh.hxx:88
const SwTwips DFLT_HEIGHT
Definition: frmmgr.hxx:38
void SetLeft(const long nL, const sal_uInt16 nProp=100)
const SwView & GetView() const
Definition: wrtsh.hxx:426
Value in Var-direction gives minimum (can be exceeded but not be less).
Definition: fmtfsize.hxx:39
void Top(const long nTop)
Definition: swrect.hxx:202
void SetHoriOrient(sal_Int16 eNew)
Definition: fmtornt.hxx:89
#define XATTR_FILL_LAST
#define XATTR_FILL_FIRST
#define RES_UL_SPACE
Definition: hintids.hxx:197
void SetVertOrientation(sal_Int16 eOrient)
Definition: frmmgr.cxx:569
SwFlyFrameAttrMgr(bool bNew, SwWrtShell *pSh, Frmmgr_Type nType)
Definition: frmmgr.cxx:65
void Right(const long nRight)
Definition: swrect.hxx:198
void SetFlyPos(const Point &rAbsPos)
Definition: fefly1.cxx:377
if(nullptr==pCandidateA||nullptr==pCandidateB)
void InsertFlyFrame()
Definition: frmmgr.cxx:174
bool GetFlyFrameAttr(SfxItemSet &rSet) const
Definition: fefly1.cxx:1023
void SetHeightSizeType(SwFrameSize eType)
Definition: frmmgr.cxx:576
sal_uInt16 ClearItem(sal_uInt16 nWhich=0)
#define RES_ANCHOR
Definition: hintids.hxx:209
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
void SetAbsPos(const Point &rLPoint)
Definition: frmmgr.cxx:235
SfxItemSet m_aSet
Definition: frmmgr.hxx:51
void SetVertOrient(sal_Int16 eNew)
Definition: fmtornt.hxx:56
#define RES_GRFATR_ROTATION
Definition: hintids.hxx:242
sal_uInt16 CalcShadowSpace(SvxShadowItemSide nShadow) const
void SetAttrItem(const SfxPoolItem &, SetAttrMode nFlags=SetAttrMode::DEFAULT, const bool bParagraphSetting=false)
Definition: edatmisc.cxx:113
void SetPos(SwTwips nNew)
Definition: fmtornt.hxx:60
sal_uInt16 Count() const
FlyAnchors.
Definition: fmtanchr.hxx:34
bool SetFlyFrameAttr(SfxItemSet &rSet)
Definition: fefly1.cxx:1066
sal_uInt16 GetHtmlMode(const SwDocShell *pShell)
Definition: viewopt.cxx:339
void SetAttrSet(const SfxItemSet &rSet)
Definition: frmmgr.cxx:604
void SetRelationOrient(sal_Int16 eNew)
Definition: fmtornt.hxx:90
SAL_DLLPRIVATE SwTwips CalcBottomSpace()
Definition: frmmgr.cxx:496
void SetAnchor(RndStdIds eId)
Definition: frmmgr.cxx:210
SwFrameSize
Definition: fmtfsize.hxx:35
Frmmgr_Type
Definition: frmmgr.hxx:40
void SSize(const Size &rNew)
Definition: swrect.hxx:176
SfxItemPool * GetPool() const
long X() const
const long LONG_MAX
SwDocShell * GetDocShell()
Definition: view.cxx:1115
void CalcBoundRect(SwRect &_orRect, const RndStdIds _nAnchorId, const sal_Int16 _eHoriRelOrient=css::text::RelOrientation::FRAME, const sal_Int16 _eVertRelOrient=css::text::RelOrientation::FRAME, const SwPosition *_pToCharContentPos=nullptr, const bool _bFollowTextFlow=false, bool _bMirror=false, Point *_opRef=nullptr, Size *_opPercent=nullptr, const SwFormatFrameSize *pFormatFrameSize=nullptr) const
i#17567 - adjustments to allow negative vertical positions for fly frames anchored to paragraph or to...
Definition: fews.cxx:730
#define RES_LR_SPACE
Definition: hintids.hxx:196
void SetParent(const SfxItemSet *pNew)
void Left(const long nLeft)
Definition: swrect.hxx:193
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
void Bottom(const long nBottom)
Definition: swrect.hxx:207
const SwFrameFormat * NewFlyFrame(const SfxItemSet &rSet, bool bAnchValid=false, SwFrameFormat *pParent=nullptr)
Definition: fefly1.cxx:632
SAL_DLLPRIVATE SwTwips CalcRightSpace()
Definition: frmmgr.cxx:510
bool IsFrameVertical(const bool bEnvironment, bool &bRightToLeft, bool &bVertL2R) const
Determines whether a frame or its environment is vertically formatted and right-to-left.
Definition: fews.cxx:1296
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
void SetHorzOrientation(sal_Int16 eOrient)
Definition: frmmgr.cxx:562
void Width(long nNew)
Definition: swrect.hxx:185
#define FN_SET_FRM_NAME
Definition: cmdid.h:826
SwFormat * GetFormatFromPool(sal_uInt16 nId)
return the requested automatic format - base-class !
Definition: edfmt.cxx:131
void SetSize(const Size &rSize)
void SetSize(const Size &rLSize)
Definition: frmmgr.cxx:597
void SetRelationOrient(sal_Int16 eNew)
Definition: fmtornt.hxx:57
const SwFormatVertOrient & GetVertOrient() const
Definition: frmmgr.hxx:142
sal_uInt16 CalcLineSpace(SvxBoxItemLine nLine, bool bEvenIfNoLine=false) const
void SetPos(SwTwips nNew)
Definition: fmtornt.hxx:93
SW_DLLPUBLIC void PrepareBoxInfo(SfxItemSet &rSet, const SwWrtShell &rSh)
Definition: uitool.cxx:103
bool m_bIsInVertical
Definition: frmmgr.hxx:57
void SetRotation(sal_uInt16 nOld, sal_uInt16 nNew, const Size &rUnrotatedSize)
Definition: frmmgr.cxx:583
RndStdIds
void SetLRSpace(long nLeft, long nRight)
Definition: frmmgr.cxx:523
const SvxShadowItem & GetShadow() const
Definition: frmmgr.hxx:154
void EnterSelFrameMode(const Point *pStartDrag=nullptr)
Definition: select.cxx:703
const SwAttrSet & GetAttrSet() const
For querying the attribute array.
Definition: format.hxx:116
std::vector< bool, std::allocator< bool > > m_aSet
const SwTwips DFLT_WIDTH
Definition: frmmgr.hxx:37
void StartAllAction()
For all views of this document.
Definition: edws.cxx:85
void SetUpper(const sal_uInt16 nU, const sal_uInt16 nProp=100)
void Chg(const Point &rNP, const Size &rNS)
Definition: swrect.hxx:162
void SetHeightSizeType(SwFrameSize eSize)
Definition: fmtfsize.hxx:81
#define RES_FRMATR_BEGIN
Definition: hintids.hxx:192
bool IsFrameSelected() const
Definition: feshview.cxx:1175
void ValidateMetrics(SvxSwFrameValidation &rVal, const SwPosition *pToCharContentPos, bool bOnlyPercentRefValue=false)
Definition: frmmgr.cxx:248
SAL_DLLPRIVATE void UpdateFlyFrame_()
Definition: frmmgr.cxx:126
SAL_DLLPRIVATE SwTwips CalcLeftSpace()
Definition: frmmgr.cxx:503
const SwFormatHoriOrient & GetHoriOrient() const
Definition: frmmgr.hxx:146
long Y() const
const SvxBoxItem & GetBox() const
Definition: frmmgr.hxx:158
void UpdateFlyFrame()
Definition: frmmgr.cxx:143
static sal_uInt16 aFrameMgrRange[]
Definition: frmmgr.cxx:49