summaryrefslogtreecommitdiff
path: root/sw/inc/tblafmt.hxx
diff options
context:
space:
mode:
authorJakub Trzebiatowski <ubap.dev@gmail.com>2016-06-07 21:57:49 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-06-13 10:48:55 +0000
commit3464befb48ccf1bf9ad4c8f321c7342db43c4019 (patch)
tree3575268ef66e0490cde203d5162a31002fb7ed64 /sw/inc/tblafmt.hxx
parent8d51397bfd98615e74e116582a50e29846ecb76e (diff)
GSoC Table Styles, CellStyle
- insertByName - replaceByName - removeByName Change-Id: I964aa0dc2e7f5a5be9eaec719b8944e847eb9d6a Reviewed-on: https://gerrit.libreoffice.org/26037 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'sw/inc/tblafmt.hxx')
-rw-r--r--sw/inc/tblafmt.hxx31
1 files changed, 31 insertions, 0 deletions
diff --git a/sw/inc/tblafmt.hxx b/sw/inc/tblafmt.hxx
index 9e5f4a3be183..6ed138d72ec8 100644
--- a/sw/inc/tblafmt.hxx
+++ b/sw/inc/tblafmt.hxx
@@ -344,6 +344,37 @@ public:
bool Save() const;
};
+class SwCellStyleDescriptor
+{
+ const std::pair<OUString, SwBoxAutoFormat*>& m_rCellStyleDesc;
+public:
+ SwCellStyleDescriptor(const std::pair<OUString, SwBoxAutoFormat*>& rCellStyleDesc) : m_rCellStyleDesc(rCellStyleDesc) { }
+
+ const OUString& GetName() { return m_rCellStyleDesc.first; }
+ SwBoxAutoFormat* GetFormat() { return m_rCellStyleDesc.second; }
+};
+
+class SwCellStyleTable
+{
+ std::vector<std::pair<OUString, SwBoxAutoFormat*>> m_aCellStyles;
+public:
+ SwCellStyleTable();
+ ~SwCellStyleTable();
+
+ size_t size() const;
+ SwCellStyleDescriptor operator[](size_t i) const;
+ void clear();
+
+ /// Add a copy of rBoxFormat
+ void AddBoxFormat(const SwBoxAutoFormat& rBoxFormat, const OUString& sName);
+ void RemoveBoxFormat(const OUString& sName);
+ void ChangeBoxFormatName(const OUString& sFromName, const OUString& sToName);
+ /// If found returns its name. If not found returns an empty OUString
+ OUString GetBoxFormatName(const SwBoxAutoFormat& rBoxFormat) const;
+ /// If found returns a ptr to a BoxFormat. If not found returns nullptr
+ SwBoxAutoFormat* GetBoxFormat(const OUString& sName) const;
+};
+
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */