summaryrefslogtreecommitdiff
path: root/include/editeng/charrotateitem.hxx
diff options
context:
space:
mode:
authorTamás Zolnai <tamas.zolnai@collabora.com>2017-04-02 15:21:14 +0200
committerTamás Zolnai <tamas.zolnai@collabora.com>2017-04-02 19:11:19 +0000
commit1e30d2aface12a31687e5a27126e2061efd4b0cd (patch)
tree1f1a702a09c1996e0f0319cd039a9a4f39b08032 /include/editeng/charrotateitem.hxx
parenta52f3310a6d84fcfffcc49016bbec35bfb6ee5e8 (diff)
Add SvxTextRotateItem inherited from SvxCharRotatItem
I will be use it later for text rotation inside a table. Change-Id: I4cbaf05953b0e71331d2f3fdb45b7c4254a2b8cc Reviewed-on: https://gerrit.libreoffice.org/36021 Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com> Tested-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Diffstat (limited to 'include/editeng/charrotateitem.hxx')
-rw-r--r--include/editeng/charrotateitem.hxx56
1 files changed, 49 insertions, 7 deletions
diff --git a/include/editeng/charrotateitem.hxx b/include/editeng/charrotateitem.hxx
index fd08402b0e41..922cbdff11cb 100644
--- a/include/editeng/charrotateitem.hxx
+++ b/include/editeng/charrotateitem.hxx
@@ -22,6 +22,54 @@
#include <svl/intitem.hxx>
#include <editeng/editengdllapi.h>
+ // class SvxTextRotateItem ----------------------------------------------
+
+ /* [Description]
+
+ This item defines a text rotation value. Currently
+ text can only be rotated 90,0 and 270,0 degrees.
+
+ */
+
+class EDITENG_DLLPUBLIC SvxTextRotateItem : public SfxUInt16Item
+{
+public:
+ static SfxPoolItem* CreateDefault();
+
+ SvxTextRotateItem(sal_uInt16 nValue, const sal_uInt16 nId);
+
+ virtual SfxPoolItem* Clone(SfxItemPool *pPool = nullptr) const override;
+ virtual SfxPoolItem* Create(SvStream &, sal_uInt16) const override;
+ virtual SvStream& Store(SvStream & rStrm, sal_uInt16 nIVer) const override;
+ virtual sal_uInt16 GetVersion(sal_uInt16 nFileVersion) const override;
+
+ virtual bool GetPresentation(SfxItemPresentation ePres,
+ MapUnit eCoreMetric,
+ MapUnit ePresMetric,
+ OUString &rText,
+ const IntlWrapper * = nullptr) const override;
+
+ virtual bool QueryValue(css::uno::Any& rVal, sal_uInt8 nMemberId = 0) const override;
+ virtual bool PutValue(const css::uno::Any& rVal, sal_uInt8 nMemberId) override;
+
+ SvxTextRotateItem& operator=(const SvxTextRotateItem& rItem)
+ {
+ SetValue(rItem.GetValue());
+ return *this;
+ }
+
+ virtual bool operator==(const SfxPoolItem&) const override;
+
+ // our currently only degree values
+ void SetTopToBottom() { SetValue(2700); }
+ void SetBottomToTop() { SetValue(900); }
+ bool IsTopToBottom() const { return 2700 == GetValue(); }
+ bool IsBottomToTop() const { return 900 == GetValue(); }
+
+ void dumpAsXml(struct _xmlTextWriter* pWriter) const override;
+};
+
+
// class SvxCharRotateItem ----------------------------------------------
/* [Description]
@@ -33,7 +81,7 @@
*/
-class EDITENG_DLLPUBLIC SvxCharRotateItem : public SfxUInt16Item
+class EDITENG_DLLPUBLIC SvxCharRotateItem : public SvxTextRotateItem
{
bool bFitToLine;
public:
@@ -66,12 +114,6 @@ public:
virtual bool operator==( const SfxPoolItem& ) const override;
- // our currently only degree values
- void SetTopToBottom() { SetValue( 2700 ); }
- void SetBottomToTop() { SetValue( 900 ); }
- bool IsTopToBottom() const { return 2700 == GetValue(); }
- bool IsBottomToTop() const { return 900 == GetValue(); }
-
bool IsFitToLine() const { return bFitToLine; }
void SetFitToLine( bool b ) { bFitToLine = b; }