bump product version to 5.0.4.1
[LibreOffice.git] / svx / source / styles / CommonStyleManager.cxx
blobd452ba49748acebc666973c819461b946d7bb412
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 */
11 #include <svx/CommonStyleManager.hxx>
12 #include <svx/CommonStylePreviewRenderer.hxx>
14 namespace svx
17 sfx2::StylePreviewRenderer* CommonStyleManager::CreateStylePreviewRenderer(
18 OutputDevice& rOutputDev, OUString const & rName,
19 SfxStyleFamily eFamily, long nMaxHeight)
21 SfxStyleSheetBasePool* pPool = mrShell.GetStyleSheetPool();
22 if (!pPool)
23 return nullptr;
25 pPool->SetSearchMask(eFamily, SFXSTYLEBIT_ALL);
26 SfxStyleSheetBase* pStyle = nullptr;
27 pStyle = pPool->First();
29 while (pStyle)
31 if (rName == pStyle->GetName())
32 return new CommonStylePreviewRenderer(mrShell, rOutputDev, pStyle, nMaxHeight);
33 pStyle = pPool->Next();
36 return nullptr;
39 } // end svx namespace
41 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */