LibreOffice Module sw (master)  1
viewtab.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 <uitool.hxx>
22 #include <sfx2/app.hxx>
23 #include <svx/rulritem.hxx>
24 #include <svx/xflclit.hxx>
25 #include <svx/xflgrit.hxx>
26 #include <svx/xflhtit.hxx>
27 #include <svx/xbtmpit.hxx>
28 #include <svx/xfillit0.hxx>
29 #include <svx/svxids.hrc>
30 #include <editeng/tstpitem.hxx>
31 #include <sfx2/request.hxx>
32 #include <sfx2/viewfrm.hxx>
33 #include <editeng/lrspitem.hxx>
34 #include <editeng/ulspitem.hxx>
35 #include <editeng/boxitem.hxx>
36 #include <editeng/frmdiritem.hxx>
37 #include <svl/eitem.hxx>
38 #include <svl/whiter.hxx>
39 #include <svx/ruler.hxx>
40 #include <editeng/protitem.hxx>
41 #include <svl/rectitem.hxx>
42 #include <sfx2/bindings.hxx>
43 #include <fmtfsize.hxx>
44 #include <fmthdft.hxx>
45 #include <fmtclds.hxx>
46 #include <fmtornt.hxx>
47 #include <frmatr.hxx>
48 #include <edtwin.hxx>
49 #include <view.hxx>
50 #include <wrtsh.hxx>
51 #include <basesh.hxx>
52 #include <cmdid.h>
53 #include <viewopt.hxx>
54 #include <tabcol.hxx>
55 #include <frmfmt.hxx>
56 #include <pagedesc.hxx>
57 #include <wview.hxx>
58 #include <fmtcol.hxx>
59 #include <section.hxx>
60 #include <swruler.hxx>
61 
62 #include <ndtxt.hxx>
63 #include <pam.hxx>
64 
66 
67 #include <svx/xtable.hxx>
68 
69 using namespace ::com::sun::star;
70 
71 // Pack columns
72 static void lcl_FillSvxColumn(const SwFormatCol& rCol,
73  long nTotalWidth,
74  SvxColumnItem& rColItem,
75  long nDistance)
76 {
77  const SwColumns& rCols = rCol.GetColumns();
78 
79  bool bOrtho = rCol.IsOrtho() && !rCols.empty();
80  long nInnerWidth = 0;
81  if( bOrtho )
82  {
83  nInnerWidth = nTotalWidth;
84  for (const auto & i : rCols)
85  {
86  nInnerWidth -= i.GetLeft() + i.GetRight();
87  }
88  if( nInnerWidth < 0 )
89  nInnerWidth = 0;
90  else
91  nInnerWidth /= rCols.size();
92  }
93 
94  long nWidth = 0;
95  for ( size_t i = 0; i < rCols.size(); ++i )
96  {
97  const SwColumn* pCol = &rCols[i];
98  const long nStart = pCol->GetLeft() + nWidth + nDistance;
99  if( bOrtho )
100  nWidth += nInnerWidth + pCol->GetLeft() + pCol->GetRight();
101  else
102  nWidth += rCol.CalcColWidth(i, static_cast< sal_uInt16 >(nTotalWidth));
103  const long nEnd = nWidth - pCol->GetRight() + nDistance;
104 
105  SvxColumnDescription aColDesc(nStart, nEnd, true);
106  rColItem.Append(aColDesc);
107  }
108 }
109 
110 // Transfer ColumnItem in ColumnInfo
111 static void lcl_ConvertToCols(const SvxColumnItem& rColItem,
112  long nTotalWidth,
113  SwFormatCol& rCols)
114 {
115  OSL_ENSURE( rCols.GetNumCols() == rColItem.Count(), "Column count mismatch" );
116  // ruler executes that change the columns shortly after the selection has changed
117  // can result in a crash
118  if(rCols.GetNumCols() != rColItem.Count())
119  return;
120 
121  sal_uInt16 nLeft = 0;
122  SwTwips nSumAll= 0; // Sum up all columns and margins
123 
124  SwColumns& rArr = rCols.GetColumns();
125 
126  // Tabcols sequentially
127  for( sal_uInt16 i=0; i < rColItem.Count()-1; ++i )
128  {
129  OSL_ENSURE(rColItem[i+1].nStart >= rColItem[i].nEnd,"overlapping columns" );
130  const long nStart = std::max(rColItem[i+1].nStart, rColItem[i].nEnd);
131  const sal_uInt16 nRight = static_cast<sal_uInt16>((nStart - rColItem[i].nEnd) / 2);
132 
133  const long nWidth = rColItem[i].nEnd - rColItem[i].nStart + nLeft + nRight;
134 
135  SwColumn* pCol = &rArr[i];
136  pCol->SetWishWidth( sal_uInt16(long(rCols.GetWishWidth()) * nWidth / nTotalWidth ));
137  pCol->SetLeft( nLeft );
138  pCol->SetRight( nRight );
139  nSumAll += pCol->GetWishWidth();
140 
141  nLeft = nRight;
142  }
143  rArr[rColItem.Count()-1].SetLeft( nLeft );
144 
145  // The difference between the total sum of the desired width and the so far
146  // calculated columns and margins should result in the width of the last column.
147  rArr[rColItem.Count()-1].SetWishWidth( rCols.GetWishWidth() - static_cast<sal_uInt16>(nSumAll) );
148 
149  rCols.SetOrtho(false, 0, 0 );
150 }
151 
152 // Delete tabs
153 static void lcl_EraseDefTabs(SvxTabStopItem& rTabStops)
154 {
155  // Delete DefTabs
156  for ( sal_uInt16 i = 0; i < rTabStops.Count(); )
157  {
158  // Here also throw out the DefTab to zero
159  if ( SvxTabAdjust::Default == rTabStops[i].GetAdjustment() ||
160  rTabStops[i].GetTabPos() == 0 )
161  {
162  rTabStops.Remove(i);
163  continue;
164  }
165  ++i;
166  }
167 }
168 
169 // Flip page margin
170 void SwView::SwapPageMargin(const SwPageDesc& rDesc, SvxLRSpaceItem& rLRSpace)
171 {
172  sal_uInt16 nPhyPage, nVirPage;
173  GetWrtShell().GetPageNum( nPhyPage, nVirPage );
174 
175  if ( rDesc.GetUseOn() == UseOnPage::Mirror && (nPhyPage % 2) == 0 )
176  {
177  long nTmp = rLRSpace.GetRight();
178  rLRSpace.SetRight( rLRSpace.GetLeft() );
179  rLRSpace.SetLeft( nTmp );
180  }
181 }
182 
183 // If the frame border is moved, the column separator
184 // should stay in the same absolute position.
185 static void lcl_Scale(long& nVal, long nScale)
186 {
187  nVal *= nScale;
188  nVal >>= 8;
189 }
190 
191 static void ResizeFrameCols(SwFormatCol& rCol,
192  long nOldWidth,
193  long nNewWidth,
194  long nLeftDelta )
195 {
196  SwColumns& rArr = rCol.GetColumns();
197  long nWishSum = static_cast<long>(rCol.GetWishWidth());
198  long nWishDiff = (nWishSum * 100/nOldWidth * nNewWidth) / 100 - nWishSum;
199  long nNewWishWidth = nWishSum + nWishDiff;
200  if(nNewWishWidth > 0xffffl)
201  {
202  // If the desired width is getting too large, then all values
203  // must be scaled appropriately.
204  long nScale = (0xffffl << 8)/ nNewWishWidth;
205  for(SwColumn & i : rArr)
206  {
207  SwColumn* pCol = &i;
208  long nVal = pCol->GetWishWidth();
209  lcl_Scale(nVal, nScale);
210  pCol->SetWishWidth(static_cast<sal_uInt16>(nVal));
211  nVal = pCol->GetLeft();
212  lcl_Scale(nVal, nScale);
213  pCol->SetLeft(static_cast<sal_uInt16>(nVal));
214  nVal = pCol->GetRight();
215  lcl_Scale(nVal, nScale);
216  pCol->SetRight(static_cast<sal_uInt16>(nVal));
217  }
218  lcl_Scale(nNewWishWidth, nScale);
219  lcl_Scale(nWishDiff, nScale);
220  }
221  rCol.SetWishWidth( static_cast<sal_uInt16>(nNewWishWidth) );
222 
223  if( nLeftDelta >= 2 || nLeftDelta <= -2)
224  rArr.front().SetWishWidth(rArr.front().GetWishWidth() + static_cast<sal_uInt16>(nWishDiff));
225  else
226  rArr.back().SetWishWidth(rArr.back().GetWishWidth() + static_cast<sal_uInt16>(nWishDiff));
227  // Reset auto width
228  rCol.SetOrtho(false, 0, 0 );
229 }
230 
231 // Here all changes to the tab bar will be shot again into the model.
232 void SwView::ExecTabWin( SfxRequest const & rReq )
233 {
234  SwWrtShell &rSh = GetWrtShell();
235  const FrameTypeFlags nFrameType = rSh.IsObjSelected() ?
237  rSh.GetFrameType(nullptr,true);
238  const bool bFrameSelection = rSh.IsFrameSelected();
239  const bool bBrowse = rSh.GetViewOptions()->getBrowseMode();
240 
241  const sal_uInt16 nSlot = rReq.GetSlot();
242  const SfxItemSet* pReqArgs = rReq.GetArgs();
243  const size_t nDescId = rSh.GetCurPageDesc();
244  const SwPageDesc& rDesc = rSh.GetPageDesc( nDescId );
245 
246  const bool bVerticalWriting = rSh.IsInVerticalText();
247  const SwFormatHeader& rHeaderFormat = rDesc.GetMaster().GetHeader();
248  SwFrameFormat *pHeaderFormat = const_cast<SwFrameFormat*>(rHeaderFormat.GetHeaderFormat());
249 
250  const SwFormatFooter& rFooterFormat = rDesc.GetMaster().GetFooter();
251  SwFrameFormat *pFooterFormat = const_cast<SwFrameFormat*>(rFooterFormat.GetFooterFormat());
252 
253  const SwFormatFrameSize &rFrameSize = rDesc.GetMaster().GetFrameSize();
254 
255  const SwRect& rPageRect = rSh.GetAnyCurRect(CurRectType::Page);
256  const long nPageWidth = bBrowse ? rPageRect.Width() : rFrameSize.GetWidth();
257  const long nPageHeight = bBrowse ? rPageRect.Height() : rFrameSize.GetHeight();
258 
259  bool bUnlockView = false;
260  rSh.StartAllAction();
261  bool bSect = bool(nFrameType & FrameTypeFlags::COLSECT);
262 
263  switch (nSlot)
264  {
265  case SID_ATTR_LONG_LRSPACE:
266  if ( pReqArgs )
267  {
268  SvxLongLRSpaceItem aLongLR( static_cast<const SvxLongLRSpaceItem&>(pReqArgs->
269  Get( SID_ATTR_LONG_LRSPACE )) );
271  if ( !bSect && (bFrameSelection || nFrameType & FrameTypeFlags::FLY_ANY) )
272  {
273  SwFrameFormat* pFormat = rSh.GetFlyFrameFormat();
274  const SwRect &rRect = rSh.GetAnyCurRect(CurRectType::FlyEmbedded);
275 
276  bool bVerticalFrame(false);
277  {
278  bool bRTL;
279  bool bVertL2R;
280  bVerticalFrame = ( bFrameSelection &&
281  rSh.IsFrameVertical(true, bRTL, bVertL2R) ) ||
282  ( !bFrameSelection && bVerticalWriting);
283  }
284  long nDeltaX = bVerticalFrame ?
285  rRect.Right() - rPageRect.Right() + aLongLR.GetRight() :
286  rPageRect.Left() + aLongLR.GetLeft() - rRect.Left();
287 
290  RES_COL, RES_COL>{} );
291 
292  if(bVerticalFrame)
293  {
294  SwFormatVertOrient aVertOrient(pFormat->GetVertOrient());
296  aVertOrient.SetPos(aVertOrient.GetPos() + nDeltaX );
297  aSet.Put( aVertOrient );
298  }
299  else
300  {
301  SwFormatHoriOrient aHoriOrient( pFormat->GetHoriOrient() );
303  aHoriOrient.SetPos( aHoriOrient.GetPos() + nDeltaX );
304  aSet.Put( aHoriOrient );
305  }
306 
307  SwFormatFrameSize aSize( pFormat->GetFrameSize() );
308  long nOldWidth = aSize.GetWidth();
309 
310  if(aSize.GetWidthPercent())
311  {
312  SwRect aRect;
313  rSh.CalcBoundRect(aRect, RndStdIds::FLY_AS_CHAR);
314  long nPrtWidth = aRect.Width();
315  aSize.SetWidthPercent(sal_uInt8((nPageWidth - aLongLR.GetLeft() - aLongLR.GetRight()) * 100 /nPrtWidth));
316  }
317  else
318  aSize.SetWidth( nPageWidth -
319  (aLongLR.GetLeft() + aLongLR.GetRight()));
320 
321  if( nFrameType & FrameTypeFlags::COLUMN )
322  {
323  SwFormatCol aCol(pFormat->GetCol());
324 
325  ::ResizeFrameCols(aCol, nOldWidth, aSize.GetWidth(), nDeltaX );
326  aSet.Put(aCol);
327  }
328 
329  aSet.Put( aSize );
330 
331  rSh.StartAction();
332  rSh.Push();
333  rSh.SetFlyFrameAttr( aSet );
334  // Cancel the frame selection
335  if(!bFrameSelection && rSh.IsFrameSelected())
336  {
337  rSh.UnSelectFrame();
338  rSh.LeaveSelFrameMode();
339  }
340  rSh.Pop();
341  rSh.EndAction();
342  }
343  else if ( nFrameType & ( FrameTypeFlags::HEADER | FrameTypeFlags::FOOTER ))
344  {
345  // Subtract out page margins
346  long nOld = rDesc.GetMaster().GetLRSpace().GetLeft();
347  aLongLR.SetLeft( nOld > aLongLR.GetLeft() ? 0 : aLongLR.GetLeft() - nOld );
348 
349  nOld = rDesc.GetMaster().GetLRSpace().GetRight();
350  aLongLR.SetRight( nOld > aLongLR.GetRight() ? 0 : aLongLR.GetRight() - nOld );
351  aLR.SetLeft(aLongLR.GetLeft());
352  aLR.SetRight(aLongLR.GetRight());
353 
354  if ( nFrameType & FrameTypeFlags::HEADER && pHeaderFormat )
355  pHeaderFormat->SetFormatAttr( aLR );
356  else if( nFrameType & FrameTypeFlags::FOOTER && pFooterFormat )
357  pFooterFormat->SetFormatAttr( aLR );
358  }
359  else if( nFrameType == FrameTypeFlags::DRAWOBJ)
360  {
361  SwRect aRect( rSh.GetObjRect() );
362  aRect.Left( aLongLR.GetLeft() + rPageRect.Left() );
363  aRect.Right( rPageRect.Right() - aLongLR.GetRight());
364  rSh.SetObjRect( aRect );
365  }
366  else if(bSect || rSh.IsDirectlyInSection())
367  {
368  //change the section indents and the columns if available
369  //at first determine the changes
371  const SwRect aTmpRect = rSh.GetAnyCurRect(CurRectType::Section);
372  aSectRect.Pos() += aTmpRect.Pos();
373  long nLeftDiff = aLongLR.GetLeft() - static_cast<long>(aSectRect.Left() - rPageRect.Left() );
374  long nRightDiff = aLongLR.GetRight() - static_cast<long>( rPageRect.Right() - aSectRect.Right());
375  //change the LRSpaceItem of the section accordingly
376  const SwSection* pCurrSect = rSh.GetCurrSection();
377  const SwSectionFormat* pSectFormat = pCurrSect->GetFormat();
378  SvxLRSpaceItem aLRTmp = pSectFormat->GetLRSpace();
379  aLRTmp.SetLeft(aLRTmp.GetLeft() + nLeftDiff);
380  aLRTmp.SetRight(aLRTmp.GetRight() + nRightDiff);
382  aSet.Put(aLRTmp);
383  //change the first/last column
384  if(bSect)
385  {
386  SwFormatCol aCols( pSectFormat->GetCol() );
387  long nDiffWidth = nLeftDiff + nRightDiff;
388  ::ResizeFrameCols(aCols, aSectRect.Width(), aSectRect.Width() - nDiffWidth, nLeftDiff );
389  aSet.Put( aCols );
390  }
391  SwSectionData aData(*pCurrSect);
392  rSh.UpdateSection(rSh.GetSectionFormatPos(*pSectFormat), aData, &aSet);
393  }
394  else
395  { // Adjust page margins
396  aLR.SetLeft(aLongLR.GetLeft());
397  aLR.SetRight(aLongLR.GetRight());
398  SwapPageMargin( rDesc, aLR );
399  SwPageDesc aDesc( rDesc );
400  aDesc.GetMaster().SetFormatAttr( aLR );
401  rSh.ChgPageDesc( nDescId, aDesc );
402  }
403  }
404  break;
405 
406  // apply new left and right margins to current page style
407  case SID_ATTR_PAGE_LRSPACE:
408  if ( pReqArgs )
409  {
410  const SvxLongLRSpaceItem& aLongLR( pReqArgs->Get( SID_ATTR_PAGE_LRSPACE ) );
411 
412  SwPageDesc aDesc( rDesc );
413  {
415  aLR.SetLeft(aLongLR.GetLeft());
416  aLR.SetRight(aLongLR.GetRight());
417  SwapPageMargin( rDesc, aLR );
418  aDesc.GetMaster().SetFormatAttr( aLR );
419  }
420  rSh.ChgPageDesc( nDescId, aDesc );
421  }
422  break;
423 
424  case SID_ATTR_LONG_ULSPACE:
425  if ( pReqArgs )
426  {
427  SvxLongULSpaceItem aLongULSpace( static_cast<const SvxLongULSpaceItem&>(pReqArgs->
428  Get( SID_ATTR_LONG_ULSPACE )));
429 
430  if( bFrameSelection || nFrameType & FrameTypeFlags::FLY_ANY )
431  {
432  SwFrameFormat* pFormat = rSh.GetFlyFrameFormat();
433  const SwRect &rRect = rSh.GetAnyCurRect(CurRectType::FlyEmbedded);
434  const long nDeltaY = rPageRect.Top() + aLongULSpace.GetUpper() - rRect.Top();
435  const long nHeight = nPageHeight - (aLongULSpace.GetUpper() + aLongULSpace.GetLower());
436 
439  //which of the orientation attributes is to be put depends on the frame's environment
440  bool bRTL;
441  bool bVertL2R;
442  if ( ( bFrameSelection &&
443  rSh.IsFrameVertical(true, bRTL, bVertL2R ) ) ||
444  ( !bFrameSelection && bVerticalWriting ) )
445  {
446  SwFormatHoriOrient aHoriOrient(pFormat->GetHoriOrient());
448  aHoriOrient.SetPos(aHoriOrient.GetPos() + nDeltaY );
449  aSet.Put( aHoriOrient );
450  }
451  else
452  {
453  SwFormatVertOrient aVertOrient(pFormat->GetVertOrient());
455  aVertOrient.SetPos(aVertOrient.GetPos() + nDeltaY );
456  aSet.Put( aVertOrient );
457  }
458  SwFormatFrameSize aSize(pFormat->GetFrameSize());
459  if(aSize.GetHeightPercent())
460  {
461  SwRect aRect;
462  rSh.CalcBoundRect(aRect, RndStdIds::FLY_AS_CHAR);
463  long nPrtHeight = aRect.Height();
464  aSize.SetHeightPercent(sal_uInt8(nHeight * 100 /nPrtHeight));
465  }
466  else
467  aSize.SetHeight(nHeight );
468 
469  aSet.Put( aSize );
470  rSh.SetFlyFrameAttr( aSet );
471  }
472  else if( nFrameType == FrameTypeFlags::DRAWOBJ )
473  {
474  SwRect aRect( rSh.GetObjRect() );
475  aRect.Top( aLongULSpace.GetUpper() + rPageRect.Top() );
476  aRect.Bottom( rPageRect.Bottom() - aLongULSpace.GetLower() );
477  rSh.SetObjRect( aRect ) ;
478  }
479  else if(bVerticalWriting && (bSect || rSh.IsDirectlyInSection()))
480  {
481  //change the section indents and the columns if available
482  //at first determine the changes
484  const SwRect aTmpRect = rSh.GetAnyCurRect(CurRectType::Section);
485  aSectRect.Pos() += aTmpRect.Pos();
486  const long nLeftDiff = aLongULSpace.GetUpper() - static_cast<long>(aSectRect.Top() - rPageRect.Top());
487  const long nRightDiff = aLongULSpace.GetLower() - static_cast<long>(nPageHeight - aSectRect.Bottom() + rPageRect.Top());
488  //change the LRSpaceItem of the section accordingly
489  const SwSection* pCurrSect = rSh.GetCurrSection();
490  const SwSectionFormat* pSectFormat = pCurrSect->GetFormat();
491  SvxLRSpaceItem aLR = pSectFormat->GetLRSpace();
492  aLR.SetLeft(aLR.GetLeft() + nLeftDiff);
493  aLR.SetRight(aLR.GetRight() + nRightDiff);
495  aSet.Put(aLR);
496  //change the first/last column
497  if(bSect)
498  {
499  SwFormatCol aCols( pSectFormat->GetCol() );
500  long nDiffWidth = nLeftDiff + nRightDiff;
501  ::ResizeFrameCols(aCols, aSectRect.Height(), aSectRect.Height() - nDiffWidth, nLeftDiff );
502  aSet.Put( aCols );
503  }
504  SwSectionData aData(*pCurrSect);
505  rSh.UpdateSection(rSh.GetSectionFormatPos(*pSectFormat), aData, &aSet);
506  }
507  else
508  { SwPageDesc aDesc( rDesc );
509 
510  if ( nFrameType & ( FrameTypeFlags::HEADER | FrameTypeFlags::FOOTER ))
511  {
512 
513  const bool bHead = bool(nFrameType & FrameTypeFlags::HEADER);
514  SvxULSpaceItem aUL( rDesc.GetMaster().GetULSpace() );
515  if ( bHead )
516  aUL.SetUpper( static_cast<sal_uInt16>(aLongULSpace.GetUpper()) );
517  else
518  aUL.SetLower( static_cast<sal_uInt16>(aLongULSpace.GetLower()) );
519  aDesc.GetMaster().SetFormatAttr( aUL );
520 
521  if( (bHead && pHeaderFormat) || (!bHead && pFooterFormat) )
522  {
523  SwFormatFrameSize aSz( bHead ? pHeaderFormat->GetFrameSize() :
524  pFooterFormat->GetFrameSize() );
526  aSz.SetHeight(nPageHeight - aLongULSpace.GetLower() -
527  aLongULSpace.GetUpper() );
528  if ( bHead )
529  pHeaderFormat->SetFormatAttr( aSz );
530  else
531  pFooterFormat->SetFormatAttr( aSz );
532  }
533  }
534  else
535  {
537  aUL.SetUpper(static_cast<sal_uInt16>(aLongULSpace.GetUpper()));
538  aUL.SetLower(static_cast<sal_uInt16>(aLongULSpace.GetLower()));
539  aDesc.GetMaster().SetFormatAttr(aUL);
540  }
541 
542  rSh.ChgPageDesc( nDescId, aDesc );
543  }
544  }
545  break;
546 
547  // apply new top and bottom margins to current page style
548  case SID_ATTR_PAGE_ULSPACE:
549  if ( pReqArgs )
550  {
551  const SvxLongULSpaceItem& aLongULSpace( pReqArgs->Get( SID_ATTR_PAGE_ULSPACE ) );
552 
553  SwPageDesc aDesc( rDesc );
554  {
556  aUL.SetUpper(static_cast<sal_uInt16>(aLongULSpace.GetUpper()));
557  aUL.SetLower(static_cast<sal_uInt16>(aLongULSpace.GetLower()));
558  aDesc.GetMaster().SetFormatAttr(aUL);
559  }
560  rSh.ChgPageDesc( nDescId, aDesc );
561  }
562  break;
563 
565  if ( pReqArgs )
566  {
567  const SfxInt16Item aColumnItem( static_cast<const SfxInt16Item&>(pReqArgs->Get(nSlot)) );
568  const sal_uInt16 nPageColumnType = aColumnItem.GetValue();
569 
570  // nPageColumnType =
571  // 1 - single-columned page
572  // 2 - two-columned page
573  // 3 - three-columned page
574  // 4 - two-columned page with left column width of 2/3 of page width
575  // 5 - two-columned page with right column width of 2/3 of page width
576 
577  sal_uInt16 nCount = 2;
578  if ( nPageColumnType == 1 )
579  {
580  nCount = 0;
581  }
582  else if ( nPageColumnType == 3 )
583  {
584  nCount = 3;
585  }
586 
587  const sal_uInt16 nGutterWidth = 0;
588 
589  const SvxLRSpaceItem aLR( rDesc.GetMaster().GetLRSpace() );
590  const long nLeft = aLR.GetLeft();
591  const long nRight = aLR.GetRight();
592  const long nWidth = nPageWidth - nLeft - nRight;
593 
594  SwFormatCol aCols( rDesc.GetMaster().GetCol() );
595  aCols.Init( nCount, nGutterWidth, nWidth );
596  aCols.SetWishWidth( nWidth );
597  aCols.SetGutterWidth( nGutterWidth, nWidth );
598  aCols.SetOrtho( false, nGutterWidth, nWidth );
599 
600  long nColumnLeft = 0;
601  long nColumnRight = 0;
602  if ( nPageColumnType == 4 )
603  {
604  nColumnRight = static_cast<long>(nWidth/3);
605  nColumnLeft = nWidth - nColumnRight;
606  aCols.GetColumns()[0].SetWishWidth( nColumnLeft );
607  aCols.GetColumns()[1].SetWishWidth( nColumnRight );
608  }
609  else if ( nPageColumnType == 5 )
610  {
611  nColumnLeft = static_cast<long>(nWidth/3);
612  nColumnRight = nWidth - nColumnLeft;
613  aCols.GetColumns()[0].SetWishWidth( nColumnLeft );
614  aCols.GetColumns()[1].SetWishWidth( nColumnRight );
615  }
616 
617  SwPageDesc aDesc( rDesc );
618  aDesc.GetMaster().SetFormatAttr( aCols );
619  rSh.ChgPageDesc( rSh.GetCurPageDesc(), aDesc );
620  }
621  break;
622 
623  case SID_ATTR_TABSTOP_VERTICAL:
624  case SID_ATTR_TABSTOP:
625  if (pReqArgs)
626  {
627  const sal_uInt16 nWhich = GetPool().GetWhich(nSlot);
628  SvxTabStopItem aTabStops( static_cast<const SvxTabStopItem&>(pReqArgs->
629  Get( nWhich )));
630  aTabStops.SetWhich(RES_PARATR_TABSTOP);
631  const SvxTabStopItem& rDefTabs = rSh.GetDefault(RES_PARATR_TABSTOP);
632 
633  // Default tab at pos 0
635  rSh.GetCurAttr( aSet );
636  const SvxLRSpaceItem& rLR = aSet.Get(RES_LR_SPACE);
637 
638  if ( rLR.GetTextFirstLineOfst() < 0 )
639  {
640  SvxTabStop aSwTabStop( 0, SvxTabAdjust::Default );
641  aTabStops.Insert( aSwTabStop );
642  }
643 
644  // Populate with default tabs.
645  ::MakeDefTabs( ::GetTabDist( rDefTabs ), aTabStops );
646 
647  SwTextFormatColl* pColl = rSh.GetCurTextFormatColl();
648  if( pColl && pColl->IsAutoUpdateFormat() )
649  {
651  aTmp.Put(aTabStops);
652  rSh.AutoUpdatePara( pColl, aTmp );
653  }
654  else
655  rSh.SetAttrItem( aTabStops );
656  }
657  break;
658 
659  case SID_HANGING_INDENT:
660  {
662  rSh.GetCurAttr( aLRSpaceSet );
663  SvxLRSpaceItem aParaMargin( aLRSpaceSet.Get( RES_LR_SPACE ) );
664 
665  SvxLRSpaceItem aNewMargin( RES_LR_SPACE );
666  aNewMargin.SetTextLeft( aParaMargin.GetTextLeft() + aParaMargin.GetTextFirstLineOfst() );
667  aNewMargin.SetRight( aParaMargin.GetRight() );
668  aNewMargin.SetTextFirstLineOfst( (aParaMargin.GetTextFirstLineOfst()) * -1 );
669 
670  rSh.SetAttrItem( aNewMargin );
671  break;
672  }
673 
674  case SID_ATTR_PARA_LRSPACE_VERTICAL:
675  case SID_ATTR_PARA_LRSPACE:
676  if ( pReqArgs )
677  {
678  SvxLRSpaceItem aParaMargin(static_cast<const SvxLRSpaceItem&>(pReqArgs->Get(nSlot)));
679 
680  aParaMargin.SetRight( aParaMargin.GetRight() - m_nRightBorderDistance );
681  aParaMargin.SetTextLeft(aParaMargin.GetTextLeft() - m_nLeftBorderDistance );
682 
683  aParaMargin.SetWhich( RES_LR_SPACE );
684  SwTextFormatColl* pColl = rSh.GetCurTextFormatColl();
685 
686  // #i23726#
688  {
689  // --> #i42922# Mouse move of numbering label
690  // has to consider the left indent of the paragraph
692  rSh.GetCurAttr( aSet );
693  const SvxLRSpaceItem& rLR = aSet.Get(RES_LR_SPACE);
694 
696  // #i90078#
697  rSh.SetIndent( static_cast< short >(aParaMargin.GetTextLeft() - rLR.GetTextLeft()), aPos);
698  // #i42921# invalidate state of indent in order to get a ruler update.
699  aParaMargin.SetWhich( nSlot );
700  GetViewFrame()->GetBindings().SetState( aParaMargin );
701  }
702  else if( pColl && pColl->IsAutoUpdateFormat() )
703  {
705  aSet.Put(aParaMargin);
706  rSh.AutoUpdatePara( pColl, aSet);
707  }
708  else
709  rSh.SetAttrItem( aParaMargin );
710 
711  if ( aParaMargin.GetTextFirstLineOfst() < 0 )
712  {
714 
715  rSh.GetCurAttr( aSet );
716  const SvxTabStopItem& rTabStops = aSet.Get(RES_PARATR_TABSTOP);
717 
718  // Do we have a tab at position zero?
719  sal_uInt16 i;
720 
721  for ( i = 0; i < rTabStops.Count(); ++i )
722  if ( rTabStops[i].GetTabPos() == 0 )
723  break;
724 
725  if ( i >= rTabStops.Count() )
726  {
727  // No DefTab
728  std::shared_ptr<SvxTabStopItem> aTabStops(static_cast<SvxTabStopItem*>(rTabStops.Clone()));
729 
730  ::lcl_EraseDefTabs(*aTabStops);
731 
732  SvxTabStop aSwTabStop( 0, SvxTabAdjust::Default );
733  aTabStops->Insert(aSwTabStop);
734 
735  const SvxTabStopItem& rDefTabs = rSh.GetDefault(RES_PARATR_TABSTOP);
736  ::MakeDefTabs( ::GetTabDist(rDefTabs), *aTabStops );
737 
738  if( pColl && pColl->IsAutoUpdateFormat())
739  {
741  aSetTmp.Put(*aTabStops);
742  rSh.AutoUpdatePara( pColl, aSetTmp );
743  }
744  else
745  rSh.SetAttrItem( *aTabStops );
746  }
747  }
748  }
749  break;
750 
751  case SID_ATTR_PARA_ULSPACE:
752  if ( pReqArgs )
753  {
754  SvxULSpaceItem aParaMargin(static_cast<const SvxULSpaceItem&>(pReqArgs->Get(nSlot)));
755 
756  aParaMargin.SetUpper( aParaMargin.GetUpper() );
757  aParaMargin.SetLower(aParaMargin.GetLower());
758 
759  aParaMargin.SetWhich( RES_UL_SPACE );
760  SwTextFormatColl* pColl = rSh.GetCurTextFormatColl();
761  if( pColl && pColl->IsAutoUpdateFormat() )
762  {
764  aSet.Put(aParaMargin);
765  rSh.AutoUpdatePara( pColl, aSet);
766  }
767  else
768  rSh.SetAttrItem( aParaMargin );
769  }
770  break;
771  case SID_PARASPACE_INCREASE:
772  case SID_PARASPACE_DECREASE:
773  {
775  rSh.GetCurAttr( aULSpaceSet );
776  SvxULSpaceItem aULSpace( aULSpaceSet.Get( RES_UL_SPACE ) );
777  sal_uInt16 nUpper = aULSpace.GetUpper();
778  sal_uInt16 nLower = aULSpace.GetLower();
779 
780  if ( nSlot == SID_PARASPACE_INCREASE )
781  {
782  nUpper = std::min< sal_uInt16 >( nUpper + 57, 5670 );
783  nLower = std::min< sal_uInt16 >( nLower + 57, 5670 );
784  }
785  else
786  {
787  nUpper = std::max< sal_Int16 >( nUpper - 57, 0 );
788  nLower = std::max< sal_Int16 >( nLower - 57, 0 );
789  }
790 
791  aULSpace.SetUpper( nUpper );
792  aULSpace.SetLower( nLower );
793 
794  SwTextFormatColl* pColl = rSh.GetCurTextFormatColl();
795  if( pColl && pColl->IsAutoUpdateFormat() )
796  {
797  aULSpaceSet.Put( aULSpace );
798  rSh.AutoUpdatePara( pColl, aULSpaceSet );
799  }
800  else
801  rSh.SetAttrItem( aULSpace, SetAttrMode::DEFAULT, true );
802  }
803  break;
804 
805  case SID_RULER_CHANGE_STATE:
806  {
807  const SfxPoolItem *pMargin1, *pMargin2;
808  if ( pReqArgs &&
809  pReqArgs->GetItemState(SID_RULER_MARGIN1,true,&pMargin1) == SfxItemState::SET )
810  {
811  const OUString ratio = static_cast<const SfxStringItem*>(pMargin1)->GetValue();
812  GetHRuler().SetValues(RulerChangeType::MARGIN1, GetHRuler().GetPageWidth() * ratio.toFloat());
813  }
814  else if ( pReqArgs &&
815  pReqArgs->GetItemState(SID_RULER_MARGIN2,true,&pMargin2) == SfxItemState::SET )
816  {
817  const OUString ratio = static_cast<const SfxStringItem*>(pMargin2)->GetValue();
818  GetHRuler().SetValues(RulerChangeType::MARGIN2, GetHRuler().GetPageWidth() * ratio.toFloat());
819  }
820  }
821  break;
822  case SID_RULER_BORDERS_VERTICAL:
823  case SID_RULER_BORDERS:
824  if ( pReqArgs )
825  {
826  SvxColumnItem aColItem(static_cast<const SvxColumnItem&>(pReqArgs->Get(nSlot)));
827 
828  if( m_bSetTabColFromDoc || (!bSect && rSh.GetTableFormat()) )
829  {
830  OSL_ENSURE(aColItem.Count(), "ColDesc is empty!!");
831 
832  const bool bSingleLine = rReq.
833  GetArgs()->Get(SID_RULER_ACT_LINE_ONLY).GetValue();
834 
835  SwTabCols aTabCols;
836  if ( m_bSetTabColFromDoc )
837  rSh.GetMouseTabCols( aTabCols, m_aTabColFromDocPos );
838  else
839  rSh.GetTabCols(aTabCols);
840 
841  // left table border
842  long nBorder = static_cast<long>(aColItem.GetLeft() - aTabCols.GetLeftMin());
843  aTabCols.SetLeft( nBorder );
844 
845  nBorder = (bVerticalWriting ? nPageHeight : nPageWidth) - aTabCols.GetLeftMin() - aColItem.GetRight();
846 
847  if ( aColItem.GetRight() > 0 )
848  aTabCols.SetRight( nBorder );
849 
850  // Tabcols sequentially
851  // The last column is defined by the edge.
852  // Columns in right-to-left tables need to be mirrored
853  bool bIsTableRTL =
854  IsTabColFromDoc() ?
856  : rSh.IsTableRightToLeft();
857  const size_t nColCount = aColItem.Count() - 1;
858  if(bIsTableRTL)
859  {
860  for ( size_t i = 0; i < nColCount && i < aTabCols.Count(); ++i )
861  {
862  const SvxColumnDescription& rCol = aColItem[nColCount - i];
863  aTabCols[i] = aTabCols.GetRight() - rCol.nStart;
864  aTabCols.SetHidden( i, !rCol.bVisible );
865  }
866  }
867  else
868  {
869  for ( size_t i = 0; i < nColCount && i < aTabCols.Count(); ++i )
870  {
871  const SvxColumnDescription& rCol = aColItem[i];
872  aTabCols[i] = rCol.nEnd + aTabCols.GetLeft();
873  aTabCols.SetHidden( i, !rCol.bVisible );
874  }
875  }
876 
877  if ( m_bSetTabColFromDoc )
878  {
879  if( !rSh.IsViewLocked() )
880  {
881  bUnlockView = true;
882  rSh.LockView( true );
883  }
884  rSh.SetMouseTabCols( aTabCols, bSingleLine,
886  }
887  else
888  rSh.SetTabCols(aTabCols, bSingleLine);
889 
890  }
891  else
892  {
893  if ( bFrameSelection || nFrameType & FrameTypeFlags::FLY_ANY || bSect)
894  {
895  SwSectionFormat *pSectFormat = nullptr;
897  if(bSect)
898  {
899  SwSection *pSect = rSh.GetAnySection();
900  OSL_ENSURE( pSect, "Which section?");
901  pSectFormat = pSect->GetFormat();
902  }
903  else
904  {
905  rSh.GetFlyFrameAttr( aSet );
906  }
907  SwFormatCol aCols(
908  bSect ?
909  pSectFormat->GetCol() :
910  aSet.Get( RES_COL, false ));
912  const long lWidth = bVerticalWriting ? aCurRect.Height() : aCurRect.Width();
913  ::lcl_ConvertToCols( aColItem, lWidth, aCols );
914  aSet.Put( aCols );
915  if(bSect)
916  rSh.SetSectionAttr( aSet, pSectFormat );
917  else
918  {
919  rSh.StartAction();
920  rSh.Push();
921  rSh.SetFlyFrameAttr( aSet );
922  // Cancel the frame selection again
923  if(!bFrameSelection && rSh.IsFrameSelected())
924  {
925  rSh.UnSelectFrame();
926  rSh.LeaveSelFrameMode();
927  }
928  rSh.Pop();
929  rSh.EndAction();
930  }
931  }
932  else
933  {
934  SwFormatCol aCols( rDesc.GetMaster().GetCol() );
935  const SwRect aPrtRect = rSh.GetAnyCurRect(CurRectType::PagePrt);
936  ::lcl_ConvertToCols( aColItem,
937  bVerticalWriting ? aPrtRect.Height() : aPrtRect.Width(),
938  aCols );
939  SwPageDesc aDesc( rDesc );
940  aDesc.GetMaster().SetFormatAttr( aCols );
941  rSh.ChgPageDesc( rSh.GetCurPageDesc(), aDesc );
942  }
943  }
944  }
945  break;
946 
947  case SID_RULER_ROWS :
948  case SID_RULER_ROWS_VERTICAL:
949  if (pReqArgs)
950  {
951  SvxColumnItem aColItem(static_cast<const SvxColumnItem&>(pReqArgs->Get(nSlot)));
952 
953  if( m_bSetTabColFromDoc || (!bSect && rSh.GetTableFormat()) )
954  {
955  OSL_ENSURE(aColItem.Count(), "ColDesc is empty!!");
956 
957  SwTabCols aTabCols;
958  if ( m_bSetTabRowFromDoc )
959  rSh.GetMouseTabRows( aTabCols, m_aTabColFromDocPos );
960  else
961  rSh.GetTabRows(aTabCols);
962 
963  if ( bVerticalWriting )
964  {
965  aTabCols.SetRight(nPageWidth - aColItem.GetRight() - aColItem.GetLeft());
966  aTabCols.SetLeftMin(aColItem.GetLeft());
967  }
968  else
969  {
970  long nBorder = nPageHeight - aTabCols.GetLeftMin() - aColItem.GetRight();
971  aTabCols.SetRight( nBorder );
972  }
973 
974  const size_t nColItems = aColItem.Count() - 1;
975  if(bVerticalWriting)
976  {
977  for ( size_t i = nColItems; i; --i )
978  {
979  const SvxColumnDescription& rCol = aColItem[i - 1];
980  long nColumnPos = aTabCols.GetRight() - rCol.nEnd ;
981  aTabCols[i - 1] = nColumnPos;
982  aTabCols.SetHidden( i - 1, !rCol.bVisible );
983  }
984  }
985  else
986  {
987  for ( size_t i = 0; i < nColItems; ++i )
988  {
989  const SvxColumnDescription& rCol = aColItem[i];
990  aTabCols[i] = rCol.nEnd + aTabCols.GetLeft();
991  aTabCols.SetHidden( i, !rCol.bVisible );
992  }
993  }
994  bool bSingleLine = false;
995  const SfxPoolItem* pSingleLine;
996  if( SfxItemState::SET == rReq.GetArgs()->GetItemState(SID_RULER_ACT_LINE_ONLY, false, &pSingleLine))
997  bSingleLine = static_cast<const SfxBoolItem*>(pSingleLine)->GetValue();
998  if ( m_bSetTabRowFromDoc )
999  {
1000  if( !rSh.IsViewLocked() )
1001  {
1002  bUnlockView = true;
1003  rSh.LockView( true );
1004  }
1005  rSh.SetMouseTabRows( aTabCols, bSingleLine, m_aTabColFromDocPos );
1006  }
1007  else
1008  rSh.SetTabRows(aTabCols, bSingleLine);
1009  }
1010  }
1011  break;
1012 
1013  case SID_ATTR_PAGE_HEADER:
1014  {
1015  if ( pReqArgs )
1016  {
1017  const bool bHeaderOn = static_cast<const SfxBoolItem&>(pReqArgs->Get(SID_ATTR_PAGE_HEADER)).GetValue();
1018  SwPageDesc aDesc(rDesc);
1019  SwFrameFormat &rMaster = aDesc.GetMaster();
1020  rMaster.SetFormatAttr( SwFormatHeader( bHeaderOn ));
1021  rSh.ChgPageDesc(rSh.GetCurPageDesc(), aDesc);
1022  }
1023  }
1024  break;
1026  {
1027  if ( pReqArgs && rDesc.GetMaster().GetHeader().IsActive() )
1028  {
1029  const SvxLongLRSpaceItem& aLongLR = static_cast<const SvxLongLRSpaceItem&>(pReqArgs->Get(SID_ATTR_PAGE_HEADER_LRMARGIN));
1031  SwPageDesc aDesc(rDesc);
1032  aLR.SetLeft(aLongLR.GetLeft());
1033  aLR.SetRight(aLongLR.GetRight());
1034  SwFrameFormat* pFormat = const_cast<SwFrameFormat*>(aDesc.GetMaster().GetHeader().GetHeaderFormat());
1035  pFormat->SetFormatAttr( aLR );
1036  rSh.ChgPageDesc(rSh.GetCurPageDesc(), aDesc);
1037  }
1038  }
1039  break;
1041  {
1042  if ( pReqArgs && rDesc.GetMaster().GetHeader().IsActive())
1043  {
1044  const SvxLongULSpaceItem& aLongUL = static_cast<const SvxLongULSpaceItem&>(pReqArgs->Get(SID_ATTR_PAGE_HEADER_SPACING));
1045  SwPageDesc aDesc(rDesc);
1046  SvxULSpaceItem aUL(0, aLongUL.GetLower(), RES_UL_SPACE );
1047  SwFrameFormat* pFormat = const_cast<SwFrameFormat*>(aDesc.GetMaster().GetHeader().GetHeaderFormat());
1048  pFormat->SetFormatAttr( aUL );
1049  rSh.ChgPageDesc(rSh.GetCurPageDesc(), aDesc);
1050  }
1051  }
1052  break;
1054  {
1055  if ( pReqArgs && rDesc.GetMaster().GetHeader().IsActive())
1056  {
1057  const SfxInt16Item& aLayoutItem = static_cast<const SfxInt16Item&>(pReqArgs->Get(SID_ATTR_PAGE_HEADER_LAYOUT));
1058  sal_uInt16 nLayout = aLayoutItem.GetValue();
1059  SwPageDesc aDesc(rDesc);
1060  aDesc.ChgHeaderShare((nLayout>>1) == 0);
1061  aDesc.ChgFirstShare((nLayout % 2) == 0); // FIXME control changes for both header footer - tdf#100287
1062  rSh.ChgPageDesc(rSh.GetCurPageDesc(), aDesc);
1063  }
1064  }
1065  break;
1066  case SID_ATTR_PAGE_FOOTER:
1067  {
1068  if ( pReqArgs )
1069  {
1070  const bool bFooterOn = static_cast<const SfxBoolItem&>(pReqArgs->Get(SID_ATTR_PAGE_FOOTER)).GetValue();
1071  SwPageDesc aDesc(rDesc);
1072  SwFrameFormat &rMaster = aDesc.GetMaster();
1073  rMaster.SetFormatAttr( SwFormatFooter( bFooterOn ));
1074  rSh.ChgPageDesc(rSh.GetCurPageDesc(), aDesc);
1075  }
1076  }
1077  break;
1079  {
1080  if ( pReqArgs && rDesc.GetMaster().GetFooter().IsActive() )
1081  {
1082  const SvxLongLRSpaceItem& aLongLR = static_cast<const SvxLongLRSpaceItem&>(pReqArgs->Get(SID_ATTR_PAGE_FOOTER_LRMARGIN));
1084  SwPageDesc aDesc(rDesc);
1085  aLR.SetLeft(aLongLR.GetLeft());
1086  aLR.SetRight(aLongLR.GetRight());
1087  SwFrameFormat* pFormat = const_cast<SwFrameFormat*>(aDesc.GetMaster().GetFooter().GetFooterFormat());
1088  pFormat->SetFormatAttr( aLR );
1089  rSh.ChgPageDesc(rSh.GetCurPageDesc(), aDesc);
1090  }
1091  }
1092  break;
1094  {
1095  if ( pReqArgs && rDesc.GetMaster().GetFooter().IsActive())
1096  {
1097  const SvxLongULSpaceItem& aLongUL = static_cast<const SvxLongULSpaceItem&>(pReqArgs->Get(SID_ATTR_PAGE_FOOTER_SPACING));
1098  SwPageDesc aDesc(rDesc);
1099  SvxULSpaceItem aUL(aLongUL.GetUpper(), 0, RES_UL_SPACE );
1100  SwFrameFormat* pFormat = const_cast<SwFrameFormat*>(aDesc.GetMaster().GetFooter().GetFooterFormat());
1101  pFormat->SetFormatAttr( aUL );
1102  rSh.ChgPageDesc(rSh.GetCurPageDesc(), aDesc);
1103  }
1104  }
1105  break;
1107  {
1108  if ( pReqArgs && rDesc.GetMaster().GetFooter().IsActive())
1109  {
1110  const SfxInt16Item& aLayoutItem = static_cast<const SfxInt16Item&>(pReqArgs->Get(SID_ATTR_PAGE_FOOTER_LAYOUT));
1111  sal_uInt16 nLayout = aLayoutItem.GetValue();
1112  SwPageDesc aDesc(rDesc);
1113  aDesc.ChgFooterShare((nLayout>>1) == 0);
1114  aDesc.ChgFirstShare((nLayout % 2) == 0); // FIXME control changes for both header footer - tdf#100287
1115  rSh.ChgPageDesc(rSh.GetCurPageDesc(), aDesc);
1116  }
1117  }
1118  break;
1119 
1120  case SID_ATTR_PAGE_COLOR:
1121  case SID_ATTR_PAGE_FILLSTYLE:
1122  case SID_ATTR_PAGE_GRADIENT:
1123  case SID_ATTR_PAGE_HATCH:
1124  case SID_ATTR_PAGE_BITMAP:
1125  {
1126  if(pReqArgs)
1127  {
1128  SwPageDesc aDesc(rDesc);
1129  SwFrameFormat &rMaster = aDesc.GetMaster();
1130  switch (nSlot)
1131  {
1132  case SID_ATTR_PAGE_FILLSTYLE:
1133  {
1134  XFillStyleItem aFSItem( pReqArgs->Get( XATTR_FILLSTYLE ) );
1135  drawing::FillStyle eXFS = aFSItem.GetValue();
1136 
1137  if ( eXFS == drawing::FillStyle_NONE )
1138  rMaster.SetFormatAttr( XFillStyleItem( eXFS ) );
1139  }
1140  break;
1141 
1142  case SID_ATTR_PAGE_COLOR:
1143  {
1144  XFillColorItem aColorItem( pReqArgs->Get( XATTR_FILLCOLOR ) );
1145  rMaster.SetFormatAttr( XFillStyleItem( drawing::FillStyle_SOLID ) );
1146  rMaster.SetFormatAttr( aColorItem );
1147  }
1148  break;
1149 
1150  case SID_ATTR_PAGE_GRADIENT:
1151  {
1152  XFillGradientItem aGradientItem( pReqArgs->Get( XATTR_FILLGRADIENT ) );
1153  rMaster.SetFormatAttr( XFillStyleItem( drawing::FillStyle_GRADIENT ) );
1154  rMaster.SetFormatAttr( aGradientItem );
1155  }
1156  break;
1157 
1158  case SID_ATTR_PAGE_HATCH:
1159  {
1160  XFillHatchItem aHatchItem( pReqArgs->Get( XATTR_FILLHATCH ) );
1161  rMaster.SetFormatAttr( XFillStyleItem( drawing::FillStyle_HATCH ) );
1162  rMaster.SetFormatAttr( aHatchItem );
1163  }
1164  break;
1165 
1166  case SID_ATTR_PAGE_BITMAP:
1167  {
1168  XFillBitmapItem aBitmapItem( pReqArgs->Get( XATTR_FILLBITMAP ) );
1169  rMaster.SetFormatAttr( XFillStyleItem( drawing::FillStyle_BITMAP ) );
1170  rMaster.SetFormatAttr( aBitmapItem );
1171  }
1172  break;
1173 
1174  default:
1175  break;
1176  }
1177  rSh.ChgPageDesc(rSh.GetCurPageDesc(), aDesc);
1178  }
1179  }
1180  break;
1181 
1182  default:
1183  OSL_ENSURE( false, "wrong SlotId");
1184  }
1185  rSh.EndAllAction();
1186 
1187  if( bUnlockView )
1188  rSh.LockView( false );
1189 
1191  SetNumRuleNodeFromDoc(nullptr);
1192 }
1193 
1194 // Here the status of the tab bar will be determined.
1195 // This means that all relevant attributes at the CursorPos
1196 // will be submitted to the tab bar.
1198 {
1199  SwWrtShell &rSh = GetWrtShell();
1200 
1201  const Point* pPt = IsTabColFromDoc() || IsTabRowFromDoc() ? &m_aTabColFromDocPos : nullptr;
1202  const FrameTypeFlags nFrameType = rSh.IsObjSelected()
1204  : rSh.GetFrameType( pPt, true );
1205 
1206  const bool bFrameSelection = rSh.IsFrameSelected();
1207  const bool bBrowse = rSh.GetViewOptions()->getBrowseMode();
1208  // PageOffset/limiter
1209  const SwRect& rPageRect = rSh.GetAnyCurRect( CurRectType::Page, pPt );
1210  const SwRect& rPagePrtRect = rSh.GetAnyCurRect( CurRectType::PagePrt, pPt );
1211  const long nPageWidth = rPageRect.Width();
1212  const long nPageHeight = rPageRect.Height();
1213 
1214  const SwPageDesc& rDesc = rSh.GetPageDesc(
1217 
1218  const SvxFrameDirectionItem& rFrameDir = rDesc.GetMaster().GetFrameDir();
1219  const bool bVerticalWriting = rSh.IsInVerticalText();
1220 
1221  //enable tab stop display on the rulers depending on the writing direction
1222  WinBits nRulerStyle = m_pHRuler->GetStyle() & ~WB_EXTRAFIELD;
1223  m_pHRuler->SetStyle(bVerticalWriting||bBrowse ? nRulerStyle : nRulerStyle|WB_EXTRAFIELD);
1224  nRulerStyle = m_pVRuler->GetStyle() & ~WB_EXTRAFIELD;
1225  m_pVRuler->SetStyle(bVerticalWriting ? nRulerStyle|WB_EXTRAFIELD : nRulerStyle);
1226 
1227  //#i24363# tab stops relative to indent
1229  m_pHRuler->SetTabsRelativeToIndent( bRelative );
1230  m_pVRuler->SetTabsRelativeToIndent( bRelative );
1231 
1232  SvxLRSpaceItem aPageLRSpace( rDesc.GetMaster().GetLRSpace() );
1233  SwapPageMargin( rDesc, aPageLRSpace );
1234 
1236  RES_LR_SPACE, RES_UL_SPACE>{} );
1237  // get also the list level indent values merged as LR-SPACE item, if needed.
1238  rSh.GetCurAttr( aCoreSet, true );
1239  const SelectionType nSelType = rSh.GetSelectionType();
1240 
1241  SfxWhichIter aIter( rSet );
1242  sal_uInt16 nWhich = aIter.FirstWhich();
1243 
1244  while ( nWhich )
1245  {
1246  switch ( nWhich )
1247  {
1248 
1249  case SID_ATTR_PAGE_COLUMN:
1250  {
1251  sal_uInt16 nColumnType = 0;
1252 
1253  const SwFrameFormat& rMaster = rDesc.GetMaster();
1254  const SwFormatCol& aCol(rMaster.GetCol());
1255  const sal_uInt16 nCols = aCol.GetNumCols();
1256  if ( nCols == 0 )
1257  {
1258  nColumnType = 1;
1259  }
1260  else if ( nCols == 2 )
1261  {
1262  const sal_uInt16 nColLeft = aCol.CalcPrtColWidth(0, aCol.GetWishWidth());
1263  const sal_uInt16 nColRight = aCol.CalcPrtColWidth(1, aCol.GetWishWidth());
1264 
1265  if ( abs(nColLeft - nColRight) <= 10 )
1266  {
1267  nColumnType = 2;
1268  }
1269  else if( abs(nColLeft - nColRight*2) < 20 )
1270  {
1271  nColumnType = 4;
1272  }
1273  else if( abs(nColLeft*2 - nColRight) < 20 )
1274  {
1275  nColumnType = 5;
1276  }
1277  }
1278  else if( nCols == 3 )
1279  {
1280  nColumnType = 3;
1281  }
1282  else
1283  nColumnType = nCols;
1284 
1285  rSet.Put( SfxInt16Item( SID_ATTR_PAGE_COLUMN, nColumnType ) );
1286  }
1287  break;
1288 
1289  case SID_ATTR_LONG_LRSPACE:
1290  {
1291  SvxLongLRSpaceItem aLongLR( aPageLRSpace.GetLeft(),
1292  aPageLRSpace.GetRight(),
1293  SID_ATTR_LONG_LRSPACE);
1294  if(bBrowse)
1295  {
1296  aLongLR.SetLeft(rPagePrtRect.Left());
1297  aLongLR.SetRight(nPageWidth - rPagePrtRect.Right());
1298  }
1299  if ( ( nFrameType & FrameTypeFlags::HEADER || nFrameType & FrameTypeFlags::FOOTER ) &&
1300  !(nFrameType & FrameTypeFlags::COLSECT) )
1301  {
1302  SwFrameFormat *pFormat = const_cast<SwFrameFormat*>((nFrameType & FrameTypeFlags::HEADER) ?
1303  rDesc.GetMaster().GetHeader().GetHeaderFormat() :
1304  rDesc.GetMaster().GetFooter().GetFooterFormat());
1305  if( pFormat )// #i80890# if rDesc is not the one belonging to the current page is might crash
1306  {
1307  SwRect aRect( rSh.GetAnyCurRect( CurRectType::HeaderFooter, pPt));
1308  aRect.Pos() -= rSh.GetAnyCurRect( CurRectType::Page, pPt ).Pos();
1309  const SvxLRSpaceItem& aLR = pFormat->GetLRSpace();
1310  aLongLR.SetLeft ( aLR.GetLeft() + aRect.Left() );
1311  aLongLR.SetRight( nPageWidth - aRect.Right() + aLR.GetRight() );
1312  }
1313  }
1314  else
1315  {
1316  SwRect aRect;
1317  if( !bFrameSelection && ((nFrameType & FrameTypeFlags::COLSECT) || rSh.IsDirectlyInSection()) )
1318  {
1319  aRect = rSh.GetAnyCurRect(CurRectType::SectionPrt, pPt);
1320  const SwRect aTmpRect = rSh.GetAnyCurRect(CurRectType::Section, pPt);
1321  aRect.Pos() += aTmpRect.Pos();
1322  }
1323 
1324  else if ( bFrameSelection || nFrameType & FrameTypeFlags::FLY_ANY )
1325  aRect = rSh.GetAnyCurRect(CurRectType::FlyEmbedded, pPt);
1326  else if( nFrameType & FrameTypeFlags::DRAWOBJ)
1327  aRect = rSh.GetObjRect();
1328 
1329  if( aRect.Width() )
1330  {
1331  // make relative to page position:
1332  aLongLR.SetLeft(aRect.Left() - rPageRect.Left());
1333  aLongLR.SetRight(rPageRect.Right() - aRect.Right());
1334  }
1335  }
1336  rSet.Put( aLongLR );
1337  }
1338  break;
1339 
1340  // provide left and right margins of current page style
1341  case SID_ATTR_PAGE_LRSPACE:
1342  {
1343  const SvxLRSpaceItem aTmpPageLRSpace( rDesc.GetMaster().GetLRSpace() );
1344  const SvxLongLRSpaceItem aLongLR(
1345  aTmpPageLRSpace.GetLeft(),
1346  aTmpPageLRSpace.GetRight(),
1347  SID_ATTR_PAGE_LRSPACE );
1348  rSet.Put( aLongLR );
1349  }
1350  break;
1351 
1352  case SID_ATTR_LONG_ULSPACE:
1353  {
1354  // Page margin top bottom
1355  SvxULSpaceItem aUL( rDesc.GetMaster().GetULSpace() );
1356  SvxLongULSpaceItem aLongUL( static_cast<long>(aUL.GetUpper()),
1357  static_cast<long>(aUL.GetLower()),
1358  SID_ATTR_LONG_ULSPACE);
1359 
1360  if ( bFrameSelection || nFrameType & FrameTypeFlags::FLY_ANY )
1361  {
1362  // Convert document coordinates into page coordinates.
1363  const SwRect &rRect = rSh.GetAnyCurRect(CurRectType::FlyEmbedded, pPt);
1364  aLongUL.SetUpper(rRect.Top() - rPageRect.Top());
1365  aLongUL.SetLower(rPageRect.Bottom() - rRect.Bottom());
1366  }
1367  else if ( nFrameType & FrameTypeFlags::HEADER || nFrameType & FrameTypeFlags::FOOTER )
1368  {
1369  SwRect aRect( rSh.GetAnyCurRect( CurRectType::HeaderFooter, pPt));
1370  aRect.Pos() -= rSh.GetAnyCurRect( CurRectType::Page, pPt ).Pos();
1371  aLongUL.SetUpper( aRect.Top() );
1372  aLongUL.SetLower( nPageHeight - aRect.Bottom() );
1373  }
1374  else if( nFrameType & FrameTypeFlags::DRAWOBJ)
1375  {
1376  const SwRect &rRect = rSh.GetObjRect();
1377  aLongUL.SetUpper(rRect.Top() - rPageRect.Top());
1378  aLongUL.SetLower(rPageRect.Bottom() - rRect.Bottom());
1379  }
1380  else if(bBrowse)
1381  {
1382  aLongUL.SetUpper(rPagePrtRect.Top());
1383  aLongUL.SetLower(nPageHeight - rPagePrtRect.Bottom());
1384  }
1385  rSet.Put( aLongUL );
1386  }
1387  break;
1388 
1389  // provide top and bottom margins of current page style
1390  case SID_ATTR_PAGE_ULSPACE:
1391  {
1392  const SvxULSpaceItem aUL( rDesc.GetMaster().GetULSpace() );
1393  SvxLongULSpaceItem aLongUL(
1394  static_cast<long>(aUL.GetUpper()),
1395  static_cast<long>(aUL.GetLower()),
1396  SID_ATTR_PAGE_ULSPACE );
1397 
1398  rSet.Put( aLongUL );
1399  }
1400  break;
1401 
1402  case SID_ATTR_TABSTOP_VERTICAL :
1403  case RES_PARATR_TABSTOP:
1404  {
1405  if ( dynamic_cast< const SwWebView *>( this ) != nullptr ||
1406  IsTabColFromDoc() ||
1407  IsTabRowFromDoc() ||
1408  ( nSelType & SelectionType::Graphic ) ||
1409  ( nSelType & SelectionType::Frame ) ||
1410  ( nSelType & SelectionType::Ole ) ||
1411  ( SfxItemState::DEFAULT > aCoreSet.GetItemState(RES_LR_SPACE) ) ||
1412  (!bVerticalWriting && (SID_ATTR_TABSTOP_VERTICAL == nWhich) ) ||
1413  ( bVerticalWriting && (RES_PARATR_TABSTOP == nWhich))
1414  )
1415  rSet.DisableItem( nWhich );
1416  else
1417  {
1418  SvxTabStopItem aTabStops(aCoreSet.Get( RES_PARATR_TABSTOP ));
1419 
1420  const SvxTabStopItem& rDefTabs = rSh.GetDefault(RES_PARATR_TABSTOP);
1421 
1422  OSL_ENSURE(m_pHRuler, "why is there no ruler?");
1423  const long nDefTabDist = ::GetTabDist(rDefTabs);
1424  m_pHRuler->SetDefTabDist( nDefTabDist );
1425  m_pVRuler->SetDefTabDist( nDefTabDist );
1426  ::lcl_EraseDefTabs(aTabStops);
1427  aTabStops.SetWhich(nWhich);
1428  rSet.Put(aTabStops);
1429  }
1430  break;
1431  }
1432 
1433  case SID_HANGING_INDENT:
1434  {
1435  SfxItemState e = aCoreSet.GetItemState(RES_LR_SPACE);
1436  if( e == SfxItemState::DISABLED )
1437  rSet.DisableItem(nWhich);
1438  break;
1439  }
1440 
1441  case SID_ATTR_PARA_LRSPACE_VERTICAL:
1442  case SID_ATTR_PARA_LRSPACE:
1443  case SID_ATTR_PARA_LEFTSPACE:
1444  case SID_ATTR_PARA_RIGHTSPACE:
1445  case SID_ATTR_PARA_FIRSTLINESPACE:
1446  {
1447  if ( nSelType & SelectionType::Graphic ||
1448  nSelType & SelectionType::Frame ||
1449  nSelType & SelectionType::Ole ||
1450  nFrameType == FrameTypeFlags::DRAWOBJ ||
1451  (!bVerticalWriting && (SID_ATTR_PARA_LRSPACE_VERTICAL == nWhich)) ||
1452  ( bVerticalWriting && (SID_ATTR_PARA_LRSPACE == nWhich))
1453  )
1454  {
1455  rSet.DisableItem(nWhich);
1456  }
1457  else
1458  {
1459  std::shared_ptr<SvxLRSpaceItem> aLR(std::make_shared<SvxLRSpaceItem>(RES_LR_SPACE));
1460  if ( !IsTabColFromDoc() )
1461  {
1462  aLR.reset(static_cast<SvxLRSpaceItem*>(aCoreSet.Get(RES_LR_SPACE).Clone()));
1463 
1464  // #i23726#
1466  {
1467  short nOffset = static_cast< short >(aLR->GetTextLeft() +
1468  // #i42922# Mouse move of numbering label
1469  // has to consider the left indent of the paragraph
1471 
1472  short nFLOffset;
1474 
1475  aLR->SetLeft( nOffset + nFLOffset );
1476  }
1477  }
1478  aLR->SetWhich(nWhich);
1479  rSet.Put(*aLR);
1480  }
1481  break;
1482  }
1483 
1484  case SID_ATTR_PARA_ULSPACE:
1485  case SID_ATTR_PARA_ABOVESPACE:
1486  case SID_ATTR_PARA_BELOWSPACE:
1487  case SID_PARASPACE_INCREASE:
1488  case SID_PARASPACE_DECREASE:
1489  {
1490  SvxULSpaceItem aUL = aCoreSet.Get(RES_UL_SPACE);
1491  SfxItemState e = aCoreSet.GetItemState(RES_UL_SPACE);
1492  if( e >= SfxItemState::DEFAULT )
1493  {
1494  if ( !aUL.GetUpper() && !aUL.GetLower() )
1495  rSet.DisableItem( SID_PARASPACE_DECREASE );
1496  else if ( aUL.GetUpper() >= 5670 && aUL.GetLower() >= 5670 )
1497  rSet.DisableItem( SID_PARASPACE_INCREASE );
1498  if ( nWhich == SID_ATTR_PARA_ULSPACE
1499  || nWhich == SID_ATTR_PARA_ABOVESPACE
1500  || nWhich == SID_ATTR_PARA_BELOWSPACE
1501  )
1502  {
1503  aUL.SetWhich( nWhich );
1504  rSet.Put( aUL );
1505  }
1506  }
1507  else
1508  {
1509  rSet.DisableItem( SID_PARASPACE_INCREASE );
1510  rSet.DisableItem( SID_PARASPACE_DECREASE );
1511  rSet.InvalidateItem( SID_ATTR_PARA_ULSPACE );
1512  rSet.InvalidateItem( SID_ATTR_PARA_ABOVESPACE );
1513  rSet.InvalidateItem( SID_ATTR_PARA_BELOWSPACE );
1514  }
1515  }
1516  break;
1517 
1518  case SID_RULER_BORDER_DISTANCE:
1519  {
1522  if ( nSelType & SelectionType::Graphic ||
1523  nSelType & SelectionType::Frame ||
1524  nSelType & SelectionType::Ole ||
1525  nFrameType == FrameTypeFlags::DRAWOBJ )
1526  rSet.DisableItem(SID_RULER_BORDER_DISTANCE);
1527  else
1528  {
1529  SvxLRSpaceItem aDistLR(SID_RULER_BORDER_DISTANCE);
1530  if(nFrameType & FrameTypeFlags::FLY_ANY)
1531  {
1532  if( IsTabColFromDoc() )
1533  {
1534  const SwRect& rFlyPrtRect = rSh.GetAnyCurRect( CurRectType::FlyEmbeddedPrt, pPt );
1535  aDistLR.SetLeft(rFlyPrtRect.Left());
1536  aDistLR.SetRight(rFlyPrtRect.Left());
1537  }
1538  else
1539  {
1540  SvxBoxInfoItem aBoxInfo( SID_ATTR_BORDER_INNER );
1541  aCoreSet.Put( aBoxInfo );
1542  rSh.GetFlyFrameAttr( aCoreSet );
1543  const SvxBoxItem& rBox = aCoreSet.Get(RES_BOX);
1544  aDistLR.SetLeft(rBox.GetDistance(SvxBoxItemLine::LEFT));
1545  aDistLR.SetRight(rBox.GetDistance(SvxBoxItemLine::RIGHT));
1546 
1547  //add the paragraph border distance
1549  rSh.GetCurAttr( aCoreSet1 );
1550  const SvxBoxItem& rParaBox = aCoreSet1.Get(RES_BOX);
1551  aDistLR.SetLeft(aDistLR.GetLeft() + rParaBox.GetDistance(SvxBoxItemLine::LEFT));
1552  aDistLR.SetRight(aDistLR.GetRight() + rParaBox.GetDistance(SvxBoxItemLine::RIGHT));
1553  }
1554  rSet.Put(aDistLR);
1555  m_nLeftBorderDistance = static_cast< sal_uInt16 >(aDistLR.GetLeft());
1556  m_nRightBorderDistance = static_cast< sal_uInt16 >(aDistLR.GetRight());
1557  }
1558  else if ( IsTabColFromDoc() ||
1559  ( rSh.GetTableFormat() && !bFrameSelection &&
1560  !(nFrameType & FrameTypeFlags::COLSECT ) ) )
1561  {
1562  SfxItemSet aCoreSet2( GetPool(),
1564  SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER>{} );
1565  SvxBoxInfoItem aBoxInfo( SID_ATTR_BORDER_INNER );
1566  aBoxInfo.SetTable(false);
1567  aBoxInfo.SetDist(true);
1568  aCoreSet2.Put(aBoxInfo);
1569  rSh.GetTabBorders( aCoreSet2 );
1570  const SvxBoxItem& rBox = aCoreSet2.Get(RES_BOX);
1571  aDistLR.SetLeft(rBox.GetDistance(SvxBoxItemLine::LEFT));
1572  aDistLR.SetRight(rBox.GetDistance(SvxBoxItemLine::RIGHT));
1573 
1574  //add the border distance of the paragraph
1576  rSh.GetCurAttr( aCoreSet1 );
1577  const SvxBoxItem& rParaBox = aCoreSet1.Get(RES_BOX);
1578  aDistLR.SetLeft(aDistLR.GetLeft() + rParaBox.GetDistance(SvxBoxItemLine::LEFT));
1579  aDistLR.SetRight(aDistLR.GetRight() + rParaBox.GetDistance(SvxBoxItemLine::RIGHT));
1580  rSet.Put(aDistLR);
1581  m_nLeftBorderDistance = static_cast< sal_uInt16 >(aDistLR.GetLeft());
1582  m_nRightBorderDistance = static_cast< sal_uInt16 >(aDistLR.GetRight());
1583  }
1584  else if ( !rSh.IsDirectlyInSection() )
1585  {
1586  //get the page/header/footer border distance
1587  const SwFrameFormat& rMaster = rDesc.GetMaster();
1588  const SvxBoxItem& rBox = rMaster.GetAttrSet().Get(RES_BOX);
1589  aDistLR.SetLeft(rBox.GetDistance(SvxBoxItemLine::LEFT));
1590  aDistLR.SetRight(rBox.GetDistance(SvxBoxItemLine::RIGHT));
1591 
1592  const SvxBoxItem* pBox = nullptr;
1593  if(nFrameType & FrameTypeFlags::HEADER)
1594  {
1595  rMaster.GetHeader();
1596  const SwFormatHeader& rHeaderFormat = rMaster.GetHeader();
1597  SwFrameFormat *pHeaderFormat = const_cast<SwFrameFormat*>(rHeaderFormat.GetHeaderFormat());
1598  if( pHeaderFormat )// #i80890# if rDesc is not the one belonging to the current page is might crash
1599  pBox = & pHeaderFormat->GetBox();
1600  }
1601  else if(nFrameType & FrameTypeFlags::FOOTER )
1602  {
1603  const SwFormatFooter& rFooterFormat = rMaster.GetFooter();
1604  SwFrameFormat *pFooterFormat = const_cast<SwFrameFormat*>(rFooterFormat.GetFooterFormat());
1605  if( pFooterFormat )// #i80890# if rDesc is not the one belonging to the current page is might crash
1606  pBox = & pFooterFormat->GetBox();
1607  }
1608  if(pBox)
1609  {
1610  aDistLR.SetLeft(pBox->GetDistance(SvxBoxItemLine::LEFT));
1611  aDistLR.SetRight(pBox->GetDistance(SvxBoxItemLine::RIGHT));
1612  }
1613 
1614  //add the border distance of the paragraph
1615  SfxItemSet aCoreSetTmp( GetPool(), svl::Items<RES_BOX, RES_BOX>{} );
1616  rSh.GetCurAttr( aCoreSetTmp );
1617  const SvxBoxItem& rParaBox = aCoreSetTmp.Get(RES_BOX);
1618  aDistLR.SetLeft(aDistLR.GetLeft() + rParaBox.GetDistance(SvxBoxItemLine::LEFT));
1619  aDistLR.SetRight(aDistLR.GetRight() + rParaBox.GetDistance(SvxBoxItemLine::RIGHT));
1620  rSet.Put(aDistLR);
1621  m_nLeftBorderDistance = static_cast< sal_uInt16 >(aDistLR.GetLeft());
1622  m_nRightBorderDistance = static_cast< sal_uInt16 >(aDistLR.GetRight());
1623  }
1624  }
1625  }
1626  break;
1627 
1628  case SID_RULER_TEXT_RIGHT_TO_LEFT:
1629  {
1630  if ( nSelType & SelectionType::Graphic ||
1631  nSelType & SelectionType::Frame ||
1632  nSelType & SelectionType::Ole ||
1633  nFrameType == FrameTypeFlags::DRAWOBJ)
1634  rSet.DisableItem(nWhich);
1635  else
1636  {
1637  bool bFlag = rSh.IsInRightToLeftText();
1638  rSet.Put(SfxBoolItem(nWhich, bFlag));
1639  }
1640  }
1641  break;
1642 
1643  case SID_RULER_BORDERS_VERTICAL:
1644  case SID_RULER_BORDERS:
1645  {
1646  bool bFrameHasVerticalColumns(false);
1647  {
1648  bool bFrameRTL;
1649  bool bFrameVertL2R;
1650  bFrameHasVerticalColumns = rSh.IsFrameVertical(false, bFrameRTL, bFrameVertL2R) &&
1651  bFrameSelection;
1652  }
1653  bool bHasTable = ( IsTabColFromDoc() ||
1654  ( rSh.GetTableFormat() && !bFrameSelection &&
1655  !(nFrameType & FrameTypeFlags::COLSECT ) ) );
1656 
1657  bool bTableVertical = bHasTable && rSh.IsTableVertical();
1658 
1659  if(((SID_RULER_BORDERS_VERTICAL == nWhich) &&
1660  ((bHasTable && !bTableVertical) ||
1661  (!bVerticalWriting && !bFrameSelection && !bHasTable ) ||
1662  ( bFrameSelection && !bFrameHasVerticalColumns))) ||
1663  ((SID_RULER_BORDERS == nWhich) &&
1664  ((bHasTable && bTableVertical) ||
1665  (bVerticalWriting && !bFrameSelection&& !bHasTable) || bFrameHasVerticalColumns)))
1666  rSet.DisableItem(nWhich);
1667  else if ( bHasTable )
1668  {
1669  SwTabCols aTabCols;
1670  size_t nNum = 0;
1672  if ( m_bSetTabColFromDoc )
1673  {
1674  rSh.GetMouseTabCols( aTabCols, m_aTabColFromDocPos );
1676  }
1677  else
1678  {
1679  rSh.GetTabCols( aTabCols );
1680  nNum = rSh.GetCurTabColNum();
1681  if(rSh.IsTableRightToLeft())
1682  nNum = aTabCols.Count() - nNum;
1683  }
1684 
1685  OSL_ENSURE(nNum <= aTabCols.Count(), "TabCol not found");
1686  const int nLft = aTabCols.GetLeftMin() + aTabCols.GetLeft();
1687  const int nRgt = (bTableVertical ? nPageHeight : nPageWidth) -
1688  (aTabCols.GetLeftMin() + aTabCols.GetRight());
1689 
1690  const sal_uInt16 nL = static_cast< sal_uInt16 >(std::max(nLft, 0));
1691  const sal_uInt16 nR = static_cast< sal_uInt16 >(std::max(nRgt, 0));
1692 
1693  SvxColumnItem aColItem(nNum, nL, nR);
1694 
1695  long nStart = 0;
1696  long nEnd = 0;
1697 
1698  //columns in right-to-left tables need to be mirrored
1699  bool bIsTableRTL =
1700  IsTabColFromDoc() ?
1702  : rSh.IsTableRightToLeft();
1703  if(bIsTableRTL)
1704  {
1705  for ( size_t i = aTabCols.Count(); i; --i )
1706  {
1707  const SwTabColsEntry& rEntry = aTabCols.GetEntry( i - 1 );
1708  nEnd = aTabCols.GetRight() - rEntry.nPos;
1709  SvxColumnDescription aColDesc( nStart, nEnd,
1710  aTabCols.GetRight() - rEntry.nMax,
1711  aTabCols.GetRight() - rEntry.nMin,
1712  !aTabCols.IsHidden(i - 1) );
1713  aColItem.Append(aColDesc);
1714  nStart = nEnd;
1715  }
1716  SvxColumnDescription aColDesc(nStart,
1717  aTabCols.GetRight() - aTabCols.GetLeft(), true);
1718  aColItem.Append(aColDesc);
1719  }
1720  else
1721  {
1722  for ( size_t i = 0; i < aTabCols.Count(); ++i )
1723  {
1724  const SwTabColsEntry& rEntry = aTabCols.GetEntry( i );
1725  nEnd = rEntry.nPos - aTabCols.GetLeft();
1726  SvxColumnDescription aColDesc( nStart, nEnd,
1727  rEntry.nMin - aTabCols.GetLeft(), rEntry.nMax - aTabCols.GetLeft(),
1728  !aTabCols.IsHidden(i) );
1729  aColItem.Append(aColDesc);
1730  nStart = nEnd;
1731  }
1732  SvxColumnDescription aColDesc(nStart, aTabCols.GetRight() - aTabCols.GetLeft(),
1733  0, 0, true);
1734  aColItem.Append(aColDesc);
1735  }
1736  aColItem.SetWhich(nWhich);
1737  rSet.Put(aColItem);
1738  }
1739  else if ( bFrameSelection || nFrameType & ( FrameTypeFlags::COLUMN | FrameTypeFlags::COLSECT ) )
1740  {
1741  // Out of frame or page?
1742  sal_uInt16 nNum = 0;
1743  if(bFrameSelection)
1744  {
1745  const SwFrameFormat* pFormat = rSh.GetFlyFrameFormat();
1746  if(pFormat)
1747  nNum = pFormat->GetCol().GetNumCols();
1748  }
1749  else
1750  nNum = rSh.GetCurColNum();
1751 
1752  if(
1753  // For that matter FrameTypeFlags::COLSECT should not be included
1754  // if the border is selected!
1755  !bFrameSelection &&
1756  nFrameType & FrameTypeFlags::COLSECT )
1757  {
1758  const SwSection *pSect = rSh.GetAnySection(false, pPt);
1759  OSL_ENSURE( pSect, "Which section?");
1760  if( pSect )
1761  {
1762  SwSectionFormat const *pFormat = pSect->GetFormat();
1763  const SwFormatCol& rCol = pFormat->GetCol();
1764  if (rSh.IsColRightToLeft())
1765  nNum = rCol.GetColumns().size() - nNum;
1766  else
1767  --nNum;
1768  SvxColumnItem aColItem(nNum);
1769  SwRect aRect = rSh.GetAnyCurRect(CurRectType::SectionPrt, pPt);
1770  const SwRect aTmpRect = rSh.GetAnyCurRect(CurRectType::Section, pPt);
1771 
1772  ::lcl_FillSvxColumn(rCol, bVerticalWriting ? aRect.Height() : aRect.Width(), aColItem, 0);
1773 
1774  if(bVerticalWriting)
1775  {
1776  aRect.Pos() += Point(aTmpRect.Left(), aTmpRect.Top());
1777  aRect.Pos().AdjustY( -(rPageRect.Top()) );
1778  aColItem.SetLeft(aRect.Top());
1779  aColItem.SetRight(nPageHeight - aRect.Bottom());
1780  }
1781  else
1782  {
1783  aRect.Pos() += aTmpRect.Pos();
1784 
1785  // make relative to page position:
1786  aColItem.SetLeft (static_cast<sal_uInt16>( aRect.Left() - rPageRect.Left() ));
1787  aColItem.SetRight(static_cast<sal_uInt16>( rPageRect.Right() - aRect.Right()));
1788  }
1789  aColItem.SetOrtho(aColItem.CalcOrtho());
1790 
1791  aColItem.SetWhich(nWhich);
1792  rSet.Put(aColItem);
1793  }
1794  }
1795  else if( bFrameSelection || nFrameType & FrameTypeFlags::FLY_ANY )
1796  {
1797  // Columns in frame
1798  if ( nNum )
1799  {
1800  const SwFrameFormat* pFormat = rSh.GetFlyFrameFormat() ;
1801 
1802  const SwFormatCol& rCol = pFormat->GetCol();
1803  if (rSh.IsColRightToLeft())
1804  nNum = rCol.GetColumns().size() - nNum;
1805  else
1806  nNum--;
1807  SvxColumnItem aColItem(nNum);
1808  const SwRect &rSizeRect = rSh.GetAnyCurRect(CurRectType::FlyEmbeddedPrt, pPt);
1809 
1810  bool bUseVertical = bFrameHasVerticalColumns || (!bFrameSelection && bVerticalWriting);
1811  const long lWidth = bUseVertical ? rSizeRect.Height() : rSizeRect.Width();
1812  const SwRect &rRect = rSh.GetAnyCurRect(CurRectType::FlyEmbedded, pPt);
1813  long nDist2 = ((bUseVertical ? rRect.Height() : rRect.Width()) - lWidth) /2;
1814  ::lcl_FillSvxColumn(rCol, lWidth, aColItem, nDist2);
1815 
1816  if(bUseVertical)
1817  {
1818  aColItem.SetLeft(rRect.Top()- rPageRect.Top());
1819  aColItem.SetRight(nPageHeight + rPageRect.Top() - rRect.Bottom());
1820  }
1821  else
1822  {
1823  aColItem.SetLeft(rRect.Left() - rPageRect.Left());
1824  aColItem.SetRight(rPageRect.Right() - rRect.Right());
1825  }
1826 
1827  aColItem.SetOrtho(aColItem.CalcOrtho());
1828 
1829  aColItem.SetWhich(nWhich);
1830  rSet.Put(aColItem);
1831  }
1832  else
1833  rSet.DisableItem(nWhich);
1834  }
1835  else
1836  { // Columns on the page
1837  const SwFrameFormat& rMaster = rDesc.GetMaster();
1838  SwFormatCol aCol(rMaster.GetCol());
1839  if(rFrameDir.GetValue() == SvxFrameDirection::Horizontal_RL_TB)
1840  nNum = aCol.GetColumns().size() - nNum;
1841  else
1842  nNum--;
1843 
1844  SvxColumnItem aColItem(nNum);
1845  const SwRect aPrtRect = rSh.GetAnyCurRect(CurRectType::PagePrt, pPt);
1846  const SvxBoxItem& rBox = rMaster.GetFormatAttr(RES_BOX);
1847  long nDist = rBox.GetSmallestDistance();
1848 
1850  aCol,
1851  bVerticalWriting ? aPrtRect.Height() : aPrtRect.Width(),
1852  aColItem, nDist);
1853 
1854  if(bBrowse)
1855  {
1856  if (bVerticalWriting)
1857  {
1858  aColItem.SetLeft(static_cast<sal_uInt16>(rPagePrtRect.Top()));
1859  aColItem.SetRight(sal_uInt16(nPageHeight - rPagePrtRect.Bottom()));
1860  }
1861  else
1862  {
1863  aColItem.SetLeft(static_cast<sal_uInt16>(rPagePrtRect.Left()));
1864  aColItem.SetRight(sal_uInt16(nPageWidth - rPagePrtRect.Right()));
1865  }
1866  }
1867  else
1868  {
1869  if (bVerticalWriting)
1870  {
1871  SvxULSpaceItem aUL( rDesc.GetMaster().GetULSpace() );
1872  aColItem.SetLeft (aUL.GetUpper());
1873  aColItem.SetRight(aUL.GetLower());
1874  }
1875  else
1876  {
1877  aColItem.SetLeft (aPageLRSpace.GetLeft());
1878  aColItem.SetRight(aPageLRSpace.GetRight());
1879  }
1880  }
1881  aColItem.SetOrtho(aColItem.CalcOrtho());
1882 
1883  aColItem.SetWhich(nWhich);
1884  rSet.Put(aColItem);
1885  }
1886  }
1887  else
1888  rSet.DisableItem(nWhich);
1889  break;
1890  }
1891 
1892  case SID_RULER_ROWS :
1893  case SID_RULER_ROWS_VERTICAL:
1894  {
1895  bool bFrameHasVerticalColumns(false);
1896  {
1897  bool bFrameRTL;
1898  bool bFrameVertL2R;
1899  bFrameHasVerticalColumns = rSh.IsFrameVertical(false, bFrameRTL, bFrameVertL2R) &&
1900  bFrameSelection;
1901  }
1902 
1903  if(((SID_RULER_ROWS == nWhich) &&
1904  ((!bVerticalWriting && !bFrameSelection) || (bFrameSelection && !bFrameHasVerticalColumns))) ||
1905  ((SID_RULER_ROWS_VERTICAL == nWhich) &&
1906  ((bVerticalWriting && !bFrameSelection) || bFrameHasVerticalColumns)))
1907  rSet.DisableItem(nWhich);
1908  else if ( IsTabRowFromDoc() ||
1909  ( rSh.GetTableFormat() && !bFrameSelection &&
1910  !(nFrameType & FrameTypeFlags::COLSECT ) ) )
1911  {
1912  SwTabCols aTabCols;
1914  if ( m_bSetTabRowFromDoc )
1915  {
1916  rSh.GetMouseTabRows( aTabCols, m_aTabColFromDocPos );
1917  }
1918  else
1919  {
1920  rSh.GetTabRows( aTabCols );
1921  }
1922 
1923  const int nLft = aTabCols.GetLeftMin();
1924  const int nRgt = (bVerticalWriting ? nPageWidth : nPageHeight) -
1925  (aTabCols.GetLeftMin() + aTabCols.GetRight());
1926 
1927  const sal_uInt16 nL = static_cast< sal_uInt16 >(std::max(nLft, 0));
1928  const sal_uInt16 nR = static_cast< sal_uInt16 >(std::max(nRgt, 0));
1929 
1930  SvxColumnItem aColItem(0, nL, nR);
1931 
1932  long nStart = 0;
1933  long nEnd = 0;
1934 
1935  for ( size_t i = 0; i < aTabCols.Count(); ++i )
1936  {
1937  const SwTabColsEntry& rEntry = aTabCols.GetEntry( i );
1938  if(bVerticalWriting)
1939  {
1940  nEnd = aTabCols.GetRight() - rEntry.nPos;
1941  SvxColumnDescription aColDesc( nStart, nEnd,
1942  std::max(0L, aTabCols.GetRight() - rEntry.nMax),
1943  std::max(0L, aTabCols.GetRight() - rEntry.nMin),
1944  !aTabCols.IsHidden(i) );
1945  aColItem.Append(aColDesc);
1946  }
1947  else
1948  {
1949  nEnd = rEntry.nPos - aTabCols.GetLeft();
1950  SvxColumnDescription aColDesc( nStart, nEnd,
1951  rEntry.nMin - aTabCols.GetLeft(),
1952  rEntry.nMax - aTabCols.GetLeft(),
1953  !aTabCols.IsHidden(i) );
1954  aColItem.Append(aColDesc);
1955  }
1956  nStart = nEnd;
1957  }
1958  if(bVerticalWriting)
1959  nEnd = aTabCols.GetRight();
1960  else
1961  nEnd = aTabCols.GetLeft();
1962 
1963  SvxColumnDescription aColDesc( nStart, nEnd,
1964  aTabCols.GetRight(),
1965  aTabCols.GetRight(),
1966  false );
1967  aColItem.Append(aColDesc);
1968 
1969  aColItem.SetWhich(nWhich);
1970  rSet.Put(aColItem);
1971  }
1972  else
1973  rSet.DisableItem(nWhich);
1974  }
1975  break;
1976 
1977  case SID_RULER_PAGE_POS:
1978  {
1979  SvxPagePosSizeItem aPagePosSize(
1980  Point( rPageRect.Left(), rPageRect.Top()) , nPageWidth, nPageHeight);
1981 
1982  rSet.Put(aPagePosSize);
1983  break;
1984  }
1985 
1986  case SID_RULER_LR_MIN_MAX:
1987  {
1988  tools::Rectangle aRectangle;
1989  if( ( nFrameType & FrameTypeFlags::COLSECT ) && !IsTabColFromDoc() &&
1990  ( nFrameType & ( FrameTypeFlags::TABLE|FrameTypeFlags::COLUMN ) ) )
1991  {
1992  if( nFrameType & FrameTypeFlags::TABLE )
1993  {
1994  const size_t nNum = rSh.GetCurTabColNum();
1995  SwTabCols aTabCols;
1996  rSh.GetTabCols( aTabCols );
1997 
1998  const int nLft = aTabCols.GetLeftMin() + aTabCols.GetLeft();
1999  const int nRgt = nPageWidth -(aTabCols.GetLeftMin() + aTabCols.GetRight());
2000 
2001  const sal_uInt16 nL = static_cast< sal_uInt16 >(std::max(nLft, 0));
2002  const sal_uInt16 nR = static_cast< sal_uInt16 >(std::max(nRgt, 0));
2003 
2004  aRectangle.SetLeft( nL );
2005  if(nNum > 1)
2006  aRectangle.AdjustLeft(aTabCols[nNum - 2] );
2007  if(nNum)
2008  aRectangle.AdjustLeft(MINLAY );
2009  if(aTabCols.Count() <= nNum + 1 )
2010  aRectangle.SetRight( nR );
2011  else
2012  aRectangle.SetRight( nPageWidth - (nL + aTabCols[nNum + 1]) );
2013 
2014  if(nNum < aTabCols.Count())
2015  aRectangle.AdjustRight(MINLAY );
2016  }
2017  else
2018  {
2019  const SwFrameFormat* pFormat = rSh.GetFlyFrameFormat();
2020  const SwFormatCol* pCols = pFormat ? &pFormat->GetCol():
2021  &rDesc.GetMaster().GetCol();
2022  const SwColumns& rCols = pCols->GetColumns();
2023  sal_uInt16 nNum = rSh.GetCurOutColNum();
2024  const sal_uInt16 nCount = std::min(sal_uInt16(nNum + 1), sal_uInt16(rCols.size()));
2025  const SwRect aRect( rSh.GetAnyCurRect( pFormat
2027  : CurRectType::PagePrt, pPt ));
2028  const SwRect aAbsRect( rSh.GetAnyCurRect( pFormat
2030  : CurRectType::Page, pPt ));
2031 
2032  // The width of the frame or within the page margins.
2033  const sal_uInt16 nTotalWidth = static_cast<sal_uInt16>(aRect.Width());
2034  // The entire frame width - The difference is twice the distance to the edge.
2035  const sal_uInt16 nOuterWidth = static_cast<sal_uInt16>(aAbsRect.Width());
2036  int nWidth = 0,
2037  nEnd = 0;
2038  aRectangle.SetLeft( 0 );
2039  for ( sal_uInt16 i = 0; i < nCount; ++i )
2040  {
2041  const SwColumn* pCol = &rCols[i];
2042  const int nStart = pCol->GetLeft() + nWidth;
2043  if(i == nNum - 2)
2044  aRectangle.SetLeft( nStart );
2045  nWidth += pCols->CalcColWidth( i, nTotalWidth );
2046  nEnd = nWidth - pCol->GetRight();
2047  }
2048  aRectangle.SetRight( rPageRect.Right() - nEnd );
2049  aRectangle.AdjustLeft( -(rPageRect.Left()) );
2050 
2051  if(nNum > 1)
2052  {
2053  aRectangle.AdjustLeft(MINLAY );
2054  aRectangle.AdjustLeft(aRect.Left() );
2055  }
2056  if(pFormat) // Range in frame - here you may up to the edge
2057  {
2058  aRectangle.SetLeft(0);
2059  aRectangle.SetRight(0);
2060  }
2061  else
2062  {
2063  // Move the rectangle to the correct absolute position.
2064  aRectangle.AdjustLeft(aAbsRect.Left() );
2065  aRectangle.AdjustRight( -(aAbsRect.Left()) );
2066  // Include distance to the border.
2067  aRectangle.AdjustRight( -((nOuterWidth - nTotalWidth) / 2) );
2068  }
2069 
2070  if(nNum < rCols.size())
2071  {
2072  aRectangle.AdjustRight(MINLAY );
2073  }
2074  else
2075  // Right is only the margin now.
2076  aRectangle.SetRight( 0 );
2077 
2078  }
2079  }
2080  else if ( ((nFrameType & FrameTypeFlags::TABLE) || IsTabColFromDoc()) &&
2081  !bFrameSelection )
2082  {
2083  bool bColumn;
2084  if ( IsTabColFromDoc() )
2085  bColumn = rSh.GetCurMouseColNum( m_aTabColFromDocPos ) != 0;
2086  else
2088 
2089  if ( !bColumn )
2090  {
2091  if( nFrameType & FrameTypeFlags::FLY_ANY && IsTabColFromDoc() )
2092  {
2093  SwRect aRect( rSh.GetAnyCurRect(
2094  CurRectType::FlyEmbeddedPrt, pPt ) );
2095  aRect.Pos() += rSh.GetAnyCurRect( CurRectType::FlyEmbedded,
2096  pPt ).Pos();
2097 
2098  aRectangle.SetLeft( aRect.Left() - rPageRect.Left() );
2099  aRectangle.SetRight( rPageRect.Right() - aRect.Right() );
2100  }
2101  else if( bBrowse )
2102  {
2103  aRectangle.SetLeft( rPagePrtRect.Left() );
2104  aRectangle.SetRight( nPageWidth - rPagePrtRect.Right() );
2105  }
2106  else
2107  {
2108  aRectangle.SetLeft( aPageLRSpace.GetLeft() );
2109  aRectangle.SetRight( aPageLRSpace.GetRight() );
2110  }
2111  }
2112  else
2113  { // Here only for table in multi-column pages and borders.
2114  bool bSectOutTable = bool(nFrameType & FrameTypeFlags::TABLE);
2115  bool bFrame = bool(nFrameType & FrameTypeFlags::FLY_ANY);
2116  bool bColSct = bool(nFrameType & ( bSectOutTable
2118  : FrameTypeFlags::COLSECT )
2119  );
2120  //So you can also drag with the mouse, without being in the table.
2121  CurRectType eRecType = CurRectType::PagePrt;
2122  size_t nNum = IsTabColFromDoc() ?
2124  rSh.GetCurOutColNum();
2125  const SwFrameFormat* pFormat = nullptr;
2126  if( bColSct )
2127  {
2128  eRecType = bSectOutTable ? CurRectType::SectionOutsideTable
2130  const SwSection *pSect = rSh.GetAnySection( bSectOutTable, pPt );
2131  OSL_ENSURE( pSect, "Which section?");
2132  pFormat = pSect->GetFormat();
2133  }
2134  else if( bFrame )
2135  {
2136  pFormat = rSh.GetFlyFrameFormat();
2137  eRecType = CurRectType::FlyEmbeddedPrt;
2138  }
2139 
2140  const SwFormatCol* pCols = pFormat ? &pFormat->GetCol():
2141  &rDesc.GetMaster().GetCol();
2142  const SwColumns& rCols = pCols->GetColumns();
2143  const sal_uInt16 nBorder = pFormat
2144  ? pFormat->GetBox().GetSmallestDistance()
2145  : rDesc.GetMaster().GetBox().GetSmallestDistance();
2146 
2147  // RECT_FLY_PRT_EMBEDDED returns the relative position to RECT_FLY_EMBEDDED
2148  // the absolute position must be added here
2149 
2150  SwRect aRect( rSh.GetAnyCurRect( eRecType, pPt ) );
2151  if(CurRectType::FlyEmbeddedPrt == eRecType)
2152  aRect.Pos() += rSh.GetAnyCurRect( CurRectType::FlyEmbedded,
2153  pPt ).Pos();
2154 
2155  const sal_uInt16 nTotalWidth = static_cast<sal_uInt16>(aRect.Width());
2156  // Initialize nStart and nEnd for nNum == 0
2157  int nWidth = 0,
2158  nStart = 0,
2159  nEnd = nTotalWidth;
2160 
2161  if( nNum > rCols.size() )
2162  {
2163  OSL_ENSURE( false, "wrong FormatCol is being edited!" );
2164  nNum = rCols.size();
2165  }
2166 
2167  for( size_t i = 0; i < nNum; ++i )
2168  {
2169  const SwColumn* pCol = &rCols[i];
2170  nStart = pCol->GetLeft() + nWidth;
2171  nWidth += pCols->CalcColWidth( static_cast<sal_uInt16>(i), nTotalWidth );
2172  nEnd = nWidth - pCol->GetRight();
2173  }
2174  if( bFrame || bColSct )
2175  {
2176  aRectangle.SetLeft( aRect.Left() - rPageRect.Left() + nStart );
2177  aRectangle.SetRight( nPageWidth - aRectangle.Left() - nEnd + nStart );
2178  }
2179  else if(!bBrowse)
2180  {
2181  aRectangle.SetLeft( aPageLRSpace.GetLeft() + nStart );
2182  aRectangle.SetRight( nPageWidth - nEnd - aPageLRSpace.GetLeft() );
2183  }
2184  else
2185  {
2186  long nLeft = rPagePrtRect.Left();
2187  aRectangle.SetLeft( nStart + nLeft );
2188  aRectangle.SetRight( nPageWidth - nEnd - nLeft );
2189  }
2190  if(!bFrame)
2191  {
2192  aRectangle.AdjustLeft(nBorder );
2193  aRectangle.AdjustRight( -nBorder );
2194  }
2195  }
2196  }
2197  else if ( nFrameType & ( FrameTypeFlags::HEADER | FrameTypeFlags::FOOTER ))
2198  {
2199  aRectangle.SetLeft( aPageLRSpace.GetLeft() );
2200  aRectangle.SetRight( aPageLRSpace.GetRight() );
2201  }
2202  else
2203  {
2204  aRectangle.SetLeft(0);
2205  aRectangle.SetRight(0);
2206  }
2207 
2208  SfxRectangleItem aLR( SID_RULER_LR_MIN_MAX , aRectangle);
2209  rSet.Put(aLR);
2210  }
2211  break;
2212 
2213  case SID_RULER_PROTECT:
2214  {
2215  if(bFrameSelection)
2216  {
2218 
2219  SvxProtectItem aProt(SID_RULER_PROTECT);
2220  aProt.SetContentProtect(bool(nProtect & FlyProtectFlags::Content));
2221  aProt.SetSizeProtect (bool(nProtect & FlyProtectFlags::Size));
2222  aProt.SetPosProtect (bool(nProtect & FlyProtectFlags::Pos));
2223  rSet.Put(aProt);
2224  }
2225  else
2226  {
2227  SvxProtectItem aProtect(SID_RULER_PROTECT);
2228  if(bBrowse && !(nFrameType & (FrameTypeFlags::DRAWOBJ|FrameTypeFlags::COLUMN)) && !rSh.GetTableFormat())
2229  {
2230  aProtect.SetSizeProtect(true);
2231  aProtect.SetPosProtect(true);
2232  }
2233  rSet.Put(aProtect);
2234  }
2235  }
2236  break;
2237 
2238  case SID_ATTR_PAGE_HEADER:
2242  {
2243  const SwFormatHeader& rHeader = rDesc.GetMaster().GetHeader();
2244  bool bHeaderOn = rHeader.IsActive();
2245  rSet.Put( SfxBoolItem(SID_ATTR_PAGE_HEADER, bHeaderOn ) );
2246  if(bHeaderOn)
2247  {
2248  const SvxLRSpaceItem* rLR = static_cast<const SvxLRSpaceItem*>(
2249  rHeader.GetHeaderFormat()->GetAttrSet().GetItem(SID_ATTR_LRSPACE));
2250  const SvxULSpaceItem* rUL = static_cast<const SvxULSpaceItem*>(
2251  rHeader.GetHeaderFormat()->GetAttrSet().GetItem(SID_ATTR_ULSPACE));
2253  rSet.Put(aLR);
2255  rSet.Put(aUL);
2256 
2257  bool bShared = !rDesc.IsHeaderShared();
2258  bool bFirst = !rDesc.IsFirstShared(); // FIXME control changes for both header footer - tdf#100287
2259  sal_uInt16 nLayout = (static_cast<int>(bShared)<<1) + static_cast<int>(bFirst);
2260  SfxInt16Item aLayoutItem(SID_ATTR_PAGE_HEADER_LAYOUT, nLayout);
2261  rSet.Put(aLayoutItem);
2262  }
2263  }
2264  break;
2265  case SID_ATTR_PAGE_FOOTER:
2269  {
2270  const SwFormatFooter& rFooter = rDesc.GetMaster().GetFooter();
2271  bool bFooterOn = rFooter.IsActive();
2272  rSet.Put( SfxBoolItem(SID_ATTR_PAGE_FOOTER, bFooterOn ) );
2273  if(bFooterOn)
2274  {
2275  const SvxLRSpaceItem* rLR = rFooter.GetFooterFormat()->GetAttrSet().GetItem<SvxLRSpaceItem>(SID_ATTR_LRSPACE);
2276  const SvxULSpaceItem* rUL = rFooter.GetFooterFormat()->GetAttrSet().GetItem<SvxULSpaceItem>(SID_ATTR_ULSPACE);
2278  rSet.Put(aLR);
2279  SvxLongULSpaceItem aUL( rUL->GetUpper(), rUL->GetLower(), SID_ATTR_PAGE_FOOTER_SPACING);
2280  rSet.Put(aUL);
2281 
2282  bool bShared = !rDesc.IsFooterShared();
2283  bool bFirst = !rDesc.IsFirstShared(); // FIXME control changes for both header footer - tdf#100287
2284  sal_uInt16 nLayout = (static_cast<int>(bShared)<<1) + static_cast<int>(bFirst);
2285  SfxInt16Item aLayoutItem(SID_ATTR_PAGE_FOOTER_LAYOUT, nLayout);
2286  rSet.Put(aLayoutItem);
2287  }
2288  }
2289  break;
2290 
2291  case SID_ATTR_PAGE_COLOR:
2292  case SID_ATTR_PAGE_FILLSTYLE:
2293  case SID_ATTR_PAGE_GRADIENT:
2294  case SID_ATTR_PAGE_HATCH:
2295  case SID_ATTR_PAGE_BITMAP:
2296  {
2297  SfxItemSet aSet = rDesc.GetMaster().GetAttrSet();
2298  if (const auto pFillStyleItem = aSet.GetItem(XATTR_FILLSTYLE))
2299  {
2300  drawing::FillStyle eXFS = pFillStyleItem->GetValue();
2301  XFillStyleItem aFillStyleItem( eXFS );
2302  aFillStyleItem.SetWhich( SID_ATTR_PAGE_FILLSTYLE );
2303  rSet.Put(aFillStyleItem);
2304 
2305  switch(eXFS)
2306  {
2307  case drawing::FillStyle_SOLID:
2308  {
2309  if (const auto pItem = aSet.GetItem<XFillColorItem>(XATTR_FILLCOLOR, false))
2310  {
2311  Color aColor = pItem->GetColorValue();
2312  XFillColorItem aFillColorItem( OUString(), aColor );
2313  aFillColorItem.SetWhich( SID_ATTR_PAGE_COLOR );
2314  rSet.Put( aFillColorItem );
2315  }
2316  break;
2317  }
2318 
2319  case drawing::FillStyle_GRADIENT:
2320  {
2321  const XGradient& xGradient = aSet.GetItem<XFillGradientItem>( XATTR_FILLGRADIENT )->GetGradientValue();
2322  XFillGradientItem aFillGradientItem( OUString(), xGradient, SID_ATTR_PAGE_GRADIENT );
2323  rSet.Put( aFillGradientItem );
2324  }
2325  break;
2326 
2327  case drawing::FillStyle_HATCH:
2328  {
2329  const XFillHatchItem *pFillHatchItem( aSet.GetItem<XFillHatchItem>( XATTR_FILLHATCH ) );
2330  XFillHatchItem aFillHatchItem( pFillHatchItem->GetName(), pFillHatchItem->GetHatchValue());
2331  aFillHatchItem.SetWhich( SID_ATTR_PAGE_HATCH );
2332  rSet.Put( aFillHatchItem );
2333  }
2334  break;
2335 
2336  case drawing::FillStyle_BITMAP:
2337  {
2338  const XFillBitmapItem *pFillBitmapItem = aSet.GetItem<XFillBitmapItem>( XATTR_FILLBITMAP );
2339  XFillBitmapItem aFillBitmapItem( pFillBitmapItem->GetName(), pFillBitmapItem->GetGraphicObject() );
2340  aFillBitmapItem.SetWhich( SID_ATTR_PAGE_BITMAP );
2341  rSet.Put( aFillBitmapItem );
2342  }
2343  break;
2344  case drawing::FillStyle_NONE:
2345  {
2346  }
2347  break;
2348 
2349  default:
2350  break;
2351  }
2352  }
2353  break;
2354  }
2355 
2356  }
2357  nWhich = aIter.NextWhich();
2358  }
2359 }
2360 
2361 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
long GetLeft() const
SfxViewFrame * GetViewFrame() const
const int nColCount
void SetMouseTabCols(const SwTabCols &rNew, bool bCurRowOnly, const Point &rPt)
Definition: fetab.cxx:2046
sal_uInt16 m_nRightBorderDistance
Definition: view.hxx:223
void SetWishWidth(sal_uInt16 nNew)
Definition: fmtclds.hxx:134
bool Insert(const SvxTabStop &rTab)
#define RES_FRM_SIZE
Definition: hintids.hxx:194
SwTextFormatColl * GetCurTextFormatColl() const
Get the named paragraph format of the current selection.
Definition: edattr.cxx:250
#define RES_COL
Definition: hintids.hxx:214
#define SID_ATTR_PAGE_HEADER_LRMARGIN
Definition: cmdid.h:835
#define XATTR_FILLHATCH
bool IsTabRowFromDoc() const
Definition: view.hxx:434
size_t GetSectionFormatPos(const SwSectionFormat &) const
Definition: edsect.cxx:136
const SwFormatCol & GetCol(bool=true) const
Definition: fmtclds.hxx:168
Represents the style of a paragraph.
Definition: fmtcol.hxx:55
bool IsInVerticalText(const Point *pPt=nullptr) const
Definition: crsrsh.cxx:3293
Rect of current FlyFrame.
sal_uInt16 Count() const
Marks a position in the document model.
Definition: pam.hxx:35
#define SID_ATTR_PAGE_HEADER
Definition: cmdid.h:834
std::vector< SwColumn > SwColumns
Definition: fmtclds.hxx:57
long GetLeftMarginWithNum(bool bTextLeft=false) const
Returns the additional indents of this text node and its numbering.
Definition: ndtxt.cxx:3160
sal_uInt16 GetLower() const
bool IsOrtho() const
Definition: fmtclds.hxx:121
#define SID_ATTR_PAGE_HEADER_LAYOUT
Definition: cmdid.h:837
#define SID_ATTR_PAGE_COLUMN
Definition: cmdid.h:833
void SetState(const SfxItemSet &rSet)
const SwFormatHeader & GetHeader(bool=true) const
Definition: fmthdft.hxx:97
void ChgHeaderShare(bool bNew)
Definition: pagedesc.hxx:303
#define RES_HORI_ORIENT
Definition: hintids.hxx:208
std::string GetValue
std::unique_ptr< SwWrtShell > m_pWrtShell
Definition: view.hxx:183
short GetTextFirstLineOfst() const
void SetLeft(sal_uInt16 nNew)
Definition: fmtclds.hxx:47
const SwFormatVertOrient & GetVertOrient(bool=true) const
Definition: fmtornt.hxx:106
void Append(const SvxColumnDescription &rDesc)
long GetWidth() const
const SwRect & GetAnyCurRect(CurRectType eType, const Point *pPt=nullptr, const css::uno::Reference< css::embed::XEmbeddedObject > &=css::uno::Reference< css::embed::XEmbeddedObject >()) const
Definition: fews.cxx:92
VclPtr< SvxRuler > m_pHRuler
Definition: view.hxx:200
long AdjustLeft(long nHorzMoveDelta)
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const override
bool GetFirstLineOfsWithNum(short &rFirstOffset) const
Returns the combined first line indent of this text node and its numbering.
Definition: ndtxt.cxx:3203
long GetLeftMin() const
Definition: tabcol.hxx:76
sal_uInt16 GetCurColNum(SwGetCurColNumPara *pPara=nullptr) const
The ruler needs some information too.
Definition: fews.cxx:684
#define MINLAY
Definition: swtypes.hxx:66
const SvxFrameDirectionItem & GetFrameDir(bool=true) const
Definition: frmatr.hxx:94
void SetRight(sal_uInt16 nNew)
Definition: fmtclds.hxx:48
bool Pop(SwCursorShell::PopMode=SwCursorShell::PopMode::DeleteStack)
Definition: wrtsh1.cxx:1697
#define XATTR_FILLGRADIENT
void GetTabRows(SwTabCols &rToFill) const
Definition: fetab.cxx:659
void Height(long nNew)
Definition: swrect.hxx:189
void InvalidateItem(sal_uInt16 nWhich)
sal_uInt16 GetDistance(SvxBoxItemLine nLine) const
void GetPageNum(sal_uInt16 &rnPhyNum, sal_uInt16 &rnVirtNum, bool bAtCursorPos=true, const bool bCalcFrame=true)
Definition: crsrsh.cxx:1197
sal_uInt16 FirstWhich()
const IDocumentSettingAccess & getIDocumentSettingAccess() const
Provides access to the document setting interface.
Definition: viewsh.cxx:2588
SW_DLLPUBLIC SwTwips GetTabDist(const SvxTabStopItem &rTabs)
Definition: uitool.cxx:586
void SetTextLeft(const long nL, const sal_uInt16 nProp=100)
long SwTwips
Definition: swtypes.hxx:49
SwSectionFormat * GetFormat()
Definition: section.hxx:337
void StateTabWin(SfxItemSet &)
Definition: viewtab.cxx:1197
void Pos(const Point &rNew)
Definition: swrect.hxx:167
void SetLeft(long aLeft)
Of course Writer needs its own rectangles.
Definition: swrect.hxx:34
void AutoUpdatePara(SwTextFormatColl *pColl, const SfxItemSet &rStyleSet, SwPaM *pPaM=nullptr)
Definition: wrtsh1.cxx:1558
const SfxItemSet * GetArgs() const
bool IsDirectlyInSection() const
Definition: fews.cxx:232
Frame cannot be moved in Var-direction.
Definition: fmtfsize.hxx:38
void GetMouseTabCols(SwTabCols &rToFill, const Point &rPt) const
Definition: fetab.cxx:2039
void EndAllAction()
Definition: edws.cxx:96
CurRectType
Definition: fesh.hxx:135
UseOnPage GetUseOn() const
Definition: pagedesc.hxx:329
size_t GetMousePageDesc(const Point &rPt) const
Definition: fedesc.cxx:149
const SwTabColsEntry & GetEntry(size_t nPos) const
Definition: tabcol.hxx:73
#define XATTR_FILLCOLOR
sal_uInt16 NextWhich()
sal_uInt16 GetCurMouseColNum(const Point &rPt) const
Definition: fetab.cxx:2059
long GetRight() const
Definition: tabcol.hxx:78
void SetOrtho(bool bNew, sal_uInt16 nGutterWidth, sal_uInt16 nAct)
This too re-arranges columns automatically if flag is set.
Definition: atrfrm.cxx:962
SwWrtShell & GetWrtShell() const
Definition: view.hxx:400
const SvxBoxItem & GetBox(bool=true) const
Definition: frmatr.hxx:84
bool IsActive() const
Definition: fmthdft.hxx:89
const SwSection * GetCurrSection() const
Definition: edsect.cxx:71
void UpdateSection(size_t const nSect, SwSectionData &, SfxItemSet const *const =nullptr)
Definition: edsect.cxx:156
#define SID_ATTR_PAGE_FOOTER_SPACING
Definition: cmdid.h:840
#define SID_ATTR_PAGE_FOOTER_LAYOUT
Definition: cmdid.h:841
Used by the UI to modify the document model.
Definition: wrtsh.hxx:88
bool IsTableVertical() const
Definition: fetab.cxx:2325
sal_Int64 WinBits
void SetLeft(const long nL, const sal_uInt16 nProp=100)
void SetValues(RulerChangeType type, long value)
Rect of current PrtArea of section.
void Top(const long nTop)
Definition: swrect.hxx:202
void SetHoriOrient(sal_Int16 eNew)
Definition: fmtornt.hxx:89
void Remove(const sal_uInt16 nPos, const sal_uInt16 nLen=1)
static void lcl_EraseDefTabs(SvxTabStopItem &rTabStops)
Definition: viewtab.cxx:153
bool getBrowseMode() const
Definition: viewopt.hxx:426
bool IsTableRightToLeft() const
Definition: fetab.cxx:2308
void SetRight(long lArgRight)
#define RES_PARATR_TABSTOP
Definition: hintids.hxx:166
Footer, for pageformats Client of FrameFormat describing the footer.
Definition: fmthdft.hxx:64
static void lcl_ConvertToCols(const SvxColumnItem &rColItem, long nTotalWidth, SwFormatCol &rCols)
Definition: viewtab.cxx:111
#define RES_UL_SPACE
Definition: hintids.hxx:197
SwTextNode * m_pNumRuleNodeFromDoc
Definition: view.hxx:177
long GetLower() const
void Right(const long nRight)
Definition: swrect.hxx:198
bool IsHidden(size_t nPos) const
Definition: tabcol.hxx:66
void SetLower(const sal_uInt16 nL, const sal_uInt16 nProp=100)
SfxItemPool & GetPool() const
const GraphicObject & GetGraphicObject() const
const XHatch & GetHatchValue() const
bool m_bSetTabColFromDoc
Definition: view.hxx:229
bool GetFlyFrameAttr(SfxItemSet &rSet) const
Definition: fefly1.cxx:1023
SwSection * GetAnySection(bool bOutOfTab=false, const Point *pPt=nullptr)
Deliver the responsible area of the columns.
Definition: edsect.cxx:83
bool IsHeaderShared() const
Definition: pagedesc.hxx:295
const SfxItemPool & GetAttrPool() const
Definition: viewsh.hxx:614
bool CalcOrtho() const
void SetRight(const long nR, const sal_uInt16 nProp=100)
sal_uInt16 m_nLeftBorderDistance
Definition: view.hxx:222
void SetTabCols(const SwTabCols &rNew, bool bCurRowOnly)
Definition: fetab.cxx:624
Style of a layout element.
Definition: frmfmt.hxx:57
const SfxPoolItem & GetDefault(sal_uInt16 nFormatHint) const
Query default attribute of document.
Definition: edatmisc.cxx:94
#define SID_ATTR_PAGE_FOOTER
Definition: cmdid.h:838
bool IsInRightToLeftText() const
Definition: crsrsh.cxx:3300
Rect of current PrtArea of page.
sal_Int16 GetValue() const
size_t GetCurMouseTabColNum(const Point &rPt) const
Definition: fetab.cxx:2064
static void lcl_FillSvxColumn(const SwFormatCol &rCol, long nTotalWidth, SvxColumnItem &rColItem, long nDistance)
Definition: viewtab.cxx:72
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
const SwColumns & GetColumns() const
Definition: fmtclds.hxx:112
Rect of current section but outside of table.
const SwFrameFormat * GetFooterFormat() const
Definition: fmthdft.hxx:85
void SetVertOrient(sal_Int16 eNew)
Definition: fmtornt.hxx:56
void EndAction(const bool bIdleEnd=false, const bool DoSetPosX=false)
Definition: crsrsh.cxx:229
const SwFormatHoriOrient & GetHoriOrient(bool=true) const
Definition: fmtornt.hxx:108
void Push()
store a copy of the current cursor on the cursor stack
Definition: crsrsh.cxx:2145
#define RES_VERT_ORIENT
Definition: hintids.hxx:207
void SetTabRows(const SwTabCols &rNew, bool bCurColOnly)
Definition: fetab.cxx:675
void ChgFirstShare(bool bNew)
Definition: pagedesc.cxx:380
void SetTabsRelativeToIndent(bool bRel)
void ChgFooterShare(bool bNew)
Definition: pagedesc.hxx:310
SfxBindings & GetBindings()
int i
void SetAttrItem(const SfxPoolItem &, SetAttrMode nFlags=SetAttrMode::DEFAULT, const bool bParagraphSetting=false)
Definition: edatmisc.cxx:113
void SetLeft(long nNew)
Definition: tabcol.hxx:82
const SwPageDesc & GetPageDesc(size_t i) const
Definition: fedesc.cxx:127
bool SetFlyFrameAttr(SfxItemSet &rSet)
Definition: fefly1.cxx:1066
sal_uInt16 CalcColWidth(sal_uInt16 nCol, sal_uInt16 nAct) const
Calculates current width of column nCol.
Definition: atrfrm.cxx:969
FrameTypeFlags
values can be combined via logical or
Definition: fesh.hxx:62
void SetRight(long v)
#define SID_ATTR_PAGE_FOOTER_LRMARGIN
Definition: cmdid.h:839
FlyProtectFlags
values can be combined via logical or
Definition: fesh.hxx:104
const SwFormatFooter & GetFooter(bool=true) const
Definition: fmthdft.hxx:99
long const nBorder
SAL_DLLPRIVATE void SwapPageMargin(const SwPageDesc &, SvxLRSpaceItem &rLR)
Definition: viewtab.cxx:170
void GetMouseTabRows(SwTabCols &rToFill, const Point &rPt) const
Definition: fetab.cxx:693
bool IsFooterShared() const
Definition: pagedesc.hxx:299
void GetTabCols(SwTabCols &rToFill) const
Info about columns and margins.
Definition: fetab.cxx:642
GUIDCNamePair const aData
static void ResizeFrameCols(SwFormatCol &rCol, long nOldWidth, long nNewWidth, long nLeftDelta)
Definition: viewtab.cxx:191
#define XATTR_FILLSTYLE
bool IsAutoUpdateFormat() const
Query / set bAutoUpdateFormat-flag.
Definition: format.hxx:168
void SetObjRect(const SwRect &rRect)
Set size of draw objects.
Definition: fefly1.cxx:1274
SW_DLLPUBLIC void MakeDefTabs(SwTwips nDefDist, SvxTabStopItem &rTabs)
Definition: uitool.cxx:574
VclPtr< SvxRuler > m_pVRuler
Definition: view.hxx:200
SwFrameFormat * GetTableFormat()
Definition: edws.cxx:182
bool m_bTabRowFromDoc
Definition: view.hxx:229
long GetRight() const
sal_uInt16 Count() const
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
Rect of current page.
void StartAction()
Definition: crsrsh.cxx:212
SelectionType
Definition: wrtsh.hxx:58
virtual bool SetFormatAttr(const SfxPoolItem &rAttr)
Definition: format.cxx:460
bool IsColRightToLeft() const
Definition: fews.cxx:629
sal_uInt16 GetWishWidth() const
Definition: fmtclds.hxx:122
void Left(const long nLeft)
Definition: swrect.hxx:193
SwFrameFormat & GetMaster()
Definition: pagedesc.hxx:216
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
void Bottom(const long nBottom)
Definition: swrect.hxx:207
sal_uInt16 GetSlot() const
const SvxULSpaceItem & GetULSpace(bool=true) const
Definition: frmatr.hxx:76
void SetSizeProtect(bool bNew)
sal_uInt16 GetWishWidth() const
Definition: fmtclds.hxx:50
void SetWishWidth(sal_uInt16 nNew)
Definition: fmtclds.hxx:46
SfxItemState
void DisableItem(sal_uInt16 nWhich)
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
void SetPosProtect(bool bNew)
long AdjustRight(long nHorzMoveDelta)
sal_uInt16 GetRight() const
Definition: fmtclds.hxx:52
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
sal_uInt16 GetWhich(sal_uInt16 nSlot, bool bDeep=true) const
bool IsTabColFromDoc() const
Definition: view.hxx:432
void SetHidden(size_t nPos, bool bValue)
Definition: tabcol.hxx:67
long GetLeft() const
unsigned char sal_uInt8
void LockView(bool b)
Definition: viewsh.hxx:465
const SwViewOption * GetViewOptions() const
Definition: viewsh.hxx:426
void Width(long nNew)
Definition: swrect.hxx:185
sal_uInt16 GetCurOutColNum() const
Current outer column.
Definition: fews.cxx:690
static SfxViewShell * Get(const css::uno::Reference< css::frame::XController > &i_rController)
static void lcl_Scale(long &nVal, long nScale)
Definition: viewtab.cxx:185
SwRect GetObjRect() const
For adjustment of PosAttr when anchor changes.
Definition: fefly1.cxx:1263
void ChgPageDesc(size_t i, const SwPageDesc &)
Definition: fedesc.cxx:112
Point m_aTabColFromDocPos
Definition: view.hxx:176
bool IsMouseTableRightToLeft(const Point &rPt) const
Definition: fetab.cxx:2317
size_t IsObjSelected() const
Definition: feshview.cxx:1167
bool m_bSetTabRowFromDoc
Definition: view.hxx:229
void UnSelectFrame()
Definition: select.cxx:327
void SetRight(long aRight)
const SfxPoolItem & GetFormatAttr(sal_uInt16 nWhich, bool bInParents=true) const
If bInParents is FALSE, search only in this format for attribute.
Definition: format.cxx:379
Rect of current header/footer.
bool m_bTabColFromDoc
Definition: view.hxx:229
ColumnDescriptor.
Definition: fmtclds.hxx:33
long Left() const
virtual bool get(DocumentSettingId id) const =0
Return the specified document setting.
Header, for PageFormats Client of FrameFormat describing the header.
Definition: fmthdft.hxx:33
bool GetCurAttr(SfxItemSet &, const bool bMergeIndentValuesOfNumRule=false) const
Definition: edattr.cxx:181
SvxRuler & GetHRuler()
Definition: view.hxx:481
const SwFormatFrameSize & GetFrameSize(bool=true) const
Definition: fmtfsize.hxx:104
void GetTabBorders(SfxItemSet &rSet) const
Definition: fetab.cxx:780
long GetRight() const
void LeaveSelFrameMode()
Definition: select.cxx:721
sal_uInt16 GetLeft() const
Definition: fmtclds.hxx:51
void SetDefTabDist(long)
#define RES_BOX
Definition: hintids.hxx:211
sal_uInt16 GetNumCols() const
Definition: fmtclds.hxx:114
#define XATTR_FILLBITMAP
void SetLeft(long v)
const SwFrameFormat * GetFlyFrameFormat() const
Get FlyFrameFormat; for UI macro linkage at Flys.
Definition: fefly1.cxx:1235
OUString const & GetName() const
Rect of current section.
void SetContentProtect(bool bNew)
void SetSectionAttr(const SfxItemSet &rSet, SwSectionFormat *pSectFormat=nullptr)
Set attributes.
Definition: edsect.cxx:171
bool IsFirstShared() const
Definition: pagedesc.cxx:375
void ExecTabWin(SfxRequest const &)
Definition: viewtab.cxx:232
const SwAttrSet & GetAttrSet() const
For querying the attribute array.
Definition: format.hxx:116
long GetUpper() const
#define WB_EXTRAFIELD
bool IsActive() const
Definition: fmthdft.hxx:58
void SetNumRuleNodeFromDoc(SwTextNode *pNumRuleNode)
Definition: view.hxx:436
void SetIndent(short nIndent, const SwPosition &rPos)
Definition: ednumber.cxx:365
void SetMouseTabRows(const SwTabCols &rNew, bool bCurColOnly, const Point &rPt)
Definition: fetab.cxx:700
void Init(sal_uInt16 nNumCols, sal_uInt16 nGutterWidth, sal_uInt16 nAct)
This function allows to (repeatedly) initialize the columns.
Definition: atrfrm.cxx:947
SelectionType GetSelectionType() const
Definition: wrtsh1.cxx:1380
void SetOrtho(bool bVal)
sal_uInt16 GetSmallestDistance() const
void StartAllAction()
For all views of this document.
Definition: edws.cxx:85
long GetHeight() const
const SfxPoolItem * GetItem(sal_uInt16 nWhich, bool bSearchInParent=true) const
void SetRight(long nNew)
Definition: tabcol.hxx:83
long GetTextLeft() const
void SetUpper(const sal_uInt16 nU, const sal_uInt16 nProp=100)
void SetHeightSizeType(SwFrameSize eSize)
Definition: fmtfsize.hxx:81
size_t GetCurPageDesc(const bool bCalcFrame=true) const
Definition: fedesc.cxx:168
#define SID_ATTR_PAGE_HEADER_SPACING
Definition: cmdid.h:836
size_t GetCurTabColNum() const
Definition: fetab.cxx:1326
Rect of PrtArea of FlyFrame.
FrameTypeFlags GetFrameType(const Point *pPt, bool bStopAtFly) const
For return values see above FrameType.
Definition: fews.cxx:238
bool IsFrameSelected() const
Definition: feshview.cxx:1175
bool IsViewLocked() const
Definition: viewsh.hxx:464
const SwFrameFormat * GetHeaderFormat() const
Definition: fmthdft.hxx:54
long GetLeft() const
Definition: tabcol.hxx:77
size_t Count() const
Definition: tabcol.hxx:64
sal_uInt16 GetUpper() const
void SetLeft(long lArgLeft)
const SvxLRSpaceItem & GetLRSpace(bool=true) const
Definition: frmatr.hxx:74