summaryrefslogtreecommitdiff
path: root/sc/source/ui
diff options
context:
space:
mode:
authorVikas <vikasmahato0@gmail.com>2018-06-29 13:52:02 +0530
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2018-07-02 23:42:58 +0200
commitcb875f3ef1aa14b931131c4c0ddc595e3841273d (patch)
tree52a820a82e377e74bfc5425c70780a94ed611a03 /sc/source/ui
parentb7a02f2bb66b990289eb7f4dc80069d1545179a4 (diff)
Export data transformations to odf
Change-Id: Ie36aef4a4ee550a1bb5407305f13726d55eeea58 Reviewed-on: https://gerrit.libreoffice.org/56665 Tested-by: Jenkins Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Diffstat (limited to 'sc/source/ui')
-rw-r--r--sc/source/ui/dataprovider/datatransformation.cxx50
-rw-r--r--sc/source/ui/inc/datatransformation.hxx22
2 files changed, 70 insertions, 2 deletions
diff --git a/sc/source/ui/dataprovider/datatransformation.cxx b/sc/source/ui/dataprovider/datatransformation.cxx
index bbb9bd068c7f..09370a8e82c7 100644
--- a/sc/source/ui/dataprovider/datatransformation.cxx
+++ b/sc/source/ui/dataprovider/datatransformation.cxx
@@ -43,6 +43,16 @@ void ColumnRemoveTransformation::Transform(ScDocument& rDoc) const
}
}
+TransformationType ColumnRemoveTransformation::getTransformationType() const
+{
+ return TransformationType::DELETE_TRANSFORMATION;
+}
+
+std::set<SCCOL> ColumnRemoveTransformation::getColumns() const
+{
+ return maColumns;
+}
+
SplitColumnTransformation::SplitColumnTransformation(SCCOL nCol, sal_Unicode cSeparator):
mnCol(nCol),
mcSeparator(cSeparator)
@@ -71,6 +81,21 @@ void SplitColumnTransformation::Transform(ScDocument& rDoc) const
}
}
+TransformationType SplitColumnTransformation::getTransformationType() const
+{
+ return TransformationType::SPLIT_TRANSFORMATION;
+}
+
+SCCOL SplitColumnTransformation::getColumn() const
+{
+ return mnCol;
+}
+
+sal_Unicode SplitColumnTransformation::getSeparator() const
+{
+ return mcSeparator;
+}
+
MergeColumnTransformation::MergeColumnTransformation(const std::set<SCCOL>& rColumns, const OUString& rMergeString):
maColumns(rColumns),
maMergeString(rMergeString)
@@ -113,6 +138,21 @@ void MergeColumnTransformation::Transform(ScDocument& rDoc) const
}
}
+TransformationType MergeColumnTransformation::getTransformationType() const
+{
+ return TransformationType::MERGE_TRANSFORMATION;
+}
+
+OUString MergeColumnTransformation::getMergeString() const
+{
+ return maMergeString;
+}
+
+std::set<SCCOL> MergeColumnTransformation::getColumns() const
+{
+ return maColumns;
+}
+
SortTransformation::SortTransformation(const ScSortParam& rSortParam):
maSortParam(rSortParam)
{
@@ -123,6 +163,16 @@ void SortTransformation::Transform(ScDocument& rDoc) const
rDoc.Sort(0, maSortParam, false, false, nullptr, nullptr);
}
+TransformationType SortTransformation::getTransformationType() const
+{
+ return TransformationType::SORT_TRANSFORMATION;
+}
+
+ScSortParam SortTransformation::getSortParam() const
+{
+ return maSortParam;
+}
+
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/datatransformation.hxx b/sc/source/ui/inc/datatransformation.hxx
index 251397ca8304..8dbae9600384 100644
--- a/sc/source/ui/inc/datatransformation.hxx
+++ b/sc/source/ui/inc/datatransformation.hxx
@@ -21,6 +21,14 @@ class ScDocument;
namespace sc {
+enum class TransformationType
+{
+ MERGE_TRANSFORMATION,
+ SPLIT_TRANSFORMATION,
+ DELETE_TRANSFORMATION,
+ SORT_TRANSFORMATION
+};
+
class SC_DLLPUBLIC DataTransformation
{
protected:
@@ -32,6 +40,8 @@ public:
virtual void Transform(ScDocument& rDoc) const = 0;
+ virtual TransformationType getTransformationType() const = 0;
+
};
class SC_DLLPUBLIC ColumnRemoveTransformation : public DataTransformation
@@ -42,8 +52,9 @@ public:
ColumnRemoveTransformation(const std::set<SCCOL>& rColumns);
virtual ~ColumnRemoveTransformation() override;
-
virtual void Transform(ScDocument& rDoc) const override;
+ virtual TransformationType getTransformationType() const override;
+ std::set<SCCOL> getColumns() const;
};
class SC_DLLPUBLIC SplitColumnTransformation : public DataTransformation
@@ -55,6 +66,9 @@ public:
SplitColumnTransformation(SCCOL nCol, sal_Unicode cSeparator);
virtual void Transform(ScDocument& rDoc) const override;
+ virtual TransformationType getTransformationType() const override;
+ SCCOL getColumn() const;
+ sal_Unicode getSeparator() const;
};
class SC_DLLPUBLIC MergeColumnTransformation : public DataTransformation
@@ -66,6 +80,9 @@ public:
MergeColumnTransformation(const std::set<SCCOL>& rColumns, const OUString& rMergeString);
virtual void Transform(ScDocument& rDoc) const override;
+ virtual TransformationType getTransformationType() const override;
+ OUString getMergeString() const;
+ std::set<SCCOL> getColumns() const;
};
class SC_DLLPUBLIC SortTransformation : public DataTransformation
@@ -74,8 +91,9 @@ class SC_DLLPUBLIC SortTransformation : public DataTransformation
public:
SortTransformation(const ScSortParam& rParam);
-
virtual void Transform(ScDocument& rDoc) const override;
+ virtual TransformationType getTransformationType() const override;
+ ScSortParam getSortParam() const;
};
}