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