diff options
author | Tamás Zolnai <tamas.zolnai@collabora.com> | 2017-04-02 15:21:14 +0200 |
---|---|---|
committer | Tamás Zolnai <tamas.zolnai@collabora.com> | 2017-04-02 19:11:19 +0000 |
commit | 1e30d2aface12a31687e5a27126e2061efd4b0cd (patch) | |
tree | 1f1a702a09c1996e0f0319cd039a9a4f39b08032 /include/editeng | |
parent | a52f3310a6d84fcfffcc49016bbec35bfb6ee5e8 (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')
-rw-r--r-- | include/editeng/charrotateitem.hxx | 56 | ||||
-rw-r--r-- | include/editeng/editrids.hrc | 2 |
2 files changed, 51 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; } diff --git a/include/editeng/editrids.hrc b/include/editeng/editrids.hrc index d302d1ad3415..a281d1814207 100644 --- a/include/editeng/editrids.hrc +++ b/include/editeng/editrids.hrc @@ -106,6 +106,8 @@ #define RID_SVXITEMS_CHARROTATE_OFF (RID_EDIT_START + 81) #define RID_SVXITEMS_CHARROTATE (RID_EDIT_START + 82) #define RID_SVXITEMS_CHARROTATE_FITLINE (RID_EDIT_START + 83) +#define RID_SVXITEMS_TEXTROTATE_OFF (RID_EDIT_START + 84) +#define RID_SVXITEMS_TEXTROTATE (RID_EDIT_START + 89) #define RID_SVXITEMS_RELIEF_BEGIN (RID_EDIT_START + 85) #define RID_SVXITEMS_RELIEF_NONE (RID_EDIT_START + 85) |