LibreOffice Module sw (master)  1
colex.cxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
20 #include <cmdid.h>
21 #include <hintids.hxx>
22 #include <svl/eitem.hxx>
23 #include <tools/fract.hxx>
24 #include <editeng/lrspitem.hxx>
25 #include <editeng/ulspitem.hxx>
26 #include <editeng/sizeitem.hxx>
27 #include <svx/pageitem.hxx>
28 #include <editeng/brushitem.hxx>
29 #include <editeng/frmdiritem.hxx>
30 #include <vcl/outdev.hxx>
31 #include <vcl/settings.hxx>
32 #include <tgrditem.hxx>
33 #include <viewopt.hxx>
34 #include <colex.hxx>
35 #include <colmgr.hxx>
37 
39 {
40  if (SfxItemState::DEFAULT <= rSet.GetItemState(RES_FRAMEDIR))
41  {
42  const SvxFrameDirectionItem& rDirItem = rSet.Get(RES_FRAMEDIR);
43  m_bVertical = rDirItem.GetValue() == SvxFrameDirection::Vertical_RL_TB||
44  rDirItem.GetValue() == SvxFrameDirection::Vertical_LR_TB;
45  }
46 
47  SfxItemPool* pPool = rSet.GetPool();
48  sal_uInt16 nWhich = pPool->GetWhich( SID_ATTR_PAGE );
49  if ( rSet.GetItemState( nWhich, false ) == SfxItemState::SET )
50  {
51  // alignment
52  const SvxPageItem& rPage = static_cast<const SvxPageItem&>(rSet.Get(nWhich));
53  SetUsage(rPage.GetPageUsage());
54  }
55 
56  nWhich = pPool->GetWhich( SID_ATTR_PAGE_SIZE );
57 
58  if ( rSet.GetItemState( nWhich, false ) == SfxItemState::SET )
59  {
60  // orientation and size from PageItem
61  const SvxSizeItem& rSize = static_cast<const SvxSizeItem&>(rSet.Get( nWhich ));
62  SetSize( rSize.GetSize() );
63  }
64  nWhich = RES_LR_SPACE;
65  if ( rSet.GetItemState( nWhich, false ) == SfxItemState::SET )
66  {
67  // set left and right border
68  const SvxLRSpaceItem& rLRSpace = static_cast<const SvxLRSpaceItem&>(rSet.Get( nWhich ));
69 
70  SetLeft( rLRSpace.GetLeft() );
71  SetRight( rLRSpace.GetRight() );
72  }
73  else
74  {
75  SetLeft( 0 );
76  SetRight( 0 );
77  }
78 
79  nWhich = RES_UL_SPACE;
80 
81  if ( rSet.GetItemState( nWhich, false ) == SfxItemState::SET )
82  {
83  // set upper and lower border
84  const SvxULSpaceItem& rULSpace = static_cast<const SvxULSpaceItem&>(rSet.Get( nWhich ));
85 
86  SetTop( rULSpace.GetUpper() );
87  SetBottom( rULSpace.GetLower() );
88  }
89  else
90  {
91  SetTop( 0 );
92  SetBottom( 0 );
93  }
94 
95  // evaluate header-attributes
96  const SfxPoolItem* pItem;
97  if( SfxItemState::SET == rSet.GetItemState( pPool->GetWhich( SID_ATTR_PAGE_HEADERSET),
98  false, &pItem ) )
99  {
100  const SfxItemSet& rHeaderSet = static_cast<const SvxSetItem*>(pItem)->GetItemSet();
101  const SfxBoolItem& rHeaderOn =
102  rHeaderSet.Get( pPool->GetWhich( SID_ATTR_PAGE_ON ) );
103 
104  if ( rHeaderOn.GetValue() )
105  {
106  const SvxSizeItem& rSize =
107  rHeaderSet.Get(pPool->GetWhich(SID_ATTR_PAGE_SIZE));
108 
109  const SvxULSpaceItem& rUL = static_cast<const SvxULSpaceItem&>(rHeaderSet.Get(
110  pPool->GetWhich(SID_ATTR_ULSPACE)));
111  const SvxLRSpaceItem& rLR = static_cast<const SvxLRSpaceItem&>(rHeaderSet.Get(
112  pPool->GetWhich(SID_ATTR_LRSPACE)));
113 
114  SetHdHeight( rSize.GetSize().Height() - rUL.GetLower());
115  SetHdDist( rUL.GetLower() );
116  SetHdLeft( rLR.GetLeft() );
117  SetHdRight( rLR.GetRight() );
118  SetHeader( true );
119 
120  if(SfxItemState::SET == rHeaderSet.GetItemState(RES_BACKGROUND))
121  {
122  // create FillAttributes from SvxBrushItem //SetHdColor(rItem.GetColor());
123  const SvxBrushItem& rItem = rHeaderSet.Get(RES_BACKGROUND);
125 
128  std::make_shared<drawinglayer::attribute::SdrAllFillAttributesHelper>(
129  aTempSet));
130  }
131  }
132  else
133  SetHeader( false );
134  }
135 
136  if( SfxItemState::SET == rSet.GetItemState( pPool->GetWhich( SID_ATTR_PAGE_FOOTERSET),
137  false, &pItem ) )
138  {
139  const SfxItemSet& rFooterSet = static_cast<const SvxSetItem*>(pItem)->GetItemSet();
140  const SfxBoolItem& rFooterOn = rFooterSet.Get( SID_ATTR_PAGE_ON );
141 
142  if ( rFooterOn.GetValue() )
143  {
144  const SvxSizeItem& rSize =
145  rFooterSet.Get( pPool->GetWhich( SID_ATTR_PAGE_SIZE ) );
146 
147  const SvxULSpaceItem& rUL = static_cast<const SvxULSpaceItem&>(rFooterSet.Get(
148  pPool->GetWhich( SID_ATTR_ULSPACE ) ));
149  const SvxLRSpaceItem& rLR = static_cast<const SvxLRSpaceItem&>(rFooterSet.Get(
150  pPool->GetWhich( SID_ATTR_LRSPACE ) ));
151 
152  SetFtHeight( rSize.GetSize().Height() - rUL.GetUpper());
153  SetFtDist( rUL.GetUpper() );
154  SetFtLeft( rLR.GetLeft() );
155  SetFtRight( rLR.GetRight() );
156  SetFooter( true );
157 
158  if( rFooterSet.GetItemState( RES_BACKGROUND ) == SfxItemState::SET )
159  {
160  // create FillAttributes from SvxBrushItem //SetFtColor(rItem.GetColor());
161  const SvxBrushItem& rItem = rFooterSet.Get(RES_BACKGROUND);
163 
166  std::make_shared<drawinglayer::attribute::SdrAllFillAttributesHelper>(
167  aTempSet));
168  }
169  }
170  else
171  SetFooter( false );
172  }
173 
174  if(const SvxBrushItem* pBrushItem = rSet.GetItemIfSet(RES_BACKGROUND, false))
175  {
176  // create FillAttributes from SvxBrushItem
178 
179  setSvxBrushItemAsFillAttributesToTargetSet(*pBrushItem, aTempSet);
181  std::make_shared<drawinglayer::attribute::SdrAllFillAttributesHelper>(
182  aTempSet));
183  }
184 
185  Invalidate();
186 }
187 
188 void SwColExample::DrawPage(vcl::RenderContext& rRenderContext, const Point& rOrg,
189  const bool bSecond, const bool bEnabled)
190 {
191  SwPageExample::DrawPage(rRenderContext, rOrg, bSecond, bEnabled);
192  if (!m_pColMgr)
193  return;
194  sal_uInt16 nColumnCount = m_pColMgr->GetCount();
195  if (!nColumnCount)
196  return;
197 
198  tools::Long nL = GetLeft();
199  tools::Long nR = GetRight();
200 
201  if (GetUsage() == SvxPageUsage::Mirror && !bSecond)
202  {
203  // swap for mirrored
204  nL = GetRight();
205  nR = GetLeft();
206  }
207 
208  rRenderContext.SetFillColor(COL_LIGHTGRAY);
209  tools::Rectangle aRect;
210  aRect.SetRight( rOrg.X() + GetSize().Width() - nR );
211  aRect.SetLeft( rOrg.X() + nL );
212  aRect.SetTop( rOrg.Y() + GetTop() + GetHdHeight() + GetHdDist() );
213  aRect.SetBottom( rOrg.Y() + GetSize().Height() - GetBottom() - GetFtHeight() - GetFtDist() );
214  rRenderContext.DrawRect(aRect);
215 
216  const tools::Rectangle aDefineRect(aRect);
218 
219  if (!rFillAttributes || !rFillAttributes->isUsed())
220  {
221  // If there is no fill, use fallback color
222  const StyleSettings& rStyleSettings = rRenderContext.GetSettings().GetStyleSettings();
223  const Color& rFieldColor = rStyleSettings.GetFieldColor();
224 
226  std::make_shared<drawinglayer::attribute::SdrAllFillAttributesHelper>(
227  rFieldColor));
228  }
229 
230  // #97495# make sure that the automatic column width's are always equal
231  bool bAutoWidth = m_pColMgr->IsAutoWidth();
232  sal_Int32 nAutoColWidth = 0;
233  if (bAutoWidth)
234  {
235  sal_Int32 nColumnWidthSum = 0;
236  for (sal_uInt16 i = 0; i < nColumnCount; ++i)
237  nColumnWidthSum += m_pColMgr->GetColWidth( i );
238  nAutoColWidth = nColumnWidthSum / nColumnCount;
239  }
240 
241  for (sal_uInt16 i = 0; i < nColumnCount; ++i)
242  {
243  if (!bAutoWidth)
244  nAutoColWidth = m_pColMgr->GetColWidth(i);
245 
246  if (!m_bVertical)
247  aRect.SetRight( aRect.Left() + nAutoColWidth );
248  else
249  aRect.SetBottom( aRect.Top() + nAutoColWidth );
250 
251  // use primitive draw command
252  drawFillAttributes(rRenderContext, getPageFillAttributes(), aRect, aDefineRect);
253 
254  if (i < nColumnCount - 1)
255  {
256  if (!m_bVertical)
257  aRect.SetLeft( aRect.Right() + m_pColMgr->GetGutterWidth(i) );
258  else
259  aRect.SetTop( aRect.Bottom() + m_pColMgr->GetGutterWidth(i) );
260  }
261  }
262  if (!m_pColMgr->HasLine())
263  return;
264 
265  Point aUp(rOrg.X() + nL, rOrg.Y() + GetTop());
266  Point aDown(rOrg.X() + nL,
267  rOrg.Y() + GetSize().Height() - GetBottom() - GetFtHeight() - GetFtDist());
268 
269  if (m_pColMgr->GetLineHeightPercent() != 100)
270  {
271  tools::Long nLength = !m_bVertical ? aDown.Y() - aUp.Y() : aDown.X() - aUp.X();
272  nLength -= nLength * m_pColMgr->GetLineHeightPercent() / 100;
273  switch (m_pColMgr->GetAdjust())
274  {
275  case COLADJ_BOTTOM:
276  if (!m_bVertical)
277  aUp.AdjustY(nLength );
278  else
279  aUp.AdjustX(nLength );
280  break;
281  case COLADJ_TOP:
282  if (!m_bVertical)
283  aDown.AdjustY( -nLength );
284  else
285  aDown.AdjustX( -nLength );
286  break;
287  case COLADJ_CENTER:
288  if (!m_bVertical)
289  {
290  aUp.AdjustY(nLength / 2 );
291  aDown.AdjustY( -(nLength / 2) );
292  }
293  else
294  {
295  aUp.AdjustX(nLength / 2 );
296  aDown.AdjustX( -(nLength / 2) );
297  }
298  break;
299  default:
300  break; // prevent warning
301  }
302  }
303 
304  for (sal_uInt16 i = 0; i < nColumnCount - 1; ++i)
305  {
306  int nGutter = m_pColMgr->GetGutterWidth(i);
307  int nDist = m_pColMgr->GetColWidth( i ) + nGutter;
308  nDist -= (i == 0) ? nGutter / 2 : 0;
309  if (!m_bVertical)
310  {
311  aUp.AdjustX(nDist );
312  aDown.AdjustX(nDist );
313  }
314  else
315  {
316  aUp.AdjustY(nDist );
317  aDown.AdjustY(nDist );
318  }
319 
320  rRenderContext.DrawLine(aUp, aDown);
321  }
322 }
323 
325  : m_aFrameSize(SvxPaperInfo::GetPaperSize(PAPER_A4)) // DIN A4
326 {
327  ::FitToActualSize(m_aCols, o3tl::narrowing<sal_uInt16>(m_aFrameSize.Width()));
328 }
329 
330 void SwColumnOnlyExample::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& /*rRect*/)
331 {
332  rRenderContext.Push(vcl::PushFlags::MAPMODE);
333 
335  MapMode aMapMode(MapUnit::MapTwip);
336  aMapMode.SetScaleX(aScale);
337  aMapMode.SetScaleY(aScale);
338  rRenderContext.SetMapMode(aMapMode);
339 
340  const StyleSettings& rStyleSettings = rRenderContext.GetSettings().GetStyleSettings();
341  const Color& rFieldColor = rStyleSettings.GetFieldColor();
342  const Color& rDlgColor = rStyleSettings.GetDialogColor();
343  const Color& rFieldTextColor = SwViewOption::GetFontColor();
344  Color aGrayColor(COL_LIGHTGRAY);
345  if (rFieldColor == aGrayColor)
346  aGrayColor.Invert();
347 
348  Size aLogSize(rRenderContext.PixelToLogic(GetOutputSizePixel()));
349  tools::Rectangle aCompleteRect(Point(0,0), aLogSize);
350  rRenderContext.SetLineColor(rDlgColor);
351  rRenderContext.SetFillColor(rDlgColor);
352  rRenderContext.DrawRect(aCompleteRect);
353 
354  rRenderContext.SetLineColor(rFieldTextColor);
355  Point aTL((aLogSize.Width() - m_aFrameSize.Width()) / 2,
356  (aLogSize.Height() - m_aFrameSize.Height()) / 2);
357  tools::Rectangle aRect(aTL, m_aFrameSize);
358 
359  //draw a shadow rectangle
360  rRenderContext.SetFillColor(COL_GRAY);
361  tools::Rectangle aShadowRect(aRect);
362  aShadowRect.Move(aTL.Y(), aTL.Y());
363  rRenderContext.DrawRect(aShadowRect);
364 
365  rRenderContext.SetFillColor(rFieldColor);
366  rRenderContext.DrawRect(aRect);
367 
368  rRenderContext.SetFillColor(aGrayColor);
369 
370  //column separator?
371  tools::Long nLength = aLogSize.Height() - 2 * aTL.Y();
372  Point aUp(aTL);
373  Point aDown(aTL.X(), nLength);
374  bool bLines = false;
375  if (m_aCols.GetLineAdj() != COLADJ_NONE)
376  {
377  bLines = true;
378 
379  sal_uInt16 nPercent = m_aCols.GetLineHeight();
380  if (nPercent != 100)
381  {
382  nLength -= nLength * nPercent / 100;
383  switch(m_aCols.GetLineAdj())
384  {
385  case COLADJ_BOTTOM: aUp.AdjustY(nLength ); break;
386  case COLADJ_TOP: aDown.AdjustY( -nLength ); break;
387  case COLADJ_CENTER:
388  aUp.AdjustY(nLength / 2 );
389  aDown.AdjustY( -(nLength / 2) );
390  break;
391  default:
392  break; //prevent warning
393  }
394  }
395 
396  }
397  const SwColumns& rCols = m_aCols.GetColumns();
398  sal_uInt16 nColCount = rCols.size();
399  if (nColCount)
400  {
401  rRenderContext.DrawRect(aRect);
402  rRenderContext.SetFillColor(rFieldColor);
403  tools::Rectangle aFrameRect(aTL, m_aFrameSize);
404  tools::Long nSum = aTL.X();
405  for (sal_uInt16 i = 0; i < nColCount; i++)
406  {
407  const SwColumn* pCol = &rCols[i];
408  aFrameRect.SetLeft( nSum + pCol->GetLeft() ); //nSum + pCol->GetLeft() + aTL.X();
409  nSum += pCol->GetWishWidth();
410  aFrameRect.SetRight( nSum - pCol->GetRight() );
411  rRenderContext.DrawRect(aFrameRect);
412  }
413  if (bLines)
414  {
415  nSum = aTL.X();
416  for (sal_uInt16 i = 0; i < nColCount - 1; i++)
417  {
418  nSum += rCols[i].GetWishWidth();
419  aUp.setX( nSum );
420  aDown.setX( nSum );
421  rRenderContext.DrawLine(aUp, aDown);
422  }
423  }
424  }
425  rRenderContext.Pop();
426 }
427 
429 {
430  m_aCols = rCol;
431  sal_uInt16 nWishSum = m_aCols.GetWishWidth();
432  tools::Long nFrameWidth = m_aFrameSize.Width();
433  SwColumns& rCols = m_aCols.GetColumns();
434  sal_uInt16 nColCount = rCols.size();
435 
436  for(sal_uInt16 i = 0; i < nColCount; i++)
437  {
438  SwColumn* pCol = &rCols[i];
439  tools::Long nWish = pCol->GetWishWidth();
440  nWish *= nFrameWidth;
441  nWish /= nWishSum;
442  pCol->SetWishWidth(o3tl::narrowing<sal_uInt16>(nWish));
443  tools::Long nLeft = pCol->GetLeft();
444  nLeft *= nFrameWidth;
445  nLeft /= nWishSum;
446  pCol->SetLeft(o3tl::narrowing<sal_uInt16>(nLeft));
447  tools::Long nRight = pCol->GetRight();
448  nRight *= nFrameWidth;
449  nRight /= nWishSum;
450  pCol->SetRight(o3tl::narrowing<sal_uInt16>(nRight));
451  }
452  // #97495# make sure that the automatic column width's are always equal
453  if(!(nColCount && m_aCols.IsOrtho()))
454  return;
455 
456  sal_Int32 nColumnWidthSum = 0;
457  sal_uInt16 i;
458  for(i = 0; i < nColCount; ++i)
459  {
460  SwColumn* pCol = &rCols[i];
461  nColumnWidthSum += pCol->GetWishWidth();
462  nColumnWidthSum -= (pCol->GetRight() + pCol->GetLeft());
463  }
464  nColumnWidthSum /= nColCount;
465  for(i = 0; i < nColCount; ++i)
466  {
467  SwColumn* pCol = &rCols[i];
468  pCol->SetWishWidth( static_cast< sal_uInt16 >(nColumnWidthSum + pCol->GetRight() + pCol->GetLeft()));
469  }
470 }
471 
473 {
475  OutputDevice& rRefDevice = pDrawingArea->get_ref_device();
476  Size aPrefSize(rRefDevice.LogicToPixel(Size(75, 46), MapMode(MapUnit::MapAppFont)));
477  pDrawingArea->set_size_request(aPrefSize.Width(), aPrefSize.Height());
478 }
479 
481 {
482  OutputDevice& rRefDevice = GetDrawingArea()->get_ref_device();
483  rRefDevice.Push(vcl::PushFlags::MAPMODE);
484  rRefDevice.SetMapMode(MapMode(MapUnit::MapTwip));
486  m_aWinSize.AdjustHeight( -4 );
487  m_aWinSize.AdjustWidth( -4 );
488  m_aWinSize = rRefDevice.PixelToLogic(m_aWinSize);
489  rRefDevice.Pop();
490  Invalidate();
491 }
492 
494 {
495 }
496 
497 void SwPageGridExample::DrawPage(vcl::RenderContext& rRenderContext, const Point& rOrg,
498  const bool bSecond, const bool bEnabled)
499 {
500  SwPageExample::DrawPage(rRenderContext, rOrg, bSecond, bEnabled);
501 
502  if (!m_pGridItem || !m_pGridItem->GetGridType())
503  return;
504 
505  //paint the grid now
506  Color aLineColor = m_pGridItem->GetColor();
507  if (aLineColor == COL_AUTO)
508  {
509  aLineColor = rRenderContext.GetFillColor();
510  aLineColor.Invert();
511  }
512  rRenderContext.SetLineColor(aLineColor);
513  tools::Long nL = GetLeft();
514  tools::Long nR = GetRight();
515 
516  if (GetUsage() == SvxPageUsage::Mirror && !bSecond)
517  {
518  // rotate for mirrored
519  nL = GetRight();
520  nR = GetLeft();
521  }
522 
523  tools::Rectangle aRect;
524  aRect.SetRight( rOrg.X() + GetSize().Width() - nR );
525  aRect.SetLeft( rOrg.X() + nL );
526  aRect.SetTop( rOrg.Y() + GetTop() + GetHdHeight() + GetHdDist() );
527  aRect.SetBottom( rOrg.Y() + GetSize().Height() - GetBottom() - GetFtHeight() - GetFtDist() );
528 
529  //increase the values to get a 'viewable' preview
530  sal_Int32 nBaseHeight = m_pGridItem->GetBaseHeight() * 3;
531  sal_Int32 nRubyHeight = m_pGridItem->GetRubyHeight() * 3;
532 
533  //detect height of rectangles
534  tools::Rectangle aRubyRect(aRect.TopLeft(),
535  m_bVertical ?
536  Size(nRubyHeight, aRect.GetHeight()) :
537  Size(aRect.GetWidth(), nRubyHeight));
538  tools::Rectangle aCharRect(aRect.TopLeft(),
539  m_bVertical ?
540  Size(nBaseHeight, aRect.GetHeight()) :
541  Size(aRect.GetWidth(), nBaseHeight));
542 
543  sal_Int32 nLineHeight = nBaseHeight + nRubyHeight;
544 
545  //detect count of rectangles
546  sal_Int32 nLines = (m_bVertical ? aRect.GetWidth(): aRect.GetHeight()) / nLineHeight;
547  if (nLines > m_pGridItem->GetLines())
548  nLines = m_pGridItem->GetLines();
549 
550  // determine start position
551  if (m_bVertical)
552  {
553  sal_Int16 nXStart = static_cast<sal_Int16>(aRect.GetWidth() / 2 - nLineHeight * nLines /2);
554  aRubyRect.Move(nXStart, 0);
555  aCharRect.Move(nXStart, 0);
556  }
557  else
558  {
559  sal_Int16 nYStart = static_cast<sal_Int16>(aRect.GetHeight() / 2 - nLineHeight * nLines /2);
560  aRubyRect.Move(0, nYStart);
561  aCharRect.Move(0, nYStart);
562  }
563 
564  if (m_pGridItem->IsRubyTextBelow())
565  m_bVertical ? aRubyRect.Move(nBaseHeight, 0) : aRubyRect.Move(0, nBaseHeight);
566  else
567  m_bVertical ? aCharRect.Move(nRubyHeight, 0) : aCharRect.Move(0, nRubyHeight);
568 
569  //vertical lines
570  bool bBothLines = m_pGridItem->GetGridType() == GRID_LINES_CHARS;
571  rRenderContext.SetFillColor(COL_TRANSPARENT);
572  sal_Int32 nXMove = m_bVertical ? nLineHeight : 0;
573  sal_Int32 nYMove = m_bVertical ? 0 : nLineHeight;
574  for (sal_Int32 nLine = 0; nLine < nLines; nLine++)
575  {
576  rRenderContext.DrawRect(aRubyRect);
577  rRenderContext.DrawRect(aCharRect);
578  if (bBothLines)
579  {
580  Point aStart = aCharRect.TopLeft();
581  Point aEnd = m_bVertical ? aCharRect.TopRight() : aCharRect.BottomLeft();
582  while (m_bVertical ? aStart.Y() < aRect.Bottom(): aStart.X() < aRect.Right())
583  {
584  rRenderContext.DrawLine(aStart, aEnd);
585  if (m_bVertical)
586  aStart.setY( aEnd.AdjustY(nBaseHeight ) );
587  else
588  aStart.setX( aEnd.AdjustX(nBaseHeight ) );
589  }
590  }
591  aRubyRect.Move(nXMove, nYMove);
592  aCharRect.Move(nXMove, nYMove);
593  }
594 
595 }
596 
598 {
599  m_pGridItem.reset();
600  //get the grid information
601  if (SfxItemState::DEFAULT <= rSet.GetItemState(RES_TEXTGRID))
602  m_pGridItem.reset(rSet.Get(RES_TEXTGRID).Clone());
604 }
605 
606 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
bool GetValue() const
constexpr TypedWhichId< SvxFrameDirectionItem > RES_FRAMEDIR(120)
void SetColumns(const SwFormatCol &rCol)
Definition: colex.cxx:428
const Color & GetDialogColor() const
const T * GetItemIfSet(TypedWhichId< T > nWhich, bool bSrchInParent=true) const
std::vector< SwColumn > SwColumns
Definition: fmtclds.hxx:57
void setHeaderFillAttributes(const drawinglayer::attribute::SdrAllFillAttributesHelperPtr &rFillAttributes)
static void drawFillAttributes(vcl::RenderContext &rRenderContext, const drawinglayer::attribute::SdrAllFillAttributesHelperPtr &rFillAttributes, const tools::Rectangle &rPaintRange, const tools::Rectangle &rDefineRange)
sal_uInt16 GetLower() const
bool IsOrtho() const
Definition: fmtclds.hxx:121
void SetFooter(bool bNew)
void FitToActualSize(SwFormatCol &rCol, sal_uInt16 nWidth)
Definition: colmgr.cxx:35
void SetLeft(sal_uInt16 nNew)
Definition: fmtclds.hxx:47
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const =0
constexpr tools::Long Left() const
void setPageFillAttributes(const drawinglayer::attribute::SdrAllFillAttributesHelperPtr &rFillAttributes)
long Long
tools::Long GetRight() const
constexpr::Color COL_TRANSPARENT(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
void SetFtHeight(tools::Long nNew)
const StyleSettings & GetStyleSettings() const
void Push(vcl::PushFlags nFlags=vcl::PushFlags::ALL)
constexpr::Color COL_AUTO(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
void SetRight(sal_uInt16 nNew)
Definition: fmtclds.hxx:48
void SetHdHeight(tools::Long nNew)
void SetTop(tools::Long nNew)
constexpr::Color COL_LIGHTGRAY(0xC0, 0xC0, 0xC0)
tools::Long GetHdDist() const
tools::Long GetFtHeight() const
void SetMapMode()
Size const & GetOutputSizePixel() const
void UpdateExample(const SfxItemSet &rSet)
Definition: colex.cxx:38
constexpr tools::Long Width() const
short GetLineHeightPercent() const
Definition: colmgr.cxx:106
void SetFtRight(tools::Long nNew)
sal_uInt16 GetColWidth(sal_uInt16 nIdx) const
Definition: colmgr.cxx:117
bool IsAutoWidth() const
Definition: colmgr.hxx:101
tools::Long GetFtDist() const
constexpr Point BottomLeft() const
void SetFtLeft(tools::Long nNew)
void setFooterFillAttributes(const drawinglayer::attribute::SdrAllFillAttributesHelperPtr &rFillAttributes)
std::shared_ptr< SdrAllFillAttributesHelper > SdrAllFillAttributesHelperPtr
Definition: format.hxx:41
tools::Long GetTop() const
tools::Long GetRight() const
bool m_bVertical
Definition: colex.hxx:34
tools::Long GetBottom() const
constexpr tools::Long GetWidth() const
virtual OutputDevice & get_ref_device()=0
void DrawLine(const Point &rStartPt, const Point &rEndPt)
bool HasLine() const
Definition: colmgr.hxx:114
tools::Long GetHdHeight() const
void DrawRect(const tools::Rectangle &rRect)
constexpr void SetLeft(tools::Long v)
void Invert()
const drawinglayer::attribute::SdrAllFillAttributesHelperPtr & getPageFillAttributes() const
virtual void SetDrawingArea(weld::DrawingArea *pDrawingArea) override
Definition: colex.cxx:472
void SetLineColor()
virtual void DrawPage(vcl::RenderContext &rRenderContext, const Point &rPoint, const bool bSecond, const bool bEnabled) override
Definition: colex.cxx:497
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
int i
const SwColumns & GetColumns() const
Definition: fmtclds.hxx:112
virtual void DrawPage(vcl::RenderContext &rRenderContext, const Point &rPoint, const bool bSecond, const bool bEnabled) override
Definition: colex.cxx:188
sal_uInt8 GetLineHeight() const
Definition: fmtclds.hxx:123
SwFormatCol m_aCols
Definition: colex.hxx:90
void SetHeader(bool bNew)
tools::Long GetLeft() const
constexpr tools::Long Right() const
void SetFillColor()
const ::std::vector< Color > ImpSvNumberformatScan::StandardColor COL_GRAY
const Color & GetFieldColor() const
void SetFtDist(tools::Long nNew)
void SetBottom(tools::Long nNew)
const SfxItemSet * GetItemSet(const SfxPoolItem &rAttr)
Returns the item set associated with a character/inet/auto style.
Definition: atrstck.cxx:133
void UpdateExample(const SfxItemSet &rSet)
Definition: colex.cxx:597
void SetHdDist(tools::Long nNew)
void SetSize(const Size &rSize)
constexpr tools::Long Top() const
void setSvxBrushItemAsFillAttributesToTargetSet(const SvxBrushItem &rBrush, SfxItemSet &rToSet)
constexpr void SetRight(tools::Long v)
const AllSettings & GetSettings() const
constexpr void SetBottom(tools::Long v)
void SetHdRight(tools::Long nNew)
SfxItemPool * GetPool() const
virtual void Resize() override
Definition: colex.cxx:480
constexpr void SetTop(tools::Long v)
SvxPageUsage GetUsage() const
constexpr Point TopLeft() const
SwColMgr * m_pColMgr
Definition: colex.hxx:62
constexpr tools::Long Bottom() const
SAL_WARN_UNUSED_RESULT Point PixelToLogic(const Point &rDevicePt) const
SAL_WARN_UNUSED_RESULT Point LogicToPixel(const Point &rLogicPt) const
const Size & GetSize() const
sal_uInt16 GetWishWidth() const
Definition: fmtclds.hxx:122
SvxPageUsage GetPageUsage() const
tools::Long GetLeft() const
weld::DrawingArea * GetDrawingArea() const
sal_uInt16 GetWishWidth() const
Definition: fmtclds.hxx:50
SwColLineAdj GetAdjust() const
Definition: colmgr.hxx:92
void SetWishWidth(sal_uInt16 nNew)
Definition: fmtclds.hxx:46
constexpr TypedWhichId< SwTextGridItem > RES_TEXTGRID(115)
constexpr TypedWhichId< SvxBrushItem > RES_BACKGROUND(105)
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
constexpr tools::Long Height() const
constexpr Point TopRight() const
static Color & GetFontColor()
Definition: viewopt.cxx:456
virtual void DrawPage(vcl::RenderContext &rRenderContext, const Point &rPoint, const bool bSecond, const bool bEnabled)
tools::Long AdjustWidth(tools::Long n)
virtual void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect) override
Definition: colex.cxx:330
virtual void SetDrawingArea(weld::DrawingArea *pDrawingArea)
constexpr TypedWhichId< SvxLRSpaceItem > RES_LR_SPACE(91)
ColumnDescriptor.
Definition: fmtclds.hxx:33
tools::Long AdjustHeight(tools::Long n)
void SetLeft(tools::Long nNew)
void SetRight(tools::Long nNew)
sal_uInt16 GetLeft() const
Definition: fmtclds.hxx:51
void Move(tools::Long nHorzMoveDelta, tools::Long nVertMoveDelta)
void SetUsage(SvxPageUsage eU)
sal_Int32 nLength
sal_uInt16 GetGutterWidth(sal_uInt16 nPos=USHRT_MAX) const
Definition: colmgr.cxx:77
sal_uInt16 GetCount() const
Definition: colmgr.hxx:73
PAPER_A4
virtual void set_size_request(int nWidth, int nHeight)=0
constexpr TypedWhichId< SvxULSpaceItem > RES_UL_SPACE(92)
void SetHdLeft(tools::Long nNew)
const Size & GetSize() const
std::unique_ptr< SwTextGridItem > m_pGridItem
Definition: colex.hxx:47
const Color & GetFillColor() const
sal_uInt16 GetUpper() const
SwColLineAdj GetLineAdj() const
Definition: fmtclds.hxx:120
constexpr tools::Long GetHeight() const