LibreOffice Module sc (master)  1
autofmt.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 <scitems.hxx>
21 #include <editeng/boxitem.hxx>
22 #include <editeng/brushitem.hxx>
23 #include <editeng/contouritem.hxx>
24 #include <editeng/colritem.hxx>
26 #include <editeng/fontitem.hxx>
27 #include <editeng/justifyitem.hxx>
28 #include <editeng/lineitem.hxx>
29 #include <editeng/postitem.hxx>
30 #include <editeng/shdditem.hxx>
31 #include <editeng/udlnitem.hxx>
32 #include <editeng/wghtitem.hxx>
33 #include <o3tl/unit_conversion.hxx>
34 #include <svl/zforlist.hxx>
35 #include <svtools/scriptedtext.hxx>
36 #include <svx/framelink.hxx>
37 #include <vcl/settings.hxx>
38 #include <vcl/svapp.hxx>
39 #include <vcl/virdev.hxx>
43 
44 #include <strings.hrc>
45 #include <zforauto.hxx>
46 #include <global.hxx>
47 #include <autoform.hxx>
48 #include <autofmt.hxx>
49 #include <scresid.hxx>
50 #include <document.hxx>
51 #include <viewdata.hxx>
52 
53 #define FRAME_OFFSET 4
54 
55 // ScAutoFmtPreview
56 
58  : pCurData(nullptr)
59  , bFitWidth(false)
60  , mbRTL(false)
61  , aStrJan(ScResId(STR_JAN))
62  , aStrFeb(ScResId(STR_FEB))
63  , aStrMar(ScResId(STR_MAR))
64  , aStrNorth(ScResId(STR_NORTH))
65  , aStrMid(ScResId(STR_MID))
66  , aStrSouth(ScResId(STR_SOUTH))
67  , aStrSum(ScResId(STR_SUM))
69 {
70  Init();
71 }
72 
74 {
76  CustomWidgetController::SetDrawingArea(pDrawingArea);
77 }
78 
80 {
81  Size aSize(GetOutputSizePixel());
82  aPrvSize = Size(aSize.Width() - 6, aSize.Height() - 30);
83  mnLabelColWidth = (aPrvSize.Width() - 4) / 4 - 12;
84  mnDataColWidth1 = (aPrvSize.Width() - 4 - 2 * mnLabelColWidth) / 3;
85  mnDataColWidth2 = (aPrvSize.Width() - 4 - 2 * mnLabelColWidth) / 4;
86  mnRowHeight = (aPrvSize.Height() - 4) / 5;
88 }
89 
91 {
92 }
93 
95  vcl::Font& rFont,
96  const SvxFontItem& rFontItem,
97  const SvxWeightItem& rWeightItem,
98  const SvxPostureItem& rPostureItem )
99 {
100  rFont.SetFamily ( rFontItem.GetFamily() );
101  rFont.SetFamilyName ( rFontItem.GetFamilyName() );
102  rFont.SetStyleName ( rFontItem.GetStyleName() );
103  rFont.SetCharSet ( rFontItem.GetCharSet() );
104  rFont.SetPitch ( rFontItem.GetPitch() );
105  rFont.SetWeight ( rWeightItem.GetValue() );
106  rFont.SetItalic ( rPostureItem.GetValue() );
107 }
108 
109 void ScAutoFmtPreview::MakeFonts(vcl::RenderContext const& rRenderContext, sal_uInt16 nIndex, vcl::Font& rFont, vcl::Font& rCJKFont, vcl::Font& rCTLFont)
110 {
111  if ( !pCurData )
112  return;
113 
114  rFont = rCJKFont = rCTLFont = rRenderContext.GetFont();
115  Size aFontSize(rFont.GetFontSize().Width(), 10 * rRenderContext.GetDPIScaleFactor());
116 
117  const SvxFontItem* pFontItem = pCurData->GetItem( nIndex, ATTR_FONT );
118  const SvxWeightItem* pWeightItem = pCurData->GetItem( nIndex, ATTR_FONT_WEIGHT );
119  const SvxPostureItem* pPostureItem = pCurData->GetItem( nIndex, ATTR_FONT_POSTURE );
120  const SvxFontItem* pCJKFontItem = pCurData->GetItem( nIndex, ATTR_CJK_FONT );
121  const SvxWeightItem* pCJKWeightItem = pCurData->GetItem( nIndex, ATTR_CJK_FONT_WEIGHT );
122  const SvxPostureItem* pCJKPostureItem = pCurData->GetItem( nIndex, ATTR_CJK_FONT_POSTURE );
123  const SvxFontItem* pCTLFontItem = pCurData->GetItem( nIndex, ATTR_CTL_FONT );
124  const SvxWeightItem* pCTLWeightItem = pCurData->GetItem( nIndex, ATTR_CTL_FONT_WEIGHT );
125  const SvxPostureItem* pCTLPostureItem = pCurData->GetItem( nIndex, ATTR_CTL_FONT_POSTURE );
126  const SvxUnderlineItem* pUnderlineItem = pCurData->GetItem( nIndex, ATTR_FONT_UNDERLINE );
127  const SvxOverlineItem* pOverlineItem = pCurData->GetItem( nIndex, ATTR_FONT_OVERLINE );
128  const SvxCrossedOutItem* pCrossedOutItem = pCurData->GetItem( nIndex, ATTR_FONT_CROSSEDOUT );
129  const SvxContourItem* pContourItem = pCurData->GetItem( nIndex, ATTR_FONT_CONTOUR );
130  const SvxShadowedItem* pShadowedItem = pCurData->GetItem( nIndex, ATTR_FONT_SHADOWED );
131  const SvxColorItem* pColorItem = pCurData->GetItem( nIndex, ATTR_FONT_COLOR );
132 
133  lcl_SetFontProperties( rFont, *pFontItem, *pWeightItem, *pPostureItem );
134  lcl_SetFontProperties( rCJKFont, *pCJKFontItem, *pCJKWeightItem, *pCJKPostureItem );
135  lcl_SetFontProperties( rCTLFont, *pCTLFontItem, *pCTLWeightItem, *pCTLPostureItem );
136 
137  Color aColor( pColorItem->GetValue() );
138  if( aColor == COL_TRANSPARENT )
140 
141 #define SETONALLFONTS( MethodName, Value ) \
142 rFont.MethodName( Value ); rCJKFont.MethodName( Value ); rCTLFont.MethodName( Value );
143 
144  SETONALLFONTS( SetUnderline, pUnderlineItem->GetValue() )
145  SETONALLFONTS( SetOverline, pOverlineItem->GetValue() )
146  SETONALLFONTS( SetStrikeout, pCrossedOutItem->GetValue() )
147  SETONALLFONTS( SetOutline, pContourItem->GetValue() )
148  SETONALLFONTS( SetShadow, pShadowedItem->GetValue() )
149  SETONALLFONTS( SetColor, aColor )
150  SETONALLFONTS( SetFontSize, aFontSize )
151  SETONALLFONTS( SetTransparent, true )
152 
153 #undef SETONALLFONTS
154 }
155 
156 sal_uInt16 ScAutoFmtPreview::GetFormatIndex( size_t nCol, size_t nRow ) const
157 {
158  static const sal_uInt16 pnFmtMap[] =
159  {
160  0, 1, 2, 1, 3,
161  4, 5, 6, 5, 7,
162  8, 9, 10, 9, 11,
163  4, 5, 6, 5, 7,
164  12, 13, 14, 13, 15
165  };
166  return pnFmtMap[ maArray.GetCellIndex( nCol, nRow, mbRTL ) ];
167 }
168 
169 const SvxBoxItem& ScAutoFmtPreview::GetBoxItem( size_t nCol, size_t nRow ) const
170 {
171  OSL_ENSURE( pCurData, "ScAutoFmtPreview::GetBoxItem - no format data found" );
172  return * pCurData->GetItem( GetFormatIndex( nCol, nRow ), ATTR_BORDER );
173 }
174 
175 const SvxLineItem& ScAutoFmtPreview::GetDiagItem( size_t nCol, size_t nRow, bool bTLBR ) const
176 {
177  OSL_ENSURE( pCurData, "ScAutoFmtPreview::GetDiagItem - no format data found" );
178  return * pCurData->GetItem( GetFormatIndex( nCol, nRow ), bTLBR ? ATTR_BORDER_TLBR : ATTR_BORDER_BLTR );
179 }
180 
181 void ScAutoFmtPreview::DrawString(vcl::RenderContext& rRenderContext, size_t nCol, size_t nRow)
182 {
183  if (!pCurData)
184  {
185  return;
186  }
187 
188  // Emit the cell text
189 
190  OUString cellString;
191  bool bNumFormat = pCurData->GetIncludeValueFormat();
192  sal_uInt32 nNum;
193  double nVal;
194  const Color* pDummy = nullptr;
195  sal_uInt16 nIndex = static_cast<sal_uInt16>(maArray.GetCellIndex(nCol, nRow, mbRTL));
196 
197  switch (nIndex)
198  {
199  case 1: cellString = aStrJan; break;
200  case 2: cellString = aStrFeb; break;
201  case 3: cellString = aStrMar; break;
202  case 5: cellString = aStrNorth; break;
203  case 10: cellString = aStrMid; break;
204  case 15: cellString = aStrSouth; break;
205  case 4:
206  case 20: cellString = aStrSum; break;
207 
208  case 6:
209  case 8:
210  case 16:
211  case 18: nVal = nIndex;
212  nNum = 5;
213  goto mknum;
214  case 17:
215  case 7: nVal = nIndex;
216  nNum = 6;
217  goto mknum;
218  case 11:
219  case 12:
220  case 13: nVal = nIndex;
221  nNum = 12 == nIndex ? 10 : 9;
222  goto mknum;
223 
224  case 9: nVal = 21; nNum = 7; goto mknum;
225  case 14: nVal = 36; nNum = 11; goto mknum;
226  case 19: nVal = 51; nNum = 7; goto mknum;
227  case 21: nVal = 33; nNum = 13; goto mknum;
228  case 22: nVal = 36; nNum = 14; goto mknum;
229  case 23: nVal = 39; nNum = 13; goto mknum;
230  case 24: nVal = 108; nNum = 15;
231  mknum:
232  if (bNumFormat)
233  {
234  ScNumFormatAbbrev& rNumFormat = const_cast<ScNumFormatAbbrev&>(pCurData->GetNumFormat(sal_uInt16(nNum)));
235  nNum = rNumFormat.GetFormatIndex(*pNumFmt);
236  }
237  else
238  nNum = 0;
239  pNumFmt->GetOutputString(nVal, nNum, cellString, &pDummy);
240  break;
241  }
242 
243  if (cellString.isEmpty())
244  return;
245 
246  Size aStrSize;
247  sal_uInt16 nFmtIndex = GetFormatIndex( nCol, nRow );
248  const basegfx::B2DRange cellRange(maArray.GetCellRange( nCol, nRow, true ));
249  Point aPos(basegfx::fround(cellRange.getMinX()), basegfx::fround(cellRange.getMinY()));
250  sal_uInt16 nRightX = 0;
251  bool bJustify = pCurData->GetIncludeJustify();
252  SvxCellHorJustify eJustification;
253 
254  SvtScriptedTextHelper aScriptedText(rRenderContext);
255 
256  // Justification:
257 
258  eJustification = mbRTL ? SvxCellHorJustify::Right : bJustify ?
259  pCurData->GetItem(nFmtIndex, ATTR_HOR_JUSTIFY)->GetValue() :
260  SvxCellHorJustify::Standard;
261 
262  if (pCurData->GetIncludeFont())
263  {
264  vcl::Font aFont, aCJKFont, aCTLFont;
265  Size theMaxStrSize;
266 
267  MakeFonts(rRenderContext, nFmtIndex, aFont, aCJKFont, aCTLFont);
268 
269  theMaxStrSize = Size(basegfx::fround(cellRange.getWidth()), basegfx::fround(cellRange.getHeight()));
270  theMaxStrSize.AdjustWidth( -(FRAME_OFFSET) );
271  theMaxStrSize.AdjustHeight( -(FRAME_OFFSET) );
272 
273  aScriptedText.SetFonts( &aFont, &aCJKFont, &aCTLFont );
274  aScriptedText.SetText(cellString, xBreakIter);
275  aStrSize = aScriptedText.GetTextSize();
276 
277  if (theMaxStrSize.Height() < aStrSize.Height())
278  {
279  // if the string does not fit in the row using this font,
280  // the default font is used
281  aScriptedText.SetDefaultFont();
282  aStrSize = aScriptedText.GetTextSize();
283  }
284  while((theMaxStrSize.Width() <= aStrSize.Width()) && (cellString.getLength() > 1))
285  {
286  if( eJustification == SvxCellHorJustify::Right )
287  cellString = cellString.copy(1);
288  else
289  cellString = cellString.copy(0, cellString.getLength() - 1 );
290 
291  aScriptedText.SetText( cellString, xBreakIter );
292  aStrSize = aScriptedText.GetTextSize();
293  }
294  }
295  else
296  {
297  aScriptedText.SetDefaultFont();
298  aScriptedText.SetText( cellString, xBreakIter );
299  aStrSize = aScriptedText.GetTextSize();
300  }
301 
302  nRightX = sal_uInt16(basegfx::fround(cellRange.getWidth()) - aStrSize.Width() - FRAME_OFFSET);
303 
304  // vertical (always center):
305 
306  aPos.AdjustY((mnRowHeight - static_cast<sal_uInt16>(aStrSize.Height())) / 2 );
307 
308  // horizontal
309 
310  if (eJustification != SvxCellHorJustify::Standard)
311  {
312  sal_uInt16 nHorPos = sal_uInt16((basegfx::fround(cellRange.getWidth())-aStrSize.Width()) / 2);
313  //sal_uInt16 nHorPos = sal_uInt16((basegfx::fround(cellRange.getWidth())-aStrSize.Width()) / 2);
314 
315  switch (eJustification)
316  {
317  case SvxCellHorJustify::Left:
318  aPos.AdjustX(FRAME_OFFSET );
319  break;
320  case SvxCellHorJustify::Right:
321  aPos.AdjustX(nRightX );
322  break;
323  case SvxCellHorJustify::Block:
324  case SvxCellHorJustify::Repeat:
325  case SvxCellHorJustify::Center:
326  aPos.AdjustX(nHorPos );
327  break;
328  // coverity[dead_error_line] - following conditions exist to avoid compiler warning
329  case SvxCellHorJustify::Standard:
330  default:
331  // Standard is not handled here
332  break;
333  }
334  }
335  else
336  {
337 
338  // Standard justification
339 
340  if (nCol == 0 || nRow == 0)
341  {
342  // Text label to the left or sum left adjusted
343  aPos.AdjustX(FRAME_OFFSET );
344  }
345  else
346  {
347  // Numbers/Dates right adjusted
348  aPos.AdjustX(nRightX );
349  }
350  }
351  aScriptedText.DrawText(aPos);
352 }
353 
354 #undef FRAME_OFFSET
355 
357 {
358  if (!pCurData)
359  return;
360 
361  for(size_t nRow = 0; nRow < 5; ++nRow)
362  {
363  for(size_t nCol = 0; nCol < 5; ++nCol)
364  {
365  const SvxBrushItem* pItem =
366  pCurData->GetItem( GetFormatIndex( nCol, nRow ), ATTR_BACKGROUND );
367 
368  rRenderContext.Push( PushFlags::LINECOLOR | PushFlags::FILLCOLOR );
369  rRenderContext.SetLineColor();
370  rRenderContext.SetFillColor( pItem->GetColor() );
371 
372  const basegfx::B2DRange aCellRange(maArray.GetCellRange( nCol, nRow, true ));
373  rRenderContext.DrawRect(
375  basegfx::fround(aCellRange.getMinX()), basegfx::fround(aCellRange.getMinY()),
376  basegfx::fround(aCellRange.getMaxX()), basegfx::fround(aCellRange.getMaxY())));
377 
378  rRenderContext.Pop();
379  }
380  }
381 }
382 
384 {
385  if (!pCurData)
386  return;
387 
388  // 1) background
390  DrawBackground(rRenderContext);
391 
392  // 2) values
393  for(size_t nRow = 0; nRow < 5; ++nRow)
394  for(size_t nCol = 0; nCol < 5; ++nCol)
395  DrawString(rRenderContext, nCol, nRow);
396 
397  // 3) border
398  if (!pCurData->GetIncludeFrame())
399  return;
400 
401  const drawinglayer::geometry::ViewInformation2D aNewViewInformation2D;
402  std::unique_ptr<drawinglayer::processor2d::BaseProcessor2D> pProcessor2D(
404  rRenderContext,
405  aNewViewInformation2D));
406 
407  if (pProcessor2D)
408  {
409  pProcessor2D->process(maArray.CreateB2DPrimitiveArray());
410  pProcessor2D.reset();
411  }
412 }
413 
415 {
416  maArray.Initialize( 5, 5 );
417  mnLabelColWidth = 0;
418  mnDataColWidth1 = 0;
419  mnDataColWidth2 = 0;
420  mnRowHeight = 0;
421  CalcCellArray( false );
422  CalcLineMap();
423 }
424 
426 {
427  SCTAB nCurrentTab = rViewData.GetTabNo();
428  ScDocument& rDoc = rViewData.GetDocument();
429  mbRTL = rDoc.IsLayoutRTL(nCurrentTab);
430  xBreakIter = rDoc.GetBreakIterator();
431 }
432 
433 void ScAutoFmtPreview::CalcCellArray( bool bFitWidthP )
434 {
435  maArray.SetXOffset( 2 );
439 
440  maArray.SetYOffset( 2 );
442 
445 }
446 
447 static void lclSetStyleFromBorder( svx::frame::Style& rStyle, const ::editeng::SvxBorderLine* pBorder )
448 {
449  rStyle.Set(pBorder, o3tl::convert(1.0, o3tl::Length::twip, o3tl::Length::pt), 5);
450 }
451 
453 {
454  if ( !pCurData )
455  return;
456 
457  for( size_t nRow = 0; nRow < 5; ++nRow )
458  {
459  for( size_t nCol = 0; nCol < 5; ++nCol )
460  {
461  svx::frame::Style aStyle;
462 
463  const SvxBoxItem& rItem = GetBoxItem( nCol, nRow );
464  lclSetStyleFromBorder( aStyle, rItem.GetLeft() );
465  maArray.SetCellStyleLeft( nCol, nRow, aStyle );
466  lclSetStyleFromBorder( aStyle, rItem.GetRight() );
467  maArray.SetCellStyleRight( nCol, nRow, aStyle );
468  lclSetStyleFromBorder( aStyle, rItem.GetTop() );
469  maArray.SetCellStyleTop( nCol, nRow, aStyle );
470  lclSetStyleFromBorder( aStyle, rItem.GetBottom() );
471  maArray.SetCellStyleBottom( nCol, nRow, aStyle );
472 
473  lclSetStyleFromBorder( aStyle, GetDiagItem( nCol, nRow, true ).GetLine() );
474  maArray.SetCellStyleTLBR( nCol, nRow, aStyle );
475  lclSetStyleFromBorder( aStyle, GetDiagItem( nCol, nRow, false ).GetLine() );
476  maArray.SetCellStyleBLTR( nCol, nRow, aStyle );
477  }
478  }
479 }
480 
482 {
483  if (pNewData)
484  {
485  pCurData = pNewData;
486  bFitWidth = pNewData->GetIncludeWidthHeight();
487  }
488 
490  CalcLineMap();
491 
492  Invalidate();
493 }
494 
496 {
497  rRenderContext.Push(PushFlags::ALL);
498  DrawModeFlags nOldDrawMode = aVD->GetDrawMode();
499 
500  Size aWndSize(GetOutputSizePixel());
501  vcl::Font aFont(aVD->GetFont());
502  Color aBackCol(rRenderContext.GetSettings().GetStyleSettings().GetWindowColor());
503  tools::Rectangle aRect(Point(), aWndSize);
504 
505  aFont.SetTransparent( true );
506  aVD->SetFont(aFont);
507  aVD->SetLineColor();
508  aVD->SetFillColor(aBackCol);
509  aVD->SetOutputSize(aWndSize);
510  aVD->DrawRect(aRect);
511 
512  PaintCells(*aVD);
513 
514  rRenderContext.SetLineColor();
515  rRenderContext.SetFillColor(aBackCol);
516  rRenderContext.DrawRect(aRect);
517 
518  Point aPos((aWndSize.Width() - aPrvSize.Width()) / 2, (aWndSize.Height() - aPrvSize.Height()) / 2);
520  aPos.setX( -aPos.X() );
521  rRenderContext.DrawOutDev(aPos, aWndSize, Point(), aWndSize, *aVD);
522  aVD->SetDrawMode(nOldDrawMode);
523  rRenderContext.Pop();
524 }
525 
526 void ScAutoFmtPreview::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& /*rRect*/)
527 {
528  DoPaint(rRenderContext);
529 }
530 
531 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void SetFamily(FontFamily)
void DetectRTL(const ScViewData &rViewData)
Definition: autofmt.cxx:425
SAL_DLLPRIVATE const SvxBoxItem & GetBoxItem(size_t nCol, size_t nRow) const
Definition: autofmt.cxx:169
SC_DLLPUBLIC const css::uno::Reference< css::i18n::XBreakIterator > & GetBreakIterator()
Definition: documen6.cxx:40
constexpr TypedWhichId< SvxWeightItem > ATTR_CTL_FONT_WEIGHT(118)
SvxCellHorJustify
void SetAllColWidths(tools::Long nWidth)
sal_Int32 nIndex
css::uno::Reference< css::i18n::XBreakIterator > xBreakIter
Definition: autofmt.hxx:53
void SetCellStyleTLBR(size_t nCol, size_t nRow, const Style &rStyle)
constexpr TypedWhichId< SvxBoxItem > ATTR_BORDER(150)
void setWidth(tools::Long nWidth)
DrawModeFlags
constexpr TypedWhichId< SvxCrossedOutItem > ATTR_FONT_CROSSEDOUT(106)
constexpr::Color COL_TRANSPARENT(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
const StyleSettings & GetStyleSettings() const
static const AllSettings & GetSettings()
const OUString aStrJan
Definition: autofmt.hxx:62
basegfx::B2DRange GetCellRange(size_t nCol, size_t nRow, bool bExpandMerged) const
void SetWeight(FontWeight)
SCTAB GetTabNo() const
Definition: viewdata.hxx:395
void SetAllRowHeights(tools::Long nHeight)
ScDocument & GetDocument() const
Definition: viewdata.hxx:380
void SetCharSet(rtl_TextEncoding)
constexpr TypedWhichId< SvxFontItem > ATTR_FONT(100)
const editeng::SvxBorderLine * GetRight() const
size_t GetCellIndex(size_t nCol, size_t nRow, bool bRTL) const
const OUString aStrFeb
Definition: autofmt.hxx:63
void SetCellStyleTop(size_t nCol, size_t nRow, const Style &rStyle)
FontPitch GetPitch() const
void SetCellStyleBottom(size_t nCol, size_t nRow, const Style &rStyle)
const OUString aStrNorth
Definition: autofmt.hxx:65
FontFamily GetFamily() const
Size const & GetOutputSizePixel() const
void SetYOffset(tools::Long nYOffset)
const OUString aStrMar
Definition: autofmt.hxx:64
const Size & GetTextSize() const
void disposeAndReset(reference_type *pBody)
tools::Long mnDataColWidth1
Definition: autofmt.hxx:59
const vcl::Font & GetFont() const
rtl_TextEncoding GetCharSet() const
ScopedVclPtrInstance< VirtualDevice > aVD
Definition: autofmt.hxx:52
bool GetIncludeWidthHeight() const
Definition: autoform.hxx:148
virtual void Resize() override
Definition: autofmt.cxx:79
virtual OutputDevice & get_ref_device()=0
B2IRange fround(const B2DRange &rRange)
void DrawRect(const tools::Rectangle &rRect)
constexpr auto convert(N n, sal_Int64 mul, sal_Int64 div)
void SetPitch(FontPitch ePitch)
constexpr TypedWhichId< SvxUnderlineItem > ATTR_FONT_UNDERLINE(104)
const OUString & GetStyleName() const
void SetCellStyleLeft(size_t nCol, size_t nRow, const Style &rStyle)
constexpr TypedWhichId< SvxLineItem > ATTR_BORDER_TLBR(141)
std::unique_ptr< BaseProcessor2D > createPixelProcessor2DFromOutputDevice(OutputDevice &rTargetOutDev, const drawinglayer::geometry::ViewInformation2D &rViewInformation2D)
const Color & GetColor() const
ScAutoFormatData * pCurData
Definition: autofmt.hxx:51
void NotifyChange(ScAutoFormatData *pNewData)
Definition: autofmt.cxx:481
const OUString aStrSouth
Definition: autofmt.hxx:67
const editeng::SvxBorderLine * GetTop() const
void SetLineColor()
constexpr TypedWhichId< SvxPostureItem > ATTR_FONT_POSTURE(103)
const ScNumFormatAbbrev & GetNumFormat(sal_uInt16 nIndex) const
Definition: autoform.cxx:380
constexpr TypedWhichId< SvxShadowedItem > ATTR_FONT_SHADOWED(108)
drawinglayer::primitive2d::Primitive2DContainer CreateB2DPrimitiveArray() const
SAL_DLLPRIVATE void CalcCellArray(bool bFitWidth)
Definition: autofmt.cxx:433
void SetFamilyName(const OUString &rFamilyName)
svx::frame::Array maArray
Definition: autofmt.hxx:55
const editeng::SvxBorderLine * GetLeft() const
SAL_DLLPRIVATE void DoPaint(vcl::RenderContext &rRenderContext)
Definition: autofmt.cxx:495
SAL_DLLPRIVATE void CalcLineMap()
Definition: autofmt.cxx:452
SAL_DLLPRIVATE const SvxLineItem & GetDiagItem(size_t nCol, size_t nRow, bool bTLBR) const
Definition: autofmt.cxx:175
void SetFonts(vcl::Font const *_pLatinFont, vcl::Font const *_pAsianFont, vcl::Font const *_pCmplxFont)
bool GetIncludeBackground() const
Definition: autoform.hxx:147
#define SETONALLFONTS(MethodName, Value)
void SetXOffset(tools::Long nXOffset)
bool mbRTL
Implementation to draw the frame borders.
Definition: autofmt.hxx:56
void SetFillColor()
tools::Long Width() const
OUString ScResId(const char *pId)
Definition: scdll.cxx:89
static bool GetLayoutRTL()
const Size & GetFontSize() const
void Initialize(size_t nWidth, size_t nHeight)
static void lcl_SetFontProperties(vcl::Font &rFont, const SvxFontItem &rFontItem, const SvxWeightItem &rWeightItem, const SvxPostureItem &rPostureItem)
Definition: autofmt.cxx:94
const AllSettings & GetSettings() const
void SetText(const OUString &_rText, const css::uno::Reference< css::i18n::XBreakIterator > &_xBreakIter)
SAL_DLLPRIVATE void PaintCells(vcl::RenderContext &rRenderContext)
Definition: autofmt.cxx:383
constexpr TypedWhichId< SvxFontItem > ATTR_CTL_FONT(116)
const OUString aStrSum
Definition: autofmt.hxx:68
void SetCellStyleBLTR(size_t nCol, size_t nRow, const Style &rStyle)
const OUString aStrMid
Definition: autofmt.hxx:66
static void lclSetStyleFromBorder(svx::frame::Style &rStyle, const ::editeng::SvxBorderLine *pBorder)
Definition: autofmt.cxx:447
tools::Long mnDataColWidth2
Definition: autofmt.hxx:60
float GetDPIScaleFactor() const
bool GetIncludeFrame() const
Definition: autoform.hxx:146
virtual ~ScAutoFmtPreview() override
Definition: autofmt.cxx:90
constexpr TypedWhichId< SvxFontItem > ATTR_CJK_FONT(111)
tools::Long mnLabelColWidth
Definition: autofmt.hxx:58
virtual void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect) override
Definition: autofmt.cxx:526
constexpr TypedWhichId< SvxBrushItem > ATTR_BACKGROUND(148)
void SetColWidth(size_t nCol, tools::Long nWidth)
const OUString & GetFamilyName() const
const SfxPoolItem * GetItem(sal_uInt16 nIndex, sal_uInt16 nWhich) const
Definition: autoform.cxx:298
void SetStyleName(const OUString &rStyleName)
constexpr TypedWhichId< SvxPostureItem > ATTR_CTL_FONT_POSTURE(119)
sal_uInt32 GetFormatIndex(SvNumberFormatter &rFormatter)
Definition: zforauto.cxx:78
bool GetIncludeFont() const
Definition: autoform.hxx:144
constexpr TypedWhichId< SvxOverlineItem > ATTR_FONT_OVERLINE(105)
SAL_DLLPRIVATE void DrawString(vcl::RenderContext &rRenderContext, size_t nCol, size_t nRow)
Definition: autofmt.cxx:181
constexpr TypedWhichId< SvxPostureItem > ATTR_CJK_FONT_POSTURE(114)
tools::Long GetHeight() const
void DrawText(const Point &_rPos)
tools::Long AdjustWidth(tools::Long n)
SAL_DLLPRIVATE void MakeFonts(vcl::RenderContext const &rRenderContext, sal_uInt16 nIndex, vcl::Font &rFont, vcl::Font &rCJKFont, vcl::Font &rCTLFont)
Definition: autofmt.cxx:109
constexpr TypedWhichId< SvxWeightItem > ATTR_FONT_WEIGHT(102)
constexpr TypedWhichId< SvxHorJustifyItem > ATTR_HOR_JUSTIFY(129)
tools::Long Height() const
Reference< XComponentContext > getProcessComponentContext()
const Color & GetWindowColor() const
tools::Long AdjustHeight(tools::Long n)
void SetCellStyleRight(size_t nCol, size_t nRow, const Style &rStyle)
SC_DLLPUBLIC bool IsLayoutRTL(SCTAB nTab) const
Definition: document.cxx:984
tools::Long GetWidth() const
void SetItalic(FontItalic)
void Set(double nP, double nD, double nS)
void setHeight(tools::Long nHeight)
virtual void SetDrawingArea(weld::DrawingArea *pDrawingArea) override
Definition: autofmt.cxx:73
#define FRAME_OFFSET
Definition: autofmt.cxx:53
bool GetIncludeValueFormat() const
Definition: autoform.hxx:143
std::unique_ptr< SvNumberFormatter > pNumFmt
Definition: autofmt.hxx:69
SAL_DLLPRIVATE void Init()
Definition: autofmt.cxx:414
SAL_DLLPRIVATE sal_uInt16 GetFormatIndex(size_t nCol, size_t nRow) const
Definition: autofmt.cxx:156
bool GetIncludeJustify() const
Definition: autoform.hxx:145
tools::Long mnRowHeight
Definition: autofmt.hxx:61
void Push(PushFlags nFlags=PushFlags::ALL)
constexpr TypedWhichId< SvxColorItem > ATTR_FONT_COLOR(109)
constexpr TypedWhichId< SvxWeightItem > ATTR_CJK_FONT_WEIGHT(113)
const editeng::SvxBorderLine * GetBottom() const
constexpr TypedWhichId< SvxLineItem > ATTR_BORDER_BLTR(142)
constexpr TypedWhichId< SvxContourItem > ATTR_FONT_CONTOUR(107)
const Color & GetWindowTextColor() const
SAL_DLLPRIVATE void DrawBackground(vcl::RenderContext &rRenderContext)
Definition: autofmt.cxx:356
SAL_DLLPRIVATE void DrawOutDev(const Point &, const Size &, const Point &, const Size &, const Printer &)=delete
const Color & GetValue() const
sal_Int16 SCTAB
Definition: types.hxx:23