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  static_cast<const SfxBoolItem&>(rHeaderSet.Get( pPool->GetWhich( SID_ATTR_PAGE_ON ) ) );
103 
104  if ( rHeaderOn.GetValue() )
105  {
106  const SvxSizeItem& rSize =
107  static_cast<const SvxSizeItem&>(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  static_cast<const SvxSizeItem&>(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(SfxItemState::SET == rSet.GetItemState(RES_BACKGROUND, false, &pItem))
175  {
176  // create FillAttributes from SvxBrushItem
177  const SvxBrushItem& rItem = static_cast< const SvxBrushItem& >(*pItem);
179 
182  std::make_shared<drawinglayer::attribute::SdrAllFillAttributesHelper>(
183  aTempSet));
184  }
185 
186  Invalidate();
187 }
188 
189 void SwColExample::DrawPage(vcl::RenderContext& rRenderContext, const Point& rOrg,
190  const bool bSecond, const bool bEnabled)
191 {
192  SwPageExample::DrawPage(rRenderContext, rOrg, bSecond, bEnabled);
193  if (!pColMgr)
194  return;
195  sal_uInt16 nColumnCount = pColMgr->GetCount();
196  if (!nColumnCount)
197  return;
198 
199  long nL = GetLeft();
200  long nR = GetRight();
201 
202  if (GetUsage() == SvxPageUsage::Mirror && !bSecond)
203  {
204  // swap for mirrored
205  nL = GetRight();
206  nR = GetLeft();
207  }
208 
209  rRenderContext.SetFillColor(COL_LIGHTGRAY);
210  tools::Rectangle aRect;
211  aRect.SetRight( rOrg.X() + GetSize().Width() - nR );
212  aRect.SetLeft( rOrg.X() + nL );
213  aRect.SetTop( rOrg.Y() + GetTop() + GetHdHeight() + GetHdDist() );
214  aRect.SetBottom( rOrg.Y() + GetSize().Height() - GetBottom() - GetFtHeight() - GetFtDist() );
215  rRenderContext.DrawRect(aRect);
216 
217  const tools::Rectangle aDefineRect(aRect);
219 
220  if (!rFillAttributes.get() || !rFillAttributes->isUsed())
221  {
222  // If there is no fill, use fallback color
223  const StyleSettings& rStyleSettings = rRenderContext.GetSettings().GetStyleSettings();
224  const Color& rFieldColor = rStyleSettings.GetFieldColor();
225 
227  std::make_shared<drawinglayer::attribute::SdrAllFillAttributesHelper>(
228  rFieldColor));
229  }
230 
231  // #97495# make sure that the automatic column width's are always equal
232  bool bAutoWidth = pColMgr->IsAutoWidth();
233  sal_Int32 nAutoColWidth = 0;
234  if (bAutoWidth)
235  {
236  sal_Int32 nColumnWidthSum = 0;
237  for (sal_uInt16 i = 0; i < nColumnCount; ++i)
238  nColumnWidthSum += pColMgr->GetColWidth( i );
239  nAutoColWidth = nColumnWidthSum / nColumnCount;
240  }
241 
242  for (sal_uInt16 i = 0; i < nColumnCount; ++i)
243  {
244  if (!bAutoWidth)
245  nAutoColWidth = pColMgr->GetColWidth(i);
246 
247  if (!m_bVertical)
248  aRect.SetRight( aRect.Left() + nAutoColWidth );
249  else
250  aRect.SetBottom( aRect.Top() + nAutoColWidth );
251 
252  // use primitive draw command
253  drawFillAttributes(rRenderContext, getPageFillAttributes(), aRect, aDefineRect);
254 
255  if (i < nColumnCount - 1)
256  {
257  if (!m_bVertical)
258  aRect.SetLeft( aRect.Right() + pColMgr->GetGutterWidth(i) );
259  else
260  aRect.SetTop( aRect.Bottom() + pColMgr->GetGutterWidth(i) );
261  }
262  }
263  if (pColMgr->HasLine())
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 (pColMgr->GetLineHeightPercent() != 100)
270  {
271  long nLength = !m_bVertical ? aDown.Y() - aUp.Y() : aDown.X() - aUp.X();
272  nLength -= nLength * pColMgr->GetLineHeightPercent() / 100;
273  switch (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 = pColMgr->GetGutterWidth(i);
307  int nDist = 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 }
324 
326  : m_aFrameSize(SvxPaperInfo::GetPaperSize(PAPER_A4)) // DIN A4
327 {
328  ::FitToActualSize(m_aCols, static_cast<sal_uInt16>(m_aFrameSize.Width()));
329 }
330 
331 void SwColumnOnlyExample::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& /*rRect*/)
332 {
333  rRenderContext.Push(PushFlags::MAPMODE);
334 
336  MapMode aMapMode(MapUnit::MapTwip);
337  aMapMode.SetScaleX(aScale);
338  aMapMode.SetScaleY(aScale);
339  rRenderContext.SetMapMode(aMapMode);
340 
341  const StyleSettings& rStyleSettings = rRenderContext.GetSettings().GetStyleSettings();
342  const Color& rFieldColor = rStyleSettings.GetFieldColor();
343  const Color& rDlgColor = rStyleSettings.GetDialogColor();
344  const Color& rFieldTextColor = SwViewOption::GetFontColor();
345  Color aGrayColor(COL_LIGHTGRAY);
346  if (rFieldColor == aGrayColor)
347  aGrayColor.Invert();
348 
349  Size aLogSize(rRenderContext.PixelToLogic(GetOutputSizePixel()));
350  tools::Rectangle aCompleteRect(Point(0,0), aLogSize);
351  rRenderContext.SetLineColor(rDlgColor);
352  rRenderContext.SetFillColor(rDlgColor);
353  rRenderContext.DrawRect(aCompleteRect);
354 
355  rRenderContext.SetLineColor(rFieldTextColor);
356  Point aTL((aLogSize.Width() - m_aFrameSize.Width()) / 2,
357  (aLogSize.Height() - m_aFrameSize.Height()) / 2);
358  tools::Rectangle aRect(aTL, m_aFrameSize);
359 
360  //draw a shadow rectangle
361  rRenderContext.SetFillColor(COL_GRAY);
362  tools::Rectangle aShadowRect(aRect);
363  aShadowRect.Move(aTL.Y(), aTL.Y());
364  rRenderContext.DrawRect(aShadowRect);
365 
366  rRenderContext.SetFillColor(rFieldColor);
367  rRenderContext.DrawRect(aRect);
368 
369  rRenderContext.SetFillColor(aGrayColor);
370 
371  //column separator?
372  long nLength = aLogSize.Height() - 2 * aTL.Y();
373  Point aUp(aTL);
374  Point aDown(aTL.X(), nLength);
375  bool bLines = false;
376  if (m_aCols.GetLineAdj() != COLADJ_NONE)
377  {
378  bLines = true;
379 
380  sal_uInt16 nPercent = m_aCols.GetLineHeight();
381  if (nPercent != 100)
382  {
383  nLength -= nLength * nPercent / 100;
384  switch(m_aCols.GetLineAdj())
385  {
386  case COLADJ_BOTTOM: aUp.AdjustY(nLength ); break;
387  case COLADJ_TOP: aDown.AdjustY( -nLength ); break;
388  case COLADJ_CENTER:
389  aUp.AdjustY(nLength / 2 );
390  aDown.AdjustY( -(nLength / 2) );
391  break;
392  default:
393  break; //prevent warning
394  }
395  }
396 
397  }
398  const SwColumns& rCols = m_aCols.GetColumns();
399  sal_uInt16 nColCount = rCols.size();
400  if (nColCount)
401  {
402  rRenderContext.DrawRect(aRect);
403  rRenderContext.SetFillColor(rFieldColor);
404  tools::Rectangle aFrameRect(aTL, m_aFrameSize);
405  long nSum = aTL.X();
406  for (sal_uInt16 i = 0; i < nColCount; i++)
407  {
408  const SwColumn* pCol = &rCols[i];
409  aFrameRect.SetLeft( nSum + pCol->GetLeft() ); //nSum + pCol->GetLeft() + aTL.X();
410  nSum += pCol->GetWishWidth();
411  aFrameRect.SetRight( nSum - pCol->GetRight() );
412  rRenderContext.DrawRect(aFrameRect);
413  }
414  if (bLines)
415  {
416  nSum = aTL.X();
417  for (sal_uInt16 i = 0; i < nColCount - 1; i++)
418  {
419  nSum += rCols[i].GetWishWidth();
420  aUp.setX( nSum );
421  aDown.setX( nSum );
422  rRenderContext.DrawLine(aUp, aDown);
423  }
424  }
425  }
426  rRenderContext.Pop();
427 }
428 
430 {
431  m_aCols = rCol;
432  sal_uInt16 nWishSum = m_aCols.GetWishWidth();
433  long nFrameWidth = m_aFrameSize.Width();
434  SwColumns& rCols = m_aCols.GetColumns();
435  sal_uInt16 nColCount = rCols.size();
436 
437  for(sal_uInt16 i = 0; i < nColCount; i++)
438  {
439  SwColumn* pCol = &rCols[i];
440  long nWish = pCol->GetWishWidth();
441  nWish *= nFrameWidth;
442  nWish /= nWishSum;
443  pCol->SetWishWidth(static_cast<sal_uInt16>(nWish));
444  long nLeft = pCol->GetLeft();
445  nLeft *= nFrameWidth;
446  nLeft /= nWishSum;
447  pCol->SetLeft(static_cast<sal_uInt16>(nLeft));
448  long nRight = pCol->GetRight();
449  nRight *= nFrameWidth;
450  nRight /= nWishSum;
451  pCol->SetRight(static_cast<sal_uInt16>(nRight));
452  }
453  // #97495# make sure that the automatic column width's are always equal
454  if(nColCount && m_aCols.IsOrtho())
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 }
472 
474 {
476  OutputDevice& rRefDevice = pDrawingArea->get_ref_device();
477  Size aPrefSize(rRefDevice.LogicToPixel(Size(75, 46), MapMode(MapUnit::MapAppFont)));
478  pDrawingArea->set_size_request(aPrefSize.Width(), aPrefSize.Height());
479 }
480 
482 {
483  OutputDevice& rRefDevice = GetDrawingArea()->get_ref_device();
484  rRefDevice.Push(PushFlags::MAPMODE);
485  rRefDevice.SetMapMode(MapMode(MapUnit::MapTwip));
487  m_aWinSize.AdjustHeight( -4 );
488  m_aWinSize.AdjustWidth( -4 );
489  m_aWinSize = rRefDevice.PixelToLogic(m_aWinSize);
490  rRefDevice.Pop();
491  Invalidate();
492 }
493 
495 {
496 }
497 
498 void SwPageGridExample::DrawPage(vcl::RenderContext& rRenderContext, const Point& rOrg,
499  const bool bSecond, const bool bEnabled)
500 {
501  SwPageExample::DrawPage(rRenderContext, rOrg, bSecond, bEnabled);
502 
503  if (!pGridItem || !pGridItem->GetGridType())
504  return;
505 
506  //paint the grid now
507  Color aLineColor = pGridItem->GetColor();
508  if (aLineColor == COL_AUTO)
509  {
510  aLineColor = rRenderContext.GetFillColor();
511  aLineColor.Invert();
512  }
513  rRenderContext.SetLineColor(aLineColor);
514  long nL = GetLeft();
515  long nR = GetRight();
516 
517  if (GetUsage() == SvxPageUsage::Mirror && !bSecond)
518  {
519  // rotate for mirrored
520  nL = GetRight();
521  nR = GetLeft();
522  }
523 
524  tools::Rectangle aRect;
525  aRect.SetRight( rOrg.X() + GetSize().Width() - nR );
526  aRect.SetLeft( rOrg.X() + nL );
527  aRect.SetTop( rOrg.Y() + GetTop() + GetHdHeight() + GetHdDist() );
528  aRect.SetBottom( rOrg.Y() + GetSize().Height() - GetBottom() - GetFtHeight() - GetFtDist() );
529 
530  //increase the values to get a 'viewable' preview
531  sal_Int32 nBaseHeight = pGridItem->GetBaseHeight() * 3;
532  sal_Int32 nRubyHeight = pGridItem->GetRubyHeight() * 3;
533 
534  //detect height of rectangles
535  tools::Rectangle aRubyRect(aRect.TopLeft(),
536  m_bVertical ?
537  Size(nRubyHeight, aRect.GetHeight()) :
538  Size(aRect.GetWidth(), nRubyHeight));
539  tools::Rectangle aCharRect(aRect.TopLeft(),
540  m_bVertical ?
541  Size(nBaseHeight, aRect.GetHeight()) :
542  Size(aRect.GetWidth(), nBaseHeight));
543 
544  sal_Int32 nLineHeight = nBaseHeight + nRubyHeight;
545 
546  //detect count of rectangles
547  sal_Int32 nLines = (m_bVertical ? aRect.GetWidth(): aRect.GetHeight()) / nLineHeight;
548  if (nLines > pGridItem->GetLines())
549  nLines = pGridItem->GetLines();
550 
551  // determine start position
552  if (m_bVertical)
553  {
554  sal_Int16 nXStart = static_cast<sal_Int16>(aRect.GetWidth() / 2 - nLineHeight * nLines /2);
555  aRubyRect.Move(nXStart, 0);
556  aCharRect.Move(nXStart, 0);
557  }
558  else
559  {
560  sal_Int16 nYStart = static_cast<sal_Int16>(aRect.GetHeight() / 2 - nLineHeight * nLines /2);
561  aRubyRect.Move(0, nYStart);
562  aCharRect.Move(0, nYStart);
563  }
564 
565  if (pGridItem->IsRubyTextBelow())
566  m_bVertical ? aRubyRect.Move(nBaseHeight, 0) : aRubyRect.Move(0, nBaseHeight);
567  else
568  m_bVertical ? aCharRect.Move(nRubyHeight, 0) : aCharRect.Move(0, nRubyHeight);
569 
570  //vertical lines
571  bool bBothLines = pGridItem->GetGridType() == GRID_LINES_CHARS;
572  rRenderContext.SetFillColor(COL_TRANSPARENT);
573  sal_Int32 nXMove = m_bVertical ? nLineHeight : 0;
574  sal_Int32 nYMove = m_bVertical ? 0 : nLineHeight;
575  for (sal_Int32 nLine = 0; nLine < nLines; nLine++)
576  {
577  rRenderContext.DrawRect(aRubyRect);
578  rRenderContext.DrawRect(aCharRect);
579  if (bBothLines)
580  {
581  Point aStart = aCharRect.TopLeft();
582  Point aEnd = m_bVertical ? aCharRect.TopRight() : aCharRect.BottomLeft();
583  while (m_bVertical ? aStart.Y() < aRect.Bottom(): aStart.X() < aRect.Right())
584  {
585  rRenderContext.DrawLine(aStart, aEnd);
586  if (m_bVertical)
587  aStart.setY( aEnd.AdjustY(nBaseHeight ) );
588  else
589  aStart.setX( aEnd.AdjustX(nBaseHeight ) );
590  }
591  }
592  aRubyRect.Move(nXMove, nYMove);
593  aCharRect.Move(nXMove, nYMove);
594  }
595 
596 }
597 
599 {
600  pGridItem.reset();
601  //get the grid information
602  if (SfxItemState::DEFAULT <= rSet.GetItemState(RES_TEXTGRID))
603  pGridItem.reset(rSet.Get(RES_TEXTGRID).Clone());
605 }
606 
607 /* 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
constexpr TypedWhichId< SvxFrameDirectionItem > RES_FRAMEDIR(120)
void SetFtRight(long nNew)
long GetWidth() const
void SetHdRight(long nNew)
void SetColumns(const SwFormatCol &rCol)
Definition: colex.cxx:429
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)
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)
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:38
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
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
long Top() const
virtual OutputDevice & get_ref_device()=0
void DrawLine(const Point &rStartPt, const Point &rEndPt)
bool HasLine() const
Definition: colmgr.hxx:114
void DrawRect(const tools::Rectangle &rRect)
void Invert()
const drawinglayer::attribute::SdrAllFillAttributesHelperPtr & getPageFillAttributes() const
virtual void SetDrawingArea(weld::DrawingArea *pDrawingArea) override
Definition: colex.cxx:473
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:498
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
int i
const SwColumns & GetColumns() const
Definition: fmtclds.hxx:112
void SetTop(long nNew)
virtual void DrawPage(vcl::RenderContext &rRenderContext, const Point &rPoint, const bool bSecond, const bool bEnabled) override
Definition: colex.cxx:189
sal_uInt8 GetLineHeight() const
Definition: fmtclds.hxx:123
SwFormatCol m_aCols
Definition: colex.hxx:91
void SetHeader(bool bNew)
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:598
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
virtual void Resize() override
Definition: colex.cxx:481
SvxPageUsage GetUsage() const
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
constexpr TypedWhichId< SwTextGridItem > RES_TEXTGRID(115)
long GetHdDist() const
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
static Color & GetFontColor()
Definition: viewopt.cxx:425
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:331
virtual void SetDrawingArea(weld::DrawingArea *pDrawingArea)
constexpr TypedWhichId< SvxLRSpaceItem > RES_LR_SPACE(91)
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)
sal_Int32 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)
constexpr TypedWhichId< SvxULSpaceItem > RES_UL_SPACE(92)
void SetLeft(long nNew)
Point TopRight() const
const Size & GetSize() const
const Color & GetFillColor() const
void SetFtDist(long nNew)
sal_uInt16 GetUpper() const
SwColLineAdj GetLineAdj() const
Definition: fmtclds.hxx:120