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>
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 {
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
188void 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();
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
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::GetCurrentViewOptions().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;
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));
488 m_aWinSize = rRefDevice.PixelToLogic(m_aWinSize);
489 rRefDevice.Pop();
490 Invalidate();
491}
492
494{
495}
496
497void 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(),
536 Size(nRubyHeight, aRect.GetHeight()) :
537 Size(aRect.GetWidth(), nRubyHeight));
538 tools::Rectangle aCharRect(aRect.TopLeft(),
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))
604}
605
606/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
const StyleSettings & GetStyleSettings() const
void Invert()
void SetScaleY(const Fraction &rScaleY)
void SetScaleX(const Fraction &rScaleX)
SAL_WARN_UNUSED_RESULT Point PixelToLogic(const Point &rDevicePt) const
void DrawRect(const tools::Rectangle &rRect)
void DrawLine(const Point &rStartPt, const Point &rEndPt)
void SetLineColor()
void SetMapMode()
void SetFillColor()
SAL_WARN_UNUSED_RESULT Point LogicToPixel(const Point &rLogicPt) const
void Push(vcl::PushFlags nFlags=vcl::PushFlags::ALL)
const AllSettings & GetSettings() const
const Color & GetFillColor() const
bool GetValue() const
sal_uInt16 GetWhich(sal_uInt16 nSlot, bool bDeep=true) const
SfxItemPool * GetPool() const
const T * GetItemIfSet(TypedWhichId< T > nWhich, bool bSrchInParent=true) const
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const=0
constexpr tools::Long Height() const
tools::Long AdjustHeight(tools::Long n)
tools::Long AdjustWidth(tools::Long n)
constexpr tools::Long Width() const
const Color & GetFieldColor() const
const Color & GetDialogColor() const
tools::Long GetRight() const
tools::Long GetLeft() const
SvxPageUsage GetPageUsage() const
void setHeaderFillAttributes(const drawinglayer::attribute::SdrAllFillAttributesHelperPtr &rFillAttributes)
void SetUsage(SvxPageUsage eU)
void SetBottom(tools::Long nNew)
tools::Long GetFtDist() const
void SetHdLeft(tools::Long nNew)
const Size & GetSize() const
tools::Long GetBottom() const
void SetHdHeight(tools::Long nNew)
tools::Long GetTop() const
SvxPageUsage GetUsage() const
void setPageFillAttributes(const drawinglayer::attribute::SdrAllFillAttributesHelperPtr &rFillAttributes)
void SetFtDist(tools::Long nNew)
void SetSize(const Size &rSize)
void SetLeft(tools::Long nNew)
void SetHdDist(tools::Long nNew)
void SetFtLeft(tools::Long nNew)
void SetFtRight(tools::Long nNew)
static void drawFillAttributes(vcl::RenderContext &rRenderContext, const drawinglayer::attribute::SdrAllFillAttributesHelperPtr &rFillAttributes, const tools::Rectangle &rPaintRange, const tools::Rectangle &rDefineRange)
void SetHdRight(tools::Long nNew)
void setFooterFillAttributes(const drawinglayer::attribute::SdrAllFillAttributesHelperPtr &rFillAttributes)
tools::Long GetRight() const
void SetFooter(bool bNew)
tools::Long GetLeft() const
const drawinglayer::attribute::SdrAllFillAttributesHelperPtr & getPageFillAttributes() const
tools::Long GetHdHeight() const
void SetFtHeight(tools::Long nNew)
tools::Long GetHdDist() const
void SetHeader(bool bNew)
tools::Long GetFtHeight() const
void SetTop(tools::Long nNew)
virtual void DrawPage(vcl::RenderContext &rRenderContext, const Point &rPoint, const bool bSecond, const bool bEnabled)
void SetRight(tools::Long nNew)
const Size & GetSize() const
sal_uInt16 GetUpper() const
sal_uInt16 GetLower() const
virtual void DrawPage(vcl::RenderContext &rRenderContext, const Point &rPoint, const bool bSecond, const bool bEnabled) override
Definition: colex.cxx:188
SwColMgr * m_pColMgr
Definition: colex.hxx:62
short GetLineHeightPercent() const
Definition: colmgr.cxx:106
sal_uInt16 GetCount() const
Definition: colmgr.hxx:73
sal_uInt16 GetColWidth(sal_uInt16 nIdx) const
Definition: colmgr.cxx:117
bool IsAutoWidth() const
Definition: colmgr.hxx:101
bool HasLine() const
Definition: colmgr.hxx:114
SwColLineAdj GetAdjust() const
Definition: colmgr.hxx:92
sal_uInt16 GetGutterWidth(sal_uInt16 nPos=USHRT_MAX) const
Definition: colmgr.cxx:77
virtual void Resize() override
Definition: colex.cxx:480
void SetColumns(const SwFormatCol &rCol)
Definition: colex.cxx:428
virtual void SetDrawingArea(weld::DrawingArea *pDrawingArea) override
Definition: colex.cxx:472
virtual void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect) override
Definition: colex.cxx:330
SwFormatCol m_aCols
Definition: colex.hxx:90
ColumnDescriptor.
Definition: fmtclds.hxx:34
sal_uInt16 GetLeft() const
Definition: fmtclds.hxx:51
void SetRight(sal_uInt16 nNew)
Definition: fmtclds.hxx:48
sal_uInt16 GetRight() const
Definition: fmtclds.hxx:52
void SetLeft(sal_uInt16 nNew)
Definition: fmtclds.hxx:47
sal_uInt16 GetWishWidth() const
Definition: fmtclds.hxx:50
void SetWishWidth(sal_uInt16 nNew)
Definition: fmtclds.hxx:46
sal_uInt16 GetWishWidth() const
Definition: fmtclds.hxx:122
bool IsOrtho() const
Definition: fmtclds.hxx:121
const SwColumns & GetColumns() const
Definition: fmtclds.hxx:112
sal_uInt8 GetLineHeight() const
Definition: fmtclds.hxx:123
SwColLineAdj GetLineAdj() const
Definition: fmtclds.hxx:120
bool m_bVertical
Definition: colex.hxx:34
void UpdateExample(const SfxItemSet &rSet)
Definition: colex.cxx:38
void UpdateExample(const SfxItemSet &rSet)
Definition: colex.cxx:597
virtual void DrawPage(vcl::RenderContext &rRenderContext, const Point &rPoint, const bool bSecond, const bool bEnabled) override
Definition: colex.cxx:497
std::unique_ptr< SwTextGridItem > m_pGridItem
Definition: colex.hxx:47
const Color & GetFontColor() const
Definition: viewopt.cxx:522
static const SwViewOption & GetCurrentViewOptions()
Definition: viewopt.cxx:608
constexpr tools::Long GetWidth() const
constexpr void SetLeft(tools::Long v)
constexpr void SetTop(tools::Long v)
constexpr tools::Long Top() const
constexpr Point TopLeft() const
constexpr void SetRight(tools::Long v)
void Move(tools::Long nHorzMoveDelta, tools::Long nVertMoveDelta)
constexpr tools::Long Right() const
constexpr void SetBottom(tools::Long v)
constexpr Point TopRight() const
constexpr tools::Long GetHeight() const
constexpr tools::Long Left() const
constexpr tools::Long Bottom() const
constexpr Point BottomLeft() const
virtual void SetDrawingArea(weld::DrawingArea *pDrawingArea)
weld::DrawingArea * GetDrawingArea() const
Size const & GetOutputSizePixel() const
virtual OutputDevice & get_ref_device()=0
virtual void set_size_request(int nWidth, int nHeight)=0
void FitToActualSize(SwFormatCol &rCol, sal_uInt16 nWidth)
Definition: colmgr.cxx:35
constexpr ::Color COL_GRAY(0x80, 0x80, 0x80)
constexpr ::Color COL_AUTO(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
constexpr ::Color COL_LIGHTGRAY(0xC0, 0xC0, 0xC0)
constexpr ::Color COL_TRANSPARENT(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
std::vector< SwColumn > SwColumns
Definition: fmtclds.hxx:57
@ COLADJ_BOTTOM
Definition: fmtclds.hxx:64
@ COLADJ_CENTER
Definition: fmtclds.hxx:63
@ COLADJ_NONE
Definition: fmtclds.hxx:61
@ COLADJ_TOP
Definition: fmtclds.hxx:62
constexpr TypedWhichId< SvxFrameDirectionItem > RES_FRAMEDIR(126)
constexpr TypedWhichId< SvxBrushItem > RES_BACKGROUND(111)
constexpr TypedWhichId< SwTextGridItem > RES_TEXTGRID(121)
constexpr TypedWhichId< SvxLRSpaceItem > RES_LR_SPACE(97)
constexpr TypedWhichId< SvxULSpaceItem > RES_UL_SPACE(98)
const SfxItemSet * GetItemSet(const SfxPoolItem &rAttr)
Returns the item set associated with a character/inet/auto style.
Definition: atrstck.cxx:133
std::shared_ptr< SdrAllFillAttributesHelper > SdrAllFillAttributesHelperPtr
Definition: format.hxx:41
int i
long Long
PAPER_A4
static SfxItemSet & rSet
@ GRID_LINES_CHARS
Definition: tgrditem.hxx:30
SVXCORE_DLLPUBLIC void setSvxBrushItemAsFillAttributesToTargetSet(const SvxBrushItem &rBrush, SfxItemSet &rToSet)
sal_Int32 nLength