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  return;
112 
113  rFont = rCJKFont = rCTLFont = rRenderContext.GetFont();
114  Size aFontSize(rFont.GetFontSize().Width(), 10 * rRenderContext.GetDPIScaleFactor());
115 
116  const SvxFontItem* pFontItem = pCurData->GetItem( nIndex, ATTR_FONT );
117  const SvxWeightItem* pWeightItem = pCurData->GetItem( nIndex, ATTR_FONT_WEIGHT );
118  const SvxPostureItem* pPostureItem = pCurData->GetItem( nIndex, ATTR_FONT_POSTURE );
119  const SvxFontItem* pCJKFontItem = pCurData->GetItem( nIndex, ATTR_CJK_FONT );
120  const SvxWeightItem* pCJKWeightItem = pCurData->GetItem( nIndex, ATTR_CJK_FONT_WEIGHT );
121  const SvxPostureItem* pCJKPostureItem = pCurData->GetItem( nIndex, ATTR_CJK_FONT_POSTURE );
122  const SvxFontItem* pCTLFontItem = pCurData->GetItem( nIndex, ATTR_CTL_FONT );
123  const SvxWeightItem* pCTLWeightItem = pCurData->GetItem( nIndex, ATTR_CTL_FONT_WEIGHT );
124  const SvxPostureItem* pCTLPostureItem = pCurData->GetItem( nIndex, ATTR_CTL_FONT_POSTURE );
125  const SvxUnderlineItem* pUnderlineItem = pCurData->GetItem( nIndex, ATTR_FONT_UNDERLINE );
126  const SvxOverlineItem* pOverlineItem = pCurData->GetItem( nIndex, ATTR_FONT_OVERLINE );
127  const SvxCrossedOutItem* pCrossedOutItem = pCurData->GetItem( nIndex, ATTR_FONT_CROSSEDOUT );
128  const SvxContourItem* pContourItem = pCurData->GetItem( nIndex, ATTR_FONT_CONTOUR );
129  const SvxShadowedItem* pShadowedItem = pCurData->GetItem( nIndex, ATTR_FONT_SHADOWED );
130  const SvxColorItem* pColorItem = pCurData->GetItem( nIndex, ATTR_FONT_COLOR );
131 
132  lcl_SetFontProperties( rFont, *pFontItem, *pWeightItem, *pPostureItem );
133  lcl_SetFontProperties( rCJKFont, *pCJKFontItem, *pCJKWeightItem, *pCJKPostureItem );
134  lcl_SetFontProperties( rCTLFont, *pCTLFontItem, *pCTLWeightItem, *pCTLPostureItem );
135 
136  Color aColor( pColorItem->GetValue() );
137  if( aColor == COL_TRANSPARENT )
139 
140 #define SETONALLFONTS( MethodName, Value ) \
141 rFont.MethodName( Value ); rCJKFont.MethodName( Value ); rCTLFont.MethodName( Value );
142 
143  SETONALLFONTS( SetUnderline, pUnderlineItem->GetValue() )
144  SETONALLFONTS( SetOverline, pOverlineItem->GetValue() )
145  SETONALLFONTS( SetStrikeout, pCrossedOutItem->GetValue() )
146  SETONALLFONTS( SetOutline, pContourItem->GetValue() )
147  SETONALLFONTS( SetShadow, pShadowedItem->GetValue() )
148  SETONALLFONTS( SetColor, aColor )
149  SETONALLFONTS( SetFontSize, aFontSize )
150  SETONALLFONTS( SetTransparent, true )
151 
152 #undef SETONALLFONTS
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  const 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  return;
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 #undef FRAME_OFFSET
354 
356 {
357  if (!pCurData)
358  return;
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 
383 {
384  if (!pCurData)
385  return;
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  return;
399 
400  const drawinglayer::geometry::ViewInformation2D aNewViewInformation2D;
401  std::unique_ptr<drawinglayer::processor2d::BaseProcessor2D> pProcessor2D(
403  rRenderContext,
404  aNewViewInformation2D));
405 
406  if (pProcessor2D)
407  {
408  pProcessor2D->process(maArray.CreateB2DPrimitiveArray());
409  pProcessor2D.reset();
410  }
411 }
412 
414 {
415  maArray.Initialize( 5, 5 );
416  mnLabelColWidth = 0;
417  mnDataColWidth1 = 0;
418  mnDataColWidth2 = 0;
419  mnRowHeight = 0;
420  CalcCellArray( false );
421  CalcLineMap();
422 }
423 
425 {
426  SCTAB nCurrentTab = pViewData->GetTabNo();
427  ScDocument& rDoc = pViewData->GetDocument();
428  mbRTL = rDoc.IsLayoutRTL(nCurrentTab);
429  xBreakIter = rDoc.GetBreakIterator();
430 }
431 
432 void ScAutoFmtPreview::CalcCellArray( bool bFitWidthP )
433 {
434  maArray.SetXOffset( 2 );
438 
439  maArray.SetYOffset( 2 );
441 
444 }
445 
446 static void lclSetStyleFromBorder( svx::frame::Style& rStyle, const ::editeng::SvxBorderLine* pBorder )
447 {
448  rStyle.Set( pBorder, 1.0 / TWIPS_PER_POINT, 5 );
449 }
450 
452 {
453  if ( !pCurData )
454  return;
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 
481 {
482  if (pNewData)
483  {
484  pCurData = pNewData;
485  bFitWidth = pNewData->GetIncludeWidthHeight();
486  }
487 
489  CalcLineMap();
490 
491  Invalidate();
492 }
493 
495 {
496  rRenderContext.Push(PushFlags::ALL);
497  DrawModeFlags nOldDrawMode = aVD->GetDrawMode();
498 
499  Size aWndSize(GetOutputSizePixel());
500  vcl::Font aFont(aVD->GetFont());
501  Color aBackCol(rRenderContext.GetSettings().GetStyleSettings().GetWindowColor());
502  tools::Rectangle aRect(Point(), aWndSize);
503 
504  aFont.SetTransparent( true );
505  aVD->SetFont(aFont);
506  aVD->SetLineColor();
507  aVD->SetFillColor(aBackCol);
508  aVD->SetOutputSize(aWndSize);
509  aVD->DrawRect(aRect);
510 
511  PaintCells(*aVD);
512 
513  rRenderContext.SetLineColor();
514  rRenderContext.SetFillColor(aBackCol);
515  rRenderContext.DrawRect(aRect);
516 
517  Point aPos((aWndSize.Width() - aPrvSize.Width()) / 2, (aWndSize.Height() - aPrvSize.Height()) / 2);
519  aPos.setX( -aPos.X() );
520  rRenderContext.DrawOutDev(aPos, aWndSize, Point(), aWndSize, *aVD);
521  aVD->SetDrawMode(nOldDrawMode);
522  rRenderContext.Pop();
523 }
524 
525 void ScAutoFmtPreview::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& /*rRect*/)
526 {
527  DoPaint(rRenderContext);
528 }
529 
530 /* 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
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)
void setWidth(tools::Long nWidth)
DrawModeFlags
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
ScDocument & GetDocument() const
Definition: viewdata.hxx:380
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)
const OUString aStrNorth
Definition: autofmt.hxx:65
FontFamily GetFamily() const
long GetWidth() const
Size const & GetOutputSizePixel() const
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)
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: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:480
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:432
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:494
SAL_DLLPRIVATE void CalcLineMap()
Definition: autofmt.cxx:451
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:85
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:95
static bool GetLayoutRTL()
void DetectRTL(const ScViewData *pViewData)
Definition: autofmt.cxx:424
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:382
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:446
tools::Long mnDataColWidth2
Definition: autofmt.hxx:60
float GetDPIScaleFactor() const
bool GetIncludeFrame() const
Definition: autoform.hxx:146
virtual ~ScAutoFmtPreview() override
Definition: autofmt.cxx:89
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:525
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)
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)
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:108
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:994
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: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:413
SAL_DLLPRIVATE sal_uInt16 GetFormatIndex(size_t nCol, size_t nRow) const
Definition: autofmt.cxx:155
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:355
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