diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2015-07-15 16:19:12 +0900 |
---|---|---|
committer | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2015-07-17 08:50:39 +0900 |
commit | 53c40258d3572152b46e5ff5f51496ae6f32879b (patch) | |
tree | 2fac26f4cf2c4ec39290ea70297a7129aa1d905f /sfx2/source/styles | |
parent | 76360c8de7bf6f0baef9c0440a2f721f15cc1564 (diff) |
StyleManager: move style search to its own method
And remove obsolete CreateStylePreviewRenderer method with style
name as input parameter.
Change-Id: I0fdf54fd40148b417250b5a6bf2453994eb83634
Diffstat (limited to 'sfx2/source/styles')
-rw-r--r-- | sfx2/source/styles/StyleManager.cxx | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/sfx2/source/styles/StyleManager.cxx b/sfx2/source/styles/StyleManager.cxx new file mode 100644 index 000000000000..aea80be43cfb --- /dev/null +++ b/sfx2/source/styles/StyleManager.cxx @@ -0,0 +1,38 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#include <sfx2/StyleManager.hxx> + +namespace sfx2 +{ + +SfxStyleSheetBase* StyleManager::Search(const OUString& rStyleName, SfxStyleFamily eFamily) +{ + SfxStyleSheetBasePool* pPool = mrShell.GetStyleSheetPool(); + if (!pPool) + return nullptr; + + pPool->SetSearchMask(eFamily, SFXSTYLEBIT_ALL); + SfxStyleSheetBase* pStyle = nullptr; + pStyle = pPool->First(); + + while (pStyle) + { + if (rStyleName == pStyle->GetName()) + return pStyle; + + pStyle = pPool->Next(); + } + + return nullptr; +} + +} // end namespace sfx2 + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |