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