use search from StyleManager in "Style & Formatting"

Change-Id: I09fff1816b1d569cbfd50c7cafb19c9b169528bf
This commit is contained in:
Tomaž Vajngerl
2015-07-16 17:04:41 +09:00
parent 53c40258d3
commit 14257152b1

View File

@@ -132,21 +132,28 @@ void StyleLBoxString::Paint(
if (pStyleManager)
{
std::unique_ptr<sfx2::StylePreviewRenderer> pStylePreviewRenderer(pStyleManager->CreateStylePreviewRenderer(rRenderContext, GetText(), meStyleFamily, 32 * rRenderContext.GetDPIScaleFactor()));
SfxStyleSheetBase* pStyleSheet = pStyleManager->Search(GetText(), meStyleFamily);
if (pStylePreviewRenderer)
if (pStyleSheet)
{
if (pStylePreviewRenderer->recalculate())
{
mpViewData->maSize = pStylePreviewRenderer->getRenderSize();
}
else
{
SvLBoxString::InitViewData( &rDevice, const_cast<SvTreeListEntry*>(&rEntry), mpViewData);
}
sal_Int32 nSize = 32 * rRenderContext.GetDPIScaleFactor();
std::unique_ptr<sfx2::StylePreviewRenderer> pStylePreviewRenderer(
pStyleManager->CreateStylePreviewRenderer(rRenderContext, pStyleSheet, nSize));
Rectangle aPaintRectangle = pView->GetPaintRectangle();
bPainted = pStylePreviewRenderer->render(aPaintRectangle);
if (pStylePreviewRenderer)
{
if (pStylePreviewRenderer->recalculate())
{
mpViewData->maSize = pStylePreviewRenderer->getRenderSize();
}
else
{
SvLBoxString::InitViewData( &rDevice, const_cast<SvTreeListEntry*>(&rEntry), mpViewData);
}
Rectangle aPaintRectangle = pView->GetPaintRectangle();
bPainted = pStylePreviewRenderer->render(aPaintRectangle);
}
}
}