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