34#include <osl/diagnose.h>
51#include <document.hxx>
79 CustomWidgetController::SetDrawingArea(pDrawingArea);
108 rFont.
SetWeight ( rWeightItem.GetValue() );
109 rFont.
SetItalic ( rPostureItem.GetValue() );
117 rFont = rCJKFont = rCTLFont = rRenderContext.
GetFont();
144#define SETONALLFONTS( MethodName, Value ) \
145rFont.MethodName( Value ); rCJKFont.MethodName( Value ); rCTLFont.MethodName( Value );
161 static const sal_uInt16 pnFmtMap[] =
174 OSL_ENSURE(
pCurData,
"ScAutoFmtPreview::GetBoxItem - no format data found" );
180 OSL_ENSURE(
pCurData,
"ScAutoFmtPreview::GetDiagItem - no format data found" );
197 const Color* pDummy =
nullptr;
202 case 1: cellString =
aStrJan;
break;
203 case 2: cellString =
aStrFeb;
break;
204 case 3: cellString =
aStrMar;
break;
206 case 10: cellString =
aStrMid;
break;
209 case 20: cellString =
aStrSum;
break;
224 nNum = 12 ==
nIndex ? 10 : 9;
227 case 9: nVal = 21; nNum = 7;
goto mknum;
228 case 14: nVal = 36; nNum = 11;
goto mknum;
229 case 19: nVal = 51; nNum = 7;
goto mknum;
230 case 21: nVal = 33; nNum = 13;
goto mknum;
231 case 22: nVal = 36; nNum = 14;
goto mknum;
232 case 23: nVal = 39; nNum = 13;
goto mknum;
233 case 24: nVal = 108; nNum = 15;
242 pNumFmt->GetOutputString(nVal, nNum, cellString, &pDummy);
246 if (cellString.isEmpty())
253 sal_uInt16 nRightX = 0;
261 eJustification =
mbRTL ? SvxCellHorJustify::Right : bJustify ?
263 SvxCellHorJustify::Standard;
270 MakeFonts(rRenderContext, nFmtIndex, aFont, aCJKFont, aCTLFont);
276 aScriptedText.
SetFonts( &aFont, &aCJKFont, &aCTLFont );
287 while((theMaxStrSize.
Width() <= aStrSize.
Width()) && (cellString.getLength() > 1))
289 if( eJustification == SvxCellHorJustify::Right )
290 cellString = cellString.copy(1);
292 cellString = cellString.copy(0, cellString.getLength() - 1 );
313 if (eJustification != SvxCellHorJustify::Standard)
318 switch (eJustification)
320 case SvxCellHorJustify::Left:
323 case SvxCellHorJustify::Right:
326 case SvxCellHorJustify::Block:
327 case SvxCellHorJustify::Repeat:
328 case SvxCellHorJustify::Center:
332 case SvxCellHorJustify::Standard:
343 if (nCol == 0 || nRow == 0)
364 for(
size_t nRow = 0; nRow < 5; ++nRow)
366 for(
size_t nCol = 0; nCol < 5; ++nCol)
381 rRenderContext.
Pop();
396 for(
size_t nRow = 0; nRow < 5; ++nRow)
397 for(
size_t nCol = 0; nCol < 5; ++nCol)
405 std::unique_ptr<drawinglayer::processor2d::BaseProcessor2D> pProcessor2D(
408 aNewViewInformation2D));
411 pProcessor2D.reset();
457 for(
size_t nRow = 0; nRow < 5; ++nRow )
459 for(
size_t nCol = 0; nCol < 5; ++nCol )
502 const Color& aBackCol =
SC_MOD()->GetColorConfig().GetColorValue( ::svtools::DOCCOLOR ).nColor;
508 aVD->SetFillColor(aBackCol);
509 aVD->SetOutputSize(aWndSize);
510 aVD->DrawRect(aRect);
520 aPos.
setX( -aPos.
X() );
522 aVD->SetDrawMode(nOldDrawMode);
523 rRenderContext.
Pop();
#define SETONALLFONTS(MethodName, Value)
static void lcl_SetFontProperties(vcl::Font &rFont, const SvxFontItem &rFontItem, const SvxWeightItem &rWeightItem, const SvxPostureItem &rPostureItem)
static void lclSetStyleFromBorder(svx::frame::Style &rStyle, const ::editeng::SvxBorderLine *pBorder)
const StyleSettings & GetStyleSettings() const
static bool GetLayoutRTL()
static const AllSettings & GetSettings()
const vcl::Font & GetFont() const
float GetDPIScaleFactor() const
void DrawRect(const tools::Rectangle &rRect)
SAL_DLLPRIVATE void DrawOutDev(const Point &, const Size &, const Point &, const Size &, const Printer &)=delete
void Push(vcl::PushFlags nFlags=vcl::PushFlags::ALL)
void setX(tools::Long nX)
tools::Long AdjustY(tools::Long nVertMove)
tools::Long AdjustX(tools::Long nHorzMove)
constexpr tools::Long X() const
SAL_DLLPRIVATE void CalcCellArray(bool bFitWidth)
virtual void SetDrawingArea(weld::DrawingArea *pDrawingArea) override
SAL_DLLPRIVATE const SvxBoxItem & GetBoxItem(size_t nCol, size_t nRow) const
ScAutoFormatData * pCurData
SAL_DLLPRIVATE void PaintCells(vcl::RenderContext &rRenderContext)
ScopedVclPtrInstance< VirtualDevice > aVD
virtual void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect) override
SAL_DLLPRIVATE sal_uInt16 GetFormatIndex(size_t nCol, size_t nRow) const
tools::Long mnLabelColWidth
SAL_DLLPRIVATE void MakeFonts(vcl::RenderContext const &rRenderContext, sal_uInt16 nIndex, vcl::Font &rFont, vcl::Font &rCJKFont, vcl::Font &rCTLFont)
virtual ~ScAutoFmtPreview() override
SAL_DLLPRIVATE void DrawBackground(vcl::RenderContext &rRenderContext)
virtual void Resize() override
SAL_DLLPRIVATE void Init()
tools::Long mnDataColWidth1
bool mbRTL
Implementation to draw the frame borders.
void NotifyChange(ScAutoFormatData *pNewData)
tools::Long mnDataColWidth2
std::unique_ptr< SvNumberFormatter > pNumFmt
svx::frame::Array maArray
SAL_DLLPRIVATE void DoPaint(vcl::RenderContext &rRenderContext)
void DetectRTL(const ScViewData &rViewData)
css::uno::Reference< css::i18n::XBreakIterator > xBreakIter
SAL_DLLPRIVATE void CalcLineMap()
SAL_DLLPRIVATE void DrawString(vcl::RenderContext &rRenderContext, size_t nCol, size_t nRow)
SAL_DLLPRIVATE const SvxLineItem & GetDiagItem(size_t nCol, size_t nRow, bool bTLBR) const
SC_DLLPUBLIC const css::uno::Reference< css::i18n::XBreakIterator > & GetBreakIterator()
SC_DLLPUBLIC bool IsLayoutRTL(SCTAB nTab) const
ScDocument & GetDocument() const
void disposeAndReset(reference_type *pBody)
constexpr tools::Long Height() const
tools::Long AdjustHeight(tools::Long n)
void setWidth(tools::Long nWidth)
tools::Long AdjustWidth(tools::Long n)
void setHeight(tools::Long nHeight)
constexpr tools::Long Width() const
const Color & GetWindowTextColor() const
const Size & GetTextSize() const
void SetText(const OUString &_rText, const css::uno::Reference< css::i18n::XBreakIterator > &_xBreakIter)
void DrawText(const Point &_rPos)
void SetFonts(vcl::Font const *_pLatinFont, vcl::Font const *_pAsianFont, vcl::Font const *_pCmplxFont)
const editeng::SvxBorderLine * GetTop() const
const editeng::SvxBorderLine * GetRight() const
const editeng::SvxBorderLine * GetLeft() const
const editeng::SvxBorderLine * GetBottom() const
const Color & GetColor() const
const Color & GetValue() const
FontFamily GetFamily() const
FontPitch GetPitch() const
const OUString & GetStyleName() const
rtl_TextEncoding GetCharSet() const
const OUString & GetFamilyName() const
void SetCellStyleBottom(sal_Int32 nCol, sal_Int32 nRow, const Style &rStyle)
void SetCellStyleTLBR(sal_Int32 nCol, sal_Int32 nRow, const Style &rStyle)
void SetCellStyleLeft(sal_Int32 nCol, sal_Int32 nRow, const Style &rStyle)
void SetCellStyleRight(sal_Int32 nCol, sal_Int32 nRow, const Style &rStyle)
void SetColWidth(sal_Int32 nCol, sal_Int32 nWidth)
void SetXOffset(sal_Int32 nXOffset)
sal_Int32 GetWidth() const
basegfx::B2DRange GetCellRange(sal_Int32 nCol, sal_Int32 nRow) const
void Initialize(sal_Int32 nWidth, sal_Int32 nHeight)
void SetYOffset(sal_Int32 nYOffset)
drawinglayer::primitive2d::Primitive2DContainer CreateB2DPrimitiveArray() const
sal_Int32 GetHeight() const
void SetAllColWidths(sal_Int32 nWidth)
void SetCellStyleBLTR(sal_Int32 nCol, sal_Int32 nRow, const Style &rStyle)
void SetAllRowHeights(sal_Int32 nHeight)
sal_Int32 GetCellIndex(sal_Int32 nCol, sal_Int32 nRow, bool bRTL) const
void SetCellStyleTop(sal_Int32 nCol, sal_Int32 nRow, const Style &rStyle)
void Set(double nP, double nD, double nS)
void SetStyleName(const OUString &rStyleName)
void SetPitch(FontPitch ePitch)
void SetTransparent(bool bTransparent)
void SetItalic(FontItalic)
void SetWeight(FontWeight)
void SetFamily(FontFamily)
void SetCharSet(rtl_TextEncoding)
const Size & GetFontSize() const
void SetFamilyName(const OUString &rFamilyName)
virtual OutputDevice & get_ref_device()=0
constexpr ::Color COL_TRANSPARENT(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
B2IRange fround(const B2DRange &rRange)
Reference< XComponentContext > getProcessComponentContext()
std::unique_ptr< BaseProcessor2D > createPixelProcessor2DFromOutputDevice(OutputDevice &rTargetOutDev, const drawinglayer::geometry::ViewInformation2D &rViewInformation2D)
constexpr Point convert(const Point &rPoint, o3tl::Length eFrom, o3tl::Length eTo)
OUString ScResId(TranslateId aId)
constexpr TypedWhichId< SvxFontItem > ATTR_CJK_FONT(111)
constexpr TypedWhichId< SvxPostureItem > ATTR_CTL_FONT_POSTURE(119)
constexpr TypedWhichId< SvxFontItem > ATTR_CTL_FONT(116)
constexpr TypedWhichId< SvxPostureItem > ATTR_FONT_POSTURE(103)
constexpr TypedWhichId< SvxWeightItem > ATTR_FONT_WEIGHT(102)
constexpr TypedWhichId< SvxColorItem > ATTR_FONT_COLOR(109)
constexpr TypedWhichId< SvxWeightItem > ATTR_CJK_FONT_WEIGHT(113)
constexpr TypedWhichId< SvxLineItem > ATTR_BORDER_TLBR(141)
constexpr TypedWhichId< SvxShadowedItem > ATTR_FONT_SHADOWED(108)
constexpr TypedWhichId< SvxContourItem > ATTR_FONT_CONTOUR(107)
constexpr TypedWhichId< SvxBrushItem > ATTR_BACKGROUND(148)
constexpr TypedWhichId< SvxOverlineItem > ATTR_FONT_OVERLINE(105)
constexpr TypedWhichId< SvxHorJustifyItem > ATTR_HOR_JUSTIFY(129)
constexpr TypedWhichId< SvxBoxItem > ATTR_BORDER(150)
constexpr TypedWhichId< SvxCrossedOutItem > ATTR_FONT_CROSSEDOUT(106)
constexpr TypedWhichId< SvxLineItem > ATTR_BORDER_BLTR(142)
constexpr TypedWhichId< SvxFontItem > ATTR_FONT(100)
constexpr TypedWhichId< SvxWeightItem > ATTR_CTL_FONT_WEIGHT(118)
constexpr TypedWhichId< SvxPostureItem > ATTR_CJK_FONT_POSTURE(114)
constexpr TypedWhichId< SvxUnderlineItem > ATTR_FONT_UNDERLINE(104)