diff options
author | Kohei Yoshida <kohei.yoshida@gmail.com> | 2013-08-20 14:56:27 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@gmail.com> | 2013-08-20 22:57:13 -0400 |
commit | 9ca5e3da5ca5f68ced1917cf38773fd1060bede4 (patch) | |
tree | d59714e40989117ffd3a1be176227e07aea926a6 /include/editeng | |
parent | 239696d95a0f6f1407e85f3d58901ee0b9ae3aee (diff) |
Add a means to retrieve all formatting attributes in non-overlapping sections.
Change-Id: Id04dffc135fad6bb66ea157cd280dd481cb80117
Diffstat (limited to 'include/editeng')
-rw-r--r-- | include/editeng/editobj.hxx | 13 | ||||
-rw-r--r-- | include/editeng/sectionattribute.hxx | 37 |
2 files changed, 50 insertions, 0 deletions
diff --git a/include/editeng/editobj.hxx b/include/editeng/editobj.hxx index 570615f5e254..c61f682672da 100644 --- a/include/editeng/editobj.hxx +++ b/include/editeng/editobj.hxx @@ -45,6 +45,7 @@ namespace editeng { class FieldUpdater; class FieldUpdaterImpl; +struct SectionAttribute; } @@ -99,6 +100,18 @@ public: bool RemoveCharAttribs( sal_uInt16 nWhich = 0 ); + /** + * Get all attributes that are applied to this content, separated by + * sections. If multiple attributes are applied to the same section, the + * object representing that section will store multiple attributes. + * Sections never overlap each other; if an attribute was applied to [0-6] + * and another applied to [3-10], you would get 3 sections that are [0-3], + * [3-6] and [6-10]. + * + * <p>Note that this method skips field attributes.</p> + */ + void GetAllSectionAttributes( std::vector<editeng::SectionAttribute>& rAttrs ) const; + bool IsFieldObject() const; const SvxFieldItem* GetField() const; const SvxFieldData* GetFieldData(sal_Int32 nPara, size_t nPos, sal_Int32 nType) const; diff --git a/include/editeng/sectionattribute.hxx b/include/editeng/sectionattribute.hxx new file mode 100644 index 000000000000..eafd4e2e320c --- /dev/null +++ b/include/editeng/sectionattribute.hxx @@ -0,0 +1,37 @@ +/* -*- 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/. + */ + +#ifndef EDITENG_SECTIONATTRIBUTE_HXX +#define EDITENG_SECTIONATTRIBUTE_HXX + +#include "editeng/editengdllapi.h" + +#include <vector> + +class SfxPoolItem; + +namespace editeng { + +struct EDITENG_DLLPUBLIC SectionAttribute +{ + size_t mnParagraph; + size_t mnStart; + size_t mnEnd; + + std::vector<const SfxPoolItem*> maAttributes; + + SectionAttribute(); + SectionAttribute(size_t nPara, size_t nStart, size_t nEnd); +}; + +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |