diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2015-07-16 17:04:41 +0900 |
---|---|---|
committer | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2015-07-17 08:50:39 +0900 |
commit | 14257152b19c08618a107c6eb0f684de11483da8 (patch) | |
tree | 1c0a76e9df995e29ac66346fff4e0251a06cdc6d /sfx2 | |
parent | 53c40258d3572152b46e5ff5f51496ae6f32879b (diff) |
use search from StyleManager in "Style & Formatting"
Change-Id: I09fff1816b1d569cbfd50c7cafb19c9b169528bf
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/dialog/templdlg.cxx | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx index 9446d0bf00a7..ab25ccdae6f3 100644 --- a/sfx2/source/dialog/templdlg.cxx +++ b/sfx2/source/dialog/templdlg.cxx @@ -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 + sal_Int32 nSize = 32 * rRenderContext.GetDPIScaleFactor(); + std::unique_ptr<sfx2::StylePreviewRenderer> pStylePreviewRenderer( + pStyleManager->CreateStylePreviewRenderer(rRenderContext, pStyleSheet, nSize)); + + if (pStylePreviewRenderer) { - SvLBoxString::InitViewData( &rDevice, const_cast<SvTreeListEntry*>(&rEntry), mpViewData); - } + if (pStylePreviewRenderer->recalculate()) + { + mpViewData->maSize = pStylePreviewRenderer->getRenderSize(); + } + else + { + SvLBoxString::InitViewData( &rDevice, const_cast<SvTreeListEntry*>(&rEntry), mpViewData); + } - Rectangle aPaintRectangle = pView->GetPaintRectangle(); - bPainted = pStylePreviewRenderer->render(aPaintRectangle); + Rectangle aPaintRectangle = pView->GetPaintRectangle(); + bPainted = pStylePreviewRenderer->render(aPaintRectangle); + } } } |