Line data Source code
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 : */
10 :
11 : #include <svx/CommonStyleManager.hxx>
12 : #include <svx/CommonStylePreviewRenderer.hxx>
13 :
14 : namespace svx
15 : {
16 :
17 0 : sfx2::StylePreviewRenderer* CommonStyleManager::CreateStylePreviewRenderer(
18 : OutputDevice& rOutputDev, OUString const & rName,
19 : SfxStyleFamily eFamily, long nMaxHeight)
20 : {
21 0 : SfxStyleSheetBasePool* pPool = mrShell.GetStyleSheetPool();
22 0 : if (!pPool)
23 0 : return nullptr;
24 :
25 0 : pPool->SetSearchMask(eFamily, SFXSTYLEBIT_ALL);
26 0 : SfxStyleSheetBase* pStyle = nullptr;
27 0 : pStyle = pPool->First();
28 :
29 0 : while (pStyle)
30 : {
31 0 : if (rName == pStyle->GetName())
32 0 : return new CommonStylePreviewRenderer(mrShell, rOutputDev, pStyle, nMaxHeight);
33 0 : pStyle = pPool->Next();
34 : }
35 :
36 0 : return nullptr;
37 : }
38 :
39 : } // end svx namespace
40 :
41 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|